@gloom-sh/terminal 0.20.21 → 0.20.22
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/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/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 +35 -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/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-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 +136 -73
- 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 +14 -15
- 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/pane-functions/catalog-snapshot.json +26 -22
- package/src/cli/pane-functions/catalog.ts +6 -2
- package/src/cli/pane-functions/dom.ts +8 -5
- package/src/cli/pane-functions/function-help.ts +34 -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 +1 -1
- 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 +18 -2
- 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/visible-key-values.ts +3 -2
- 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/curve/model.ts +4 -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 +50 -8
- package/src/components/feed-data-table/stack-view.tsx +3 -0
- package/src/components/index.ts +3 -3
- package/src/components/layout/floating-pane.tsx +5 -2
- package/src/components/layout/pane/header.tsx +21 -2
- 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/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 +57 -15
- package/src/components/ui/data-table/opentui/index.tsx +5 -0
- package/src/components/ui/data-table/types.ts +96 -5
- package/src/components/ui/data-table/visible-range.ts +9 -1
- package/src/components/ui/day-cell.ts +30 -0
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/prose.tsx +3 -1
- package/src/components/ui/table-layout.ts +188 -6
- package/src/core/state/app/layout.ts +7 -2
- package/src/core/state/app/state.ts +6 -2
- 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 +76 -11
- package/src/data/sqlite/checkpointer.ts +73 -10
- package/src/data/sqlite/database.ts +14 -1
- package/src/data/sqlite/retry.ts +1 -1
- package/src/docs/load.ts +5 -2
- package/src/docs/snapshot.json +1648 -4396
- package/src/i18n/es.ts +108 -0
- package/src/i18n/index.ts +74 -4
- package/src/i18n/ja.ts +108 -0
- package/src/i18n/ko.ts +108 -0
- package/src/i18n/react.ts +10 -2
- package/src/i18n/zh-cn.ts +108 -0
- package/src/i18n/zh-tw.ts +108 -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 +37 -33
- 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/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/regular-session-valuation.ts +6 -0
- 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 +74 -33
- 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 +10 -3
- 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/controller/draft-sync.ts +13 -7
- package/src/plugins/builtin/chat/controller/state.ts +4 -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/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 +47 -7
- 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/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/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/headless.ts +24 -15
- package/src/plugins/builtin/dividend-yield/index.tsx +2 -1
- package/src/plugins/builtin/dividend-yield/model.ts +8 -5
- package/src/plugins/builtin/dividend-yield/pane.tsx +20 -11
- 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/view.ts +36 -10
- 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 +72 -3
- package/src/plugins/builtin/econ/index.tsx +9 -21
- 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 +63 -0
- package/src/plugins/builtin/holders/disclosures.ts +33 -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 +208 -47
- package/src/plugins/builtin/ipo-calendar/pane.tsx +87 -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 +3 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -1
- 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 +1 -1
- 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/table.tsx +15 -4
- 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/pane.tsx +2 -1
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/headless.ts +19 -12
- package/src/plugins/builtin/perps/model.ts +4 -3
- package/src/plugins/builtin/portfolio-list/cached-account.ts +3 -1
- 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 +138 -0
- package/src/plugins/builtin/research/event-detail.tsx +442 -0
- package/src/plugins/builtin/research/event-model.ts +328 -31
- 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 +20 -8
- package/src/plugins/builtin/research/relative-valuation-headless.ts +8 -4
- 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/headless.ts +2 -0
- package/src/plugins/builtin/scanner/lock-note.ts +5 -9
- package/src/plugins/builtin/sec/exchange-filings.ts +44 -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 +129 -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/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 +36 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +172 -39
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +62 -8
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +64 -10
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +67 -32
- package/src/plugins/builtin/ticker-detail/headless.ts +33 -12
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +75 -14
- package/src/plugins/builtin/ticker-detail/overview/model.ts +26 -20
- 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 +45 -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/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/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/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/i18n.ts +3 -2
- package/src/renderers/dom/css.d.ts +1 -0
- package/src/renderers/dom/data-table/index.tsx +60 -8
- package/src/renderers/dom/data-table/row.tsx +1 -1
- package/src/renderers/electrobun/bun/desktop/backend.ts +12 -1
- 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/sources/gloomberb-cloud/batched-lookups.ts +12 -1
- package/src/sources/gloomberb-cloud/index.ts +36 -3
- package/src/sources/gloomberb-cloud/normalizers.ts +1 -0
- package/src/sources/provider-router/financials.ts +4 -4
- package/src/sources/provider-router/index.ts +9 -1
- package/src/state/app/context/index.tsx +12 -4
- 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/test-support/cloud-api.ts +34 -0
- package/src/test-support/strict-table-capture.tsx +83 -0
- package/src/tickers/search/index.ts +23 -7
- 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/fundamentals/current-valuation.ts +22 -5
- package/src/time-series/fundamentals/history-link.ts +25 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +50 -5
- 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/types/config.ts +13 -61
- package/src/types/data-provider.ts +8 -0
- package/src/types/financials.ts +49 -6
- package/src/types/headless.ts +30 -0
- package/src/types/plugin-context.ts +8 -1
- package/src/utils/crypto-pair.ts +10 -0
- package/src/utils/day-format.ts +104 -0
- package/src/utils/exchange-announcements.ts +35 -12
- 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/trailing-dividend.ts +47 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +0 -771
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react";
|
|
2
2
|
import type { PluginModule } from "../plugin-module";
|
|
3
3
|
import type { SecFilingDocument, SecFilingItem } from "../../../types/data-provider";
|
|
4
|
+
import { apiClient } from "../../../api-client";
|
|
5
|
+
import { useAsyncResource } from "../../../public/react";
|
|
6
|
+
import { EXCHANGE_FILING_HISTORY_LIMIT, exchangeFilingForm, localFilingListing, localFilingRows, PRESENTATIONS_FORM } from "./exchange-filings";
|
|
4
7
|
import { useResolvedEntryValue, useSecFilingDocuments, useSecFilingsQuery, useTickerFinancials } from "../../../market-data/hooks";
|
|
5
8
|
import { getSharedMarketDataCoordinator } from "../../../market-data/coordinator";
|
|
6
9
|
import { useShortcut } from "../../../react/input";
|
|
@@ -9,13 +12,14 @@ import { logFailure } from "../../../utils/log-failure";
|
|
|
9
12
|
import { instrumentFromTicker } from "../../../market-data/request-types";
|
|
10
13
|
import { useDebouncedPluginPaneState, usePluginAppActions, usePluginPaneState } from "../../runtime";
|
|
11
14
|
import { usePaneSettingValue } from "../../../state/app/context";
|
|
12
|
-
import { Box, Text, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
15
|
+
import { Box, Text, useRendererHost, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
13
16
|
import { FILL_REST } from "../../../components/ui/fill";
|
|
14
17
|
import { t, tf } from "../../../i18n";
|
|
15
18
|
import { EmptyState, ExternalLinkText, FeedDataTableStackView, PaneLinkMenu, QueryBar, Spinner, TickerBadgeList, usePaneNoticeFooter, useTableLoadMore, type FeedDataTableItem, type FeedDataTableTimeColumn, type PaneHint, type QueryBarFilter } from "../../../components";
|
|
16
19
|
import { useCompanyDataFooter } from "../../../components/layout/pane/status-footer";
|
|
17
20
|
import { displayWidth } from "../../../utils/format";
|
|
18
21
|
import { formatFilingDate } from "../../../utils/datetime-format";
|
|
22
|
+
import { formatDaysInText, isoDaysInText } from "../../../utils/day-format";
|
|
19
23
|
import type { DetailFact } from "../../../components/reader/detail-reader";
|
|
20
24
|
import type { ThemeColors } from "../../../theme/colors";
|
|
21
25
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
@@ -183,7 +187,10 @@ function toFeedItems(
|
|
|
183
187
|
openStories: { accession: string; stories: readonly FilingStory[]; open: (story: FilingStory) => void } | null = null,
|
|
184
188
|
): FeedDataTableItem[] {
|
|
185
189
|
// A Form 144 names its seller freely; the insider forms read beside it say which way round.
|
|
186
|
-
const knownOwners = filings.flatMap((filing) =>
|
|
190
|
+
const knownOwners = filings.flatMap((filing) => [
|
|
191
|
+
...ownerNames(filing.form, contentCache.get(filing.accessionNumber)),
|
|
192
|
+
...(filing.form4?.ownerName ? [filing.form4.ownerName] : []),
|
|
193
|
+
]);
|
|
187
194
|
return filings.map((filing) => {
|
|
188
195
|
const displayTitle = getFilingDisplayTitle(filing);
|
|
189
196
|
const acceptedAt = secReportedAcceptance(filing);
|
|
@@ -246,12 +253,16 @@ function toFeedItems(
|
|
|
246
253
|
: []),
|
|
247
254
|
];
|
|
248
255
|
|
|
256
|
+
// A ticker shared by several filers names the filer on each row. A period end or fund year reads day first
|
|
257
|
+
// and exports as its ISO day.
|
|
258
|
+
const title = formatDaysInText(showIssuer && filing.companyName ? `${filing.companyName}: ${summary}` : summary);
|
|
259
|
+
const titleValue = isoDaysInText(title);
|
|
249
260
|
return {
|
|
250
261
|
id: filing.accessionNumber,
|
|
251
262
|
eyebrow: filing.form,
|
|
252
263
|
eyebrowColor: toneColor(filingTone(filing, direction), colors),
|
|
253
|
-
|
|
254
|
-
|
|
264
|
+
title,
|
|
265
|
+
...(titleValue !== title ? { titleValue } : {}),
|
|
255
266
|
timestamp: filing.filingDate,
|
|
256
267
|
detailTitle: enrichedTitle,
|
|
257
268
|
detailFacts: facts,
|
|
@@ -339,16 +350,23 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
339
350
|
);
|
|
340
351
|
// The fund view (ETF) has its own groups; each view keeps its own choice.
|
|
341
352
|
const groups = forms ? FUND_FORM_GROUPS : COMPANY_FORM_GROUPS;
|
|
353
|
+
const local = ticker && !forms && eligibleTicker ? localFilingListing(ticker.metadata.ticker, ticker.metadata.exchange) : null;
|
|
354
|
+
const localSymbol = local?.symbol;
|
|
355
|
+
const localVenue = local?.exchange;
|
|
356
|
+
const localForm = exchangeFilingForm(localVenue);
|
|
342
357
|
const [storedGroup, setFormGroup] = usePluginPaneState<string>(forms ? "fundFormGroup" : "formGroup", ALL_FORMS);
|
|
343
|
-
const
|
|
358
|
+
const localKind = localForm && localForm.value === storedGroup ? localForm.kind : undefined;
|
|
359
|
+
const presentations = localKind === PRESENTATIONS_FORM;
|
|
360
|
+
const formGroup = localKind || groups.some((group) => group.value === storedGroup) ? storedGroup : ALL_FORMS;
|
|
344
361
|
// A ticker can map to more than one filer (CIK); each can be listed alone.
|
|
345
362
|
const issuers = useMemo(() => secFilingIssuers(formFilings), [formFilings]);
|
|
346
363
|
const [storedIssuer, setIssuer] = usePluginPaneState<string>("issuerCik", ALL_FORMS);
|
|
347
364
|
const issuerCik = issuers.some((issuer) => issuer.cik === storedIssuer) ? storedIssuer : ALL_FORMS;
|
|
348
365
|
const scopedFilings = useMemo(() => {
|
|
366
|
+
if (localKind) return NO_FILINGS;
|
|
349
367
|
const grouped = filterFilingsByGroup(formFilings, groups, formGroup);
|
|
350
368
|
return issuerCik === ALL_FORMS ? grouped : grouped.filter((filing) => filing.cik === issuerCik);
|
|
351
|
-
}, [formFilings, formGroup, groups, issuerCik]);
|
|
369
|
+
}, [formFilings, formGroup, groups, issuerCik, localKind]);
|
|
352
370
|
// A bank files a pricing supplement for each note it sells, hundreds a week, which bury its
|
|
353
371
|
// reports; they stay out until asked for, counted among the filings the other filters keep.
|
|
354
372
|
const [showSupplements, setShowSupplements] = usePluginPaneState<boolean>("pricingSupplements", false);
|
|
@@ -359,39 +377,58 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
359
377
|
() => (showSupplements || supplementCount === 0 ? scopedFilings : scopedFilings.filter((filing) => !isSupplement(filing))),
|
|
360
378
|
[isSupplement, scopedFilings, showSupplements, supplementCount],
|
|
361
379
|
);
|
|
380
|
+
const host = useRendererHost();
|
|
381
|
+
const readLocal = useCallback(() => apiClient.getCloudExchangeAnnouncements({
|
|
382
|
+
symbol: localSymbol!,
|
|
383
|
+
exchange: localVenue!,
|
|
384
|
+
limit: localKind || localVenue === "JPX" ? EXCHANGE_FILING_HISTORY_LIMIT : 50,
|
|
385
|
+
...(localKind ? { kind: localKind } : {}),
|
|
386
|
+
}), [localSymbol, localVenue, localKind]);
|
|
387
|
+
const localFeed = useAsyncResource(localSymbol && localVenue ? readLocal : null);
|
|
388
|
+
const localRows = useMemo(() => localFeed.data && localVenue && (localKind || (formGroup === ALL_FORMS && issuerCik === ALL_FORMS))
|
|
389
|
+
? localFilingRows(localFeed.data, showSupplements) : [], [localFeed.data, localVenue, formGroup, issuerCik, localKind, showSupplements]);
|
|
390
|
+
|
|
391
|
+
const openLocal = localRows.find(row => `exchange:${row.url}` === openItemId);
|
|
392
|
+
const timeline = useMemo(() => {
|
|
393
|
+
const sec = filings.map(filing => ({ id: filing.accessionNumber, date: +new Date(filing.filingDate), filing }));
|
|
394
|
+
if (!localRows.length) return sec;
|
|
395
|
+
return [...sec, ...localRows.map(row => ({ id: `exchange:${row.url}`, date: Date.parse(row.filedAt), filing: null }))]
|
|
396
|
+
.sort((a, b) => b.date - a.date);
|
|
397
|
+
}, [filings, localRows]);
|
|
362
398
|
const filterHistoryCapped = !!forms && issuerFilings.length >= SEC_FILING_FETCH_LIMIT;
|
|
363
399
|
const [visibleCount, setVisibleCount] = useState(SEC_FILING_PAGE_SIZE);
|
|
364
|
-
const
|
|
400
|
+
const visible = useMemo(() => timeline.slice(0, visibleCount), [timeline, visibleCount]);
|
|
401
|
+
const visibleFilings = useMemo(() => visible.flatMap(item => item.filing ? [item.filing] : []), [visible]);
|
|
365
402
|
const scrollRef = useRef<ScrollBoxRenderable | null>(null);
|
|
366
403
|
const loadMore = useTableLoadMore(
|
|
367
404
|
scrollRef,
|
|
368
|
-
visibleCount <
|
|
369
|
-
() => setVisibleCount((current) => Math.min(
|
|
405
|
+
visibleCount < timeline.length,
|
|
406
|
+
() => setVisibleCount((current) => Math.min(timeline.length, current + SEC_FILING_PAGE_SIZE)),
|
|
370
407
|
);
|
|
371
408
|
useEffect(() => {
|
|
372
409
|
setVisibleCount(SEC_FILING_PAGE_SIZE);
|
|
373
410
|
}, [ticker?.metadata.ticker, ticker?.metadata.exchange, formsSetting, formGroup, issuerCik, showSupplements]);
|
|
374
|
-
const loading = filingsEntry?.phase === "loading" || filingsEntry?.phase === "refreshing";
|
|
411
|
+
const loading = !localKind && (filingsEntry?.phase === "loading" || filingsEntry?.phase === "refreshing");
|
|
375
412
|
// A restored or shared open filing can sit past the first page, or be gone
|
|
376
413
|
// from the feed entirely.
|
|
377
414
|
useEffect(() => {
|
|
378
|
-
if (!openItemId ||
|
|
379
|
-
const index =
|
|
415
|
+
if (!openItemId || !timeline.length) return;
|
|
416
|
+
const index = timeline.findIndex(item => item.id === openItemId);
|
|
380
417
|
if (index < 0) {
|
|
381
418
|
// A pricing supplement opened from the command bar shows the supplements rather than closing.
|
|
382
419
|
const supplement = !showSupplements && scopedFilings.some((filing) => filing.accessionNumber === openItemId && isSupplement(filing));
|
|
383
420
|
if (supplement) setShowSupplements(true);
|
|
384
|
-
else if (!loading) setOpenItemId(null);
|
|
421
|
+
else if (!loading && !localFeed.loading) setOpenItemId(null);
|
|
385
422
|
return;
|
|
386
423
|
}
|
|
387
424
|
if (index >= visibleCount) {
|
|
388
425
|
setVisibleCount(Math.ceil((index + 1) / SEC_FILING_PAGE_SIZE) * SEC_FILING_PAGE_SIZE);
|
|
389
426
|
}
|
|
390
|
-
}, [
|
|
391
|
-
const error = filingsEntry?.error && filingsEntry.error.reasonCode !== "NO_DATA" ? filingsEntry.error.message : null;
|
|
427
|
+
}, [timeline, isSupplement, loading, localFeed.loading, openItemId, scopedFilings, setOpenItemId, setShowSupplements, showSupplements, visibleCount]);
|
|
428
|
+
const error = !localKind && filingsEntry?.error && filingsEntry.error.reasonCode !== "NO_DATA" ? filingsEntry.error.message : null;
|
|
392
429
|
// Hosted, the only filings source is Gloom Cloud, which needs an account.
|
|
393
430
|
const cloudSession = useResearchCloudSession();
|
|
394
|
-
const authWall = formFilings.length === 0 && isCloudSessionRequired(error);
|
|
431
|
+
const authWall = !localFeed.loading && !localRows.length && (!!localKind || formFilings.length === 0) && (isCloudSessionRequired(error) || isCloudSessionRequired(localFeed.error));
|
|
395
432
|
|
|
396
433
|
const openFiling = openItemId
|
|
397
434
|
? filings.find((filing) => filing.accessionNumber === openItemId) ?? null
|
|
@@ -418,21 +455,21 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
418
455
|
// in their text, so the ones around the cursor are read after it, one at a
|
|
419
456
|
// time, for their rows; the rest of the list is never queued, which would
|
|
420
457
|
// fire dozens of requests for rows nobody looks at. Read text is cached.
|
|
421
|
-
const selectedFiling =
|
|
458
|
+
const selectedFiling = visible[selectedIdx]?.filing;
|
|
422
459
|
// The rows on screen, as a share of the list so it holds for terminal rows and desktop pixels alike.
|
|
423
460
|
const [onScreen, setOnScreen] = useState({ first: 0, count: height });
|
|
424
461
|
const trackScroll = useCallback(() => {
|
|
425
462
|
loadMore();
|
|
426
463
|
const box = scrollRef.current;
|
|
427
|
-
if (!box?.viewport || !(box.scrollHeight > 0) ||
|
|
428
|
-
const first = Math.floor((box.scrollTop / box.scrollHeight) *
|
|
429
|
-
const count = Math.ceil((box.viewport.height / box.scrollHeight) *
|
|
464
|
+
if (!box?.viewport || !(box.scrollHeight > 0) || visible.length === 0) return;
|
|
465
|
+
const first = Math.floor((box.scrollTop / box.scrollHeight) * visible.length);
|
|
466
|
+
const count = Math.ceil((box.viewport.height / box.scrollHeight) * visible.length) + 1;
|
|
430
467
|
setOnScreen((current) => (current.first === first && current.count === count ? current : { first, count }));
|
|
431
|
-
}, [loadMore,
|
|
468
|
+
}, [loadMore, visible.length]);
|
|
432
469
|
const nearbyOwnership = useMemo(() => [
|
|
433
470
|
...(selectedFiling ? [selectedFiling] : []),
|
|
434
|
-
...
|
|
435
|
-
].map(rowSummaryTarget).filter((target): target is SecFilingItem => !!target), [onScreen, selectedFiling,
|
|
471
|
+
...visible.slice(onScreen.first, onScreen.first + Math.min(OWNERSHIP_ROWS_READ, onScreen.count)).flatMap(item => item.filing ? [item.filing] : []),
|
|
472
|
+
].map(rowSummaryTarget).filter((target): target is SecFilingItem => !!target), [onScreen, selectedFiling, visible]);
|
|
436
473
|
const viewedTargets = useMemo(() => [
|
|
437
474
|
...(openFiling ? [openFiling] : []),
|
|
438
475
|
...buildInlineFilingContentTargets(openFiling, openDocuments),
|
|
@@ -477,6 +514,7 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
477
514
|
useShortcut((event) => {
|
|
478
515
|
if (!isPlainKey(event, "r")) return;
|
|
479
516
|
refresh();
|
|
517
|
+
if (localVenue) localFeed.reload();
|
|
480
518
|
if (forms && eligibleTicker) reloadFacts();
|
|
481
519
|
}, { enabled: focused, scope: "sec" });
|
|
482
520
|
// Signing in must retry the request the wall was shown for.
|
|
@@ -487,11 +525,12 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
487
525
|
refresh();
|
|
488
526
|
}, [cloudSession.requestKey, refresh]);
|
|
489
527
|
|
|
528
|
+
const itemCount = visible.length;
|
|
490
529
|
useEffect(() => {
|
|
491
|
-
if (
|
|
492
|
-
setSelectedIdx(Math.max(0,
|
|
530
|
+
if (itemCount > 0 && selectedIdx >= itemCount) {
|
|
531
|
+
setSelectedIdx(Math.max(0, itemCount - 1));
|
|
493
532
|
}
|
|
494
|
-
}, [selectedIdx, setSelectedIdx,
|
|
533
|
+
}, [selectedIdx, setSelectedIdx, itemCount]);
|
|
495
534
|
|
|
496
535
|
// The pane's own ticker opens its description; a fund or equity both have one.
|
|
497
536
|
const issuerTicker = useMemo(() => (ticker && paneType ? {
|
|
@@ -506,27 +545,29 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
506
545
|
registrationId: "sec",
|
|
507
546
|
focused,
|
|
508
547
|
// A current report links its press release, where its figures are, when its index names one.
|
|
509
|
-
url: openFiling ? openFiling.pressReleaseUrl ?? openFiling.filingUrl
|
|
510
|
-
|
|
511
|
-
|
|
548
|
+
url: openLocal ? openLocal.url : openFiling ? openFiling.pressReleaseUrl ?? openFiling.filingUrl
|
|
549
|
+
: factsUrl ?? abroadPage ?? (localKind ? localFeed.data?.page : null) ?? announcements?.url,
|
|
550
|
+
source: openLocal ? openLocal.source : openFiling ? openFiling.form : facts?.covered ? listNames(fundFactPublishers(facts)) : facts?.note ? facts.note.filing.form : announcements?.name ?? null,
|
|
551
|
+
label: openLocal ? "filing" : openFiling ? openFiling.pressReleaseUrl ? "press release" : "filing"
|
|
512
552
|
: factsUrl ? "source" : abroadPage ? "issuer page" : announcements ? "announcements" : "filing",
|
|
513
553
|
// Rows read in the background for their insiders do not hold up the pane.
|
|
514
|
-
loading: loading || loadingDocuments || (!!loadingKey && viewedTargets.some((target) => target.accessionNumber === loadingKey)),
|
|
515
|
-
error: authWall ? null : error ?? detailError,
|
|
554
|
+
loading: loading || localFeed.loading || loadingDocuments || (!!loadingKey && viewedTargets.some((target) => target.accessionNumber === loadingKey)),
|
|
555
|
+
error: authWall ? null : error ?? detailError ?? localFeed.error,
|
|
556
|
+
stale: !!localKind && localFeed.data?.stale === true,
|
|
516
557
|
hints,
|
|
517
|
-
showOpenHint: !!(openFiling ? openFiling.filingUrl : factsUrl ?? abroadPage ?? announcements),
|
|
558
|
+
showOpenHint: !!openLocal || !!(openFiling ? openFiling.filingUrl : factsUrl ?? abroadPage ?? announcements),
|
|
518
559
|
});
|
|
519
560
|
|
|
520
561
|
// A foreign line's filings are its company's, read from the home line.
|
|
521
562
|
useCompanyDataFooter(issuerFilings[0]?.companyFrom, !openFiling);
|
|
522
563
|
usePaneNoticeFooter({
|
|
523
564
|
registrationId: "sec:form-filter",
|
|
524
|
-
notices: filterHistoryCapped
|
|
565
|
+
notices: (localRows.length || localKind) && localFeed.data?.coverage ? [localFeed.data.coverage] : filterHistoryCapped
|
|
525
566
|
? [`Only the ${SEC_FILING_FETCH_LIMIT.toLocaleString("en-US")} most recent filings of this issuer were searched; older fund filings are not listed.`]
|
|
526
567
|
: [],
|
|
527
568
|
focused,
|
|
528
569
|
enabled: !openFiling,
|
|
529
|
-
title: "Fund filings",
|
|
570
|
+
title: localKind ? localForm?.label : "Fund filings",
|
|
530
571
|
});
|
|
531
572
|
|
|
532
573
|
const queryFilters = useMemo<QueryBarFilter[]>(() => [
|
|
@@ -535,10 +576,14 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
535
576
|
label: "Form",
|
|
536
577
|
value: formGroup,
|
|
537
578
|
defaultValue: ALL_FORMS,
|
|
538
|
-
options: [
|
|
579
|
+
options: [
|
|
580
|
+
{ value: ALL_FORMS, label: forms ? "All fund forms" : "All forms" },
|
|
581
|
+
...(localForm ? [{ value: localForm.value, label: localForm.label }] : []),
|
|
582
|
+
...groups.map((group) => ({ value: group.value, label: group.label })),
|
|
583
|
+
],
|
|
539
584
|
onChange: (value: string) => { setFormGroup(value); setSelectedIdx(0, { immediate: true }); setOpenItemId(null); },
|
|
540
585
|
},
|
|
541
|
-
...(issuers.length > 1 ? [{
|
|
586
|
+
...(!localKind && issuers.length > 1 ? [{
|
|
542
587
|
id: "issuer",
|
|
543
588
|
label: "Filer",
|
|
544
589
|
value: issuerCik,
|
|
@@ -555,9 +600,9 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
555
600
|
defaultValue: false,
|
|
556
601
|
onChange: (value: boolean) => { setShowSupplements(value); setSelectedIdx(0, { immediate: true }); setOpenItemId(null); },
|
|
557
602
|
}] : []),
|
|
558
|
-
], [formGroup, forms, groups, issuerCik, issuers, setFormGroup, setIssuer, setOpenItemId, setSelectedIdx, setShowSupplements, showSupplements, supplementCount]);
|
|
603
|
+
], [formGroup, forms, groups, issuerCik, issuers, localForm, localKind, setFormGroup, setIssuer, setOpenItemId, setSelectedIdx, setShowSupplements, showSupplements, supplementCount]);
|
|
559
604
|
// The ticker and the filer once, beside the filters: every row is their filing.
|
|
560
|
-
const issuerMeta = issuers.length === 1 ? secIssuerLabel(issuers[0]!).replace(/CIK 0+/, "CIK ") : undefined;
|
|
605
|
+
const issuerMeta = !localKind && issuers.length === 1 ? secIssuerLabel(issuers[0]!).replace(/CIK 0+/, "CIK ") : undefined;
|
|
561
606
|
const queryBar = (
|
|
562
607
|
<QueryBar
|
|
563
608
|
width={width}
|
|
@@ -605,10 +650,11 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
605
650
|
)
|
|
606
651
|
: body;
|
|
607
652
|
if (authWall) return withFacts(<SignInWall placement="sec-signin" action="view SEC filings" needsVerification={cloudSession.needsVerification} />);
|
|
608
|
-
if (loading && filings.length === 0) return withFacts(<Spinner label="Loading SEC filings..." />);
|
|
653
|
+
if (!localForm && (loading || localFeed.loading) && filings.length === 0 && !localRows.length) return withFacts(<Spinner label="Loading SEC filings..." />);
|
|
609
654
|
// The fund view keeps its facts and query bar over an empty or failed filings list, which says why in the table.
|
|
610
|
-
|
|
611
|
-
if (!forms && formFilings.length === 0) {
|
|
655
|
+
const feedError = localFeed.error ?? error;
|
|
656
|
+
if (!forms && !localForm && feedError && formFilings.length === 0 && !localRows.length) return <EmptyState title="Filings unavailable." message={feedError} />;
|
|
657
|
+
if (!forms && !localForm && formFilings.length === 0 && !localRows.length) {
|
|
612
658
|
// A company from abroad that files nothing with the SEC says so and links its exchange's announcements, as `filings` does.
|
|
613
659
|
if (equityAbroad) {
|
|
614
660
|
const listing = { symbol: parsePublicTickerKey(ticker.metadata.ticker).symbol, exchange: equityAbroad, name: ticker.metadata.name ?? null };
|
|
@@ -632,39 +678,61 @@ function SecView({ width, height, focused, paneType }: { width: number; height:
|
|
|
632
678
|
);
|
|
633
679
|
}
|
|
634
680
|
|
|
681
|
+
const secItems = toFeedItems(
|
|
682
|
+
colors,
|
|
683
|
+
issuerTicker,
|
|
684
|
+
issuers.length > 1 && issuerCik === ALL_FORMS,
|
|
685
|
+
visibleFilings,
|
|
686
|
+
openFiling?.accessionNumber,
|
|
687
|
+
contentCache,
|
|
688
|
+
loadingContent,
|
|
689
|
+
openDocuments,
|
|
690
|
+
loadingDocuments,
|
|
691
|
+
documentsError,
|
|
692
|
+
contentErrors,
|
|
693
|
+
previews,
|
|
694
|
+
storyLinks,
|
|
695
|
+
);
|
|
696
|
+
let items = secItems;
|
|
697
|
+
if (localRows.length) {
|
|
698
|
+
const byId = new Map(secItems.map(item => [item.id, item]));
|
|
699
|
+
for (const row of localRows) {
|
|
700
|
+
const id = `exchange:${row.url}`;
|
|
701
|
+
byId.set(id, { id, title: row.filing, timestamp: row.filedAt, eyebrow: row.source,
|
|
702
|
+
detailFacts: [{ label: row.dateBasis === "catalogue" ? "Catalogue date" : "Filed", value: formatFilingDate(row.filedAt) },
|
|
703
|
+
{ label: "Document", value: row.source, link: { label: "Open filing", onOpen: () => host.openExternal(row.url).catch(logFailure("sec.pane", "Open exchange filing failed")) } }],
|
|
704
|
+
detailMeta: [row.form, formatFilingDate(row.filedAt)],
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
items = visible.map(item => byId.get(item.id)!);
|
|
708
|
+
}
|
|
635
709
|
return (
|
|
636
710
|
<FeedDataTableStackView
|
|
637
711
|
width={width}
|
|
638
712
|
height={height}
|
|
639
713
|
focused={focused}
|
|
640
|
-
items={
|
|
641
|
-
colors,
|
|
642
|
-
issuerTicker,
|
|
643
|
-
issuers.length > 1 && issuerCik === ALL_FORMS,
|
|
644
|
-
visibleFilings,
|
|
645
|
-
openFiling?.accessionNumber,
|
|
646
|
-
contentCache,
|
|
647
|
-
loadingContent,
|
|
648
|
-
openDocuments,
|
|
649
|
-
loadingDocuments,
|
|
650
|
-
documentsError,
|
|
651
|
-
contentErrors,
|
|
652
|
-
previews,
|
|
653
|
-
storyLinks,
|
|
654
|
-
)}
|
|
714
|
+
items={items}
|
|
655
715
|
selectedIdx={selectedIdx}
|
|
656
716
|
onSelect={setSelectedIdx}
|
|
657
717
|
openItemId={openItemId}
|
|
658
718
|
onOpenItemIdChange={setOpenItemId}
|
|
659
719
|
prefetchDetail={prefetchDocuments}
|
|
660
720
|
rootBefore={factsSummary ? <Box flexDirection="column" flexShrink={0}>{queryBar}{factsSummary}</Box> : queryBar}
|
|
661
|
-
sourceLabel="Form"
|
|
721
|
+
sourceLabel={localRows.length ? "Source / form" : "Form"}
|
|
662
722
|
titleLabel="Filing"
|
|
663
|
-
timeColumn={FILED_COLUMN}
|
|
664
|
-
emptyStateTitle={
|
|
723
|
+
timeColumn={localRows.some(row => row.dateBasis === "catalogue") ? { ...FILED_COLUMN, label: "Date" } : FILED_COLUMN}
|
|
724
|
+
emptyStateTitle={presentations
|
|
725
|
+
? localFeed.loading ? "Loading presentations..."
|
|
726
|
+
: localFeed.error || localFeed.data?.stale ? "Presentation archive unavailable or incomplete."
|
|
727
|
+
: "No investor conference presentations in the past year."
|
|
728
|
+
: localForm && (loading || localFeed.loading) ? "Loading filings..."
|
|
729
|
+
: localForm && feedError ? "Filings unavailable."
|
|
730
|
+
: localKind === "results" ? "No SGX results or presentations."
|
|
731
|
+
: forms && formFilings.length === 0 ? fundEmptyTitle
|
|
665
732
|
: supplementCount > 0 && !showSupplements ? "Only pricing supplements."
|
|
666
733
|
: formGroup === ALL_FORMS ? "No SEC filings." : "No filings of these forms."}
|
|
667
|
-
emptyStateHint={
|
|
734
|
+
emptyStateHint={localForm && feedError ? feedError
|
|
735
|
+
: forms && formFilings.length === 0 ? fundEmptyHint
|
|
668
736
|
: supplementCount > 0 && !showSupplements ? "Turn on Pricing supplements to list them." : undefined}
|
|
669
737
|
scrollRef={scrollRef}
|
|
670
738
|
onBodyScrollActivity={trackScroll}
|
|
@@ -694,7 +762,7 @@ export const secModule: PluginModule = {
|
|
|
694
762
|
id: "sec-pane",
|
|
695
763
|
paneId: "sec",
|
|
696
764
|
label: "SEC",
|
|
697
|
-
description: "
|
|
765
|
+
description: "SEC filings and covered exchange disclosures for the selected ticker.",
|
|
698
766
|
keywords: ["sec", "filings", "10-k", "10-q", "8-k"],
|
|
699
767
|
shortcut: "SEC",
|
|
700
768
|
shortcutAliases: ["CF"],
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatDay } from "../../../utils/day-format";
|
|
1
2
|
import type { SecFilingItem } from "../../../types/data-provider";
|
|
2
3
|
import { secFilingItemCodes } from "../../../utils/sec";
|
|
3
4
|
import { currentReportItemNames, form4TradeText, isCurrentReportForm as isCurrentReport } from "../../../utils/sec-filings";
|
|
@@ -64,8 +65,12 @@ function periodicReportPeriod(filing: Pick<SecFilingItem, "form" | "primaryDocum
|
|
|
64
65
|
return days >= 0 && days <= 460 ? iso : null;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
/**
|
|
68
|
-
|
|
68
|
+
/**
|
|
69
|
+
* The adjacent FORM column already identifies the form. Keep its meaning here:
|
|
70
|
+
* what the filing reports, a period end day first as the pane draws it
|
|
71
|
+
* (`period ended 26 Sep 2026`), or as `day` writes it.
|
|
72
|
+
*/
|
|
73
|
+
export function getFilingColumnText(filing: SecFilingItem, day: (iso: string) => string = formatDay): string {
|
|
69
74
|
// A Form 4 Gloom Cloud read says its trade, and whose shares when they are another company's.
|
|
70
75
|
const trade = form4TradeText(filing);
|
|
71
76
|
if (trade) return trade;
|
|
@@ -75,7 +80,7 @@ export function getFilingColumnText(filing: SecFilingItem): string {
|
|
|
75
80
|
const items = isCurrentReport(filing.form) ? currentReportItemNames(filing.items) : null;
|
|
76
81
|
if (items) return /\/A$/i.test(filing.form.trim()) ? `${items} (amended)` : items;
|
|
77
82
|
const period = periodicReportPeriod(filing);
|
|
78
|
-
if (period) return `${meaning || "Report"}, period ended ${period}`;
|
|
83
|
+
if (period) return `${meaning || "Report"}, period ended ${day(period)}`;
|
|
79
84
|
return meaning || "Filing";
|
|
80
85
|
}
|
|
81
86
|
return meaning && normalizeComparableText(description) !== normalizeComparableText(meaning)
|
|
@@ -223,7 +228,8 @@ export function buildSecFilingRows(filings: readonly SecFilingItem[]) {
|
|
|
223
228
|
acceptedAtRaw: filing.acceptedAtRaw ?? null,
|
|
224
229
|
acceptanceReported: secReportedAcceptance(filing),
|
|
225
230
|
form: filing.form,
|
|
226
|
-
|
|
231
|
+
// JSON and CSV keep a period end in ISO, as they always wrote it; the text draws it day first.
|
|
232
|
+
filing: getFilingColumnText(filing, (iso) => iso),
|
|
227
233
|
items: secFilingItemCodes(filing.items),
|
|
228
234
|
accessionNumber: filing.accessionNumber,
|
|
229
235
|
primaryDocument: filing.primaryDocument ?? null,
|
|
@@ -30,6 +30,7 @@ const isOwnershipForm = (form: string) => OWNERSHIP_FORMS.test(form.trim());
|
|
|
30
30
|
export function rowSummaryTarget(filing: SecFilingItem): SecFilingItem | null {
|
|
31
31
|
const form = filing.form.trim();
|
|
32
32
|
if (!isOwnershipForm(form) && !FUND_FLOW_FORM.test(form)) return null;
|
|
33
|
+
if (/^4(?:\/A)?$/i.test(form) && filing.form4) return null;
|
|
33
34
|
if (/^[345](?:\/A)?$/i.test(form)) return filing;
|
|
34
35
|
const url = filing.primaryDocumentUrl?.replace(/\/xsl[^/]+\//, "/");
|
|
35
36
|
if (!url || url === filing.primaryDocumentUrl) return null;
|
|
@@ -69,7 +69,11 @@ export const SERIES_INVENTORY: readonly SeriesInventoryEntry[] = [
|
|
|
69
69
|
{ module: "treasury-daily", chart: "The Treasury General Account's daily closing balance", notInCatalog: "not-yet", reason: "Daily and dated, from the Daily Treasury Statement's operating cash balance table; the pane reads it with the day's cash lines, and none is registered for the composer yet." },
|
|
70
70
|
{ module: "primary-dealers", chart: "A primary dealer position's weekly net level, the sum of the release's series behind the row", notInCatalog: "not-yet", reason: "Weekly and dated, one series per row of the board; the pane reads each only when its row is selected, and none is registered for the composer yet." },
|
|
71
71
|
{ module: "short-interest", chart: "A ticker's short interest and days to cover", series: ["short-interest:*"] },
|
|
72
|
+
{ module: "short-interest", chart: "A ticker's fails to deliver by settlement date, over the price the same rows report (FTD)", notInCatalog: "not-yet", reason: "Dated per ticker and settlement date; it could be a ticker series and is not registered for the composer yet." },
|
|
73
|
+
{ module: "short-interest", chart: "A ticker's weekly ATS share of off-exchange volume (ATS)", notInCatalog: "not-yet", reason: "Weekly and dated per ticker; it could be a ticker series and is not registered for the composer yet." },
|
|
74
|
+
{ module: "insider", chart: "A ticker's weekly open-market insider buys and sales, plan trades apart, over the daily close", notInCatalog: "not-yet", reason: "Weekly and dated per ticker, summed in the pane from the filings it lists; the close is in the catalog, and the weekly totals are not registered for the composer yet." },
|
|
72
75
|
{ module: "short-volume", chart: "A ticker's daily short volume ratio", series: ["short-volume:*"] },
|
|
76
|
+
{ module: "buybacks", chart: "A Hong Kong listing's shares bought back each session, on the Exchange and elsewhere, under its closes (the ticker's own price)", series: ["buybacks:*"] },
|
|
73
77
|
{ module: "scanner", chart: "Net options premium through the session, for the market or one ticker (FLOW's Tide)", notInCatalog: "per-item", reason: "One per ticker, filter set and session, summed on request from the recorded option prints." },
|
|
74
78
|
{ module: "social-mentions", chart: "A ticker's daily posts", series: ["social-mentions:*"] },
|
|
75
79
|
{ module: "jobs", chart: "A company's open job postings", series: ["jobs:*"] },
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { scalarPoint, staticSeries } from "../../../components/chart/static/series";
|
|
2
|
+
import type { ResolvedSeries, TimeSeriesPoint } from "../../../time-series/types";
|
|
3
|
+
import { colors } from "../../../theme/colors";
|
|
4
|
+
|
|
5
|
+
const DAY_MS = 86_400_000;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* One slot per bar, oldest first, with an empty slot at each end so the outer
|
|
9
|
+
* bars sit inside the plot, as ERN's report bars do.
|
|
10
|
+
*/
|
|
11
|
+
export function slotPoints<T extends { date: string }>(bars: readonly T[], value: (bar: T) => number | null | undefined): TimeSeriesPoint[] {
|
|
12
|
+
if (!bars.length) return [];
|
|
13
|
+
const at = (date: string, days = 0) => new Date(Date.parse(`${date}T00:00:00Z`) + days * DAY_MS);
|
|
14
|
+
return [
|
|
15
|
+
scalarPoint(at(bars[0]!.date, -1), null),
|
|
16
|
+
...bars.map((bar) => scalarPoint(at(bar.date), value(bar) ?? null)),
|
|
17
|
+
scalarPoint(at(bars.at(-1)!.date, 1), null),
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A tick under each bar; where they are too close the axis drops some rather than run them together. */
|
|
22
|
+
export function slotAxis<T>(bars: readonly T[], label: (bar: T) => string, cursor: (bar: T) => string) {
|
|
23
|
+
const slots = bars.length + 1;
|
|
24
|
+
return {
|
|
25
|
+
ticks: bars.map((bar, index) => ({ label: label(bar), ratio: (index + 1) / slots })),
|
|
26
|
+
formatCursor: (ratio: number) => {
|
|
27
|
+
const bar = bars[Math.max(0, Math.min(bars.length - 1, Math.round(ratio * slots) - 1))];
|
|
28
|
+
return bar ? cursor(bar) : "";
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** How a report's EPS reads against its estimate; "eps" with no estimate to measure against, or exactly on it. */
|
|
34
|
+
function outcome(actual: number | null | undefined, estimate: number | null | undefined): "beat" | "miss" | "eps" | null {
|
|
35
|
+
if (actual == null) return null;
|
|
36
|
+
return estimate == null || actual === estimate ? "eps" : actual > estimate ? "beat" : "miss";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The beat or miss chart EVT's Earnings view and EM's Surprises draw over
|
|
41
|
+
* their reports, oldest first: each report's estimate as a muted column
|
|
42
|
+
* beside what was reported, the reported column in the beat or miss colour,
|
|
43
|
+
* so a quarter reads at a glance. A report with no estimate to measure
|
|
44
|
+
* against (or exactly on it) is the plain EPS column; one not out yet is its
|
|
45
|
+
* estimate alone. Fewer than two reports draw nothing.
|
|
46
|
+
*/
|
|
47
|
+
export function beatMissSeries<T extends { date: string }>(
|
|
48
|
+
bars: readonly T[],
|
|
49
|
+
read: { actual: (bar: T) => number | null | undefined; estimate: (bar: T) => number | null | undefined; comparable?: (bar: T) => boolean },
|
|
50
|
+
unit = "",
|
|
51
|
+
): ResolvedSeries[] {
|
|
52
|
+
if (bars.length < 2) return [];
|
|
53
|
+
const result = (bar: T) => outcome(read.actual(bar), read.comparable?.(bar) === false ? null : read.estimate(bar));
|
|
54
|
+
const reported = (id: "beat" | "miss" | "eps", label: string, color: string): ResolvedSeries => ({
|
|
55
|
+
...staticSeries(slotPoints(bars, (bar) => (result(bar) === id ? read.actual(bar) : null)),
|
|
56
|
+
{ id, label, color, style: "columns" }),
|
|
57
|
+
unit, unitGroup: "eps",
|
|
58
|
+
});
|
|
59
|
+
return [
|
|
60
|
+
{ ...staticSeries(slotPoints(bars, read.estimate), { id: "estimate", label: "Estimate", color: colors.textMuted, style: "columns" }),
|
|
61
|
+
unit, unitGroup: "eps" },
|
|
62
|
+
reported("beat", "Beat", colors.positive),
|
|
63
|
+
reported("miss", "Miss", colors.negative),
|
|
64
|
+
...(bars.some((bar) => result(bar) === "eps") ? [reported("eps", "EPS", colors.textBright)] : []),
|
|
65
|
+
];
|
|
66
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { HeadlessPaneEntry } from "../../../types/headless";
|
|
2
|
+
import { formatDaysInText, isoDaysInText } from "../../../utils/day-format";
|
|
3
|
+
|
|
4
|
+
type DayEntries = { entries: HeadlessPaneEntry[]; textEntries: HeadlessPaneEntry[] };
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A report section's figures, drawn with their days first as the pane writes
|
|
8
|
+
* them (`26 Nov 2026 00:11 UTC`): the text report prints them so
|
|
9
|
+
* (`textEntries`), while JSON and CSV keep each line's days in ISO
|
|
10
|
+
* (`2026-11-26 00:11 UTC`), as they always wrote them. A day without its
|
|
11
|
+
* year has none to read back and stays as drawn.
|
|
12
|
+
*/
|
|
13
|
+
export function dayFirstEntries(entries: HeadlessPaneEntry[]): DayEntries {
|
|
14
|
+
return {
|
|
15
|
+
entries: entries.map((entry) => entry.formatted ? { ...entry, formatted: isoDaysInText(entry.formatted) } : entry),
|
|
16
|
+
textEntries: entries,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The other way round: figures written with ISO days, which JSON and CSV keep,
|
|
22
|
+
* and the text report draws day first. `whole` names the keys whose line is a
|
|
23
|
+
* link or an identifier, left as it is.
|
|
24
|
+
*/
|
|
25
|
+
export function isoDayEntries(entries: HeadlessPaneEntry[], whole: readonly string[] = []): DayEntries {
|
|
26
|
+
return { entries, textEntries: dayFirstTextEntries(entries, whole) };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Text-report lines with each ISO day drawn first: a line's words, or a value
|
|
31
|
+
* that is words (`Stale cash history as of 2026-11-20; …`). For a section
|
|
32
|
+
* whose `textEntries` are already their own lines; `whole` as above.
|
|
33
|
+
*/
|
|
34
|
+
export function dayFirstTextEntries(entries: HeadlessPaneEntry[], whole: readonly string[] = []): HeadlessPaneEntry[] {
|
|
35
|
+
return entries.map((entry) => {
|
|
36
|
+
if (entry.key && whole.includes(entry.key)) return entry;
|
|
37
|
+
if (entry.formatted) return { ...entry, formatted: formatDaysInText(entry.formatted) };
|
|
38
|
+
const shown = typeof entry.value === "string" ? formatDaysInText(entry.value) : null;
|
|
39
|
+
return shown != null && shown !== entry.value ? { ...entry, formatted: shown } : entry;
|
|
40
|
+
});
|
|
41
|
+
}
|