gloomberb 0.20.12 → 0.20.13
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/package.json +1 -1
- package/src/account/billing.ts +3 -2
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -33
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/cli/commands/market.ts +51 -32
- package/src/cli/commands/overview.ts +3 -3
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +9 -0
- package/src/cli/listing-arg.ts +105 -18
- package/src/cli/pane-functions/catalog.ts +55 -7
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +8 -8
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +2 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +101 -15
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +20 -9
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +101 -32
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +1 -1
- package/src/i18n/es.ts +5 -2
- package/src/i18n/ja.ts +5 -2
- package/src/i18n/ko.ts +5 -2
- package/src/i18n/zh-cn.ts +5 -2
- package/src/i18n/zh-tw.ts +5 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +13 -13
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-model.ts +6 -6
- package/src/plugins/builtin/analytics/risk-pane.tsx +6 -5
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +7 -3
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +4 -3
- package/src/plugins/builtin/cpi/model.ts +8 -7
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/model.ts +4 -3
- package/src/plugins/builtin/crypto-board/pane.tsx +8 -8
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +7 -3
- package/src/plugins/builtin/dividend-yield/headless.ts +16 -11
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +19 -11
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +3 -3
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +14 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +2 -2
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +4 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +6 -5
- package/src/plugins/builtin/macro-day/model.ts +2 -1
- package/src/plugins/builtin/macro-day/pane.tsx +4 -4
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/headless.ts +2 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +4 -4
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +2 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -4
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -5
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/overview/model.ts +24 -13
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +33 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/column-values.ts +47 -41
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +2 -0
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/tickers/company-name-listing.ts +2 -2
- package/src/tickers/company-name.ts +17 -1
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/index.ts +19 -0
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +15 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/financial-statements.ts +39 -15
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useMemo } from "react";
|
|
2
3
|
import type { BreadthDay } from "../../../api-client/members";
|
|
3
4
|
import { ChartTableHeader, DataTableView, PaneStatusBody, QueryBar, useChartTableSelection, usePaneNoticeFooter, usePaneStatusFooter, type DataTableColumn } from "../../../components";
|
|
@@ -11,7 +12,7 @@ import { cachedBreadth, loadBreadth } from "./client";
|
|
|
11
12
|
import { useLiveSessionRefresh } from "../shared/volatility/live-session";
|
|
12
13
|
import { decimal } from "./model";
|
|
13
14
|
|
|
14
|
-
const percent = (value: number | null) => value == null ?
|
|
15
|
+
const percent = (value: number | null) => value == null ? MISSING_VALUE : `${value.toFixed(1)}%`;
|
|
15
16
|
const CHARTS = [{ value: "adLine", label: "A/D line" }, { value: "ma200", label: "Above 200D" }, { value: "ma50", label: "Above 50D" }, { value: "ma20", label: "Above 20D" }];
|
|
16
17
|
type Metric = "adLine" | "ma200" | "ma50" | "ma20";
|
|
17
18
|
const dateOf = (row: BreadthDay) => new Date(`${row.date}T00:00:00Z`);
|
|
@@ -65,15 +66,15 @@ export function Breadth({ fund, width, height, focused, active }: Pick<PaneProps
|
|
|
65
66
|
if (column.id === "ma20" || column.id === "ma50" || column.id === "ma200") return { text: percent(row[column.id].percent), value: row[column.id].percent };
|
|
66
67
|
const value = row[column.id as "advances"];
|
|
67
68
|
const eligible = column.id === "newHighs" || column.id === "newLows" ? row.highLowEligible : row.advanceDeclineEligible;
|
|
68
|
-
return { text: eligible ? decimal(value, 0) :
|
|
69
|
+
return { text: eligible ? decimal(value, 0) : MISSING_VALUE, value: eligible ? value : null,
|
|
69
70
|
color: column.id === "advances" || column.id === "newHighs" ? colors.positive : column.id === "declines" || column.id === "newLows" ? colors.negative : colors.text };
|
|
70
71
|
}}
|
|
71
72
|
rootBefore={<ChartTableHeader width={width} height={height} tableRows={rows.length} tableColumns={columns}
|
|
72
73
|
query={<QueryBar width={width} meta="History uses current members (survivorship bias)." filters={[{ kind: "select", id: "chart", label: "History", value: metric, options: CHARTS, onChange: value => setMetric(value as Metric) }]} />}
|
|
73
74
|
figures={[
|
|
74
|
-
{ label: "Adv / Dec", value: latest.advanceDeclineEligible ? `${latest.advances} / ${latest.declines}` :
|
|
75
|
+
{ label: "Adv / Dec", value: latest.advanceDeclineEligible ? `${latest.advances} / ${latest.declines}` : MISSING_VALUE, detail: `${latest.unchanged} unchanged` },
|
|
75
76
|
...([20, 50, 200] as const).map(window => ({ label: `Above ${window}D`, value: percent(latest[`ma${window}`].percent), detail: `${latest[`ma${window}`].eligible}/${latest.memberCount} covered` })),
|
|
76
|
-
{ label: "52W high / low", value: latest.highLowEligible ? `${latest.newHighs} / ${latest.newLows}` :
|
|
77
|
+
{ label: "52W high / low", value: latest.highLowEligible ? `${latest.newHighs} / ${latest.newLows}` : MISSING_VALUE, detail: `${latest.highLowEligible}/${latest.memberCount} covered` },
|
|
77
78
|
]}
|
|
78
79
|
chart={{ series, ...link, formatValue: metric === "adLine" ? value => decimal(value, 0) : percent,
|
|
79
80
|
formatAxisValue: metric === "adLine" ? value => decimal(value, 0) : percent, remoteKind: "member-breadth", empty: "History is awaiting sufficient daily bars." }} />}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
|
|
2
3
|
import type { HeadlessRowsResult } from "../../../types/headless";
|
|
3
4
|
import { fetchBreadth, fetchChanges, fetchFunds, fetchMembers, fetchStockFunds, FundNotCoveredError } from "./client";
|
|
@@ -6,7 +7,7 @@ import { canonicalFund, changeReason, coverageText, decimal, DEFAULT_SORT, fundN
|
|
|
6
7
|
noStockFundsMessage, percent, stockFundAsOf, stockFundsNotices, usListingInput } from "./model";
|
|
7
8
|
const columns: HeadlessPaneColumn[] = [
|
|
8
9
|
{ key: "symbol", header: "Ticker" }, { key: "name", header: "Name" },
|
|
9
|
-
{ key: "weight", header: "Weight %", align: "right", format: (value) => value == null ?
|
|
10
|
+
{ key: "weight", header: "Weight %", align: "right", format: (value) => value == null ? MISSING_VALUE : decimal(Number(value) * 100) },
|
|
10
11
|
{ key: "shares", header: "Shares", align: "right", format: (value) => decimal(value as number | null, 0) },
|
|
11
12
|
{ key: "price", header: "Price $", align: "right", format: (value) => decimal(value as number | null) },
|
|
12
13
|
...["changePercent", "return1WPercent", "return1MPercent", "returnYtdPercent"].map((key, i) => ({ key, header: ["1D", "1W", "1M", "YTD"][i]!, align: "right" as const, format: (value: unknown) => percent(value as number | null) })),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { FundChange, FundMember, FundMembersPayload, MemberFundsPayload, StockFund, StockFundsPayload } from "../../../api-client/members";
|
|
2
3
|
import type { DataTableColumn } from "../../../components";
|
|
3
4
|
import { buildSectionedRows, type SectionedRow } from "../../../components/data-table/sections";
|
|
@@ -138,12 +139,12 @@ export function membersTitle(input: string, stock = false) {
|
|
|
138
139
|
export const DEFAULT_SORT: SortPreference<string> = { columnId: "weight", direction: "desc" };
|
|
139
140
|
/** A signed figure; one that rounds to zero is unsigned (0.00, never +0.00 or -0.00). */
|
|
140
141
|
export function percent(value: number | null, suffix = "%", digits = 2) {
|
|
141
|
-
if (value == null || !Number.isFinite(value)) return
|
|
142
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
142
143
|
const fixed = value.toFixed(digits);
|
|
143
144
|
if (!/[1-9]/.test(fixed)) return `${fixed.replace("-", "")}${suffix}`;
|
|
144
145
|
return `${value > 0 ? "+" : ""}${fixed}${suffix}`;
|
|
145
146
|
}
|
|
146
|
-
export const decimal = (value: number | null, digits = 2) => value == null || !Number.isFinite(value) ?
|
|
147
|
+
export const decimal = (value: number | null, digits = 2) => value == null || !Number.isFinite(value) ? MISSING_VALUE : value.toLocaleString("en-US", { minimumFractionDigits: digits, maximumFractionDigits: digits });
|
|
147
148
|
export function sortMembers(rows: readonly FundMember[], sort: SortPreference<string>) {
|
|
148
149
|
return [...rows].sort((a, b) => compareSortValues(a[sort.columnId as keyof FundMember] as number | string | null,
|
|
149
150
|
b[sort.columnId as keyof FundMember] as number | string | null, sort.direction) || a.id.localeCompare(b.id));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { Breadth } from "./breadth-pane";
|
|
2
3
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
3
4
|
import type { FundChange, FundMember, MemberFundsPayload, StockFund } from "../../../api-client/members";
|
|
@@ -89,9 +90,9 @@ function Holdings({ fund, tab, width, height, focused, active }: ViewProps & { t
|
|
|
89
90
|
const renderCell = useCallback((item: SectionedRow<FundMember>, column: DataTableColumn): DataTableCell => {
|
|
90
91
|
if (!isSectionedItemRow(item)) return { text: "" };
|
|
91
92
|
const row = item.item;
|
|
92
|
-
if (column.id === "symbol") return { text: row.symbol ??
|
|
93
|
-
if (column.id === "name" || column.id === "sector") return { text: row[column.id] ??
|
|
94
|
-
if (column.id === "weight") return { text: row.weight == null ?
|
|
93
|
+
if (column.id === "symbol") return { text: row.symbol ?? MISSING_VALUE, color: colors.textBright };
|
|
94
|
+
if (column.id === "name" || column.id === "sector") return { text: row[column.id] ?? MISSING_VALUE, color: colors.text };
|
|
95
|
+
if (column.id === "weight") return { text: row.weight == null ? MISSING_VALUE : decimal(row.weight * 100), value: row.weight == null ? null : row.weight * 100 };
|
|
95
96
|
if (column.id === "shares") return { text: decimal(row.shares, 0), value: row.shares };
|
|
96
97
|
if (column.id === "price") return { text: decimal(row.price), value: row.price };
|
|
97
98
|
const value = row[column.id as "changePercent"];
|
|
@@ -133,10 +134,10 @@ function Changes({ fund, width, height, focused, active }: ViewProps) {
|
|
|
133
134
|
info: data?.asOf ? [{ id: "updated", parts: [{ text: `as of ${data.asOf.slice(0, 10)}`, tone: "muted" }] }] : [] });
|
|
134
135
|
usePaneNoticeFooter({ registrationId: "members:changes-notices", focused, notices: resource.error || resource.data?.refreshError ? [resource.error ?? resource.data!.refreshError!] : [] });
|
|
135
136
|
const renderCell = useCallback((row: FundChange, column: DataTableColumn): DataTableCell => {
|
|
136
|
-
if (column.id === "effectiveDate") return { text: row.effectiveDate ??
|
|
137
|
-
if (column.id === "daysToGo") return { text: row.daysToGo === null ?
|
|
138
|
-
if (column.id === "added") return { text: row.added ??
|
|
139
|
-
if (column.id === "removed") return { text: row.removed ??
|
|
137
|
+
if (column.id === "effectiveDate") return { text: row.effectiveDate ?? MISSING_VALUE };
|
|
138
|
+
if (column.id === "daysToGo") return { text: row.daysToGo === null ? MISSING_VALUE : `${row.daysToGo}${column.label === "In" ? "d" : ""}`, value: row.daysToGo, color: row.daysToGo === null ? colors.textMuted : colors.warning, keepColorWhenSelected: row.daysToGo !== null };
|
|
139
|
+
if (column.id === "added") return { text: row.added ?? MISSING_VALUE, color: colors.positive };
|
|
140
|
+
if (column.id === "removed") return { text: row.removed ?? MISSING_VALUE, color: colors.negative };
|
|
140
141
|
if (column.id === "estimate") { const value = row.estimates.length === 1 ? row.estimates[0]!.days : null; return { text: percent(value, ""), value }; }
|
|
141
142
|
return { text: changeReason(row), color: colors.text };
|
|
142
143
|
}, [colors]);
|
|
@@ -191,7 +192,7 @@ function FundPicker({ width, height, focused, choose }: Pick<PaneProps, "width"
|
|
|
191
192
|
{resource.data && <DataTableView items={resource.data.payload.funds} emptyStateTitle="No covered funds." rootWidth={width} rootHeight={height} focused={focused}
|
|
192
193
|
columns={[{ id: "ticker", label: "Fund", align: "left", width: 8 }, { id: "name", label: "Index", align: "left", width: 24, flexGrow: 1 }, { id: "asOf", label: "Holdings as of", align: "left", width: 16 }]}
|
|
193
194
|
getItemKey={(row) => row.ticker} selection={{ kind: "id", selectedId: selected, getId: (row) => row.ticker, onChange: (id) => setSelected(String(id)) }}
|
|
194
|
-
onActivate={(row) => choose(row.ticker)} sortColumnId={null} sortDirection="asc" renderCell={(row, col) => ({ text: String(row[col.id as "ticker"] ??
|
|
195
|
+
onActivate={(row) => choose(row.ticker)} sortColumnId={null} sortDirection="asc" renderCell={(row, col) => ({ text: String(row[col.id as "ticker"] ?? MISSING_VALUE) })} />}
|
|
195
196
|
</PaneStatusBody>;
|
|
196
197
|
}
|
|
197
198
|
type ListProps = Pick<PaneProps, "width" | "height" | "focused">;
|
|
@@ -216,7 +217,7 @@ function StockFunds({ symbol, width, height, focused }: ListProps & { symbol: st
|
|
|
216
217
|
const row = item.item;
|
|
217
218
|
if (column.id === "ticker") return { text: row.ticker, color: colors.textBright };
|
|
218
219
|
if (column.id === "name") return { text: row.name, color: colors.text };
|
|
219
|
-
if (column.id === "weight") return { text: row.weight == null ?
|
|
220
|
+
if (column.id === "weight") return { text: row.weight == null ? MISSING_VALUE : decimal(row.weight * 100), value: row.weight == null ? null : row.weight * 100 };
|
|
220
221
|
return { text: stockFundAsOf(row, !stockFundAsOfFits(width)), color: colors.textMuted };
|
|
221
222
|
}, [colors, width]);
|
|
222
223
|
const none = noStockFundsMessage(symbol, "pane");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../../utils/format";
|
|
1
2
|
import type { CloudFilingEventPayload } from "../../../../api-client";
|
|
2
3
|
import type {
|
|
3
4
|
DesignationDateBasis,
|
|
@@ -26,7 +27,7 @@ export function distressView(value: unknown): DistressViewId {
|
|
|
26
27
|
return DISTRESS_VIEWS.some((view) => view.value === value) ? value as DistressViewId : DEFAULT_DISTRESS_VIEW;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export const MISSING =
|
|
30
|
+
export const MISSING = MISSING_VALUE;
|
|
30
31
|
|
|
31
32
|
/** Every C0 and C1 control except the line break: source text is drawn as plain text, never as markup or escapes. */
|
|
32
33
|
const CONTROL_CHARACTERS = /[\u0000-\u0009\u000B-\u001F\u007F-\u009F]/g;
|
|
@@ -2,11 +2,11 @@ import type { MnaDeal, MnaStatus, MnaTerms } from "../../../api-client/mna";
|
|
|
2
2
|
import type { Quote } from "../../../types/financials";
|
|
3
3
|
import { getListingSymbol } from "../../../sources/listing-symbols";
|
|
4
4
|
import { parsePublicTickerKey } from "../../../utils/exchanges";
|
|
5
|
-
import { formatCompact } from "../../../utils/format";
|
|
5
|
+
import { MISSING_VALUE, formatCompact } from "../../../utils/format";
|
|
6
6
|
import { nonUsSecListingVenue } from "../../../utils/sec";
|
|
7
7
|
|
|
8
8
|
export const MNA_PANE_ID = "mna";
|
|
9
|
-
export const MISSING =
|
|
9
|
+
export const MISSING = MISSING_VALUE;
|
|
10
10
|
|
|
11
11
|
const MS_PER_DAY = 86_400_000;
|
|
12
12
|
|
|
@@ -214,7 +214,7 @@ export function expectedCloseDate(value: string | null): Date | null {
|
|
|
214
214
|
return null;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
/** "Oct
|
|
217
|
+
/** "15 Oct", "Oct '27" (a month in another year), "Q1 27", "2027". */
|
|
218
218
|
export function formatExpectedClose(value: string | null, now = new Date()): string {
|
|
219
219
|
if (!value) return MISSING;
|
|
220
220
|
const text = value.trim();
|
|
@@ -222,7 +222,7 @@ export function formatExpectedClose(value: string | null, now = new Date()): str
|
|
|
222
222
|
if (day) {
|
|
223
223
|
const date = new Date(`${text}T00:00:00Z`);
|
|
224
224
|
const month = date.toLocaleString("en-US", { month: "short", timeZone: "UTC" });
|
|
225
|
-
return date.getUTCFullYear() === now.getUTCFullYear() ? `${
|
|
225
|
+
return date.getUTCFullYear() === now.getUTCFullYear() ? `${Number(day[3])} ${month}` : `${month} '${day[1]!.slice(2)}`;
|
|
226
226
|
}
|
|
227
227
|
const period = /^([QH][1-4])\s+(\d{4})$/i.exec(text);
|
|
228
228
|
if (period) return `${period[1]!.toUpperCase()} ${period[2]!.slice(2)}`;
|
|
@@ -266,7 +266,7 @@ export function formatListDate(value: string, now = new Date()): string {
|
|
|
266
266
|
const date = new Date(`${value}T00:00:00Z`);
|
|
267
267
|
if (!Number.isFinite(date.getTime())) return MISSING;
|
|
268
268
|
const month = date.toLocaleString("en-US", { month: "short", timeZone: "UTC" });
|
|
269
|
-
return date.getUTCFullYear() === now.getUTCFullYear() ? `${
|
|
269
|
+
return date.getUTCFullYear() === now.getUTCFullYear() ? `${date.getUTCDate()} ${month}` : `${month} ${date.getUTCFullYear()}`;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
/** 0.0038 is "0.38%", -0.049 is "-4.9%": tight arb spreads keep two decimals. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
2
3
|
import type { MoneyMarketRow } from "../../../api-client/money-markets";
|
|
3
4
|
import { fetchHongKongMoneyMarkets, fetchMoneyMarkets } from "./client";
|
|
@@ -37,7 +38,7 @@ export const moneyMarketsHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
37
38
|
{ key: "change", header: "Change", align: "right", format: (value, row) => moneyMarketChange(value as number | null, row.changeUnit as "basis-points" | "usd-billions") },
|
|
38
39
|
// A narrow terminal moves the status, percentile and earlier date under each row first.
|
|
39
40
|
{ key: "previousAsOf", header: "Versus", shrink: false, stackPriority: 1 },
|
|
40
|
-
{ key: "percentileValue", header: "Pctl 1Y", align: "right", stackPriority: 2, format: (value) => value == null ?
|
|
41
|
+
{ key: "percentileValue", header: "Pctl 1Y", align: "right", stackPriority: 2, format: (value) => value == null ? MISSING_VALUE : Number(value).toFixed(0) },
|
|
41
42
|
{ key: "asOf", header: "As of", shrink: false }, { key: "status", header: "Status", stackPriority: 3 },
|
|
42
43
|
], rows: report.rows }],
|
|
43
44
|
errors, unavailableSymbols: rows.filter((row) => row.status === "unavailable").flatMap((row) => row.sourceSeriesIds.length ? row.sourceSeriesIds : [row.label]),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { MoneyMarketRow, MoneyMarketsPayload } from "../../../api-client/money-markets";
|
|
2
3
|
import { formatPercentAxis, spanAxisFormatter } from "../../../components/chart-table";
|
|
3
4
|
import type { CompositeAxisDomain } from "../../../components/chart/composite/types";
|
|
@@ -6,9 +7,9 @@ import type { CurvePalette, CurveSeries } from "../../../components/chart/curve/
|
|
|
6
7
|
/** A balance in billions to the million under $10B, to the hundred million above. */
|
|
7
8
|
const billionsDigits = (value: number) => Math.abs(value) < 10 ? 3 : 1;
|
|
8
9
|
export const moneyMarketValue = (value: number | null, unit: MoneyMarketRow["unit"]) => value == null
|
|
9
|
-
?
|
|
10
|
+
? MISSING_VALUE : unit === "percent" ? `${value.toFixed(2)}%` : `$${value.toLocaleString("en-US", { minimumFractionDigits: billionsDigits(value), maximumFractionDigits: billionsDigits(value) })}B`;
|
|
10
11
|
export const moneyMarketChange = (value: number | null, unit: MoneyMarketRow["changeUnit"]) => value == null
|
|
11
|
-
?
|
|
12
|
+
? MISSING_VALUE : `${value > 0 ? "+" : ""}${value.toFixed(unit === "usd-billions" && Math.abs(value) < 1 ? 3 : 1)}${unit === "basis-points" ? "bp" : "B"}`;
|
|
12
13
|
const formatBillionsAxis = spanAxisFormatter(
|
|
13
14
|
(value, digits) => `$${value.toLocaleString("en-US", { minimumFractionDigits: digits, maximumFractionDigits: digits })}B`,
|
|
14
15
|
billionsDigits,
|
|
@@ -11,7 +11,7 @@ import type { MoneyMarketRow } from "../../../api-client/money-markets";
|
|
|
11
11
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
12
12
|
import { StatChartDetail } from "../../../components/market-board";
|
|
13
13
|
import type { PaneProps } from "../../../types/plugin";
|
|
14
|
-
import { formatPercentileRank } from "../../../utils/format";
|
|
14
|
+
import { MISSING_VALUE, formatPercentileRank } from "../../../utils/format";
|
|
15
15
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
16
16
|
import { useResearchCloudSession } from "../shared/research-cloud-session";
|
|
17
17
|
import { getCachedHongKongMoneyMarkets, getCachedMoneyMarkets, loadHongKongMoneyMarkets, loadMoneyMarkets } from "./client";
|
|
@@ -51,8 +51,8 @@ function ObservationDetail({ row, width, height, focused = false }: { row: Money
|
|
|
51
51
|
// The chart below shows the 1Y window, so the range carries no sample count or window dates.
|
|
52
52
|
const items: StatItem[] = [
|
|
53
53
|
{ id: "level", label: row.unit === "percent" ? "Rate" : "USD billions", value: moneyMarketValue(row.value, row.unit),
|
|
54
|
-
detail: `${formatPercentileRank(p.value, "1Y")} · ${row.asOf ??
|
|
55
|
-
{ id: "change", label: "Change", value: moneyMarketChange(row.change, row.changeUnit), detail: `since ${row.previousAsOf ??
|
|
54
|
+
detail: `${formatPercentileRank(p.value, "1Y")} · ${row.asOf ?? MISSING_VALUE}` },
|
|
55
|
+
{ id: "change", label: "Change", value: moneyMarketChange(row.change, row.changeUnit), detail: `since ${row.previousAsOf ?? MISSING_VALUE}` },
|
|
56
56
|
{ id: "range", label: "1Y range", value: `${moneyMarketValue(p.min, row.unit)} to ${moneyMarketValue(p.max, row.unit)}` },
|
|
57
57
|
// A bill yield is HKMA's; the US rows name their FRED series.
|
|
58
58
|
row.group === "efb" ? { id: "series", label: "Source", value: "HKMA", detail: "closing yield, 16:00 HKT" }
|
|
@@ -88,7 +88,7 @@ export function MoneyMarketsPane({ width, height, focused }: PaneProps) {
|
|
|
88
88
|
const slope = data?.billsCurve.slope;
|
|
89
89
|
// The curve's slope is the Bills tab's summary figure.
|
|
90
90
|
const billsItems: StatItem[] = slope ? [{ id: "slope", label: "1Y-4W",
|
|
91
|
-
value: slope.valueBps == null ?
|
|
91
|
+
value: slope.valueBps == null ? MISSING_VALUE : `${slope.valueBps > 0 ? "+" : ""}${slope.valueBps.toFixed(1)}bp`,
|
|
92
92
|
detail: [formatPercentileRank(slope.percentile.value, "1Y"),
|
|
93
93
|
slope.asOf && slope.asOf !== data?.billsCurve.asOf ? slope.asOf : null].filter(Boolean).join(" · ") }] : [];
|
|
94
94
|
// A bill row and its tenor on the curve are one selection, matched by FRED series.
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { parsePublicTickerKey } from "../../../utils/exchanges";
|
|
15
15
|
import { companyDataNotes, readCompanyFrom } from "../../../types/company-from";
|
|
16
16
|
import { formatUtcSeconds } from "../../../utils/utc-time";
|
|
17
|
-
import { newsSummaryLine } from "../../../news/news-model";
|
|
17
|
+
import { listedRowHeadline, newsSummaryLine, routineNoticeFields } from "../../../news/news-model";
|
|
18
18
|
import { shortStoryId } from "../../../news/story-id";
|
|
19
19
|
import { cloudNewsFreshness, cloudRealtimeAccess } from "../shared/report-freshness";
|
|
20
20
|
import { REPORT_FILTER, REPORT_ROWS } from "../shared/headless-options";
|
|
@@ -23,7 +23,9 @@ import { REPORT_FILTER, REPORT_ROWS } from "../shared/headless-options";
|
|
|
23
23
|
const NEWS_COLUMNS = [
|
|
24
24
|
{ key: "publishedAt", header: "Published", textFormat: formatUtcSeconds },
|
|
25
25
|
{ key: "source", header: "Source" },
|
|
26
|
-
|
|
26
|
+
// A row standing for a company's routine notices (a buy-back's daily ones) says how many; exports keep the
|
|
27
|
+
// headline as the story's and the count in its own fields.
|
|
28
|
+
{ key: "headline", header: "Headline", textFormat: listedRowHeadline },
|
|
27
29
|
{ key: "tickers", header: "Tickers", textFormat: (value: unknown) => Array.isArray(value) ? value.join(", ") : String(value ?? "") },
|
|
28
30
|
{ key: "sentiment", header: "Sentiment" },
|
|
29
31
|
{ key: "importance", header: "Score", align: "right" as const },
|
|
@@ -57,6 +59,7 @@ function newsRow(article: NewsArticle) {
|
|
|
57
59
|
source: article.source,
|
|
58
60
|
headline: article.title,
|
|
59
61
|
summary: article.summary ?? null,
|
|
62
|
+
...routineNoticeFields(article),
|
|
60
63
|
topic: article.topic,
|
|
61
64
|
topics: article.topics,
|
|
62
65
|
sectors: article.sectors,
|
|
@@ -94,22 +94,24 @@ export function setupBreakingNewsNotifications(ctx: GloomPluginContext): () => v
|
|
|
94
94
|
const isSnoozed = () => breakingNewsSnoozed(ctx);
|
|
95
95
|
const snooze = () => snoozeBreakingNews(ctx);
|
|
96
96
|
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (tracked) next.add(metadata.ticker.toUpperCase());
|
|
108
|
-
}
|
|
109
|
-
watchedSymbols = next;
|
|
110
|
-
} catch (error) {
|
|
111
|
-
ctx.log.warn(`breaking notifications could not load watched tickers: ${error}`);
|
|
97
|
+
const loadWatchedSymbols = async () => {
|
|
98
|
+
const tickers = await ctx.tickerRepository.loadAllTickers();
|
|
99
|
+
const next = new Set<string>();
|
|
100
|
+
for (const ticker of tickers) {
|
|
101
|
+
const metadata = ticker.metadata;
|
|
102
|
+
const tracked =
|
|
103
|
+
(metadata.watchlists?.length ?? 0) > 0 ||
|
|
104
|
+
(metadata.portfolios?.length ?? 0) > 0 ||
|
|
105
|
+
(metadata.positions?.length ?? 0) > 0;
|
|
106
|
+
if (tracked) next.add(metadata.ticker.toUpperCase());
|
|
112
107
|
}
|
|
108
|
+
watchedSymbols = next;
|
|
109
|
+
};
|
|
110
|
+
// Nothing waits on it: a failed read keeps the last set, and says so.
|
|
111
|
+
const refreshWatchedSymbols = () => {
|
|
112
|
+
loadWatchedSymbols().catch((error: unknown) => {
|
|
113
|
+
ctx.log.warn(`breaking notifications could not load watched tickers: ${error}`);
|
|
114
|
+
});
|
|
113
115
|
};
|
|
114
116
|
|
|
115
117
|
const notifyNewBreakingArticles = (articles: MarketNewsItem[]): void => {
|
|
@@ -176,7 +178,7 @@ export function setupBreakingNewsNotifications(ctx: GloomPluginContext): () => v
|
|
|
176
178
|
ctx.log.warn("breaking notifications unavailable: news query watcher missing");
|
|
177
179
|
return;
|
|
178
180
|
}
|
|
179
|
-
|
|
181
|
+
refreshWatchedSymbols();
|
|
180
182
|
disposeWatch = ctx.watchNewsQuery(NEWS_QUERY_PRESETS.breaking, handleState);
|
|
181
183
|
};
|
|
182
184
|
|
|
@@ -186,11 +188,11 @@ export function setupBreakingNewsNotifications(ctx: GloomPluginContext): () => v
|
|
|
186
188
|
};
|
|
187
189
|
|
|
188
190
|
const disposeConfigListener = ctx.on("config:changed", () => {
|
|
189
|
-
|
|
191
|
+
refreshWatchedSymbols();
|
|
190
192
|
sync();
|
|
191
193
|
});
|
|
192
|
-
const disposeTickerAdded = ctx.on("ticker:added", () =>
|
|
193
|
-
const disposeTickerRemoved = ctx.on("ticker:removed", () =>
|
|
194
|
+
const disposeTickerAdded = ctx.on("ticker:added", () => refreshWatchedSymbols());
|
|
195
|
+
const disposeTickerRemoved = ctx.on("ticker:removed", () => refreshWatchedSymbols());
|
|
194
196
|
sync();
|
|
195
197
|
|
|
196
198
|
return () => {
|
|
@@ -2,6 +2,7 @@ import { TextAttributes } from "../../../../../ui";
|
|
|
2
2
|
import type { MarketNewsItem } from "../../../../../types/news-source";
|
|
3
3
|
import { colors } from "../../../../../theme/colors";
|
|
4
4
|
import { formatFeedTime } from "../../../../../utils/datetime-format";
|
|
5
|
+
import { listedHeadline } from "../../../../../news/news-model";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* How a story reads in a row wherever stories are listed (the news tables, a
|
|
@@ -42,7 +43,8 @@ export function newsHeadlineCell(
|
|
|
42
43
|
{ read = false, title, ...options }: NewsRowTone & { read?: boolean; title?: string } = {},
|
|
43
44
|
): NewsRowCell {
|
|
44
45
|
return {
|
|
45
|
-
|
|
46
|
+
// A row standing for a run of routine notices says how many after its headline.
|
|
47
|
+
text: title ?? listedHeadline(article),
|
|
46
48
|
color: tone(colors.text, options),
|
|
47
49
|
attributes: options.later || read ? TextAttributes.NONE : TextAttributes.BOLD,
|
|
48
50
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../../../utils/format";
|
|
1
2
|
import { useCallback, useEffect, useMemo, useRef, type ReactNode, type RefObject } from "react";
|
|
2
3
|
import type { ScrollBoxRenderable } from "../../../../../ui";
|
|
3
4
|
import {
|
|
@@ -358,13 +359,13 @@ export function NewsArticleStackView({
|
|
|
358
359
|
}
|
|
359
360
|
case "categories":
|
|
360
361
|
return {
|
|
361
|
-
text: formatNewsCategoryForColumn(item.categories[0]) ||
|
|
362
|
+
text: formatNewsCategoryForColumn(item.categories[0]) || MISSING_VALUE,
|
|
362
363
|
color: tone(colors.textDim),
|
|
363
364
|
};
|
|
364
365
|
case "sentiment": {
|
|
365
366
|
const sentiment = item.sentiment;
|
|
366
367
|
return {
|
|
367
|
-
text: sentiment ? sentiment.slice(0, 3) :
|
|
368
|
+
text: sentiment ? sentiment.slice(0, 3) : MISSING_VALUE,
|
|
368
369
|
color: tone(
|
|
369
370
|
sentiment === "positive"
|
|
370
371
|
? colors.positive
|
|
@@ -9,9 +9,16 @@ interface PersistedNewsStoryItem extends Omit<NewsStoryItem, "publishedAt"> {
|
|
|
9
9
|
publishedAt: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
type NewsRoutineNotices = NonNullable<MarketNewsItem["routine"]>;
|
|
13
|
+
|
|
14
|
+
interface PersistedNewsRoutineNotices extends Omit<NewsRoutineNotices, "since"> {
|
|
15
|
+
since: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface PersistedNewsArticle extends Omit<MarketNewsItem, "publishedAt" | "items" | "routine"> {
|
|
13
19
|
publishedAt: string;
|
|
14
20
|
items?: PersistedNewsStoryItem[];
|
|
21
|
+
routine?: PersistedNewsRoutineNotices;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
function articleDate(value: Date | string): Date | null {
|
|
@@ -28,15 +35,30 @@ function serializeStoryItem(item: NewsStoryItem): PersistedNewsStoryItem | null
|
|
|
28
35
|
};
|
|
29
36
|
}
|
|
30
37
|
|
|
38
|
+
/** A folded row's notices with their first day as text, as pane state keeps dates; none when that day is unreadable. */
|
|
39
|
+
function serializeRoutine(routine: NewsRoutineNotices | undefined): PersistedNewsRoutineNotices | undefined {
|
|
40
|
+
const since = routine ? articleDate(routine.since) : null;
|
|
41
|
+
return routine && since ? { ...routine, since: since.toISOString() } : undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A folded row's notices as restored: their first day a Date again, or none when it cannot be read. */
|
|
45
|
+
function restoreRoutine(routine: PersistedNewsRoutineNotices | NewsRoutineNotices | undefined): NewsRoutineNotices | undefined {
|
|
46
|
+
const since = routine ? articleDate(routine.since) : null;
|
|
47
|
+
return routine && since ? { ...routine, since } : undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
31
50
|
function serializeArticle(article: MarketNewsItem): PersistedNewsArticle | null {
|
|
32
51
|
const publishedAt = articleDate(article.publishedAt);
|
|
33
52
|
if (!publishedAt) return null;
|
|
53
|
+
const { routine: _routine, ...rest } = article;
|
|
54
|
+
const routine = serializeRoutine(article.routine);
|
|
34
55
|
return {
|
|
35
|
-
...
|
|
56
|
+
...rest,
|
|
36
57
|
publishedAt: publishedAt.toISOString(),
|
|
37
58
|
items: article.items
|
|
38
59
|
?.map(serializeStoryItem)
|
|
39
60
|
.filter((item): item is PersistedNewsStoryItem => !!item),
|
|
61
|
+
...(routine ? { routine } : {}),
|
|
40
62
|
};
|
|
41
63
|
}
|
|
42
64
|
|
|
@@ -52,12 +74,15 @@ function restoreStoryItem(item: PersistedNewsStoryItem): NewsStoryItem | null {
|
|
|
52
74
|
function restoreArticle(article: PersistedNewsArticle): MarketNewsItem | null {
|
|
53
75
|
const publishedAt = articleDate(article.publishedAt);
|
|
54
76
|
if (!publishedAt) return null;
|
|
77
|
+
const { routine: _routine, ...rest } = article;
|
|
78
|
+
const routine = restoreRoutine(article.routine);
|
|
55
79
|
return {
|
|
56
|
-
...
|
|
80
|
+
...rest,
|
|
57
81
|
publishedAt,
|
|
58
82
|
items: article.items
|
|
59
83
|
?.map(restoreStoryItem)
|
|
60
84
|
.filter((item): item is NewsStoryItem => !!item),
|
|
85
|
+
...(routine ? { routine } : {}),
|
|
61
86
|
};
|
|
62
87
|
}
|
|
63
88
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
/**
|
|
2
3
|
* `gloom fn NOTE`: the quick notes the Notes pane opens, read where the pane
|
|
3
4
|
* reads them (Gloom Cloud when signed in, the files on this device otherwise),
|
|
@@ -68,7 +69,7 @@ export const notesHeadless = {
|
|
|
68
69
|
options: [],
|
|
69
70
|
columns: [
|
|
70
71
|
{ key: "title", header: "Note" },
|
|
71
|
-
{ key: "updated", header: "Updated", textFormat: (value) => (typeof value === "string" ? formatUtcTime(value) :
|
|
72
|
+
{ key: "updated", header: "Updated", textFormat: (value) => (typeof value === "string" ? formatUtcTime(value) : MISSING_VALUE) },
|
|
72
73
|
{ key: "text", header: "Text", textHeader: "First line", shrink: true, textFormat: (value) => firstLine(typeof value === "string" ? value : "") },
|
|
73
74
|
],
|
|
74
75
|
discovery: { screenshotReadiness: "ready" },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { truncateWithEllipsis } from "../../../utils/text-wrap";
|
|
1
2
|
export type { QuickNoteEntry } from "./files";
|
|
2
3
|
|
|
3
4
|
let nextNoteId = 1;
|
|
@@ -32,5 +33,5 @@ export function formatLastEdited(updatedAt: number | undefined): string {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export function formatDeleteNoteTitle(title: string): string {
|
|
35
|
-
return title
|
|
36
|
+
return truncateWithEllipsis(title, 28);
|
|
36
37
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useEffect, useMemo, useRef, type ReactNode } from "react";
|
|
2
3
|
import {
|
|
3
4
|
DataTableStackView,
|
|
@@ -72,9 +73,9 @@ const EMPTY_FILTERS: FilterState = {};
|
|
|
72
73
|
const MAX_FILL_PAGES = 4;
|
|
73
74
|
|
|
74
75
|
/** Products FDA's product data does not cover (most vaccines) have no labeler on any row. */
|
|
75
|
-
const QUIET_COLUMNS = { labeler: [
|
|
76
|
+
const QUIET_COLUMNS = { labeler: [MISSING_VALUE] } as const;
|
|
76
77
|
|
|
77
|
-
const formatDate = (date: Date | null): string => (date ? date.toISOString().slice(0, 10) :
|
|
78
|
+
const formatDate = (date: Date | null): string => (date ? date.toISOString().slice(0, 10) : MISSING_VALUE);
|
|
78
79
|
|
|
79
80
|
const capitalize = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);
|
|
80
81
|
|
|
@@ -95,7 +96,7 @@ function labelerText(record: DrugReport): string | null {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
function cellFor(record: OpenFdaRecord, column: ColumnId, colors: ThemeColors): DataTableCell {
|
|
98
|
-
const missing: DataTableCell = { text:
|
|
99
|
+
const missing: DataTableCell = { text: MISSING_VALUE, color: colors.textMuted };
|
|
99
100
|
const toned = (text: string | null): DataTableCell => (text
|
|
100
101
|
? { text, color: toneColor(recordTone(column, text), colors) }
|
|
101
102
|
: missing);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { OptionContract } from "../../../types/financials";
|
|
2
3
|
import { daysToExpiryFrom, optionMid, type OptionSide } from "../shared/volatility";
|
|
3
4
|
import { optionSpread } from "./market-reference";
|
|
@@ -113,7 +114,7 @@ const MIN_COST_OF_SPOT_PERCENT = 0.001;
|
|
|
113
114
|
* reads <0.001%, so a far out-of-the-money quote stays inside the column.
|
|
114
115
|
*/
|
|
115
116
|
export function formatCostOfSpot(value: number | null | undefined): string {
|
|
116
|
-
if (value == null || !Number.isFinite(value) || value < 0) return
|
|
117
|
+
if (value == null || !Number.isFinite(value) || value < 0) return MISSING_VALUE;
|
|
117
118
|
const percent = value * 100;
|
|
118
119
|
if (percent === 0) return "0%";
|
|
119
120
|
if (percent < MIN_COST_OF_SPOT_PERCENT) return `<${MIN_COST_OF_SPOT_PERCENT}%`;
|
|
@@ -125,7 +126,7 @@ export function formatCostOfSpot(value: number | null | undefined): string {
|
|
|
125
126
|
|
|
126
127
|
/** A fraction as a percent: one decimal under 100% (0.0421 reads 4.2%), whole percents above. */
|
|
127
128
|
export function formatCarryPercent(value: number | null | undefined): string {
|
|
128
|
-
if (value == null || !Number.isFinite(value)) return
|
|
129
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
129
130
|
const percent = value * 100;
|
|
130
131
|
return `${percent.toFixed(Math.abs(percent) < 100 ? 1 : 0)}%`;
|
|
131
132
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { OptionContract } from "../../../types/financials";
|
|
2
3
|
import { formatMarketPrice, stablePriceFractionDigits } from "../../../market-data/market/format";
|
|
3
4
|
import { formatExpDate } from "../../../utils/options";
|
|
@@ -45,7 +46,7 @@ export function formatOptionPrice(value: number, maxWidth?: number): string {
|
|
|
45
46
|
return formatMarketPrice(value, { assetCategory: "OPT", fixedFractionDigits: OPTION_PRICE_DIGITS, maxWidth });
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
const price = (value: number) => Number.isFinite(value) && value > 0 ? formatOptionPrice(value) :
|
|
49
|
+
const price = (value: number) => Number.isFinite(value) && value > 0 ? formatOptionPrice(value) : MISSING_VALUE;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* The spread is the one quote fact the chain table cannot show: its columns
|