@gloom-sh/terminal 0.20.21 → 0.20.23
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 +4 -3
- package/patches/electrobun-devkit@2.0.5.patch +169 -3
- package/src/account/heard-from-question.tsx +6 -4
- package/src/account/heard-from.ts +3 -4
- package/src/api-client/buybacks.ts +108 -0
- package/src/api-client/data.ts +213 -1
- package/src/api-client/dilution.ts +183 -0
- package/src/api-client/earnings.ts +2 -2
- package/src/api-client/equity-screener.ts +7 -0
- package/src/api-client/exchange-announcements.ts +16 -5
- package/src/api-client/exchange-short-balances.ts +24 -0
- package/src/api-client/heard-from.ts +5 -7
- package/src/api-client/hk-cbbc.ts +134 -0
- package/src/api-client/hk-ccass.ts +233 -0
- package/src/api-client/index.ts +55 -3
- package/src/api-client/jpx-short-positions.ts +24 -0
- package/src/api-client/market-discovery.ts +34 -6
- package/src/api-client/members.ts +5 -0
- package/src/api-client/ownership-disclosures.ts +68 -0
- package/src/api-client/paths.ts +2 -2
- package/src/api-client/request.ts +39 -10
- package/src/api-client/revenue-breakdown.ts +6 -2
- package/src/api-client/sfc-short-positions.ts +19 -0
- package/src/api-client/supply-chain.ts +22 -0
- package/src/api-client/taiwan-revenue.ts +134 -0
- package/src/api-client/types/jobs.ts +1 -0
- package/src/api-client/types/ticker-data.ts +3 -1
- package/src/api-client/types/world-venues.ts +1 -0
- package/src/app/language-observer.tsx +6 -1
- package/src/app/pane-runtime/plugin-bindings.ts +9 -4
- package/src/app/runtime/plugin-bindings.ts +20 -2
- package/src/architecture/core-builtin-allowlist.json +2 -2
- package/src/architecture/dom-cell-metrics-allowlist.json +2 -2
- package/src/architecture/dom-text-cuts-allowlist.json +2 -2
- package/src/architecture/floating-promise-allowlist.json +2 -2
- package/src/architecture/pane-tabs-allowlist.json +3 -0
- package/src/brokers/account-cache.ts +2 -1
- package/src/brokers/account-choice.ts +121 -0
- package/src/brokers/broker-portfolio-sync.ts +30 -5
- package/src/brokers/profile-form.ts +3 -0
- package/src/brokers/signed-in/adapter.ts +16 -5
- package/src/brokers/sync-broker-instance.ts +27 -3
- package/src/capabilities/asset-data-inputs.ts +8 -0
- package/src/capabilities/factories.ts +4 -0
- package/src/cli/commands/market.ts +141 -76
- package/src/cli/commands/news-search.ts +12 -0
- package/src/cli/commands/options-chain.ts +9 -3
- package/src/cli/commands/options-leaps.ts +55 -30
- package/src/cli/commands/overview.ts +20 -23
- package/src/cli/commands/search.ts +2 -1
- package/src/cli/commands/ticker.ts +17 -18
- package/src/cli/csv-export.ts +9 -5
- package/src/cli/desktop-pane-shot-browser.ts +143 -53
- package/src/cli/desktop-pane-shot.ts +50 -64
- package/src/cli/export-source.ts +9 -4
- package/src/cli/history-demergers.ts +134 -11
- package/src/cli/history-rows.ts +47 -7
- package/src/cli/listing-arg.ts +45 -18
- package/src/cli/pane-functions/catalog-snapshot.json +26 -22
- package/src/cli/pane-functions/catalog.ts +6 -2
- package/src/cli/pane-functions/data.ts +3 -1
- package/src/cli/pane-functions/dom.ts +8 -5
- package/src/cli/pane-functions/freshness.ts +6 -1
- package/src/cli/pane-functions/function-help.ts +32 -2
- package/src/cli/pane-functions/headless.ts +79 -27
- package/src/cli/pane-functions/index.ts +2 -1
- package/src/cli/pane-functions/market-session.ts +13 -3
- package/src/cli/pane-functions/resolver.ts +4 -1
- package/src/cli/pane-functions/screenshot-assessment.ts +26 -10
- package/src/cli/pane-functions/screenshot-bridge.ts +4 -1
- package/src/cli/pane-functions/screenshot-data-evidence.ts +11 -5
- package/src/cli/pane-functions/screenshot-payload.ts +21 -3
- package/src/cli/pane-functions/screenshot-render.ts +2 -0
- package/src/cli/pane-functions/ticker-question.ts +52 -47
- package/src/cli/rendered-table-rows.ts +75 -0
- package/src/cli/report-tables.ts +7 -1
- package/src/cli/result.ts +9 -2
- package/src/cli/symbol-list.ts +52 -14
- package/src/cli/ticker-resolution.ts +133 -38
- package/src/cli/visible-key-values.ts +3 -2
- package/src/components/chart/composite/composite-chart.tsx +12 -0
- package/src/components/chart/composite/format.ts +14 -1
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +37 -14
- package/src/components/chart/composite/panel-surface.tsx +1 -0
- package/src/components/chart/composite/text-renderer.ts +104 -44
- package/src/components/chart/composite/types.ts +18 -0
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +38 -15
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart-table/header.tsx +11 -5
- package/src/components/chart-table/selection.ts +20 -1
- package/src/components/command-bar/routes/root/start-here.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/results.ts +2 -1
- package/src/components/data-table/export.ts +3 -1
- package/src/components/data-table/sections.ts +12 -1
- package/src/components/data-table/view.tsx +52 -8
- package/src/components/feed-data-table/stack-view.tsx +88 -5
- package/src/components/index.ts +3 -3
- package/src/components/layout/floating-pane.tsx +5 -2
- package/src/components/layout/pane/header.tsx +33 -32
- package/src/components/layout/pane/index.tsx +6 -2
- package/src/components/layout/pane/link-note.ts +12 -0
- package/src/components/layout/pane/title.ts +1 -3
- package/src/components/market-board/index.tsx +8 -11
- package/src/components/reader/reader-text.tsx +25 -2
- package/src/components/ticker/badge/index.tsx +9 -4
- package/src/components/ticker/badge/list.tsx +3 -1
- package/src/components/ticker/list-table-view.tsx +4 -0
- package/src/components/ui/data-table/column-fit.ts +129 -0
- package/src/components/ui/data-table/display-columns.ts +28 -9
- package/src/components/ui/data-table/index.tsx +64 -16
- package/src/components/ui/data-table/muted-row.tsx +47 -0
- package/src/components/ui/data-table/opentui/index.tsx +47 -11
- package/src/components/ui/data-table/spill.ts +36 -0
- package/src/components/ui/data-table/types.ts +113 -6
- package/src/components/ui/data-table/use-column-order.ts +11 -0
- package/src/components/ui/data-table/visible-range.ts +9 -1
- package/src/components/ui/day-cell.ts +30 -0
- package/src/components/ui/icon.tsx +50 -3
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/list-view.tsx +2 -2
- package/src/components/ui/prose.tsx +3 -1
- package/src/components/ui/table-layout.ts +220 -6
- package/src/components/ui/terminal-hover-label.tsx +49 -0
- package/src/components/use-pinned-moment.ts +222 -13
- package/src/core/state/app/layout.ts +7 -2
- package/src/core/state/app/state.ts +17 -4
- package/src/core/state/app/types.ts +2 -1
- package/src/data/config/store/legacy-tabs.ts +51 -0
- package/src/data/config/store/node.ts +2 -2
- package/src/data/config/store/normalize.ts +11 -5
- package/src/data/config/store/shared-file.ts +8 -7
- package/src/data/config/store/shared-layout.ts +146 -0
- package/src/data/sqlite/access.ts +90 -12
- package/src/data/sqlite/checkpointer.ts +75 -12
- package/src/data/sqlite/database.ts +18 -1
- package/src/data/sqlite/retry.ts +1 -1
- package/src/docs/load.ts +5 -2
- package/src/docs/snapshot.json +1862 -4456
- package/src/i18n/es.ts +109 -0
- package/src/i18n/index.ts +74 -4
- package/src/i18n/ja.ts +109 -0
- package/src/i18n/ko.ts +109 -0
- package/src/i18n/react.ts +10 -2
- package/src/i18n/zh-cn.ts +109 -0
- package/src/i18n/zh-tw.ts +109 -0
- package/src/layout/pane-manager/dock-normalization.ts +61 -0
- package/src/market-data/ah-pair.ts +7 -2
- package/src/market-data/fund-actions.ts +21 -0
- package/src/market-data/market/freshness.ts +39 -35
- package/src/market-data/market/globex-day.ts +14 -0
- package/src/market-data/market/split-price-basis.ts +55 -0
- package/src/market-data/market/status.ts +2 -4
- package/src/market-data/price-adjustments.ts +115 -0
- package/src/market-data/published-us-sessions.ts +3 -2
- package/src/market-data/quotes/balance-sheet-rate.ts +6 -2
- package/src/market-data/quotes/day-range.ts +24 -9
- package/src/market-data/quotes/freshness.ts +4 -3
- package/src/market-data/quotes/live-valuation.ts +4 -2
- package/src/market-data/quotes/metadata.ts +48 -5
- package/src/market-data/quotes/regular-session-valuation.ts +18 -1
- package/src/market-data/quotes/resolution.ts +18 -29
- package/src/market-data/quotes/time.ts +138 -14
- package/src/news/query-presets.ts +6 -4
- package/src/plugins/builtin/alerts/cli-forms.ts +3 -0
- package/src/plugins/builtin/alerts/cli.ts +19 -7
- package/src/plugins/builtin/alerts/events-pane.tsx +1 -0
- package/src/plugins/builtin/alerts/format.ts +22 -10
- package/src/plugins/builtin/alerts/headless.ts +7 -4
- package/src/plugins/builtin/alerts/history-pane.tsx +93 -36
- package/src/plugins/builtin/alerts/history-rows.ts +24 -1
- package/src/plugins/builtin/alerts/index.tsx +8 -10
- package/src/plugins/builtin/alerts/metric-data.ts +24 -6
- package/src/plugins/builtin/alerts/pane.tsx +9 -0
- package/src/plugins/builtin/alerts/pro-rules.ts +1 -0
- package/src/plugins/builtin/alerts/research-builder.ts +6 -2
- package/src/plugins/builtin/alerts/research-rules.ts +12 -0
- package/src/plugins/builtin/alerts/types.ts +1 -0
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +13 -4
- package/src/plugins/builtin/awards/model.ts +36 -1
- package/src/plugins/builtin/awards/pane.tsx +29 -9
- package/src/plugins/builtin/backtest/pane.tsx +4 -2
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/detail.tsx +67 -4
- package/src/plugins/builtin/broker-manager/index.tsx +35 -4
- package/src/plugins/builtin/broker-manager/keyboard.ts +10 -0
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +35 -2
- package/src/plugins/builtin/broker-trading/orders.tsx +14 -5
- package/src/plugins/builtin/broker-trading/ticket.tsx +1 -0
- package/src/plugins/builtin/buildout/format.ts +3 -1
- package/src/plugins/builtin/buybacks/client.ts +48 -0
- package/src/plugins/builtin/buybacks/index.tsx +22 -0
- package/src/plugins/builtin/buybacks/model.ts +151 -0
- package/src/plugins/builtin/buybacks/pane.tsx +140 -0
- package/src/plugins/builtin/buybacks/series.ts +36 -0
- package/src/plugins/builtin/catalysts/detail.tsx +14 -8
- package/src/plugins/builtin/catalysts/evidence.ts +11 -3
- package/src/plugins/builtin/catalysts/headless.ts +51 -8
- package/src/plugins/builtin/catalysts/kinds.ts +413 -0
- package/src/plugins/builtin/catalysts/model.ts +61 -18
- package/src/plugins/builtin/catalysts/pane.tsx +85 -19
- package/src/plugins/builtin/cds/client.ts +9 -2
- package/src/plugins/builtin/cds/headless.ts +25 -10
- package/src/plugins/builtin/cds/model.ts +37 -12
- package/src/plugins/builtin/cds/pane.tsx +18 -10
- package/src/plugins/builtin/chart-composer/chart-spec-edit.ts +68 -7
- package/src/plugins/builtin/chart-composer/chart-title.ts +114 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +13 -1
- package/src/plugins/builtin/chart-composer/index.tsx +2 -68
- package/src/plugins/builtin/chart-composer/leverage-overlay.ts +2 -4
- package/src/plugins/builtin/chart-composer/pane.tsx +11 -3
- package/src/plugins/builtin/chart-composer/presets.ts +1 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +46 -12
- package/src/plugins/builtin/chat/channels.ts +5 -2
- package/src/plugins/builtin/chat/content/composer-runtime.ts +64 -65
- package/src/plugins/builtin/chat/content/footer.tsx +17 -7
- package/src/plugins/builtin/chat/content/index.tsx +108 -36
- package/src/plugins/builtin/chat/content/new-dm-dialog.tsx +21 -8
- package/src/plugins/builtin/chat/content/selection-runtime.ts +16 -0
- package/src/plugins/builtin/chat/content/shortcuts.ts +3 -0
- package/src/plugins/builtin/chat/content/snapshot.ts +37 -13
- package/src/plugins/builtin/chat/content/transcript.tsx +12 -0
- package/src/plugins/builtin/chat/content/types.ts +2 -0
- package/src/plugins/builtin/chat/controller/channels.ts +15 -15
- package/src/plugins/builtin/chat/controller/draft-sync.ts +13 -7
- package/src/plugins/builtin/chat/controller/index.ts +140 -34
- package/src/plugins/builtin/chat/controller/lifecycle.ts +8 -12
- package/src/plugins/builtin/chat/controller/persistence.ts +32 -4
- package/src/plugins/builtin/chat/controller/send.ts +41 -17
- package/src/plugins/builtin/chat/controller/session-runtime.ts +28 -27
- package/src/plugins/builtin/chat/controller/state.ts +21 -8
- package/src/plugins/builtin/chat/controller/storage.ts +41 -4
- package/src/plugins/builtin/chat/controller/view.ts +6 -3
- package/src/plugins/builtin/chat/index.tsx +1 -1
- package/src/plugins/builtin/chat/layout.ts +8 -1
- package/src/plugins/builtin/chat/message/desktop.tsx +15 -11
- package/src/plugins/builtin/chat/message/header.tsx +112 -30
- package/src/plugins/builtin/chat/message/reactions.tsx +10 -11
- package/src/plugins/builtin/chat/message/render-state.ts +4 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/message/types.ts +5 -0
- package/src/plugins/builtin/chat/pane-requests.ts +8 -4
- package/src/plugins/builtin/clinical-trials/model.ts +2 -2
- package/src/plugins/builtin/clinical-trials/pane.tsx +3 -3
- package/src/plugins/builtin/cloud/askg/pane.tsx +60 -50
- package/src/plugins/builtin/cloud/auth-actions.tsx +2 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +25 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +4 -2
- package/src/plugins/builtin/commodity-balances/headless.ts +2 -1
- package/src/plugins/builtin/company-attention/building-model.ts +3 -4
- package/src/plugins/builtin/company-attention/building.tsx +2 -0
- package/src/plugins/builtin/company-attention/headless.ts +2 -2
- package/src/plugins/builtin/company-attention/model.ts +2 -0
- package/src/plugins/builtin/company-attention/moves-model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +2 -0
- package/src/plugins/builtin/company-attention/pane.tsx +17 -3
- package/src/plugins/builtin/company-attention/signals-model.ts +3 -4
- package/src/plugins/builtin/company-attention/signals.tsx +5 -0
- package/src/plugins/builtin/company-kpis/headless.ts +26 -10
- package/src/plugins/builtin/company-kpis/model.ts +58 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +36 -19
- package/src/plugins/builtin/company-kpis/taiwan-monthly-model.ts +99 -0
- package/src/plugins/builtin/company-kpis/taiwan-monthly-view.tsx +327 -0
- package/src/plugins/builtin/composite/ownership-browser.ts +28 -0
- package/src/plugins/builtin/composite/ownership.ts +5 -1
- package/src/plugins/builtin/congress-trades/detail.tsx +44 -8
- package/src/plugins/builtin/congress-trades/headless.ts +15 -11
- package/src/plugins/builtin/congress-trades/model.ts +104 -11
- package/src/plugins/builtin/congress-trades/pane.tsx +11 -6
- package/src/plugins/builtin/congress-trades/table.tsx +17 -10
- package/src/plugins/builtin/congress-trades/use-feed.ts +13 -2
- package/src/plugins/builtin/correlation/compute.ts +6 -1
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/relationship/pane.tsx +11 -8
- package/src/plugins/builtin/correlation/relationship/view-model.ts +1 -19
- package/src/plugins/builtin/cot/headless.ts +1 -1
- package/src/plugins/builtin/cot/pane.tsx +7 -2
- package/src/plugins/builtin/cpi/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-documents/detail.tsx +2 -1
- package/src/plugins/builtin/credit-documents/export.ts +18 -12
- package/src/plugins/builtin/credit-documents/model.ts +106 -25
- package/src/plugins/builtin/credit-documents/pane.tsx +9 -5
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -1
- package/src/plugins/builtin/crypto-board/defi.ts +5 -4
- package/src/plugins/builtin/crypto-board/headless.ts +7 -2
- package/src/plugins/builtin/crypto-board/model.ts +6 -4
- package/src/plugins/builtin/crypto-board/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/supply.ts +4 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +15 -8
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -5
- package/src/plugins/builtin/custom-view/loader.ts +95 -34
- package/src/plugins/builtin/custom-view/pane.tsx +31 -41
- package/src/plugins/builtin/custom-view/table.ts +201 -0
- package/src/plugins/builtin/debt-maturities/headless.ts +56 -38
- package/src/plugins/builtin/debt-maturities/model.ts +2 -1
- package/src/plugins/builtin/debt-maturities/pane.tsx +24 -22
- package/src/plugins/builtin/dilution/index.tsx +74 -0
- package/src/plugins/builtin/dilution/model.ts +159 -0
- package/src/plugins/builtin/dilution/pane.tsx +592 -0
- package/src/plugins/builtin/dividend-yield/client.ts +14 -17
- package/src/plugins/builtin/dividend-yield/headless.ts +24 -16
- package/src/plugins/builtin/dividend-yield/index.tsx +2 -1
- package/src/plugins/builtin/dividend-yield/model.ts +52 -10
- package/src/plugins/builtin/dividend-yield/pane.tsx +89 -17
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +6 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +7 -3
- package/src/plugins/builtin/dividend-yield/types.ts +2 -3
- package/src/plugins/builtin/dividend-yield/view.ts +58 -12
- package/src/plugins/builtin/docs/index.tsx +1 -1
- package/src/plugins/builtin/docs/pane.tsx +7 -3
- package/src/plugins/builtin/docs/use-docs.ts +2 -1
- package/src/plugins/builtin/earnings/board-model.ts +19 -6
- package/src/plugins/builtin/earnings/board-table.ts +64 -48
- package/src/plugins/builtin/earnings/board.tsx +93 -51
- package/src/plugins/builtin/earnings/headless.ts +71 -12
- package/src/plugins/builtin/earnings/history-model.ts +28 -15
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +23 -10
- package/src/plugins/builtin/earnings-calls/format.ts +34 -0
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +22 -17
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +14 -12
- package/src/plugins/builtin/earnings-ripple/pane.tsx +4 -3
- package/src/plugins/builtin/econ/calendar-model.ts +207 -3
- package/src/plugins/builtin/econ/columns.ts +132 -0
- package/src/plugins/builtin/econ/index.tsx +27 -79
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +10 -5
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -3
- package/src/plugins/builtin/econ-statistics/view.ts +15 -4
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/model.ts +12 -3
- package/src/plugins/builtin/estimate-revisions/headless.ts +23 -2
- package/src/plugins/builtin/estimate-revisions/model.ts +63 -13
- package/src/plugins/builtin/estimate-revisions/pane.tsx +228 -225
- package/src/plugins/builtin/estimate-revisions/sorting.ts +8 -16
- package/src/plugins/builtin/exposure/drivers.ts +5 -2
- package/src/plugins/builtin/exposure/headless.ts +6 -3
- package/src/plugins/builtin/exposure/model.ts +2 -1
- package/src/plugins/builtin/exposure/pane.tsx +16 -7
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/pane.tsx +21 -7
- package/src/plugins/builtin/futures-curve/headless.ts +14 -9
- package/src/plugins/builtin/futures-curve/model.ts +12 -4
- package/src/plugins/builtin/futures-curve/pane.tsx +18 -15
- package/src/plugins/builtin/fx-matrix/headless.ts +3 -2
- package/src/plugins/builtin/gpu/headless.ts +10 -4
- package/src/plugins/builtin/holders/beneficial-model.ts +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +3 -2
- package/src/plugins/builtin/holders/ccass-market-pane.tsx +363 -0
- package/src/plugins/builtin/holders/ccass-view.tsx +323 -0
- package/src/plugins/builtin/holders/disclosures-view.tsx +66 -0
- package/src/plugins/builtin/holders/disclosures.ts +47 -0
- package/src/plugins/builtin/holders/headless.ts +9 -2
- package/src/plugins/builtin/holders/index.tsx +75 -1
- package/src/plugins/builtin/holders/pane.tsx +37 -10
- package/src/plugins/builtin/holders/report-rows.ts +2 -0
- package/src/plugins/builtin/holders/table-model.ts +14 -6
- package/src/plugins/builtin/holders/types.ts +2 -2
- package/src/plugins/builtin/insider/activity-chart.ts +141 -0
- package/src/plugins/builtin/insider/headless.ts +2 -1
- package/src/plugins/builtin/insider/index.tsx +74 -12
- package/src/plugins/builtin/insider/signals-cells.tsx +15 -8
- package/src/plugins/builtin/insider/signals.tsx +6 -5
- package/src/plugins/builtin/insider/table-model.ts +17 -17
- package/src/plugins/builtin/insider/table.tsx +18 -10
- package/src/plugins/builtin/ipo-calendar/headless.ts +55 -11
- package/src/plugins/builtin/ipo-calendar/listing-ipo.ts +31 -4
- package/src/plugins/builtin/ipo-calendar/model.ts +238 -48
- package/src/plugins/builtin/ipo-calendar/pane.tsx +91 -25
- package/src/plugins/builtin/iv-history/client.ts +17 -8
- package/src/plugins/builtin/iv-history/format.ts +23 -12
- package/src/plugins/builtin/iv-history/headless.ts +9 -5
- package/src/plugins/builtin/iv-history/model.ts +15 -13
- package/src/plugins/builtin/iv-history/pane.tsx +5 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +46 -24
- package/src/plugins/builtin/jobs/headless.ts +4 -3
- package/src/plugins/builtin/jobs/pane.tsx +6 -5
- package/src/plugins/builtin/jodi/headless.ts +15 -2
- package/src/plugins/builtin/jodi/model.ts +46 -5
- package/src/plugins/builtin/jodi/pane.tsx +17 -13
- package/src/plugins/builtin/kelly-sizer/headless.ts +11 -4
- package/src/plugins/builtin/kelly-sizer/pane.tsx +19 -9
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/units.ts +26 -0
- package/src/plugins/builtin/macro-day/pane.tsx +12 -5
- package/src/plugins/builtin/market-halts/model.ts +10 -8
- package/src/plugins/builtin/market-halts/pane.tsx +15 -3
- package/src/plugins/builtin/market-heatmap/data.ts +17 -2
- package/src/plugins/builtin/market-heatmap/headless.ts +56 -6
- package/src/plugins/builtin/market-heatmap/index.tsx +55 -1
- package/src/plugins/builtin/market-heatmap/model.ts +27 -1
- package/src/plugins/builtin/market-movers/model.ts +7 -1
- package/src/plugins/builtin/market-movers/session-table.ts +1 -0
- package/src/plugins/builtin/market-movers/session.ts +1 -1
- package/src/plugins/builtin/market-movers/table.ts +1 -1
- package/src/plugins/builtin/members/headless.ts +13 -5
- package/src/plugins/builtin/members/model.ts +35 -1
- package/src/plugins/builtin/members/pane.tsx +16 -8
- package/src/plugins/builtin/mna/distress/detail.tsx +7 -6
- package/src/plugins/builtin/mna/distress/model.ts +7 -7
- package/src/plugins/builtin/mna/distress/pane.tsx +8 -7
- package/src/plugins/builtin/mna/headless.ts +40 -7
- package/src/plugins/builtin/mna/model.ts +66 -6
- package/src/plugins/builtin/mna/pane.tsx +118 -60
- package/src/plugins/builtin/news/wire/industry-pane.tsx +1 -0
- package/src/plugins/builtin/news/wire/news/row.ts +5 -12
- package/src/plugins/builtin/news/wire/news/table.tsx +46 -44
- package/src/plugins/builtin/notes/index.tsx +2 -1
- package/src/plugins/builtin/openfda/model.ts +1 -1
- package/src/plugins/builtin/openfda/pane.tsx +37 -9
- package/src/plugins/builtin/options/analytics.ts +30 -6
- package/src/plugins/builtin/options/calc-seed.ts +38 -3
- package/src/plugins/builtin/options/footer.ts +18 -1
- package/src/plugins/builtin/options/live-quotes.ts +21 -6
- package/src/plugins/builtin/options/open-interest-as-of.ts +5 -0
- package/src/plugins/builtin/options/quote-context.tsx +21 -8
- package/src/plugins/builtin/options/table.ts +17 -2
- package/src/plugins/builtin/options/view.tsx +97 -46
- package/src/plugins/builtin/options-calculator/model.ts +65 -3
- package/src/plugins/builtin/options-calculator/pane.tsx +11 -3
- package/src/plugins/builtin/options-calculator/valuation.ts +33 -0
- package/src/plugins/builtin/options-positioning/cbbc-model.ts +160 -0
- package/src/plugins/builtin/options-positioning/cbbc-view.tsx +453 -0
- package/src/plugins/builtin/options-positioning/index.tsx +22 -1
- package/src/plugins/builtin/options-positioning/pane.tsx +16 -1
- package/src/plugins/builtin/options-scenario/charts.tsx +2 -1
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +5 -5
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +11 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +9 -1
- package/src/plugins/builtin/options-scenario/headless.ts +3 -3
- package/src/plugins/builtin/options-scenario/index.tsx +1 -1
- package/src/plugins/builtin/options-scenario/model.ts +7 -0
- package/src/plugins/builtin/options-scenario/pane.tsx +24 -14
- package/src/plugins/builtin/pe-band/headless.ts +1 -1
- package/src/plugins/builtin/pe-band/model.ts +41 -18
- package/src/plugins/builtin/pe-band/pane.tsx +8 -6
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/equity-row.tsx +4 -6
- package/src/plugins/builtin/perps/headless.ts +19 -12
- package/src/plugins/builtin/perps/markets-section.tsx +19 -15
- package/src/plugins/builtin/perps/model.ts +14 -5
- package/src/plugins/builtin/portfolio-list/cached-account.ts +3 -1
- package/src/plugins/builtin/portfolio-list/cli/import-positions.ts +6 -18
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +1 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +1 -1
- package/src/plugins/builtin/portfolio-list/positions-import/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/positions-import/lookup.ts +28 -57
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -3
- package/src/plugins/builtin/portfolio-list/table.tsx +19 -2
- package/src/plugins/builtin/power/client.ts +2 -2
- package/src/plugins/builtin/power/detail.tsx +11 -8
- package/src/plugins/builtin/power/gas-model.ts +2 -1
- package/src/plugins/builtin/power/gas.tsx +3 -2
- package/src/plugins/builtin/power/headless.ts +4 -1
- package/src/plugins/builtin/power/model.ts +19 -0
- package/src/plugins/builtin/power/pane.tsx +5 -4
- package/src/plugins/builtin/power/prices-headless.ts +4 -3
- package/src/plugins/builtin/power/prices.tsx +7 -6
- package/src/plugins/builtin/primary-dealers/headless.ts +1 -1
- package/src/plugins/builtin/primary-dealers/model.ts +2 -1
- package/src/plugins/builtin/rate-path/headless.ts +5 -2
- package/src/plugins/builtin/rate-path/pane.tsx +13 -10
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +7 -8
- package/src/plugins/builtin/realized-vol/headless.ts +3 -4
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/research/analyst-model.ts +1 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +2 -1
- package/src/plugins/builtin/research/earnings-estimates-pane.tsx +262 -0
- package/src/plugins/builtin/research/event-charts.ts +322 -0
- package/src/plugins/builtin/research/event-data.ts +140 -0
- package/src/plugins/builtin/research/event-detail.tsx +442 -0
- package/src/plugins/builtin/research/event-model.ts +338 -39
- package/src/plugins/builtin/research/event-sources.ts +58 -8
- package/src/plugins/builtin/research/event-views.tsx +397 -0
- package/src/plugins/builtin/research/events-headless.ts +60 -4
- package/src/plugins/builtin/research/headless-schema.ts +2 -2
- package/src/plugins/builtin/research/headless.ts +84 -7
- package/src/plugins/builtin/research/index.tsx +19 -17
- package/src/plugins/builtin/research/relative-valuation-columns.ts +39 -14
- package/src/plugins/builtin/research/relative-valuation-headless.ts +9 -5
- package/src/plugins/builtin/research/relative-valuation-model.ts +23 -8
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +10 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +9 -4
- package/src/plugins/builtin/revenue-breakdown/headless.ts +1 -1
- package/src/plugins/builtin/revenue-breakdown/index.tsx +2 -1
- package/src/plugins/builtin/revenue-breakdown/model.ts +2 -0
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +10 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +14 -9
- package/src/plugins/builtin/scanner/flow-pane.tsx +10 -0
- package/src/plugins/builtin/scanner/headless.ts +2 -0
- package/src/plugins/builtin/scanner/lock-note.ts +5 -9
- package/src/plugins/builtin/sec/exchange-filings.ts +69 -0
- package/src/plugins/builtin/sec/fund-facts.ts +10 -8
- package/src/plugins/builtin/sec/headless.ts +60 -8
- package/src/plugins/builtin/sec/index.tsx +169 -61
- package/src/plugins/builtin/sec/model.ts +10 -4
- package/src/plugins/builtin/sec/row-summaries.ts +1 -0
- package/src/plugins/builtin/series-inventory.ts +4 -0
- package/src/plugins/builtin/shared/beat-miss-chart.ts +66 -0
- package/src/plugins/builtin/shared/day-entries.ts +41 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +80 -53
- package/src/plugins/builtin/shared/earnings-report.ts +53 -15
- package/src/plugins/builtin/shared/history-span.ts +2 -1
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/pro-lock-note.ts +8 -12
- package/src/plugins/builtin/shared/report-freshness.ts +4 -1
- package/src/plugins/builtin/shared/ticker-request.ts +4 -2
- package/src/plugins/builtin/shared/volatility/live-session.ts +6 -7
- package/src/plugins/builtin/shared/volatility/option-snapshot.ts +30 -0
- package/src/plugins/builtin/shared/volatility/quote-session.ts +49 -0
- package/src/plugins/builtin/short-interest/exchange-balances.ts +76 -0
- package/src/plugins/builtin/short-interest/exchange-positions-pane.tsx +55 -0
- package/src/plugins/builtin/short-interest/headless.ts +15 -2
- package/src/plugins/builtin/short-interest/index.tsx +7 -3
- package/src/plugins/builtin/short-interest/jpx.ts +38 -0
- package/src/plugins/builtin/short-interest/model.ts +3 -2
- package/src/plugins/builtin/short-interest/pane.tsx +4 -3
- package/src/plugins/builtin/short-interest/publications-model.ts +73 -2
- package/src/plugins/builtin/short-interest/publications-pane.tsx +16 -4
- package/src/plugins/builtin/short-interest/sfc.ts +40 -0
- package/src/plugins/builtin/short-interest/surface.tsx +16 -2
- package/src/plugins/builtin/short-volume/headless.ts +18 -3
- package/src/plugins/builtin/short-volume/model.ts +6 -1
- package/src/plugins/builtin/short-volume/pane.tsx +8 -7
- package/src/plugins/builtin/short-volume/sgx.ts +23 -0
- package/src/plugins/builtin/social-mentions/outliers-model.ts +2 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +10 -8
- package/src/plugins/builtin/supply-chain/client.ts +10 -2
- package/src/plugins/builtin/supply-chain/directories.ts +18 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +12 -4
- package/src/plugins/builtin/supply-chain/headless.ts +20 -7
- package/src/plugins/builtin/supply-chain/pane.tsx +40 -11
- package/src/plugins/builtin/thirteenf/api.ts +299 -31
- package/src/plugins/builtin/thirteenf/data.ts +126 -32
- package/src/plugins/builtin/thirteenf/format.ts +4 -6
- package/src/plugins/builtin/thirteenf/headless.ts +68 -29
- package/src/plugins/builtin/thirteenf/model.ts +24 -11
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +16 -8
- package/src/plugins/builtin/thirteenf/pane.tsx +45 -22
- package/src/plugins/builtin/thirteenf/report-notes.ts +52 -2
- package/src/plugins/builtin/thirteenf/session-scope.ts +57 -0
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +17 -4
- package/src/plugins/builtin/thirteenf/split-history.ts +119 -0
- package/src/plugins/builtin/thirteenf/table.ts +6 -6
- package/src/plugins/builtin/thirteenf/types.ts +17 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +11 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +12 -8
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +5 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +7 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +12 -5
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +35 -5
- package/src/plugins/builtin/ticker-detail/financials/exchange-table.tsx +61 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +210 -43
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +69 -8
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +64 -10
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +132 -68
- package/src/plugins/builtin/ticker-detail/headless.ts +37 -13
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +75 -14
- package/src/plugins/builtin/ticker-detail/overview/model.ts +87 -35
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +14 -8
- package/src/plugins/builtin/ticker-detail/overview/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +50 -17
- package/src/plugins/builtin/ticker-detail/pane.tsx +5 -3
- package/src/plugins/builtin/ticker-detail/research-groups.ts +15 -2
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +2 -1
- package/src/plugins/builtin/time-sales/headless.ts +3 -3
- package/src/plugins/builtin/time-sales/model.ts +16 -9
- package/src/plugins/builtin/time-sales/pane.tsx +27 -24
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/cache.ts +44 -19
- package/src/plugins/builtin/treasury-auctions/client.ts +9 -4
- package/src/plugins/builtin/treasury-daily/client.ts +43 -9
- package/src/plugins/builtin/treasury-daily/pane.tsx +48 -27
- package/src/plugins/builtin/treasury-daily/resource.ts +33 -0
- package/src/plugins/builtin/vol-surface/charts.tsx +3 -1
- package/src/plugins/builtin/vol-surface/events.ts +8 -5
- package/src/plugins/builtin/vol-surface/evidence.ts +2 -2
- package/src/plugins/builtin/vol-surface/headless.ts +46 -28
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/model.ts +34 -9
- package/src/plugins/builtin/vol-surface/pane.tsx +35 -67
- package/src/plugins/builtin/vol-surface/quote-coverage.ts +68 -0
- package/src/plugins/builtin/vol-surface/tables.ts +57 -6
- package/src/plugins/builtin/volatility/charts.tsx +7 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -5
- package/src/plugins/builtin/volatility/pane.tsx +8 -5
- package/src/plugins/builtin/world-indices/headless.ts +5 -3
- package/src/plugins/builtin/world-venue-map/headless.ts +15 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +5 -3
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/world-venue-map/venue-exceptions.ts +72 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +20 -11
- package/src/plugins/builtin/yield-curve/headless.ts +4 -2
- package/src/plugins/builtin/yield-curve/index.tsx +4 -3
- package/src/plugins/catalog-browser.ts +3 -34
- package/src/plugins/marketplace/feed.ts +3 -2
- package/src/plugins/registry/contributions.ts +37 -10
- package/src/plugins/registry/index.ts +2 -1
- package/src/portfolio/column-values.ts +8 -9
- package/src/portfolio/positions-import/parse.ts +14 -6
- package/src/portfolio/positions-import/plan.ts +3 -2
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/i18n.ts +3 -2
- package/src/react/async-resource.ts +3 -1
- package/src/renderers/dom/css.d.ts +1 -0
- package/src/renderers/dom/data-table/index.tsx +100 -8
- package/src/renderers/dom/data-table/row.tsx +40 -4
- package/src/renderers/dom/desktop/icons.tsx +147 -3
- package/src/renderers/dom/desktop/popover.tsx +2 -2
- package/src/renderers/dom/host/media-surface.tsx +204 -45
- package/src/renderers/dom/host/tabs.tsx +1 -0
- package/src/renderers/dom/styles.css +14 -2
- package/src/renderers/electrobun/bun/desktop/backend.ts +14 -1
- package/src/renderers/electrobun/bun/desktop/rpc-timing.ts +9 -3
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +5 -2
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +7 -1
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +2 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +44 -3
- package/src/sources/gloomberb-cloud/batched-lookups.ts +12 -1
- package/src/sources/gloomberb-cloud/index.ts +44 -10
- package/src/sources/gloomberb-cloud/normalizers.ts +8 -2
- package/src/sources/listing-symbols.ts +7 -1
- package/src/sources/provider-router/cache.ts +5 -4
- package/src/sources/provider-router/financials.ts +44 -22
- package/src/sources/provider-router/index.ts +9 -1
- package/src/state/app/context/index.tsx +12 -4
- package/src/state/app/tab-cursor.ts +47 -6
- package/src/sync/broker-instances.ts +63 -11
- package/src/sync/config-merge.ts +1 -1
- package/src/sync/sanitize.ts +2 -0
- package/src/telemetry/stall-clocks.ts +3 -0
- package/src/telemetry/stall-reports.ts +12 -3
- package/src/telemetry/windows-process-activity.ts +41 -0
- package/src/telemetry/windows-time.ts +32 -0
- package/src/test-support/cloud-api.ts +34 -0
- package/src/test-support/scoped-earnings.ts +24 -0
- package/src/test-support/strict-table-capture.tsx +83 -0
- package/src/tickers/search/index.ts +23 -7
- package/src/tickers/terminal-codes.ts +1 -6
- package/src/time-series/alignment.ts +14 -4
- package/src/time-series/base-series.ts +5 -4
- package/src/time-series/chart-data.ts +2 -0
- package/src/time-series/chart-seed.ts +3 -1
- package/src/time-series/daily-valuation.ts +13 -6
- package/src/time-series/filed-trailing-eps.ts +16 -3
- package/src/time-series/fundamentals/current-valuation.ts +30 -5
- package/src/time-series/fundamentals/historical-valuation.ts +20 -0
- package/src/time-series/fundamentals/history-link.ts +25 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +50 -5
- package/src/time-series/fundamentals/series.ts +13 -1
- package/src/time-series/market.ts +30 -4
- package/src/time-series/price-comparison.ts +39 -60
- package/src/time-series/resolve.ts +18 -11
- package/src/time-series/spec.ts +2 -1
- package/src/time-series/studies/formula.ts +4 -2
- package/src/time-series/studies/indicators.ts +2 -0
- package/src/time-series/studies/pair.ts +4 -2
- package/src/time-series/studies/shared.ts +1 -0
- package/src/time-series/types.ts +2 -1
- package/src/time-series/use-chart-resolution.ts +32 -14
- package/src/time-series/valuation-currency.ts +2 -0
- package/src/types/config.ts +13 -61
- package/src/types/data-provider.ts +8 -0
- package/src/types/financials.ts +94 -15
- package/src/types/headless.ts +30 -0
- package/src/types/plugin-context.ts +8 -1
- package/src/ui/dialog-context.ts +8 -0
- package/src/utils/crypto-pair.ts +10 -0
- package/src/utils/datetime-format.ts +23 -1
- package/src/utils/day-format.ts +104 -0
- package/src/utils/declared-dividends.ts +12 -2
- package/src/utils/exchange-announcements.ts +38 -12
- package/src/utils/exchange-notation.generated.ts +3 -1
- package/src/utils/exchanges.ts +2 -1
- package/src/utils/financial-statements.ts +40 -46
- package/src/utils/format.ts +39 -12
- package/src/utils/forward-dividend.ts +2 -1
- package/src/utils/fundamentals.ts +1 -0
- package/src/utils/main-thread-stall.ts +9 -1
- package/src/utils/rpc-timeout-error.ts +36 -11
- package/src/utils/sec.ts +3 -1
- package/src/utils/share-multiples.ts +1 -1
- package/src/utils/stall-process-activity.ts +70 -0
- package/src/utils/statement-scope.ts +103 -0
- package/src/utils/trailing-dividend.ts +47 -0
- package/src/utils/trailing-eps.ts +1 -1
- package/src/utils/zoned-date-time.ts +1 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +0 -771
|
@@ -38,7 +38,7 @@ export const docsModule: PluginModule = {
|
|
|
38
38
|
name: "Docs",
|
|
39
39
|
icon: "?",
|
|
40
40
|
get component(): typeof import("./pane").DocsPane { const { DocsPane } = require("./pane"); return DocsPane; },
|
|
41
|
-
reportFreshness: { status: "not-a-feed", basis: "documentation", local: true },
|
|
41
|
+
reportFreshness: { source: "Gloom documentation", status: "not-a-feed", basis: "documentation", local: true },
|
|
42
42
|
// A page reads whole in a report, not cut at the first screen.
|
|
43
43
|
shotFitsReader: true,
|
|
44
44
|
defaultPosition: "right",
|
|
@@ -254,7 +254,11 @@ export function DocsPane({ focused, width, height }: PaneProps) {
|
|
|
254
254
|
const instance = usePaneInstance();
|
|
255
255
|
const requestKey = instance?.params?.topic ?? null;
|
|
256
256
|
const requestAt = instance?.params?.at ?? null;
|
|
257
|
-
const { feed, offline, reload } = useDocsFeed();
|
|
257
|
+
const { feed, offline, bundled, reload } = useDocsFeed();
|
|
258
|
+
useRemoteUiNode(bundled ? {
|
|
259
|
+
role: "report-freshness", label: "Documentation source",
|
|
260
|
+
getMetadata: () => ({ source: "Bundled documentation" }),
|
|
261
|
+
} : null);
|
|
258
262
|
usePaneRefreshKey(reload, { focused });
|
|
259
263
|
const [stack, setStack] = usePluginPaneState<string[]>("stack", []);
|
|
260
264
|
const [query, setQuery] = usePluginPaneState<string>("query", "");
|
|
@@ -363,8 +367,8 @@ export function DocsPane({ focused, width, height }: PaneProps) {
|
|
|
363
367
|
}, [rendererHost, topic]);
|
|
364
368
|
|
|
365
369
|
const footerInfo = useMemo<PaneFooterSegment[]>(() => (
|
|
366
|
-
offline ? [{ id: "docs-offline", parts: [{ text: "offline, saved copy", tone: "warning" }] }] : []
|
|
367
|
-
), [offline]);
|
|
370
|
+
offline ? [{ id: "docs-offline", parts: [{ text: bundled ? "offline, bundled documentation" : "offline, saved copy", tone: "warning" }] }] : []
|
|
371
|
+
), [offline, bundled]);
|
|
368
372
|
const footerHints = useMemo<PaneHint[]>(() => {
|
|
369
373
|
const hints: PaneHint[] = [];
|
|
370
374
|
if (topic?.kind === "function" && feed && findDocsFunction(feed, topic.code)) {
|
|
@@ -8,11 +8,12 @@ export interface DocsFeedState {
|
|
|
8
8
|
feed: DocsFeed | null;
|
|
9
9
|
/** The site could not be read; the reader shows the saved or shipped copy. */
|
|
10
10
|
offline: boolean;
|
|
11
|
+
bundled: boolean;
|
|
11
12
|
reload: () => void;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export function useDocsFeed(): DocsFeedState {
|
|
15
|
-
const [state, setState] = useState<
|
|
16
|
+
const [state, setState] = useState<Omit<DocsFeedState, "reload">>(() => ({ feed: savedDocsFeed(), offline: false, bundled: false }));
|
|
16
17
|
const [request, setRequest] = useState({ force: false, token: 0 });
|
|
17
18
|
useEffect(() => {
|
|
18
19
|
let live = true;
|
|
@@ -2,20 +2,20 @@ import type { EarningsCalendarReport, EarningsTiming } from "../../../api-client
|
|
|
2
2
|
import { getExtendedSessionDisplay, getRegularSessionMoveDisplay } from "../../../market-data/market/status";
|
|
3
3
|
import { getPublishedUsEquityCalendarDay } from "../../../market-data/published-us-sessions";
|
|
4
4
|
import type { EarningsEvent } from "../../../types/data-provider";
|
|
5
|
-
import type { EarningsDateStatus, EarningsEpsBasis, Quote } from "../../../types/financials";
|
|
5
|
+
import type { EarningsDateStatus, EarningsEpsBasis, FilingEpsDetails, Quote } from "../../../types/financials";
|
|
6
6
|
import type { TickerRecord } from "../../../types/ticker";
|
|
7
|
-
import {
|
|
7
|
+
import { displayEarningsEpsBasis, earningsDateStatus, isProvisionalActual, reportedEpsComparison } from "../shared/earnings-report";
|
|
8
8
|
import { calendarReport } from "../shared/earnings-calendar";
|
|
9
9
|
import { listingSuffixCandidate } from "../../../sources/listing-symbols";
|
|
10
10
|
import { isUsListingExchange, parsePublicTickerKey } from "../../../utils/exchanges";
|
|
11
11
|
import { listingAbroadVenue } from "../../../utils/sec";
|
|
12
12
|
import { sameHistoryListing } from "./client";
|
|
13
|
-
import { shortDate,
|
|
13
|
+
import { shortDate, weekday, type Surprise } from "./format";
|
|
14
14
|
|
|
15
15
|
/** A held name is in a portfolio; a watched one only in watchlists. */
|
|
16
16
|
export type Ownership = "held" | "watched";
|
|
17
17
|
|
|
18
|
-
export interface BoardReport {
|
|
18
|
+
export interface BoardReport extends FilingEpsDetails {
|
|
19
19
|
key: string;
|
|
20
20
|
symbol: string;
|
|
21
21
|
name: string;
|
|
@@ -153,8 +153,9 @@ export function boardReport(report: EarningsCalendarReport, owned: ReadonlyMap<s
|
|
|
153
153
|
epsAnalysts: report.epsAnalysts,
|
|
154
154
|
epsActual: report.epsActual,
|
|
155
155
|
provisional: isProvisionalActual(report),
|
|
156
|
-
epsBasis:
|
|
157
|
-
|
|
156
|
+
epsBasis: displayEarningsEpsBasis(report),
|
|
157
|
+
...(report.streetEps ? { streetEps: report.streetEps, gaapEps: report.gaapEps } : {}),
|
|
158
|
+
epsSurprise: reportedEpsComparison(report)?.surprise ?? null,
|
|
158
159
|
revenueEstimate: report.revenueEstimate,
|
|
159
160
|
impliedMove: report.implied?.move ?? null,
|
|
160
161
|
averageMove: report.averageReports >= MIN_AVERAGE_REPORTS ? report.averageMove : null,
|
|
@@ -166,6 +167,18 @@ export function boardReport(report: EarningsCalendarReport, owned: ReadonlyMap<s
|
|
|
166
167
|
};
|
|
167
168
|
}
|
|
168
169
|
|
|
170
|
+
/** Whether a board row is a report already out or one still to come, each with columns of its own. */
|
|
171
|
+
export type BoardKind = "upcoming" | "reported";
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* A report is out once the calendar says so, once it has an actual or a
|
|
175
|
+
* measured move on it, or once its day has gone by; until then it is to come,
|
|
176
|
+
* confirmed or projected.
|
|
177
|
+
*/
|
|
178
|
+
export function boardReportKind(report: Pick<BoardReport, "date" | "dateStatus" | "epsActual" | "realizedMove">, today: string): BoardKind {
|
|
179
|
+
return report.dateStatus === "reported" || report.epsActual != null || report.realizedMove != null || report.date < today ? "reported" : "upcoming";
|
|
180
|
+
}
|
|
181
|
+
|
|
169
182
|
/**
|
|
170
183
|
* A listing as the board and Gloom Cloud's earnings history key it, however it
|
|
171
184
|
* was typed: a vendor's suffix as the venue it names (0700.HK, 700.HK and
|
|
@@ -8,11 +8,11 @@ import { isNotMeaningful } from "../../../utils/growth";
|
|
|
8
8
|
import { TextAttributes } from "../../../ui";
|
|
9
9
|
import { ACTUAL_PENDING, actualPending, epsBasisShort, showsEpsBasis } from "../shared/earnings-report";
|
|
10
10
|
import { listingAbroadVenue } from "../../../utils/sec";
|
|
11
|
-
import type { BoardReport, BoardRow, BoardSort } from "./board-model";
|
|
11
|
+
import type { BoardKind, BoardReport, BoardRow, BoardSort } from "./board-model";
|
|
12
12
|
import { epsText, impliedText, moneyText, moveSize, signedPercent, TIMING_LABEL, weekday, type Surprise } from "./format";
|
|
13
13
|
|
|
14
14
|
type BoardColumnId =
|
|
15
|
-
| "owned" | "symbol" | "name" | "when" | "status" | "cap" | "
|
|
15
|
+
| "owned" | "symbol" | "name" | "when" | "status" | "cap" | "epsEstimate" | "analysts" | "epsActual" | "basis"
|
|
16
16
|
| "epsSurprise" | "revenueEstimate" | "implied" | "move" | "average";
|
|
17
17
|
|
|
18
18
|
export type BoardColumn = DataTableColumn & { id: BoardColumnId };
|
|
@@ -32,13 +32,11 @@ const ALL_COLUMNS: BoardColumn[] = [
|
|
|
32
32
|
// while no report in view has one: small caps list no options and too few
|
|
33
33
|
// reports to average, and a move is only measured on the day a report is out.
|
|
34
34
|
{ id: "implied", label: "IMPLIED", width: 7, align: "right", omitWhenEmpty: "visible" },
|
|
35
|
-
// The move, the actual EPS and its surprise come with the report: an upcoming one has none.
|
|
36
35
|
{ id: "move", label: "MOVE", width: 7, align: "right", mayBeBlank: true, omitWhenEmpty: "visible" },
|
|
37
36
|
{ id: "average", label: "AVG MOVE", width: 8, align: "right", omitWhenEmpty: "visible" },
|
|
38
|
-
// The currency of the EPS and sales figures, on a board with a listing abroad's (CNY for Tencent).
|
|
39
|
-
{ id: "ccy", label: "CCY", width: 3, align: "left" },
|
|
40
37
|
{ id: "epsEstimate", label: "EPS EST", width: 7, align: "right" },
|
|
41
38
|
{ id: "analysts", label: "ESTS", width: 4, align: "right" },
|
|
39
|
+
// A report out without its actual yet says it is pending.
|
|
42
40
|
{ id: "epsActual", label: "EPS ACT", width: 7, align: "right", mayBeBlank: true },
|
|
43
41
|
{ id: "basis", label: "BASIS", width: 5, align: "left", mayBeBlank: true },
|
|
44
42
|
{ id: "epsSurprise", label: "EPS SURP", width: 8, align: "right", mayBeBlank: true },
|
|
@@ -47,42 +45,65 @@ const ALL_COLUMNS: BoardColumn[] = [
|
|
|
47
45
|
];
|
|
48
46
|
|
|
49
47
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
48
|
+
* Each kind of report has its own columns. One to come has its date's status
|
|
49
|
+
* (confirmed or projected), its implied move and its analysts, and nothing of
|
|
50
|
+
* a report yet. One out has the move on it, its actual and surprise, and no
|
|
51
|
+
* status: the view says it is out.
|
|
53
52
|
*/
|
|
54
|
-
const
|
|
53
|
+
const KIND_COLUMNS: Record<BoardKind, ReadonlySet<BoardColumnId>> = {
|
|
54
|
+
upcoming: new Set(["owned", "symbol", "name", "when", "status", "implied", "average", "epsEstimate", "analysts", "revenueEstimate", "cap"]),
|
|
55
|
+
reported: new Set(["owned", "symbol", "name", "when", "implied", "move", "average", "epsEstimate", "epsActual", "basis", "epsSurprise", "revenueEstimate", "cap"]),
|
|
56
|
+
};
|
|
55
57
|
|
|
56
58
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* goes. Without one, those two columns would be empty, so DROP_ORDER holds.
|
|
59
|
+
* Dropped first when narrow, labels before figures. Upcoming: the analysts,
|
|
60
|
+
* the status, then the cap and the estimates; the implied move and its
|
|
61
|
+
* average stay beside the name. WHEN quiets a projected date once STATUS goes.
|
|
61
62
|
*/
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const DROP_ORDER: Record<BoardKind, BoardColumnId[]> = {
|
|
64
|
+
upcoming: ["analysts", "status", "cap", "revenueEstimate", "epsEstimate", "owned"],
|
|
65
|
+
// Out, the report is the news: EPS ACT, then EPS SURP, outrank SALES EST, MKT CAP and AVG MOVE, which go first.
|
|
66
|
+
reported: ["basis", "average", "cap", "revenueEstimate", "epsSurprise", "epsActual", "epsEstimate", "owned"],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The columns in the report's currency. A report in another currency than
|
|
71
|
+
* dollars (a listing abroad's) writes its code after each figure ("7.21 CNY"),
|
|
72
|
+
* and these columns take the room for it; dollars stay bare, so no column
|
|
73
|
+
* says USD down the board.
|
|
74
|
+
*/
|
|
75
|
+
const CURRENCY_FIGURES: ReadonlySet<BoardColumnId> = new Set(["epsEstimate", "epsActual", "revenueEstimate"]);
|
|
76
|
+
/** " CNY" after a figure. */
|
|
77
|
+
const CURRENCY_CODE_WIDTH = 4;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A figure with its report's currency after it when that is not dollars; a
|
|
81
|
+
* missing or pending one bare. The figure itself is the cell's value, so an
|
|
82
|
+
* export writes numbers down a column whose rows show different codes, and
|
|
83
|
+
* names each row's currency in its own column (BOARD_CURRENCY_EXPORT).
|
|
84
|
+
*/
|
|
85
|
+
function inReportCurrency(cell: DataTableCell, report: BoardReport, figure: number | null | undefined): DataTableCell {
|
|
86
|
+
if (figure == null || cell.text === MISSING_VALUE || cell.text === ACTUAL_PENDING) return cell;
|
|
87
|
+
const currency = report.currency;
|
|
88
|
+
return { ...cell, value: figure, ...(currency && currency !== "USD" ? { text: `${cell.text} ${currency}` } : {}) };
|
|
89
|
+
}
|
|
65
90
|
|
|
66
|
-
/**
|
|
67
|
-
const
|
|
91
|
+
/** A board with a report in another currency than dollars exports each report's currency after the table's columns. */
|
|
92
|
+
export const BOARD_CURRENCY_EXPORT = {
|
|
93
|
+
headers: ["CCY"],
|
|
94
|
+
cells: (row: BoardRow): readonly unknown[] | null => (row.kind === "report" ? [row.report.currency ?? ""] : null),
|
|
95
|
+
} as const;
|
|
68
96
|
|
|
69
97
|
/** Header clicks sort these; the rest keep the ranking. */
|
|
70
98
|
export const SORTABLE: Partial<Record<BoardColumnId, BoardSort["column"]>> = {
|
|
71
99
|
symbol: "symbol", cap: "cap", implied: "implied", average: "average",
|
|
72
100
|
};
|
|
73
101
|
|
|
74
|
-
/**
|
|
75
|
-
* Whether any report on the board is out, with its actual or still pending: the narrow board then keeps EPS ACT and
|
|
76
|
-
* EPS SURP (boardColumns), so a report out today says its actual is pending rather than dropping the column.
|
|
77
|
-
*/
|
|
78
|
-
export function boardHasActuals(rows: readonly BoardRow[]): boolean {
|
|
79
|
-
return rows.some((row) => row.kind === "report" && (row.report.epsActual != null || actualPending(row.report, listingAbroadVenue(row.report.symbol) != null)));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
102
|
/**
|
|
83
103
|
* Whether a report on the board is in another currency than dollars (a
|
|
84
|
-
* listing abroad's): the board then
|
|
85
|
-
* dollars (boardColumns). A board of US reports
|
|
104
|
+
* listing abroad's): the board then makes room for a code after its figures,
|
|
105
|
+
* and says its market cap is in dollars (boardColumns). A board of US reports
|
|
106
|
+
* looks as it always has.
|
|
86
107
|
*/
|
|
87
108
|
export function boardHasCurrencies(rows: readonly BoardRow[]): boolean {
|
|
88
109
|
return rows.some((row) => row.kind === "report" && row.report.currency != null && row.report.currency !== "USD");
|
|
@@ -96,24 +117,23 @@ export function boardSymbolWidth(rows: readonly BoardRow[]): number {
|
|
|
96
117
|
|
|
97
118
|
export function boardColumns(
|
|
98
119
|
width: number,
|
|
99
|
-
{
|
|
120
|
+
{ kind = "upcoming", currencies = false, symbolWidth = SYMBOL_WIDTH }: { kind?: BoardKind; currencies?: boolean; symbolWidth?: number } = {},
|
|
100
121
|
): BoardColumn[] {
|
|
101
|
-
// Every column but the name, with the space a left-aligned column keeps from a right-aligned one before it (
|
|
102
|
-
//
|
|
122
|
+
// Every column but the name, with the space a left-aligned column keeps from a right-aligned one before it (BASIS
|
|
123
|
+
// after EPS ACT), so the last column is never cut at the pane's edge.
|
|
103
124
|
const fixed = (list: BoardColumn[]) =>
|
|
104
125
|
list.reduce((sum, column, index) =>
|
|
105
126
|
sum + tableColumnLeadGap(list, index, TABLE_COLUMN_GAP) + (column.id === "name" ? 0 : tableColumnWidth(column)) + TABLE_COLUMN_GAP, 2);
|
|
106
127
|
// Beside figures in yuan or Hong Kong dollars, the cap says it is in dollars.
|
|
107
|
-
let columns =
|
|
128
|
+
let columns = ALL_COLUMNS.filter((column) => KIND_COLUMNS[kind].has(column.id)).map((column) =>
|
|
108
129
|
column.id === "cap" && currencies ? { ...column, label: "MKT CAP $", width: 9 }
|
|
109
130
|
: column.id === "symbol" ? { ...column, width: symbolWidth }
|
|
110
|
-
: column)
|
|
111
|
-
|
|
131
|
+
: currencies && CURRENCY_FIGURES.has(column.id) ? { ...column, width: column.width + CURRENCY_CODE_WIDTH }
|
|
132
|
+
: column);
|
|
133
|
+
for (const id of DROP_ORDER[kind]) {
|
|
112
134
|
if (fixed(columns) + NAME_MIN_WIDTH <= width) break;
|
|
113
135
|
columns = columns.filter((column) => column.id !== id);
|
|
114
136
|
}
|
|
115
|
-
// CCY is the currency of the figures beside it; with none left it goes too.
|
|
116
|
-
if (!columns.some((column) => CURRENCY_FIGURES.includes(column.id))) columns = columns.filter((column) => column.id !== "ccy");
|
|
117
137
|
// The name takes what the other columns leave.
|
|
118
138
|
const nameWidth = Math.max(NAME_MIN_WIDTH, width - fixed(columns));
|
|
119
139
|
return columns.map((column) => (column.id === "name" ? { ...column, width: nameWidth } : column));
|
|
@@ -125,7 +145,7 @@ export function renderBoardSection(row: BoardRow) {
|
|
|
125
145
|
|
|
126
146
|
/** What a board cell draws besides its report. */
|
|
127
147
|
export interface BoardCellContext {
|
|
128
|
-
/** Whether the STATUS column is on screen; without it
|
|
148
|
+
/** Whether the STATUS column is on screen; without it WHEN quiets a projected date, as STATUS would. */
|
|
129
149
|
statusShown: boolean;
|
|
130
150
|
/** The move on the report (boardMove): so far for one out today, across it for one out before; "loading" while today's quote is. */
|
|
131
151
|
move: (report: BoardReport) => number | "loading" | null;
|
|
@@ -157,28 +177,24 @@ export function renderBoardCell(row: BoardRow, column: BoardColumn, context: Boa
|
|
|
157
177
|
case "when": {
|
|
158
178
|
const timing = report.timing ? TIMING_LABEL[report.timing] : MISSING_VALUE;
|
|
159
179
|
const text = row.showDay ? `${weekday(report.date)} ${timing}` : timing;
|
|
160
|
-
// An expected time, from the company's last reports, reads quieter than an announced one
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return
|
|
164
|
-
? { text: `${text} ✓`, color: report.expectedTiming ? colors.textMuted : dim }
|
|
165
|
-
: { text, color: report.expectedTiming || report.dateStatus === "projected" ? colors.textMuted : dim };
|
|
180
|
+
// An expected time, from the company's last reports, reads quieter than an announced one; so does a projected
|
|
181
|
+
// date once no STATUS column says it is.
|
|
182
|
+
const quiet = report.expectedTiming || (!context.statusShown && report.dateStatus === "projected");
|
|
183
|
+
return { text, color: quiet ? colors.textMuted : dim };
|
|
166
184
|
}
|
|
167
185
|
case "status":
|
|
168
186
|
// A projected date reads quieter than an announced one, as an expected time does.
|
|
169
187
|
return { text: report.dateStatus ?? MISSING_VALUE, color: report.dateStatus === "projected" ? colors.textMuted : dim };
|
|
170
188
|
case "cap":
|
|
171
189
|
return { text: moneyText(report.marketCap), color: dim };
|
|
172
|
-
case "ccy":
|
|
173
|
-
return { text: report.currency ?? MISSING_VALUE, color: dim };
|
|
174
190
|
case "epsEstimate":
|
|
175
|
-
return { text: epsText(report.epsEstimate), color: dim };
|
|
191
|
+
return inReportCurrency({ text: epsText(report.epsEstimate), color: dim }, report, report.epsEstimate);
|
|
176
192
|
case "analysts":
|
|
177
193
|
return { text: report.epsAnalysts == null ? MISSING_VALUE : String(report.epsAnalysts), color: dim };
|
|
178
194
|
case "epsActual":
|
|
179
195
|
// A report out with no actual yet says so; the company's press release's figure reads quieter until the calendar's replaces it.
|
|
180
196
|
if (actualPending(report, listingAbroadVenue(report.symbol) != null)) return { text: ACTUAL_PENDING, color: dim };
|
|
181
|
-
return { text: epsText(report.epsActual), color: report.epsActual == null ? dim : report.provisional ? colors.textMuted : colors.text };
|
|
197
|
+
return inReportCurrency({ text: epsText(report.epsActual), color: report.epsActual == null ? dim : report.provisional ? colors.textMuted : colors.text }, report, report.epsActual);
|
|
182
198
|
case "basis":
|
|
183
199
|
return !showsEpsBasis(report)
|
|
184
200
|
? { text: MISSING_VALUE, color: dim }
|
|
@@ -186,7 +202,7 @@ export function renderBoardCell(row: BoardRow, column: BoardColumn, context: Boa
|
|
|
186
202
|
case "epsSurprise":
|
|
187
203
|
return signed(report.epsSurprise);
|
|
188
204
|
case "revenueEstimate":
|
|
189
|
-
return { text: moneyText(report.revenueEstimate), color: dim };
|
|
205
|
+
return inReportCurrency({ text: moneyText(report.revenueEstimate), color: dim }, report, report.revenueEstimate);
|
|
190
206
|
case "implied":
|
|
191
207
|
return { text: impliedText(report.impliedMove), color: colors.textBright };
|
|
192
208
|
case "move": {
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
usePaneFooter,
|
|
7
7
|
usePaneMenuItems,
|
|
8
8
|
usePaneStatusFooter,
|
|
9
|
+
usePaneTabs,
|
|
9
10
|
type DataTableKeyEvent,
|
|
10
11
|
type QueryBarFilter,
|
|
11
12
|
type QueryBarView,
|
|
@@ -43,11 +44,13 @@ import {
|
|
|
43
44
|
ownershipBySymbol,
|
|
44
45
|
relativeDays,
|
|
45
46
|
boardMove,
|
|
47
|
+
boardReportKind,
|
|
48
|
+
type BoardKind,
|
|
46
49
|
type BoardReport,
|
|
47
50
|
type BoardRow,
|
|
48
51
|
type BoardSort,
|
|
49
52
|
} from "./board-model";
|
|
50
|
-
import {
|
|
53
|
+
import { BOARD_CURRENCY_EXPORT, boardColumns, boardHasCurrencies, boardSymbolWidth, renderBoardCell, renderBoardSection, SORTABLE, type BoardCellContext, type BoardColumn } from "./board-table";
|
|
51
54
|
import { EarningsCalendarView, CALENDAR_GROUP_ROWS, calendarSlotsPerRow } from "./calendar";
|
|
52
55
|
import {
|
|
53
56
|
boardRangeDays,
|
|
@@ -96,6 +99,9 @@ type BoardView = "table" | "calendar";
|
|
|
96
99
|
const ORDER_OPTIONS: ReadonlyArray<{ value: Order; label: string }> = [{ value: "cap", label: "Size" }, { value: "mine", label: "Mine first" }];
|
|
97
100
|
/** The week as logos is for the desktop and the web; the terminal draws no logos and keeps the table. */
|
|
98
101
|
const ERN_VIEWS: ReadonlyArray<{ value: BoardView; label: string }> = [{ value: "table", label: "Table" }, { value: "calendar", label: "Calendar" }];
|
|
102
|
+
/** The table's reports to come and reports out, each with columns of its own. */
|
|
103
|
+
const BOARD_KINDS: Array<{ value: BoardKind; label: string }> = [{ value: "upcoming", label: "Upcoming" }, { value: "reported", label: "Reported" }];
|
|
104
|
+
const isBoardKind = (value: unknown): value is BoardKind => value === "upcoming" || value === "reported";
|
|
99
105
|
|
|
100
106
|
interface BoardData {
|
|
101
107
|
/** The query read, by `earningsCalendarKey`: kept data from another week is not this week's. */
|
|
@@ -113,7 +119,7 @@ interface BoardData {
|
|
|
113
119
|
* Names filter (Mine, a portfolio, a watchlist or a fund's holdings),
|
|
114
120
|
* the upcoming reports of those companies instead. Every board reads the Hong
|
|
115
121
|
* Kong, China A and Singapore top 100's reports too, ranked by their value in
|
|
116
|
-
* dollars beside US companies,
|
|
122
|
+
* dollars beside US companies, a code after each figure not in dollars.
|
|
117
123
|
*/
|
|
118
124
|
export function EarningsBoard({ focused, width, height, scopedSymbols, highlight = null }: {
|
|
119
125
|
focused: boolean;
|
|
@@ -156,6 +162,10 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
156
162
|
const [requestedDate] = usePaneSettingValue<string>("date", "");
|
|
157
163
|
const [requestedWeek] = usePaneSettingValue<string>("week", "");
|
|
158
164
|
const [chosenRange, setRange] = usePluginPaneState<BoardRange | null>("range", null);
|
|
165
|
+
// The table's Upcoming or Reported view: a layout's or `shot`'s `kind` setting, else the reports to come while the
|
|
166
|
+
// range has any; a choice made in the pane wins.
|
|
167
|
+
const [requestedKind] = usePaneSettingValue<string>("kind", "");
|
|
168
|
+
const [chosenKind, setKind] = usePluginPaneState<BoardKind | null>("kind", null);
|
|
159
169
|
// The calendar's groups opened past their "+N more" slot, by `calendarGroupKey`.
|
|
160
170
|
const [expanded, setExpanded] = useState(NONE_EXPANDED);
|
|
161
171
|
const desktop = useUiCapabilities().nativePaneChrome === true;
|
|
@@ -213,8 +223,8 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
213
223
|
const week = useMemo(() => calendarWeekDates(today, weekOffset), [today, weekOffset]);
|
|
214
224
|
// EVTS 0700.HK names its listing, which the market board then keeps whatever the day's cut.
|
|
215
225
|
const highlightListing = market && highlight ? boardKey(highlight) : null;
|
|
216
|
-
// The calendar reads its week, reported days included; the table its days.
|
|
217
|
-
//
|
|
226
|
+
// The calendar reads its week, reported days included; the table its days. A report not in dollars says its
|
|
227
|
+
// currency after its figures, so every board reads the listings abroad too.
|
|
218
228
|
const query = useMemo<EarningsCalendarQuery>(() => {
|
|
219
229
|
const symbols = highlightListing && !named.includes(highlightListing) ? [...named, highlightListing] : named;
|
|
220
230
|
return calendar
|
|
@@ -271,7 +281,14 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
271
281
|
// A new fund or range never shows the previous scope while its holdings load or fail.
|
|
272
282
|
const data = resource.data?.queryKey === queryKey ? resource.data : null;
|
|
273
283
|
const weekData = data;
|
|
274
|
-
const
|
|
284
|
+
const kinds = useMemo(() => {
|
|
285
|
+
const split: Record<BoardKind, BoardReport[]> = { upcoming: [], reported: [] };
|
|
286
|
+
for (const report of data?.reports ?? []) split[boardReportKind(report, today)].push(report);
|
|
287
|
+
return split;
|
|
288
|
+
}, [data, today]);
|
|
289
|
+
const kind: BoardKind = chosenKind ?? (isBoardKind(requestedKind) ? requestedKind
|
|
290
|
+
: kinds.upcoming.length > 0 || kinds.reported.length === 0 ? "upcoming" : "reported");
|
|
291
|
+
const rows = useMemo(() => boardRows(kinds[kind], days, sort, order === "mine"), [days, kind, kinds, order, sort]);
|
|
275
292
|
const reportRows = useMemo(() => rows.filter((row): row is BoardRow & { kind: "report" } => row.kind === "report"), [rows]);
|
|
276
293
|
const slotsPerRow = calendarSlotsPerRow(width);
|
|
277
294
|
const weekDays = useMemo(
|
|
@@ -286,13 +303,12 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
286
303
|
const selected = reportRows.find((row) => row.key === selectedKey) ?? reportRows[0] ?? null;
|
|
287
304
|
const open = reportRows.find((row) => row.key === openKey)?.report
|
|
288
305
|
?? (openKey ? data?.reports.find((report) => report.key === openKey) : undefined) ?? null;
|
|
289
|
-
//
|
|
290
|
-
// keyed by the flags, so the columns hold between renders.
|
|
291
|
-
const actuals = boardHasActuals(rows);
|
|
306
|
+
// Each view has its own columns, with room for a code after the figures while one of its reports is in another
|
|
307
|
+
// currency than dollars; keyed by the flags, so the columns hold between renders.
|
|
292
308
|
const currencies = boardHasCurrencies(rows);
|
|
293
309
|
// TICKER fits a listing abroad's key (601939:SSE) when the board has one.
|
|
294
310
|
const symbolWidth = boardSymbolWidth(rows);
|
|
295
|
-
const columns = useMemo(() => boardColumns(width, {
|
|
311
|
+
const columns = useMemo(() => boardColumns(width, { kind, currencies, symbolWidth }), [currencies, kind, symbolWidth, width]);
|
|
296
312
|
// The move on each report out today, beside its implied move, from the quotes every board reads.
|
|
297
313
|
// Keyed by content: the rows are rebuilt on renders that change nothing, and the quote board reloads on a new list.
|
|
298
314
|
const reportedKey = [...new Set(reportRows.filter((row) => row.report.dateStatus === "reported" && row.report.date === today)
|
|
@@ -333,13 +349,21 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
333
349
|
}, [data, openSymbol, setOpenKey]);
|
|
334
350
|
|
|
335
351
|
useEffect(() => {
|
|
336
|
-
if (!highlight || highlighted.current === highlight) return;
|
|
337
|
-
// 0700.HK as typed is the board's 0700:HKEX; 0939.HK is CCB's row under its A share.
|
|
338
|
-
const
|
|
339
|
-
|
|
352
|
+
if (!highlight || highlighted.current === highlight || !data) return;
|
|
353
|
+
// 0700.HK as typed is the board's 0700:HKEX; 0939.HK is CCB's row under its A share. In the range, in its view.
|
|
354
|
+
const report = boardRows(data.reports, days, sort, false).find((candidate): candidate is BoardRow & { kind: "report" } =>
|
|
355
|
+
candidate.kind === "report" && boardRowOf(candidate.report, highlight))?.report;
|
|
356
|
+
if (!report) return;
|
|
340
357
|
highlighted.current = highlight;
|
|
341
|
-
|
|
342
|
-
|
|
358
|
+
// A view named by `--kind` or a layout's `kind` wins: the ticker's report is selected only in it.
|
|
359
|
+
const reportKind = boardReportKind(report, today);
|
|
360
|
+
if (isBoardKind(requestedKind)) {
|
|
361
|
+
if (requestedKind === reportKind) setSelectedKey(report.key);
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
setKind(reportKind);
|
|
365
|
+
setSelectedKey(report.key);
|
|
366
|
+
}, [data, days, highlight, requestedKind, setKind, setSelectedKey, sort, today]);
|
|
343
367
|
|
|
344
368
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
345
369
|
const updatedAgo = useUpdatedAgo(resource.updatedAt);
|
|
@@ -418,7 +442,8 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
418
442
|
...weekOptions(range && !isBoardRangeDay(range) ? weekOffset : null),
|
|
419
443
|
...rangeDates.map((date) => ({ value: date, label: boardRangeLabel(date, today)! })),
|
|
420
444
|
],
|
|
421
|
-
|
|
445
|
+
// Another range opens on its reports to come, or on those out when none is.
|
|
446
|
+
onChange: (value: string) => { setRange(value); setSelectedKey(null); setKind(null); },
|
|
422
447
|
};
|
|
423
448
|
// On the desktop the view picks the table or the week, and the order is a filter beside the names and the Range.
|
|
424
449
|
const queryBar = !desktop ? <QueryBar width={width} filters={[...namesFilter, rangeFilter]} view={orderView} /> : (
|
|
@@ -434,10 +459,22 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
434
459
|
);
|
|
435
460
|
// "last week", "on Thu Oct 15", "in the week of Nov 2": the days the empty board or week is of.
|
|
436
461
|
const rangeWords = calendar ? boardRangeWords(String(weekOffset), today) : boardRangeWords(range, today);
|
|
437
|
-
|
|
462
|
+
// A view with none of the range's reports says so: all are out, or none is yet.
|
|
463
|
+
const otherKind = kind === "upcoming" ? kinds.reported.length > 0 : kinds.upcoming.length > 0;
|
|
464
|
+
const emptyStateTitle = !calendar && otherKind
|
|
465
|
+
? kind === "upcoming" ? `Every report ${rangeWords ?? "these days"} is out.` : "None of these reports is out yet."
|
|
466
|
+
: market ? noCalendarReportsTitle(rangeWords)
|
|
438
467
|
: scope.kind === "mine" && named.length === 0 ? "No portfolio or watchlist names."
|
|
439
468
|
: (scope.kind === "portfolio" || scope.kind === "watchlist") && named.length === 0 ? `No tickers in ${scope.name}.`
|
|
440
469
|
: rangeWords ? `No reports from these companies ${rangeWords}.` : "No upcoming reports.";
|
|
470
|
+
// The table's two views. The week draws both kinds as logos, and a company's report history replaces the board.
|
|
471
|
+
const { strip: kindStrip, rows: kindRows } = usePaneTabs(calendar || open ? null : {
|
|
472
|
+
tabs: BOARD_KINDS,
|
|
473
|
+
activeValue: kind,
|
|
474
|
+
onSelect: (value) => { if (isBoardKind(value)) { setKind(value); setSelectedKey(null); } },
|
|
475
|
+
focused,
|
|
476
|
+
dense: true,
|
|
477
|
+
});
|
|
441
478
|
const history = open ? (
|
|
442
479
|
<EarningsHistoryView key={open.symbol} symbol={open.symbol} width={width} height={Math.max(4, height - 1)}
|
|
443
480
|
focused={focused} registrationId="earnings-history" />
|
|
@@ -481,40 +518,45 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
481
518
|
}
|
|
482
519
|
|
|
483
520
|
return (
|
|
484
|
-
<
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
521
|
+
<Box flexDirection="column" width={width} height={height}>
|
|
522
|
+
{kindStrip}
|
|
523
|
+
<DataTableStackView<BoardRow, BoardColumn>
|
|
524
|
+
focused={focused}
|
|
525
|
+
rootWidth={width}
|
|
526
|
+
rootHeight={Math.max(3, height - kindRows)}
|
|
527
|
+
rootBefore={queryBar}
|
|
528
|
+
status={{ loading: (resource.loading || highlightedReport.loading) && !data, error: !data ? resource.error : null, subject: "the earnings calendar" }}
|
|
529
|
+
columns={columns}
|
|
530
|
+
items={rows}
|
|
531
|
+
getItemKey={(row) => row.key}
|
|
532
|
+
isNavigable={(row) => row.kind === "report"}
|
|
533
|
+
renderSectionHeader={renderBoardSection}
|
|
534
|
+
renderCell={renderCell}
|
|
535
|
+
// The figures export bare; a board with a report in another currency names each row's after them.
|
|
536
|
+
exportIdentity={currencies ? BOARD_CURRENCY_EXPORT : undefined}
|
|
537
|
+
getRowVersion={rowVersion}
|
|
538
|
+
selectedTextOverridesCellColor
|
|
539
|
+
sortColumnId={sortColumn}
|
|
540
|
+
sortDirection={sort.direction}
|
|
541
|
+
onHeaderClick={(columnId) => {
|
|
542
|
+
const column = SORTABLE[columnId as BoardColumn["id"]];
|
|
543
|
+
if (!column) return;
|
|
544
|
+
setSort((current) => ({ column, direction: current.column === column && current.direction === "desc" ? "asc" : column === "symbol" ? "asc" : "desc" }));
|
|
545
|
+
}}
|
|
546
|
+
selection={{
|
|
547
|
+
kind: "index",
|
|
548
|
+
selectedIndex: selected ? rows.indexOf(selected) : -1,
|
|
549
|
+
onChange: (_index, row) => { if (row.kind === "report") setSelectedKey(row.key); },
|
|
550
|
+
}}
|
|
551
|
+
onActivate={(row) => { if (row.kind === "report") setOpenKey(row.key); }}
|
|
552
|
+
onRootKeyDown={handleKeyDown}
|
|
553
|
+
detailOpen={!!open}
|
|
554
|
+
onBack={() => setOpenKey(null)}
|
|
555
|
+
detailTitle={open ? `${open.symbol} · ${open.name}` : undefined}
|
|
556
|
+
detailContent={history}
|
|
557
|
+
emptyStateTitle={emptyStateTitle}
|
|
558
|
+
/>
|
|
559
|
+
</Box>
|
|
518
560
|
);
|
|
519
561
|
}
|
|
520
562
|
|