prefect 3.6.15__py3-none-any.whl → 3.6.16.dev3__py3-none-any.whl
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.
- prefect/__init__.py +20 -0
- prefect/_build_info.py +3 -3
- prefect/_internal/analytics/__init__.py +80 -0
- prefect/_internal/analytics/_config.py +2 -0
- prefect/_internal/analytics/ci_detection.py +39 -0
- prefect/_internal/analytics/client.py +132 -0
- prefect/_internal/analytics/device_id.py +55 -0
- prefect/_internal/analytics/emit.py +90 -0
- prefect/_internal/analytics/enabled.py +33 -0
- prefect/_internal/analytics/events.py +14 -0
- prefect/_internal/analytics/milestones.py +177 -0
- prefect/_internal/analytics/notice.py +60 -0
- prefect/_internal/analytics/service.py +238 -0
- prefect/analytics/__init__.py +67 -0
- prefect/deployments/runner.py +20 -0
- prefect/flow_engine.py +16 -0
- prefect/flows.py +8 -0
- prefect/logging/formatters.py +24 -1
- prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js → artifact-card-BclosG8t.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js.map → artifact-card-BclosG8t.js.map} +1 -1
- prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js +2 -0
- prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js.map +1 -0
- prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js → automation-wizard-Bmgt6nn8.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js.map → automation-wizard-Bmgt6nn8.js.map} +1 -1
- prefect/server/ui-v2/assets/automation._id-Ccke3KJz.js +2 -0
- prefect/server/ui-v2/assets/{automation._id-Dn7jABys.js.map → automation._id-Ccke3KJz.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js → automation_._id.edit-BlKPUTVf.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js.map → automation_._id.edit-BlKPUTVf.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js → automations-header-Df2zw3SC.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js.map → automations-header-Df2zw3SC.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js → base-job-template-form-section-oZD6U-RW.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js.map → base-job-template-form-section-oZD6U-RW.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js → block-type-details-CYrdaLot.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js.map → block-type-details-CYrdaLot.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js +2 -0
- prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js.map +1 -0
- prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js → block._id-CBgHrpTP.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js.map → block._id-CBgHrpTP.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js → block_._id.edit-CW-kdi4O.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js.map → block_._id.edit-CW-kdi4O.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js → catalog-Brh0kn1I.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js.map → catalog-Brh0kn1I.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog_._slug-MCgzguIZ.js +2 -0
- prefect/server/ui-v2/assets/{catalog_._slug-Bl2J2oI3.js.map → catalog_._slug-MCgzguIZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js → catalog_._slug_.create-DBaeHi9Q.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js.map → catalog_._slug_.create-DBaeHi9Q.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js → collapsible-B_NJS0uJ.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js.map → collapsible-B_NJS0uJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js → concurrency-limit._id-qzNUQzQa.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js.map → concurrency-limit._id-qzNUQzQa.js.map} +1 -1
- prefect/server/ui-v2/assets/create-BwXG6EIb.js +2 -0
- prefect/server/ui-v2/assets/{create-D--LHaji.js.map → create-BwXG6EIb.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-BycfZHGQ.js → create-MoiIE9Ms.js} +2 -2
- prefect/server/ui-v2/assets/{create-BycfZHGQ.js.map → create-MoiIE9Ms.js.map} +1 -1
- prefect/server/ui-v2/assets/data-table-CPkppyg6.js +2 -0
- prefect/server/ui-v2/assets/data-table-CPkppyg6.js.map +1 -0
- prefect/server/ui-v2/assets/delete-confirmation-dialog-CwDK_2QS.js +2 -0
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-DHkm2p8m.js.map → delete-confirmation-dialog-CwDK_2QS.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js → deployment-action-header-Vp9YsCJO.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js.map → deployment-action-header-Vp9YsCJO.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js → deployment-form-CJcg_6DJ.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js.map → deployment-form-CJcg_6DJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js → deployment-links-CIkJIuHh.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js.map → deployment-links-CIkJIuHh.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment._id-C6XrGMp_.js +2 -0
- prefect/server/ui-v2/assets/{deployment._id-Ci9zge5n.js.map → deployment._id-C6XrGMp_.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js → deployment._id-CWgTYmTG.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js.map → deployment._id-CWgTYmTG.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-Bg0s0ZJn.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-D9ZWkh8H.js.map → deployment_._id.duplicate-Bg0s0ZJn.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-CnoB0UeG.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-CS7sObzC.js.map → deployment_._id.edit-CnoB0UeG.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js → deployment_._id.run-BqPK6rTB.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js.map → deployment_._id.run-BqPK6rTB.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js → dropdown-menu-D7Gwbd15.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js.map → dropdown-menu-D7Gwbd15.js.map} +1 -1
- prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js → event-resource-display-CDRgVKd4.js} +2 -2
- prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js.map → event-resource-display-CDRgVKd4.js.map} +1 -1
- prefect/server/ui-v2/assets/event._eventDate._eventId-C73GMDkK.js +2 -0
- prefect/server/ui-v2/assets/{event._eventDate._eventId-D7Twzb22.js.map → event._eventDate._eventId-C73GMDkK.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js → flow-run-graph-ckiE3mA9.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js.map → flow-run-graph-ckiE3mA9.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js → flow-run._id-BukrNCAq.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js.map → flow-run._id-BukrNCAq.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js → flow-run._id-CtI5VZ2M.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js.map → flow-run._id-CtI5VZ2M.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-s1UJuakA.js +4 -0
- prefect/server/ui-v2/assets/{flow-run._id-RLy2kBh0.js.map → flow-run._id-s1UJuakA.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js → flow-runs-pagination-SLbYtvaR.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js.map → flow-runs-pagination-SLbYtvaR.js.map} +1 -1
- prefect/server/ui-v2/assets/flow._id-CZ5P0v4N.js +2 -0
- prefect/server/ui-v2/assets/{flow._id-BdQGWPKP.js.map → flow._id-CZ5P0v4N.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-DLrbC7rV.js → form-mws4law8.js} +2 -2
- prefect/server/ui-v2/assets/{form-DLrbC7rV.js.map → form-mws4law8.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-BTAWyeXv.js → header-Bes1LmY7.js} +2 -2
- prefect/server/ui-v2/assets/{header-BTAWyeXv.js.map → header-Bes1LmY7.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-ChFAx5uR.js → header-Bj_zBR-a.js} +2 -2
- prefect/server/ui-v2/assets/{header-ChFAx5uR.js.map → header-Bj_zBR-a.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-CyQqOj1w.js → header-CPxTHSvz.js} +2 -2
- prefect/server/ui-v2/assets/{header-CyQqOj1w.js.map → header-CPxTHSvz.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-m48E4KcG.js → index-B8vo2Lrg.js} +5 -5
- prefect/server/ui-v2/assets/{index-m48E4KcG.js.map → index-B8vo2Lrg.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D5RT-SAp.js → index-BBeh-3Nh.js} +2 -2
- prefect/server/ui-v2/assets/{index-D5RT-SAp.js.map → index-BBeh-3Nh.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BLnEvHia.js +2 -0
- prefect/server/ui-v2/assets/{index-7i4X9TeK.js.map → index-BLnEvHia.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BpKoubXu.js +2 -0
- prefect/server/ui-v2/assets/index-BpKoubXu.js.map +1 -0
- prefect/server/ui-v2/assets/index-By6YGqR3.js +2 -0
- prefect/server/ui-v2/assets/index-By6YGqR3.js.map +1 -0
- prefect/server/ui-v2/assets/index-CEi3BlKI.js +2 -0
- prefect/server/ui-v2/assets/index-CEi3BlKI.js.map +1 -0
- prefect/server/ui-v2/assets/{index-BaWDC4da.js → index-CS-zxv7Z.js} +2 -2
- prefect/server/ui-v2/assets/{index-BaWDC4da.js.map → index-CS-zxv7Z.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-kP_I5Qfd.js → index-CToHKh4q.js} +2 -2
- prefect/server/ui-v2/assets/{index-kP_I5Qfd.js.map → index-CToHKh4q.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CKGj5lSu.js → index-CUVvZndW.js} +2 -2
- prefect/server/ui-v2/assets/{index-CKGj5lSu.js.map → index-CUVvZndW.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CxUfZRkN.js → index-CYVn-I3i.js} +2 -2
- prefect/server/ui-v2/assets/{index-CxUfZRkN.js.map → index-CYVn-I3i.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CnlN-VC_.js → index-Cun0JN4t.js} +2 -2
- prefect/server/ui-v2/assets/{index-CnlN-VC_.js.map → index-Cun0JN4t.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BwCLKpNb.js → index-D6ynV6U7.js} +2 -2
- prefect/server/ui-v2/assets/{index-BwCLKpNb.js.map → index-D6ynV6U7.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CHf6xi9j.js → index-DdNUJLRW.js} +2 -2
- prefect/server/ui-v2/assets/{index-CHf6xi9j.js.map → index-DdNUJLRW.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CQnWiUE5.js → index-DlHOXQhu.js} +2 -2
- prefect/server/ui-v2/assets/{index-CQnWiUE5.js.map → index-DlHOXQhu.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js → index-DyVw8YE8.js} +2 -2
- prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js.map → index-DyVw8YE8.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Btb_-PDp.js → index-DzRz7D2P.js} +2 -2
- prefect/server/ui-v2/assets/{index-Btb_-PDp.js.map → index-DzRz7D2P.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DQGif3jm.js → index-DzUcVNZg.js} +2 -2
- prefect/server/ui-v2/assets/{index-DQGif3jm.js.map → index-DzUcVNZg.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DNh9ZBy4.js → index-IBvMMs6S.js} +2 -2
- prefect/server/ui-v2/assets/{index-DNh9ZBy4.js.map → index-IBvMMs6S.js.map} +1 -1
- prefect/server/ui-v2/assets/index-_kpA__te.js +2 -0
- prefect/server/ui-v2/assets/{index-CiSFHkhI.js.map → index-_kpA__te.js.map} +1 -1
- prefect/server/ui-v2/assets/index-m9O-nIOl.css +1 -0
- prefect/server/ui-v2/assets/{index-lyQav_XM.js → index-wOvyf10b.js} +2 -2
- prefect/server/ui-v2/assets/{index-lyQav_XM.js.map → index-wOvyf10b.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js → json-input-Ce-HlRqa.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js.map → json-input-Ce-HlRqa.js.map} +1 -1
- prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js → key-value-XHEZOtZX.js} +2 -2
- prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js.map → key-value-XHEZOtZX.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js → key._key-LpsMf3zD.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js.map → key._key-LpsMf3zD.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js → lazy-markdown-1Hz0xzca.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js.map → lazy-markdown-1Hz0xzca.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-DxMF9Jvj.js → login-D5uepl9L.js} +2 -2
- prefect/server/ui-v2/assets/{login-DxMF9Jvj.js.map → login-D5uepl9L.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js → markdown-input-CG6M9zD0.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js.map → markdown-input-CG6M9zD0.js.map} +1 -1
- prefect/server/ui-v2/assets/python-example-snippet-DRHcUlCX.js +3 -0
- prefect/server/ui-v2/assets/{python-example-snippet-DfCFYPN_.js.map → python-example-snippet-DRHcUlCX.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-mr6GD840.js → python-input-BsUS8fw1.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-mr6GD840.js.map → python-input-BsUS8fw1.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js → radio-group-BUsmwdrt.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js.map → radio-group-BUsmwdrt.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js → route-error-state-BFBpiIhD.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js.map → route-error-state-BFBpiIhD.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-CWDHSME9.js → schema-form-BwTmkvJk.js} +2 -2
- prefect/server/ui-v2/assets/schema-form-BwTmkvJk.js.map +1 -0
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js → schema-form-input-string-format-datetime-nrb3g-JJ.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js.map → schema-form-input-string-format-datetime-nrb3g-JJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-DU5y6tJE.js → settings-CUBtK5aW.js} +2 -2
- prefect/server/ui-v2/assets/{settings-DU5y6tJE.js.map → settings-CUBtK5aW.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js → sort-filter-Cv8zAXMp.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js.map → sort-filter-Cv8zAXMp.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-bBL6C0ZK.js → table-BBNGfPra.js} +2 -2
- prefect/server/ui-v2/assets/{table-bBL6C0ZK.js.map → table-BBNGfPra.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js → tags-input-DHrnkwjQ.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js.map → tags-input-DHrnkwjQ.js.map} +1 -1
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js +2 -0
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-S69sih55.js.map → task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js → task-run._id-BY58gqs2.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js.map → task-run._id-BY58gqs2.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js → task-run._id-u73Jxfqw.js} +3 -3
- prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js.map → task-run._id-u73Jxfqw.js.map} +1 -1
- prefect/server/ui-v2/assets/task-runs-pagination-DUy3147A.js +2 -0
- prefect/server/ui-v2/assets/{task-runs-pagination-VdR-LO4r.js.map → task-runs-pagination-DUy3147A.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js → textarea-DUhh6-kq.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js.map → textarea-DUhh6-kq.js.map} +1 -1
- prefect/server/ui-v2/assets/timezone-select-D4Q6VBtD.js +2 -0
- prefect/server/ui-v2/assets/{timezone-select-BuPYznge.js.map → timezone-select-D4Q6VBtD.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js → toggle-group-7WUJn2Tx.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js.map → toggle-group-7WUJn2Tx.js.map} +1 -1
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-D4AD5Ndf.js +2 -0
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DpdsLH4t.js.map → use-delete-automation-confirmation-dialog-D4AD5Ndf.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js → use-delete-block-document-confirmation-dialog-DnwWEGUY.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js.map → use-delete-block-document-confirmation-dialog-DnwWEGUY.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js → use-flow-runs-selected-rows-C-tehPRB.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js.map → use-flow-runs-selected-rows-C-tehPRB.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js → use-get-artifacts-flow-task-runs-DRWRrmrb.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js.map → use-get-artifacts-flow-task-runs-DRWRrmrb.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js → use-quick-run-B4Xj-YQQ.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js.map → use-quick-run-B4Xj-YQQ.js.map} +1 -1
- prefect/server/ui-v2/assets/use-state-favicon-au2TZdMV.js +2 -0
- prefect/server/ui-v2/assets/{use-state-favicon-M09DmrNy.js.map → use-state-favicon-au2TZdMV.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js → use-stepper-DyIb3vlq.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js.map → use-stepper-DyIb3vlq.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js → utilities-D9Y2wo66.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js.map → utilities-D9Y2wo66.js.map} +1 -1
- prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js +34 -0
- prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js.map +1 -0
- prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js → work-pool-filter-CSOATj2D.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js.map → work-pool-filter-CSOATj2D.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-Dh7B1zMo.js +2 -0
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-BQ9b-Wxy.js.map → work-pool-queue-toggle-Dh7B1zMo.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool._workPoolName-B_NFWXKS.js +2 -0
- prefect/server/ui-v2/assets/{work-pool._workPoolName-C_LiL3SE.js.map → work-pool._workPoolName-B_NFWXKS.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js → work-pool_._workPoolName.edit-Cyzn8g-S.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js.map → work-pool_._workPoolName.edit-Cyzn8g-S.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js.map → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js → work-queue-icon-text-BOpcJ8YU.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js.map → work-queue-icon-text-BOpcJ8YU.js.map} +1 -1
- prefect/server/ui-v2/index.html +3 -3
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/METADATA +2 -1
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/RECORD +223 -211
- prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js +0 -2
- prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js.map +0 -1
- prefect/server/ui-v2/assets/automation._id-Dn7jABys.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js.map +0 -1
- prefect/server/ui-v2/assets/catalog_._slug-Bl2J2oI3.js +0 -2
- prefect/server/ui-v2/assets/create-D--LHaji.js +0 -2
- prefect/server/ui-v2/assets/data-table-rlbkLcrY.js +0 -2
- prefect/server/ui-v2/assets/data-table-rlbkLcrY.js.map +0 -1
- prefect/server/ui-v2/assets/delete-confirmation-dialog-DHkm2p8m.js +0 -2
- prefect/server/ui-v2/assets/deployment._id-Ci9zge5n.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-D9ZWkh8H.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-CS7sObzC.js +0 -2
- prefect/server/ui-v2/assets/event._eventDate._eventId-D7Twzb22.js +0 -2
- prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js +0 -4
- prefect/server/ui-v2/assets/flow._id-BdQGWPKP.js +0 -2
- prefect/server/ui-v2/assets/index-7i4X9TeK.js +0 -2
- prefect/server/ui-v2/assets/index-BkiGTHwU.js +0 -2
- prefect/server/ui-v2/assets/index-BkiGTHwU.js.map +0 -1
- prefect/server/ui-v2/assets/index-COouj_0-.css +0 -1
- prefect/server/ui-v2/assets/index-CiSFHkhI.js +0 -2
- prefect/server/ui-v2/assets/index-DATPYZfT.js +0 -2
- prefect/server/ui-v2/assets/index-DATPYZfT.js.map +0 -1
- prefect/server/ui-v2/assets/index-VH4TnZ4e.js +0 -2
- prefect/server/ui-v2/assets/index-VH4TnZ4e.js.map +0 -1
- prefect/server/ui-v2/assets/python-example-snippet-DfCFYPN_.js +0 -3
- prefect/server/ui-v2/assets/schema-form-CWDHSME9.js.map +0 -1
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-S69sih55.js +0 -2
- prefect/server/ui-v2/assets/task-runs-pagination-VdR-LO4r.js +0 -2
- prefect/server/ui-v2/assets/timezone-select-BuPYznge.js +0 -2
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DpdsLH4t.js +0 -2
- prefect/server/ui-v2/assets/use-state-favicon-M09DmrNy.js +0 -2
- prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js +0 -34
- prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js.map +0 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-BQ9b-Wxy.js +0 -2
- prefect/server/ui-v2/assets/work-pool._workPoolName-C_LiL3SE.js +0 -2
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/WHEEL +0 -0
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-flow-runs-selected-rows-DmQSWBTu.js","sources":["../../src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts","../../src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx","../../src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.ts"],"sourcesContent":["import { toast } from \"sonner\";\nimport { useDeleteFlowRun } from \"@/api/flow-runs\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteFlowRunsDialog = () => {\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { mutateAsync } = useDeleteFlowRun();\n\n\tconst handleDeletes = async (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) => {\n\t\ttry {\n\t\t\tconst res = await Promise.allSettled(\n\t\t\t\tflowRunIds.map((id) => mutateAsync(id)),\n\t\t\t);\n\t\t\tconst { numFails, numSuccess } = res.reduce(\n\t\t\t\t(accumulator, currentValue) => {\n\t\t\t\t\tif (currentValue.status === \"rejected\") {\n\t\t\t\t\t\taccumulator.numFails += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taccumulator.numSuccess += 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ numFails: 0, numSuccess: 0 },\n\t\t\t);\n\t\t\tif (numFails > 1) {\n\t\t\t\ttoast.error(`${numFails} flow runs failed to delete`);\n\t\t\t} else if (numFails === 1) {\n\t\t\t\ttoast.error(\"Flow run failed to delete\");\n\t\t\t} else if (numSuccess > 1) {\n\t\t\t\ttoast.success(`${numSuccess} flow runs deleted`);\n\t\t\t} else {\n\t\t\t\ttoast.success(\"Flow run deleted\");\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(\"Unknown error while deleting flow run.\", err);\n\t\t} finally {\n\t\t\tonConfirm();\n\t\t}\n\t};\n\n\tconst handleConfirmDelete = (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Flow Runs\",\n\t\t\tdescription: \"Are you sure you want to delete selected flow runs?\",\n\t\t\tonConfirm: () => {\n\t\t\t\tvoid handleDeletes(flowRunIds, onConfirm);\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n","import type { CheckedState } from \"@radix-ui/react-checkbox\";\nimport { useMemo } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { pluralize } from \"@/utils\";\nimport type { FlowRunCardData } from \"../flow-run-card\";\nimport { useDeleteFlowRunsDialog } from \"./use-delete-flow-runs-dialog\";\n\ntype CountOnlyProps = {\n\tcount: number | undefined;\n};\ntype SelectableProps = {\n\tcount: number | undefined;\n\tresults: Array<FlowRunCardData> | undefined;\n\tsetSelectedRows: (rows: Set<string>) => void;\n\tselectedRows: Set<string>;\n};\ntype FlowRunsRowCountProps = CountOnlyProps | SelectableProps;\n\nexport const FlowRunsRowCount = ({\n\tcount = 0,\n\t...props\n}: FlowRunsRowCountProps) => {\n\t// Selectable UX\n\tif (\n\t\t\"results\" in props &&\n\t\t\"setSelectedRows\" in props &&\n\t\t\"selectedRows\" in props\n\t) {\n\t\treturn <SelectedCount count={count} {...props} />;\n\t}\n\n\t// Count only UX\n\treturn (\n\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t</Typography>\n\t);\n};\n\nfunction SelectedCount({\n\tcount = 0,\n\tresults = [],\n\tsetSelectedRows,\n\tselectedRows,\n}: SelectableProps) {\n\tconst [deleteConfirmationDialogState, confirmDelete] =\n\t\tuseDeleteFlowRunsDialog();\n\n\tconst resultsIds = useMemo(() => results.map(({ id }) => id), [results]);\n\n\tconst selectedRowsList = Array.from(selectedRows);\n\n\tconst ToggleCheckbox = () => {\n\t\tconst isAllRowsSelected = resultsIds.every((id) => selectedRows.has(id));\n\t\tconst isSomeRowsSelected = resultsIds.some((id) => selectedRows.has(id));\n\t\tlet checkedState: CheckedState = false;\n\t\tif (isAllRowsSelected) {\n\t\t\tcheckedState = true;\n\t\t} else if (isSomeRowsSelected) {\n\t\t\tcheckedState = \"indeterminate\";\n\t\t}\n\t\treturn (\n\t\t\t<Checkbox\n\t\t\t\tclassName=\"block\"\n\t\t\t\tchecked={checkedState}\n\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\tif (checked) {\n\t\t\t\t\t\tsetSelectedRows(new Set(resultsIds));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetSelectedRows(new Set());\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\taria-label=\"Toggle all\"\n\t\t\t/>\n\t\t);\n\t};\n\n\t// If has selected rows\n\tif (selectedRows.size > 0)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<ToggleCheckbox />\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t\t\t{selectedRowsList.length} selected\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Delete rows\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tconfirmDelete(selectedRowsList, () => setSelectedRows(new Set()));\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Trash2\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t<DeleteConfirmationDialog {...deleteConfirmationDialogState} />\n\t\t\t</>\n\t\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t{results && setSelectedRows && selectedRows && (\n\t\t\t\t<Checkbox\n\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\tchecked={false}\n\t\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\t\tsetSelectedRows(new Set(checked ? resultsIds : undefined));\n\t\t\t\t\t}}\n\t\t\t\t\taria-label=\"Toggle all\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t\t</Typography>\n\t\t</div>\n\t);\n}\n","import { useState } from \"react\";\n\nexport const useFlowRunsSelectedRows = (defaultValues?: Array<string>) => {\n\tconst [selectedRows, setSelectedRows] = useState<Set<string>>(\n\t\tnew Set(defaultValues),\n\t);\n\n\tconst addRow = (id: string) =>\n\t\tsetSelectedRows((curr) => new Set(curr).add(id));\n\n\tconst removeRow = (id: string) =>\n\t\tsetSelectedRows((curr) => {\n\t\t\tconst newValue = new Set(curr);\n\t\t\tnewValue.delete(id);\n\t\t\treturn newValue;\n\t\t});\n\n\tconst onSelectRow = (id: string, checked: boolean) => {\n\t\tif (checked) {\n\t\t\taddRow(id);\n\t\t} else {\n\t\t\tremoveRow(id);\n\t\t}\n\t};\n\n\tconst clearSet = () => setSelectedRows(new Set());\n\n\tconst utils = {\n\t\taddRow,\n\t\tremoveRow,\n\t\tonSelectRow,\n\t\tclearSet,\n\t};\n\n\treturn [selectedRows, setSelectedRows, utils] as const;\n};\n"],"names":["useDeleteFlowRunsDialog","dialogState","confirmDelete","useDeleteConfirmationDialog","mutateAsync","useDeleteFlowRun","handleDeletes","flowRunIds","onConfirm","res","id","numFails","numSuccess","accumulator","currentValue","toast","err","FlowRunsRowCount","count","props","jsx","SelectedCount","jsxs","Typography","pluralize","results","setSelectedRows","selectedRows","deleteConfirmationDialogState","resultsIds","useMemo","selectedRowsList","ToggleCheckbox","isAllRowsSelected","isSomeRowsSelected","checkedState","Checkbox","checked","Fragment","Button","Icon","DeleteConfirmationDialog","useFlowRunsSelectedRows","defaultValues","useState","addRow","curr","removeRow","newValue"],"mappings":"4QAIO,MAAMA,EAA0B,IAAM,CAC5C,KAAM,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAE/B,CAAE,YAAAC,CAAA,EAAgBC,EAAA,EAElBC,EAAgB,MACrBC,EACAC,EAAY,IAAM,CAAC,IACf,CACJ,GAAI,CACH,MAAMC,EAAM,MAAM,QAAQ,WACzBF,EAAW,IAAKG,GAAON,EAAYM,CAAE,CAAC,CAAA,EAEjC,CAAE,SAAAC,EAAU,WAAAC,CAAA,EAAeH,EAAI,OACpC,CAACI,EAAaC,KACTA,EAAa,SAAW,WAC3BD,EAAY,UAAY,EAExBA,EAAY,YAAc,EAEpBA,GAER,CAAE,SAAU,EAAG,WAAY,CAAA,CAAE,EAE1BF,EAAW,EACdI,EAAM,MAAM,GAAGJ,CAAQ,6BAA6B,EAC1CA,IAAa,EACvBI,EAAM,MAAM,2BAA2B,EAC7BH,EAAa,EACvBG,EAAM,QAAQ,GAAGH,CAAU,oBAAoB,EAE/CG,EAAM,QAAQ,kBAAkB,CAElC,OAASC,EAAK,CACb,QAAQ,MAAM,yCAA0CA,CAAG,CAC5D,QAAA,CACCR,EAAA,CACD,CACD,EAcA,MAAO,CAACP,EAZoB,CAC3BM,EACAC,EAAY,IAAM,CAAC,IAEnBN,EAAc,CACb,MAAO,mBACP,YAAa,sDACb,UAAW,IAAM,CACXI,EAAcC,EAAYC,CAAS,CACzC,CAAA,CACA,CAEsC,CACzC,ECnCaS,EAAmB,CAAC,CAChC,MAAAC,EAAQ,EACR,GAAGC,CACJ,IAGE,YAAaA,GACb,oBAAqBA,GACrB,iBAAkBA,EAEXC,EAAAA,IAACC,EAAA,CAAc,MAAAH,EAAe,GAAGC,CAAA,CAAO,EAK/CG,EAAAA,KAACC,EAAA,CAAW,QAAQ,YAAY,UAAU,wBACxC,SAAA,CAAAL,EAAM,IAAEM,EAAUN,EAAO,UA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EAIDN,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACb,SAAA,CAAAG,GAAWC,GAAmBC,GAC9BP,EAAAA,IAACgB,EAAA,CACA,UAAU,QACV,QAAS,GACT,gBAAkBC,GAAY,CAC7BX,EAAgB,IAAI,IAAIW,EAAUR,EAAa,MAAS,CAAC,CAC1D,EACA,aAAW,YAAA,CAAA,EAGbP,EAAAA,KAACC,EAAA,CAAW,QAAQ,YAAY,UAAU,wBACxC,SAAA,CAAAL,EAAM,IAAEM,EAAUN,EAAO,UAAU,CAAA,CAAA,CACrC,CAAA,EACD,CAEF,CCxHO,MAAMwB,EAA2BC,GAAkC,CACzE,KAAM,CAAChB,EAAcD,CAAe,EAAIkB,EAAAA,SACvC,IAAI,IAAID,CAAa,CAAA,EAGhBE,EAAUnC,GACfgB,EAAiBoB,GAAS,IAAI,IAAIA,CAAI,EAAE,IAAIpC,CAAE,CAAC,EAE1CqC,EAAarC,GAClBgB,EAAiBoB,GAAS,CACzB,MAAME,EAAW,IAAI,IAAIF,CAAI,EAC7B,OAAAE,EAAS,OAAOtC,CAAE,EACXsC,CACR,CAAC,EAmBF,MAAO,CAACrB,EAAcD,EAPR,CACb,OAAAmB,EACA,UAAAE,EACA,YAbmB,CAACrC,EAAY2B,IAAqB,CACjDA,EACHQ,EAAOnC,CAAE,EAETqC,EAAUrC,CAAE,CAEd,EAQC,SANgB,IAAMgB,EAAgB,IAAI,GAAK,CAM/C,CAG2C,CAC7C"}
|
|
1
|
+
{"version":3,"file":"use-flow-runs-selected-rows-C-tehPRB.js","sources":["../../src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts","../../src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx","../../src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.ts"],"sourcesContent":["import { toast } from \"sonner\";\nimport { useDeleteFlowRun } from \"@/api/flow-runs\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteFlowRunsDialog = () => {\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { mutateAsync } = useDeleteFlowRun();\n\n\tconst handleDeletes = async (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) => {\n\t\ttry {\n\t\t\tconst res = await Promise.allSettled(\n\t\t\t\tflowRunIds.map((id) => mutateAsync(id)),\n\t\t\t);\n\t\t\tconst { numFails, numSuccess } = res.reduce(\n\t\t\t\t(accumulator, currentValue) => {\n\t\t\t\t\tif (currentValue.status === \"rejected\") {\n\t\t\t\t\t\taccumulator.numFails += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taccumulator.numSuccess += 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ numFails: 0, numSuccess: 0 },\n\t\t\t);\n\t\t\tif (numFails > 1) {\n\t\t\t\ttoast.error(`${numFails} flow runs failed to delete`);\n\t\t\t} else if (numFails === 1) {\n\t\t\t\ttoast.error(\"Flow run failed to delete\");\n\t\t\t} else if (numSuccess > 1) {\n\t\t\t\ttoast.success(`${numSuccess} flow runs deleted`);\n\t\t\t} else {\n\t\t\t\ttoast.success(\"Flow run deleted\");\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(\"Unknown error while deleting flow run.\", err);\n\t\t} finally {\n\t\t\tonConfirm();\n\t\t}\n\t};\n\n\tconst handleConfirmDelete = (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Flow Runs\",\n\t\t\tdescription: \"Are you sure you want to delete selected flow runs?\",\n\t\t\tonConfirm: () => {\n\t\t\t\tvoid handleDeletes(flowRunIds, onConfirm);\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n","import type { CheckedState } from \"@radix-ui/react-checkbox\";\nimport { useMemo } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { pluralize } from \"@/utils\";\nimport type { FlowRunCardData } from \"../flow-run-card\";\nimport { useDeleteFlowRunsDialog } from \"./use-delete-flow-runs-dialog\";\n\ntype CountOnlyProps = {\n\tcount: number | undefined;\n};\ntype SelectableProps = {\n\tcount: number | undefined;\n\tresults: Array<FlowRunCardData> | undefined;\n\tsetSelectedRows: (rows: Set<string>) => void;\n\tselectedRows: Set<string>;\n};\ntype FlowRunsRowCountProps = CountOnlyProps | SelectableProps;\n\nexport const FlowRunsRowCount = ({\n\tcount = 0,\n\t...props\n}: FlowRunsRowCountProps) => {\n\t// Selectable UX\n\tif (\n\t\t\"results\" in props &&\n\t\t\"setSelectedRows\" in props &&\n\t\t\"selectedRows\" in props\n\t) {\n\t\treturn <SelectedCount count={count} {...props} />;\n\t}\n\n\t// Count only UX\n\treturn (\n\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t</Typography>\n\t);\n};\n\nfunction SelectedCount({\n\tcount = 0,\n\tresults = [],\n\tsetSelectedRows,\n\tselectedRows,\n}: SelectableProps) {\n\tconst [deleteConfirmationDialogState, confirmDelete] =\n\t\tuseDeleteFlowRunsDialog();\n\n\tconst resultsIds = useMemo(() => results.map(({ id }) => id), [results]);\n\n\tconst selectedRowsList = Array.from(selectedRows);\n\n\tconst ToggleCheckbox = () => {\n\t\tconst isAllRowsSelected = resultsIds.every((id) => selectedRows.has(id));\n\t\tconst isSomeRowsSelected = resultsIds.some((id) => selectedRows.has(id));\n\t\tlet checkedState: CheckedState = false;\n\t\tif (isAllRowsSelected) {\n\t\t\tcheckedState = true;\n\t\t} else if (isSomeRowsSelected) {\n\t\t\tcheckedState = \"indeterminate\";\n\t\t}\n\t\treturn (\n\t\t\t<Checkbox\n\t\t\t\tclassName=\"block\"\n\t\t\t\tchecked={checkedState}\n\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\tif (checked) {\n\t\t\t\t\t\tsetSelectedRows(new Set(resultsIds));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetSelectedRows(new Set());\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\taria-label=\"Toggle all\"\n\t\t\t/>\n\t\t);\n\t};\n\n\t// If has selected rows\n\tif (selectedRows.size > 0)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<ToggleCheckbox />\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t\t\t{selectedRowsList.length} selected\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Delete rows\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tconfirmDelete(selectedRowsList, () => setSelectedRows(new Set()));\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Trash2\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t<DeleteConfirmationDialog {...deleteConfirmationDialogState} />\n\t\t\t</>\n\t\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t{results && setSelectedRows && selectedRows && (\n\t\t\t\t<Checkbox\n\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\tchecked={false}\n\t\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\t\tsetSelectedRows(new Set(checked ? resultsIds : undefined));\n\t\t\t\t\t}}\n\t\t\t\t\taria-label=\"Toggle all\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t\t</Typography>\n\t\t</div>\n\t);\n}\n","import { useState } from \"react\";\n\nexport const useFlowRunsSelectedRows = (defaultValues?: Array<string>) => {\n\tconst [selectedRows, setSelectedRows] = useState<Set<string>>(\n\t\tnew Set(defaultValues),\n\t);\n\n\tconst addRow = (id: string) =>\n\t\tsetSelectedRows((curr) => new Set(curr).add(id));\n\n\tconst removeRow = (id: string) =>\n\t\tsetSelectedRows((curr) => {\n\t\t\tconst newValue = new Set(curr);\n\t\t\tnewValue.delete(id);\n\t\t\treturn newValue;\n\t\t});\n\n\tconst onSelectRow = (id: string, checked: boolean) => {\n\t\tif (checked) {\n\t\t\taddRow(id);\n\t\t} else {\n\t\t\tremoveRow(id);\n\t\t}\n\t};\n\n\tconst clearSet = () => setSelectedRows(new Set());\n\n\tconst utils = {\n\t\taddRow,\n\t\tremoveRow,\n\t\tonSelectRow,\n\t\tclearSet,\n\t};\n\n\treturn [selectedRows, setSelectedRows, utils] as const;\n};\n"],"names":["useDeleteFlowRunsDialog","dialogState","confirmDelete","useDeleteConfirmationDialog","mutateAsync","useDeleteFlowRun","handleDeletes","flowRunIds","onConfirm","res","id","numFails","numSuccess","accumulator","currentValue","toast","err","FlowRunsRowCount","count","props","jsx","SelectedCount","jsxs","Typography","pluralize","results","setSelectedRows","selectedRows","deleteConfirmationDialogState","resultsIds","useMemo","selectedRowsList","ToggleCheckbox","isAllRowsSelected","isSomeRowsSelected","checkedState","Checkbox","checked","Fragment","Button","Icon","DeleteConfirmationDialog","useFlowRunsSelectedRows","defaultValues","useState","addRow","curr","removeRow","newValue"],"mappings":"4QAIO,MAAMA,EAA0B,IAAM,CAC5C,KAAM,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAE/B,CAAE,YAAAC,CAAA,EAAgBC,EAAA,EAElBC,EAAgB,MACrBC,EACAC,EAAY,IAAM,CAAC,IACf,CACJ,GAAI,CACH,MAAMC,EAAM,MAAM,QAAQ,WACzBF,EAAW,IAAKG,GAAON,EAAYM,CA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O,UAAU,CAAA,CAAA,CACrC,CAAA,EACD,CAEF,CCxHO,MAAMwB,EAA2BC,GAAkC,CACzE,KAAM,CAAChB,EAAcD,CAAe,EAAIkB,EAAAA,SACvC,IAAI,IAAID,CAAa,CAAA,EAGhBE,EAAUnC,GACfgB,EAAiBoB,GAAS,IAAI,IAAIA,CAAI,EAAE,IAAIpC,CAAE,CAAC,EAE1CqC,EAAarC,GAClBgB,EAAiBoB,GAAS,CACzB,MAAME,EAAW,IAAI,IAAIF,CAAI,EAC7B,OAAAE,EAAS,OAAOtC,CAAE,EACXsC,CACR,CAAC,EAmBF,MAAO,CAACrB,EAAcD,EAPR,CACb,OAAAmB,EACA,UAAAE,EACA,YAbmB,CAACrC,EAAY2B,IAAqB,CACjDA,EACHQ,EAAOnC,CAAE,EAETqC,EAAUrC,CAAE,CAEd,EAQC,SANgB,IAAMgB,EAAgB,IAAI,GAAK,CAM/C,CAG2C,CAC7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as _,u as l}from"./vendor-tanstack-BcZfOOfy.js";import{
|
|
2
|
-
//# sourceMappingURL=use-get-artifacts-flow-task-runs-
|
|
1
|
+
import{t as _,u as l}from"./vendor-tanstack-BcZfOOfy.js";import{bz as k,aR as c,dA as R,dB as w}from"./index-B8vo2Lrg.js";const y=a=>{const{data:t}=_(k(a)),u=t?.map(s=>s.flow_run_id).filter(s=>s!=null&&s!==void 0),o=t?.map(s=>s.task_run_id).filter(s=>s!=null&&s!==void 0),{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:u}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:o}},sort:"ID_DESC",offset:0})],combine:s=>{const[n,e]=s;return{flowRuns:n.data,taskRuns:e.data}}});return t?.map(s=>{const n=r?.find(d=>d.id===s.flow_run_id),e=i?.find(d=>d.id===s.task_run_id);return{...s,flow_run:n,task_run:e}})},D=a=>{const{data:t}=_(w(a)),u=t?.flow_run_id,o=t?.task_run_id,{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:[u??""]}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:[o??""]}},sort:"ID_DESC",offset:0})],combine:f=>{const[s,n]=f;return{flowRuns:s.data,taskRuns:n.data}}});return{...t,flow_run:r?.[0],task_run:i?.[0]}};export{D as a,y as u};
|
|
2
|
+
//# sourceMappingURL=use-get-artifacts-flow-task-runs-DRWRrmrb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-artifacts-flow-task-runs-
|
|
1
|
+
{"version":3,"file":"use-get-artifacts-flow-task-runs-DRWRrmrb.js","sources":["../../src/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs.ts"],"sourcesContent":["import { useQueries, useQuery } from \"@tanstack/react-query\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport { buildListTaskRunsQuery } from \"@/api/task-runs\";\nimport {\n\ttype ArtifactsFilter,\n\ttype ArtifactWithFlowRunAndTaskRun,\n\tbuildGetArtifactQuery,\n\tbuildListArtifactsQuery,\n} from \"..\";\n\nexport const useFilterArtifactsFlowTaskRuns = (filter: ArtifactsFilter) => {\n\tconst { data: artifacts } = useQuery(buildListArtifactsQuery(filter));\n\n\tconst flowRunIds = artifacts\n\t\t?.map((artifact) => artifact.flow_run_id)\n\t\t.filter((val) => val != null && val !== undefined);\n\tconst taskRunIds = artifacts\n\t\t?.map((artifact) => artifact.task_run_id)\n\t\t.filter((val) => val != null && val !== undefined);\n\n\tconst { flowRuns, taskRuns } = useQueries({\n\t\tqueries: [\n\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: flowRunIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t\tbuildListTaskRunsQuery({\n\t\t\t\ttask_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: taskRunIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t],\n\t\tcombine: (data) => {\n\t\t\tconst [flowRuns, taskRuns] = data;\n\t\t\treturn {\n\t\t\t\tflowRuns: flowRuns.data,\n\t\t\t\ttaskRuns: taskRuns.data,\n\t\t\t};\n\t\t},\n\t});\n\n\tconst artifactsWithMetadata = artifacts?.map((artifact) => {\n\t\tconst flowRun = flowRuns?.find(\n\t\t\t(flowRun) => flowRun.id === artifact.flow_run_id,\n\t\t);\n\t\tconst taskRun = taskRuns?.find(\n\t\t\t(taskRun) => taskRun.id === artifact.task_run_id,\n\t\t);\n\n\t\treturn {\n\t\t\t...artifact,\n\t\t\tflow_run: flowRun,\n\t\t\ttask_run: taskRun,\n\t\t};\n\t});\n\n\treturn artifactsWithMetadata as ArtifactWithFlowRunAndTaskRun[];\n};\n\nexport const useGetArtifactFlowTaskRuns = (artifactId: string) => {\n\tconst { data: artifact } = useQuery(buildGetArtifactQuery(artifactId));\n\n\tconst flowRunId = artifact?.flow_run_id;\n\tconst taskRunId = artifact?.task_run_id;\n\tconst { flowRuns, taskRuns } = useQueries({\n\t\tqueries: [\n\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [flowRunId ?? \"\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t\tbuildListTaskRunsQuery({\n\t\t\t\ttask_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [taskRunId ?? \"\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t],\n\t\tcombine: (data) => {\n\t\t\tconst [flowRuns, taskRuns] = data;\n\t\t\treturn {\n\t\t\t\tflowRuns: flowRuns.data,\n\t\t\t\ttaskRuns: taskRuns.data,\n\t\t\t};\n\t\t},\n\t});\n\n\treturn {\n\t\t...artifact,\n\t\tflow_run: flowRuns?.[0],\n\t\ttask_run: taskRuns?.[0],\n\t} as ArtifactWithFlowRunAndTaskRun;\n};\n"],"names":["useFilterArtifactsFlowTaskRuns","filter","artifacts","useQuery","buildListArtifactsQuery","flowRunIds","artifact","val","taskRunIds","flowRuns","taskRuns","useQueries","buildFilterFlowRunsQuery","buildListTaskRunsQuery","data","flowRun","taskRun","useGetArtifactFlowTaskRuns","artifactId","buildGetArtifactQuery","flowRunId","taskRunId"],"mappings":"0HAUO,MAAMA,EAAkCC,GAA4B,CAC1E,KAAM,CAAE,KAAMC,CAAA,EAAcC,EAASC,EAAwBH,CAAM,CAAC,EAE9DI,EAAaH,GAChB,IAAKI,GAAaA,EAAS,WAAW,EACvC,OAAQC,GAAQA,GAAO,MAAQA,IAAQ,MAAS,EAC5CC,EAAaN,GAChB,IAAKI,GAAaA,EAAS,WAAW,EACvC,OAAQC,GAAQA,GAAO,MAAQA,IAAQ,MAAS,EAE5C,CAAE,SAAAE,EAAU,SAAAC,CAAA,EAAaC,EAAW,CACzC,QAAS,CACRC,EAAyB,CACxB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAMP,CAAA,CACP,EAED,KAAM,UACN,OAAQ,CAAA,CACR,EACDQ,EAAuB,CACtB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAML,CAAA,CACP,EAED,KAAM,UACN,OAAQ,CAAA,CACR,CAAA,EAEF,QAAUM,GAAS,CAClB,KAAM,CAACL,EAAUC,CAAQ,EAAII,EAC7B,MAAO,CACN,SAAUL,EAAS,KACnB,SAAUC,EAAS,IAAA,CAErB,CAAA,CACA,EAiBD,OAf8BR,GAAW,IAAKI,GAAa,CAC1D,MAAMS,EAAUN,GAAU,KACxBM,GAAYA,EAAQ,KAAOT,EAAS,WAAA,EAEhCU,EAAUN,GAAU,KACxBM,GAAYA,EAAQ,KAAOV,EAAS,WAAA,EAGtC,MAAO,CACN,GAAGA,EACH,SAAUS,EACV,SAAUC,CAAA,CAEZ,CAAC,CAGF,EAEaC,EAA8BC,GAAuB,CACjE,KAAM,CAAE,KAAMZ,CAAA,EAAaH,EAASgB,EAAsBD,CAAU,CAAC,EAE/DE,EAAYd,GAAU,YACtBe,EAAYf,GAAU,YACtB,CAAE,SAAAG,EAAU,SAAAC,CAAA,EAAaC,EAAW,CACzC,QAAS,CACRC,EAAyB,CACxB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAM,CAACQ,GAAa,EAAE,CAAA,CACvB,EAED,KAAM,UACN,OAAQ,CAAA,CACR,EACDP,EAAuB,CACtB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAM,CAACQ,GAAa,EAAE,CAAA,CACvB,EAED,KAAM,UACN,OAAQ,CAAA,CACR,CAAA,EAEF,QAAUP,GAAS,CAClB,KAAM,CAACL,EAAUC,CAAQ,EAAII,EAC7B,MAAO,CACN,SAAUL,EAAS,KACnB,SAAUC,EAAS,IAAA,CAErB,CAAA,CACA,EAED,MAAO,CACN,GAAGJ,EACH,SAAUG,IAAW,CAAC,EACtB,SAAUC,IAAW,CAAC,CAAA,CAExB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d,j as n,L as m}from"./vendor-tanstack-BcZfOOfy.js";import{
|
|
2
|
-
//# sourceMappingURL=use-quick-run-
|
|
1
|
+
import{d,j as n,L as m}from"./vendor-tanstack-BcZfOOfy.js";import{cH as f,y as l,d1 as p,q as D}from"./index-B8vo2Lrg.js";import{u as h}from"./use-delete-confirmation-dialog-CUdii6Lo.js";const C=()=>{const o=d(),[t,a]=h(),{deleteDeployment:r}=f();return[t,(s,{shouldNavigate:i=!1}={})=>a({title:"Delete Deployment",description:`Are you sure you want to delete ${s.name}? This action cannot be undone.`,onConfirm:()=>{r(s.id,{onSuccess:()=>{l.success("Deployment deleted"),i&&o({to:"/deployments"})},onError:c=>{const u=c.message||"Unknown error while deleting deployment.";console.error(u)}})}})]},g={state:{type:"SCHEDULED",message:"Run from the Prefect UI with defaults",state_details:{deferred:!1,untrackable_result:!1,pause_reschedule:!1}}},R=()=>{const{createDeploymentFlowRun:o,isPending:t}=p();return{onQuickRun:r=>{o({id:r,...g},{onSuccess:e=>{l.success("Flow run created",{action:n.jsx(m,{to:"/runs/flow-run/$id",params:{id:e.id},children:n.jsx(D,{size:"sm",children:"View run"})}),description:n.jsxs("p",{children:[n.jsx("span",{className:"font-bold",children:e.name})," scheduled to start"," ",n.jsx("span",{className:"font-bold",children:"now"})]})})},onError:e=>{const s=e.message||"Unknown error while creating flow run.";console.error(s)}})},isPending:t}};export{C as a,R as u};
|
|
2
|
+
//# sourceMappingURL=use-quick-run-B4Xj-YQQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-quick-run-
|
|
1
|
+
{"version":3,"file":"use-quick-run-B4Xj-YQQ.js","sources":["../../src/components/deployments/use-delete-deployment-confirmation-dialog.ts","../../src/components/deployments/use-quick-run.tsx"],"sourcesContent":["import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { type Deployment, useDeleteDeployment } from \"@/api/deployments\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteDeploymentConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteDeployment } = useDeleteDeployment();\n\n\tconst handleConfirmDelete = (\n\t\tdeployment: Deployment,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t}: {\n\t\t\t/** Should navigate back to /deployments */\n\t\t\tshouldNavigate?: boolean;\n\t\t} = {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Deployment\",\n\t\t\tdescription: `Are you sure you want to delete ${deployment.name}? This action cannot be undone.`,\n\t\t\tonConfirm: () => {\n\t\t\t\tdeleteDeployment(deployment.id, {\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Deployment deleted\");\n\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\tvoid navigate({ to: \"/deployments\" });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while deleting deployment.\";\n\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n","import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { useDeploymentCreateFlowRun } from \"@/api/flow-runs\";\nimport { Button } from \"@/components/ui/button\";\n\nconst DEPLOYMENT_QUICK_RUN_PAYLOAD = {\n\tstate: {\n\t\ttype: \"SCHEDULED\",\n\t\tmessage: \"Run from the Prefect UI with defaults\",\n\t\tstate_details: {\n\t\t\tdeferred: false,\n\t\t\tuntrackable_result: false,\n\t\t\tpause_reschedule: false,\n\t\t},\n\t},\n} as const;\n\n/**\n *\n * @returns a function that handles the mutation and UX when a deployment creates a quick run\n */\nexport const useQuickRun = () => {\n\tconst { createDeploymentFlowRun, isPending } = useDeploymentCreateFlowRun();\n\tconst onQuickRun = (id: string) => {\n\t\tcreateDeploymentFlowRun(\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\t...DEPLOYMENT_QUICK_RUN_PAYLOAD,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: (res) => {\n\t\t\t\t\ttoast.success(\"Flow run created\", {\n\t\t\t\t\t\taction: (\n\t\t\t\t\t\t\t<Link to=\"/runs/flow-run/$id\" params={{ id: res.id }}>\n\t\t\t\t\t\t\t\t<Button size=\"sm\">View run</Button>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdescription: (\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<span className=\"font-bold\">{res.name}</span> scheduled to start{\" \"}\n\t\t\t\t\t\t\t\t<span className=\"font-bold\">now</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while creating flow run.\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn { onQuickRun, isPending };\n};\n"],"names":["useDeleteDeploymentConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteDeployment","useDeleteDeployment","deployment","shouldNavigate","toast","error","message","DEPLOYMENT_QUICK_RUN_PAYLOAD","useQuickRun","createDeploymentFlowRun","isPending","useDeploymentCreateFlowRun","id","res","jsx","Link","Button"],"mappings":"2LAKO,MAAMA,EAAwC,IAAM,CAC1D,MAAMC,EAAWC,EAAA,EACX,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAE/B,CAAE,iBAAAC,CAAA,EAAqBC,EAAA,EA+B7B,MAAO,CAACJ,EA7BoB,CAC3BK,EACA,CACC,eAAAC,EAAiB,EAAA,EAId,CAAA,IAEJL,EAAc,CACb,MAAO,oBACP,YAAa,mCAAmCI,EAAW,IAAI,kCAC/D,UAAW,IAAM,CAChBF,EAAiBE,EAAW,GAAI,CAC/B,UAAW,IAAM,CAChBE,EAAM,QAAQ,oBAAoB,EAC9BD,GACER,EAAS,CAAE,GAAI,eAAgB,CAEtC,EACA,QAAUU,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,2CAClB,QAAQ,MAAMC,CAAO,CACtB,CAAA,CACA,CACF,CAAA,CACA,CAEsC,CACzC,ECpCMC,EAA+B,CACpC,MAAO,CACN,KAAM,YACN,QAAS,wCACT,cAAe,CACd,SAAU,GACV,mBAAoB,GACpB,iBAAkB,EAAA,CACnB,CAEF,EAMaC,EAAc,IAAM,CAChC,KAAM,CAAE,wBAAAC,EAAyB,UAAAC,CAAA,EAAcC,EAAA,EAgC/C,MAAO,CAAE,WA/BWC,GAAe,CAClCH,EACC,CACC,GAAAG,EACA,GAAGL,CAAA,EAEJ,CACC,UAAYM,GAAQ,CACnBT,EAAM,QAAQ,mBAAoB,CACjC,OACCU,EAAAA,IAACC,EAAA,CAAK,GAAG,qBAAqB,OAAQ,CAAE,GAAIF,EAAI,EAAA,EAC/C,SAAAC,EAAAA,IAACE,EAAA,CAAO,KAAK,KAAK,oBAAQ,EAC3B,EAED,mBACE,IAAA,CACA,SAAA,CAAAF,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,SAAAD,EAAI,KAAK,EAAO,sBAAoB,IACjEC,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAY,SAAA,KAAA,CAAG,CAAA,CAAA,CAChC,CAAA,CAED,CACF,EACA,QAAUT,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,yCAClB,QAAQ,MAAMC,CAAO,CACtB,CAAA,CACD,CAEF,EAEqB,UAAAI,CAAA,CACtB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{bL as y,a_ as k,H as C,cE as N,a2 as S,a3 as w,a4 as I,a5 as D,i as v,au as E,p as R,a7 as L,q as b}from"./index-B8vo2Lrg.js";import{r as n,J as A,j as e}from"./vendor-tanstack-BcZfOOfy.js";import{I as B,Z as j}from"./vendor-date-wwuDAncJ.js";import{S as M}from"./index-D6ynV6U7.js";const O=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],W=y("rows-3",O),q=({logs:t,taskRun:s,onBottomReached:r,virtualize:o=!0,className:d})=>{const u=n.useRef(null),l=n.useRef(t);l.current=t;const g=n.useCallback(a=>l.current[a]?.id??a,[]),c=A({count:t.length,getScrollElement:()=>u.current,estimateSize:()=>90,overscan:5,getItemKey:g}),h=n.useCallback(a=>{a&&c.measureElement(a)},[c]),f=o?c.getVirtualItems():Array.from({length:t.length},(a,i)=>({index:i,size:90,start:i*90})),m=f.at(-1)?.index;n.useEffect(()=>{m!==void 0&&m>=t.length-1&&r()},[t.length,m,r]);const x=a=>{if(a===0)return!0;const i=t[a-1],p=t[a];return!B(i.timestamp,p.timestamp)};return t.length===0?e.jsx("div",{className:"flex flex-col gap-2 bg-muted p-2 rounded-md font-mono",children:e.jsx("span",{className:"text-muted-foreground",children:"No logs found"})}):e.jsx("div",{ref:u,className:k("bg-muted rounded-md font-mono p-4 overflow-y-auto",d),role:"log",children:e.jsx("ol",{className:"relative",style:{height:`${c.getTotalSize()}px`},children:f.map(a=>{const i=t[a.index],p=x(a.index);return e.jsxs("li",{"data-index":a.index,ref:h,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${a.start}px)`},children:[p&&e.jsx(V,{date:new Date(i.timestamp)}),e.jsx(F,{log:i,taskRunName:s?.name})]},i.id)})})})},F=({log:t,taskRunName:s})=>e.jsxs("div",{className:"grid grid-cols-[84px_minmax(0,1fr)_150px] gap-2 text-sm py-2",children:[e.jsx("div",{children:e.jsx(z,{level:t.level})}),e.jsx("div",{className:"select-auto whitespace-pre-wrap break-words",children:t.message}),e.jsxs("div",{className:"text-xs grid grid-cols-1 gap-1 justify-items-end text-muted-foreground truncate",children:[e.jsx("span",{children:j(t.timestamp,"pp")}),s&&e.jsx("span",{children:s}),e.jsx("span",{className:"font-bold break-all whitespace-normal",children:t.name})]})]}),_=N("gap-1",{variants:{level:{CRITICAL:"bg-red-600 text-red-50 hover:bg-red-600",ERROR:"bg-red-600 text-red-50 hover:bg-red-600",WARNING:"bg-orange-600 text-orange-50 hover:bg-orange-600",INFO:"bg-sky-600 text-blue-50 hover:bg-sky-600",DEBUG:"bg-gray-700 text-gray-50 hover:bg-gray-700",CUSTOM:"bg-gray-700 text-gray-50 hover:bg-gray-700"}}}),z=({level:t})=>{const s=U(t);return e.jsx(C,{className:_({level:s}),children:s})};function U(t){const[s]=t.toString();switch(s){case"5":return"CRITICAL";case"4":return"ERROR";case"3":return"WARNING";case"2":return"INFO";case"1":return"DEBUG";default:return"CUSTOM"}}const V=({date:t})=>e.jsxs("div",{className:"flex flex-row justify-center items-center gap-2",children:[e.jsx("div",{className:"h-[1px] w-full bg-muted-foreground/30"}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:j(t,"MMM d, yyyy")}),e.jsx("div",{className:"h-[1px] w-full bg-muted-foreground/30"})]}),J=({open:t,onOpenChange:s,currentState:r,label:o,onConfirm:d,isLoading:u=!1})=>{const[l,g]=n.useState(void 0),[c,h]=n.useState("");n.useEffect(()=>{t||(g(void 0),h(""))},[t]);const f=()=>{l&&d({type:l,message:c||void 0})},m=!l||u;return e.jsx(S,{open:t,onOpenChange:s,children:e.jsxs(w,{"aria-describedby":void 0,children:[e.jsx(I,{children:e.jsxs(D,{children:["Change ",o," State"]})}),e.jsxs("div",{className:"space-y-4",children:[r&&e.jsxs("div",{children:[e.jsx(v,{className:"mb-2 block",children:"Current State"}),e.jsx(E,{type:r.type,name:r.name})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"desired-state",className:"mb-2 block",children:"Desired State"}),e.jsx(M,{value:l,onValueChange:g,terminalOnly:!0})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"message",className:"mb-2 block",children:"Reason (Optional)"}),e.jsx(R,{id:"message",value:c,onChange:x=>h(x.target.value),placeholder:"State changed manually via UI"})]})]}),e.jsxs(L,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:u,children:"Close"}),e.jsx(b,{type:"button",onClick:f,disabled:m,loading:u,children:"Change"})]})]})})},K=()=>{const[t,s]=n.useState(!1),r=n.useCallback(()=>s(!0),[]),o=n.useCallback(()=>s(!1),[]);return{open:t,onOpenChange:s,openDialog:r,closeDialog:o}};function G(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"no-preference"}function Y(t){n.useEffect(()=>{const s=G(),r=s==="dark"?document.getElementById("favicon-16-dark"):document.getElementById("favicon-16"),o=s==="dark"?document.getElementById("favicon-32-dark"):document.getElementById("favicon-32");if(t){const d=`/${t.toLowerCase()}.svg`;r?.setAttribute("href",d),o?.setAttribute("href",d)}return()=>{s==="dark"?(r?.setAttribute("href","/favicon-16x16-dark.png"),o?.setAttribute("href","/favicon-32x32-dark.png")):(r?.setAttribute("href","/favicon-16x16.png"),o?.setAttribute("href","/favicon-32x32.png"))}},[t])}export{J as C,W as R,q as a,K as b,Y as u};
|
|
2
|
+
//# sourceMappingURL=use-state-favicon-au2TZdMV.js.map
|
prefect/server/ui-v2/assets/{use-state-favicon-M09DmrNy.js.map → use-state-favicon-au2TZdMV.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-state-favicon-M09DmrNy.js","sources":["../../node_modules/lucide-react/dist/esm/icons/rows-3.js","../../src/components/ui/run-logs/index.tsx","../../src/components/ui/change-state-dialog/index.tsx","../../src/hooks/use-state-favicon.ts"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M21 9H3\", key: \"1338ky\" }],\n [\"path\", { d: \"M21 15H3\", key: \"9uk58r\" }]\n];\nconst Rows3 = createLucideIcon(\"rows-3\", __iconNode);\n\nexport { __iconNode, Rows3 as default };\n//# sourceMappingURL=rows-3.js.map\n","import { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { cva } from \"class-variance-authority\";\nimport { isSameDay } from \"date-fns\";\nimport { format } from \"date-fns-tz\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/utils\";\n\ntype RunLogsProps = {\n\tlogs: components[\"schemas\"][\"Log\"][];\n\ttaskRun?: components[\"schemas\"][\"TaskRun\"];\n\tonBottomReached: () => void;\n\tvirtualize?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Displays logs from a run in a virtualized list.\n *\n * @param logs - Array of log entries to display\n * @param taskRun - Optional task run information to display with logs\n * @param onBottomReached - Callback function triggered when the user scrolls to the bottom of the logs\n *\n */\nexport const RunLogs = ({\n\tlogs,\n\ttaskRun,\n\tonBottomReached,\n\tvirtualize = true,\n\tclassName,\n}: RunLogsProps) => {\n\tconst parentRef = useRef<HTMLDivElement>(null);\n\n\t// Use a ref to store logs for stable getItemKey callback\n\tconst logsRef = useRef(logs);\n\tlogsRef.current = logs;\n\n\tconst getItemKey = useCallback(\n\t\t(index: number) => logsRef.current[index]?.id ?? index,\n\t\t[],\n\t);\n\n\tconst virtualizer = useVirtualizer({\n\t\tcount: logs.length,\n\t\tgetScrollElement: () => parentRef.current,\n\t\testimateSize: () => 90,\n\t\toverscan: 5,\n\t\tgetItemKey,\n\t});\n\n\t// Wrap measureElement in a stable callback to prevent infinite re-renders\n\tconst measureElement = useCallback(\n\t\t(el: HTMLElement | null) => {\n\t\t\tif (el) {\n\t\t\t\tvirtualizer.measureElement(el);\n\t\t\t}\n\t\t},\n\t\t[virtualizer],\n\t);\n\n\tconst virtualItems = virtualize\n\t\t? virtualizer.getVirtualItems()\n\t\t: Array.from({ length: logs.length }, (_, i) => ({\n\t\t\t\tindex: i,\n\t\t\t\tsize: 90,\n\t\t\t\tstart: i * 90,\n\t\t\t}));\n\n\t// Get the last visible item index for stable effect dependency\n\tconst lastVisibleIndex = virtualItems.at(-1)?.index;\n\n\t/**\n\t * This effect detects when the user has scrolled to the bottom of the logs.\n\t * It works by checking if the last visible virtual item is also the last item in the logs array.\n\t * When this condition is met, it calls the bottomReached callback to potentially load more logs.\n\t */\n\tuseEffect(() => {\n\t\tif (lastVisibleIndex === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastVisibleIndex >= logs.length - 1) {\n\t\t\tonBottomReached();\n\t\t}\n\t}, [logs.length, lastVisibleIndex, onBottomReached]);\n\n\tconst showDivider = (index: number): boolean => {\n\t\tif (index === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst previous = logs[index - 1];\n\t\tconst current = logs[index];\n\n\t\treturn !isSameDay(previous.timestamp, current.timestamp);\n\t};\n\n\tif (logs.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"flex flex-col gap-2 bg-muted p-2 rounded-md font-mono\">\n\t\t\t\t<span className=\"text-muted-foreground\">No logs found</span>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={parentRef}\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-muted rounded-md font-mono p-4 overflow-y-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\trole=\"log\"\n\t\t>\n\t\t\t<ol\n\t\t\t\tclassName=\"relative\"\n\t\t\t\tstyle={{\n\t\t\t\t\theight: `${virtualizer.getTotalSize()}px`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{virtualItems.map((virtualRow) => {\n\t\t\t\t\tconst log = logs[virtualRow.index];\n\t\t\t\t\tconst shouldShowDivider = showDivider(virtualRow.index);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={log.id}\n\t\t\t\t\t\t\tdata-index={virtualRow.index}\n\t\t\t\t\t\t\tref={measureElement}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\ttransform: `translateY(${virtualRow.start}px)`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{shouldShowDivider && (\n\t\t\t\t\t\t\t\t<LogDivider date={new Date(log.timestamp)} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<RunLogRow log={log} taskRunName={taskRun?.name} />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\t\t</div>\n\t);\n};\n\ntype RunLogRowProps = {\n\tlog: components[\"schemas\"][\"Log\"];\n\ttaskRunName?: string;\n};\n\nconst RunLogRow = ({ log, taskRunName }: RunLogRowProps) => {\n\treturn (\n\t\t<div className=\"grid grid-cols-[84px_minmax(0,1fr)_150px] gap-2 text-sm py-2\">\n\t\t\t<div>\n\t\t\t\t<LogLevelBadge level={log.level} />\n\t\t\t</div>\n\t\t\t<div className=\"select-auto whitespace-pre-wrap break-words\">\n\t\t\t\t{log.message}\n\t\t\t</div>\n\t\t\t<div className=\"text-xs grid grid-cols-1 gap-1 justify-items-end text-muted-foreground truncate\">\n\t\t\t\t<span>{format(log.timestamp, \"pp\")}</span>\n\t\t\t\t{taskRunName && <span>{taskRunName}</span>}\n\t\t\t\t<span className=\"font-bold break-all whitespace-normal\">\n\t\t\t\t\t{log.name}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst logLevelBadgeVariants = cva(\"gap-1\", {\n\tvariants: {\n\t\tlevel: {\n\t\t\tCRITICAL: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tERROR: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tWARNING: \"bg-orange-600 text-orange-50 hover:bg-orange-600\",\n\t\t\tINFO: \"bg-sky-600 text-blue-50 hover:bg-sky-600\",\n\t\t\tDEBUG: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t\tCUSTOM: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t} satisfies Record<LogLevel, string>,\n\t},\n});\n\nexport const LogLevelBadge = ({ level }: { level: number }) => {\n\tconst levelLabel = logLevelLabel(level);\n\treturn (\n\t\t<Badge className={logLevelBadgeVariants({ level: levelLabel })}>\n\t\t\t{levelLabel}\n\t\t</Badge>\n\t);\n};\n\ntype LogLevel = \"CRITICAL\" | \"ERROR\" | \"WARNING\" | \"INFO\" | \"DEBUG\" | \"CUSTOM\";\n\nfunction logLevelLabel(level: number): LogLevel {\n\tconst [first] = level.toString();\n\n\tswitch (first) {\n\t\tcase \"5\":\n\t\t\treturn \"CRITICAL\";\n\t\tcase \"4\":\n\t\t\treturn \"ERROR\";\n\t\tcase \"3\":\n\t\t\treturn \"WARNING\";\n\t\tcase \"2\":\n\t\t\treturn \"INFO\";\n\t\tcase \"1\":\n\t\t\treturn \"DEBUG\";\n\t\tdefault:\n\t\t\treturn \"CUSTOM\";\n\t}\n}\n\nconst LogDivider = ({ date }: { date: Date }) => {\n\treturn (\n\t\t<div className=\"flex flex-row justify-center items-center gap-2\">\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t\t<span className=\"text-xs text-muted-foreground whitespace-nowrap\">\n\t\t\t\t{format(date, \"MMM d, yyyy\")}\n\t\t\t</span>\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t</div>\n\t);\n};\n","import { useCallback, useEffect, useState } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n} from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { StateSelect } from \"@/components/ui/state-select\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\nexport type ChangeStateDialogProps = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tcurrentState: { type: string; name: string } | null;\n\tlabel: string;\n\tonConfirm: (newState: { type: string; message?: string }) => void;\n\tisLoading?: boolean;\n};\n\nexport const ChangeStateDialog = ({\n\topen,\n\tonOpenChange,\n\tcurrentState,\n\tlabel,\n\tonConfirm,\n\tisLoading = false,\n}: ChangeStateDialogProps) => {\n\tconst [selectedState, setSelectedState] = useState<StateType | undefined>(\n\t\tundefined,\n\t);\n\tconst [message, setMessage] = useState(\"\");\n\n\tuseEffect(() => {\n\t\tif (!open) {\n\t\t\tsetSelectedState(undefined);\n\t\t\tsetMessage(\"\");\n\t\t}\n\t}, [open]);\n\n\tconst handleConfirm = () => {\n\t\tif (selectedState) {\n\t\t\tonConfirm({\n\t\t\t\ttype: selectedState,\n\t\t\t\tmessage: message || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\tconst isConfirmDisabled = !selectedState || isLoading;\n\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Change {label} State</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<div className=\"space-y-4\">\n\t\t\t\t\t{currentState && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Label className=\"mb-2 block\">Current State</Label>\n\t\t\t\t\t\t\t<StateBadge\n\t\t\t\t\t\t\t\ttype={currentState.type as StateType}\n\t\t\t\t\t\t\t\tname={currentState.name}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"desired-state\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tDesired State\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<StateSelect\n\t\t\t\t\t\t\tvalue={selectedState}\n\t\t\t\t\t\t\tonValueChange={setSelectedState}\n\t\t\t\t\t\t\tterminalOnly\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"message\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tReason (Optional)\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tid=\"message\"\n\t\t\t\t\t\t\tvalue={message}\n\t\t\t\t\t\t\tonChange={(e) => setMessage(e.target.value)}\n\t\t\t\t\t\t\tplaceholder=\"State changed manually via UI\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => onOpenChange(false)}\n\t\t\t\t\t\tdisabled={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tClose\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleConfirm}\n\t\t\t\t\t\tdisabled={isConfirmDisabled}\n\t\t\t\t\t\tloading={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tChange\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\nexport type UseChangeStateDialogResult = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\topenDialog: () => void;\n\tcloseDialog: () => void;\n};\n\nexport const useChangeStateDialog = (): UseChangeStateDialogResult => {\n\tconst [open, setOpen] = useState(false);\n\n\tconst openDialog = useCallback(() => setOpen(true), []);\n\tconst closeDialog = useCallback(() => setOpen(false), []);\n\n\treturn {\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\topenDialog,\n\t\tcloseDialog,\n\t};\n};\n","import { useEffect } from \"react\";\n\ntype StateType =\n\t| \"SCHEDULED\"\n\t| \"PENDING\"\n\t| \"RUNNING\"\n\t| \"COMPLETED\"\n\t| \"FAILED\"\n\t| \"CANCELLED\"\n\t| \"CANCELLING\"\n\t| \"CRASHED\"\n\t| \"PAUSED\";\n\nfunction getPreferredColorScheme(): \"dark\" | \"light\" | \"no-preference\" {\n\tif (window.matchMedia(\"(prefers-color-scheme: dark)\").matches) {\n\t\treturn \"dark\";\n\t}\n\tif (window.matchMedia(\"(prefers-color-scheme: light)\").matches) {\n\t\treturn \"light\";\n\t}\n\treturn \"no-preference\";\n}\n\n/**\n * A hook that sets the browser favicon based on the provided state type.\n * Resets the favicon to the default when the component unmounts.\n *\n * @param stateType - The state type to display in the favicon (e.g., \"COMPLETED\", \"FAILED\")\n * @returns void\n *\n * @example\n * ```tsx\n * // Set favicon based on task run state\n * useStateFavicon(taskRun.state_type);\n * ```\n */\nexport function useStateFavicon(stateType: StateType | null | undefined): void {\n\tuseEffect(() => {\n\t\tconst colorScheme = getPreferredColorScheme();\n\t\tconst favicon16 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-16-dark\")\n\t\t\t\t: document.getElementById(\"favicon-16\");\n\t\tconst favicon32 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-32-dark\")\n\t\t\t\t: document.getElementById(\"favicon-32\");\n\n\t\tif (stateType) {\n\t\t\tconst faviconPath = `/${stateType.toLowerCase()}.svg`;\n\t\t\tfavicon16?.setAttribute(\"href\", faviconPath);\n\t\t\tfavicon32?.setAttribute(\"href\", faviconPath);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Reset to default favicon on unmount\n\t\t\tif (colorScheme === \"dark\") {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16-dark.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32-dark.png\");\n\t\t\t} else {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32.png\");\n\t\t\t}\n\t\t};\n\t}, [stateType]);\n}\n"],"names":["__iconNode","Rows3","createLucideIcon","RunLogs","logs","taskRun","onBottomReached","virtualize","className","parentRef","useRef","logsRef","getItemKey","useCallback","index","virtualizer","useVirtualizer","measureElement","el","virtualItems","_","lastVisibleIndex","useEffect","showDivider","previous","current","isSameDay","jsx","cn","virtualRow","log","shouldShowDivider","jsxs","LogDivider","RunLogRow","taskRunName","LogLevelBadge","format","logLevelBadgeVariants","cva","level","levelLabel","logLevelLabel","Badge","first","date","ChangeStateDialog","open","onOpenChange","currentState","label","onConfirm","isLoading","selectedState","setSelectedState","useState","message","setMessage","handleConfirm","isConfirmDisabled","Dialog","DialogContent","DialogHeader","DialogTitle","Label","StateBadge","StateSelect","Input","e","DialogFooter","Button","useChangeStateDialog","setOpen","openDialog","closeDialog","getPreferredColorScheme","useStateFavicon","stateType","colorScheme","favicon16","favicon32","faviconPath"],"mappings":"gSASA,MAAMA,EAAa,CACjB,CAAC,OAAQ,CAAE,MAAO,KAAM,OAAQ,KAAM,EAAG,IAAK,EAAG,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC9E,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAQ,CAAE,CAC3C,EACMC,EAAQC,EAAiB,SAAUF,CAAU,ECWtCG,EAAU,CAAC,CACvB,KAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,WAAAC,EAAa,GACb,UAAAC,CACD,IAAoB,CACnB,MAAMC,EAAYC,EAAAA,OAAuB,IAAI,EAGvCC,EAAUD,EAAAA,OAAON,CAAI,EAC3BO,EAAQ,QAAUP,EAElB,MAAMQ,EAAaC,EAAAA,YACjBC,GAAkBH,EAAQ,QAAQG,CAAK,GAAG,IAAMA,EACjD,CAAA,CAAC,EAGIC,EAAcC,EAAe,C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MwD,EAAcH,EAAA,EACdI,EACLD,IAAgB,OACb,SAAS,eAAe,iBAAiB,EACzC,SAAS,eAAe,YAAY,EAClCE,EACLF,IAAgB,OACb,SAAS,eAAe,iBAAiB,EACzC,SAAS,eAAe,YAAY,EAExC,GAAID,EAAW,CACd,MAAMI,EAAc,IAAIJ,EAAU,YAAA,CAAa,OAC/CE,GAAW,aAAa,OAAQE,CAAW,EAC3CD,GAAW,aAAa,OAAQC,CAAW,CAC5C,CAEA,MAAO,IAAM,CAERH,IAAgB,QACnBC,GAAW,aAAa,OAAQ,yBAAyB,EACzDC,GAAW,aAAa,OAAQ,yBAAyB,IAEzDD,GAAW,aAAa,OAAQ,oBAAoB,EACpDC,GAAW,aAAa,OAAQ,oBAAoB,EAEtD,CACD,EAAG,CAACH,CAAS,CAAC,CACf","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"use-state-favicon-au2TZdMV.js","sources":["../../node_modules/lucide-react/dist/esm/icons/rows-3.js","../../src/components/ui/run-logs/index.tsx","../../src/components/ui/change-state-dialog/index.tsx","../../src/hooks/use-state-favicon.ts"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M21 9H3\", key: \"1338ky\" }],\n [\"path\", { d: \"M21 15H3\", key: \"9uk58r\" }]\n];\nconst Rows3 = createLucideIcon(\"rows-3\", __iconNode);\n\nexport { __iconNode, Rows3 as default };\n//# sourceMappingURL=rows-3.js.map\n","import { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { cva } from \"class-variance-authority\";\nimport { isSameDay } from \"date-fns\";\nimport { format } from \"date-fns-tz\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/utils\";\n\ntype RunLogsProps = {\n\tlogs: components[\"schemas\"][\"Log\"][];\n\ttaskRun?: components[\"schemas\"][\"TaskRun\"];\n\tonBottomReached: () => void;\n\tvirtualize?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Displays logs from a run in a virtualized list.\n *\n * @param logs - Array of log entries to display\n * @param taskRun - Optional task run information to display with logs\n * @param onBottomReached - Callback function triggered when the user scrolls to the bottom of the logs\n *\n */\nexport const RunLogs = ({\n\tlogs,\n\ttaskRun,\n\tonBottomReached,\n\tvirtualize = true,\n\tclassName,\n}: RunLogsProps) => {\n\tconst parentRef = useRef<HTMLDivElement>(null);\n\n\t// Use a ref to store logs for stable getItemKey callback\n\tconst logsRef = useRef(logs);\n\tlogsRef.current = logs;\n\n\tconst getItemKey = useCallback(\n\t\t(index: number) => logsRef.current[index]?.id ?? index,\n\t\t[],\n\t);\n\n\tconst virtualizer = useVirtualizer({\n\t\tcount: logs.length,\n\t\tgetScrollElement: () => parentRef.current,\n\t\testimateSize: () => 90,\n\t\toverscan: 5,\n\t\tgetItemKey,\n\t});\n\n\t// Wrap measureElement in a stable callback to prevent infinite re-renders\n\tconst measureElement = useCallback(\n\t\t(el: HTMLElement | null) => {\n\t\t\tif (el) {\n\t\t\t\tvirtualizer.measureElement(el);\n\t\t\t}\n\t\t},\n\t\t[virtualizer],\n\t);\n\n\tconst virtualItems = virtualize\n\t\t? virtualizer.getVirtualItems()\n\t\t: Array.from({ length: logs.length }, (_, i) => ({\n\t\t\t\tindex: i,\n\t\t\t\tsize: 90,\n\t\t\t\tstart: i * 90,\n\t\t\t}));\n\n\t// Get the last visible item index for stable effect dependency\n\tconst lastVisibleIndex = virtualItems.at(-1)?.index;\n\n\t/**\n\t * This effect detects when the user has scrolled to the bottom of the logs.\n\t * It works by checking if the last visible virtual item is also the last item in the logs array.\n\t * When this condition is met, it calls the bottomReached callback to potentially load more logs.\n\t */\n\tuseEffect(() => {\n\t\tif (lastVisibleIndex === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastVisibleIndex >= logs.length - 1) {\n\t\t\tonBottomReached();\n\t\t}\n\t}, [logs.length, lastVisibleIndex, onBottomReached]);\n\n\tconst showDivider = (index: number): boolean => {\n\t\tif (index === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst previous = logs[index - 1];\n\t\tconst current = logs[index];\n\n\t\treturn !isSameDay(previous.timestamp, current.timestamp);\n\t};\n\n\tif (logs.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"flex flex-col gap-2 bg-muted p-2 rounded-md font-mono\">\n\t\t\t\t<span className=\"text-muted-foreground\">No logs found</span>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={parentRef}\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-muted rounded-md font-mono p-4 overflow-y-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\trole=\"log\"\n\t\t>\n\t\t\t<ol\n\t\t\t\tclassName=\"relative\"\n\t\t\t\tstyle={{\n\t\t\t\t\theight: `${virtualizer.getTotalSize()}px`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{virtualItems.map((virtualRow) => {\n\t\t\t\t\tconst log = logs[virtualRow.index];\n\t\t\t\t\tconst shouldShowDivider = showDivider(virtualRow.index);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={log.id}\n\t\t\t\t\t\t\tdata-index={virtualRow.index}\n\t\t\t\t\t\t\tref={measureElement}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\ttransform: `translateY(${virtualRow.start}px)`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{shouldShowDivider && (\n\t\t\t\t\t\t\t\t<LogDivider date={new Date(log.timestamp)} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<RunLogRow log={log} taskRunName={taskRun?.name} />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\t\t</div>\n\t);\n};\n\ntype RunLogRowProps = {\n\tlog: components[\"schemas\"][\"Log\"];\n\ttaskRunName?: string;\n};\n\nconst RunLogRow = ({ log, taskRunName }: RunLogRowProps) => {\n\treturn (\n\t\t<div className=\"grid grid-cols-[84px_minmax(0,1fr)_150px] gap-2 text-sm py-2\">\n\t\t\t<div>\n\t\t\t\t<LogLevelBadge level={log.level} />\n\t\t\t</div>\n\t\t\t<div className=\"select-auto whitespace-pre-wrap break-words\">\n\t\t\t\t{log.message}\n\t\t\t</div>\n\t\t\t<div className=\"text-xs grid grid-cols-1 gap-1 justify-items-end text-muted-foreground truncate\">\n\t\t\t\t<span>{format(log.timestamp, \"pp\")}</span>\n\t\t\t\t{taskRunName && <span>{taskRunName}</span>}\n\t\t\t\t<span className=\"font-bold break-all whitespace-normal\">\n\t\t\t\t\t{log.name}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst logLevelBadgeVariants = cva(\"gap-1\", {\n\tvariants: {\n\t\tlevel: {\n\t\t\tCRITICAL: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tERROR: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tWARNING: \"bg-orange-600 text-orange-50 hover:bg-orange-600\",\n\t\t\tINFO: \"bg-sky-600 text-blue-50 hover:bg-sky-600\",\n\t\t\tDEBUG: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t\tCUSTOM: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t} satisfies Record<LogLevel, string>,\n\t},\n});\n\nexport const LogLevelBadge = ({ level }: { level: number }) => {\n\tconst levelLabel = logLevelLabel(level);\n\treturn (\n\t\t<Badge className={logLevelBadgeVariants({ level: levelLabel })}>\n\t\t\t{levelLabel}\n\t\t</Badge>\n\t);\n};\n\ntype LogLevel = \"CRITICAL\" | \"ERROR\" | \"WARNING\" | \"INFO\" | \"DEBUG\" | \"CUSTOM\";\n\nfunction logLevelLabel(level: number): LogLevel {\n\tconst [first] = level.toString();\n\n\tswitch (first) {\n\t\tcase \"5\":\n\t\t\treturn \"CRITICAL\";\n\t\tcase \"4\":\n\t\t\treturn \"ERROR\";\n\t\tcase \"3\":\n\t\t\treturn \"WARNING\";\n\t\tcase \"2\":\n\t\t\treturn \"INFO\";\n\t\tcase \"1\":\n\t\t\treturn \"DEBUG\";\n\t\tdefault:\n\t\t\treturn \"CUSTOM\";\n\t}\n}\n\nconst LogDivider = ({ date }: { date: Date }) => {\n\treturn (\n\t\t<div className=\"flex flex-row justify-center items-center gap-2\">\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t\t<span className=\"text-xs text-muted-foreground whitespace-nowrap\">\n\t\t\t\t{format(date, \"MMM d, yyyy\")}\n\t\t\t</span>\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t</div>\n\t);\n};\n","import { useCallback, useEffect, useState } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n} from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { StateSelect } from \"@/components/ui/state-select\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\nexport type ChangeStateDialogProps = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tcurrentState: { type: string; name: string } | null;\n\tlabel: string;\n\tonConfirm: (newState: { type: string; message?: string }) => void;\n\tisLoading?: boolean;\n};\n\nexport const ChangeStateDialog = ({\n\topen,\n\tonOpenChange,\n\tcurrentState,\n\tlabel,\n\tonConfirm,\n\tisLoading = false,\n}: ChangeStateDialogProps) => {\n\tconst [selectedState, setSelectedState] = useState<StateType | undefined>(\n\t\tundefined,\n\t);\n\tconst [message, setMessage] = useState(\"\");\n\n\tuseEffect(() => {\n\t\tif (!open) {\n\t\t\tsetSelectedState(undefined);\n\t\t\tsetMessage(\"\");\n\t\t}\n\t}, [open]);\n\n\tconst handleConfirm = () => {\n\t\tif (selectedState) {\n\t\t\tonConfirm({\n\t\t\t\ttype: selectedState,\n\t\t\t\tmessage: message || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\tconst isConfirmDisabled = !selectedState || isLoading;\n\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Change {label} State</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<div className=\"space-y-4\">\n\t\t\t\t\t{currentState && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Label className=\"mb-2 block\">Current State</Label>\n\t\t\t\t\t\t\t<StateBadge\n\t\t\t\t\t\t\t\ttype={currentState.type as StateType}\n\t\t\t\t\t\t\t\tname={currentState.name}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"desired-state\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tDesired State\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<StateSelect\n\t\t\t\t\t\t\tvalue={selectedState}\n\t\t\t\t\t\t\tonValueChange={setSelectedState}\n\t\t\t\t\t\t\tterminalOnly\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"message\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tReason (Optional)\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tid=\"message\"\n\t\t\t\t\t\t\tvalue={message}\n\t\t\t\t\t\t\tonChange={(e) => setMessage(e.target.value)}\n\t\t\t\t\t\t\tplaceholder=\"State changed manually via UI\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => onOpenChange(false)}\n\t\t\t\t\t\tdisabled={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tClose\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleConfirm}\n\t\t\t\t\t\tdisabled={isConfirmDisabled}\n\t\t\t\t\t\tloading={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tChange\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\nexport type UseChangeStateDialogResult = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\topenDialog: () => void;\n\tcloseDialog: () => void;\n};\n\nexport const useChangeStateDialog = (): UseChangeStateDialogResult => {\n\tconst [open, setOpen] = useState(false);\n\n\tconst openDialog = useCallback(() => setOpen(true), []);\n\tconst closeDialog = useCallback(() => setOpen(false), []);\n\n\treturn {\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\topenDialog,\n\t\tcloseDialog,\n\t};\n};\n","import { useEffect } from \"react\";\n\ntype StateType =\n\t| \"SCHEDULED\"\n\t| \"PENDING\"\n\t| \"RUNNING\"\n\t| \"COMPLETED\"\n\t| \"FAILED\"\n\t| \"CANCELLED\"\n\t| \"CANCELLING\"\n\t| \"CRASHED\"\n\t| \"PAUSED\";\n\nfunction getPreferredColorScheme(): \"dark\" | \"light\" | \"no-preference\" {\n\tif (window.matchMedia(\"(prefers-color-scheme: dark)\").matches) {\n\t\treturn \"dark\";\n\t}\n\tif (window.matchMedia(\"(prefers-color-scheme: light)\").matches) {\n\t\treturn \"light\";\n\t}\n\treturn \"no-preference\";\n}\n\n/**\n * A hook that sets the browser favicon based on the provided state type.\n * Resets the favicon to the default when the component unmounts.\n *\n * @param stateType - The state type to display in the favicon (e.g., \"COMPLETED\", \"FAILED\")\n * @returns void\n *\n * @example\n * ```tsx\n * // Set favicon based on task run state\n * useStateFavicon(taskRun.state_type);\n * ```\n */\nexport function useStateFavicon(stateType: StateType | null | undefined): void {\n\tuseEffect(() => {\n\t\tconst colorScheme = getPreferredColorScheme();\n\t\tconst favicon16 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-16-dark\")\n\t\t\t\t: document.getElementById(\"favicon-16\");\n\t\tconst favicon32 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-32-dark\")\n\t\t\t\t: document.getElementById(\"favicon-32\");\n\n\t\tif (stateType) {\n\t\t\tconst faviconPath = `/${stateType.toLowerCase()}.svg`;\n\t\t\tfavicon16?.setAttribute(\"href\", faviconPath);\n\t\t\tfavicon32?.setAttribute(\"href\", faviconPath);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Reset to default favicon on unmount\n\t\t\tif (colorScheme === \"dark\") {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16-dark.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32-dark.png\");\n\t\t\t} else {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32.png\");\n\t\t\t}\n\t\t};\n\t}, [stateType]);\n}\n"],"names":["__iconNode","Rows3","createLucideIcon","RunLogs","logs","taskRun","onBottomReached","virtualize","className","parentRef","useRef","logsRef","getItemKey","useCallback","index","virtualizer","useVirtualizer","measureElement","el","virtualItems","_","lastVisibleIndex","useEffect","showDivider","previous","current","isSameDay","jsx","cn","virtualRow","log","shouldShowDivider","jsxs","LogDivider","RunLogRow","taskRunName","LogLevelBadge","format","logLevelBadgeVariants","cva","level","levelLabel","logLevelLabel","Badge","first","date","ChangeStateDialog","open","onOpenChange","currentState","label","onConfirm","isLoading","selectedState","setSelectedState","useState","message","setMessage","handleConfirm","isConfirmDisabled","Dialog","DialogContent","DialogHeader","DialogTitle","Label","StateBadge","StateSelect","Input","e","DialogFooter","Button","useChangeStateDialog","setOpen","openDialog","closeDialog","getPreferredColorScheme","useStateFavicon","stateType","colorScheme","favicon16","favicon32","faviconPath"],"mappings":"kSASA,MAAMA,EAAa,CACjB,CAAC,OAAQ,CAAE,MAAO,KAAM,OAAQ,KAAM,EAAG,IAAK,EAAG,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC9E,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAQ,CAAE,CAC3C,EACMC,EAAQC,EAAiB,SAAUF,CAAU,ECWtCG,EAAU,CAAC,CACvB,KAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,WAAAC,EAAa,GACb,UAAAC,CACD,IAAoB,CACnB,MAAMC,EAAYC,EAAAA,OAAuB,IAAI,EAGvCC,EAAUD,EAAAA,OAAON,CAAI,EAC3BO,EAAQ,QAAUP,EAElB,MAAMQ,EAAaC,EAAAA,YACjBC,GAAkBH,EAAQ,QAAQG,CAAK,GAAG,IAAMA,EACjD,CAAA,CAAC,EAGIC,EAAcC,EAAe,CAClC,MAAOZ,EAAK,OACZ,iBAAkB,IAAMK,EAAU,QAClC,aAAc,IAAM,GACpB,SAAU,EACV,WAAAG,CAAA,CACA,EAGKK,EAAiBJ,EAAAA,YACrBK,GAA2B,CACvBA,GACHH,EAAY,eAAeG,CA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,EAAW,CACd,MAAMI,EAAc,IAAIJ,EAAU,YAAA,CAAa,OAC/CE,GAAW,aAAa,OAAQE,CAAW,EAC3CD,GAAW,aAAa,OAAQC,CAAW,CAC5C,CAEA,MAAO,IAAM,CAERH,IAAgB,QACnBC,GAAW,aAAa,OAAQ,yBAAyB,EACzDC,GAAW,aAAa,OAAQ,yBAAyB,IAEzDD,GAAW,aAAa,OAAQ,oBAAoB,EACpDC,GAAW,aAAa,OAAQ,oBAAoB,EAEtD,CACD,EAAG,CAACH,CAAS,CAAC,CACf","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as d,r as x}from"./vendor-tanstack-BcZfOOfy.js";import{C as j,
|
|
2
|
-
//# sourceMappingURL=use-stepper-
|
|
1
|
+
import{j as d,r as x}from"./vendor-tanstack-BcZfOOfy.js";import{C as j,a_ as f,I as C,ap as y}from"./index-B8vo2Lrg.js";const L=({currentStepNum:e,onClick:s,steps:r,completedSteps:t,visitedSteps:o})=>d.jsx(j,{className:"p-4 flex flex-row items-center justify-around gap-4 overflow-x-auto",children:r.map((n,a)=>{const p=e===a,m=o.has(a),u=t.has(a);return d.jsx(N,{disabled:!m,onClick:()=>s({stepName:n,stepNum:a}),number:a,isActive:p,isComplete:u,name:n},n)})}),N=({isActive:e=!1,isComplete:s=!1,disabled:r=!1,onClick:t=()=>{},number:o,name:n})=>{const a=o+1,p=a<10?`0${a}`:String(a);return d.jsxs("button",{type:"button",className:f("flex items-center gap-3 text-nowrap",r&&"cursor-not-allowed"),disabled:r,onClick:()=>t({number:o,name:n}),children:[s?d.jsx(C,{id:"CircleCheck",color:e?"teal":"grey",className:"size-12"}):d.jsx(v,{isActive:e,label:p}),d.jsx(y,{variant:"bodyLarge",className:f("text-gray-500 border-gray-500 whitespace-nowrap",e&&"text-teal-700 border-teal-700"),children:n})]})},v=({isActive:e=!1,label:s})=>d.jsx("div",{className:f("flex items-center justify-center size-12 rounded-full border-4 text-gray-500 border-gray-500",e&&"text-teal-700 border-teal-700"),children:d.jsx(y,{variant:"bodyLarge",className:f("text-gray-500 border-gray-500",e&&"text-teal-700 border-teal-700"),children:s})}),g=(e=new Set)=>{const[s,r]=x.useState(e),t=x.useMemo(()=>({add:c=>r(l=>new Set([...Array.from(l),c])),remove:c=>r(l=>new Set([...Array.from(l).filter(S=>S!==c)])),toggle:c=>r(l=>l.has(c)?new Set(Array.from(l).filter(S=>S!==c)):new Set([...Array.from(l),c])),clear:()=>r(new Set),reset:()=>r(e)}),[e]),o={has:x.useCallback(n=>s.has(n),[s]),...t};return[s,o]},V=(e,s=0,r)=>{const[t,o]=x.useState(s),[n,{add:a,reset:p}]=g(r??new Set([0])),[m,{add:u,reset:c}]=g(new Set),l=()=>{t<e-1&&(u(t),a(t+1),o(i=>i+1))},S=()=>{t>0&&o(i=>i-1)},b=i=>{o(i)},h=()=>{c(),p(),o(s)},w=t===e-1;return{changeStep:b,completedStepsSet:m,currentStep:t,decrementStep:S,incrementStep:l,isFinalStep:w,isStartingStep:t===0,reset:h,visitedStepsSet:n}};export{L as S,V as u};
|
|
2
|
+
//# sourceMappingURL=use-stepper-DyIb3vlq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-stepper-CDucnvzp.js","sources":["../../src/components/ui/stepper/stepper.tsx","../../src/hooks/use-set.ts","../../src/hooks/use-stepper.ts"],"sourcesContent":["import { Card } from \"@/components/ui/card\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { cn } from \"@/utils\";\n\ntype StepperProps = {\n\tcurrentStepNum: number;\n\tsteps: Array<string> | ReadonlyArray<string>;\n\tonClick: ({\n\t\tstepName,\n\t\tstepNum,\n\t}: {\n\t\tstepName: string;\n\t\tstepNum: number;\n\t}) => void;\n\tcompletedSteps: Set<number>;\n\tvisitedSteps: Set<number>;\n};\nconst Stepper = ({\n\tcurrentStepNum,\n\tonClick,\n\tsteps,\n\tcompletedSteps,\n\tvisitedSteps,\n}: StepperProps) => {\n\treturn (\n\t\t<Card className=\"p-4 flex flex-row items-center justify-around gap-4 overflow-x-auto\">\n\t\t\t{steps.map((step, i) => {\n\t\t\t\tconst isCurrentStep = currentStepNum === i;\n\t\t\t\tconst isStepVisited = visitedSteps.has(i);\n\t\t\t\tconst isStepComplete = completedSteps.has(i);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Step\n\t\t\t\t\t\tkey={step}\n\t\t\t\t\t\tdisabled={!isStepVisited}\n\t\t\t\t\t\tonClick={() => onClick({ stepName: step, stepNum: i })}\n\t\t\t\t\t\tnumber={i}\n\t\t\t\t\t\tisActive={isCurrentStep}\n\t\t\t\t\t\tisComplete={isStepComplete}\n\t\t\t\t\t\tname={step}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Card>\n\t);\n};\n\ntype StepProps = {\n\tisActive?: boolean;\n\tisComplete?: boolean;\n\tdisabled?: boolean;\n\tnumber: number;\n\tname: string;\n\tonClick?: ({ number, name }: { number: number; name: string }) => void;\n};\n\nconst Step = ({\n\tisActive = false,\n\tisComplete = false,\n\tdisabled = false,\n\tonClick = () => {},\n\t/** Assume steps are indexed =0 */\n\tnumber,\n\tname,\n}: StepProps) => {\n\t// add 1 to number assuming index 0\n\tconst adjustedNumberDisplay = number + 1;\n\tconst numberLabel =\n\t\tadjustedNumberDisplay < 10\n\t\t\t? `0${adjustedNumberDisplay}`\n\t\t\t: String(adjustedNumberDisplay);\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex items-center gap-3 text-nowrap\",\n\t\t\t\tdisabled && \"cursor-not-allowed\",\n\t\t\t)}\n\t\t\tdisabled={disabled}\n\t\t\tonClick={() => onClick({ number, name })}\n\t\t>\n\t\t\t{isComplete ? (\n\t\t\t\t<Icon\n\t\t\t\t\tid=\"CircleCheck\"\n\t\t\t\t\tcolor={isActive ? \"teal\" : \"grey\"}\n\t\t\t\t\tclassName=\"size-12\"\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<StepIcon isActive={isActive} label={numberLabel} />\n\t\t\t)}\n\t\t\t<Typography\n\t\t\t\tvariant=\"bodyLarge\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"text-gray-500 border-gray-500 whitespace-nowrap\",\n\t\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{name}\n\t\t\t</Typography>\n\t\t</button>\n\t);\n};\n\ntype StepIconProps = {\n\tlabel: string;\n\tisActive?: boolean;\n};\nconst StepIcon = ({ isActive = false, label }: StepIconProps) => (\n\t<div\n\t\tclassName={cn(\n\t\t\t\"flex items-center justify-center size-12 rounded-full border-4 text-gray-500 border-gray-500\",\n\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t)}\n\t>\n\t\t<Typography\n\t\t\tvariant=\"bodyLarge\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-gray-500 border-gray-500\",\n\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t)}\n\t\t>\n\t\t\t{label}\n\t\t</Typography>\n\t</div>\n);\n\nexport { Step, Stepper };\n","import { useCallback, useMemo, useState } from \"react\";\n\ntype StableActions<K> = {\n\tadd: (key: K) => void;\n\tremove: (key: K) => void;\n\ttoggle: (key: K) => void;\n\treset: () => void;\n\tclear: () => void;\n};\n\ntype Actions<K> = StableActions<K> & {\n\thas: (key: K) => boolean;\n};\n\n/**\n * A hook that is used to declarative to keep state of a 'Set' type of data structure.\n * This is useful in cases where the UX needs to keep track of selected rows by id\n *\n * @param initialSet Initial state of a Set\n * @returns a Set object and utils as a tuple\n *\n * @example\n * ```tsx\n * function FlowCheckboxList() {\n * const [selectedIDs, { has, toggle }] = useSet<string>();\n *\n * return flows.map((flow) =>\n * \t\t<Checkbox\n * \t\t\tkey={flow.id}\n * \t\t\tchecked={has(flow.id)}\n * \t\t\tonCheck={() => toggle(flow.id)}\n * \t\t\tlabel={flow.name} />\n *\n * }\n * ```\n */\nexport const useSet = <K>(initialSet = new Set<K>()): [Set<K>, Actions<K>] => {\n\tconst [set, setSet] = useState(initialSet);\n\n\tconst stableActions = useMemo(() => {\n\t\tconst add = (item: K) =>\n\t\t\tsetSet((curr) => new Set([...Array.from(curr), item]));\n\t\tconst remove = (item: K) =>\n\t\t\tsetSet(\n\t\t\t\t(curr) => new Set([...Array.from(curr).filter((i) => i !== item)]),\n\t\t\t);\n\t\tconst toggle = (item: K) =>\n\t\t\tsetSet((curr) =>\n\t\t\t\tcurr.has(item)\n\t\t\t\t\t? new Set(Array.from(curr).filter((i) => i !== item))\n\t\t\t\t\t: new Set([...Array.from(curr), item]),\n\t\t\t);\n\t\tconst reset = () => setSet(initialSet);\n\t\tconst clear = () => setSet(new Set());\n\n\t\treturn { add, remove, toggle, clear, reset };\n\t}, [initialSet]);\n\n\tconst utils = {\n\t\thas: useCallback((item) => set.has(item), [set]),\n\t\t...stableActions,\n\t} as Actions<K>;\n\n\treturn [set, utils];\n};\n","import { useState } from \"react\";\nimport { useSet } from \"./use-set\";\n/**\n *\n * @param steps\n * @param startingStep\n * @returns state with declarative utilities to increment, decrement, or skip to a current state\n *\n * @example\n * ```ts\n * const STEPS = ['Trigger', 'Actions', 'Details'] as const\n *\n * const stepper = useStepper(STEPS.length);\n *\n * return (\n * <div>\n * <h2>Current Step: {STEPS[stepper.currentStep]}</h2>\n * <ul>\n * {STEPS.map((step, i) => (\n * \t\t\t<li key={i} onClick={() => stepper.setStep(i)}>{step}</li>\n * \t\t)}\n * </ul>\n * <div>\n * <Button disabled={stepper.isStartingStep} onClick={stepper.decrementStep()}>Previous</Button>\n * <Button onClick={stepper.incrementStep()}>{stepper.isFinalStep ? 'Save' : 'Next'}</Button>\n * </div>\n * </div>\n * )\n * ```\n */\nexport const useStepper = (\n\tnumSteps: number,\n\tstartingStep = 0,\n\tinitialVisitedSteps?: Set<number>,\n) => {\n\tconst [currentStep, setCurrentStep] = useState(startingStep);\n\tconst [visitedStepsSet, { add: addVisitedStep, reset: resetVisitedSteps }] =\n\t\tuseSet(initialVisitedSteps ?? new Set<number>([0]));\n\tconst [\n\t\tcompletedStepsSet,\n\t\t{ add: addCompletedStep, reset: resetCompletedSteps },\n\t] = useSet(new Set<number>());\n\n\tconst incrementStep = () => {\n\t\tif (currentStep < numSteps - 1) {\n\t\t\t// Marks step as visited\n\t\t\taddCompletedStep(currentStep);\n\t\t\taddVisitedStep(currentStep + 1);\n\t\t\tsetCurrentStep((curr) => curr + 1);\n\t\t}\n\t};\n\n\tconst decrementStep = () => {\n\t\tif (currentStep > 0) {\n\t\t\tsetCurrentStep((curr) => curr - 1);\n\t\t}\n\t};\n\n\tconst changeStep = (stepNum: number) => {\n\t\tsetCurrentStep(stepNum);\n\t};\n\n\tconst reset = () => {\n\t\tresetCompletedSteps();\n\t\tresetVisitedSteps();\n\t\tsetCurrentStep(startingStep);\n\t};\n\n\tconst isFinalStep = currentStep === numSteps - 1;\n\tconst isStartingStep = currentStep === 0;\n\n\treturn {\n\t\tchangeStep,\n\t\tcompletedStepsSet,\n\t\tcurrentStep,\n\t\tdecrementStep,\n\t\tincrementStep,\n\t\tisFinalStep,\n\t\tisStartingStep,\n\t\treset,\n\t\tvisitedStepsSet,\n\t};\n};\n"],"names":["Stepper","currentStepNum","onClick","steps","completedSteps","visitedSteps","jsx","Card","step","i","isCurrentStep","isStepVisited","isStepComplete","Step","isActive","isComplete","disabled","number","name","adjustedNumberDisplay","numberLabel","jsxs","cn","Icon","StepIcon","Typography","label","useSet","initialSet","set","setSet","useState","stableActions","useMemo","item","curr","utils","useCallback","useStepper","numSteps","startingStep","initialVisitedSteps","currentStep","setCurrentStep","visitedStepsSet","addVisitedStep","resetVisitedSteps","completedStepsSet","addCompletedStep","resetCompletedSteps","incrementStep","decrementStep","changeStep","stepNum","reset","isFinalStep"],"mappings":"wHAkBA,MAAMA,EAAU,CAAC,CAChB,eAAAC,EACA,QAAAC,EACA,MAAA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,EAAgB,IAAM,CACvBR,EAAcH,EAAW,IAE5BS,EAAiBN,CAAW,EAC5BG,EAAeH,EAAc,CAAC,EAC9BC,EAAgBR,GAASA,EAAO,CAAC,EAEnC,EAEMgB,EAAgB,IAAM,CACvBT,EAAc,GACjBC,EAAgBR,GAASA,EAAO,CAAC,CAEnC,EAEMiB,EAAcC,GAAoB,CACvCV,EAAeU,CAAO,CACvB,EAEMC,EAAQ,IAAM,CACnBL,EAAA,EACAH,EAAA,EACAH,EAAeH,CAAY,CAC5B,EAEMe,EAAcb,IAAgBH,EAAW,EAG/C,MAAO,CACN,WAAAa,EACA,kBAAAL,EACA,YAAAL,EACA,cAAAS,EACA,cAAAD,EACA,YAAAK,EACA,eATsBb,IAAgB,EAUtC,MAAAY,EACA,gBAAAV,CAAA,CAEF"}
|
|
1
|
+
{"version":3,"file":"use-stepper-DyIb3vlq.js","sources":["../../src/components/ui/stepper/stepper.tsx","../../src/hooks/use-set.ts","../../src/hooks/use-stepper.ts"],"sourcesContent":["import { Card } from \"@/components/ui/card\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { cn } from \"@/utils\";\n\ntype StepperProps = {\n\tcurrentStepNum: number;\n\tsteps: Array<string> | ReadonlyArray<string>;\n\tonClick: ({\n\t\tstepName,\n\t\tstepNum,\n\t}: {\n\t\tstepName: string;\n\t\tstepNum: number;\n\t}) => void;\n\tcompletedSteps: Set<number>;\n\tvisitedSteps: Set<number>;\n};\nconst Stepper = ({\n\tcurrentStepNum,\n\tonClick,\n\tsteps,\n\tcompletedSteps,\n\tvisitedSteps,\n}: StepperProps) => {\n\treturn (\n\t\t<Card className=\"p-4 flex flex-row items-center justify-around gap-4 overflow-x-auto\">\n\t\t\t{steps.map((step, i) => {\n\t\t\t\tconst isCurrentStep = currentStepNum === i;\n\t\t\t\tconst isStepVisited = visitedSteps.has(i);\n\t\t\t\tconst isStepComplete = completedSteps.has(i);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Step\n\t\t\t\t\t\tkey={step}\n\t\t\t\t\t\tdisabled={!isStepVisited}\n\t\t\t\t\t\tonClick={() => onClick({ stepName: step, stepNum: i })}\n\t\t\t\t\t\tnumber={i}\n\t\t\t\t\t\tisActive={isCurrentStep}\n\t\t\t\t\t\tisComplete={isStepComplete}\n\t\t\t\t\t\tname={step}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Card>\n\t);\n};\n\ntype StepProps = {\n\tisActive?: boolean;\n\tisComplete?: boolean;\n\tdisabled?: boolean;\n\tnumber: number;\n\tname: string;\n\tonClick?: ({ number, name }: { number: number; name: string }) => void;\n};\n\nconst Step = ({\n\tisActive = false,\n\tisComplete = false,\n\tdisabled = false,\n\tonClick = () => {},\n\t/** Assume steps are indexed =0 */\n\tnumber,\n\tname,\n}: StepProps) => {\n\t// add 1 to number assuming index 0\n\tconst adjustedNumberDisplay = number + 1;\n\tconst numberLabel =\n\t\tadjustedNumberDisplay < 10\n\t\t\t? `0${adjustedNumberDisplay}`\n\t\t\t: String(adjustedNumberDisplay);\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex items-center gap-3 text-nowrap\",\n\t\t\t\tdisabled && \"cursor-not-allowed\",\n\t\t\t)}\n\t\t\tdisabled={disabled}\n\t\t\tonClick={() => onClick({ number, name })}\n\t\t>\n\t\t\t{isComplete ? (\n\t\t\t\t<Icon\n\t\t\t\t\tid=\"CircleCheck\"\n\t\t\t\t\tcolor={isActive ? \"teal\" : \"grey\"}\n\t\t\t\t\tclassName=\"size-12\"\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<StepIcon isActive={isActive} label={numberLabel} />\n\t\t\t)}\n\t\t\t<Typography\n\t\t\t\tvariant=\"bodyLarge\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"text-gray-500 border-gray-500 whitespace-nowrap\",\n\t\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{name}\n\t\t\t</Typography>\n\t\t</button>\n\t);\n};\n\ntype StepIconProps = {\n\tlabel: string;\n\tisActive?: boolean;\n};\nconst StepIcon = ({ isActive = false, label }: StepIconProps) => (\n\t<div\n\t\tclassName={cn(\n\t\t\t\"flex items-center justify-center size-12 rounded-full border-4 text-gray-500 border-gray-500\",\n\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t)}\n\t>\n\t\t<Typography\n\t\t\tvariant=\"bodyLarge\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-gray-500 border-gray-500\",\n\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t)}\n\t\t>\n\t\t\t{label}\n\t\t</Typography>\n\t</div>\n);\n\nexport { Step, Stepper };\n","import { useCallback, useMemo, useState } from \"react\";\n\ntype StableActions<K> = {\n\tadd: (key: K) => void;\n\tremove: (key: K) => void;\n\ttoggle: (key: K) => void;\n\treset: () => void;\n\tclear: () => void;\n};\n\ntype Actions<K> = StableActions<K> & {\n\thas: (key: K) => boolean;\n};\n\n/**\n * A hook that is used to declarative to keep state of a 'Set' type of data structure.\n * This is useful in cases where the UX needs to keep track of selected rows by id\n *\n * @param initialSet Initial state of a Set\n * @returns a Set object and utils as a tuple\n *\n * @example\n * ```tsx\n * function FlowCheckboxList() {\n * const [selectedIDs, { has, toggle }] = useSet<string>();\n *\n * return flows.map((flow) =>\n * \t\t<Checkbox\n * \t\t\tkey={flow.id}\n * \t\t\tchecked={has(flow.id)}\n * \t\t\tonCheck={() => toggle(flow.id)}\n * \t\t\tlabel={flow.name} />\n *\n * }\n * ```\n */\nexport const useSet = <K>(initialSet = new Set<K>()): [Set<K>, Actions<K>] => {\n\tconst [set, setSet] = useState(initialSet);\n\n\tconst stableActions = useMemo(() => {\n\t\tconst add = (item: K) =>\n\t\t\tsetSet((curr) => new Set([...Array.from(curr), item]));\n\t\tconst remove = (item: K) =>\n\t\t\tsetSet(\n\t\t\t\t(curr) => new Set([...Array.from(curr).filter((i) => i !== item)]),\n\t\t\t);\n\t\tconst toggle = (item: K) =>\n\t\t\tsetSet((curr) =>\n\t\t\t\tcurr.has(item)\n\t\t\t\t\t? new Set(Array.from(curr).filter((i) => i !== item))\n\t\t\t\t\t: new Set([...Array.from(curr), item]),\n\t\t\t);\n\t\tconst reset = () => setSet(initialSet);\n\t\tconst clear = () => setSet(new Set());\n\n\t\treturn { add, remove, toggle, clear, reset };\n\t}, [initialSet]);\n\n\tconst utils = {\n\t\thas: useCallback((item) => set.has(item), [set]),\n\t\t...stableActions,\n\t} as Actions<K>;\n\n\treturn [set, utils];\n};\n","import { useState } from \"react\";\nimport { useSet } from \"./use-set\";\n/**\n *\n * @param steps\n * @param startingStep\n * @returns state with declarative utilities to increment, decrement, or skip to a current state\n *\n * @example\n * ```ts\n * const STEPS = ['Trigger', 'Actions', 'Details'] as const\n *\n * const stepper = useStepper(STEPS.length);\n *\n * return (\n * <div>\n * <h2>Current Step: {STEPS[stepper.currentStep]}</h2>\n * <ul>\n * {STEPS.map((step, i) => (\n * \t\t\t<li key={i} onClick={() => stepper.setStep(i)}>{step}</li>\n * \t\t)}\n * </ul>\n * <div>\n * <Button disabled={stepper.isStartingStep} onClick={stepper.decrementStep()}>Previous</Button>\n * <Button onClick={stepper.incrementStep()}>{stepper.isFinalStep ? 'Save' : 'Next'}</Button>\n * </div>\n * </div>\n * )\n * ```\n */\nexport const useStepper = (\n\tnumSteps: number,\n\tstartingStep = 0,\n\tinitialVisitedSteps?: Set<number>,\n) => {\n\tconst [currentStep, setCurrentStep] = useState(startingStep);\n\tconst [visitedStepsSet, { add: addVisitedStep, reset: resetVisitedSteps }] =\n\t\tuseSet(initialVisitedSteps ?? new Set<number>([0]));\n\tconst [\n\t\tcompletedStepsSet,\n\t\t{ add: addCompletedStep, reset: resetCompletedSteps },\n\t] = useSet(new Set<number>());\n\n\tconst incrementStep = () => {\n\t\tif (currentStep < numSteps - 1) {\n\t\t\t// Marks step as visited\n\t\t\taddCompletedStep(currentStep);\n\t\t\taddVisitedStep(currentStep + 1);\n\t\t\tsetCurrentStep((curr) => curr + 1);\n\t\t}\n\t};\n\n\tconst decrementStep = () => {\n\t\tif (currentStep > 0) {\n\t\t\tsetCurrentStep((curr) => curr - 1);\n\t\t}\n\t};\n\n\tconst changeStep = (stepNum: number) => {\n\t\tsetCurrentStep(stepNum);\n\t};\n\n\tconst reset = () => {\n\t\tresetCompletedSteps();\n\t\tresetVisitedSteps();\n\t\tsetCurrentStep(startingStep);\n\t};\n\n\tconst isFinalStep = currentStep === numSteps - 1;\n\tconst isStartingStep = currentStep === 0;\n\n\treturn {\n\t\tchangeStep,\n\t\tcompletedStepsSet,\n\t\tcurrentStep,\n\t\tdecrementStep,\n\t\tincrementStep,\n\t\tisFinalStep,\n\t\tisStartingStep,\n\t\treset,\n\t\tvisitedStepsSet,\n\t};\n};\n"],"names":["Stepper","currentStepNum","onClick","steps","completedSteps","visitedSteps","jsx","Card","step","i","isCurrentStep","isStepVisited","isStepComplete","Step","isActive","isComplete","disabled","number","name","adjustedNumberDisplay","numberLabel","jsxs","cn","Icon","StepIcon","Typography","label","useSet","initialSet","set","setSet","useState","stableActions","useMemo","item","curr","utils","useCallback","useStepper","numSteps","startingStep","initialVisitedSteps","currentStep","setCurrentStep","visitedStepsSet","addVisitedStep","resetVisitedSteps","completedStepsSet","addCompletedStep","resetCompletedSteps","incrementStep","decrementStep","changeStep","stepNum","reset","isFinalStep"],"mappings":"wHAkBA,MAAMA,EAAU,CAAC,CAChB,eAAAC,EACA,QAAAC,EACA,MAAAC,EACA,eAAAC,EACA,aAAAC,CACD,IAEEC,MAACC,GAAK,UAAU,sEACd,WAAM,IAAI,CAACC,EAAMC,IAAM,CACvB,MAAMC,EAAgBT,IAAmBQ,EACnCE,EAAgBN,EAAa,IAAII,CAAC,EAClCG,EAAiBR,EAAe,IAAIK,CAAC,EAE3C,OACCH,EAAAA,IAACO,EAAA,CAEA,SAAU,CA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CAAO,CACvB,EAEMC,EAAQ,IAAM,CACnBL,EAAA,EACAH,EAAA,EACAH,EAAeH,CAAY,CAC5B,EAEMe,EAAcb,IAAgBH,EAAW,EAG/C,MAAO,CACN,WAAAa,EACA,kBAAAL,EACA,YAAAL,EACA,cAAAS,EACA,cAAAD,EACA,YAAAK,EACA,eATsBb,IAAgB,EAUtC,MAAAY,EACA,gBAAAV,CAAA,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as a}from"./vendor-tanstack-BcZfOOfy.js";import{L as n,
|
|
2
|
-
//# sourceMappingURL=utilities-
|
|
1
|
+
import{j as a}from"./vendor-tanstack-BcZfOOfy.js";import{L as n,a_ as o,f}from"./index-B8vo2Lrg.js";function p({value:e,className:t,hideLineNumbers:s=!0,copy:r=!0,...i}){return a.jsx(n,{value:e,disabled:!0,hideLineNumbers:s,copy:r,className:o("bg-muted/50",t),...i})}function u(e){const t=[],s=e.split(".");for(let r=1;r<s.length;r++){const i=s.slice(0,r).join(".");t.push(`${i}.*`)}return[...t,e]}function m(e){let t=e;return t.startsWith("prefect.")?t=t.slice(8):t.startsWith("prefect-cloud.")&&(t=t.slice(14)),t.split(/[._-]/).map(s=>f(s.toLowerCase())).join(" ")}export{p as J,m as f,u as g};
|
|
2
|
+
//# sourceMappingURL=utilities-D9Y2wo66.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities-
|
|
1
|
+
{"version":3,"file":"utilities-D9Y2wo66.js","sources":["../../src/components/ui/json-view.tsx","../../src/components/events/events-timeline/utilities.ts"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/utils\";\nimport { LazyJsonInput as JsonInput } from \"./json-input-lazy\";\n\ntype JsonViewProps = Omit<\n\tReact.ComponentProps<typeof JsonInput>,\n\t\"onChange\" | \"onBlur\" | \"disabled\"\n> & {\n\tvalue?: string;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport function JsonView({\n\tvalue,\n\tclassName,\n\thideLineNumbers = true,\n\tcopy = true,\n\t...props\n}: JsonViewProps) {\n\treturn (\n\t\t<JsonInput\n\t\t\tvalue={value}\n\t\t\tdisabled={true}\n\t\t\thideLineNumbers={hideLineNumbers}\n\t\t\tcopy={copy}\n\t\t\tclassName={cn(\"bg-muted/50\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { capitalize } from \"@/utils\";\n\n/**\n * Get event prefixes for filtering.\n * For example, \"prefect.flow-run.Completed\" returns:\n * [\"prefect.*\", \"prefect.flow-run.*\", \"prefect.flow-run.Completed\"]\n */\nexport function getEventPrefixes(eventName: string): string[] {\n\tconst prefixes: string[] = [];\n\tconst parts = eventName.split(\".\");\n\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tconst prefix = parts.slice(0, i).join(\".\");\n\t\tprefixes.push(`${prefix}.*`);\n\t}\n\n\treturn [...prefixes, eventName];\n}\n\n/**\n * Format event label from event name.\n * For example, \"prefect.flow-run.Completed\" becomes \"Flow Run Completed\"\n */\nexport function formatEventLabel(eventName: string): string {\n\t// Remove prefect. or prefect-cloud. prefix\n\tlet label = eventName;\n\tif (label.startsWith(\"prefect.\")) {\n\t\tlabel = label.slice(8);\n\t} else if (label.startsWith(\"prefect-cloud.\")) {\n\t\tlabel = label.slice(14);\n\t}\n\n\t// Replace dashes and dots with spaces, then capitalize each word\n\treturn label\n\t\t.split(/[._-]/)\n\t\t.map((word) => capitalize(word.toLowerCase()))\n\t\t.join(\" \");\n}\n"],"names":["JsonView","value","className","hideLineNumbers","copy","props","jsx","JsonInput","cn","getEventPrefixes","eventName","prefixes","parts","i","prefix","formatEventLabel","label","word","capitalize"],"mappings":"oGAcO,SAASA,EAAS,CACxB,MAAAC,EACA,UAAAC,EACA,gBAAAC,EAAkB,GAClB,KAAAC,EAAO,GACP,GAAGC,CACJ,EAAkB,CACjB,OACCC,EAAAA,IAACC,EAAA,CACA,MAAAN,EACA,SAAU,GACV,gBAAAE,EACA,KAAAC,EACA,UAAWI,EAAG,cAAeN,CAAS,EACrC,GAAGG,CAAA,CAAA,CAGP,CCxBO,SAASI,EAAiBC,EAA6B,CAC7D,MAAMC,EAAqB,CAAA,EACrBC,EAAQF,EAAU,MAAM,GAAG,EAEjC,QAASG,EAAI,EAAGA,EAAID,EAAM,OAAQC,IAAK,CACtC,MAAMC,EAASF,EAAM,MAAM,EAAGC,CAAC,EAAE,KAAK,GAAG,EACzCF,EAAS,KAAK,GAAGG,CAAM,IAAI,CAC5B,CAEA,MAAO,CAAC,GAAGH,EAAUD,CAAS,CAC/B,CAMO,SAASK,EAAiBL,EAA2B,CAE3D,IAAIM,EAAQN,EACZ,OAAIM,EAAM,WAAW,UAAU,EAC9BA,EAAQA,EAAM,MAAM,CAAC,EACXA,EAAM,WAAW,gBAAgB,IAC3CA,EAAQA,EAAM,MAAM,EAAE,GAIhBA,EACL,MAAM,OAAO,EACb,IAAKC,GAASC,EAAWD,EAAK,YAAA,CAAa,CAAC,EAC5C,KAAK,GAAG,CACX"}
|