@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
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
SectionHeading,
|
|
14
14
|
type QueryBarSearch,
|
|
15
15
|
} from "../../../components";
|
|
16
|
+
import { ReaderMeasure } from "../../../components/reader/reader-text";
|
|
16
17
|
import { PlaybackLine } from "../../../components/ui";
|
|
17
18
|
import { afterLayout, revealInScrollBox } from "../../../components/ui/reveal-in-scroll-box";
|
|
18
19
|
import { useShortcut } from "../../../react/input";
|
|
@@ -54,7 +55,9 @@ export const READER_TABS: Array<{ label: string; value: ReaderTab; hint: string
|
|
|
54
55
|
{ label: "Original", value: "original", hint: "g" },
|
|
55
56
|
];
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
/** A speaker's time and name keep their room in the header; the role and firm after them wrap. */
|
|
59
|
+
const NATIVE_KEEP = { flexShrink: 0 } as const;
|
|
60
|
+
const NATIVE_WRAP = { wrapText: true, style: { minWidth: 0 } } as const;
|
|
58
61
|
/** After the reader scrolls by hand, playback leaves the view where it is for this long. */
|
|
59
62
|
const FOLLOW_PAUSE_MS = 5_000;
|
|
60
63
|
/** A scroll this soon after the reader moved itself is that move, not the user's. */
|
|
@@ -136,17 +139,20 @@ const TurnView = memo(function TurnView({
|
|
|
136
139
|
// The server cuts paragraphs where the speaker paused on the recording.
|
|
137
140
|
// A transcript from before that is one block, so it is cut here by length.
|
|
138
141
|
const paragraphs = turnParagraphs(turn);
|
|
142
|
+
// The desktop and the web wrap a role and firm the reading column has no
|
|
143
|
+
// room for under its start; the terminal row ends at the pane's edge.
|
|
144
|
+
const { nativePaneChrome } = useUiCapabilities();
|
|
139
145
|
return (
|
|
140
146
|
<Box flexDirection="column" marginTop={1}>
|
|
141
|
-
<Box height={1} flexDirection="row" gap={1} overflow="hidden">
|
|
147
|
+
<Box height={nativePaneChrome ? undefined : 1} flexDirection="row" gap={1} overflow={nativePaneChrome ? undefined : "hidden"}>
|
|
142
148
|
{/* A transcript the company published as a document has no timings. */}
|
|
143
149
|
{turn.startSeconds !== null && (
|
|
144
|
-
<Text fg={colors.textDim}>{formatTimestamp(turn.startSeconds)}</Text>
|
|
150
|
+
<Text fg={colors.textDim} {...(nativePaneChrome ? NATIVE_KEEP : {})}>{formatTimestamp(turn.startSeconds)}</Text>
|
|
145
151
|
)}
|
|
146
|
-
<Text fg={speakerColor(turn)} attributes={TextAttributes.BOLD}>
|
|
152
|
+
<Text fg={speakerColor(turn)} attributes={TextAttributes.BOLD} {...(nativePaneChrome ? NATIVE_KEEP : {})}>
|
|
147
153
|
{turn.speaker}
|
|
148
154
|
</Text>
|
|
149
|
-
{detail ? <Text fg={colors.textDim}>{detail}</Text> : null}
|
|
155
|
+
{detail ? <Text fg={colors.textDim} {...(nativePaneChrome ? NATIVE_WRAP : {})}>{detail}</Text> : null}
|
|
150
156
|
</Box>
|
|
151
157
|
{paragraphs.map((paragraph, index) => (
|
|
152
158
|
<PlaybackLine
|
|
@@ -202,9 +208,6 @@ export function TranscriptView({
|
|
|
202
208
|
/** The call's recording: lines play from where they start and the one heard is marked and followed. */
|
|
203
209
|
playback?: TranscriptPlayback;
|
|
204
210
|
}) {
|
|
205
|
-
const { nativePaneChrome } = useUiCapabilities();
|
|
206
|
-
const isNative = nativePaneChrome === true;
|
|
207
|
-
|
|
208
211
|
// Each shown turn with its place in the whole transcript, which names its
|
|
209
212
|
// lines for playback and find whatever the section shows.
|
|
210
213
|
const turns = useMemo(() => {
|
|
@@ -330,8 +333,6 @@ export function TranscriptView({
|
|
|
330
333
|
// One column of padding each side inside the scroll box.
|
|
331
334
|
const bodyWidth = Math.max(12, width - 2);
|
|
332
335
|
const proseWidth = Math.min(bodyWidth, READING_WIDTH);
|
|
333
|
-
const contentWidth = isNative ? "100%" : bodyWidth;
|
|
334
|
-
const contentStyle = isNative ? NATIVE_STRETCH_STYLE : undefined;
|
|
335
336
|
|
|
336
337
|
return (
|
|
337
338
|
<Box
|
|
@@ -365,7 +366,8 @@ export function TranscriptView({
|
|
|
365
366
|
focusable={false}
|
|
366
367
|
paddingX={1}
|
|
367
368
|
>
|
|
368
|
-
|
|
369
|
+
{/* The reading column on the desktop and the web; the terminal keeps its body width. */}
|
|
370
|
+
<ReaderMeasure width={bodyWidth}>
|
|
369
371
|
{tab === "summary" ? (
|
|
370
372
|
<>
|
|
371
373
|
<Prose
|
|
@@ -480,7 +482,7 @@ export function TranscriptView({
|
|
|
480
482
|
)}
|
|
481
483
|
</>
|
|
482
484
|
)}
|
|
483
|
-
</
|
|
485
|
+
</ReaderMeasure>
|
|
484
486
|
</ScrollBox>
|
|
485
487
|
</Box>
|
|
486
488
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dayCell } from "../../../components/ui/day-cell";
|
|
1
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
3
|
import { DataTableView, EmptyState, PaneStatusBody, usePaneFooter, usePaneNoticeFooter, usePaneTabs,
|
|
3
4
|
type DataTableCell, type DataTableColumn, type PaneHint } from "../../../components";
|
|
@@ -32,7 +33,7 @@ const COLUMNS: DataTableColumn[] = [
|
|
|
32
33
|
];
|
|
33
34
|
|
|
34
35
|
const SECOND_HOP_COLUMNS: DataTableColumn[] = [
|
|
35
|
-
{ id: "date", label: "Date", width:
|
|
36
|
+
{ id: "date", label: "Date", width: 11, align: "left" },
|
|
36
37
|
{ id: "timing", label: "Time", width: 5, align: "left" },
|
|
37
38
|
{ id: "company", label: "Reports", width: 14, flexGrow: 1, align: "left" },
|
|
38
39
|
{ id: "link", label: "Link", width: 19, align: "left" },
|
|
@@ -99,7 +100,7 @@ const move = (row: RippleRow | SecondHopRow): DataTableCell =>
|
|
|
99
100
|
|
|
100
101
|
function renderCell(row: RippleRow, column: DataTableColumn): DataTableCell {
|
|
101
102
|
switch (column.id) {
|
|
102
|
-
case "date": return
|
|
103
|
+
case "date": return dayCell(row.date);
|
|
103
104
|
case "timing": return { text: row.timing?.toUpperCase() ?? MISSING_VALUE };
|
|
104
105
|
case "company": return { text: `${row.company} ${row.companyName}` };
|
|
105
106
|
case "link": return { text: row.link === "customer" ? "customer of" : "supplier to" };
|
|
@@ -112,7 +113,7 @@ function renderCell(row: RippleRow, column: DataTableColumn): DataTableCell {
|
|
|
112
113
|
|
|
113
114
|
function renderSecondHopCell(row: SecondHopRow, column: DataTableColumn, firstHopWidth: number): DataTableCell {
|
|
114
115
|
switch (column.id) {
|
|
115
|
-
case "date": return
|
|
116
|
+
case "date": return dayCell(row.date);
|
|
116
117
|
case "timing": return { text: row.timing?.toUpperCase() ?? MISSING_VALUE };
|
|
117
118
|
case "company": return { text: `${row.company} ${row.companyName}` };
|
|
118
119
|
case "link": return { text: row.link === "customer" ? "customer's customer" : "supplier's supplier" };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createPluginCache } from "../../../data/plugin-cache";
|
|
2
|
-
import type { DataTableColumn } from "../../../components";
|
|
2
|
+
import type { DataTableCell, DataTableColumn } from "../../../components";
|
|
3
|
+
import { narrowColumnsForName } from "../../../components/ui/table-layout";
|
|
3
4
|
import { colors } from "../../../theme/colors";
|
|
4
5
|
import { displayWidth, MISSING_VALUE } from "../../../utils/format";
|
|
5
6
|
import { fetchEconCalendar } from "./calendar-source";
|
|
@@ -281,6 +282,33 @@ export function eventCountry(event: Pick<EconEvent, "country" | "event">): strin
|
|
|
281
282
|
return euroAreaMember(event) ?? event.country;
|
|
282
283
|
}
|
|
283
284
|
|
|
285
|
+
/**
|
|
286
|
+
* The adjective that names a country, which a release's name may start with:
|
|
287
|
+
* the euro area's members, whose national releases both feeds write so, and
|
|
288
|
+
* the other countries the calendar lists.
|
|
289
|
+
*/
|
|
290
|
+
const COUNTRY_ADJECTIVES: Readonly<Record<string, string>> = {
|
|
291
|
+
...EURO_AREA_MEMBERS,
|
|
292
|
+
Australian: "AU", Brazilian: "BR", British: "GB", Canadian: "CA", Chinese: "CN", Danish: "DK", Indian: "IN",
|
|
293
|
+
Indonesian: "ID", Japanese: "JP", Mexican: "MX", Norwegian: "NO", Polish: "PL", Russian: "RU", Swedish: "SE",
|
|
294
|
+
Swiss: "CH", Turkish: "TR",
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* A row's name as the list shows it. Beside the country column
|
|
299
|
+
* (`countryShown`) a name that starts with the adjective of the row's country
|
|
300
|
+
* leaves it out, the column saying it once: "French Inflation Rate YoY Prel"
|
|
301
|
+
* on an FR row reads "Inflation Rate YoY Prel". Without the column (a filter
|
|
302
|
+
* on one country) the name keeps it. The detail, the search and the exports
|
|
303
|
+
* read the whole name (econEventName).
|
|
304
|
+
*/
|
|
305
|
+
export function listedEventName(event: Pick<EconEvent, "country" | "event" | "actual" | "forecast" | "prior">, countryShown: boolean): string {
|
|
306
|
+
const name = econEventName(event);
|
|
307
|
+
if (!countryShown) return name;
|
|
308
|
+
const adjective = /^([A-Z][a-z]+) (?=\S)/.exec(name);
|
|
309
|
+
return adjective && COUNTRY_ADJECTIVES[adjective[1]!] === eventCountry(event) ? name.slice(adjective[0].length) : name;
|
|
310
|
+
}
|
|
311
|
+
|
|
284
312
|
/** What the feeds call the Fed's rate decision. */
|
|
285
313
|
const FED_RATE_DECISION_NAMES = new Set(["federal funds rate", "fed interest rate decision"]);
|
|
286
314
|
/** A figure that is a range (3.75-4.00%) rather than one level. */
|
|
@@ -550,6 +578,45 @@ export function actualMayBeBlank(
|
|
|
550
578
|
return now < event.date.getTime() + (hasNoReleaseTime(event) ? AWAITING_FIGURE_MS : 0);
|
|
551
579
|
}
|
|
552
580
|
|
|
581
|
+
/**
|
|
582
|
+
* Whether a row prints a figure, by the two a row has beside `field`: a speech
|
|
583
|
+
* or a meeting has none of the three. A feed's row names no kind, so a release
|
|
584
|
+
* that lost all three reads as one that prints none, and is not named.
|
|
585
|
+
*/
|
|
586
|
+
function printsFigureBeside(event: Pick<EconEvent, "actual" | "forecast" | "prior">, field: "forecast" | "prior"): boolean {
|
|
587
|
+
const others = field === "forecast" ? [event.actual, event.prior] : [event.actual, event.forecast];
|
|
588
|
+
return others.some((figure) => !!figure?.trim());
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Whether a row's FORECAST is blank with no consensus missing: the row prints
|
|
593
|
+
* no figure (a speech, a meeting: neither an actual nor a prior), or it is
|
|
594
|
+
* past the end of the listing, where no feed carries a consensus yet.
|
|
595
|
+
*
|
|
596
|
+
* A figure row inside the listing owes one. The calendar cannot tell a release
|
|
597
|
+
* nobody forecasts, or one whose consensus is not in yet, from a forecast it
|
|
598
|
+
* lost: all three arrive as a null `forecast`. So a capture whose every such
|
|
599
|
+
* row has none fails on the column, and the pane's own note on a row still to
|
|
600
|
+
* come (NO_CONSENSUS_NOTE) is the only word on which it is.
|
|
601
|
+
*/
|
|
602
|
+
function forecastMayBeBlank(event: Pick<EconEvent, "actual" | "forecast" | "prior" | "pastListing">): boolean {
|
|
603
|
+
if (event.forecast?.trim()) return false;
|
|
604
|
+
return pastReleaseListing(event) || !printsFigureBeside(event, "forecast");
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Whether a row's PRIOR is blank with nothing missing: the row prints no
|
|
609
|
+
* figure (neither an actual nor a forecast).
|
|
610
|
+
*
|
|
611
|
+
* A figure row owes one. An indicator's first release has no prior either,
|
|
612
|
+
* which the calendar cannot tell from a prior it lost (both a null `prior`),
|
|
613
|
+
* so a capture whose every figure row has none fails on the column.
|
|
614
|
+
*/
|
|
615
|
+
function priorMayBeBlank(event: Pick<EconEvent, "actual" | "forecast" | "prior">): boolean {
|
|
616
|
+
if (event.prior?.trim()) return false;
|
|
617
|
+
return !printsFigureBeside(event, "prior");
|
|
618
|
+
}
|
|
619
|
+
|
|
553
620
|
/** What a release awaiting its figure says in place of it: "due 07:00 UTC, awaiting figure". */
|
|
554
621
|
function awaitingFigureText(event: Pick<EconEvent, "date">): string {
|
|
555
622
|
return `due ${timeLabel(event.date)} ${CALENDAR_TIME_ZONE_LABEL}, awaiting figure`;
|
|
@@ -564,10 +631,54 @@ export function figureGapText(event: Pick<EconEvent, "date">, gap: "awaiting" |
|
|
|
564
631
|
}
|
|
565
632
|
|
|
566
633
|
/** The ACTUAL cell of a release awaiting its figure, where the whole text has no room; the row's time is beside it. */
|
|
567
|
-
|
|
634
|
+
const AWAITING_FIGURE_CELL = "awaiting";
|
|
568
635
|
|
|
569
636
|
/** The ACTUAL cell of a release whose source has no figure; the footer says it whole. */
|
|
570
|
-
|
|
637
|
+
const NO_FIGURE_CELL = "no figure";
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* The cells of the widest word a row of `events` says under ACTUAL in place of
|
|
641
|
+
* its figure (`awaiting`, `no figure`), at `now`; 0 where none does. The
|
|
642
|
+
* column keeps them whatever the names need: a word is not a long figure.
|
|
643
|
+
*/
|
|
644
|
+
export function actualNoteWidth(events: readonly EconEvent[], now: number, calendar: readonly EconEvent[] = []): number {
|
|
645
|
+
let widest = 0;
|
|
646
|
+
for (const event of events) {
|
|
647
|
+
const gap = figureGap(event, now, calendar);
|
|
648
|
+
if (gap) widest = Math.max(widest, displayWidth(gap === "none" ? NO_FIGURE_CELL : AWAITING_FIGURE_CELL));
|
|
649
|
+
}
|
|
650
|
+
return widest;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* A release's ACTUAL, FORECAST or PRIOR cell. An amount reads with its
|
|
655
|
+
* currency beside it (-556.5B JPY), where the server says it. A dash is
|
|
656
|
+
* marked as one that may be blank only where the row says no figure is owed
|
|
657
|
+
* (actualMayBeBlank, forecastMayBeBlank, priorMayBeBlank), never by the dash.
|
|
658
|
+
*/
|
|
659
|
+
export function econFigureCell(
|
|
660
|
+
field: "actual" | "forecast" | "prior",
|
|
661
|
+
event: EconEvent,
|
|
662
|
+
now: number,
|
|
663
|
+
calendar: readonly EconEvent[] = [],
|
|
664
|
+
): DataTableCell {
|
|
665
|
+
if (field === "actual") {
|
|
666
|
+
// A release past its time whose figure is not in yet says so, or that the source has none; the footer says it whole.
|
|
667
|
+
const gap = figureGap(event, now, calendar);
|
|
668
|
+
if (gap) return { text: gap === "none" ? NO_FIGURE_CELL : AWAITING_FIGURE_CELL, color: colors.warning, value: null };
|
|
669
|
+
return {
|
|
670
|
+
text: figureWithCurrency(event.actual, event.currency) ?? MISSING_VALUE,
|
|
671
|
+
color: actualColor(event.actual, event.forecast),
|
|
672
|
+
...(actualMayBeBlank(event, now) ? { mayBeBlank: true } : {}),
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
const mayBeBlank = field === "forecast" ? forecastMayBeBlank(event) : priorMayBeBlank(event);
|
|
676
|
+
return {
|
|
677
|
+
text: figureWithCurrency(event[field], event.currency) ?? MISSING_VALUE,
|
|
678
|
+
color: colors.textDim,
|
|
679
|
+
...(mayBeBlank ? { mayBeBlank: true } : {}),
|
|
680
|
+
};
|
|
681
|
+
}
|
|
571
682
|
|
|
572
683
|
/** What a dash under Forecast means on a row still to come. */
|
|
573
684
|
export const NO_CONSENSUS_NOTE = `${MISSING_VALUE} forecast = no consensus yet`;
|
|
@@ -775,6 +886,99 @@ export function valueColumnWidth(events: readonly EconEvent[], key: "actual" | "
|
|
|
775
886
|
return width;
|
|
776
887
|
}
|
|
777
888
|
|
|
889
|
+
/** The cells a release's name needs to say which one it is (`GDP Growth Rate QoQ`, `Inflation Rate YoY`). */
|
|
890
|
+
const READABLE_NAME_CELLS = 20;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* The figure columns a narrow calendar leaves out, least needed first, each
|
|
894
|
+
* with the cells the event names keep before it goes. PRIOR is context, so it
|
|
895
|
+
* leaves once the names would get under READABLE_NAME_CELLS: in the 9 the
|
|
896
|
+
* three columns left them in a pane 53 cells wide, two rows of one hour both
|
|
897
|
+
* read `GDP Growt…`. The forecast is what a print is read against, so the
|
|
898
|
+
* names give up more before it goes. The actual always stays, and an event's
|
|
899
|
+
* detail has all three.
|
|
900
|
+
*/
|
|
901
|
+
const ECON_FIGURE_DROP_ORDER: readonly { id: string; namesUnder: number }[] = [
|
|
902
|
+
{ id: "prior", namesUnder: READABLE_NAME_CELLS },
|
|
903
|
+
{ id: "forecast", namesUnder: 14 },
|
|
904
|
+
];
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* The cells a plain figure takes (`105.28B`, `-24 Bcf`, `36.00%`): a column
|
|
908
|
+
* keeps these, and its header, whatever the names need. A column whose
|
|
909
|
+
* figures are all shorter (`0.4%`) is already as narrow as its widest.
|
|
910
|
+
*/
|
|
911
|
+
const PLAIN_FIGURE_WIDTH = 7;
|
|
912
|
+
|
|
913
|
+
/** The fewest cells `column` gives up to: a plain figure's, and under ACTUAL the word a row says in place of one (`actualNote`). */
|
|
914
|
+
const plainFigureCells = (column: { id: string }, actualNote: number) =>
|
|
915
|
+
(column.id === "actual" ? Math.max(PLAIN_FIGURE_WIDTH, actualNote) : PLAIN_FIGURE_WIDTH);
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* The cells the longest event name listed takes, as the list shows it beside
|
|
919
|
+
* its country (`countryShown`, listedEventName): a calendar of short names
|
|
920
|
+
* (`Retail Sales`) asks for no more.
|
|
921
|
+
*/
|
|
922
|
+
export function longestEventName(events: readonly Pick<EconEvent, "country" | "event" | "actual" | "forecast" | "prior">[], countryShown = false): number {
|
|
923
|
+
let longest = 0;
|
|
924
|
+
for (const event of events) longest = Math.max(longest, displayWidth(listedEventName(event, countryShown)));
|
|
925
|
+
return longest;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* The figure columns a calendar keeps at its width, as every narrow table
|
|
930
|
+
* decides: the name that says what a row is stays readable, and the least
|
|
931
|
+
* needed columns leave first (ECON_FIGURE_DROP_ORDER). Once one has left, the
|
|
932
|
+
* columns kept give the names what a long figure took before another goes
|
|
933
|
+
* (narrowColumnsForName). `roomFor` is the cells the event column gets
|
|
934
|
+
* beside the columns given; `longestName` what the names listed take at most
|
|
935
|
+
* (longestEventName), `floor` the fewest cells the column is ever drawn at,
|
|
936
|
+
* and `actualNote` the word a row says under ACTUAL in place of a figure
|
|
937
|
+
* (actualNoteWidth), which ACTUAL keeps whole. The widths are the ones the
|
|
938
|
+
* choice is made at; `figuresBesideNames` then gives the names the rest of
|
|
939
|
+
* what a long figure took.
|
|
940
|
+
*/
|
|
941
|
+
export function keptFigureColumns<C extends { id: string; width: number; label?: string }>(
|
|
942
|
+
figures: readonly C[],
|
|
943
|
+
roomFor: (kept: readonly C[]) => number,
|
|
944
|
+
longestName: number,
|
|
945
|
+
floor: number,
|
|
946
|
+
actualNote = 0,
|
|
947
|
+
): C[] {
|
|
948
|
+
const names = (cells: number) => Math.max(floor, Math.min(cells, longestName));
|
|
949
|
+
const fit = (kept: readonly C[]) => (kept.length < figures.length
|
|
950
|
+
? narrowColumnsForName(kept, roomFor, names(READABLE_NAME_CELLS), (column) => plainFigureCells(column, actualNote))
|
|
951
|
+
: [...kept]);
|
|
952
|
+
let kept = [...figures];
|
|
953
|
+
for (const { id, namesUnder } of ECON_FIGURE_DROP_ORDER) {
|
|
954
|
+
const fitted = fit(kept);
|
|
955
|
+
if (roomFor(fitted) >= names(namesUnder)) return fitted;
|
|
956
|
+
kept = kept.filter((column) => column.id !== id);
|
|
957
|
+
}
|
|
958
|
+
return fit(kept);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* The figure columns kept (keptFigureColumns) as wide as the names leave
|
|
963
|
+
* them: at any width, a column keeps more than a plain figure's cells (or its
|
|
964
|
+
* header's) only while the longest name listed is whole beside it. A column
|
|
965
|
+
* is as wide as the widest figure listed, so one long figure weeks out held
|
|
966
|
+
* every row's name to `French Inflation Rate …` beside a column of `2.9%`;
|
|
967
|
+
* now that figure is cut, and whole in its detail. `roomFor` is the cells the
|
|
968
|
+
* event column gets beside the columns given, under the headers drawn, and
|
|
969
|
+
* `actualNote` the word a row says under ACTUAL in place of a figure
|
|
970
|
+
* (actualNoteWidth), which ACTUAL keeps whole.
|
|
971
|
+
*/
|
|
972
|
+
export function figuresBesideNames<C extends { id: string; width: number; label?: string }>(
|
|
973
|
+
figures: readonly C[],
|
|
974
|
+
roomFor: (kept: readonly C[]) => number,
|
|
975
|
+
longestName: number,
|
|
976
|
+
floor: number,
|
|
977
|
+
actualNote = 0,
|
|
978
|
+
): C[] {
|
|
979
|
+
return narrowColumnsForName(figures, roomFor, Math.max(floor, longestName), (column) => plainFigureCells(column, actualNote));
|
|
980
|
+
}
|
|
981
|
+
|
|
778
982
|
export function actualColor(actual: string | null, forecast: string | null): string {
|
|
779
983
|
const a = parseEconFigure(actual)?.value ?? null;
|
|
780
984
|
const f = parseEconFigure(forecast)?.value ?? null;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { COUNTRY_FLAG_CELLS } from "../../../components/ui/country-flag";
|
|
2
|
+
import { markHiddenTableColumns, tableColumnWidth } from "../../../components/ui/table-layout";
|
|
3
|
+
import { timeZoneCity, zonedClock } from "../../../utils/utc-time";
|
|
4
|
+
import {
|
|
5
|
+
CALENDAR_TIME_ZONE_LABEL,
|
|
6
|
+
figuresBesideNames,
|
|
7
|
+
keptFigureColumns,
|
|
8
|
+
longestEventName,
|
|
9
|
+
valueColumnWidth,
|
|
10
|
+
type CountryFilter,
|
|
11
|
+
type EconCalendarColumn,
|
|
12
|
+
type ImpactFilter,
|
|
13
|
+
} from "./calendar-model";
|
|
14
|
+
import { hasNoReleaseTime, isAllDayEvent, type EconEvent } from "./types";
|
|
15
|
+
|
|
16
|
+
const SPELLED_IMPACT = "IMPACT";
|
|
17
|
+
const SPELLED_COUNTRY = "COUNTRY";
|
|
18
|
+
/** Event names this wide still read; past it the headers spell themselves out. */
|
|
19
|
+
const SPELLED_HEADER_MIN_EVENT_WIDTH = 24;
|
|
20
|
+
|
|
21
|
+
/** Whether the list has a country column: not where a filter names one country (the euro area's are several). */
|
|
22
|
+
export function countryColumnShown(countryFilter: CountryFilter): boolean {
|
|
23
|
+
return !/^[A-Z]{2}$/.test(countryFilter) || countryFilter === "EU";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The calendar's columns at `width` cells for the events listed (`events`):
|
|
28
|
+
* `columns` the table draws, `exportColumns` all of them, as Export CSV
|
|
29
|
+
* writes them, in the reader's column order where `exportInReaderOrder`. `flagged` leads each country's code with its flag (the
|
|
30
|
+
* desktop and the web), and `readerZone` is the reader's own time zone.
|
|
31
|
+
* `actualNote` is the widest word a row says under ACTUAL in place of its
|
|
32
|
+
* figure (actualNoteWidth), which the column keeps whole.
|
|
33
|
+
* Every width comes from the whole list, never the rows in view, so no
|
|
34
|
+
* column moves as the reader scrolls.
|
|
35
|
+
*/
|
|
36
|
+
export function econCalendarColumns({ width, events, countryFilter, impactFilter, flagged, readerZone, actualNote = 0 }: {
|
|
37
|
+
width: number;
|
|
38
|
+
events: readonly EconEvent[];
|
|
39
|
+
countryFilter: CountryFilter;
|
|
40
|
+
impactFilter: ImpactFilter;
|
|
41
|
+
flagged: boolean;
|
|
42
|
+
readerZone: string | null;
|
|
43
|
+
actualNote?: number;
|
|
44
|
+
}): { columns: EconCalendarColumn[]; exportColumns: EconCalendarColumn[]; exportInReaderOrder: boolean } {
|
|
45
|
+
// Named by its zone, as the reader's column is by its city: "TIME (UTC)" took 13
|
|
46
|
+
// cells over "07:00" while EVENT read "GDP Growth Ra…" (review, 12 Nov 2026).
|
|
47
|
+
const timeLabelText = CALENDAR_TIME_ZONE_LABEL;
|
|
48
|
+
const timeWidth = tableColumnWidth({ width: events.some(isAllDayEvent) ? "All day".length : 5, label: timeLabelText });
|
|
49
|
+
const compact = width < 58;
|
|
50
|
+
// One country, or one impact level, is the filter's: no column repeats it on each row.
|
|
51
|
+
const showCountry = countryColumnShown(countryFilter);
|
|
52
|
+
const showImpact = impactFilter === "all";
|
|
53
|
+
const actualLabel = compact ? "ACT" : "ACTUAL";
|
|
54
|
+
const forecastLabel = compact ? "EST" : "FORECAST";
|
|
55
|
+
// ACTUAL as wide as its widest figure and `note`, the word a row may say in its place.
|
|
56
|
+
const actualWidth = (note: number) => tableColumnWidth({ width: Math.max(valueColumnWidth(events, "actual", compact ? 3 : 9), note), label: actualLabel });
|
|
57
|
+
const forecastWidth = tableColumnWidth({ width: valueColumnWidth(events, "forecast", compact ? 3 : 10), label: forecastLabel });
|
|
58
|
+
const priorWidth = tableColumnWidth({ width: valueColumnWidth(events, "prior", compact ? 5 : 9), label: "PRIOR" });
|
|
59
|
+
const minEventWidth = tableColumnWidth({ width: compact ? 5 : 12, label: "EVENT" });
|
|
60
|
+
// The reader's clock, with the weekday on rows where it is another day than the UTC one they are listed under.
|
|
61
|
+
const readerLabel = readerZone ? timeZoneCity(readerZone).toUpperCase() : null;
|
|
62
|
+
const readerWidth = !readerZone || !readerLabel ? 0 : tableColumnWidth({ label: readerLabel,
|
|
63
|
+
width: events.some((ev) => !hasNoReleaseTime(ev) && zonedClock(ev.date.getTime(), readerZone).label.length > 5) ? 9 : 5 });
|
|
64
|
+
const figureColumnsFor = (note: number): EconCalendarColumn[] => [
|
|
65
|
+
{ id: "actual", label: actualLabel, title: "Actual", width: actualWidth(note), align: "right" },
|
|
66
|
+
{ id: "forecast", label: forecastLabel, title: "Forecast", width: forecastWidth, align: "right" },
|
|
67
|
+
{ id: "prior", label: "PRIOR", width: priorWidth, align: "right" },
|
|
68
|
+
];
|
|
69
|
+
// Padding, one gap per column boundary, and the vertical scrollbar lane;
|
|
70
|
+
// one column short of that clipped the PRIOR values at the right edge.
|
|
71
|
+
// `times` is the time columns (UTC, and the reader's clock); impact, country and event are the other three.
|
|
72
|
+
const roomBeside = (figures: readonly EconCalendarColumn[], times: number, timesWidth: number) => (impactWidth: number, countryWidth: number) => (
|
|
73
|
+
width - 3 - (times + 3 + figures.length) + (showCountry ? 0 : 1) + (showImpact ? 0 : 1)
|
|
74
|
+
- (timesWidth + (showImpact ? impactWidth : 0) + (showCountry ? countryWidth : 0) + figures.reduce((sum, column) => sum + column.width, 0))
|
|
75
|
+
);
|
|
76
|
+
const codeWidth = 2 + (flagged ? COUNTRY_FLAG_CELLS : 0);
|
|
77
|
+
const underShortHeaders = (room: (impactWidth: number, countryWidth: number) => number) => room(4, Math.max(3, codeWidth));
|
|
78
|
+
const spelledImpactWidth = tableColumnWidth({ width: 1, label: SPELLED_IMPACT });
|
|
79
|
+
const spelledCountryWidth = Math.max(codeWidth, tableColumnWidth({ width: 1, label: SPELLED_COUNTRY }));
|
|
80
|
+
|
|
81
|
+
// The columns before the figures, and the figures kept, beside figure columns as wide as `figureColumns` and names
|
|
82
|
+
// of up to `longestName` cells, with `note` the word ACTUAL keeps whole.
|
|
83
|
+
const layout = (figureColumns: readonly EconCalendarColumn[], longestName: number, note: number) => {
|
|
84
|
+
// The reader's column only where the event names keep room to read beside it, under the short headers.
|
|
85
|
+
const withReader = readerWidth > 0 && underShortHeaders(roomBeside(figureColumns, 2, timeWidth + readerWidth)) >= minEventWidth;
|
|
86
|
+
const times = withReader ? 2 : 1;
|
|
87
|
+
const timesWidth = withReader ? timeWidth + readerWidth : timeWidth;
|
|
88
|
+
// The names come first, as in every narrow table: where three figure columns leave "GDP Growt…", PRIOR goes, and
|
|
89
|
+
// in a narrower pane still the forecast; the table says which it left out. The event's detail has all three.
|
|
90
|
+
const kept = keptFigureColumns(figureColumns, (columns) => underShortHeaders(roomBeside(columns, times, timesWidth)), longestName, minEventWidth,
|
|
91
|
+
note);
|
|
92
|
+
// IMPACT and COUNTRY in words while event names keep room to read; the
|
|
93
|
+
// short labels otherwise, with the word on hover where there is one.
|
|
94
|
+
const spelled = roomBeside(kept, times, timesWidth)(spelledImpactWidth, spelledCountryWidth) >= SPELLED_HEADER_MIN_EVENT_WIDTH;
|
|
95
|
+
const impactColumn = spelled
|
|
96
|
+
? { label: SPELLED_IMPACT, width: spelledImpactWidth }
|
|
97
|
+
: { label: "IMP", width: 4, title: "Impact" };
|
|
98
|
+
const countryColumn = spelled
|
|
99
|
+
? { label: SPELLED_COUNTRY, width: spelledCountryWidth }
|
|
100
|
+
: { label: "CTY", width: Math.max(3, codeWidth), title: "Country" };
|
|
101
|
+
const eventRoom = (columns: readonly EconCalendarColumn[]) =>
|
|
102
|
+
roomBeside(columns, times, timesWidth)(tableColumnWidth(impactColumn), tableColumnWidth(countryColumn));
|
|
103
|
+
const leading = (eventWidth: number): EconCalendarColumn[] => [
|
|
104
|
+
{ id: "time", label: timeLabelText, width: timeWidth, align: "left" },
|
|
105
|
+
...withReader ? [{ id: "readerTime" as const, label: readerLabel!, width: readerWidth, align: "left" as const, title: readerZone! }] : [],
|
|
106
|
+
...showImpact ? [{ id: "impact" as const, ...impactColumn, align: "left" as const }] : [],
|
|
107
|
+
...showCountry ? [{ id: "country" as const, ...countryColumn, align: "left" as const }] : [],
|
|
108
|
+
// The names take any room the pane has past these widths too: the desktop and the web otherwise spread it over
|
|
109
|
+
// every column, figures among them, while the names stay cut.
|
|
110
|
+
{ id: "event", label: "EVENT", width: eventWidth, align: "left", flexGrow: 1 },
|
|
111
|
+
];
|
|
112
|
+
return { kept, eventRoom, leading };
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const figureColumns = figureColumnsFor(actualNote);
|
|
116
|
+
const longestName = longestEventName(events, showCountry);
|
|
117
|
+
const shown = layout(figureColumns, longestName, actualNote);
|
|
118
|
+
// Then the names have what a long figure weeks out took, up to the longest of them: the figure is cut, not every name.
|
|
119
|
+
const figures = figuresBesideNames(shown.kept, shown.eventRoom, longestName, minEventWidth, actualNote);
|
|
120
|
+
const leading = shown.leading(Math.max(minEventWidth, shown.eventRoom(figures)));
|
|
121
|
+
// Export CSV writes the columns it always did, decided at the figures' own widths and the names as the source
|
|
122
|
+
// writes them: a row awaiting its figure, which widens ACT in the table, never takes the reader's clock from the file.
|
|
123
|
+
const filedFigures = figureColumnsFor(0);
|
|
124
|
+
const filed = layout(filedFigures, longestEventName(events), 0);
|
|
125
|
+
return {
|
|
126
|
+
columns: markHiddenTableColumns([...leading, ...figureColumns], [...leading, ...figures]),
|
|
127
|
+
exportColumns: [...filed.leading(Math.max(minEventWidth, filed.eventRoom(filed.kept))), ...filedFigures],
|
|
128
|
+
// Where those columns keep every figure, the file follows the order the reader left the table's columns in,
|
|
129
|
+
// as the table's own export does; where they leave one out, it writes the pane's own order.
|
|
130
|
+
exportInReaderOrder: filed.kept.length === filedFigures.length,
|
|
131
|
+
};
|
|
132
|
+
}
|