@gearbox-protocol/ui-kit 4.0.0-next.1 → 4.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/base/amount-input/amount-input.cjs +1 -1
- package/dist/cjs/components/base/amount-input/constants.cjs +1 -1
- package/dist/cjs/components/base/amount-input/index.cjs +1 -1
- package/dist/cjs/components/base/amount-input/token-button.cjs +1 -1
- package/dist/cjs/components/base/amount-input/token-select-panel.cjs +1 -0
- package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -0
- package/dist/cjs/components/base/borrow-rate-block/constants.cjs +1 -0
- package/dist/cjs/components/base/borrow-rate-block/index.cjs +1 -0
- package/dist/cjs/components/base/chart-with-side-card/chart-with-side-card.cjs +1 -0
- package/dist/cjs/components/base/chart-with-side-card/constants.cjs +1 -0
- package/dist/cjs/components/base/chart-with-side-card/index.cjs +1 -0
- package/dist/cjs/components/base/details-view/details-view.cjs +1 -1
- package/dist/cjs/components/base/history-chart/history-chart.cjs +1 -1
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/constants.cjs +1 -1
- package/dist/cjs/components/base/info-list/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/leverage-input/leverage-input.cjs +1 -1
- package/dist/cjs/components/base/liquidation-params-table/constants.cjs +1 -0
- package/dist/cjs/components/base/liquidation-params-table/index.cjs +1 -0
- package/dist/cjs/components/base/liquidation-params-table/liquidation-params-table.cjs +1 -0
- package/dist/cjs/components/base/manage-pane/index.cjs +1 -1
- package/dist/cjs/components/base/manage-pane/manage-pane.cjs +1 -1
- package/dist/cjs/components/base/more-accordion/constants.cjs +1 -0
- package/dist/cjs/components/base/more-accordion/index.cjs +1 -0
- package/dist/cjs/components/base/more-accordion/more-accordion.cjs +1 -0
- package/dist/cjs/components/base/nested-info-stack/constants.cjs +1 -0
- package/dist/cjs/components/base/nested-info-stack/index.cjs +1 -0
- package/dist/cjs/components/base/nested-info-stack/nested-info-stack.cjs +1 -0
- package/dist/cjs/components/base/page-title/page-title.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/constants.cjs +1 -0
- package/dist/cjs/components/base/pool-apy-breakdown-card/index.cjs +1 -0
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -0
- package/dist/cjs/components/base/side-card/constants.cjs +1 -0
- package/dist/cjs/components/base/side-card/index.cjs +1 -0
- package/dist/cjs/components/base/side-card/side-card.cjs +1 -0
- package/dist/cjs/components/base/strategy-apy-breakdown-card/constants.cjs +1 -0
- package/dist/cjs/components/base/strategy-apy-breakdown-card/index.cjs +1 -0
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -0
- package/dist/cjs/components/base/tabber/tabber.cjs +1 -1
- package/dist/cjs/components/base/title-meta/constants.cjs +1 -0
- package/dist/cjs/components/base/title-meta/index.cjs +1 -0
- package/dist/cjs/components/base/title-meta/title-meta.cjs +1 -0
- package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
- package/dist/cjs/components/base/token-pair-symbol/constants.cjs +1 -0
- package/dist/cjs/components/base/token-pair-symbol/index.cjs +1 -0
- package/dist/cjs/components/base/token-pair-symbol/token-pair-symbol.cjs +1 -0
- package/dist/cjs/components/base/token-pair-title/constants.cjs +1 -0
- package/dist/cjs/components/base/token-pair-title/index.cjs +1 -0
- package/dist/cjs/components/base/token-pair-title/token-pair-title.cjs +1 -0
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/composites/notification-center/notification-center.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
- package/dist/cjs/components/explorer-links-dropdown/explorer-links-dropdown.cjs +1 -1
- package/dist/cjs/components/explorer-links-dropdown/index.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/icons/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/index.cjs +1 -1
- package/dist/cjs/components/modal/modal.cjs +1 -1
- package/dist/cjs/components/table/index.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/hooks/index.cjs +1 -1
- package/dist/cjs/hooks/use-debounce-call.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/base/amount-input/amount-input.js +179 -147
- package/dist/esm/components/base/amount-input/constants.js +2 -0
- package/dist/esm/components/base/amount-input/index.js +5 -3
- package/dist/esm/components/base/amount-input/token-button.js +65 -35
- package/dist/esm/components/base/amount-input/token-select-panel.js +85 -0
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +88 -0
- package/dist/esm/components/base/borrow-rate-block/constants.js +8 -0
- package/dist/esm/components/base/borrow-rate-block/index.js +6 -0
- package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +36 -0
- package/dist/esm/components/base/chart-with-side-card/constants.js +8 -0
- package/dist/esm/components/base/chart-with-side-card/index.js +6 -0
- package/dist/esm/components/base/details-view/details-view.js +37 -32
- package/dist/esm/components/base/history-chart/history-chart.js +25 -21
- package/dist/esm/components/base/index.js +165 -116
- package/dist/esm/components/base/info-list/constants.js +1 -0
- package/dist/esm/components/base/info-list/index.js +5 -4
- package/dist/esm/components/base/info-list/info-list.js +44 -23
- package/dist/esm/components/base/leverage-input/leverage-input.js +53 -50
- package/dist/esm/components/base/liquidation-params-table/constants.js +6 -0
- package/dist/esm/components/base/liquidation-params-table/index.js +6 -0
- package/dist/esm/components/base/liquidation-params-table/liquidation-params-table.js +62 -0
- package/dist/esm/components/base/manage-pane/index.js +7 -6
- package/dist/esm/components/base/manage-pane/manage-pane.js +88 -67
- package/dist/esm/components/base/more-accordion/constants.js +7 -0
- package/dist/esm/components/base/more-accordion/index.js +6 -0
- package/dist/esm/components/base/more-accordion/more-accordion.js +51 -0
- package/dist/esm/components/base/nested-info-stack/constants.js +6 -0
- package/dist/esm/components/base/nested-info-stack/index.js +6 -0
- package/dist/esm/components/base/nested-info-stack/nested-info-stack.js +20 -0
- package/dist/esm/components/base/page-title/page-title.js +28 -22
- package/dist/esm/components/base/pool-apy-breakdown-card/constants.js +7 -0
- package/dist/esm/components/base/pool-apy-breakdown-card/index.js +6 -0
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +65 -0
- package/dist/esm/components/base/side-card/constants.js +8 -0
- package/dist/esm/components/base/side-card/index.js +6 -0
- package/dist/esm/components/base/side-card/side-card.js +57 -0
- package/dist/esm/components/base/strategy-apy-breakdown-card/constants.js +7 -0
- package/dist/esm/components/base/strategy-apy-breakdown-card/index.js +6 -0
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +51 -0
- package/dist/esm/components/base/tabber/tabber.js +83 -75
- package/dist/esm/components/base/title-meta/constants.js +8 -0
- package/dist/esm/components/base/title-meta/index.js +6 -0
- package/dist/esm/components/base/title-meta/title-meta.js +68 -0
- package/dist/esm/components/base/token-amount/token-amount.js +12 -12
- package/dist/esm/components/base/token-pair-symbol/constants.js +6 -0
- package/dist/esm/components/base/token-pair-symbol/index.js +6 -0
- package/dist/esm/components/base/token-pair-symbol/token-pair-symbol.js +33 -0
- package/dist/esm/components/base/token-pair-title/constants.js +6 -0
- package/dist/esm/components/base/token-pair-title/index.js +6 -0
- package/dist/esm/components/base/token-pair-title/token-pair-title.js +20 -0
- package/dist/esm/components/base/values/index.js +8 -7
- package/dist/esm/components/base/values/pnl-value.js +8 -8
- package/dist/esm/components/base/values/scalars.js +27 -26
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +19 -29
- package/dist/esm/components/checkbox/checkbox-labeled.js +16 -26
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +16 -26
- package/dist/esm/components/composites/notification-center/notification-center.js +1 -1
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +2 -3
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +14 -13
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +6 -7
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +25 -35
- package/dist/esm/components/explorer-links-dropdown/explorer-links-dropdown.js +1 -83
- package/dist/esm/components/explorer-links-dropdown/index.js +1 -4
- package/dist/esm/components/graph/graph-view.js +74 -74
- package/dist/esm/components/graph/graph.js +309 -308
- package/dist/esm/components/icons/index.js +29 -28
- package/dist/esm/components/index.js +699 -709
- package/dist/esm/components/layout/index.js +14 -33
- package/dist/esm/components/modal/modal.js +1 -1
- package/dist/esm/components/table/index.js +38 -52
- package/dist/esm/components/with-copy/with-copy.js +16 -26
- package/dist/esm/hooks/index.js +29 -54
- package/dist/esm/hooks/use-debounce-call.js +2 -3
- package/dist/esm/index.js +864 -900
- package/dist/esm/locale/en.json.js +24 -1
- package/dist/globals.css +1 -1
- package/dist/types/components/base/amount-input/amount-input.d.ts +13 -2
- package/dist/types/components/base/amount-input/constants.d.ts +2 -0
- package/dist/types/components/base/amount-input/index.d.ts +1 -0
- package/dist/types/components/base/amount-input/token-button.d.ts +14 -2
- package/dist/types/components/base/amount-input/token-select-panel.d.ts +17 -0
- package/dist/types/components/base/borrow-rate-block/borrow-rate-block.d.ts +21 -0
- package/dist/types/components/base/borrow-rate-block/constants.d.ts +5 -0
- package/dist/types/components/base/borrow-rate-block/index.d.ts +2 -0
- package/dist/types/components/base/chart-with-side-card/chart-with-side-card.d.ts +13 -0
- package/dist/types/components/base/chart-with-side-card/constants.d.ts +5 -0
- package/dist/types/components/base/chart-with-side-card/index.d.ts +2 -0
- package/dist/types/components/base/detailed-page-title/detailed-page-title.d.ts +2 -1
- package/dist/types/components/base/history-chart/history-chart.d.ts +8 -1
- package/dist/types/components/base/index.d.ts +11 -0
- package/dist/types/components/base/info-list/constants.d.ts +1 -0
- package/dist/types/components/base/info-list/info-list.d.ts +8 -1
- package/dist/types/components/base/leverage-input/leverage-input.d.ts +1 -1
- package/dist/types/components/base/liquidation-params-table/constants.d.ts +3 -0
- package/dist/types/components/base/liquidation-params-table/index.d.ts +2 -0
- package/dist/types/components/base/liquidation-params-table/liquidation-params-table.d.ts +12 -0
- package/dist/types/components/base/manage-pane/manage-pane.d.ts +7 -0
- package/dist/types/components/base/more-accordion/constants.d.ts +4 -0
- package/dist/types/components/base/more-accordion/index.d.ts +2 -0
- package/dist/types/components/base/more-accordion/more-accordion.d.ts +11 -0
- package/dist/types/components/base/nested-info-stack/constants.d.ts +3 -0
- package/dist/types/components/base/nested-info-stack/index.d.ts +2 -0
- package/dist/types/components/base/nested-info-stack/nested-info-stack.d.ts +10 -0
- package/dist/types/components/base/page-title/page-title.d.ts +6 -2
- package/dist/types/components/base/pool-apy-breakdown-card/constants.d.ts +4 -0
- package/dist/types/components/base/pool-apy-breakdown-card/index.d.ts +2 -0
- package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +14 -0
- package/dist/types/components/base/side-card/constants.d.ts +5 -0
- package/dist/types/components/base/side-card/index.d.ts +2 -0
- package/dist/types/components/base/side-card/side-card.d.ts +16 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/constants.d.ts +4 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/index.d.ts +2 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +9 -0
- package/dist/types/components/base/tabber/tabber.d.ts +11 -2
- package/dist/types/components/base/title-meta/constants.d.ts +5 -0
- package/dist/types/components/base/title-meta/index.d.ts +2 -0
- package/dist/types/components/base/title-meta/title-meta.d.ts +15 -0
- package/dist/types/components/base/token-pair-symbol/constants.d.ts +3 -0
- package/dist/types/components/base/token-pair-symbol/index.d.ts +2 -0
- package/dist/types/components/base/token-pair-symbol/token-pair-symbol.d.ts +15 -0
- package/dist/types/components/base/token-pair-title/constants.d.ts +3 -0
- package/dist/types/components/base/token-pair-title/index.d.ts +2 -0
- package/dist/types/components/base/token-pair-title/token-pair-title.d.ts +11 -0
- package/dist/types/components/base/values/index.d.ts +1 -1
- package/dist/types/components/base/values/position-type-badge.d.ts +1 -1
- package/dist/types/components/base/values/scalars.d.ts +9 -0
- package/dist/types/components/base-link/base-link.d.ts +1 -1
- package/dist/types/components/buttons/button/button.d.ts +2 -2
- package/dist/types/components/checkbox/checkbox.d.ts +2 -2
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +1 -1
- package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +4 -1
- package/dist/types/components/dialog/dialog-container.d.ts +3 -3
- package/dist/types/components/edit-input/edit-input.d.ts +1 -1
- package/dist/types/components/explorer-links-dropdown/explorer-links-dropdown.d.ts +6 -75
- package/dist/types/components/filter/variants.d.ts +1 -1
- package/dist/types/components/graph/graph-view.d.ts +1 -1
- package/dist/types/components/health-factor/health-factor.d.ts +2 -1
- package/dist/types/components/icons/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +0 -6
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components/layout/index.d.ts +0 -7
- package/dist/types/components/skeleton/skeleton.d.ts +2 -2
- package/dist/types/components/status-dot/status-dot.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +0 -5
- package/dist/types/components/text-button/text-button.d.ts +1 -1
- package/dist/types/components/tip-card/tip-card.d.ts +2 -2
- package/dist/types/components/token-symbol/token-symbol.d.ts +1 -1
- package/dist/types/components/vertical-indicator/vertical-indicator.d.ts +2 -2
- package/dist/types/components/with-title/with-title.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -6
- package/dist/types/locale/en.json.d.ts +30 -1
- package/dist/types/types/index.d.ts +0 -2
- package/package.json +3 -15
- package/dist/cjs/components/auth/connect-required.cjs +0 -1
- package/dist/cjs/components/auth/index.cjs +0 -1
- package/dist/cjs/components/auth/signin-required.cjs +0 -1
- package/dist/cjs/components/auth/wallet-ui-context.cjs +0 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +0 -1
- package/dist/cjs/components/block-sync/index.cjs +0 -1
- package/dist/cjs/components/image/image.cjs +0 -1
- package/dist/cjs/components/image/index.cjs +0 -1
- package/dist/cjs/components/layout/app-logo/app-logo.cjs +0 -1
- package/dist/cjs/components/layout/app-logo/index.cjs +0 -1
- package/dist/cjs/components/layout/block/block.cjs +0 -1
- package/dist/cjs/components/layout/block/index.cjs +0 -1
- package/dist/cjs/components/layout/footer/footer.cjs +0 -1
- package/dist/cjs/components/layout/footer/index.cjs +0 -1
- package/dist/cjs/components/layout/header/header.cjs +0 -1
- package/dist/cjs/components/layout/header/index.cjs +0 -1
- package/dist/cjs/components/layout/legal-disclaimer/index.cjs +0 -1
- package/dist/cjs/components/layout/legal-disclaimer/legal-disclaimer.cjs +0 -1
- package/dist/cjs/components/layout/page-layout/index.cjs +0 -1
- package/dist/cjs/components/layout/page-layout/page-layout.cjs +0 -1
- package/dist/cjs/components/layout/social-icons/index.cjs +0 -1
- package/dist/cjs/components/layout/social-icons/social-icons.cjs +0 -1
- package/dist/cjs/components/navbar/index.cjs +0 -1
- package/dist/cjs/components/navbar/navbar-indicator-context.cjs +0 -1
- package/dist/cjs/components/navbar/navbar-with-overflow.cjs +0 -1
- package/dist/cjs/components/navbar/navbar.cjs +0 -1
- package/dist/cjs/components/navitem/index.cjs +0 -1
- package/dist/cjs/components/navitem/navitem.cjs +0 -1
- package/dist/cjs/components/page-title/index.cjs +0 -1
- package/dist/cjs/components/page-title/page-title.cjs +0 -1
- package/dist/cjs/components/pool-apy-tooltip/apy-tooltip.cjs +0 -1
- package/dist/cjs/components/pool-apy-tooltip/index.cjs +0 -1
- package/dist/cjs/components/table/edit-button.cjs +0 -1
- package/dist/cjs/components/table/editable-grid-table.cjs +0 -1
- package/dist/cjs/components/table/editable-table.cjs +0 -1
- package/dist/cjs/components/table/grid-table-loader.cjs +0 -1
- package/dist/cjs/components/table/updated-value.cjs +0 -1
- package/dist/cjs/hooks/use-liquidation/index.cjs +0 -1
- package/dist/cjs/hooks/use-liquidation/types.cjs +0 -1
- package/dist/cjs/hooks/use-liquidation/utils.cjs +0 -1
- package/dist/cjs/test-ids/base.cjs +0 -1
- package/dist/cjs/test-ids/index.cjs +0 -1
- package/dist/cjs/types/component-props.cjs +0 -1
- package/dist/cjs/types/help.cjs +0 -1
- package/dist/cjs/utils/reactochart-compat.cjs +0 -1
- package/dist/esm/components/auth/connect-required.js +0 -37
- package/dist/esm/components/auth/index.js +0 -9
- package/dist/esm/components/auth/signin-required.js +0 -55
- package/dist/esm/components/auth/wallet-ui-context.js +0 -13
- package/dist/esm/components/block-sync/block-sync.js +0 -208
- package/dist/esm/components/block-sync/index.js +0 -4
- package/dist/esm/components/image/image.js +0 -32
- package/dist/esm/components/image/index.js +0 -4
- package/dist/esm/components/layout/app-logo/app-logo.js +0 -99
- package/dist/esm/components/layout/app-logo/index.js +0 -5
- package/dist/esm/components/layout/block/block.js +0 -50
- package/dist/esm/components/layout/block/index.js +0 -4
- package/dist/esm/components/layout/footer/footer.js +0 -237
- package/dist/esm/components/layout/footer/index.js +0 -7
- package/dist/esm/components/layout/header/header.js +0 -93
- package/dist/esm/components/layout/header/index.js +0 -5
- package/dist/esm/components/layout/legal-disclaimer/index.js +0 -4
- package/dist/esm/components/layout/legal-disclaimer/legal-disclaimer.js +0 -46
- package/dist/esm/components/layout/page-layout/index.js +0 -4
- package/dist/esm/components/layout/page-layout/page-layout.js +0 -39
- package/dist/esm/components/layout/social-icons/index.js +0 -4
- package/dist/esm/components/layout/social-icons/social-icons.js +0 -61
- package/dist/esm/components/navbar/index.js +0 -11
- package/dist/esm/components/navbar/navbar-indicator-context.js +0 -46
- package/dist/esm/components/navbar/navbar-with-overflow.js +0 -181
- package/dist/esm/components/navbar/navbar.js +0 -99
- package/dist/esm/components/navitem/index.js +0 -5
- package/dist/esm/components/navitem/navitem.js +0 -124
- package/dist/esm/components/page-title/index.js +0 -6
- package/dist/esm/components/page-title/page-title.js +0 -120
- package/dist/esm/components/pool-apy-tooltip/apy-tooltip.js +0 -154
- package/dist/esm/components/pool-apy-tooltip/index.js +0 -4
- package/dist/esm/components/table/edit-button.js +0 -48
- package/dist/esm/components/table/editable-grid-table.js +0 -121
- package/dist/esm/components/table/editable-table.js +0 -108
- package/dist/esm/components/table/grid-table-loader.js +0 -22
- package/dist/esm/components/table/updated-value.js +0 -49
- package/dist/esm/hooks/use-liquidation/index.js +0 -138
- package/dist/esm/hooks/use-liquidation/types.js +0 -1
- package/dist/esm/hooks/use-liquidation/utils.js +0 -144
- package/dist/esm/test-ids/base.js +0 -44
- package/dist/esm/test-ids/index.js +0 -46
- package/dist/esm/types/component-props.js +0 -1
- package/dist/esm/types/help.js +0 -1
- package/dist/esm/utils/reactochart-compat.js +0 -18
- package/dist/types/components/auth/connect-required.d.ts +0 -32
- package/dist/types/components/auth/index.d.ts +0 -3
- package/dist/types/components/auth/signin-required.d.ts +0 -37
- package/dist/types/components/auth/wallet-ui-context.d.ts +0 -36
- package/dist/types/components/block-sync/block-sync.d.ts +0 -8
- package/dist/types/components/block-sync/index.d.ts +0 -1
- package/dist/types/components/image/image.d.ts +0 -35
- package/dist/types/components/image/index.d.ts +0 -1
- package/dist/types/components/layout/app-logo/app-logo.d.ts +0 -26
- package/dist/types/components/layout/app-logo/index.d.ts +0 -1
- package/dist/types/components/layout/block/block.d.ts +0 -23
- package/dist/types/components/layout/block/index.d.ts +0 -1
- package/dist/types/components/layout/footer/footer.d.ts +0 -53
- package/dist/types/components/layout/footer/index.d.ts +0 -1
- package/dist/types/components/layout/header/header.d.ts +0 -123
- package/dist/types/components/layout/header/index.d.ts +0 -1
- package/dist/types/components/layout/legal-disclaimer/index.d.ts +0 -1
- package/dist/types/components/layout/legal-disclaimer/legal-disclaimer.d.ts +0 -32
- package/dist/types/components/layout/page-layout/index.d.ts +0 -1
- package/dist/types/components/layout/page-layout/page-layout.d.ts +0 -41
- package/dist/types/components/layout/social-icons/index.d.ts +0 -1
- package/dist/types/components/layout/social-icons/social-icons.d.ts +0 -7
- package/dist/types/components/navbar/index.d.ts +0 -3
- package/dist/types/components/navbar/navbar-indicator-context.d.ts +0 -13
- package/dist/types/components/navbar/navbar-with-overflow.d.ts +0 -20
- package/dist/types/components/navbar/navbar.d.ts +0 -25
- package/dist/types/components/navitem/index.d.ts +0 -1
- package/dist/types/components/navitem/navitem.d.ts +0 -67
- package/dist/types/components/page-title/index.d.ts +0 -1
- package/dist/types/components/page-title/page-title.d.ts +0 -77
- package/dist/types/components/pool-apy-tooltip/apy-tooltip.d.ts +0 -20
- package/dist/types/components/pool-apy-tooltip/index.d.ts +0 -1
- package/dist/types/components/table/edit-button.d.ts +0 -51
- package/dist/types/components/table/editable-grid-table.d.ts +0 -120
- package/dist/types/components/table/editable-table.d.ts +0 -101
- package/dist/types/components/table/grid-table-loader.d.ts +0 -25
- package/dist/types/components/table/updated-value.d.ts +0 -34
- package/dist/types/hooks/use-liquidation/index.d.ts +0 -53
- package/dist/types/hooks/use-liquidation/types.d.ts +0 -16
- package/dist/types/hooks/use-liquidation/utils.d.ts +0 -71
- package/dist/types/test-ids/base.d.ts +0 -20
- package/dist/types/test-ids/index.d.ts +0 -9
- package/dist/types/types/component-props.d.ts +0 -16
- package/dist/types/types/help.d.ts +0 -4
- package/dist/types/types/reactochart.d.ts +0 -145
- package/dist/types/utils/reactochart-compat.d.ts +0 -12
- /package/dist/cjs/{test-ids/notification-center.cjs → components/composites/notification-center/constants.cjs} +0 -0
- /package/dist/esm/{test-ids/notification-center.js → components/composites/notification-center/constants.js} +0 -0
- /package/dist/types/{test-ids/notification-center.d.ts → components/composites/notification-center/constants.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as le, jsx as w } from "react/jsx-runtime";
|
|
2
|
-
import { createChart as
|
|
2
|
+
import { createChart as it, CrosshairMode as st, LineStyle as te, LineSeries as ct, AreaSeries as ut } from "lightweight-charts";
|
|
3
3
|
import * as xe from "react";
|
|
4
|
-
import { useRef as
|
|
4
|
+
import { useRef as O, useState as U, useEffect as G, useLayoutEffect as ft } from "react";
|
|
5
5
|
import { useIsMobile as ht } from "../../hooks/use-media-query.js";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as ae } from "../../utils/cn.js";
|
|
7
7
|
import { resolveCSSColor as ee, generateColorsFromBase as fe, hslToHex as dt } from "../../utils/colors.js";
|
|
8
8
|
import { getDefaultOptions as Xe, getDefaultSeries as mt, getDefaultVerticalLine as pt } from "./default-config.js";
|
|
9
9
|
import { getXFormatters as qe, formatExactValue as we, createAdaptiveYAxisFormatter as gt } from "./formatters.js";
|
|
@@ -14,13 +14,13 @@ class St {
|
|
|
14
14
|
_yTop;
|
|
15
15
|
_yBottom;
|
|
16
16
|
_color;
|
|
17
|
-
constructor(l, u,
|
|
18
|
-
this._yTop = l, this._yBottom = u, this._color =
|
|
17
|
+
constructor(l, u, h) {
|
|
18
|
+
this._yTop = l, this._yBottom = u, this._color = h;
|
|
19
19
|
}
|
|
20
20
|
draw(l) {
|
|
21
21
|
l.useBitmapCoordinateSpace((u) => {
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const h = u.context, c = u.verticalPixelRatio, b = this._yTop === null ? 0 : this._yTop * c, L = this._yBottom === null ? u.bitmapSize.height : this._yBottom * c, x = Math.min(b, L), R = Math.max(b, L);
|
|
23
|
+
h.fillStyle = this._color, h.fillRect(0, x, u.bitmapSize.width, R - x);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -49,8 +49,8 @@ class xt {
|
|
|
49
49
|
priceBottom;
|
|
50
50
|
color;
|
|
51
51
|
_paneViews;
|
|
52
|
-
constructor(l, u,
|
|
53
|
-
this.series = l, this.priceTop = u, this.priceBottom =
|
|
52
|
+
constructor(l, u, h, c) {
|
|
53
|
+
this.series = l, this.priceTop = u, this.priceBottom = h, this.color = c, this._paneViews = [new yt(this)];
|
|
54
54
|
}
|
|
55
55
|
updateAllViews() {
|
|
56
56
|
for (const l of this._paneViews) l.update();
|
|
@@ -59,8 +59,8 @@ class xt {
|
|
|
59
59
|
return this._paneViews;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function wt(
|
|
63
|
-
switch (
|
|
62
|
+
function wt(e, l) {
|
|
63
|
+
switch (e) {
|
|
64
64
|
case te.Dotted:
|
|
65
65
|
return [l, l];
|
|
66
66
|
case te.Dashed:
|
|
@@ -78,14 +78,14 @@ class _t {
|
|
|
78
78
|
_color;
|
|
79
79
|
_lineWidth;
|
|
80
80
|
_lineStyle;
|
|
81
|
-
constructor(l, u,
|
|
82
|
-
this._y = l, this._color = u, this._lineWidth =
|
|
81
|
+
constructor(l, u, h, c) {
|
|
82
|
+
this._y = l, this._color = u, this._lineWidth = h, this._lineStyle = c;
|
|
83
83
|
}
|
|
84
84
|
draw(l) {
|
|
85
85
|
l.useBitmapCoordinateSpace((u) => {
|
|
86
86
|
if (this._y === null) return;
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const h = u.context, c = u.verticalPixelRatio, b = Math.max(1, Math.round(this._lineWidth * c)), L = Math.round(this._y * c);
|
|
88
|
+
h.save(), h.strokeStyle = this._color, h.lineWidth = b, h.setLineDash(wt(this._lineStyle, b)), h.beginPath(), h.moveTo(0, L), h.lineTo(u.bitmapSize.width, L), h.stroke(), h.restore();
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -123,8 +123,8 @@ class Tt {
|
|
|
123
123
|
lineWidth;
|
|
124
124
|
lineStyle;
|
|
125
125
|
_paneViews;
|
|
126
|
-
constructor(l, u,
|
|
127
|
-
this.series = l, this.price = u, this.color =
|
|
126
|
+
constructor(l, u, h, c, b) {
|
|
127
|
+
this.series = l, this.price = u, this.color = h, this.lineWidth = c, this.lineStyle = b, this._paneViews = [new Nt(this)];
|
|
128
128
|
}
|
|
129
129
|
updateAllViews() {
|
|
130
130
|
for (const l of this._paneViews) l.update();
|
|
@@ -133,26 +133,26 @@ class Tt {
|
|
|
133
133
|
return this._paneViews;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
function Vt(
|
|
137
|
-
const
|
|
138
|
-
|
|
136
|
+
function Vt(e, l, u) {
|
|
137
|
+
const h = e.labelText ?? "", c = e.value, b = c === void 0 ? "" : typeof c == "number" ? l === "$" ? `$${we(c, void 0, u)}` : l === "%" ? `${we(c, void 0, u)}%` : we(
|
|
138
|
+
c,
|
|
139
139
|
l !== "none" && l !== "%" && l !== "$" ? l : void 0,
|
|
140
140
|
u
|
|
141
|
-
) : String(
|
|
142
|
-
return { labelText:
|
|
141
|
+
) : String(c);
|
|
142
|
+
return { labelText: h, valueStr: b };
|
|
143
143
|
}
|
|
144
144
|
const Ze = 4;
|
|
145
|
-
function Pt(
|
|
146
|
-
const
|
|
145
|
+
function Pt(e, l, u) {
|
|
146
|
+
const h = { left: e, transform: "translateX(-50%)" };
|
|
147
147
|
if (l <= 0 || !u || u <= 0)
|
|
148
|
-
return
|
|
149
|
-
const
|
|
150
|
-
return L < b ? { left: l / 2, transform: "translateX(-50%)" } : { left: Math.min(Math.max(
|
|
148
|
+
return h;
|
|
149
|
+
const c = u / 2, b = Ze + c, L = l - Ze - c;
|
|
150
|
+
return L < b ? { left: l / 2, transform: "translateX(-50%)" } : { left: Math.min(Math.max(e, b), L), transform: "translateX(-50%)" };
|
|
151
151
|
}
|
|
152
|
-
function Lt(
|
|
153
|
-
for (let u =
|
|
154
|
-
if (Number(
|
|
155
|
-
return
|
|
152
|
+
function Lt(e, l) {
|
|
153
|
+
for (let u = e.length - 1; u >= 0; u--)
|
|
154
|
+
if (Number(e[u].time) <= l)
|
|
155
|
+
return e[u].value;
|
|
156
156
|
return 0;
|
|
157
157
|
}
|
|
158
158
|
const _e = [
|
|
@@ -271,25 +271,25 @@ const _e = [
|
|
|
271
271
|
bottom: "rgba(71, 85, 105, 0.04)"
|
|
272
272
|
}
|
|
273
273
|
], Rt = 137.5;
|
|
274
|
-
function Ke(
|
|
275
|
-
if (
|
|
276
|
-
return _e[
|
|
277
|
-
const u = (
|
|
278
|
-
return { line:
|
|
274
|
+
function Ke(e) {
|
|
275
|
+
if (e < _e.length)
|
|
276
|
+
return _e[e];
|
|
277
|
+
const u = (e - _e.length) * Rt % 360, h = dt(u, 70, 50), { topColor: c, bottomColor: b } = fe(h);
|
|
278
|
+
return { line: h, top: c, bottom: b };
|
|
279
279
|
}
|
|
280
280
|
function Ot({
|
|
281
|
-
series:
|
|
281
|
+
series: e,
|
|
282
282
|
className: l,
|
|
283
283
|
showLegend: u = !1,
|
|
284
|
-
onUnselectSeries:
|
|
285
|
-
xMeasureUnit:
|
|
284
|
+
onUnselectSeries: h,
|
|
285
|
+
xMeasureUnit: c = "time",
|
|
286
286
|
yMeasureUnit: b = "token",
|
|
287
287
|
optionsOverrides: L,
|
|
288
|
-
verticalLineOptions:
|
|
289
|
-
priceLineOptions:
|
|
290
|
-
zoneOptions:
|
|
288
|
+
verticalLineOptions: x,
|
|
289
|
+
priceLineOptions: R,
|
|
290
|
+
zoneOptions: E,
|
|
291
291
|
currentValueDecimals: he,
|
|
292
|
-
useSharedPriceScale:
|
|
292
|
+
useSharedPriceScale: j = !1,
|
|
293
293
|
dualYAxis: I = !1,
|
|
294
294
|
defaultVisiblePriceScaleId: Ne = "right",
|
|
295
295
|
leftPriceScaleTitle: Te,
|
|
@@ -299,41 +299,41 @@ function Ot({
|
|
|
299
299
|
yScaleMin: Ve,
|
|
300
300
|
yScaleMinMultiple: Pe,
|
|
301
301
|
visibleTimeFrom: K,
|
|
302
|
-
disableZoom:
|
|
302
|
+
disableZoom: ie = !1,
|
|
303
303
|
hideDefaultTooltip: me = !1
|
|
304
304
|
}) {
|
|
305
|
-
const
|
|
306
|
-
if (
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
309
|
-
return
|
|
305
|
+
const W = O(null), y = O(/* @__PURE__ */ new Map()), pe = O(!1), Le = O(!0), Re = O([]), B = O(null), ge = O(null), se = O(null), V = ht(), X = xe.useMemo(() => e.flatMap((t) => t.data), [e]), Qe = xe.useMemo(() => {
|
|
306
|
+
if (e.length > 0) {
|
|
307
|
+
const t = e[e.length - 1];
|
|
308
|
+
if (t.data.length > 0)
|
|
309
|
+
return t.data[t.data.length - 1];
|
|
310
310
|
}
|
|
311
|
-
}, [
|
|
311
|
+
}, [e]), [Me, be] = U(() => {
|
|
312
312
|
if (!Qe) return;
|
|
313
|
-
const
|
|
314
|
-
for (const
|
|
315
|
-
|
|
316
|
-
return
|
|
317
|
-
}), [ke, q] = U(null), [De, Ie] = U([]), [Ye, Be] = U(0), Fe =
|
|
318
|
-
|
|
319
|
-
const
|
|
313
|
+
const t = /* @__PURE__ */ new Map();
|
|
314
|
+
for (const i of e)
|
|
315
|
+
i.data.length > 0 && t.set(i.label, i.data[i.data.length - 1]);
|
|
316
|
+
return t;
|
|
317
|
+
}), [ke, q] = U(null), [De, Ie] = U([]), [Ye, Be] = U(0), Fe = O(/* @__PURE__ */ new Map()), [Ue, et] = U({}), [ce, tt] = U(0);
|
|
318
|
+
G(() => {
|
|
319
|
+
const t = () => {
|
|
320
320
|
try {
|
|
321
|
-
if (B.current && Be(B.current.clientWidth),
|
|
322
|
-
const s = B.current.clientWidth,
|
|
323
|
-
|
|
321
|
+
if (B.current && Be(B.current.clientWidth), W.current && B.current) {
|
|
322
|
+
const s = B.current.clientWidth, a = B.current.clientHeight;
|
|
323
|
+
W.current.resize(s, a);
|
|
324
324
|
}
|
|
325
325
|
} catch {
|
|
326
326
|
}
|
|
327
|
-
},
|
|
328
|
-
return se.current = n,
|
|
329
|
-
|
|
327
|
+
}, i = B.current, n = i ? new ResizeObserver(t) : null;
|
|
328
|
+
return se.current = n, i && n?.observe(i), () => {
|
|
329
|
+
i && n?.unobserve(i), n?.disconnect(), se.current = null;
|
|
330
330
|
};
|
|
331
|
-
}, []),
|
|
331
|
+
}, []), G(() => {
|
|
332
332
|
if (!ge.current || pe.current) return;
|
|
333
|
-
const
|
|
333
|
+
const t = Xe(), i = ee(
|
|
334
334
|
"hsl(var(--foreground))",
|
|
335
335
|
"rgb(0, 0, 0)"
|
|
336
|
-
), n =
|
|
336
|
+
), n = ie ? {
|
|
337
337
|
handleScale: {
|
|
338
338
|
mouseWheel: !1,
|
|
339
339
|
pinch: !1,
|
|
@@ -346,34 +346,34 @@ function Ot({
|
|
|
346
346
|
horzTouchDrag: !1,
|
|
347
347
|
vertTouchDrag: !1
|
|
348
348
|
}
|
|
349
|
-
} : {}, s =
|
|
350
|
-
...
|
|
349
|
+
} : {}, s = it(ge.current, {
|
|
350
|
+
...t,
|
|
351
351
|
leftPriceScale: {
|
|
352
|
-
...
|
|
352
|
+
...t.leftPriceScale || {},
|
|
353
353
|
visible: !1,
|
|
354
|
-
textColor:
|
|
354
|
+
textColor: i
|
|
355
355
|
},
|
|
356
356
|
rightPriceScale: {
|
|
357
|
-
...
|
|
357
|
+
...t.rightPriceScale || {},
|
|
358
358
|
visible: !V,
|
|
359
|
-
textColor:
|
|
359
|
+
textColor: i
|
|
360
360
|
},
|
|
361
361
|
...V && {
|
|
362
362
|
crosshair: {
|
|
363
|
-
...
|
|
363
|
+
...t.crosshair,
|
|
364
364
|
mode: st.Magnet
|
|
365
365
|
}
|
|
366
366
|
},
|
|
367
367
|
...n,
|
|
368
368
|
...L
|
|
369
369
|
});
|
|
370
|
-
return
|
|
371
|
-
se.current?.disconnect(), se.current = null, s.remove(),
|
|
370
|
+
return W.current = s, pe.current = !0, tt((a) => a + 1), () => {
|
|
371
|
+
se.current?.disconnect(), se.current = null, s.remove(), W.current = null, pe.current = !1, y.current.clear();
|
|
372
372
|
};
|
|
373
|
-
}, [V, L,
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
373
|
+
}, [V, L, ie]), G(() => {
|
|
374
|
+
const t = W.current;
|
|
375
|
+
t && t.applyOptions(
|
|
376
|
+
ie ? {
|
|
377
377
|
handleScale: {
|
|
378
378
|
mouseWheel: !1,
|
|
379
379
|
pinch: !1,
|
|
@@ -401,53 +401,53 @@ function Ot({
|
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
);
|
|
404
|
-
}, [
|
|
405
|
-
const
|
|
406
|
-
if (!
|
|
407
|
-
const n =
|
|
404
|
+
}, [ie]), G(() => {
|
|
405
|
+
const t = W.current;
|
|
406
|
+
if (!t || e.length === 0) return;
|
|
407
|
+
const n = e.filter((r) => r.data.length > 0).length <= 1 ? Ve : Pe, s = c === "time" ? qe(c, X) : qe(c), a = /* @__PURE__ */ new Map();
|
|
408
408
|
{
|
|
409
409
|
let r = 0;
|
|
410
|
-
for (const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
410
|
+
for (const o of e)
|
|
411
|
+
o.data.length !== 0 && (a.set(
|
|
412
|
+
o.label,
|
|
413
|
+
o.priceScaleId ?? (r === 0 ? "left" : "right")
|
|
414
414
|
), r++);
|
|
415
415
|
}
|
|
416
|
-
const f = (r,
|
|
416
|
+
const f = (r, o, m) => {
|
|
417
417
|
const {
|
|
418
418
|
formatter: D,
|
|
419
419
|
tickmarksFormatter: T,
|
|
420
|
-
updateVisibleRange:
|
|
420
|
+
updateVisibleRange: $,
|
|
421
421
|
updateLastValues: We
|
|
422
|
-
} = gt(r,
|
|
422
|
+
} = gt(r, o, {
|
|
423
423
|
yScaleMin: n
|
|
424
|
-
}), Ce =
|
|
425
|
-
return We(Ce), { formatter: D, tickmarksFormatter: T, updateVisibleRange:
|
|
424
|
+
}), Ce = e.filter((J) => J.data.length > 0 && m.has(J.label)).map((J) => J.data[J.data.length - 1].value);
|
|
425
|
+
return We(Ce), { formatter: D, tickmarksFormatter: T, updateVisibleRange: $, labels: m };
|
|
426
426
|
}, d = [];
|
|
427
427
|
if (I)
|
|
428
428
|
for (const r of ["left", "right"]) {
|
|
429
|
-
const
|
|
429
|
+
const o = /* @__PURE__ */ new Set(), m = [];
|
|
430
430
|
let D = b;
|
|
431
|
-
for (const T of
|
|
432
|
-
if (T.data.length !== 0 &&
|
|
433
|
-
|
|
434
|
-
for (const
|
|
431
|
+
for (const T of e)
|
|
432
|
+
if (T.data.length !== 0 && a.get(T.label) === r) {
|
|
433
|
+
o.size === 0 && T.yMeasureUnit && (D = T.yMeasureUnit), o.add(T.label);
|
|
434
|
+
for (const $ of T.data) m.push($.value);
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
o.size > 0 && d.push(f(m, D, o));
|
|
437
437
|
}
|
|
438
438
|
else {
|
|
439
|
-
const r = X.map((m) => m.value),
|
|
440
|
-
|
|
439
|
+
const r = X.map((m) => m.value), o = new Set(
|
|
440
|
+
e.filter((m) => m.data.length > 0).map((m) => m.label)
|
|
441
441
|
);
|
|
442
|
-
d.push(f(r, b,
|
|
442
|
+
d.push(f(r, b, o));
|
|
443
443
|
}
|
|
444
444
|
Re.current = d;
|
|
445
445
|
const v = /* @__PURE__ */ new Map();
|
|
446
446
|
for (const r of d)
|
|
447
|
-
for (const
|
|
448
|
-
v.set(
|
|
447
|
+
for (const o of r.labels)
|
|
448
|
+
v.set(o, r);
|
|
449
449
|
const C = Xe();
|
|
450
|
-
|
|
450
|
+
t.applyOptions({
|
|
451
451
|
localization: {
|
|
452
452
|
...C.localization || {},
|
|
453
453
|
// biome-ignore lint/suspicious/noExplicitAny: External library type compatibility
|
|
@@ -463,26 +463,26 @@ function Ot({
|
|
|
463
463
|
minBarSpacing: 0
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
|
-
const P = (X.length > 0 ? Math.min(...X.map((r) => r.value)) : 0) < 0, _ = X.some((r) => r.value === 0), p = !P && _, S = !I &&
|
|
466
|
+
const P = (X.length > 0 ? Math.min(...X.map((r) => r.value)) : 0) < 0, _ = X.some((r) => r.value === 0), p = !P && _, S = !I && e.length > 1 && !j, M = I ? V : e.length > 1 && !j || V, k = ee(
|
|
467
467
|
"hsl(var(--foreground))",
|
|
468
468
|
"rgb(0, 0, 0)"
|
|
469
469
|
);
|
|
470
|
-
|
|
470
|
+
t.applyOptions({
|
|
471
471
|
...I && {
|
|
472
472
|
defaultVisiblePriceScaleId: Ne
|
|
473
473
|
},
|
|
474
474
|
leftPriceScale: {
|
|
475
475
|
...C.leftPriceScale || {},
|
|
476
476
|
visible: I && !V,
|
|
477
|
-
textColor:
|
|
477
|
+
textColor: k,
|
|
478
478
|
...I && Te && {
|
|
479
479
|
// lightweight-charts uses scale margins; title shown via localization if needed
|
|
480
480
|
}
|
|
481
481
|
},
|
|
482
482
|
rightPriceScale: {
|
|
483
483
|
...C.rightPriceScale || {},
|
|
484
|
-
visible: I ? !V : !
|
|
485
|
-
textColor:
|
|
484
|
+
visible: I ? !V : !M,
|
|
485
|
+
textColor: k,
|
|
486
486
|
...p && !I && {
|
|
487
487
|
scaleMargins: {
|
|
488
488
|
top: 0.3,
|
|
@@ -491,73 +491,73 @@ function Ot({
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
|
-
const N = new Set(
|
|
494
|
+
const N = new Set(y.current.keys()), Z = new Set(e.map((r) => r.label));
|
|
495
495
|
for (const r of N)
|
|
496
496
|
if (!Z.has(r)) {
|
|
497
|
-
const
|
|
498
|
-
|
|
497
|
+
const o = y.current.get(r);
|
|
498
|
+
o && (t.removeSeries(o), y.current.delete(r));
|
|
499
499
|
}
|
|
500
500
|
const Q = mt(), oe = [];
|
|
501
501
|
let re = 0;
|
|
502
|
-
const Ee =
|
|
503
|
-
if (
|
|
504
|
-
for (const r of
|
|
502
|
+
const Ee = e.find((r) => r.data.length > 0), ne = /* @__PURE__ */ new Map();
|
|
503
|
+
if (R && R.length > 0)
|
|
504
|
+
for (const r of R) {
|
|
505
505
|
if (!Number.isFinite(r.price)) continue;
|
|
506
|
-
const
|
|
507
|
-
if (!
|
|
508
|
-
const m = ne.get(
|
|
509
|
-
m.push(r.price), ne.set(
|
|
506
|
+
const o = r.seriesLabel ?? Ee?.label;
|
|
507
|
+
if (!o) continue;
|
|
508
|
+
const m = ne.get(o) ?? [];
|
|
509
|
+
m.push(r.price), ne.set(o, m);
|
|
510
510
|
}
|
|
511
|
-
if (
|
|
512
|
-
for (const r of
|
|
513
|
-
const
|
|
514
|
-
if (!
|
|
515
|
-
const m = ne.get(
|
|
516
|
-
Number.isFinite(r.priceTop) && m.push(r.priceTop), Number.isFinite(r.priceBottom) && m.push(r.priceBottom), ne.set(
|
|
511
|
+
if (E && E.length > 0)
|
|
512
|
+
for (const r of E) {
|
|
513
|
+
const o = r.seriesLabel ?? Ee?.label;
|
|
514
|
+
if (!o) continue;
|
|
515
|
+
const m = ne.get(o) ?? [];
|
|
516
|
+
Number.isFinite(r.priceTop) && m.push(r.priceTop), Number.isFinite(r.priceBottom) && m.push(r.priceBottom), ne.set(o, m);
|
|
517
517
|
}
|
|
518
|
-
for (let r = 0; r <
|
|
519
|
-
const
|
|
520
|
-
let T,
|
|
521
|
-
if (
|
|
522
|
-
if (
|
|
523
|
-
T =
|
|
524
|
-
else if (
|
|
518
|
+
for (let r = 0; r < e.length; r++) {
|
|
519
|
+
const o = e[r], m = Ke(r), D = o.lineColor ?? o.color ?? m.line;
|
|
520
|
+
let T, $;
|
|
521
|
+
if (o.lineColor ?? o.color)
|
|
522
|
+
if (o.topColor && o.bottomColor)
|
|
523
|
+
T = o.topColor, $ = o.bottomColor;
|
|
524
|
+
else if (o.topColor) {
|
|
525
525
|
const g = fe(D);
|
|
526
|
-
T =
|
|
527
|
-
} else if (
|
|
528
|
-
T = fe(D).topColor,
|
|
526
|
+
T = o.topColor, $ = g.bottomColor;
|
|
527
|
+
} else if (o.bottomColor)
|
|
528
|
+
T = fe(D).topColor, $ = o.bottomColor;
|
|
529
529
|
else {
|
|
530
530
|
const g = fe(D);
|
|
531
|
-
T = g.topColor,
|
|
531
|
+
T = g.topColor, $ = g.bottomColor;
|
|
532
532
|
}
|
|
533
533
|
else
|
|
534
|
-
T =
|
|
535
|
-
if (
|
|
536
|
-
const g =
|
|
537
|
-
g && (
|
|
534
|
+
T = o.topColor || m.top, $ = o.bottomColor || m.bottom;
|
|
535
|
+
if (o.data.length === 0) {
|
|
536
|
+
const g = y.current.get(o.label);
|
|
537
|
+
g && (t.removeSeries(g), y.current.delete(o.label));
|
|
538
538
|
continue;
|
|
539
539
|
}
|
|
540
|
-
const Ce = (
|
|
540
|
+
const Ce = (o.data.length > 0 ? Math.min(...o.data.map((g) => g.value)) : 0) < 0, J = o.data.some((g) => g.value === 0), ot = !Ce && J, Ae = I ? o.priceScaleId ?? (re === 0 ? "left" : "right") : j || !S || re === 0 ? "right" : `scale-${re}`;
|
|
541
541
|
S && oe.push({
|
|
542
542
|
priceScaleId: Ae || "right",
|
|
543
543
|
shouldPreventNegativeAxis: ot,
|
|
544
544
|
seriesIndex: re
|
|
545
545
|
});
|
|
546
|
-
const $e = (
|
|
546
|
+
const $e = (j || !S) && n !== void 0 && typeof n == "number", rt = ne.get(o.label) ?? [], nt = (g) => {
|
|
547
547
|
const z = g();
|
|
548
548
|
if (z?.priceRange) {
|
|
549
549
|
$e && (z.priceRange.minValue = n);
|
|
550
|
-
for (const
|
|
551
|
-
|
|
550
|
+
for (const H of rt)
|
|
551
|
+
H < z.priceRange.minValue && (z.priceRange.minValue = H), H > z.priceRange.maxValue && (z.priceRange.maxValue = H);
|
|
552
552
|
}
|
|
553
553
|
return z;
|
|
554
|
-
}, Ge = v.get(
|
|
554
|
+
}, Ge = v.get(o.label) ?? d[0], je = Ge.formatter, lt = Ge.tickmarksFormatter, Se = {
|
|
555
555
|
lineColor: D,
|
|
556
556
|
topColor: T,
|
|
557
|
-
bottomColor:
|
|
557
|
+
bottomColor: $,
|
|
558
558
|
priceScaleId: Ae,
|
|
559
|
-
...
|
|
560
|
-
lineStyle:
|
|
559
|
+
...o.seriesType === "line" && {
|
|
560
|
+
lineStyle: o.lineStyle ?? te.Solid
|
|
561
561
|
},
|
|
562
562
|
priceFormat: {
|
|
563
563
|
type: "custom",
|
|
@@ -568,29 +568,29 @@ function Ot({
|
|
|
568
568
|
tickmarksFormatter: lt
|
|
569
569
|
},
|
|
570
570
|
autoscaleInfoProvider: nt
|
|
571
|
-
}, He =
|
|
572
|
-
let F =
|
|
573
|
-
const Y =
|
|
571
|
+
}, He = o.seriesType === "line";
|
|
572
|
+
let F = y.current.get(o.label);
|
|
573
|
+
const Y = o.data.map((g) => ({
|
|
574
574
|
...g,
|
|
575
575
|
time: g.time
|
|
576
576
|
}));
|
|
577
577
|
if (K !== void 0 && Y.length > 0 && Number(Y[0].time) > K) {
|
|
578
|
-
const g = Number(Y[0].time), z = g - K,
|
|
579
|
-
for (let ye = K; ye < g; ye +=
|
|
578
|
+
const g = Number(Y[0].time), z = g - K, H = 86400, at = z > 180 * H ? 7 * H : z > 30 * H ? H : 6 * 3600, Oe = [];
|
|
579
|
+
for (let ye = K; ye < g; ye += at)
|
|
580
580
|
Oe.push({ time: ye });
|
|
581
581
|
Y.unshift(...Oe);
|
|
582
582
|
}
|
|
583
|
-
F && F.seriesType() !== (He ? "Line" : "Area") && (
|
|
583
|
+
F && F.seriesType() !== (He ? "Line" : "Area") && (t.removeSeries(F), y.current.delete(o.label), F = void 0), F ? (F.applyOptions(Se), F.setData(Y)) : (He ? F = t.addSeries(ct, {
|
|
584
584
|
...Q,
|
|
585
585
|
...Se
|
|
586
|
-
}) : F =
|
|
586
|
+
}) : F = t.addSeries(ut, {
|
|
587
587
|
...Q,
|
|
588
588
|
...Se
|
|
589
|
-
}), F.setData(Y),
|
|
589
|
+
}), F.setData(Y), y.current.set(o.label, F)), re++;
|
|
590
590
|
}
|
|
591
591
|
if (I)
|
|
592
592
|
try {
|
|
593
|
-
const r =
|
|
593
|
+
const r = t.priceScale("left"), o = t.priceScale("right"), m = {
|
|
594
594
|
visible: !V,
|
|
595
595
|
autoScale: !0,
|
|
596
596
|
scaleMargins: { top: 0.1, bottom: 0.1 },
|
|
@@ -598,16 +598,16 @@ function Ot({
|
|
|
598
598
|
borderVisible: !0,
|
|
599
599
|
borderColor: "rgba(224, 227, 235, 0.1)",
|
|
600
600
|
entireTextOnly: !1,
|
|
601
|
-
textColor:
|
|
601
|
+
textColor: k
|
|
602
602
|
};
|
|
603
|
-
r?.applyOptions(m),
|
|
603
|
+
r?.applyOptions(m), o?.applyOptions(m);
|
|
604
604
|
} catch {
|
|
605
605
|
}
|
|
606
606
|
else if (S && oe.length > 0)
|
|
607
607
|
for (const r of oe)
|
|
608
608
|
try {
|
|
609
|
-
const
|
|
610
|
-
|
|
609
|
+
const o = t.priceScale(r.priceScaleId);
|
|
610
|
+
o && o.applyOptions({
|
|
611
611
|
visible: !1,
|
|
612
612
|
autoScale: !0,
|
|
613
613
|
scaleMargins: {
|
|
@@ -622,17 +622,17 @@ function Ot({
|
|
|
622
622
|
borderVisible: !0,
|
|
623
623
|
borderColor: "rgba(224, 227, 235, 0.1)",
|
|
624
624
|
entireTextOnly: !1,
|
|
625
|
-
textColor:
|
|
625
|
+
textColor: k
|
|
626
626
|
});
|
|
627
|
-
} catch (
|
|
627
|
+
} catch (o) {
|
|
628
628
|
console.warn(
|
|
629
629
|
`Failed to configure price scale ${r.priceScaleId} for series ${r.seriesIndex}:`,
|
|
630
|
-
|
|
630
|
+
o
|
|
631
631
|
);
|
|
632
632
|
}
|
|
633
633
|
else if (!S)
|
|
634
634
|
try {
|
|
635
|
-
const r =
|
|
635
|
+
const r = t.priceScale("right");
|
|
636
636
|
r && r.applyOptions({
|
|
637
637
|
visible: !V,
|
|
638
638
|
autoScale: !0,
|
|
@@ -648,24 +648,24 @@ function Ot({
|
|
|
648
648
|
borderVisible: !0,
|
|
649
649
|
borderColor: "rgba(224, 227, 235, 0.1)",
|
|
650
650
|
entireTextOnly: !1,
|
|
651
|
-
textColor:
|
|
651
|
+
textColor: k
|
|
652
652
|
});
|
|
653
653
|
} catch {
|
|
654
654
|
}
|
|
655
|
-
if (n !== void 0 && !V && (
|
|
655
|
+
if (n !== void 0 && !V && (j || !S) && t.applyOptions({
|
|
656
656
|
handleScroll: {
|
|
657
657
|
vertTouchDrag: !1
|
|
658
658
|
}
|
|
659
659
|
}), X.length > 0) {
|
|
660
|
-
const r = X.map((
|
|
660
|
+
const r = X.map((o) => Number(o.time)).filter((o) => Number.isFinite(o));
|
|
661
661
|
if (r.length > 0) {
|
|
662
|
-
const
|
|
662
|
+
const o = Math.min(...r), m = K !== void 0 ? Math.min(K, o) : o, D = Math.max(...r);
|
|
663
663
|
if (Number(m) <= Number(D))
|
|
664
664
|
try {
|
|
665
|
-
|
|
665
|
+
t.timeScale().setVisibleRange({ from: m, to: D });
|
|
666
666
|
} catch {
|
|
667
667
|
try {
|
|
668
|
-
|
|
668
|
+
t.timeScale().fitContent();
|
|
669
669
|
} catch {
|
|
670
670
|
}
|
|
671
671
|
}
|
|
@@ -673,62 +673,62 @@ function Ot({
|
|
|
673
673
|
}
|
|
674
674
|
Le.current && (Le.current = !1);
|
|
675
675
|
const ve = /* @__PURE__ */ new Map();
|
|
676
|
-
for (const r of
|
|
676
|
+
for (const r of e)
|
|
677
677
|
r.data.length > 0 && ve.set(r.label, r.data[r.data.length - 1]);
|
|
678
678
|
be(ve.size > 0 ? ve : void 0);
|
|
679
679
|
}, [
|
|
680
|
-
|
|
680
|
+
e,
|
|
681
681
|
X,
|
|
682
|
-
|
|
682
|
+
c,
|
|
683
683
|
b,
|
|
684
684
|
V,
|
|
685
|
-
|
|
685
|
+
j,
|
|
686
686
|
I,
|
|
687
687
|
Ne,
|
|
688
688
|
Te,
|
|
689
689
|
Ve,
|
|
690
690
|
Pe,
|
|
691
691
|
K,
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
]),
|
|
695
|
-
const
|
|
696
|
-
if (!
|
|
697
|
-
const
|
|
692
|
+
R,
|
|
693
|
+
E
|
|
694
|
+
]), G(() => {
|
|
695
|
+
const t = W.current;
|
|
696
|
+
if (!t || e.length === 0) return;
|
|
697
|
+
const i = e.length === 1;
|
|
698
698
|
let n;
|
|
699
|
-
for (const
|
|
700
|
-
if (
|
|
701
|
-
n =
|
|
699
|
+
for (const a of e)
|
|
700
|
+
if (a.data.length > 0) {
|
|
701
|
+
n = a.data[a.data.length - 1].time;
|
|
702
702
|
break;
|
|
703
703
|
}
|
|
704
704
|
if (!n) return;
|
|
705
|
-
const s = (
|
|
706
|
-
const { time: f = n, seriesData: d, point: v } =
|
|
705
|
+
const s = (a) => {
|
|
706
|
+
const { time: f = n, seriesData: d, point: v } = a || {}, C = Array.from(y.current.values());
|
|
707
707
|
if (!v || !f) {
|
|
708
708
|
const _ = /* @__PURE__ */ new Map();
|
|
709
|
-
for (const p of
|
|
709
|
+
for (const p of e)
|
|
710
710
|
p.data.length > 0 && _.set(p.label, p.data[p.data.length - 1]);
|
|
711
|
-
if (be(_.size > 0 ? _ : void 0),
|
|
711
|
+
if (be(_.size > 0 ? _ : void 0), i || j || me)
|
|
712
712
|
q(null);
|
|
713
713
|
else if (C[0] && n) {
|
|
714
|
-
const S =
|
|
715
|
-
if (
|
|
716
|
-
const
|
|
714
|
+
const S = t.timeScale().timeToCoordinate(n), M = e[0];
|
|
715
|
+
if (M.data.length > 0) {
|
|
716
|
+
const k = M.data[M.data.length - 1].value, N = C[0].priceToCoordinate(k);
|
|
717
717
|
S !== null && N !== null && q({ x: S, y: N });
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
|
-
const
|
|
722
|
+
const A = /* @__PURE__ */ new Map();
|
|
723
723
|
let P;
|
|
724
|
-
for (let _ = 0; _ <
|
|
725
|
-
const p =
|
|
724
|
+
for (let _ = 0; _ < e.length; _++) {
|
|
725
|
+
const p = e[_], S = y.current.get(p.label);
|
|
726
726
|
if (!S) continue;
|
|
727
|
-
const
|
|
727
|
+
const M = d?.get(S), k = M && "value" in M ? M.value : void 0;
|
|
728
728
|
let N;
|
|
729
|
-
if (
|
|
730
|
-
N =
|
|
731
|
-
else if (
|
|
729
|
+
if (k !== void 0)
|
|
730
|
+
N = k;
|
|
731
|
+
else if (i) {
|
|
732
732
|
const Z = Number(f), Q = p.data.length > 0 ? Number(p.data[0].time) : Number.POSITIVE_INFINITY;
|
|
733
733
|
Z < Q ? N = Number.NaN : N = p.data[p.data.length - 1]?.value ?? 0;
|
|
734
734
|
} else {
|
|
@@ -736,18 +736,18 @@ function Ot({
|
|
|
736
736
|
if (Number(f) < Z) continue;
|
|
737
737
|
N = Lt(p.data, Number(f));
|
|
738
738
|
}
|
|
739
|
-
Number.isNaN(N) || (P === void 0 && (P = N),
|
|
739
|
+
Number.isNaN(N) || (P === void 0 && (P = N), A.set(p.label, { value: N, time: f }));
|
|
740
740
|
}
|
|
741
|
-
if (be(
|
|
742
|
-
const p =
|
|
741
|
+
if (be(A), P !== void 0 && C[0]) {
|
|
742
|
+
const p = t.timeScale().timeToCoordinate(f), S = C[0].priceToCoordinate(P);
|
|
743
743
|
if (p !== null && S !== null) {
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
746
|
-
const
|
|
744
|
+
const M = B.current;
|
|
745
|
+
if (M) {
|
|
746
|
+
const k = M.querySelector(
|
|
747
747
|
".LightweightChart"
|
|
748
748
|
);
|
|
749
|
-
if (
|
|
750
|
-
const N =
|
|
749
|
+
if (k) {
|
|
750
|
+
const N = k.getBoundingClientRect(), Z = M.getBoundingClientRect(), Q = p + (N.left - Z.left), oe = S + (N.top - Z.top);
|
|
751
751
|
q({ x: Q, y: oe });
|
|
752
752
|
} else
|
|
753
753
|
q({ x: p, y: S });
|
|
@@ -758,170 +758,170 @@ function Ot({
|
|
|
758
758
|
} else
|
|
759
759
|
q(null);
|
|
760
760
|
};
|
|
761
|
-
return
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
764
|
-
const d =
|
|
761
|
+
return t.subscribeCrosshairMove(s), V && t.subscribeClick(s), !i && !j && !me && requestAnimationFrame(() => {
|
|
762
|
+
const a = Array.from(y.current.values());
|
|
763
|
+
if (a[0] && n && e[0]?.data.length > 0) {
|
|
764
|
+
const d = t.timeScale().timeToCoordinate(n), v = e[0].data[e[0].data.length - 1].value, C = a[0].priceToCoordinate(v);
|
|
765
765
|
d !== null && C !== null && q({ x: d, y: C });
|
|
766
766
|
}
|
|
767
767
|
}), () => {
|
|
768
|
-
|
|
768
|
+
t.unsubscribeCrosshairMove(s), V && t.unsubscribeClick(s);
|
|
769
769
|
};
|
|
770
|
-
}, [
|
|
771
|
-
const
|
|
772
|
-
if (!
|
|
773
|
-
const
|
|
770
|
+
}, [e, j, V, me]), G(() => {
|
|
771
|
+
const t = W.current;
|
|
772
|
+
if (!t || e.length === 0) return;
|
|
773
|
+
const i = t.timeScale(), n = () => {
|
|
774
774
|
const s = Re.current;
|
|
775
775
|
if (s.length === 0) return;
|
|
776
|
-
const
|
|
777
|
-
if (!
|
|
778
|
-
const f = Number(
|
|
776
|
+
const a = i.getVisibleRange();
|
|
777
|
+
if (!a) return;
|
|
778
|
+
const f = Number(a.from), d = Number(a.to);
|
|
779
779
|
for (const v of s) {
|
|
780
780
|
const C = [];
|
|
781
|
-
for (const
|
|
782
|
-
if (v.labels.has(
|
|
783
|
-
for (const P of
|
|
781
|
+
for (const A of e)
|
|
782
|
+
if (v.labels.has(A.label))
|
|
783
|
+
for (const P of A.data) {
|
|
784
784
|
const _ = Number(P.time);
|
|
785
785
|
_ >= f && _ <= d && C.push(P.value);
|
|
786
786
|
}
|
|
787
787
|
C.length > 0 && v.updateVisibleRange(C);
|
|
788
788
|
}
|
|
789
789
|
};
|
|
790
|
-
return
|
|
791
|
-
|
|
790
|
+
return i.subscribeVisibleLogicalRangeChange(n), () => {
|
|
791
|
+
i.unsubscribeVisibleLogicalRangeChange(
|
|
792
792
|
n
|
|
793
793
|
);
|
|
794
794
|
};
|
|
795
|
-
}, [
|
|
796
|
-
const
|
|
797
|
-
if (
|
|
798
|
-
const s = pt(),
|
|
799
|
-
for (const f of
|
|
795
|
+
}, [e]), G(() => {
|
|
796
|
+
const t = W.current, i = Array.from(y.current.values()), n = [];
|
|
797
|
+
if (t && i.length > 0 && x) {
|
|
798
|
+
const s = pt(), a = i[0];
|
|
799
|
+
for (const f of x) {
|
|
800
800
|
const d = {
|
|
801
801
|
...s,
|
|
802
802
|
...f.options || {}
|
|
803
803
|
};
|
|
804
804
|
d.color && (d.color = ee(d.color, d.color));
|
|
805
|
-
const v = new Ct(
|
|
806
|
-
|
|
805
|
+
const v = new Ct(t, a, f.xCoordinate, d);
|
|
806
|
+
a.attachPrimitive(v), n.push(v);
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
809
|
return () => {
|
|
810
|
-
if (
|
|
811
|
-
const s =
|
|
812
|
-
for (const
|
|
810
|
+
if (i.length > 0) {
|
|
811
|
+
const s = i[0];
|
|
812
|
+
for (const a of n)
|
|
813
813
|
try {
|
|
814
|
-
s.detachPrimitive(
|
|
814
|
+
s.detachPrimitive(a);
|
|
815
815
|
} catch {
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
818
|
};
|
|
819
|
-
}, [
|
|
820
|
-
const
|
|
821
|
-
if (
|
|
822
|
-
const n = Array.from(
|
|
819
|
+
}, [x, e, ce]), G(() => {
|
|
820
|
+
const t = [], i = [];
|
|
821
|
+
if (R && R.length > 0) {
|
|
822
|
+
const n = Array.from(y.current.values())[0], s = ee(
|
|
823
823
|
"hsl(var(--destructive))",
|
|
824
824
|
"rgb(239, 68, 68)"
|
|
825
825
|
);
|
|
826
|
-
for (const
|
|
827
|
-
if (!Number.isFinite(
|
|
828
|
-
const f =
|
|
826
|
+
for (const a of R) {
|
|
827
|
+
if (!Number.isFinite(a.price)) continue;
|
|
828
|
+
const f = a.seriesLabel ? y.current.get(a.seriesLabel) : n;
|
|
829
829
|
if (!f) continue;
|
|
830
|
-
const d =
|
|
831
|
-
price:
|
|
830
|
+
const d = a.color ? ee(a.color, a.color) : s, v = a.lineWidth ?? 1, C = a.lineStyle ?? te.Dashed, A = f.createPriceLine({
|
|
831
|
+
price: a.price,
|
|
832
832
|
color: d,
|
|
833
833
|
lineWidth: v,
|
|
834
834
|
lineStyle: C,
|
|
835
|
-
axisLabelVisible:
|
|
836
|
-
title:
|
|
835
|
+
axisLabelVisible: a.axisLabelVisible ?? !0,
|
|
836
|
+
title: a.title ?? ""
|
|
837
837
|
});
|
|
838
|
-
|
|
838
|
+
t.push({ series: f, line: A });
|
|
839
839
|
const P = new Tt(
|
|
840
840
|
f,
|
|
841
|
-
|
|
841
|
+
a.price,
|
|
842
842
|
d,
|
|
843
843
|
v,
|
|
844
844
|
C
|
|
845
845
|
);
|
|
846
|
-
f.attachPrimitive(P),
|
|
846
|
+
f.attachPrimitive(P), i.push({ series: f, primitive: P });
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
849
|
return () => {
|
|
850
|
-
for (const { series: n, primitive: s } of
|
|
850
|
+
for (const { series: n, primitive: s } of i)
|
|
851
851
|
try {
|
|
852
852
|
n.detachPrimitive(s);
|
|
853
853
|
} catch {
|
|
854
854
|
}
|
|
855
|
-
for (const { series: n, line: s } of
|
|
855
|
+
for (const { series: n, line: s } of t)
|
|
856
856
|
try {
|
|
857
857
|
n.removePriceLine(s);
|
|
858
858
|
} catch {
|
|
859
859
|
}
|
|
860
860
|
};
|
|
861
|
-
}, [
|
|
862
|
-
const
|
|
863
|
-
if (
|
|
864
|
-
const
|
|
865
|
-
for (const s of
|
|
866
|
-
const
|
|
867
|
-
if (!
|
|
861
|
+
}, [R, e, ce]), G(() => {
|
|
862
|
+
const t = [];
|
|
863
|
+
if (E && E.length > 0) {
|
|
864
|
+
const i = Array.from(y.current.values())[0], n = "rgba(239, 68, 68, 0.12)";
|
|
865
|
+
for (const s of E) {
|
|
866
|
+
const a = s.seriesLabel ? y.current.get(s.seriesLabel) : i;
|
|
867
|
+
if (!a) continue;
|
|
868
868
|
const f = s.color ? ee(s.color, n) : n, d = new xt(
|
|
869
|
-
|
|
869
|
+
a,
|
|
870
870
|
s.priceTop,
|
|
871
871
|
s.priceBottom,
|
|
872
872
|
f
|
|
873
873
|
);
|
|
874
|
-
|
|
874
|
+
a.attachPrimitive(d), t.push({ series: a, zone: d });
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
return () => {
|
|
878
|
-
for (const { series:
|
|
878
|
+
for (const { series: i, zone: n } of t)
|
|
879
879
|
try {
|
|
880
|
-
|
|
880
|
+
i.detachPrimitive(n);
|
|
881
881
|
} catch {
|
|
882
882
|
}
|
|
883
883
|
};
|
|
884
|
-
}, [
|
|
885
|
-
const
|
|
886
|
-
if (!
|
|
884
|
+
}, [E, e, ce]), G(() => {
|
|
885
|
+
const t = W.current;
|
|
886
|
+
if (!t || !x?.length) {
|
|
887
887
|
Ie([]);
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
|
-
const
|
|
891
|
-
const
|
|
890
|
+
const i = () => {
|
|
891
|
+
const a = t.timeScale(), f = x.map((d) => a.timeToCoordinate(d.xCoordinate) ?? null);
|
|
892
892
|
Ie(f), B.current && Be(B.current.clientWidth);
|
|
893
893
|
};
|
|
894
|
-
|
|
895
|
-
const n =
|
|
896
|
-
|
|
894
|
+
i();
|
|
895
|
+
const n = t.timeScale(), s = () => {
|
|
896
|
+
i();
|
|
897
897
|
};
|
|
898
898
|
return n.subscribeVisibleLogicalRangeChange(s), () => {
|
|
899
899
|
n.unsubscribeVisibleLogicalRangeChange(s);
|
|
900
900
|
};
|
|
901
|
-
}, [
|
|
902
|
-
et((
|
|
903
|
-
const
|
|
901
|
+
}, [x, e, ce]), ft(() => {
|
|
902
|
+
et((t) => {
|
|
903
|
+
const i = {};
|
|
904
904
|
let n = !1;
|
|
905
|
-
for (const [s,
|
|
906
|
-
if (!
|
|
907
|
-
const f =
|
|
908
|
-
|
|
905
|
+
for (const [s, a] of Fe.current) {
|
|
906
|
+
if (!a) continue;
|
|
907
|
+
const f = a.offsetWidth;
|
|
908
|
+
i[s] = f, t[s] !== f && (n = !0);
|
|
909
909
|
}
|
|
910
|
-
return Object.keys(
|
|
910
|
+
return Object.keys(t).length !== Object.keys(i).length && (n = !0), n ? i : t;
|
|
911
911
|
});
|
|
912
912
|
});
|
|
913
|
-
const ue =
|
|
914
|
-
if (ue &&
|
|
915
|
-
const
|
|
916
|
-
if (
|
|
917
|
-
return
|
|
913
|
+
const ue = e.length === 1, ze = xe.useMemo(() => {
|
|
914
|
+
if (ue && e.length > 0) {
|
|
915
|
+
const t = e[0];
|
|
916
|
+
if (t.data.length > 0)
|
|
917
|
+
return t.data[t.data.length - 1];
|
|
918
918
|
}
|
|
919
|
-
}, [ue,
|
|
919
|
+
}, [ue, e]);
|
|
920
920
|
return /* @__PURE__ */ le(
|
|
921
921
|
"div",
|
|
922
922
|
{
|
|
923
923
|
ref: B,
|
|
924
|
-
className:
|
|
924
|
+
className: ae(
|
|
925
925
|
"relative z-[1] w-full h-full overflow-hidden p-0",
|
|
926
926
|
l
|
|
927
927
|
),
|
|
@@ -930,7 +930,7 @@ function Ot({
|
|
|
930
930
|
bt,
|
|
931
931
|
{
|
|
932
932
|
point: ze,
|
|
933
|
-
xMeasureUnit:
|
|
933
|
+
xMeasureUnit: c,
|
|
934
934
|
yMeasureUnit: b,
|
|
935
935
|
decimals: he
|
|
936
936
|
}
|
|
@@ -939,52 +939,52 @@ function Ot({
|
|
|
939
939
|
vt,
|
|
940
940
|
{
|
|
941
941
|
points: Me,
|
|
942
|
-
xMeasureUnit:
|
|
942
|
+
xMeasureUnit: c,
|
|
943
943
|
yMeasureUnit: b,
|
|
944
|
-
series:
|
|
944
|
+
series: e,
|
|
945
945
|
position: ke,
|
|
946
946
|
containerRef: B,
|
|
947
947
|
decimals: he
|
|
948
948
|
}
|
|
949
949
|
),
|
|
950
|
-
u && /* @__PURE__ */ w(Mt, { series:
|
|
951
|
-
|
|
950
|
+
u && /* @__PURE__ */ w(Mt, { series: e, onUnselect: h }),
|
|
951
|
+
x && x.length > 0 && De.length === x.length && /* @__PURE__ */ w(
|
|
952
952
|
"div",
|
|
953
953
|
{
|
|
954
954
|
className: "absolute inset-0 z-[5] pointer-events-none",
|
|
955
955
|
"aria-hidden": !0,
|
|
956
|
-
children:
|
|
957
|
-
const n = De[
|
|
958
|
-
if (n === null || !
|
|
956
|
+
children: x.map((t, i) => {
|
|
957
|
+
const n = De[i], s = t.options ?? {}, a = s.showLabel !== !1;
|
|
958
|
+
if (n === null || !a) return null;
|
|
959
959
|
const { labelText: f, valueStr: d } = Vt(
|
|
960
960
|
s,
|
|
961
961
|
b,
|
|
962
962
|
he
|
|
963
963
|
), v = s.tooltipText ?? "";
|
|
964
964
|
if (!(f || d || v)) return null;
|
|
965
|
-
const
|
|
965
|
+
const A = s.labelBackgroundColor ?? s.color ?? "hsl(var(--background))", P = s.labelTextColor ?? "hsl(var(--foreground))", _ = `${String(t.xCoordinate)}-${f}-${v}`, p = Pt(
|
|
966
966
|
n,
|
|
967
967
|
Ye,
|
|
968
|
-
Ue[
|
|
968
|
+
Ue[i]
|
|
969
969
|
);
|
|
970
970
|
return /* @__PURE__ */ le(
|
|
971
971
|
"div",
|
|
972
972
|
{
|
|
973
973
|
ref: (S) => {
|
|
974
|
-
Fe.current.set(
|
|
974
|
+
Fe.current.set(i, S);
|
|
975
975
|
},
|
|
976
|
-
className:
|
|
976
|
+
className: ae(
|
|
977
977
|
"group absolute top-2 px-2 py-1 rounded text-xs font-medium whitespace-nowrap shadow-sm border border-border",
|
|
978
978
|
v && "pointer-events-auto cursor-default"
|
|
979
979
|
),
|
|
980
980
|
style: {
|
|
981
981
|
...p,
|
|
982
|
-
backgroundColor:
|
|
982
|
+
backgroundColor: A,
|
|
983
983
|
color: P
|
|
984
984
|
},
|
|
985
985
|
children: [
|
|
986
986
|
f && /* @__PURE__ */ w("span", { className: "block", children: f }),
|
|
987
|
-
d && /* @__PURE__ */ w("span", { className:
|
|
987
|
+
d && /* @__PURE__ */ w("span", { className: ae("block", f && "mt-0.5"), children: d }),
|
|
988
988
|
v && /* @__PURE__ */ w(
|
|
989
989
|
"span",
|
|
990
990
|
{
|
|
@@ -1012,44 +1012,45 @@ function Ot({
|
|
|
1012
1012
|
);
|
|
1013
1013
|
}
|
|
1014
1014
|
function Mt({
|
|
1015
|
-
series:
|
|
1015
|
+
series: e,
|
|
1016
1016
|
onUnselect: l,
|
|
1017
1017
|
inline: u = !1
|
|
1018
1018
|
}) {
|
|
1019
|
+
const h = e.every((c) => c.data.length === 0);
|
|
1019
1020
|
return /* @__PURE__ */ w(
|
|
1020
1021
|
"div",
|
|
1021
1022
|
{
|
|
1022
|
-
className:
|
|
1023
|
+
className: ae(
|
|
1023
1024
|
"flex flex-wrap gap-2",
|
|
1024
1025
|
u ? "items-center" : "absolute top-0 left-2 z-[10]"
|
|
1025
1026
|
),
|
|
1026
|
-
children:
|
|
1027
|
-
const
|
|
1027
|
+
children: e.map((c, b) => {
|
|
1028
|
+
const L = Ke(b), x = (c.lineColor ?? c.color) || L.line, R = !h && c.data.length === 0;
|
|
1028
1029
|
return /* @__PURE__ */ le(
|
|
1029
1030
|
"div",
|
|
1030
1031
|
{
|
|
1031
|
-
className:
|
|
1032
|
+
className: ae(
|
|
1032
1033
|
"flex items-center gap-1.5 px-2 py-1 bg-background/80 backdrop-blur-sm rounded border border-border",
|
|
1033
|
-
|
|
1034
|
+
R && "opacity-50"
|
|
1034
1035
|
),
|
|
1035
1036
|
children: [
|
|
1036
1037
|
/* @__PURE__ */ w(
|
|
1037
1038
|
"div",
|
|
1038
1039
|
{
|
|
1039
1040
|
className: "w-3 h-3 rounded-sm",
|
|
1040
|
-
style: { backgroundColor:
|
|
1041
|
+
style: { backgroundColor: x }
|
|
1041
1042
|
}
|
|
1042
1043
|
),
|
|
1043
1044
|
/* @__PURE__ */ le("span", { className: "text-[10px] sm:text-xs font-medium text-foreground", children: [
|
|
1044
1045
|
c.label,
|
|
1045
|
-
|
|
1046
|
+
R && " (no data)"
|
|
1046
1047
|
] }),
|
|
1047
1048
|
l && /* @__PURE__ */ w(
|
|
1048
1049
|
"button",
|
|
1049
1050
|
{
|
|
1050
1051
|
type: "button",
|
|
1051
|
-
onClick: (
|
|
1052
|
-
|
|
1052
|
+
onClick: (E) => {
|
|
1053
|
+
E.stopPropagation(), l(c.label);
|
|
1053
1054
|
},
|
|
1054
1055
|
className: "ml-1 flex items-center justify-center w-4 h-4 rounded-sm hover:bg-muted transition-colors cursor-pointer",
|
|
1055
1056
|
"aria-label": `Remove ${c.label}`,
|