@gloom-sh/terminal 0.20.20 → 0.20.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/src/api-client/data.ts +1 -1
- package/src/api-client/equity-screener.ts +17 -0
- package/src/api-client/futures-curve.ts +5 -0
- package/src/api-client/market-discovery.ts +8 -0
- package/src/api-client/members.ts +2 -0
- package/src/api-client/paths.ts +3 -0
- package/src/api-client/perps.ts +20 -0
- package/src/api-client/request.ts +53 -7
- package/src/api-client/types/filings-and-calls.ts +2 -0
- package/src/app/pane-runtime/plugin-bindings.ts +6 -4
- package/src/app/pro-welcome/model.ts +15 -11
- package/src/app/pro-welcome/row.tsx +3 -3
- package/src/app/pro-welcome/use-pro-welcome.ts +2 -2
- package/src/app/runtime/startup.ts +3 -2
- package/src/app.tsx +3 -2
- package/src/capabilities/asset-data-inputs.ts +5 -0
- package/src/capabilities/factories.ts +8 -3
- package/src/capabilities/registry.ts +1 -0
- package/src/capabilities/types.ts +1 -0
- package/src/cli/commands/market.ts +68 -35
- package/src/cli/commands/options-chain.ts +2 -2
- package/src/cli/commands/overview.ts +10 -9
- package/src/cli/commands/ticker.ts +19 -4
- package/src/cli/desktop-pane-shot.ts +11 -3
- package/src/cli/export-source.ts +35 -2
- package/src/cli/glossary.ts +3 -2
- package/src/cli/helpers.ts +2 -1
- package/src/cli/history-demergers.ts +41 -10
- package/src/cli/history-rows.ts +3 -1
- package/src/cli/known-gaps.ts +21 -7
- package/src/cli/listing-arg.ts +22 -11
- package/src/cli/pane-functions/capabilities.ts +4 -9
- package/src/cli/pane-functions/catalog-snapshot.json +29 -29
- package/src/cli/pane-functions/catalog.ts +1 -18
- package/src/cli/pane-functions/data.ts +8 -4
- package/src/cli/pane-functions/financial-ratio-shot.ts +20 -5
- package/src/cli/pane-functions/freshness.ts +57 -12
- package/src/cli/pane-functions/function-help.ts +2 -2
- package/src/cli/pane-functions/headless.ts +6 -0
- package/src/cli/pane-functions/index.ts +11 -4
- package/src/cli/pane-functions/market-session.ts +25 -0
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +75 -3
- package/src/cli/pane-functions/screenshot-bridge.ts +1 -0
- package/src/cli/pane-functions/screenshot-data-evidence.ts +1 -0
- package/src/cli/pane-functions/screenshot-payload.ts +38 -5
- package/src/cli/pane-functions/screenshot-render.ts +20 -7
- package/src/cli/perpetual-contract.ts +14 -1
- package/src/cli/report-tables.ts +11 -2
- package/src/cli/result.ts +6 -1
- package/src/components/chart-table/layout.ts +8 -4
- package/src/components/command-bar/list/model.ts +2 -0
- package/src/components/command-bar/pane-templates/items.ts +5 -25
- package/src/components/command-bar/panel/index.tsx +7 -4
- package/src/components/command-bar/routes/root/provider-search.ts +4 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/results.ts +19 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -3
- package/src/components/command-bar/routes/ticker-search/title.ts +23 -0
- package/src/components/command-bar/routing/list-state.ts +17 -5
- package/src/components/command-bar/selection-runtime.ts +3 -2
- package/src/components/command-bar/surface/index.tsx +2 -0
- package/src/components/command-bar/workflow/alert.ts +6 -4
- package/src/components/command-bar/workflow/collection-actions.ts +2 -1
- package/src/components/layout/pane/footer/index.tsx +1 -0
- package/src/components/layout/pane/footer/model.ts +20 -7
- package/src/components/layout/pane/title.ts +11 -2
- package/src/components/price-selector-dialog.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +4 -3
- package/src/components/ticker/list-table-view.tsx +12 -1
- package/src/components/ui/query-bar.tsx +20 -14
- package/src/data/cached-query.ts +20 -4
- package/src/data/news-pane-snapshots.ts +2 -1
- package/src/data/plugin-cache.ts +5 -1
- package/src/data/saved-copies.ts +68 -2
- package/src/docs/snapshot.json +65 -14
- package/src/docs/topics.ts +11 -9
- package/src/i18n/es.ts +1 -0
- package/src/i18n/ja.ts +1 -0
- package/src/i18n/ko.ts +1 -0
- package/src/i18n/zh-cn.ts +1 -0
- package/src/i18n/zh-tw.ts +1 -0
- package/src/market-data/coordinator/index.ts +25 -5
- package/src/market-data/depositary-pair.ts +27 -10
- package/src/market-data/futures-roll-returns.ts +54 -7
- package/src/market-data/fx-closes.ts +14 -0
- package/src/market-data/market/futures-product-hours.ts +113 -0
- package/src/market-data/market/futures-week.ts +2 -0
- package/src/market-data/market/globex-day.ts +9 -2
- package/src/market-data/market/status.ts +32 -25
- package/src/market-data/market/venue-session.ts +18 -0
- package/src/market-data/options-alternatives.ts +49 -7
- package/src/market-data/perpetual-open-interest.ts +41 -0
- package/src/market-data/quotes/contributions.ts +4 -2
- package/src/market-data/quotes/export-identity.ts +11 -3
- package/src/market-data/quotes/freshness.ts +3 -2
- package/src/market-data/quotes/resolution.ts +9 -2
- package/src/market-data/quotes/tick-range.ts +22 -1
- package/src/market-data/quotes/time.ts +34 -4
- package/src/market-data/split-terms.ts +3 -2
- package/src/news/aggregator.ts +1 -0
- package/src/news/news-model.ts +12 -2
- package/src/news/types.ts +15 -0
- package/src/plugins/builtin/alerts/alert-engine.ts +2 -0
- package/src/plugins/builtin/alerts/cli-forms.ts +3 -2
- package/src/plugins/builtin/alerts/cli-move.ts +5 -2
- package/src/plugins/builtin/alerts/cli.ts +50 -25
- package/src/plugins/builtin/alerts/command.ts +51 -3
- package/src/plugins/builtin/alerts/event-rows.ts +1 -1
- package/src/plugins/builtin/alerts/events-pane.tsx +1 -1
- package/src/plugins/builtin/alerts/format.ts +67 -8
- package/src/plugins/builtin/alerts/headless.ts +22 -6
- package/src/plugins/builtin/alerts/index.tsx +26 -25
- package/src/plugins/builtin/alerts/move-checks.ts +1 -0
- package/src/plugins/builtin/alerts/pane.tsx +15 -6
- package/src/plugins/builtin/alerts/pro-rules.ts +9 -4
- package/src/plugins/builtin/alerts/quotes.ts +10 -5
- package/src/plugins/builtin/alerts/session.ts +28 -0
- package/src/plugins/builtin/alerts/types.ts +1 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -1
- package/src/plugins/builtin/analytics/risk-model.ts +2 -2
- package/src/plugins/builtin/attention/headless.ts +2 -2
- package/src/plugins/builtin/attention/model.ts +7 -2
- package/src/plugins/builtin/attention/pane.tsx +2 -1
- package/src/plugins/builtin/awards/headless.ts +1 -1
- package/src/plugins/builtin/broker-trading/ticket.tsx +13 -5
- package/src/plugins/builtin/buildout/detail/company.tsx +0 -1
- package/src/plugins/builtin/buildout/detail/ui.tsx +7 -5
- package/src/plugins/builtin/buildout/model/normalizers.ts +0 -1
- package/src/plugins/builtin/buildout/model/types.ts +0 -1
- package/src/plugins/builtin/buildout/pane/index.tsx +9 -0
- package/src/plugins/builtin/buildout/pane/status.tsx +11 -0
- package/src/plugins/builtin/catalysts/headless.ts +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +14 -6
- package/src/plugins/builtin/chart-composer/pane.tsx +2 -1
- package/src/plugins/builtin/chart-composer/session-history.ts +14 -2
- package/src/plugins/builtin/chat/controller/index.ts +5 -3
- package/src/plugins/builtin/chat/controller/session-runtime.ts +18 -8
- package/src/plugins/builtin/chat/index.tsx +1 -1
- package/src/plugins/builtin/cloud/auth-actions.tsx +4 -2
- package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +4 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -1
- package/src/plugins/builtin/company-attention/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/headless.ts +1 -1
- package/src/plugins/builtin/correlation/headless.ts +3 -3
- package/src/plugins/builtin/correlation/history.ts +1 -0
- package/src/plugins/builtin/correlation/index.tsx +7 -5
- package/src/plugins/builtin/correlation/matrix/selection.ts +21 -3
- package/src/plugins/builtin/correlation/relationship/model.ts +5 -0
- package/src/plugins/builtin/correlation/relationship/pane.tsx +3 -2
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -2
- package/src/plugins/builtin/credit-documents/headless.ts +1 -1
- package/src/plugins/builtin/dividend-yield/client.ts +81 -10
- package/src/plugins/builtin/dividend-yield/headless.ts +21 -10
- package/src/plugins/builtin/dividend-yield/model.ts +1 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +9 -5
- package/src/plugins/builtin/dividend-yield/ranking.ts +15 -5
- package/src/plugins/builtin/dividend-yield/reference-price.ts +3 -0
- package/src/plugins/builtin/dividend-yield/types.ts +12 -0
- package/src/plugins/builtin/dividend-yield/view.ts +30 -7
- package/src/plugins/builtin/doe/headless.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +16 -7
- package/src/plugins/builtin/earnings-calls/data.ts +8 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +1 -1
- package/src/plugins/builtin/econ/index.tsx +26 -18
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/headless.ts +149 -31
- package/src/plugins/builtin/equity-screener/live.ts +23 -5
- package/src/plugins/builtin/equity-screener/model.ts +27 -12
- package/src/plugins/builtin/equity-screener/pane.tsx +5 -5
- package/src/plugins/builtin/exposure/headless.ts +1 -1
- package/src/plugins/builtin/exposure/holdings.ts +2 -2
- package/src/plugins/builtin/futures/index.tsx +29 -1
- package/src/plugins/builtin/futures/model.ts +93 -10
- package/src/plugins/builtin/futures/returns.ts +54 -1
- package/src/plugins/builtin/futures/table.tsx +14 -2
- package/src/plugins/builtin/futures/use-front-returns.ts +20 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -1
- package/src/plugins/builtin/futures-curve/headless.ts +9 -3
- package/src/plugins/builtin/futures-curve/model.ts +19 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +12 -6
- package/src/plugins/builtin/gpu/headless.ts +1 -1
- package/src/plugins/builtin/gpu/model.ts +1 -1
- package/src/plugins/builtin/help/function-index.ts +16 -8
- package/src/plugins/builtin/help/functions-table.tsx +6 -4
- package/src/plugins/builtin/help/shortcut-model.ts +7 -2
- package/src/plugins/builtin/holders/headless.ts +16 -5
- package/src/plugins/builtin/holders/pane.tsx +43 -5
- package/src/plugins/builtin/insider/client.ts +118 -11
- package/src/plugins/builtin/insider/filing-stories.ts +36 -20
- package/src/plugins/builtin/insider/issuer.ts +5 -2
- package/src/plugins/builtin/iv-history/headless.ts +2 -0
- package/src/plugins/builtin/macro-day/client.ts +2 -3
- package/src/plugins/builtin/macro-day/comparison.ts +58 -0
- package/src/plugins/builtin/macro-day/headless.ts +47 -3
- package/src/plugins/builtin/macro-day/index.tsx +32 -9
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/pane.tsx +99 -12
- package/src/plugins/builtin/market-heatmap/index.tsx +2 -2
- package/src/plugins/builtin/market-movers/footer.ts +29 -3
- package/src/plugins/builtin/market-movers/headless.ts +12 -5
- package/src/plugins/builtin/market-movers/index.tsx +3 -3
- package/src/plugins/builtin/market-movers/session-body.tsx +6 -3
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +6 -6
- package/src/plugins/builtin/market-valuation/pane.tsx +2 -3
- package/src/plugins/builtin/market-valuation/view.ts +6 -8
- package/src/plugins/builtin/members/client.ts +9 -2
- package/src/plugins/builtin/members/headless.ts +8 -10
- package/src/plugins/builtin/members/model.ts +29 -17
- package/src/plugins/builtin/members/pane.tsx +10 -12
- package/src/plugins/builtin/money-markets/headless.ts +1 -1
- package/src/plugins/builtin/news/headless.ts +4 -0
- package/src/plugins/builtin/news/index.tsx +3 -1
- package/src/plugins/builtin/news/wire/industry-pane.tsx +2 -1
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +1 -1
- package/src/plugins/builtin/news/wire/persisted-articles.ts +8 -4
- package/src/plugins/builtin/notes/headless.ts +7 -0
- package/src/plugins/builtin/notes/index.tsx +1 -1
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +18 -2
- package/src/plugins/builtin/options/view.tsx +7 -6
- package/src/plugins/builtin/options-positioning/headless.ts +4 -4
- package/src/plugins/builtin/options-positioning/pane.tsx +7 -3
- package/src/plugins/builtin/options-scenario/client.ts +20 -4
- package/src/plugins/builtin/options-scenario/headless.ts +1 -1
- package/src/plugins/builtin/pe-band/client.ts +5 -9
- package/src/plugins/builtin/pe-band/headless.ts +11 -13
- package/src/plugins/builtin/pe-band/model.ts +39 -60
- package/src/plugins/builtin/pe-band/pane.tsx +14 -15
- package/src/plugins/builtin/perps/equity-row.tsx +3 -1
- package/src/plugins/builtin/perps/freshness.ts +16 -9
- package/src/plugins/builtin/perps/headless.ts +4 -1
- package/src/plugins/builtin/perps/markets-section.tsx +16 -10
- package/src/plugins/builtin/perps/model.ts +33 -2
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/perps/status-line.ts +12 -3
- package/src/plugins/builtin/perps/venue-markets.ts +38 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +4 -3
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +46 -7
- package/src/plugins/builtin/portfolio-list/headless.ts +31 -8
- package/src/plugins/builtin/portfolio-list/settings.ts +3 -0
- package/src/plugins/builtin/portfolio-list/table.tsx +7 -1
- package/src/plugins/builtin/power/headless.ts +1 -1
- package/src/plugins/builtin/realized-vol/headless.ts +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +27 -13
- package/src/plugins/builtin/scanner/feed.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +8 -4
- package/src/plugins/builtin/scanner/headless.ts +57 -26
- package/src/plugins/builtin/scanner/hilo-pane.tsx +6 -3
- package/src/plugins/builtin/scanner/lock-note.ts +3 -2
- package/src/plugins/builtin/scanner/us-session.ts +9 -0
- package/src/plugins/builtin/seasonality/client.ts +46 -10
- package/src/plugins/builtin/seasonality/headless.ts +29 -11
- package/src/plugins/builtin/seasonality/model.ts +101 -24
- package/src/plugins/builtin/seasonality/pane.tsx +10 -6
- package/src/plugins/builtin/sec/filing-content.ts +13 -0
- package/src/plugins/builtin/sec/index.tsx +16 -11
- package/src/plugins/builtin/sectors/client.ts +27 -5
- package/src/plugins/builtin/sectors/headless.ts +2 -1
- package/src/plugins/builtin/sectors/index.tsx +22 -10
- package/src/plugins/builtin/shared/cloud-resource.ts +3 -3
- package/src/plugins/builtin/shared/extended-print.ts +38 -0
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +1 -1
- package/src/plugins/builtin/shared/report-freshness.ts +7 -3
- package/src/plugins/builtin/shared/scanner-capture.ts +16 -3
- package/src/plugins/builtin/shared/ticker-company.ts +17 -8
- package/src/plugins/builtin/shared/use-quote-board.ts +11 -4
- package/src/plugins/builtin/social-mentions/client.ts +7 -3
- package/src/plugins/builtin/social-mentions/outliers.tsx +9 -2
- package/src/plugins/builtin/thirteenf/api.ts +24 -3
- package/src/plugins/builtin/thirteenf/data.ts +21 -8
- package/src/plugins/builtin/thirteenf/headless.ts +7 -3
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +10 -3
- package/src/plugins/builtin/thirteenf/signals.ts +22 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -2
- package/src/plugins/builtin/ticker-detail/financials/model.ts +7 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +15 -6
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +5 -4
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +14 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +32 -26
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -3
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -5
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +14 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +9 -8
- package/src/plugins/builtin/ticker-detail/pane.tsx +16 -9
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +41 -23
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +30 -13
- package/src/plugins/builtin/ticker-detail/settings.ts +9 -2
- package/src/plugins/builtin/time-sales/headless.ts +49 -13
- package/src/plugins/builtin/time-sales/model.ts +2 -2
- package/src/plugins/builtin/time-sales/window.ts +84 -10
- package/src/plugins/builtin/vol-surface/charts.tsx +4 -2
- package/src/plugins/builtin/vol-surface/events.ts +12 -5
- package/src/plugins/builtin/vol-surface/headless.ts +1 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +15 -7
- package/src/plugins/builtin/world-indices/footer.ts +1 -1
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +27 -13
- package/src/plugins/builtin/yield-curve/client.ts +3 -1
- package/src/plugins/duplicates.ts +60 -0
- package/src/plugins/loader.ts +12 -3
- package/src/plugins/marketplace/model.ts +10 -1
- package/src/portfolio/column-values.ts +52 -5
- package/src/react/async-resource.ts +8 -7
- package/src/renderers/browser/bundled-plugins.ts +2 -1
- package/src/renderers/dom/build-assets.ts +20 -0
- package/src/renderers/dom/data-table/index.tsx +36 -2
- package/src/renderers/dom/es2023-array-methods.ts +57 -0
- package/src/renderers/dom/host/surface-fit.ts +64 -13
- package/src/renderers/dom/styles.css +6 -1
- package/src/renderers/electrobun/bun/external-plugins.ts +16 -6
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +31 -7
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +15 -8
- package/src/renderers/electrobun/view/external-plugins.ts +1 -0
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +1 -0
- package/src/series/types.ts +1 -0
- package/src/sources/gloomberb-cloud/fred-attribution.ts +6 -5
- package/src/sources/gloomberb-cloud/index.ts +42 -5
- package/src/sources/gloomberb-cloud/news.ts +15 -2
- package/src/sources/gloomberb-cloud/normalizers.ts +9 -0
- package/src/sources/history-result.ts +2 -1
- package/src/sources/history-retention.ts +14 -2
- package/src/sources/listing-symbols.ts +1 -1
- package/src/sources/provider-router/cache.ts +32 -3
- package/src/sources/provider-router/cached-routes.ts +25 -0
- package/src/sources/provider-router/connection-health.ts +1 -0
- package/src/sources/provider-router/history.ts +2 -2
- package/src/sources/provider-router/index.ts +14 -0
- package/src/sources/provider-router/sec-filings-page.ts +25 -0
- package/src/sources/sec-edgar/content.ts +67 -36
- package/src/tickers/listing-fate.ts +28 -0
- package/src/tickers/search/home-listing.ts +3 -0
- package/src/tickers/search/index-root-lead.ts +40 -0
- package/src/tickers/terminal-codes.ts +7 -4
- package/src/time-series/base-series.ts +17 -8
- package/src/time-series/fundamentals/historical-valuation.ts +2 -2
- package/src/time-series/fundamentals/series.ts +15 -12
- package/src/time-series/history-acquisition.ts +2 -0
- package/src/time-series/market.ts +3 -1
- package/src/time-series/price-comparison.ts +3 -1
- package/src/time-series/resolve-context.ts +8 -0
- package/src/time-series/resolve.ts +50 -10
- package/src/time-series/types.ts +1 -0
- package/src/time-series/use-chart-resolution.ts +2 -2
- package/src/time-series/valuation-currency.ts +40 -12
- package/src/types/data-provider.ts +30 -1
- package/src/types/financials.ts +23 -0
- package/src/types/headless.ts +23 -0
- package/src/types/instrument.ts +1 -0
- package/src/utils/crypto-pair.ts +16 -0
- package/src/utils/exchange-announcements.ts +2 -1
- package/src/utils/exchange-notation.generated.ts +58 -1
- package/src/utils/exchanges.ts +43 -1
- package/src/utils/format.ts +37 -2
- package/src/utils/function-search.ts +38 -0
- package/src/utils/fuzzy-search.ts +10 -6
- package/src/utils/option-choice.ts +15 -0
- package/src/utils/price-history.ts +15 -1
- package/src/utils/reason-codes.ts +6 -3
- package/src/utils/trailing-dividend.ts +241 -28
|
@@ -22,10 +22,12 @@ import { isLiveResizing, onLiveResizeEnd, onLiveResizeStart } from "../../../ui/
|
|
|
22
22
|
* A box that has a size of its own on the way (a fixed width, a share of the
|
|
23
23
|
* pane, a whole-cell rounding) leaves the surface on its cells on that axis,
|
|
24
24
|
* as it was, and to `useLiveStretch`'s prediction during a resize. So does a
|
|
25
|
-
* box that scrolls content larger than itself (a column of charts and text)
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* box that scrolls content larger than itself (a column of charts and text):
|
|
26
|
+
* following the frame through it would lay all of that content out on every
|
|
27
|
+
* frame. So does a sized box whose data table would be resized with it (the
|
|
28
|
+
* chart-table kit's band over its table): a table keeps the cells its pane
|
|
29
|
+
* gives it at rest, and follows the frame on its own during a resize
|
|
30
|
+
* (`trackTable`).
|
|
29
31
|
*
|
|
30
32
|
* Nothing here changes a box's size at the moment it is marked: an exact box
|
|
31
33
|
* is already the size CSS gives it, and a filled box only gains the fraction
|
|
@@ -43,6 +45,10 @@ const surfaces = new Map<HTMLElement, ResizeObserver | null>();
|
|
|
43
45
|
/** The boxes above each surface that fill at rest along with it. */
|
|
44
46
|
const boxFills = new Map<HTMLElement, Array<[HTMLElement, Axis, Mode]>>();
|
|
45
47
|
const followed = new WeakMap<HTMLElement, { x: boolean; y: boolean }>();
|
|
48
|
+
/** Tracked data tables, each with what it is told when a resize starts and stops laying it out (`trackTable`). */
|
|
49
|
+
const tables = new Map<HTMLElement, (follows: boolean) => void>();
|
|
50
|
+
/** The tables the resize under way lays out on every frame. */
|
|
51
|
+
let followingTables: Array<(follows: boolean) => void> = [];
|
|
46
52
|
let followMarks: Array<[HTMLElement, Axis]> = [];
|
|
47
53
|
let installed = false;
|
|
48
54
|
|
|
@@ -55,6 +61,9 @@ const cellOn = (axis: Axis) => (axis === "x" ? WEB_CELL_WIDTH : WEB_CELL_HEIGHT)
|
|
|
55
61
|
const SIZE = { x: "width", y: "height" } as const;
|
|
56
62
|
const FILL_ATTRIBUTE = { x: "data-gloom-fill-x", y: "data-gloom-fill-y" } as const;
|
|
57
63
|
const FOLLOW_ATTRIBUTE = { x: "data-gloom-follow-x", y: "data-gloom-follow-y" } as const;
|
|
64
|
+
/** A box above a table that follows short of its space, by what it was at rest (styles.css). */
|
|
65
|
+
const FOLLOW_SHORT = "data-gloom-follow-short-x";
|
|
66
|
+
const FOLLOW_SHORT_BY = "--gloom-follow-short-x";
|
|
58
67
|
|
|
59
68
|
interface Pass {
|
|
60
69
|
styles: Map<Element, CSSStyleDeclaration>;
|
|
@@ -341,7 +350,7 @@ function fitGrip(surface: HTMLElement): void {
|
|
|
341
350
|
|
|
342
351
|
function startFollowing(): void {
|
|
343
352
|
const pass: Pass = { styles: new Map() };
|
|
344
|
-
const marks: Array<[HTMLElement, Axis, Mode]> = [];
|
|
353
|
+
const marks: Array<[HTMLElement, Axis, Mode, number]> = [];
|
|
345
354
|
// A resize changes the parents' boxes on every frame; nothing refits until it ends.
|
|
346
355
|
for (const observer of surfaces.values()) observer?.disconnect();
|
|
347
356
|
for (const surface of surfaces.keys()) {
|
|
@@ -353,21 +362,46 @@ function startFollowing(): void {
|
|
|
353
362
|
if (!trace(pass, surface.parentElement, axis, links).follows) continue;
|
|
354
363
|
result[axis] = true;
|
|
355
364
|
// A short box fills, and so follows, already.
|
|
356
|
-
for (const [element, mode, kind] of links) if (kind === "exact") marks.push([element, axis, mode]);
|
|
365
|
+
for (const [element, mode, kind] of links) if (kind === "exact") marks.push([element, axis, mode, 0]);
|
|
357
366
|
}
|
|
358
367
|
followed.set(surface, result);
|
|
359
368
|
}
|
|
369
|
+
// A table is never filled at rest, so a short box above it follows short
|
|
370
|
+
// by the fraction of a cell it is at rest: the press moves no column.
|
|
371
|
+
for (const [table, listener] of tables) {
|
|
372
|
+
if (!table.isConnected) continue;
|
|
373
|
+
const links: Link[] = [];
|
|
374
|
+
if (!trace(pass, table, "x", links).follows) continue;
|
|
375
|
+
for (const [element, mode, kind] of links) {
|
|
376
|
+
marks.push([element, "x", mode, kind === "short" ? placement(pass, element, "x").space - (ownSize(element, "x") ?? 0) : 0]);
|
|
377
|
+
}
|
|
378
|
+
followingTables.push(listener);
|
|
379
|
+
}
|
|
360
380
|
// Marked after every surface is traced: a mark changes no size now, but the
|
|
361
381
|
// trace reads the layout as the pane drew it.
|
|
362
|
-
for (const [element, axis, mode] of marks) {
|
|
382
|
+
for (const [element, axis, mode, short] of marks) {
|
|
363
383
|
element.setAttribute(FOLLOW_ATTRIBUTE[axis], mode);
|
|
384
|
+
if (Math.abs(short) > EXACT_PX) {
|
|
385
|
+
element.setAttribute(FOLLOW_SHORT, "");
|
|
386
|
+
element.style.setProperty(FOLLOW_SHORT_BY, `${short}px`);
|
|
387
|
+
}
|
|
364
388
|
followMarks.push([element, axis]);
|
|
365
389
|
}
|
|
390
|
+
for (const listener of followingTables) listener(true);
|
|
366
391
|
}
|
|
367
392
|
|
|
368
393
|
function stopFollowing(): void {
|
|
369
|
-
for (const [element, axis] of followMarks)
|
|
394
|
+
for (const [element, axis] of followMarks) {
|
|
395
|
+
element.removeAttribute(FOLLOW_ATTRIBUTE[axis]);
|
|
396
|
+
if (element.hasAttribute(FOLLOW_SHORT)) {
|
|
397
|
+
element.removeAttribute(FOLLOW_SHORT);
|
|
398
|
+
element.style.removeProperty(FOLLOW_SHORT_BY);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
370
401
|
followMarks = [];
|
|
402
|
+
const stopped = followingTables;
|
|
403
|
+
followingTables = [];
|
|
404
|
+
for (const listener of stopped) listener(false);
|
|
371
405
|
for (const surface of surfaces.keys()) followed.delete(surface);
|
|
372
406
|
// After the release has laid the panes out: every surface fits its box again.
|
|
373
407
|
const refit = () => {
|
|
@@ -380,16 +414,33 @@ function stopFollowing(): void {
|
|
|
380
414
|
else setTimeout(refit, 0);
|
|
381
415
|
}
|
|
382
416
|
|
|
417
|
+
function install(): void {
|
|
418
|
+
if (installed) return;
|
|
419
|
+
installed = true;
|
|
420
|
+
onLiveResizeStart(startFollowing);
|
|
421
|
+
onLiveResizeEnd(stopFollowing);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Tracks a data table's root: during every resize, the boxes above it follow
|
|
426
|
+
* the frame on x by CSS wherever they can (as a chart's do), so its columns
|
|
427
|
+
* are laid out at the frame's width on every frame rather than at each
|
|
428
|
+
* catch-up. At rest nothing changes: its boxes keep the cells the pane gave
|
|
429
|
+
* them. `listener` hears when a resize starts laying the table out so
|
|
430
|
+
* (true) and when it stops (false). Returns the untrack.
|
|
431
|
+
*/
|
|
432
|
+
export function trackTable(table: HTMLElement, listener: (follows: boolean) => void): () => void {
|
|
433
|
+
install();
|
|
434
|
+
tables.set(table, listener);
|
|
435
|
+
return () => { tables.delete(table); };
|
|
436
|
+
}
|
|
437
|
+
|
|
383
438
|
/**
|
|
384
439
|
* Tracks a surface root: fits it now, again whenever its parent's box changes
|
|
385
440
|
* size at rest, and takes it into every resize's pass. Returns the untrack.
|
|
386
441
|
*/
|
|
387
442
|
export function trackSurface(surface: HTMLElement): () => void {
|
|
388
|
-
|
|
389
|
-
installed = true;
|
|
390
|
-
onLiveResizeStart(startFollowing);
|
|
391
|
-
onLiveResizeEnd(stopFollowing);
|
|
392
|
-
}
|
|
443
|
+
install();
|
|
393
444
|
const parent = surface.parentElement;
|
|
394
445
|
const observer = typeof ResizeObserver !== "undefined" && parent
|
|
395
446
|
? new ResizeObserver(() => fitSurface(surface))
|
|
@@ -319,7 +319,7 @@ button, [data-gloom-interactive="true"] { cursor: pointer; }
|
|
|
319
319
|
[data-gloom-role="status-bar"] span {
|
|
320
320
|
line-height: var(--cell-h);
|
|
321
321
|
}
|
|
322
|
-
/* The returning-user strip and the new
|
|
322
|
+
/* The returning-user strip and the new-to-Pro row under the header: one row of shell chrome each, ruled off from the layout. */
|
|
323
323
|
[data-gloom-role="since-last-visit"],
|
|
324
324
|
[data-gloom-role="pro-welcome"] {
|
|
325
325
|
flex: none;
|
|
@@ -355,6 +355,11 @@ button, [data-gloom-interactive="true"] { cursor: pointer; }
|
|
|
355
355
|
width: auto !important;
|
|
356
356
|
min-width: 0 !important;
|
|
357
357
|
}
|
|
358
|
+
/* A box above a table that sat a fraction of a cell short of its space keeps
|
|
359
|
+
that gap while it follows, so the press moves nothing. */
|
|
360
|
+
[data-gloom-follow-short-x] {
|
|
361
|
+
margin-right: var(--gloom-follow-short-x) !important;
|
|
362
|
+
}
|
|
358
363
|
[data-gloom-fill-y="stretch"], [data-gloom-follow-y="stretch"] {
|
|
359
364
|
height: auto !important;
|
|
360
365
|
align-self: stretch !important;
|
|
@@ -10,8 +10,9 @@ import { bundleExternalPlugin, pluginBundleCacheDir } from "../../../plugins/bun
|
|
|
10
10
|
import {
|
|
11
11
|
getPluginCacheDir,
|
|
12
12
|
getPluginsDir,
|
|
13
|
-
listPluginDirectories,
|
|
14
13
|
loadExternalPlugin,
|
|
14
|
+
loadExternalPlugins,
|
|
15
|
+
type LoadedExternalPlugin,
|
|
15
16
|
} from "../../../plugins/loader";
|
|
16
17
|
import { createNodePluginManager } from "../../../plugins/manager-node";
|
|
17
18
|
import { deactivatePluginForRemoval } from "../../../plugins/marketplace/deactivation";
|
|
@@ -68,8 +69,14 @@ async function bundlePluginDirectory(
|
|
|
68
69
|
// The same load the terminal does, so the metadata, the commit and whether
|
|
69
70
|
// the plugin runs on the desktop at all are decided in one place.
|
|
70
71
|
const loaded = await loadExternalPlugin(pluginDir, "desktop", options);
|
|
71
|
-
|
|
72
|
+
return loaded ? bundleLoadedPlugin(pluginDir, loaded, options) : null;
|
|
73
|
+
}
|
|
72
74
|
|
|
75
|
+
async function bundleLoadedPlugin(
|
|
76
|
+
pluginDir: string,
|
|
77
|
+
loaded: LoadedExternalPlugin,
|
|
78
|
+
options: { fresh?: boolean } = {},
|
|
79
|
+
): Promise<DesktopExternalPluginBundle> {
|
|
73
80
|
const { plugin } = loaded;
|
|
74
81
|
const directory = basename(pluginDir);
|
|
75
82
|
const icon = readPluginIcon(pluginDir);
|
|
@@ -83,6 +90,7 @@ async function bundlePluginDirectory(
|
|
|
83
90
|
...(loaded.commit ? { commit: loaded.commit } : {}),
|
|
84
91
|
...(loaded.repo ? { repo: loaded.repo } : {}),
|
|
85
92
|
...(loaded.linked ? { linked: true } : {}),
|
|
93
|
+
...(loaded.duplicateOf ? { duplicateOf: loaded.duplicateOf } : {}),
|
|
86
94
|
...(icon ? { icon } : {}),
|
|
87
95
|
...(plugin.targets ? { targets: plugin.targets } : {}),
|
|
88
96
|
};
|
|
@@ -153,10 +161,12 @@ export async function collectExternalPluginBundles(): Promise<DesktopExternalPlu
|
|
|
153
161
|
const bundles: DesktopExternalPluginBundle[] = [];
|
|
154
162
|
|
|
155
163
|
// Links every folder before reading any: a plugin that imports a sibling
|
|
156
|
-
// needs the sibling linked too, whichever of them is read first.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
// needs the sibling linked too, whichever of them is read first. Compiled
|
|
165
|
+
// only once every folder is read, so a plugin id that two folders declare
|
|
166
|
+
// is settled the way the backend's registry settles it, and the copy that
|
|
167
|
+
// is not loaded is not compiled.
|
|
168
|
+
for (const loaded of await loadExternalPlugins("desktop", pluginsDir)) {
|
|
169
|
+
bundles.push(await bundleLoadedPlugin(loaded.path, loaded));
|
|
160
170
|
}
|
|
161
171
|
|
|
162
172
|
return bundles;
|
|
@@ -175,6 +175,8 @@ export interface DesktopExternalPluginBundle {
|
|
|
175
175
|
unsupportedTarget?: "desktop";
|
|
176
176
|
/** The files changed under modules the Bun process already imported; no code is sent. */
|
|
177
177
|
needsRestart?: boolean;
|
|
178
|
+
/** The folder that loads in this one's place, which declares the same plugin id; `error` says so and no code is sent. */
|
|
179
|
+
duplicateOf?: string;
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
/**
|
|
@@ -48,6 +48,7 @@ import type {
|
|
|
48
48
|
QuoteBatchResult,
|
|
49
49
|
SecFilingDocument,
|
|
50
50
|
SecFilingItem,
|
|
51
|
+
SecFilingsPage,
|
|
51
52
|
} from "../../../types/data-provider";
|
|
52
53
|
import type {
|
|
53
54
|
AnalystResearchData,
|
|
@@ -72,6 +73,7 @@ import { statsCache } from "../../../plugins/builtin/econ-statistics/cache";
|
|
|
72
73
|
import { apiClient, setCloudApiFetchTransport } from "../../../api-client";
|
|
73
74
|
import { createGloomberbCloudCapabilities, createGloomberbCloudProvider } from "../../../sources/gloomberb-cloud";
|
|
74
75
|
import { logFailure } from "../../../utils/log-failure";
|
|
76
|
+
import { markSavedCopy, stampRetrievedAt } from "../../../data/saved-copies";
|
|
75
77
|
|
|
76
78
|
declare global {
|
|
77
79
|
interface Window {
|
|
@@ -227,6 +229,24 @@ async function restoreShotCloudSession(): Promise<void> {
|
|
|
227
229
|
* of the corporate action history come from providers the router merges in.
|
|
228
230
|
*/
|
|
229
231
|
async function requestShotMarketData<T>(operation: string, args: unknown[], signal?: AbortSignal): Promise<T> {
|
|
232
|
+
return (await requestShotMarketReply<T>(operation, args, signal)).data as T;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* A dataset read through the bridge (holders, filings, analyst research,
|
|
237
|
+
* corporate actions), marked as the Bun side served it: a copy saved earlier
|
|
238
|
+
* that a failed refresh fell back to, or one read earlier and served again,
|
|
239
|
+
* with the time it was saved or read. JSON keeps no marks, so the reply
|
|
240
|
+
* carries the times; `revive` restores what else JSON loses first.
|
|
241
|
+
*/
|
|
242
|
+
async function requestShotDataset<T extends object>(operation: string, args: unknown[], revive: (value: T) => T = (value) => value): Promise<T> {
|
|
243
|
+
const reply = await requestShotMarketReply<T>(operation, args);
|
|
244
|
+
const data = revive(reply.data as T);
|
|
245
|
+
if (typeof reply.savedAt === "number") return markSavedCopy(data, reply.savedAt);
|
|
246
|
+
return typeof reply.retrievedAt === "number" ? stampRetrievedAt(data, reply.retrievedAt) : data;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
async function requestShotMarketReply<T>(operation: string, args: unknown[], signal?: AbortSignal): Promise<{ data?: T; savedAt?: number; retrievedAt?: number }> {
|
|
230
250
|
const viaFetch = () => window.fetch(shotRouteUrl(SHOT_MARKET_BRIDGE_PATH, SHOT_PAGE_URL), {
|
|
231
251
|
method: "POST",
|
|
232
252
|
headers: { "Content-Type": "application/json" },
|
|
@@ -239,9 +259,9 @@ async function requestShotMarketData<T>(operation: string, args: unknown[], sign
|
|
|
239
259
|
const send = await shotSocket();
|
|
240
260
|
return await send?.({ market: { operation, args } }, signal) ?? await viaFetch();
|
|
241
261
|
})());
|
|
242
|
-
const result = await response.json() as { ok: boolean; data?: T; error?: string };
|
|
262
|
+
const result = await response.json() as { ok: boolean; data?: T; error?: string; savedAt?: number; retrievedAt?: number };
|
|
243
263
|
if (!result.ok) throw new Error(result.error ?? `Screenshot data request failed: ${operation}`);
|
|
244
|
-
return result
|
|
264
|
+
return result;
|
|
245
265
|
}
|
|
246
266
|
|
|
247
267
|
/** JSON has no Date, so every bridged date arrives as a string. */
|
|
@@ -368,10 +388,12 @@ function createShotDataProvider(payload: DesktopPaneShotPayload): DataProvider {
|
|
|
368
388
|
}));
|
|
369
389
|
},
|
|
370
390
|
getArticleSummary: async () => null,
|
|
371
|
-
getAnalystResearch: (symbol, exchange) =>
|
|
372
|
-
getCorporateActions: (symbol, exchange) =>
|
|
373
|
-
getHolders: (symbol, exchange) =>
|
|
374
|
-
getSecFilings: (symbol, count, exchange) =>
|
|
391
|
+
getAnalystResearch: (symbol, exchange) => requestShotDataset<AnalystResearchData>("getAnalystResearch", [symbol, exchange]),
|
|
392
|
+
getCorporateActions: (symbol, exchange) => requestShotDataset<CorporateActionsData>("getCorporateActions", [symbol, exchange]),
|
|
393
|
+
getHolders: (symbol, exchange) => requestShotDataset<HolderData>("getHolders", [symbol, exchange]),
|
|
394
|
+
getSecFilings: (symbol, count, exchange) => requestShotDataset<SecFilingItem[]>("getSecFilings", [symbol, count, exchange], reviveSecFilings),
|
|
395
|
+
getSecFilingsPage: (symbol, query, exchange) => requestShotDataset<SecFilingsPage>("getSecFilingsPage", [symbol, query, exchange],
|
|
396
|
+
(page) => ({ ...page, filings: reviveSecFilings(page.filings) })),
|
|
375
397
|
// The page holds no session credential, so verified cloud reads such as
|
|
376
398
|
// Form 4 content would fail as signed out if the page made them itself.
|
|
377
399
|
getSecFilingDocuments: (filing) => requestShotMarketData<SecFilingDocument[]>("getSecFilingDocuments", [filing]),
|
|
@@ -419,11 +441,13 @@ function createShotDataProvider(payload: DesktopPaneShotPayload): DataProvider {
|
|
|
419
441
|
|
|
420
442
|
function createShotAppServices(payload: DesktopPaneShotPayload, externalPlugins: LoadedExternalPlugin[]) {
|
|
421
443
|
const dataProvider = createShotDataProvider(payload);
|
|
444
|
+
const persistence = new JsonPersistence();
|
|
445
|
+
for (const { pluginId, key, value } of payload.deviceState ?? []) persistence.pluginState.set(pluginId, key, value);
|
|
422
446
|
return createAppRuntime({
|
|
423
447
|
config: payload.config,
|
|
424
448
|
plugins: getLoadablePlugins(externalPlugins),
|
|
425
449
|
dataProvider,
|
|
426
|
-
persistence
|
|
450
|
+
persistence,
|
|
427
451
|
tickerRepository: new JsonTickerRepository(undefined, payload.tickers),
|
|
428
452
|
registryOptions: {
|
|
429
453
|
enableCapabilityHandlers: false,
|
|
@@ -17,11 +17,12 @@ declare global {
|
|
|
17
17
|
* Set by a capture that carries a status line: shows the first of the
|
|
18
18
|
* variants (longest first) that fits the footer, cut in the middle when
|
|
19
19
|
* none does, and resolves to the text shown. `dates` says what the line
|
|
20
|
-
* dates, so the pane's own text that says the same goes.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* dates, so the pane's own text that says the same goes. `ownStatus`: the
|
|
21
|
+
* view dates its data in its own footer (a DES research tab), which stays
|
|
22
|
+
* whole beside the line. With no variants the pane has nothing to date:
|
|
23
|
+
* the footer row is given back to the body and the text shown is empty.
|
|
23
24
|
*/
|
|
24
|
-
__GLOOM_CLI_SHOT_FIT_STATUS__?: (variants: string[], options?: { dates?: ShotLineDates }) => Promise<string>;
|
|
25
|
+
__GLOOM_CLI_SHOT_FIT_STATUS__?: (variants: string[], options?: { dates?: ShotLineDates; ownStatus?: boolean }) => Promise<string>;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -126,17 +127,21 @@ interface ShotStatusLineState {
|
|
|
126
127
|
dates: ShotLineDates;
|
|
127
128
|
/** No variant fit beside the pane's own `as of`, so it gave way. */
|
|
128
129
|
crowded: boolean;
|
|
130
|
+
/** The view dates its data in its own footer, which the capture keeps. */
|
|
131
|
+
ownStatus: boolean;
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
function useShotStatusLine(enabled: boolean, hasAsOf: () => boolean): ShotStatusLineState {
|
|
132
135
|
const [text, setText] = useState<string | null>(PENDING_STATUS);
|
|
133
136
|
const [dates, setDates] = useState<ShotLineDates>(null);
|
|
134
137
|
const [crowded, setCrowded] = useState(false);
|
|
138
|
+
const [ownStatus, setOwnStatus] = useState(false);
|
|
135
139
|
useEffect(() => {
|
|
136
140
|
if (!enabled) return;
|
|
137
141
|
// What the line says goes before it is fitted, so the line gets its room.
|
|
138
142
|
window.__GLOOM_CLI_SHOT_FIT_STATUS__ = async (variants, options) => {
|
|
139
143
|
setDates(options?.dates ?? null);
|
|
144
|
+
setOwnStatus(options?.ownStatus === true);
|
|
140
145
|
setCrowded(false);
|
|
141
146
|
if (variants.length === 0) {
|
|
142
147
|
setText(null);
|
|
@@ -158,7 +163,7 @@ function useShotStatusLine(enabled: boolean, hasAsOf: () => boolean): ShotStatus
|
|
|
158
163
|
delete window.__GLOOM_CLI_SHOT_FIT_STATUS__;
|
|
159
164
|
};
|
|
160
165
|
}, [enabled, hasAsOf]);
|
|
161
|
-
return { text, dates, crowded };
|
|
166
|
+
return { text, dates, crowded, ownStatus };
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
/**
|
|
@@ -170,7 +175,9 @@ function useShotStatusLine(enabled: boolean, hasAsOf: () => boolean): ShotStatus
|
|
|
170
175
|
* pane's own text that says the same goes, so the date is said once: its `as
|
|
171
176
|
* of` (a footer segment or a query bar's) when the line dates the pane's data,
|
|
172
177
|
* and its quote date and delay when the line states them. A pane's `as of`
|
|
173
|
-
* also gives way before the line would be cut.
|
|
178
|
+
* also gives way before the line would be cut. A view that dates its data in
|
|
179
|
+
* its own footer (the line's `ownStatus`) keeps that footer's status, as
|
|
180
|
+
* `preserveStatus` does for a whole pane.
|
|
174
181
|
*/
|
|
175
182
|
export function PaneShotFrame({ paneId, title, width, height, preserveStatus = false, statusLine = false, children }: {
|
|
176
183
|
paneId: string;
|
|
@@ -183,7 +190,7 @@ export function PaneShotFrame({ paneId, title, width, height, preserveStatus = f
|
|
|
183
190
|
}) {
|
|
184
191
|
const shownAsOf = useRef(false);
|
|
185
192
|
const hasAsOf = useCallback(() => shownAsOf.current, []);
|
|
186
|
-
const { text: statusText, dates, crowded } = useShotStatusLine(statusLine, hasAsOf);
|
|
193
|
+
const { text: statusText, dates, crowded, ownStatus } = useShotStatusLine(statusLine, hasAsOf);
|
|
187
194
|
const datesData = statusLine && dates === "data";
|
|
188
195
|
const palette = useThemeColors();
|
|
189
196
|
const [noteHeight, setNoteHeight] = useState(0);
|
|
@@ -201,7 +208,7 @@ export function PaneShotFrame({ paneId, title, width, height, preserveStatus = f
|
|
|
201
208
|
const status: PaneFooterSegment[] = statusLine && statusText !== null ? [{ id: "shot-status", parts: [{ text: statusText, tone: "label" }] }] : [];
|
|
202
209
|
const warnings = registeredFooter.info.filter((segment) => segment.icon === "warning" && segment.notes?.length !== 0);
|
|
203
210
|
const info = registeredFooter.info.filter((segment) => segment.icon !== "warning"
|
|
204
|
-
&& (preserveStatus || segment.capture)
|
|
211
|
+
&& (preserveStatus || ownStatus || segment.capture)
|
|
205
212
|
&& !(datesPaneData(segment) && (datesData || crowded))
|
|
206
213
|
&& !(segment.quoteStatus && statusLine && dates !== null));
|
|
207
214
|
shownAsOf.current = info.some(datesPaneData);
|
|
@@ -28,6 +28,7 @@ export async function loadDesktopExternalPlugin(bundle: DesktopExternalPluginBun
|
|
|
28
28
|
...(bundle.commit ? { commit: bundle.commit } : {}),
|
|
29
29
|
...(bundle.repo ? { repo: bundle.repo } : {}),
|
|
30
30
|
...(bundle.linked ? { linked: true } : {}),
|
|
31
|
+
...(bundle.duplicateOf ? { duplicateOf: bundle.duplicateOf } : {}),
|
|
31
32
|
...(bundle.icon ? { icon: bundle.icon } : {}),
|
|
32
33
|
};
|
|
33
34
|
const fallback = {
|
|
@@ -45,6 +45,7 @@ const assetDataPayloads: Record<string, PayloadBuilder> = {
|
|
|
45
45
|
getExchangeRate: (fromCurrency) => ({ fromCurrency }),
|
|
46
46
|
search: (query, context) => ({ query, context }),
|
|
47
47
|
getSecFilings: (ticker, count, exchange, context) => ({ ticker, count, exchange, context }),
|
|
48
|
+
getSecFilingsPage: (ticker, query, exchange, context) => ({ ticker, query, exchange, context }),
|
|
48
49
|
getHolders: (ticker, exchange, context) => ({ ticker, exchange, context }),
|
|
49
50
|
getAnalystResearch: (ticker, exchange, context) => ({ ticker, exchange, context }),
|
|
50
51
|
getCorporateActions: (ticker, exchange, context) => ({ ticker, exchange, context }),
|
package/src/series/types.ts
CHANGED
|
@@ -3,12 +3,12 @@ import { seriesNotOnFred, type FredSeriesData } from "./fred-series";
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* When FRED last updated a series, its `last_updated` (`2026-10-09 08:08:04-05`),
|
|
6
|
-
* as an ISO instant in UTC
|
|
6
|
+
* as an ISO instant in UTC, distinct from the publisher's release. Only when
|
|
7
7
|
* that update covers the newest observation shown (`observationEnd` reaches
|
|
8
|
-
* it): metadata from before it
|
|
8
|
+
* it): metadata from before it does not date the observation shown.
|
|
9
9
|
* Null when it does not, or when FRED's metadata does not say.
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function fredUpdateTime(
|
|
12
12
|
info: { lastUpdated?: string | null; observationEnd?: string | null } | null | undefined,
|
|
13
13
|
newestDate: string | null | undefined,
|
|
14
14
|
): string | null {
|
|
@@ -23,6 +23,7 @@ export interface FredProvenance {
|
|
|
23
23
|
source: string;
|
|
24
24
|
publisher?: string;
|
|
25
25
|
publishedAt?: string;
|
|
26
|
+
fredUpdatedAt?: string;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -78,10 +79,10 @@ export function fredSeriesAttribution(
|
|
|
78
79
|
const ahead = fredProvenance(data.observations.filter((observation) => observation.date === newestDate), seriesId);
|
|
79
80
|
if (ahead) return ahead;
|
|
80
81
|
const publisher = data.info?.source?.trim();
|
|
81
|
-
const
|
|
82
|
+
const fredUpdatedAt = fredUpdateTime(data.info, newestDate);
|
|
82
83
|
return {
|
|
83
84
|
source: notOnFredSource(seriesId) ?? "FRED",
|
|
84
85
|
...(publisher ? { publisher } : {}),
|
|
85
|
-
...(
|
|
86
|
+
...(fredUpdatedAt ? { fredUpdatedAt } : {}),
|
|
86
87
|
};
|
|
87
88
|
}
|
|
@@ -19,6 +19,8 @@ import type {
|
|
|
19
19
|
EarningsEvent,
|
|
20
20
|
SecFilingDocument,
|
|
21
21
|
SecFilingItem,
|
|
22
|
+
SecFilingsPage,
|
|
23
|
+
SecFilingsPageQuery,
|
|
22
24
|
SecForm4Trade,
|
|
23
25
|
BatchedReadMethod,
|
|
24
26
|
MarketDataRequestContext,
|
|
@@ -42,7 +44,9 @@ import {
|
|
|
42
44
|
type CloudHoldersPayload,
|
|
43
45
|
type CloudMarketResponse,
|
|
44
46
|
type CloudPricePointPayload,
|
|
47
|
+
type CloudSecFilingsResponse,
|
|
45
48
|
} from "../../api-client";
|
|
49
|
+
import type { CloudSecFilingsParams } from "../../api-client/paths";
|
|
46
50
|
import type { NewsArticle, NewsQuery } from "../../types/news-source";
|
|
47
51
|
import { normalizeNewsFeed } from "../../news/news-model";
|
|
48
52
|
import { resolveCurrencyUnit } from "../../utils/currency-units";
|
|
@@ -170,6 +174,13 @@ function mapCloudSecFiling(item: {
|
|
|
170
174
|
};
|
|
171
175
|
}
|
|
172
176
|
|
|
177
|
+
/** Each form's newest filing day as the service sent it, or null when it sent none (an older server). */
|
|
178
|
+
function readNewestByForm(value: unknown): Record<string, string> | null {
|
|
179
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
180
|
+
return Object.fromEntries(Object.entries(value as Record<string, unknown>)
|
|
181
|
+
.filter((entry): entry is [string, string] => !!entry[0].trim() && typeof entry[1] === "string" && /^\d{4}-\d{2}-\d{2}$/.test(entry[1])));
|
|
182
|
+
}
|
|
183
|
+
|
|
173
184
|
/** A Form 4's trade as the service summarized it, or null when it sent none or an unreadable one. */
|
|
174
185
|
function readForm4Trade(value: unknown): SecForm4Trade | null {
|
|
175
186
|
if (!value || typeof value !== "object") return null;
|
|
@@ -763,23 +774,49 @@ export class GloomberbCloudProvider implements AssetDataProvider {
|
|
|
763
774
|
}
|
|
764
775
|
|
|
765
776
|
async getSecFilings(ticker: string, count = 15, exchange?: string, context?: MarketDataRequestContext): Promise<SecFilingItem[]> {
|
|
777
|
+
return (await this.readSecFilings(ticker, exchange, context, { limit: count, offset: 0 })).filings;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
async getSecFilingsPage(ticker: string, query: SecFilingsPageQuery, exchange?: string, context?: MarketDataRequestContext): Promise<SecFilingsPage> {
|
|
781
|
+
const { filings, response } = await this.readSecFilings(ticker, exchange, context, {
|
|
782
|
+
forms: query.forms, limit: query.limit, offset: query.offset ?? 0, newestByForm: true,
|
|
783
|
+
});
|
|
784
|
+
const newestByForm = readNewestByForm(response.newestByForm);
|
|
785
|
+
return {
|
|
786
|
+
filings,
|
|
787
|
+
hasMore: response.hasMore === true,
|
|
788
|
+
nextOffset: typeof response.nextOffset === "number" ? response.nextOffset : (query.offset ?? 0) + response.filings.length,
|
|
789
|
+
...(newestByForm ? { newestByForm } : {}),
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/** A listing's filings as the service lists them, checked to be its company's when it trades abroad. */
|
|
794
|
+
private async readSecFilings(
|
|
795
|
+
ticker: string,
|
|
796
|
+
exchange: string | undefined,
|
|
797
|
+
context: MarketDataRequestContext | undefined,
|
|
798
|
+
page: Pick<CloudSecFilingsParams, "forms" | "limit" | "offset" | "newestByForm">,
|
|
799
|
+
): Promise<{ filings: SecFilingItem[]; response: CloudSecFilingsResponse }> {
|
|
766
800
|
rejectPerpetual(ticker, exchange, "SEC filings");
|
|
767
801
|
rejectPredictionMarket(ticker, exchange);
|
|
768
802
|
const venue = nonUsSecListingVenue(ticker, exchange);
|
|
769
803
|
const name = venue ? context?.listingName?.trim() || await this.listingName(ticker, venue) || undefined : undefined;
|
|
770
|
-
const filings = await withCloudFallback(async () => {
|
|
771
|
-
const response = await apiClient.getCloudSecFilings({ ticker, exchange, name,
|
|
804
|
+
const { filings, response } = await withCloudFallback(async () => {
|
|
805
|
+
const response = await apiClient.getCloudSecFilings({ ticker, exchange, name, ...page });
|
|
772
806
|
// A foreign line's filings read from its company's home line say whose, each of them.
|
|
773
807
|
const companyFrom = readCompanyFrom(response.companyFrom);
|
|
774
|
-
return
|
|
808
|
+
return {
|
|
809
|
+
response,
|
|
810
|
+
filings: response.filings.map((filing) => companyFrom ? { ...mapCloudSecFiling(filing), companyFrom } : mapCloudSecFiling(filing)),
|
|
811
|
+
};
|
|
775
812
|
}, `Cloud SEC filings are unavailable for ${ticker}`);
|
|
776
813
|
// The service matched a line read from its company's home line to the company itself.
|
|
777
|
-
if (!venue || filings.length === 0 || filings[0]!.companyFrom) return filings;
|
|
814
|
+
if (!venue || filings.length === 0 || filings[0]!.companyFrom) return { filings, response };
|
|
778
815
|
const symbol = parsePublicTickerKey(ticker).symbol;
|
|
779
816
|
// Without the listing's company the filings cannot be told apart from another company's.
|
|
780
817
|
if (!name) throw createProviderMiss(`SEC filings for ${symbol} could not be matched to its ${venue} listing`);
|
|
781
818
|
assertSecRegistrantMatches(filings, { symbol, exchange: venue, name });
|
|
782
|
-
return filings;
|
|
819
|
+
return { filings, response };
|
|
783
820
|
}
|
|
784
821
|
|
|
785
822
|
/** The company a listing belongs to, from its own quote; null when the quote prices another venue. */
|
|
@@ -2,7 +2,7 @@ import { normalizeNewsFeed } from "../../news/news-model";
|
|
|
2
2
|
import { readableNewsSource } from "../../news/source-label";
|
|
3
3
|
import { collectNewsDisplayTickers } from "../../news/ticker-symbols";
|
|
4
4
|
import type { NewsAccess, NewsArticle, NewsQuery, NewsStoryItem } from "../../types/news-source";
|
|
5
|
-
import type { NewsInsiderFiling } from "../../news/types";
|
|
5
|
+
import type { NewsInsiderFiling, NewsStoryTimes } from "../../news/types";
|
|
6
6
|
import { CLOUD_NEWS_DELAY_HOURS } from "../../api-client/plan-rules";
|
|
7
7
|
import type {
|
|
8
8
|
apiClient,
|
|
@@ -124,12 +124,24 @@ function routineNotices(payload: CloudNewsPayload["routine"]): NewsArticle["rout
|
|
|
124
124
|
return { kind: payload.kind, notices: payload.notices, since, programme: payload.programme ?? null };
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/** The story's times as sent, each one that reads as an instant. */
|
|
128
|
+
function storyTimes(item: CloudNewsPayload): NewsStoryTimes {
|
|
129
|
+
const times: NewsStoryTimes = {};
|
|
130
|
+
for (const key of ["firstPublishedAt", "lastPublishedAt", "firstSeenAt", "lastSeenAt"] as const) {
|
|
131
|
+
const value = item[key];
|
|
132
|
+
if (typeof value === "string" && Number.isFinite(Date.parse(value))) times[key] = value;
|
|
133
|
+
}
|
|
134
|
+
return times;
|
|
135
|
+
}
|
|
136
|
+
|
|
127
137
|
export function mapCloudNewsArticle(
|
|
128
138
|
item: CloudNewsPayload,
|
|
129
139
|
fallbackTicker?: string,
|
|
130
140
|
): NewsArticle {
|
|
141
|
+
// A story is dated by its first publication: a later report it gathers (a
|
|
142
|
+
// paper's copy hours on) is its latest, never when it broke.
|
|
131
143
|
const publishedAt = new Date(
|
|
132
|
-
item.lastPublishedAt || item.
|
|
144
|
+
item.firstPublishedAt || item.lastPublishedAt || item.firstSeenAt || item.lastSeenAt,
|
|
133
145
|
);
|
|
134
146
|
const topic = item.topic ?? item.category ?? "general";
|
|
135
147
|
const topics = uniqueStrings([topic, ...normalizeStringArray(item.topics)]);
|
|
@@ -153,6 +165,7 @@ export function mapCloudNewsArticle(
|
|
|
153
165
|
|| primaryItem?.sourceName
|
|
154
166
|
|| readableNewsSource(item.primarySource),
|
|
155
167
|
publishedAt: Number.isNaN(publishedAt.getTime()) ? new Date(0) : publishedAt,
|
|
168
|
+
times: storyTimes(item),
|
|
156
169
|
summary: item.summary,
|
|
157
170
|
topic,
|
|
158
171
|
topics,
|
|
@@ -128,6 +128,7 @@ export function mapQuote(
|
|
|
128
128
|
priceVenue: typeof quote.priceVenue === "string" && /^[A-Za-z][A-Za-z0-9 .-]{0,23}$/.test(quote.priceVenue) ? quote.priceVenue : undefined,
|
|
129
129
|
priceBasis,
|
|
130
130
|
priceObservation,
|
|
131
|
+
futuresPriceKind: quote.futuresPriceKind === "settlement" || quote.futuresPriceKind === "last-trade" ? quote.futuresPriceKind : undefined,
|
|
131
132
|
currency: currency || quote.currency,
|
|
132
133
|
price: normalizePriceValueByDivisor(quote.price, divisor) ?? quote.price,
|
|
133
134
|
change,
|
|
@@ -152,6 +153,9 @@ export function mapQuote(
|
|
|
152
153
|
dailyClose: readDailyClose(quote.dailyClose),
|
|
153
154
|
bid: normalizePriceValueByDivisor(quote.bid, divisor),
|
|
154
155
|
ask: normalizePriceValueByDivisor(quote.ask, divisor),
|
|
156
|
+
// The book's own stamp, only beside a book: never borrowed from the trade.
|
|
157
|
+
bidAskTime: (quote.bid != null || quote.ask != null) && typeof quote.bidAskTime === "number"
|
|
158
|
+
&& Number.isFinite(quote.bidAskTime) && quote.bidAskTime > 0 ? quote.bidAskTime : undefined,
|
|
155
159
|
open: sessionPrice(quote.open),
|
|
156
160
|
high: sessionPrice(quote.high),
|
|
157
161
|
low: sessionPrice(quote.low),
|
|
@@ -336,6 +340,11 @@ function mapCloudFundamentals(fundamentals: Fundamentals | undefined): Fundament
|
|
|
336
340
|
if (result === value) result = { ...value };
|
|
337
341
|
delete result[field];
|
|
338
342
|
}
|
|
343
|
+
// The rate's basis goes with the rate, and only the one basis is read.
|
|
344
|
+
if (result.dividendRateBasis !== undefined && (result.dividendRate === undefined || result.dividendRateBasis !== "uneven-regular-payments")) {
|
|
345
|
+
if (result === value) result = { ...value };
|
|
346
|
+
delete result.dividendRateBasis;
|
|
347
|
+
}
|
|
339
348
|
return result;
|
|
340
349
|
}
|
|
341
350
|
|
|
@@ -7,6 +7,7 @@ import { canonicalHistoryInterval } from "./history-retention";
|
|
|
7
7
|
import { historyCoverageNoteText, isHistoryCoverageDate } from "./history-coverage";
|
|
8
8
|
import { readNonPositiveCloseDates } from "./history-omitted";
|
|
9
9
|
import { parseListingDelisting } from "../market-data/quotes/delisting";
|
|
10
|
+
import { savedCopyMark } from "../data/saved-copies";
|
|
10
11
|
|
|
11
12
|
export type HistoryResultRequest =
|
|
12
13
|
| { kind: "range"; range: TimeRange }
|
|
@@ -40,7 +41,7 @@ export function normalizeHistoryResult(
|
|
|
40
41
|
if (result.session != null && (!session || result.resolution === null)) return null;
|
|
41
42
|
const nonPositiveCloseDates = readNonPositiveCloseDates(result.nonPositiveCloseDates);
|
|
42
43
|
const delisting = parseListingDelisting(result.delisting);
|
|
43
|
-
return { points: result.points, resolution: result.resolution,
|
|
44
|
+
return { points: result.points, resolution: result.resolution, ...savedCopyMark(result),
|
|
44
45
|
...(session ? { session } : {}),
|
|
45
46
|
...(nonPositiveCloseDates ? { nonPositiveCloseDates } : {}),
|
|
46
47
|
...(typeof result.sourceKey === "string" && /^(provider|broker):[^\r\n\0]+$/.test(result.sourceKey) ? { sourceKey: result.sourceKey } : {}),
|