@gloom-sh/terminal 0.20.16 → 0.20.18
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 +3 -1
- package/src/account/auth-dialog.tsx +19 -1
- package/src/account/billing.ts +2 -1
- package/src/account/heard-from-question.tsx +235 -0
- package/src/account/heard-from.ts +97 -0
- package/src/api-client/data.ts +16 -5
- package/src/api-client/heard-from.ts +72 -0
- package/src/api-client/index.ts +63 -6
- package/src/api-client/mna.ts +18 -0
- package/src/api-client/supply-chain.ts +9 -0
- package/src/api-client/types/billing.ts +35 -1
- package/src/api-client/types/econ.ts +3 -0
- package/src/app/global-shortcuts.ts +5 -3
- package/src/app/pro-welcome/keys.ts +27 -0
- package/src/app/pro-welcome/model.ts +158 -0
- package/src/app/pro-welcome/row.tsx +176 -0
- package/src/app/pro-welcome/use-pro-welcome.ts +156 -0
- package/src/app/runtime/external-profile-changes.ts +135 -0
- package/src/app.tsx +33 -2
- package/src/architecture/core-builtin-allowlist.json +1 -1
- package/src/architecture/floating-promise-allowlist.json +0 -1
- package/src/architecture/shortcut-labels-allowlist.json +1 -0
- package/src/cli/alert-listing.ts +98 -0
- package/src/cli/commands/fred-series.ts +3 -1
- package/src/cli/commands/market.ts +138 -22
- package/src/cli/commands/overview.ts +72 -14
- package/src/cli/commands/plugins.ts +3 -2
- package/src/cli/commands/search.ts +30 -6
- package/src/cli/context.ts +16 -5
- package/src/cli/csv-export.ts +74 -0
- package/src/cli/desktop-pane-shot.ts +75 -11
- package/src/cli/glossary.ts +64 -10
- package/src/cli/help.ts +4 -2
- package/src/cli/history-demergers.ts +117 -0
- package/src/cli/history-rows.ts +6 -2
- package/src/cli/index.ts +1 -0
- package/src/cli/known-gaps.ts +16 -0
- package/src/cli/known-us-stocks.ts +18 -0
- package/src/cli/listing-arg.ts +105 -15
- package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
- package/src/cli/pane-functions/catalog-snapshot.json +866 -0
- package/src/cli/pane-functions/catalog-snapshot.ts +62 -0
- package/src/cli/pane-functions/catalog.ts +50 -16
- package/src/cli/pane-functions/data.ts +16 -4
- package/src/cli/pane-functions/dom.ts +24 -6
- package/src/cli/pane-functions/freshness.ts +17 -1
- package/src/cli/pane-functions/headless.ts +7 -2
- package/src/cli/pane-functions/index.ts +102 -44
- package/src/cli/pane-functions/resolver.ts +8 -5
- package/src/cli/pane-functions/screenshot-assessment.ts +30 -7
- package/src/cli/pane-functions/screenshot-bridge.ts +4 -2
- package/src/cli/pane-functions/screenshot-payload.ts +21 -0
- package/src/cli/pane-functions/screenshot-render.ts +3 -1
- package/src/cli/quote-answer.ts +32 -16
- package/src/cli/registry.ts +22 -2
- package/src/cli/report-tables.ts +17 -3
- package/src/cli/result.ts +8 -10
- package/src/cli/series-search.ts +45 -6
- package/src/cli/shot-temp-dir.ts +4 -9
- package/src/components/chart/composite/legend.tsx +80 -25
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
- package/src/components/chart/composite/price-axis-labels.tsx +7 -5
- package/src/components/chart-table/header.tsx +9 -0
- package/src/components/chart-table/layout.ts +11 -11
- package/src/components/command-bar/pane-templates/items.ts +17 -1
- package/src/components/command-bar/routes/root/provider-search.ts +10 -1
- package/src/components/command-bar/routes/root/results.ts +34 -2
- package/src/components/command-bar/routes/root/runtime.ts +8 -1
- package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
- package/src/components/command-bar/workflow/alert.ts +19 -8
- package/src/components/data-table/view.tsx +15 -2
- package/src/components/form-modal/content.tsx +9 -4
- package/src/components/index.ts +1 -1
- package/src/components/layout/header.tsx +9 -5
- package/src/components/layout/pane/capture-status.ts +6 -0
- package/src/components/layout/pane/footer/index.tsx +2 -0
- package/src/components/layout/pane/footer/model.ts +113 -15
- package/src/components/layout/pane/header.tsx +16 -2
- package/src/components/market-board/index.tsx +4 -2
- package/src/components/onboarding/onboarding-frame.tsx +6 -2
- package/src/components/onboarding/onboarding-keyboard.ts +7 -1
- package/src/components/onboarding/onboarding-wizard.tsx +3 -1
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +24 -15
- package/src/components/onboarding/setup-cards.ts +36 -0
- package/src/components/onboarding/use-onboarding-progress.ts +22 -1
- package/src/components/onboarding/wizard-account.ts +6 -1
- package/src/components/onboarding/wizard-model.ts +32 -6
- package/src/components/onboarding/wizard-positions.ts +1 -1
- package/src/components/sign-in-gate.tsx +3 -1
- package/src/components/toggle-list.tsx +6 -8
- package/src/components/ui/confirm-dialog.tsx +47 -7
- package/src/components/ui/data-table/display-columns.ts +4 -1
- package/src/components/ui/data-table/hooks.ts +2 -3
- package/src/components/ui/data-table/index.tsx +4 -1
- package/src/components/ui/data-table/types.ts +19 -4
- package/src/components/ui/data-table/visible-range.ts +11 -1
- package/src/components/ui/display.tsx +17 -2
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/stat-grid.tsx +4 -0
- package/src/components/ui/status.tsx +13 -1
- package/src/components/ui/table-layout.ts +2 -1
- package/src/components/use-pane-notice-footer.tsx +16 -3
- package/src/data/config/store/index.ts +31 -0
- package/src/data/config/store/node.ts +61 -11
- package/src/data/config/store/normalize.ts +4 -6
- package/src/data/config/store/shared-file.ts +309 -0
- package/src/data/profile-merge.ts +299 -0
- package/src/data/sqlite/checkpointer.ts +11 -1
- package/src/data/sqlite/database.ts +1 -1
- package/src/data/ticker-repository.ts +134 -10
- package/src/data/ticker-store.ts +67 -0
- package/src/data/ticker-writes.ts +5 -0
- package/src/i18n/es.ts +27 -0
- package/src/i18n/ja.ts +27 -0
- package/src/i18n/ko.ts +27 -0
- package/src/i18n/zh-cn.ts +27 -0
- package/src/i18n/zh-tw.ts +27 -0
- package/src/layout-marketplace/gallery-desktop.tsx +2 -2
- package/src/market-data/ah-pair.ts +103 -0
- package/src/market-data/depositary-pair.ts +6 -2
- package/src/market-data/hooks.tsx +33 -2
- package/src/market-data/market/change-basis.ts +2 -1
- package/src/market-data/market/header-market.ts +11 -0
- package/src/market-data/split-terms.ts +28 -0
- package/src/plugins/builtin/account-management/footer.ts +1 -1
- package/src/plugins/builtin/account-management/keyboard.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +1 -0
- package/src/plugins/builtin/account-management/pane.tsx +75 -7
- package/src/plugins/builtin/account-management/payment-recovery-row.tsx +12 -5
- package/src/plugins/builtin/account-management/pro-cancel.tsx +197 -0
- package/src/plugins/builtin/account-management/trial-cancel.ts +1 -1
- package/src/plugins/builtin/alerts/cli-move.ts +2 -2
- package/src/plugins/builtin/alerts/cli.ts +36 -30
- package/src/plugins/builtin/alerts/constants.ts +10 -0
- package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
- package/src/plugins/builtin/alerts/format.ts +24 -8
- package/src/plugins/builtin/alerts/index.tsx +38 -9
- package/src/plugins/builtin/alerts/move-checks.ts +7 -0
- package/src/plugins/builtin/alerts/pane.tsx +1 -1
- package/src/plugins/builtin/alerts/quotes.ts +26 -2
- package/src/plugins/builtin/alerts/scheduled.ts +6 -1
- package/src/plugins/builtin/alerts/types.ts +7 -0
- package/src/plugins/builtin/analytics/manual-value.ts +61 -0
- package/src/plugins/builtin/analytics/risk-book.ts +7 -7
- package/src/plugins/builtin/analytics/risk-client.ts +26 -13
- package/src/plugins/builtin/analytics/risk-headless.ts +13 -8
- package/src/plugins/builtin/analytics/risk-model.ts +92 -4
- package/src/plugins/builtin/analytics/risk-pane.tsx +85 -38
- package/src/plugins/builtin/awards/pane.tsx +7 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/central-bank-rates/model.ts +8 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -3
- package/src/plugins/builtin/chart-composer/cli-options.ts +4 -2
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
- package/src/plugins/builtin/chart-composer/pane.tsx +9 -3
- package/src/plugins/builtin/cloud/auth-actions.tsx +11 -6
- package/src/plugins/builtin/cloud/company-picker.tsx +5 -3
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +9 -4
- package/src/plugins/builtin/company-kpis/latest.ts +45 -0
- package/src/plugins/builtin/company-kpis/model.ts +38 -8
- package/src/plugins/builtin/company-kpis/pane.tsx +22 -8
- package/src/plugins/builtin/composite/alt-data.ts +20 -0
- package/src/plugins/builtin/composite/application.ts +14 -0
- package/src/plugins/builtin/composite/broker.ts +12 -0
- package/src/plugins/builtin/composite/credit.ts +33 -0
- package/src/plugins/builtin/composite/crypto.ts +10 -0
- package/src/plugins/builtin/composite/earnings.ts +12 -0
- package/src/plugins/builtin/composite/filings.ts +13 -0
- package/src/plugins/builtin/composite/futures-commodities.ts +23 -0
- package/src/plugins/builtin/composite/global-markets.ts +12 -0
- package/src/plugins/builtin/composite/options-volatility.ts +23 -0
- package/src/plugins/builtin/composite/ownership.ts +23 -0
- package/src/plugins/builtin/composite/portfolio.ts +10 -0
- package/src/plugins/builtin/composite/quant.ts +15 -0
- package/src/plugins/builtin/composite/rates-macro.ts +30 -0
- package/src/plugins/builtin/composite/screeners.ts +11 -0
- package/src/plugins/builtin/composite/shared.ts +11 -0
- package/src/plugins/builtin/composite/ticker-core.ts +36 -0
- package/src/plugins/builtin/congress-trades/headless.ts +31 -3
- package/src/plugins/builtin/correlation/index.tsx +13 -17
- package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
- package/src/plugins/builtin/credit-conditions/series.ts +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +57 -16
- package/src/plugins/builtin/dividend-yield/headless.ts +17 -11
- package/src/plugins/builtin/dividend-yield/model.ts +4 -3
- package/src/plugins/builtin/dividend-yield/pane.tsx +22 -18
- package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +23 -12
- package/src/plugins/builtin/earnings/board-model.ts +12 -0
- package/src/plugins/builtin/earnings/board-table.ts +7 -4
- package/src/plugins/builtin/earnings/board.tsx +2 -2
- package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
- package/src/plugins/builtin/earnings/headless.ts +7 -4
- package/src/plugins/builtin/earnings/highlight.ts +1 -1
- package/src/plugins/builtin/earnings/history-model.ts +6 -4
- package/src/plugins/builtin/earnings/history-table.ts +4 -3
- package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
- package/src/plugins/builtin/econ/calendar-model.ts +18 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +1 -256
- package/src/plugins/builtin/econ/index.tsx +3 -0
- package/src/plugins/builtin/econ-statistics/cache.ts +1 -1
- package/src/plugins/builtin/econ-statistics/client.ts +11 -10
- package/src/plugins/builtin/econ-statistics/detail.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/headless.ts +42 -6
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +7 -2
- package/src/plugins/builtin/econ-statistics/stats.ts +2 -1
- package/src/plugins/builtin/econ-statistics/view.ts +9 -3
- package/src/plugins/builtin/equity-screener/headless.ts +4 -1
- package/src/plugins/builtin/equity-screener/model.ts +7 -6
- package/src/plugins/builtin/estimate-revisions/headless.ts +1 -1
- package/src/plugins/builtin/exposure/model.ts +10 -0
- package/src/plugins/builtin/exposure/pane.tsx +10 -3
- package/src/plugins/builtin/fx-matrix/amount.ts +15 -1
- package/src/plugins/builtin/fx-matrix/headless.ts +12 -6
- package/src/plugins/builtin/fx-matrix/index.tsx +23 -5
- package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
- package/src/plugins/builtin/kelly-sizer/pane.tsx +9 -4
- package/src/plugins/builtin/market-valuation/pane.tsx +22 -10
- package/src/plugins/builtin/mna/detail.tsx +67 -6
- package/src/plugins/builtin/mna/headless.ts +128 -13
- package/src/plugins/builtin/mna/model.ts +219 -16
- package/src/plugins/builtin/mna/pane.tsx +34 -6
- package/src/plugins/builtin/money-markets/model.ts +14 -5
- package/src/plugins/builtin/money-markets/pane.tsx +4 -3
- package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +22 -6
- package/src/plugins/builtin/options-scenario/csp-screen.ts +39 -12
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +7 -5
- package/src/plugins/builtin/pe-band/client.ts +13 -1
- package/src/plugins/builtin/pe-band/headless.ts +2 -2
- package/src/plugins/builtin/pe-band/model.ts +63 -10
- package/src/plugins/builtin/pe-band/pane.tsx +5 -5
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +26 -7
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +66 -13
- package/src/plugins/builtin/portfolio-list/cli/render.ts +76 -33
- package/src/plugins/builtin/portfolio-list/headless.ts +69 -22
- package/src/plugins/builtin/portfolio-list/pane/data.ts +3 -3
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +29 -14
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -2
- package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +5 -1
- package/src/plugins/builtin/research/event-model.ts +31 -13
- package/src/plugins/builtin/research/headless.ts +8 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
- package/src/plugins/builtin/sectors/index.tsx +6 -9
- package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
- package/src/plugins/builtin/shared/earnings-report.ts +19 -4
- package/src/plugins/builtin/shared/fred-catalog.ts +256 -0
- package/src/plugins/builtin/shared/report-freshness.ts +2 -3
- package/src/plugins/builtin/shared/series-cache.ts +3 -0
- package/src/plugins/builtin/shared/series-detail-chart.tsx +3 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +7 -7
- package/src/plugins/builtin/supply-chain/client.ts +34 -9
- package/src/plugins/builtin/supply-chain/evidence.ts +3 -2
- package/src/plugins/builtin/supply-chain/flow.tsx +4 -3
- package/src/plugins/builtin/supply-chain/graph-model.ts +14 -7
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +3 -1
- package/src/plugins/builtin/supply-chain/graph.tsx +6 -3
- package/src/plugins/builtin/supply-chain/headless.ts +19 -4
- package/src/plugins/builtin/supply-chain/model.ts +50 -6
- package/src/plugins/builtin/supply-chain/pane.tsx +76 -16
- package/src/plugins/builtin/ticker-detail/adr-pair/ah.ts +62 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +119 -20
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +67 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +31 -16
- package/src/plugins/builtin/ticker-detail/overview/model.ts +17 -1
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +9 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +5 -2
- package/src/plugins/builtin/time-sales/headless.ts +4 -1
- package/src/plugins/builtin/time-sales/pane.tsx +2 -0
- package/src/plugins/builtin/time-sales/window.ts +12 -0
- package/src/plugins/builtin/treasury-auctions/client.ts +4 -0
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -0
- package/src/plugins/builtin/treasury-daily/client.ts +23 -11
- package/src/plugins/builtin/volatility/model.ts +17 -0
- package/src/plugins/builtin/volatility/pane.tsx +13 -4
- package/src/plugins/builtin/world-indices/index.tsx +2 -0
- package/src/plugins/builtin/world-indices/table.tsx +15 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +3 -2
- package/src/plugins/builtin/world-venue-map/headless.ts +28 -16
- package/src/plugins/builtin/world-venue-map/index.ts +19 -6
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +9 -5
- package/src/plugins/builtin/world-venue-map/layers.ts +33 -11
- package/src/plugins/builtin/world-venue-map/map.tsx +12 -0
- package/src/plugins/builtin/world-venue-map/pane.tsx +35 -6
- package/src/plugins/builtin/world-venue-map/place.ts +119 -0
- package/src/plugins/catalog-data.ts +20 -0
- package/src/plugins/catalog-lazy.ts +51 -0
- package/src/plugins/catalog-ui.ts +16 -18
- package/src/plugins/host-smoke.ts +5 -2
- package/src/portfolio/allocation.ts +79 -19
- package/src/portfolio/cash-balances.ts +76 -0
- package/src/portfolio/mutations.ts +43 -8
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/desktop/window-layouts.ts +14 -0
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/host/tabs.tsx +57 -8
- package/src/renderers/dom/styles.css +13 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +4 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +22 -1
- package/src/renderers/electrobun/bun/window/native-min-size.ts +6 -1
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -0
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +50 -12
- package/src/renderers/electrobun/view/remote/ticker-repository.ts +10 -0
- package/src/series/standalone-catalog.ts +5 -4
- package/src/series/standalone.ts +13 -7
- package/src/sources/gloomberb-cloud/fred-publisher.ts +25 -0
- package/src/sources/gloomberb-cloud/fred-series.ts +1 -1
- package/src/sources/gloomberb-cloud/index.ts +14 -3
- package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
- package/src/sources/provider-router/financials.ts +20 -13
- package/src/sources/provider-router/index.ts +4 -0
- package/src/sources/provider-router/search.ts +1 -0
- package/src/sync/collections-contributor.ts +3 -1
- package/src/sync/config-merge.ts +10 -1
- package/src/sync/sanitize.ts +26 -2
- package/src/tickers/company-name-listing.ts +16 -2
- package/src/tickers/listing-fate.ts +12 -8
- package/src/tickers/renamed-listings.ts +43 -10
- package/src/tickers/search/home-listing.ts +28 -0
- package/src/tickers/search/index.ts +19 -7
- package/src/tickers/terminal-codes.ts +11 -1
- package/src/time-series/base-series.ts +3 -0
- package/src/time-series/ice-credit.ts +1 -0
- package/src/time-series/resolve.ts +3 -1
- package/src/time-series/spec.ts +2 -2
- package/src/time-series/types.ts +2 -1
- package/src/types/data-provider.ts +11 -0
- package/src/types/financials.ts +39 -3
- package/src/types/headless.ts +4 -2
- package/src/types/ticker.ts +10 -2
- package/src/utils/cli-output.ts +1 -1
- package/src/utils/declared-dividends.ts +13 -1
- package/src/utils/dividend-cash.ts +5 -1
- package/src/utils/forward-dividend.ts +4 -3
- package/src/utils/remove-folder.ts +37 -0
- package/src/utils/throttled-fetch.ts +15 -1
- package/src/utils/trailing-dividend.ts +1 -1
- package/src/plugins/builtin/composite-plugins.ts +0 -285
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { composeBuiltinPlugin } from "../plugin-module";
|
|
2
|
+
import { screenersPluginMeta } from "../builtin-plugin-meta";
|
|
3
|
+
import { equityScreenerModule } from "../equity-screener";
|
|
4
|
+
import { marketMoversModule } from "../market-movers";
|
|
5
|
+
import { scannerModule } from "../scanner";
|
|
6
|
+
|
|
7
|
+
export const screenersPlugin = composeBuiltinPlugin({
|
|
8
|
+
...screenersPluginMeta,
|
|
9
|
+
description: "Equity screener, top movers, session highs and lows, and unusual options flow.",
|
|
10
|
+
modules: [equityScreenerModule, marketMoversModule, scannerModule],
|
|
11
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PluginModule } from "../plugin-module";
|
|
2
|
+
|
|
3
|
+
// Ticker Research's modules are drawn in the renderer: the desktop backend
|
|
4
|
+
// process runs none of them, and keeps only the identity of the plugins that
|
|
5
|
+
// hold nothing else.
|
|
6
|
+
export const rendererOnly = (module: PluginModule) => ({ module, rendererOnly: true });
|
|
7
|
+
export const tickerResearchModule = (module: PluginModule) => ({ module, stateId: "ticker-research", rendererOnly: true });
|
|
8
|
+
export const runtimeOnly = (module: PluginModule): PluginModule => {
|
|
9
|
+
const { panes: _panes, paneTemplates: _paneTemplates, ...runtime } = module;
|
|
10
|
+
return runtime;
|
|
11
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { composeBuiltinPlugin } from "../plugin-module";
|
|
2
|
+
import { rendererOnly } from "./shared";
|
|
3
|
+
import { tickerCorePluginMeta } from "../builtin-plugin-meta";
|
|
4
|
+
import { chartComposerModule } from "../chart-composer";
|
|
5
|
+
import { userSeriesModule } from "../chart-composer/user-series";
|
|
6
|
+
import { companyKpisModule } from "../company-kpis";
|
|
7
|
+
import { dividendYieldModule } from "../dividend-yield";
|
|
8
|
+
import { estimateRevisionsModule } from "../estimate-revisions";
|
|
9
|
+
import { executivesModule } from "../executives";
|
|
10
|
+
import { peBandModule } from "../pe-band";
|
|
11
|
+
import { researchModule } from "../research";
|
|
12
|
+
import { revenueBreakdownModule } from "../revenue-breakdown";
|
|
13
|
+
import { reverseDcfModule } from "../reverse-dcf";
|
|
14
|
+
import { tickerDetailModule } from "../ticker-detail";
|
|
15
|
+
import { timeSalesModule } from "../time-sales";
|
|
16
|
+
|
|
17
|
+
export const tickerCorePlugin = composeBuiltinPlugin({
|
|
18
|
+
...tickerCorePluginMeta,
|
|
19
|
+
modules: [
|
|
20
|
+
...[
|
|
21
|
+
tickerDetailModule,
|
|
22
|
+
chartComposerModule,
|
|
23
|
+
researchModule,
|
|
24
|
+
estimateRevisionsModule,
|
|
25
|
+
companyKpisModule,
|
|
26
|
+
revenueBreakdownModule,
|
|
27
|
+
dividendYieldModule,
|
|
28
|
+
reverseDcfModule,
|
|
29
|
+
peBandModule,
|
|
30
|
+
executivesModule,
|
|
31
|
+
timeSalesModule,
|
|
32
|
+
].map(rendererOnly),
|
|
33
|
+
// Reads the profile's series folder, so it runs where the disk is: the desktop backend too.
|
|
34
|
+
userSeriesModule,
|
|
35
|
+
],
|
|
36
|
+
});
|
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
formatCongressReturn,
|
|
16
16
|
formatLag,
|
|
17
17
|
FILING_DAY_FORMAT,
|
|
18
|
+
nextCongressPage,
|
|
19
|
+
previousCongressYearPage,
|
|
18
20
|
sortedMembers,
|
|
19
21
|
sortedTrades,
|
|
20
22
|
sortedTickers,
|
|
@@ -113,6 +115,28 @@ function shotFilters(options: HeadlessPaneLoadArgs["options"], given: ReadonlySe
|
|
|
113
115
|
}));
|
|
114
116
|
}
|
|
115
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Why a page holds no trades, as the pane says it ("No matching trades in
|
|
120
|
+
* this filing window."): a ticker search reads one window of the year's
|
|
121
|
+
* filings, so none in it says nothing of the year, and never that Congress
|
|
122
|
+
* disclosures do not cover the ticker. Names the window read and the
|
|
123
|
+
* command that reads the next one, or the year before after the last.
|
|
124
|
+
*/
|
|
125
|
+
function emptyFilingWindow(payload: CloudCongressHousePayload, args: HeadlessPaneLoadArgs): string {
|
|
126
|
+
const symbol = args.symbols[0];
|
|
127
|
+
const from = payload.filingOffset ?? Number(args.options.filingOffset ?? 0);
|
|
128
|
+
const window = payload.filingsScanned > 0
|
|
129
|
+
? `${payload.year} filings ${from + 1}-${from + payload.filingsScanned} of ${payload.filingCount}`
|
|
130
|
+
: `${payload.year} filings`;
|
|
131
|
+
const lines = [`No matching trades${symbol ? ` in ${symbol}` : ""} in this filing window (${window}).`];
|
|
132
|
+
const next = nextCongressPage(payload);
|
|
133
|
+
const asked = ["fn CG", symbol, args.options.tab && args.options.tab !== "trades" ? `--tab ${args.options.tab}` : null].filter(Boolean).join(" ");
|
|
134
|
+
const before = next ? null : previousCongressYearPage(payload);
|
|
135
|
+
if (next) lines.push(`An empty window does not mean none this year; the next: gloom ${asked} --year ${payload.year} --filingOffset ${next.filingOffset}`);
|
|
136
|
+
else if (before) lines.push(`That was the year's last window; the year before: gloom ${asked} --year ${before.year}`);
|
|
137
|
+
return lines.join("\n");
|
|
138
|
+
}
|
|
139
|
+
|
|
116
140
|
export function createCongressHeadless(
|
|
117
141
|
dependencies: CongressHeadlessDependencies = defaultDependencies,
|
|
118
142
|
): HeadlessPaneDefinition<"rows"> {
|
|
@@ -184,7 +208,10 @@ export function createCongressHeadless(
|
|
|
184
208
|
filingsPaper: payload.filingsPaper ?? 0,
|
|
185
209
|
senateUnavailable: payload.senateUnavailable ?? false,
|
|
186
210
|
};
|
|
211
|
+
// None in this window is the window's answer for a covered ticker, not a gap in coverage.
|
|
212
|
+
const empty = (rows: unknown[]) => rows.length === 0 ? { empty: emptyFilingWindow(payload, args), unavailableSymbols: [] } : {};
|
|
187
213
|
if (args.options.tab === "tickers") {
|
|
214
|
+
const rows = sortedTickers(payload.tickers ?? [], { columnId: "buyCount", direction: "desc" }).slice(0, limit).map((row) => ({ ...row }));
|
|
188
215
|
return {
|
|
189
216
|
columns: [
|
|
190
217
|
{ key: "ticker", header: "Ticker" }, { key: "buyCount", header: "Buys", align: "right" },
|
|
@@ -192,9 +219,10 @@ export function createCongressHeadless(
|
|
|
192
219
|
{ key: "estimatedLow", header: "Est Range", format: (_value, row) => formatAmountRange(row.estimatedLow as number | null, row.estimatedHigh as number | null) },
|
|
193
220
|
{ key: "lastFilingDate", header: "Last filed" },
|
|
194
221
|
],
|
|
195
|
-
rows
|
|
222
|
+
rows,
|
|
196
223
|
// Tickers aggregate the filings scanned so far rather than paging rows.
|
|
197
224
|
metadata: { ...metadata, aggregateScope: "filtered filing window", filingOffset: payload.filingOffset, filingsScanned: payload.filingsScanned },
|
|
225
|
+
...empty(rows),
|
|
198
226
|
};
|
|
199
227
|
}
|
|
200
228
|
const pagedMetadata = { ...metadata, nextOffset: payload.nextOffset, hasMore: payload.hasMore };
|
|
@@ -202,12 +230,12 @@ export function createCongressHeadless(
|
|
|
202
230
|
const rows = sortedMembers(payload.members, { columnId: "trades", direction: "desc" })
|
|
203
231
|
.slice(0, limit)
|
|
204
232
|
.map((member) => ({ ...member }));
|
|
205
|
-
return { columns: MEMBER_COLUMNS, rows, metadata: pagedMetadata };
|
|
233
|
+
return { columns: MEMBER_COLUMNS, rows, metadata: pagedMetadata, ...empty(rows) };
|
|
206
234
|
}
|
|
207
235
|
const rows = sortedTrades(payload.trades, { columnId: "filed", direction: "desc" })
|
|
208
236
|
.slice(0, limit)
|
|
209
237
|
.map((trade) => ({ ...trade }));
|
|
210
|
-
return { columns: TRADE_COLUMNS, rows, metadata: pagedMetadata };
|
|
238
|
+
return { columns: TRADE_COLUMNS, rows, metadata: pagedMetadata, ...empty(rows) };
|
|
211
239
|
},
|
|
212
240
|
};
|
|
213
241
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box, type InputRenderable } from "../../../ui";
|
|
2
2
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { PaneStatusBody, QueryBar,
|
|
3
|
+
import { PaneStatusBody, QueryBar, RowNote, usePaneFooter } from "../../../components";
|
|
4
|
+
import { wrapTextLines } from "../../../utils/text-wrap";
|
|
4
5
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
5
6
|
import type { PaneProps } from "../../../types/plugin";
|
|
6
7
|
import type { PluginModule } from "../plugin-module";
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
buildCorrelationPaneTitle,
|
|
38
39
|
buildGeoCorrelationSeries,
|
|
39
40
|
buildStatusSummary,
|
|
40
|
-
|
|
41
|
+
matrixCellNotes,
|
|
41
42
|
type CorrelationSeries,
|
|
42
43
|
getSeriesForEntry,
|
|
43
44
|
pairKey,
|
|
@@ -215,29 +216,23 @@ function CorrelationMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
215
216
|
phase: "before",
|
|
216
217
|
scope: "correlation:tickers",
|
|
217
218
|
});
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
// The ticker set and range are visible in-pane and an invalid list shows in
|
|
226
|
-
// the body, so the footer carries load state, and a future's rolls as GR
|
|
227
|
-
// says them. `r` is global: no hint.
|
|
228
|
-
const rollNotes = correlationRollNotes(symbols, seriesBySymbol).join(" · ");
|
|
219
|
+
// What concerns a symbol (a failed refresh, a future's rolls as GR says them) or the selected pair is said under
|
|
220
|
+
// the matrix while a cell of it is selected, as a table's row note is; the footer carries the matrix's load state.
|
|
221
|
+
// The ticker set and range are visible in-pane and an invalid list shows in the body. `r` is global: no hint.
|
|
222
|
+
const cellNote = matrixCellNotes(selection ? [...new Set(selection)] : [], seriesBySymbol,
|
|
223
|
+
pair && pairHistory?.unavailable ? `${pair.join("/")}: ${pairHistory.unavailable}` : null).join(" ");
|
|
229
224
|
usePaneFooter("correlation", () => ({
|
|
230
225
|
info: !settings.symbolsError && symbols.length >= 2 && statusSummary
|
|
231
|
-
? [{ id: "status", parts: [{ text: statusSummary, tone: "muted" as const }] }
|
|
232
|
-
...(rollNotes ? [{ id: "rolls", parts: [{ text: rollNotes, tone: "muted" as const }] }] : [])]
|
|
226
|
+
? [{ id: "status", parts: [{ text: statusSummary, tone: "muted" as const }] }]
|
|
233
227
|
: [],
|
|
234
|
-
}), [
|
|
228
|
+
}), [settings.symbolsError, statusSummary, symbols.length]);
|
|
235
229
|
|
|
236
230
|
// Rows are exactly as wide as the matrix (after the one-cell inset), so the
|
|
237
231
|
// zebra and hover bands stop at the last column instead of running on.
|
|
238
232
|
const matrixRowWidth = correlationMatrixLayout(symbols, width).rowWidth;
|
|
239
233
|
const chartRows = pair ? matrixChartRows(width, height, symbols.length, matrixRowWidth) : 0;
|
|
240
|
-
const
|
|
234
|
+
const noteRows = cellNote ? wrapTextLines(cellNote, Math.max(1, width - 2)).length : 0;
|
|
235
|
+
const matrixHeight = Math.max(1, height - 1 - noteRows - (chartRows > 0 ? chartRows + 1 : 0));
|
|
241
236
|
const bodyStatus = settings.symbolsError
|
|
242
237
|
? <PaneStatusBody error={settings.symbolsError} />
|
|
243
238
|
: symbols.length < 2
|
|
@@ -287,6 +282,7 @@ function CorrelationMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
287
282
|
rowColor={(symbol) => rowHeaderColor(seriesBySymbol.get(symbol)?.status ?? "loading")}
|
|
288
283
|
onOpenSymbol={openSymbol}
|
|
289
284
|
/>
|
|
285
|
+
<RowNote>{cellNote}</RowNote>
|
|
290
286
|
{chartRows > 0 && pair && pairHistory ? (
|
|
291
287
|
<MatrixPairChart
|
|
292
288
|
pair={pair}
|
|
@@ -204,6 +204,24 @@ export function correlationRollNotes(symbols: readonly string[], seriesBySymbol:
|
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* What the matrix says under itself for the selected cell: each of its
|
|
209
|
+
* symbols' rolls and failed refresh, then the pair's own note. A note about
|
|
210
|
+
* one symbol is said where that symbol is selected, never in the footer.
|
|
211
|
+
*/
|
|
212
|
+
export function matrixCellNotes(symbols: readonly string[], seriesBySymbol: ReadonlyMap<string, CorrelationSeries>, pairNote: string | null): string[] {
|
|
213
|
+
return [
|
|
214
|
+
...correlationRollNotes(symbols, seriesBySymbol).map((note) => `${note.replace(/\.$/, "")}.`),
|
|
215
|
+
...symbols.flatMap((symbol) => {
|
|
216
|
+
const series = seriesBySymbol.get(symbol);
|
|
217
|
+
return series?.refreshError
|
|
218
|
+
? [`${symbol}: ${series.refreshError}${series.fetchedAt ? ` Retained history retrieved ${new Date(series.fetchedAt).toISOString()}.` : ""}`]
|
|
219
|
+
: [];
|
|
220
|
+
}),
|
|
221
|
+
...(pairNote ? [pairNote] : []),
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
|
|
207
225
|
/**
|
|
208
226
|
* The matrix already labels every symbol on both axes and the pane now carries
|
|
209
227
|
* its own range control, so the title stays generic instead of repeating them.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fredSeriesUrl } from "../../../sources/gloomberb-cloud/fred-series";
|
|
2
2
|
import type { SeriesDefinition } from "../../../series/types";
|
|
3
|
-
import { ICE_CREDIT_SERIES, ICE_HISTORY_LIMIT_NOTICE } from "../../../time-series/ice-credit";
|
|
3
|
+
import { ICE_CREDIT_PUBLISHER, ICE_CREDIT_SERIES, ICE_HISTORY_LIMIT_NOTICE } from "../../../time-series/ice-credit";
|
|
4
4
|
|
|
5
5
|
/** Corporate bond option-adjusted spreads by rating and region, and the effective yields of the US indexes. */
|
|
6
6
|
export const CREDIT_SPREAD_SERIES: readonly SeriesDefinition[] = ICE_CREDIT_SERIES.map((series) => ({
|
|
@@ -11,7 +11,7 @@ export const CREDIT_SPREAD_SERIES: readonly SeriesDefinition[] = ICE_CREDIT_SERI
|
|
|
11
11
|
frequency: "daily",
|
|
12
12
|
group: "Credit",
|
|
13
13
|
tags: [series.measure, ...series.tags, "corporate bonds"],
|
|
14
|
-
publisher:
|
|
14
|
+
publisher: ICE_CREDIT_PUBLISHER,
|
|
15
15
|
// A fixed note on every ICE series. G and CRD read the same sentence from each series' FRED notes instead, so there it lapses if FRED lifts the limit.
|
|
16
16
|
limitation: ICE_HISTORY_LIMIT_NOTICE,
|
|
17
17
|
url: fredSeriesUrl(series.seriesId),
|
|
@@ -4,7 +4,7 @@ import type { ConnectionHealthRegistry } from "../../../core/connection-health";
|
|
|
4
4
|
import type { DividendMetrics, DividendPayment, GrowthPayments } from "./types";
|
|
5
5
|
import { resolveCurrencyUnit } from "../../../utils/currency-units";
|
|
6
6
|
import { calendarMonthsBefore } from "../../../utils/calendar-date";
|
|
7
|
-
import { cashDistribution, dividendReferencePrice, dividendYieldAt, inferCadence, trailingCashAt, trailingDividendRate, trailingPaymentShortfall, unevenRegularPayments } from "../../../utils/trailing-dividend";
|
|
7
|
+
import { cashDistribution, dividendReferencePrice, dividendYieldAt, inferCadence, trailingCashAt, trailingDividendRate, trailingPayments as countedTrailingPayments, trailingPaymentShortfall, unevenRegularPayments } from "../../../utils/trailing-dividend";
|
|
8
8
|
import { dividendQuotePriceMetadata } from "./reference-price";
|
|
9
9
|
import { mapQuote } from "../../../sources/gloomberb-cloud/normalizers";
|
|
10
10
|
import { regularSessionValuationPrice } from "../../../market-data/quotes/regular-session-valuation";
|
|
@@ -35,8 +35,8 @@ function unavailableDividendHistory(triedAt?: string): string {
|
|
|
35
35
|
return `Cash history unavailable${lastTried(triedAt)}; no payments, totals or growth.`;
|
|
36
36
|
}
|
|
37
37
|
/** A read without its summary; `forward` when another source still gave the forward rate. */
|
|
38
|
-
function unavailableDividendSummary(triedAt?: string, { forward = false } = {}): string {
|
|
39
|
-
return `Dividend summary unavailable${lastTried(triedAt)}; no ${forward ? "payout ratio
|
|
38
|
+
function unavailableDividendSummary(triedAt?: string, { forward = false, payDate = false } = {}): string {
|
|
39
|
+
return `Dividend summary unavailable${lastTried(triedAt)}; no ${forward ? "payout ratio" : "forward rate, payout ratio"}${payDate ? "" : " or pay date"}.`;
|
|
40
40
|
}
|
|
41
41
|
export const INCOMPLETE_DIVIDEND_HISTORY = incompleteDividendHistory();
|
|
42
42
|
export const MISSING_DIVIDEND_CURRENCY = "Dividend currency is unavailable; cash amounts cannot be compared safely.";
|
|
@@ -163,7 +163,7 @@ export interface DividendData {
|
|
|
163
163
|
convertedFrom?: string;
|
|
164
164
|
/** Beside convertedFrom, the sub-unit the source states the cash in (GBp, ZAc): converted amounts are written in it. */
|
|
165
165
|
convertedSubUnit?: string;
|
|
166
|
-
/** Declared and unpaid, in `currency`;
|
|
166
|
+
/** Declared and unpaid, in `currency`; issuer-confirmed ex-dated rows also enter `payments`. Absent from older servers. */
|
|
167
167
|
declared?: DeclaredDividendAction[];
|
|
168
168
|
metrics: DividendMetrics;
|
|
169
169
|
price: number | null;
|
|
@@ -179,6 +179,8 @@ export interface DividendData {
|
|
|
179
179
|
providerId?: string;
|
|
180
180
|
/** Source fetch time, not the last ex-date or this pane's cache-read time. */
|
|
181
181
|
fetchedAt?: string;
|
|
182
|
+
declaredCashAsOf?: string;
|
|
183
|
+
cashVerificationWarning?: string;
|
|
182
184
|
stale?: boolean;
|
|
183
185
|
priceAsOf?: string;
|
|
184
186
|
priceStale?: boolean;
|
|
@@ -218,7 +220,7 @@ export async function fetchDividendData(
|
|
|
218
220
|
: null;
|
|
219
221
|
const statedFields = !summary && stated && (!cashCurrency || stated.currency === cashCurrency) ? statedRateSummary(stated) : null;
|
|
220
222
|
const quoteFields = summary ?? statedFields;
|
|
221
|
-
|
|
223
|
+
let summaryError = !summary ? unavailableDividendSummary(triedAt, { forward: quoteFields != null, payDate: !!actions?.declaredCash?.announced?.payDate })
|
|
222
224
|
: response.data.summaryError ?? ([summary.exDividendDate, summary.dividendDate]
|
|
223
225
|
.some((timestamp) => timestamp != null && reportedDividendDate(timestamp) === null)
|
|
224
226
|
? INVALID_DIVIDEND_SUMMARY_DATE : undefined);
|
|
@@ -233,13 +235,18 @@ export async function fetchDividendData(
|
|
|
233
235
|
const convertedFrom = cashCurrency ? declaredCurrencyOf(actions?.declaredCash, cashCurrency) : undefined;
|
|
234
236
|
const sourceUnit = sourceActions?.currency;
|
|
235
237
|
const convertedSubUnit = convertedFrom && sourceUnit && resolveCurrencyUnit(sourceUnit).divisor !== 1 ? sourceUnit : undefined;
|
|
236
|
-
const
|
|
238
|
+
const declared = actions && cashCurrency ? declaredDividends(actions) : [];
|
|
239
|
+
const distributions = actions ? [...actions.dividends, ...declared.filter((row) => declaredCash.has(row.exDate) && Date.parse(row.exDate) <= Date.now())] : [];
|
|
240
|
+
const payments = cashCurrency ? distributions.flatMap(action => {
|
|
237
241
|
const payment = toDividendPayment(action.exDate, action.amount, cashCurrency);
|
|
238
242
|
const declared = declaredCash.get(action.exDate);
|
|
239
|
-
const source = distributionSource(action.source);
|
|
240
|
-
return payment ? [{ ...payment,
|
|
243
|
+
const source = distributionSource("source" in action ? action.source : undefined);
|
|
244
|
+
return payment ? [{ ...payment, paymentDate: action.payDate ? reportedDividendDate(Date.parse(action.payDate) / 1000) : null,
|
|
245
|
+
recordDate: action.recordDate ? reportedDividendDate(Date.parse(action.recordDate) / 1000) : null,
|
|
246
|
+
...(declared ? { declared } : {}), ...("cashEstimate" in action && action.cashEstimate ? { cashEstimate: action.cashEstimate } : {}),
|
|
247
|
+
...(source ? { source } : {}) }] : [];
|
|
241
248
|
}).sort((a, b) => b.exDate.getTime() - a.exDate.getTime()) : [];
|
|
242
|
-
if (!historyError && actions && (actions.coverage?.dividends === "unavailable" || payments.length !==
|
|
249
|
+
if (!historyError && actions && (actions.coverage?.dividends === "unavailable" || payments.length !== distributions.length)) {
|
|
243
250
|
// A read with no rows is not an incomplete one.
|
|
244
251
|
historyError = actions.dividends.length === 0 ? unavailableDividendHistory(triedAt) : incompleteDividendHistory(triedAt);
|
|
245
252
|
}
|
|
@@ -250,14 +257,40 @@ export async function fetchDividendData(
|
|
|
250
257
|
// The annual rates are in the summary's currency, the major unit Gloom Cloud states it in. One stated in a
|
|
251
258
|
// sub-unit, as an older server's is, has them in an unstated unit (SBK's 17.8 "ZAc" is rand), so none is read.
|
|
252
259
|
const summaryRatesComparable = !!summaryUnit.currency && summaryUnit.divisor === 1 && summaryUnit.currency === currency;
|
|
253
|
-
const
|
|
254
|
-
const
|
|
260
|
+
const announced = actions?.declaredCash?.announced;
|
|
261
|
+
const announcedFields = announced ? { trailingAnnualDividendRate: null, trailingAnnualDividendYield: null,
|
|
262
|
+
forwardAnnualDividendRate: null, payoutRatio: null, currency: currency || null, ...quoteFields,
|
|
263
|
+
exDividendDate: Date.parse(announced.exDate) / 1000, dividendDate: Date.parse(announced.payDate) / 1000,
|
|
264
|
+
} : quoteFields;
|
|
265
|
+
const metricFields = actions && historyError && announcedFields ? { ...announcedFields, trailingAnnualDividendRate: null } : announcedFields;
|
|
255
266
|
const token = isToken(symbol, exchange, quote?.instrumentType);
|
|
256
267
|
const built = buildDividendMetrics(payments, metricFields, price, { historyAvailable, summaryRatesComparable, declared });
|
|
257
268
|
// A token's empty history is no 0.00% yield: it has none to measure.
|
|
258
|
-
|
|
269
|
+
let metrics = token && payments.length === 0
|
|
259
270
|
? { ...built, trailingRate: null, forwardRate: null, trailingYield: null, forwardYield: null, forwardRateAsOf: null }
|
|
260
271
|
: built;
|
|
272
|
+
const annualCount = { monthly: 12, quarterly: 4, "semi-annual": 2, annual: 1, irregular: 0 }[metrics.paymentFrequency ?? "irregular"];
|
|
273
|
+
const announcedCash = declared.find((row) => row.exDate === announced?.exDate);
|
|
274
|
+
const announcedAmount = announced?.paidAmount ?? announcedCash?.amount;
|
|
275
|
+
const announcedUneven = announcedCash && historyAvailable && !metrics.lapse ? unevenRegularPayments(payments, new Date()) : null;
|
|
276
|
+
if (announcedUneven) {
|
|
277
|
+
metrics = repriceDividendMetrics({ ...metrics, forwardRate: announcedUneven.total, forwardBasis: "uneven",
|
|
278
|
+
forwardRateAsOf: announcedUneven.latest.toISOString().slice(0, 10) }, price);
|
|
279
|
+
} else if (announced && announcedAmount != null && !metrics.lapse && metrics.forwardBasis !== "uneven" && annualCount > 0) {
|
|
280
|
+
metrics = repriceDividendMetrics({ ...metrics, forwardRate: announcedAmount * annualCount, forwardRateAsOf: announced.exDate }, price);
|
|
281
|
+
}
|
|
282
|
+
if (!summary && metrics.forwardRate != null) {
|
|
283
|
+
summaryError = unavailableDividendSummary(triedAt, { forward: true, payDate: !!announced?.payDate });
|
|
284
|
+
}
|
|
285
|
+
if (metrics.forwardRate != null && metrics.forwardBasis === "uneven" && metrics.trailingEstimates?.length) {
|
|
286
|
+
metrics.forwardEstimate = metrics.trailingEstimates.at(-1);
|
|
287
|
+
} else if (metrics.forwardRate != null && metrics.forwardBasis !== "uneven" && convertedFrom && (!announced || announced.paidAmount == null || !annualCount)) {
|
|
288
|
+
metrics.forwardEstimate = announcedCash?.cashEstimate ?? { declaredCurrency: convertedFrom,
|
|
289
|
+
...(announced ? { declaredAmount: announced.amount, fixingDate: announced.fixingDate } : {}),
|
|
290
|
+
basis: announced ? "Indicated annual rate converted from the declared currency; the issuer's cash-currency conversion is not fixed."
|
|
291
|
+
: "Indicated annual rate converted from the declared currency; the conversion rate and fixing date are unavailable.",
|
|
292
|
+
};
|
|
293
|
+
}
|
|
261
294
|
if (!historyAvailable && !historyError && metrics.trailingRate == null && metrics.forwardRate == null && !token) {
|
|
262
295
|
throw new Error(`No dividend data found for ${symbol}`);
|
|
263
296
|
}
|
|
@@ -268,9 +301,12 @@ export async function fetchDividendData(
|
|
|
268
301
|
...(historyError ? { historyError } : {}), ...(summaryError ? { summaryError } : {}),
|
|
269
302
|
...(statedFields && metrics.forwardRate != null ? { forwardFromFundamentals: true } : {}),
|
|
270
303
|
// A history standing in for a refresh that could not read it is dated by its own read.
|
|
271
|
-
providerId: actions?.providerId ?? "gloom", fetchedAt: actions?.dividendsAsOf ?? actions?.fetchedAt,
|
|
272
|
-
|
|
273
|
-
|
|
304
|
+
providerId: actions?.providerId ?? "gloom", fetchedAt: [actions?.dividendsAsOf ?? actions?.fetchedAt, actions?.declaredCash?.fetchedAt]
|
|
305
|
+
.filter((value): value is string => !!value && Number.isFinite(Date.parse(value))).sort()[0],
|
|
306
|
+
declaredCashAsOf: actions?.declaredCash?.fetchedAt,
|
|
307
|
+
...(actions?.declaredCash?.verification === "unavailable" ? { cashVerificationWarning: "Dividend cash is not issuer-verified; issuer confirmation is unavailable. Upstream history is shown." } : {}),
|
|
308
|
+
stale: response.stale === true || response.data.stale === true || actions?.stale === true || actions?.declaredCash?.stale === true,
|
|
309
|
+
notes: ["Cash yield excludes taxes and reinvestment. Unannounced future payments and tax components are not modeled."],
|
|
274
310
|
};
|
|
275
311
|
}
|
|
276
312
|
|
|
@@ -296,6 +332,8 @@ export function buildDividendMetrics(
|
|
|
296
332
|
const trailingRate = options.historyAvailable !== false
|
|
297
333
|
? trailingDividendRate(payments, now)
|
|
298
334
|
: options.summaryRatesComparable !== false ? quoteFields?.trailingAnnualDividendRate ?? null : null;
|
|
335
|
+
const trailingEstimates = options.historyAvailable !== false
|
|
336
|
+
? countedTrailingPayments(payments, now).counted.flatMap((payment) => payment.cashEstimate ? [payment.cashEstimate] : []) : [];
|
|
299
337
|
const statedRate = options.summaryRatesComparable !== false ? quoteFields?.forwardAnnualDividendRate ?? null : null;
|
|
300
338
|
const statedAsOf = statedRate != null && /^\d{4}-\d{2}-\d{2}$/.test(quoteFields?.forwardRateAsOf ?? "")
|
|
301
339
|
? quoteFields!.forwardRateAsOf! : null;
|
|
@@ -310,7 +348,9 @@ export function buildDividendMetrics(
|
|
|
310
348
|
|
|
311
349
|
const reportedPayDate = reportedDividendDate(quoteFields?.dividendDate ?? null);
|
|
312
350
|
const today = new Date(now.toISOString().slice(0, 10));
|
|
313
|
-
const
|
|
351
|
+
const paymentDates = payments.flatMap((payment) => payment.paymentDate && payment.paymentDate >= today ? [payment.paymentDate] : []);
|
|
352
|
+
if (reportedPayDate && reportedPayDate >= today) paymentDates.push(reportedPayDate);
|
|
353
|
+
const nextPayDate = paymentDates.length ? new Date(Math.min(...paymentDates.map((date) => date.getTime()))) : null;
|
|
314
354
|
|
|
315
355
|
// A dividend that has stopped has no forward rate, whatever is still stated for it.
|
|
316
356
|
// Without a usable history only the latest date known says it, on the annual window.
|
|
@@ -344,6 +384,7 @@ export function buildDividendMetrics(
|
|
|
344
384
|
trailingYield: null,
|
|
345
385
|
forwardYield: null,
|
|
346
386
|
trailingRate,
|
|
387
|
+
...(trailingEstimates.length ? { trailingEstimates } : {}),
|
|
347
388
|
forwardRate,
|
|
348
389
|
forwardRateAsOf,
|
|
349
390
|
...(uneven ? { forwardBasis: "uneven" as const } : {}),
|
|
@@ -8,7 +8,7 @@ import { fetchDividendData, requestDividendHistory, statedForwardRate, TOKEN_YIE
|
|
|
8
8
|
import { dividendReferencePrice } from "../../../utils/trailing-dividend";
|
|
9
9
|
import type { DividendPayment, GrowthPayments } from "./types";
|
|
10
10
|
import {
|
|
11
|
-
convertedFromText, formatConvertedAmount, formatDividendYield, growthPaymentsText, PAYOUT_NOT_MEANINGFUL, staleHistoryText, toDividendRows, trailingPaymentsText,
|
|
11
|
+
cashEstimateText, convertedFromText, formatConvertedAmount, formatDividendYield, forwardEstimateText, growthPaymentsText, PAYOUT_NOT_MEANINGFUL, staleHistoryText, toDividendRows, trailingPaymentsText,
|
|
12
12
|
} from "./view";
|
|
13
13
|
import { MISSING_VALUE, formatDistributionAmount, formatPercent } from "../../../utils/format";
|
|
14
14
|
import { NOT_MEANINGFUL_TEXT } from "../../../utils/growth";
|
|
@@ -40,7 +40,7 @@ function paymentColumns(converted: boolean, subUnit?: string) {
|
|
|
40
40
|
{ key: "exDate", header: "Ex-date" },
|
|
41
41
|
{ key: "amount", header: "Amount", align: "right" as const,
|
|
42
42
|
format: (value: unknown, row: Record<string, unknown>) => typeof value === "number" && typeof row.currency === "string" && row.currency
|
|
43
|
-
? amount(value, row.currency) : value == null ? MISSING_VALUE : String(value) },
|
|
43
|
+
? `${row.cashEstimate ? "estimated " : ""}${amount(value, row.currency)}` : value == null ? MISSING_VALUE : String(value) },
|
|
44
44
|
{ key: "currency", header: "CCY" },
|
|
45
45
|
{ key: "type", header: "Type" },
|
|
46
46
|
];
|
|
@@ -211,11 +211,12 @@ export function projectDividendYieldHeadless(
|
|
|
211
211
|
const priceStatus = dividendPriceStatus(data.price, data.priceAsOf, data.priceStale);
|
|
212
212
|
// A regular payer's year with fewer payments than its cadence pays: the yield says how many it counts.
|
|
213
213
|
const shortfall = trailingPaymentsText(metrics.trailingPayments, { cadence: true });
|
|
214
|
-
const
|
|
214
|
+
const trailingEstimate = metrics.trailingEstimates?.length ? metrics.trailingEstimates.map(cashEstimateText).join("; ") : null;
|
|
215
|
+
const errors = [data.historyError, data.summaryError, data.cashVerificationWarning, tax?.checkError].filter((error): error is string => !!error);
|
|
215
216
|
|
|
216
217
|
// A monthly payer's history that ends early: its yields and last ex-date stop there, and each says so.
|
|
217
218
|
const historyEnd = metrics.lapse?.historyEnds ? metrics.lapse.lastPaid : null;
|
|
218
|
-
const trailingNotes = [TRAILING_DIVIDEND_BASIS, shortfall ? `counts ${shortfall}` : null, historyEnd ? historyEndsText(historyEnd) : null]
|
|
219
|
+
const trailingNotes = [TRAILING_DIVIDEND_BASIS, shortfall ? `counts ${shortfall}` : null, historyEnd ? historyEndsText(historyEnd) : null, trailingEstimate]
|
|
219
220
|
.filter((note): note is string => !!note).join("; ");
|
|
220
221
|
const trailingLabel = bond ? `Trailing distribution yield (${NOT_SEC_YIELD})` : "Trailing yield";
|
|
221
222
|
const forwardLabel = bond ? `Forward distribution yield (${NOT_SEC_YIELD})` : "Forward yield";
|
|
@@ -226,7 +227,7 @@ export function projectDividendYieldHeadless(
|
|
|
226
227
|
const datesAndCash = [
|
|
227
228
|
dateEntry("Last ex-dividend", metrics.lastExDividendDate),
|
|
228
229
|
dateEntry("Next ex-dividend", metrics.nextExDividendDate),
|
|
229
|
-
dateEntry("Next pay", metrics.nextPayDate),
|
|
230
|
+
metrics.nextPayDate ? dateEntry("Next pay", metrics.nextPayDate) : { label: "Next pay", value: null, formatted: "Unavailable" },
|
|
230
231
|
...(data.payments.length > 0 && metrics.trailingRate === 0
|
|
231
232
|
? [{ label: "Cash status", value: "No cash distributions reported in the past 12 months." }] : []),
|
|
232
233
|
];
|
|
@@ -252,16 +253,16 @@ export function projectDividendYieldHeadless(
|
|
|
252
253
|
{ label: forwardLabel, value: roundedRatio(metrics.forwardYield),
|
|
253
254
|
formatted: forwardText
|
|
254
255
|
?? (metrics.forwardYield == null ? formatDividendYield(null)
|
|
255
|
-
: `${formatDividendYield(metrics.forwardYield)} (${metrics.forwardBasis === "uneven" ? UNEVEN_REGULAR_PAYMENTS
|
|
256
|
-
: forwardDividendBasis(metrics.forwardRateAsOf, { payDate: forwardPayDate(metrics), declared: data.declared, currency })})`) },
|
|
256
|
+
: `${formatDividendYield(metrics.forwardYield)} (${forwardEstimateText(metrics) ?? (metrics.forwardBasis === "uneven" ? UNEVEN_REGULAR_PAYMENTS
|
|
257
|
+
: forwardDividendBasis(metrics.forwardRateAsOf, { payDate: forwardPayDate(metrics), declared: data.declared, currency }))})`) },
|
|
257
258
|
...figures.map((figure) => ({
|
|
258
259
|
label: figureLabel(figure),
|
|
259
260
|
value: figure.value,
|
|
260
261
|
formatted: `${figure.text}${figure.date ? ` (as of ${figure.date})` : ""}`,
|
|
261
262
|
})),
|
|
262
|
-
{ label: "Trailing rate", value: metrics.trailingRate, formatted: cashRate(metrics.trailingRate) },
|
|
263
|
-
{ label: "Forward rate", value: metrics.forwardRate, formatted: cashRate(metrics.forwardRate) },
|
|
264
|
-
{ label: "
|
|
263
|
+
{ label: "Trailing rate", value: metrics.trailingRate, formatted: `${cashRate(metrics.trailingRate)}${trailingEstimate ? ` (${trailingEstimate})` : ""}` },
|
|
264
|
+
{ label: "Forward rate", value: metrics.forwardRate, formatted: `${cashRate(metrics.forwardRate)}${metrics.forwardEstimate ? ` (${forwardEstimateText(metrics)})` : ""}` },
|
|
265
|
+
{ label: "Payout (basis/date unstated)", value: roundedRatio(metrics.payoutRatio), formatted: metrics.payoutNotMeaningful ? PAYOUT_NOT_MEANINGFUL : formatDividendYield(metrics.payoutRatio) },
|
|
265
266
|
growthEntry("1Y Cash Growth", metrics.growth1Y, metrics.growth1YPayments, metrics.growth1YNotMeaningful),
|
|
266
267
|
growthEntry("3Y Cash CAGR", metrics.growth3Y, metrics.growth3YPayments, metrics.growth3YNotMeaningful),
|
|
267
268
|
{ label: "Frequency", value: metrics.paymentFrequency },
|
|
@@ -284,7 +285,7 @@ export function projectDividendYieldHeadless(
|
|
|
284
285
|
asOf: metrics.trailingRate == null ? null : lastEx },
|
|
285
286
|
{ label: "Forward rate", value: metrics.forwardRate, ...(metrics.forwardRate != null && currency && !convertedFrom ? { unit: currency } : { formatted: cashRate(metrics.forwardRate) }),
|
|
286
287
|
asOf: metrics.forwardRate == null ? null : metrics.forwardRateAsOf },
|
|
287
|
-
{ label: "
|
|
288
|
+
{ label: "Payout (basis/date unstated)", value: roundedRatio(metrics.payoutRatio), formatted: metrics.payoutNotMeaningful ? PAYOUT_NOT_MEANINGFUL : formatDividendYield(metrics.payoutRatio),
|
|
288
289
|
exportUnit: "pct", asOf: null },
|
|
289
290
|
{ ...growthEntry("1Y Cash Growth", metrics.growth1Y, metrics.growth1YPayments, metrics.growth1YNotMeaningful), exportUnit: "pct", asOf: metrics.growth1Y == null ? null : lastEx },
|
|
290
291
|
{ ...growthEntry("3Y Cash CAGR", metrics.growth3Y, metrics.growth3YPayments, metrics.growth3YNotMeaningful), exportUnit: "pct", asOf: metrics.growth3Y == null ? null : lastEx },
|
|
@@ -328,6 +329,11 @@ export function projectDividendYieldHeadless(
|
|
|
328
329
|
growth1YNotMeaningful: metrics.growth1YNotMeaningful === true,
|
|
329
330
|
growth3YNotMeaningful: metrics.growth3YNotMeaningful === true,
|
|
330
331
|
forwardRateAsOf: metrics.forwardRateAsOf,
|
|
332
|
+
forwardRateEstimate: metrics.forwardEstimate ?? null,
|
|
333
|
+
trailingRateEstimates: metrics.trailingEstimates ?? [],
|
|
334
|
+
nextPayDateStatus: metrics.nextPayDate ? "announced" : "unavailable",
|
|
335
|
+
declaredCashAsOf: data.declaredCashAsOf ?? null,
|
|
336
|
+
cashVerificationWarning: data.cashVerificationWarning ?? null,
|
|
331
337
|
// Set when a monthly payer's history stops more than 40 days ago: its forward yield is withheld and its trailing yield counts the history to then.
|
|
332
338
|
historyEnds: metrics.lapse?.historyEnds ? metrics.lapse.lastPaid : null,
|
|
333
339
|
// "uneven": the year's regular payments differ too widely for one to be annualized, so the forward rate is their total.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataTableColumn } from "../../../components";
|
|
2
2
|
import { compareSortValues, type SortDirection } from "../../../utils/sort-values";
|
|
3
|
-
import
|
|
3
|
+
import { displayWidth } from "../../../utils/format";
|
|
4
|
+
import { formatDividendRowAmount, type DividendRow } from "./view";
|
|
4
5
|
|
|
5
6
|
export type DividendColumnId = "exDate" | "amount" | "declared" | "currency" | "source";
|
|
6
7
|
export type DividendColumn = DataTableColumn & { id: DividendColumnId };
|
|
@@ -22,11 +23,11 @@ export const DEFAULT_SORT_PREFERENCE: DividendSortPreference = {
|
|
|
22
23
|
* when the payments mix currencies; otherwise the amount's own symbol says it.
|
|
23
24
|
* The source column shows only when a fund's sponsor gave a row its history lacks.
|
|
24
25
|
*/
|
|
25
|
-
export function buildDividendColumns(rows: readonly Pick<DividendRow, "currency" | "declared" | "source">[] = []): DividendColumn[] {
|
|
26
|
+
export function buildDividendColumns(rows: readonly Pick<DividendRow, "amount" | "currency" | "declared" | "source" | "cashEstimate">[] = [], converted = false, subUnit?: string): DividendColumn[] {
|
|
26
27
|
const mixed = new Set(rows.map((row) => row.currency)).size > 1;
|
|
27
28
|
return [
|
|
28
29
|
{ id: "exDate", label: "EX-DATE", width: 10, align: "left" },
|
|
29
|
-
{ id: "amount", label: "AMOUNT", width: 12, align: "right" },
|
|
30
|
+
{ id: "amount", label: "AMOUNT", width: Math.max(12, ...rows.map((row) => displayWidth(formatDividendRowAmount(row, converted, subUnit)))), align: "right" },
|
|
30
31
|
...(rows.some((row) => row.declared) ? [{ id: "declared" as const, label: "DECLARED", width: 10, align: "right" as const }] : []),
|
|
31
32
|
...(mixed ? [{ id: "currency" as const, label: "CCY", width: 6, align: "left" as const }] : []),
|
|
32
33
|
...(rows.some((row) => row.source) ? [{ id: "source" as const, label: "SOURCE", width: 12, align: "left" as const }] : []),
|
|
@@ -32,7 +32,7 @@ import { isCloudSessionRequired, useResearchCloudSession } from "../shared/resea
|
|
|
32
32
|
import { fetchDividendData, repriceDividendMetrics, statedForwardRate, type DividendData } from "./client";
|
|
33
33
|
import { dividendReferencePrice } from "../../../utils/trailing-dividend";
|
|
34
34
|
import { useTickerQuoteStream } from "../../../state/hooks/live-ticker-financials";
|
|
35
|
-
import { buildTrailingCashChartPoints, convertedFromText, formatConvertedAmount, formatDividendYield, growthPaymentsDetail, PAYOUT_NOT_MEANINGFUL, staleHistoryText, toDividendRows, trailingPaymentsText, type DividendRow } from "./view";
|
|
35
|
+
import { buildTrailingCashChartPoints, convertedFromText, formatConvertedAmount, formatDividendRowAmount, formatDividendYield, forwardEstimateText, growthPaymentsDetail, PAYOUT_NOT_MEANINGFUL, staleHistoryText, toDividendRows, trailingPaymentsText, type DividendRow } from "./view";
|
|
36
36
|
import {
|
|
37
37
|
DEFAULT_SORT_PREFERENCE,
|
|
38
38
|
buildDividendColumns,
|
|
@@ -99,41 +99,44 @@ function buildMetricItems(metrics: DividendMetrics, currency: string, hasHistory
|
|
|
99
99
|
// The rates of a listing paid in a conversion of what its company declares say what they were converted from.
|
|
100
100
|
const converted = convertedFrom ? { detail: convertedFromText(convertedFrom) } : {};
|
|
101
101
|
const exDate: StatItem[] = metrics.nextExDividendDate
|
|
102
|
-
? [{ id: "next-ex", label: "Next ex", value: formatDate(metrics.nextExDividendDate) }]
|
|
102
|
+
? [{ id: "next-ex", label: "Next ex", value: formatDate(metrics.nextExDividendDate), essential: true }]
|
|
103
103
|
: hasHistory ? [] : [{ id: "last-ex", label: "Last ex", value: formatDate(metrics.lastExDividendDate) }];
|
|
104
104
|
const dated = metrics.lapse ? lastPaidNote(metrics.lapse)
|
|
105
105
|
: metrics.forwardYield == null ? null
|
|
106
|
-
: metrics.forwardBasis === "uneven" ? UNEVEN_REGULAR_PAYMENTS : forwardDividendNote(metrics.forwardRateAsOf, { declared, currency });
|
|
106
|
+
: forwardEstimateText(metrics) ?? (metrics.forwardBasis === "uneven" ? UNEVEN_REGULAR_PAYMENTS : forwardDividendNote(metrics.forwardRateAsOf, { declared, currency }));
|
|
107
107
|
// "not SEC" in the grid: the SEC yield is the next cell, and the long form costs the header a column.
|
|
108
108
|
const notSec = (note: string | null) => bond ? [note, "not SEC"].filter(Boolean).join(", ") : note;
|
|
109
|
-
const forwardNote = notSec(dated);
|
|
109
|
+
const forwardNote = metrics.forwardEstimate ? null : notSec(dated);
|
|
110
110
|
// A regular payer's year with fewer payments than its cadence pays says how many the yield counts.
|
|
111
111
|
const trailingNote = notSec(trailingPaymentsText(metrics.trailingPayments));
|
|
112
112
|
const ttmLabel = bond ? (short ? "TTM dist" : "TTM dist yld") : short ? "TTM yld" : "TTM yield";
|
|
113
113
|
const fwdLabel = bond ? (short ? "Fwd dist" : "Fwd dist yld") : short ? "Fwd yld" : "Fwd yield";
|
|
114
114
|
const sec = bond ? bondFigures(bond).find((figure) => figure.key === "secYield") : undefined;
|
|
115
115
|
return [
|
|
116
|
-
{ id: "ttm-yield", label: ttmLabel, value: formatDividendYield(metrics.trailingYield)
|
|
116
|
+
{ id: "ttm-yield", essential: true, label: ttmLabel, value: `${formatDividendYield(metrics.trailingYield)}${metrics.trailingEstimates?.length ? " estimated" : ""}`, color: priceColor(metrics.trailingYield ?? 0),
|
|
117
117
|
...(trailingNote ? { detail: trailingNote } : {}) },
|
|
118
118
|
// Dated by the distribution it annualizes, or marked declared (with its stated amount) beside the next ex-date;
|
|
119
119
|
// a dividend that stopped has none, dated by its last ex-date, and a monthly payer's history that ends says so.
|
|
120
120
|
// docs/research-data.md says how it is built.
|
|
121
121
|
metrics.lapse
|
|
122
|
-
? { id: "forward-yield", label: fwdLabel, value: lapseValue(metrics.lapse), ...(forwardNote ? { detail: forwardNote } : {}) }
|
|
123
|
-
: { id: "forward-yield", label: fwdLabel, value: formatDividendYield(metrics.forwardYield)
|
|
122
|
+
? { id: "forward-yield", essential: true, label: fwdLabel, value: lapseValue(metrics.lapse), ...(forwardNote ? { detail: forwardNote } : {}) }
|
|
123
|
+
: { id: "forward-yield", essential: true, label: fwdLabel, value: `${formatDividendYield(metrics.forwardYield)}${metrics.forwardEstimate ? " estimated" : ""}`, color: priceColor(metrics.forwardYield ?? 0),
|
|
124
124
|
...(forwardNote ? { detail: forwardNote } : {}) },
|
|
125
|
+
...(metrics.forwardEstimate ? [{ id: "forward-fx", essential: true, label: metrics.forwardEstimate.fixingDate ? "FX fixing" : "FX basis",
|
|
126
|
+
value: metrics.forwardEstimate.fixingDate ?? `${metrics.forwardEstimate.declaredCurrency}, ${metrics.forwardEstimate.declaredAmount != null ? "not fixed" : "FX unknown"}` }] : []),
|
|
125
127
|
// The 30-day SEC yield as the fund's sponsor publishes it, dated.
|
|
126
128
|
...(sec ? [{ id: "sec-yield", label: short ? "SEC yld" : "SEC yield", value: sec.text, ...(sec.date ? { detail: `as of ${sec.date}` } : {}) }] : []),
|
|
127
|
-
{ id: "ttm-rate", label: short ? "TTM/sh" : "TTM/share", value: formatRate(metrics.trailingRate, currency, !!convertedFrom, convertedSubUnit),
|
|
129
|
+
{ id: "ttm-rate", essential: false, label: short ? "TTM/sh" : "TTM/share", value: formatRate(metrics.trailingRate, currency, !!convertedFrom, convertedSubUnit),
|
|
128
130
|
...metrics.trailingRate != null ? converted : {} },
|
|
129
|
-
{ id: "forward-rate", label: short ? "Fwd/sh" : "Fwd/share", value: formatRate(metrics.forwardRate, currency, !!convertedFrom, convertedSubUnit),
|
|
131
|
+
{ id: "forward-rate", essential: false, label: short ? "Fwd/sh" : "Fwd/share", value: formatRate(metrics.forwardRate, currency, !!convertedFrom, convertedSubUnit),
|
|
130
132
|
...metrics.forwardRate != null ? converted : {} },
|
|
131
|
-
growthItem("growth-1y", short ? "1Y chg" : "1Y growth", metrics.growth1Y, metrics.growth1YPayments, metrics.growth1YNotMeaningful),
|
|
132
|
-
growthItem("cagr-3y", "3Y CAGR", metrics.growth3Y, metrics.growth3YPayments, metrics.growth3YNotMeaningful),
|
|
133
|
-
{ id: "payout", label: "Payout", value: metrics.payoutNotMeaningful ? PAYOUT_NOT_MEANINGFUL : metrics.payoutRatio != null ? `${(metrics.payoutRatio * 100).toFixed(1)}%` : MISSING_VALUE
|
|
134
|
-
|
|
133
|
+
{ ...growthItem("growth-1y", short ? "1Y chg" : "1Y growth", metrics.growth1Y, metrics.growth1YPayments, metrics.growth1YNotMeaningful), essential: false },
|
|
134
|
+
{ ...growthItem("cagr-3y", "3Y CAGR", metrics.growth3Y, metrics.growth3YPayments, metrics.growth3YNotMeaningful), essential: false },
|
|
135
|
+
{ id: "payout", essential: false, label: "Payout", value: metrics.payoutNotMeaningful ? PAYOUT_NOT_MEANINGFUL : metrics.payoutRatio != null ? `${(metrics.payoutRatio * 100).toFixed(1)}%` : MISSING_VALUE,
|
|
136
|
+
detail: "Basis/date unstated" },
|
|
137
|
+
{ id: "cadence", essential: false, label: "Cadence", value: formatFrequency(metrics.paymentFrequency) },
|
|
135
138
|
...exDate,
|
|
136
|
-
{ id: "next-pay", label: "Next pay", value: formatDate(metrics.nextPayDate) },
|
|
139
|
+
{ id: "next-pay", essential: true, label: "Next pay", value: metrics.nextPayDate ? formatDate(metrics.nextPayDate) : "Unavailable" },
|
|
137
140
|
];
|
|
138
141
|
}
|
|
139
142
|
|
|
@@ -162,7 +165,7 @@ function renderCell(
|
|
|
162
165
|
return { text: row.exDate, color: colors.textDim };
|
|
163
166
|
case "amount":
|
|
164
167
|
return {
|
|
165
|
-
text:
|
|
168
|
+
text: formatDividendRowAmount(row, converted, subUnit),
|
|
166
169
|
color: colors.textBright,
|
|
167
170
|
attributes: TextAttributes.BOLD,
|
|
168
171
|
};
|
|
@@ -257,6 +260,7 @@ function DividendTickerPane({ focused, width, height, loadData = fetchDividendDa
|
|
|
257
260
|
|
|
258
261
|
const sourceWarnings = [
|
|
259
262
|
...(data?.stale ? [staleHistoryText(data.fetchedAt)] : []),
|
|
263
|
+
...(data?.cashVerificationWarning ? [data.cashVerificationWarning] : []),
|
|
260
264
|
];
|
|
261
265
|
usePaneNoticeFooter({
|
|
262
266
|
registrationId: "dividend-yield-notices",
|
|
@@ -267,7 +271,9 @@ function DividendTickerPane({ focused, width, height, loadData = fetchDividendDa
|
|
|
267
271
|
const metrics = data?.metrics ? repriceDividendMetrics(data.metrics, currentPrice) : undefined;
|
|
268
272
|
const rows = useMemo(() => toDividendRows(payments), [payments]);
|
|
269
273
|
const sortedRows = useMemo(() => sortRows(rows, sortPreference), [rows, sortPreference]);
|
|
270
|
-
const
|
|
274
|
+
const convertedFrom = historyData?.convertedFrom;
|
|
275
|
+
const convertedSubUnit = historyData?.convertedSubUnit;
|
|
276
|
+
const columns = useMemo(() => buildDividendColumns(rows, !!convertedFrom, convertedSubUnit), [rows, convertedFrom, convertedSubUnit]);
|
|
271
277
|
const chartPoints = useMemo(
|
|
272
278
|
() => data?.historyAvailable === false ? [] : buildTrailingCashChartPoints(payments),
|
|
273
279
|
[data?.historyAvailable, payments],
|
|
@@ -295,8 +301,6 @@ function DividendTickerPane({ focused, width, height, loadData = fetchDividendDa
|
|
|
295
301
|
});
|
|
296
302
|
// The header row, plus the scrollbar row once the columns overflow the pane.
|
|
297
303
|
const tableChromeRows = chartTableChromeRows(columns, width);
|
|
298
|
-
const convertedFrom = historyData?.convertedFrom;
|
|
299
|
-
const convertedSubUnit = historyData?.convertedSubUnit;
|
|
300
304
|
const renderRowCell = useCallback((row: DividendRow, column: DividendColumn) => renderCell(row, column, !!convertedFrom, convertedSubUnit),
|
|
301
305
|
[convertedFrom, convertedSubUnit]);
|
|
302
306
|
const fullFigures = metrics ? buildMetricItems(metrics, currency, sortedRows.length > 0, false, data?.declared, bond, convertedFrom, convertedSubUnit) : [];
|