gloomberb 0.15.7 → 0.16.0
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/README.md +11 -2
- package/package.json +1 -1
- package/src/api-client/app-attention.ts +147 -0
- package/src/api-client/attention.ts +26 -0
- package/src/api-client/awards.ts +215 -0
- package/src/api-client/catalysts.ts +160 -0
- package/src/api-client/chat.ts +137 -14
- package/src/api-client/company-kpis.ts +153 -0
- package/src/api-client/cpi.ts +52 -0
- package/src/api-client/credit-documents.ts +107 -0
- package/src/api-client/data.ts +192 -3
- package/src/api-client/distress.ts +164 -0
- package/src/api-client/doe.ts +75 -0
- package/src/api-client/equity-screener.ts +11 -0
- package/src/api-client/exposure.ts +202 -0
- package/src/api-client/gpu.ts +93 -0
- package/src/api-client/hiring.ts +110 -0
- package/src/api-client/index.ts +78 -3
- package/src/api-client/normalizers.ts +31 -1
- package/src/api-client/paths.ts +3 -0
- package/src/api-client/perps.ts +127 -0
- package/src/api-client/power.ts +148 -0
- package/src/api-client/request.ts +58 -1
- package/src/api-client/research-activity.ts +172 -13
- package/src/api-client/socket.ts +75 -27
- package/src/api-client/supply-chain-graph.ts +40 -0
- package/src/api-client/supply-chain.ts +98 -0
- package/src/api-client/telemetry.ts +29 -0
- package/src/api-client/themes.ts +28 -0
- package/src/api-client/types.ts +33 -1
- package/src/api-client/wall-experiments.ts +100 -0
- package/src/api-client/wall-summary.ts +49 -0
- package/src/api-client/web-experiments.ts +136 -0
- package/src/app/pane-runtime/plugin-bindings.ts +5 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +8 -2
- package/src/app/runtime/update.ts +13 -1
- package/src/cli/commands/system.ts +2 -0
- package/src/cli/desktop-pane-shot.ts +3 -4
- package/src/cli/pane-functions/data.ts +78 -0
- package/src/cli/pane-functions/financial-ratio-shot.ts +160 -0
- package/src/cli/pane-functions/function-help.ts +220 -8
- package/src/cli/pane-functions/headless.ts +4 -0
- package/src/cli/pane-functions/screenshot-evidence.ts +21 -0
- package/src/cli/pane-functions/screenshot.ts +49 -5
- package/src/components/chart/composite/composite-chart.tsx +15 -2
- package/src/components/chart/composite/format.ts +24 -11
- package/src/components/chart/composite/rasterizer.ts +67 -16
- package/src/components/chart/composite/scene.ts +53 -2
- package/src/components/chart/composite/session-shading.ts +3 -2
- package/src/components/chart/composite/text-renderer.ts +52 -1
- package/src/components/chart/composite/time-axis.ts +100 -30
- package/src/components/chart/composite/tools.ts +2 -1
- package/src/components/chart/composite/types.ts +4 -0
- package/src/components/chart-table/index.ts +1 -0
- package/src/components/chart-table/layout.ts +15 -0
- package/src/components/command-bar/action-runtime.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +32 -0
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/pane-templates/items.ts +11 -0
- package/src/components/command-bar/pane-templates/workflow.ts +19 -4
- package/src/components/command-bar/routes/root/command-items.ts +6 -0
- package/src/components/command-bar/routes/root/provider-search.ts +2 -0
- package/src/components/command-bar/routes/root/results.ts +64 -0
- package/src/components/command-bar/routes/root/runtime.ts +8 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +89 -24
- package/src/components/command-bar/routes/ticker-search/route.ts +2 -0
- package/src/components/command-bar/surface/index.tsx +15 -0
- package/src/components/command-bar/view-model.ts +3 -0
- package/src/components/command-bar/workflow/collection-actions.ts +9 -7
- package/src/components/command-bar/workflow/ops.ts +19 -0
- package/src/components/command-bar/workflow/tickers.ts +5 -0
- package/src/components/company-logo.tsx +15 -2
- package/src/components/data-table/table-pane.ts +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/layout/detached-pane-shell.tsx +12 -1
- package/src/components/layout/missing-pane.tsx +87 -23
- package/src/components/layout/pane/footer/index.tsx +64 -18
- package/src/components/layout/pane/footer/model.ts +85 -0
- package/src/components/layout/pane/sidebar.tsx +19 -1
- package/src/components/layout/shell/index.tsx +38 -28
- package/src/components/layout/shell/pane/management-shortcuts.ts +13 -1
- package/src/components/layout/status-bar.tsx +93 -28
- package/src/components/layout/status-widget-space.ts +72 -0
- package/src/components/onboarding/first-run-workspace.ts +8 -2
- package/src/components/onboarding/onboarding-wizard.tsx +35 -16
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +14 -5
- package/src/components/onboarding/wizard-model.ts +13 -5
- package/src/components/onboarding/wizard-positions.ts +56 -7
- package/src/components/price-performance.tsx +31 -34
- package/src/components/ui/data-table/index.tsx +11 -8
- package/src/components/ui/display.tsx +15 -6
- package/src/components/ui/fields.tsx +5 -0
- package/src/components/ui/figure.tsx +94 -0
- package/src/components/ui/header-case.ts +25 -3
- package/src/components/ui/icon.tsx +3 -1
- package/src/components/ui/message-composer.tsx +8 -1
- package/src/components/ui/query-bar.tsx +8 -1
- package/src/components/ui/ratio-bar.tsx +84 -0
- package/src/components/ui/toggle.tsx +3 -1
- package/src/components/use-scrollbox-layout.ts +17 -0
- package/src/core/state/app/layout.ts +35 -1
- package/src/core/state/app/state.ts +15 -0
- package/src/core/state/app/types.ts +1 -0
- package/src/data/config/store/normalize.ts +24 -0
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout-marketplace/pane-imagery.ts +1 -0
- package/src/market-data/coordinator/entries.ts +13 -0
- package/src/market-data/coordinator/financials.ts +33 -8
- package/src/market-data/market/freshness.ts +16 -5
- package/src/market-data/market/trading-sessions.ts +65 -1
- package/src/market-data/published-cn-sessions.ts +25 -0
- package/src/market-data/published-nse-sessions.ts +20 -0
- package/src/news/aggregator.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +6 -1
- package/src/plugins/builtin/account-management/pane.tsx +36 -25
- package/src/plugins/builtin/alerts/catalysts.ts +77 -0
- package/src/plugins/builtin/alerts/events-pane.tsx +3 -0
- package/src/plugins/builtin/alerts/events.ts +10 -4
- package/src/plugins/builtin/alerts/history-pane.tsx +1 -1
- package/src/plugins/builtin/alerts/history.ts +1 -0
- package/src/plugins/builtin/alerts/index.tsx +6 -0
- package/src/plugins/builtin/alerts/research-builder.ts +10 -3
- package/src/plugins/builtin/alerts/research-rules.ts +15 -1
- package/src/plugins/builtin/analytics/risk-client.ts +15 -3
- package/src/plugins/builtin/analytics/risk-headless.ts +123 -18
- package/src/plugins/builtin/attention/client.ts +80 -0
- package/src/plugins/builtin/attention/evidence.ts +30 -0
- package/src/plugins/builtin/attention/headless.ts +33 -0
- package/src/plugins/builtin/attention/index.tsx +18 -0
- package/src/plugins/builtin/attention/model.ts +59 -0
- package/src/plugins/builtin/attention/pane.tsx +211 -0
- package/src/plugins/builtin/attention/trending.tsx +59 -0
- package/src/plugins/builtin/awards/alerts.ts +32 -0
- package/src/plugins/builtin/awards/client.ts +82 -0
- package/src/plugins/builtin/awards/detail.tsx +107 -0
- package/src/plugins/builtin/awards/evidence.ts +36 -0
- package/src/plugins/builtin/awards/headless.ts +55 -0
- package/src/plugins/builtin/awards/index.tsx +20 -0
- package/src/plugins/builtin/awards/model.ts +42 -0
- package/src/plugins/builtin/awards/pane.tsx +263 -0
- package/src/plugins/builtin/catalysts/client.ts +28 -0
- package/src/plugins/builtin/catalysts/detail.tsx +88 -0
- package/src/plugins/builtin/catalysts/evidence.ts +47 -0
- package/src/plugins/builtin/catalysts/headless.ts +42 -0
- package/src/plugins/builtin/catalysts/history.ts +26 -0
- package/src/plugins/builtin/catalysts/index.tsx +29 -0
- package/src/plugins/builtin/catalysts/model.ts +135 -0
- package/src/plugins/builtin/catalysts/pane.tsx +159 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +4 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +6 -0
- package/src/plugins/builtin/chart-composer/index.tsx +8 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +28 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +610 -0
- package/src/plugins/builtin/chat/attachments/files.ts +45 -0
- package/src/plugins/builtin/chat/attachments/model.ts +164 -0
- package/src/plugins/builtin/chat/attachments/terminal.tsx +72 -0
- package/src/plugins/builtin/chat/attachments/transfer.ts +165 -0
- package/src/plugins/builtin/chat/content/channel-navigation.ts +13 -12
- package/src/plugins/builtin/chat/content/composer-runtime.ts +25 -4
- package/src/plugins/builtin/chat/content/composer.tsx +46 -4
- package/src/plugins/builtin/chat/content/footer.tsx +46 -8
- package/src/plugins/builtin/chat/content/index.tsx +263 -62
- package/src/plugins/builtin/chat/content/layout-metrics.ts +10 -2
- package/src/plugins/builtin/chat/content/open-targets.ts +17 -3
- package/src/plugins/builtin/chat/content/scroll.ts +7 -1
- package/src/plugins/builtin/chat/content/shortcuts.ts +36 -11
- package/src/plugins/builtin/chat/content/snapshot.ts +3 -0
- package/src/plugins/builtin/chat/content/transcript.tsx +17 -1
- package/src/plugins/builtin/chat/content/types.ts +7 -0
- package/src/plugins/builtin/chat/controller/attachments.ts +213 -0
- package/src/plugins/builtin/chat/controller/connections.ts +3 -1
- package/src/plugins/builtin/chat/controller/index.ts +114 -2
- package/src/plugins/builtin/chat/controller/lifecycle.ts +9 -0
- package/src/plugins/builtin/chat/controller/messages.ts +35 -2
- package/src/plugins/builtin/chat/controller/send.ts +128 -25
- package/src/plugins/builtin/chat/controller/state.ts +12 -1
- package/src/plugins/builtin/chat/controller/utils.ts +7 -5
- package/src/plugins/builtin/chat/controller/view.ts +2 -0
- package/src/plugins/builtin/chat/index.tsx +21 -0
- package/src/plugins/builtin/chat/layout.ts +9 -4
- package/src/plugins/builtin/chat/message/desktop.tsx +55 -20
- package/src/plugins/builtin/chat/message/header.tsx +30 -5
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +9 -0
- package/src/plugins/builtin/chat/message/pending-send.ts +35 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +5 -1
- package/src/plugins/builtin/chat/message/render-state.ts +12 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +51 -4
- package/src/plugins/builtin/chat/message/types.ts +6 -1
- package/src/plugins/builtin/chat/pane-state.ts +59 -1
- package/src/plugins/builtin/chat/profile-popover.ts +50 -1
- package/src/plugins/builtin/chat/sidebar.tsx +8 -3
- package/src/plugins/builtin/chat/status-widget.tsx +29 -12
- package/src/plugins/builtin/chat/unread-inbox-pane.tsx +143 -0
- package/src/plugins/builtin/chat/unread-inbox.ts +91 -0
- package/src/plugins/builtin/clinical-trials/client.ts +237 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +74 -0
- package/src/plugins/builtin/clinical-trials/pane.tsx +225 -0
- package/src/plugins/builtin/clinical-trials/types.ts +2 -0
- package/src/plugins/builtin/cloud/askg/controller.ts +37 -6
- package/src/plugins/builtin/cloud/askg/executor.ts +59 -44
- package/src/plugins/builtin/cloud/askg/host.ts +8 -1
- package/src/plugins/builtin/cloud/askg/manifest.ts +29 -2
- package/src/plugins/builtin/cloud/askg/model.ts +47 -13
- package/src/plugins/builtin/cloud/askg/notes.ts +100 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +50 -14
- package/src/plugins/builtin/cloud/askg/protocol.ts +39 -1
- package/src/plugins/builtin/cloud/askg/result-budget.ts +156 -0
- package/src/plugins/builtin/cloud/askg/user-data.ts +89 -0
- package/src/plugins/builtin/cloud/auth-actions.tsx +55 -31
- package/src/plugins/builtin/cloud/plugin.tsx +4 -1
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +10 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +2 -2
- package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -2
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +202 -0
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/cloud/upgrade-dialog.tsx +29 -3
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +1 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +1 -1
- package/src/plugins/builtin/comment-letters/client.ts +342 -0
- package/src/plugins/builtin/comment-letters/index.tsx +74 -0
- package/src/plugins/builtin/comment-letters/pane.tsx +295 -0
- package/src/plugins/builtin/comment-letters/types.ts +43 -0
- package/src/plugins/builtin/company-attention/app-rank.tsx +79 -0
- package/src/plugins/builtin/company-attention/client.ts +69 -0
- package/src/plugins/builtin/company-attention/evidence.ts +45 -0
- package/src/plugins/builtin/company-attention/headless.ts +47 -0
- package/src/plugins/builtin/company-attention/index.tsx +30 -0
- package/src/plugins/builtin/company-attention/model.ts +129 -0
- package/src/plugins/builtin/company-attention/pane.tsx +183 -0
- package/src/plugins/builtin/company-kpis/client.ts +92 -0
- package/src/plugins/builtin/company-kpis/headless.ts +32 -0
- package/src/plugins/builtin/company-kpis/index.tsx +26 -0
- package/src/plugins/builtin/company-kpis/model.ts +124 -0
- package/src/plugins/builtin/company-kpis/pane.tsx +226 -0
- package/src/plugins/builtin/company-kpis/related.ts +11 -0
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +44 -0
- package/src/plugins/builtin/composite-plugins.ts +34 -0
- package/src/plugins/builtin/correlation/history.ts +4 -1
- package/src/plugins/builtin/correlation/index.tsx +139 -80
- package/src/plugins/builtin/correlation/matrix/pair-chart.tsx +48 -0
- package/src/plugins/builtin/correlation/matrix/selection.ts +77 -0
- package/src/plugins/builtin/correlation/relationship/model.ts +2 -2
- package/src/plugins/builtin/cpi/client.ts +66 -0
- package/src/plugins/builtin/cpi/headless.ts +78 -0
- package/src/plugins/builtin/cpi/index.tsx +31 -0
- package/src/plugins/builtin/cpi/model.ts +198 -0
- package/src/plugins/builtin/cpi/pane.tsx +157 -0
- package/src/plugins/builtin/credit-documents/client.ts +99 -0
- package/src/plugins/builtin/credit-documents/detail.tsx +109 -0
- package/src/plugins/builtin/credit-documents/evidence.ts +64 -0
- package/src/plugins/builtin/credit-documents/gauge.tsx +55 -0
- package/src/plugins/builtin/credit-documents/headless.ts +40 -0
- package/src/plugins/builtin/credit-documents/index.tsx +19 -0
- package/src/plugins/builtin/credit-documents/model.ts +336 -0
- package/src/plugins/builtin/credit-documents/pane.tsx +185 -0
- package/src/plugins/builtin/custom-view/view-spec.ts +14 -2
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/client.ts +73 -0
- package/src/plugins/builtin/doe/headless.ts +93 -0
- package/src/plugins/builtin/doe/index.tsx +41 -0
- package/src/plugins/builtin/doe/model.ts +215 -0
- package/src/plugins/builtin/doe/pane.tsx +148 -0
- package/src/plugins/builtin/doe/range-bar.tsx +45 -0
- package/src/plugins/builtin/earnings/board.tsx +3 -0
- package/src/plugins/builtin/earnings/index.tsx +2 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +7 -1
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +7 -7
- package/src/plugins/builtin/earnings-ripple/client.ts +60 -0
- package/src/plugins/builtin/earnings-ripple/headless.ts +35 -0
- package/src/plugins/builtin/earnings-ripple/index.tsx +35 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +98 -0
- package/src/plugins/builtin/earnings-ripple/pane.tsx +103 -0
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +1 -1
- package/src/plugins/builtin/equity-screener/model.ts +74 -9
- package/src/plugins/builtin/equity-screener/pane.tsx +2 -0
- package/src/plugins/builtin/estimate-revisions/pane.tsx +3 -0
- package/src/plugins/builtin/executives/pane.tsx +7 -5
- package/src/plugins/builtin/exposure/charts.tsx +66 -0
- package/src/plugins/builtin/exposure/client.ts +53 -0
- package/src/plugins/builtin/exposure/drivers.ts +29 -0
- package/src/plugins/builtin/exposure/editor.tsx +61 -0
- package/src/plugins/builtin/exposure/evidence.ts +39 -0
- package/src/plugins/builtin/exposure/headless.ts +51 -0
- package/src/plugins/builtin/exposure/holdings.ts +56 -0
- package/src/plugins/builtin/exposure/index.tsx +13 -0
- package/src/plugins/builtin/exposure/model.ts +104 -0
- package/src/plugins/builtin/exposure/pane.tsx +247 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +1 -1
- package/src/plugins/builtin/fear-greed/pane.tsx +2 -9
- package/src/plugins/builtin/filing-events/pane.tsx +2 -1
- package/src/plugins/builtin/gpu/board.tsx +163 -0
- package/src/plugins/builtin/gpu/changes.tsx +94 -0
- package/src/plugins/builtin/gpu/client.ts +130 -0
- package/src/plugins/builtin/gpu/equities.tsx +112 -0
- package/src/plugins/builtin/gpu/headless.ts +67 -0
- package/src/plugins/builtin/gpu/history.tsx +140 -0
- package/src/plugins/builtin/gpu/index.tsx +18 -0
- package/src/plugins/builtin/gpu/ladder.tsx +127 -0
- package/src/plugins/builtin/gpu/model.ts +317 -0
- package/src/plugins/builtin/gpu/pane.tsx +63 -0
- package/src/plugins/builtin/help/index.tsx +19 -2
- package/src/plugins/builtin/holders/pane.tsx +5 -9
- package/src/plugins/builtin/insider/detail.tsx +119 -0
- package/src/plugins/builtin/insider/display.ts +221 -0
- package/src/plugins/builtin/insider/headless.ts +24 -3
- package/src/plugins/builtin/insider/index.tsx +206 -108
- package/src/plugins/builtin/insider/insider-data.ts +31 -3
- package/src/plugins/builtin/insider/model.ts +53 -4
- package/src/plugins/builtin/insider/table-model.ts +226 -0
- package/src/plugins/builtin/insider/table.tsx +79 -0
- package/src/plugins/builtin/iv-history/screen-pane.tsx +1 -1
- package/src/plugins/builtin/jobs/pane.tsx +14 -7
- package/src/plugins/builtin/kelly-sizer/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/client.ts +50 -0
- package/src/plugins/builtin/macro-day/headless.ts +51 -0
- package/src/plugins/builtin/macro-day/index.tsx +21 -0
- package/src/plugins/builtin/macro-day/model.ts +137 -0
- package/src/plugins/builtin/macro-day/pane.tsx +118 -0
- package/src/plugins/builtin/macro-day/releases.ts +58 -0
- package/src/plugins/builtin/market-halts/model.ts +30 -17
- package/src/plugins/builtin/market-halts/pane.tsx +15 -21
- package/src/plugins/builtin/market-heatmap/data.ts +1 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +198 -50
- package/src/plugins/builtin/market-heatmap/portfolio.ts +220 -0
- package/src/plugins/builtin/market-movers/index.tsx +1 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +5 -2
- package/src/plugins/builtin/mna/distress/client.ts +326 -0
- package/src/plugins/builtin/mna/distress/detail.tsx +247 -0
- package/src/plugins/builtin/mna/distress/headless.ts +257 -0
- package/src/plugins/builtin/mna/distress/model.ts +427 -0
- package/src/plugins/builtin/mna/distress/pane.tsx +606 -0
- package/src/plugins/builtin/mna/index.tsx +15 -0
- package/src/plugins/builtin/mna/pane.tsx +42 -1
- package/src/plugins/builtin/news/index.tsx +62 -16
- package/src/plugins/builtin/news/wire/filter-articles.ts +54 -0
- package/src/plugins/builtin/news/wire/index.tsx +37 -3
- package/src/plugins/builtin/news/wire/industry-pane.tsx +29 -13
- package/src/plugins/builtin/news/wire/mutes.ts +253 -0
- package/src/plugins/builtin/news/wire/news/command-bar-search.ts +117 -0
- package/src/plugins/builtin/news/wire/news/footer.ts +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +34 -0
- package/src/plugins/builtin/news/wire/news/pop-out.tsx +158 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +64 -19
- package/src/plugins/builtin/openfda/client.ts +300 -0
- package/src/plugins/builtin/openfda/index.tsx +71 -0
- package/src/plugins/builtin/openfda/pane.tsx +382 -0
- package/src/plugins/builtin/openfda/types.ts +76 -0
- package/src/plugins/builtin/options/footer.ts +1 -0
- package/src/plugins/builtin/options/view.tsx +1 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +0 -1
- package/src/plugins/builtin/options-positioning/index.tsx +4 -2
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/client.ts +61 -0
- package/src/plugins/builtin/pe-band/headless.ts +51 -0
- package/src/plugins/builtin/pe-band/index.tsx +20 -0
- package/src/plugins/builtin/pe-band/model.ts +267 -0
- package/src/plugins/builtin/pe-band/pane.tsx +159 -0
- package/src/plugins/builtin/perps/client.ts +66 -0
- package/src/plugins/builtin/perps/equity-row.tsx +28 -0
- package/src/plugins/builtin/perps/headless.ts +34 -0
- package/src/plugins/builtin/perps/index.tsx +14 -0
- package/src/plugins/builtin/perps/model.ts +58 -0
- package/src/plugins/builtin/perps/pane.tsx +185 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +0 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +177 -87
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +6 -20
- package/src/plugins/builtin/portfolio-list/command-bar.ts +6 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +237 -0
- package/src/plugins/builtin/portfolio-list/index.tsx +2 -0
- package/src/plugins/builtin/portfolio-list/mutations.ts +70 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +17 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +88 -5
- package/src/plugins/builtin/portfolio-list/pane/remove-ticker.ts +85 -0
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +18 -12
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +6 -0
- package/src/plugins/builtin/power/client.ts +100 -0
- package/src/plugins/builtin/power/detail.tsx +82 -0
- package/src/plugins/builtin/power/evidence.ts +56 -0
- package/src/plugins/builtin/power/generation.tsx +37 -0
- package/src/plugins/builtin/power/headless.ts +43 -0
- package/src/plugins/builtin/power/index.tsx +16 -0
- package/src/plugins/builtin/power/model.ts +89 -0
- package/src/plugins/builtin/power/pane.tsx +209 -0
- package/src/plugins/builtin/power/query.ts +25 -0
- package/src/plugins/builtin/relative-rotation/pane.tsx +3 -3
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +13 -4
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +11 -9
- package/src/plugins/builtin/research-search/pane.tsx +21 -7
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +35 -0
- package/src/plugins/builtin/reverse-dcf/headless.ts +44 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +20 -0
- package/src/plugins/builtin/reverse-dcf/model.ts +87 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +107 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +6 -5
- package/src/plugins/builtin/scanner/denied.tsx +4 -2
- package/src/plugins/builtin/scanner/feed.ts +1 -0
- package/src/plugins/builtin/scanner/flow-pane.tsx +3 -2
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/seasonality/client.ts +4 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +217 -0
- package/src/plugins/builtin/sec/forms.ts +54 -0
- package/src/plugins/builtin/sec/headless.ts +31 -5
- package/src/plugins/builtin/sec/index.tsx +67 -11
- package/src/plugins/builtin/sec/model.ts +35 -5
- package/src/plugins/builtin/sectors/headless.ts +1 -0
- package/src/plugins/builtin/sectors/index.tsx +72 -26
- package/src/plugins/builtin/shared/cloud-upgrade.ts +143 -39
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +8 -4
- package/src/plugins/builtin/shared/research-cells.tsx +107 -0
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -1
- package/src/plugins/builtin/shared/ticker-request.ts +1 -1
- package/src/plugins/builtin/shared/wall-teaser-catalog.ts +80 -0
- package/src/plugins/builtin/shared/wall-teaser.tsx +192 -0
- package/src/plugins/builtin/shared/wall-view-lifecycle.ts +43 -0
- package/src/plugins/builtin/short-interest/index.tsx +31 -0
- package/src/plugins/builtin/short-interest/watch-client.ts +70 -0
- package/src/plugins/builtin/short-interest/watch-headless.ts +49 -0
- package/src/plugins/builtin/short-interest/watch-model.ts +185 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +169 -0
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/client.ts +104 -0
- package/src/plugins/builtin/supply-chain/disclosure-quote.tsx +17 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +88 -0
- package/src/plugins/builtin/supply-chain/flow-layout.ts +133 -0
- package/src/plugins/builtin/supply-chain/flow.tsx +323 -0
- package/src/plugins/builtin/supply-chain/graph-client.ts +83 -0
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +25 -0
- package/src/plugins/builtin/supply-chain/graph-model.ts +45 -0
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +218 -0
- package/src/plugins/builtin/supply-chain/graph.tsx +163 -0
- package/src/plugins/builtin/supply-chain/headless.ts +105 -0
- package/src/plugins/builtin/supply-chain/index.tsx +17 -0
- package/src/plugins/builtin/supply-chain/model.ts +145 -0
- package/src/plugins/builtin/supply-chain/pane.tsx +276 -0
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +96 -0
- package/src/plugins/builtin/supply-chain/trust.ts +34 -0
- package/src/plugins/builtin/themes/client.ts +39 -0
- package/src/plugins/builtin/themes/headless.ts +38 -0
- package/src/plugins/builtin/themes/model.ts +92 -0
- package/src/plugins/builtin/themes/pane.tsx +125 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +6 -15
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +5 -6
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +201 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +327 -0
- package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +5 -2
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +60 -12
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -2
- package/src/plugins/builtin/ticker-detail/index.tsx +22 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +53 -30
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +112 -47
- package/src/plugins/builtin/ticker-detail/pane.tsx +50 -6
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +21 -42
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +3 -0
- package/src/plugins/builtin/time-sales/pane.tsx +1 -1
- package/src/plugins/builtin/world-indices/indices.ts +1 -0
- package/src/plugins/catalog-browser.ts +40 -0
- package/src/plugins/catalog-manifest.ts +3 -0
- package/src/plugins/catalog-ui.ts +6 -0
- package/src/plugins/current-target.ts +0 -9
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/browser/cloud-transport.ts +66 -1
- package/src/renderers/browser/main.tsx +2 -0
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/desktop/controls.tsx +38 -25
- package/src/renderers/dom/desktop/icons.tsx +8 -0
- package/src/renderers/dom/host/chart-surface.tsx +36 -2
- package/src/renderers/dom/host/focus-scope.ts +11 -1
- package/src/renderers/dom/styles.css +28 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -2
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -1
- package/src/renderers/electrobun/view/http-fetch.ts +2 -0
- package/src/renderers/electrobun/view/main.tsx +3 -1
- package/src/renderers/electrobun/view/rpc-timeout.ts +59 -0
- package/src/renderers/opentui/start.tsx +3 -0
- package/src/shares/api.ts +3 -1
- package/src/sources/gloomberb-cloud/index.ts +47 -13
- package/src/sources/history-result.ts +1 -0
- package/src/sources/history-retention.ts +16 -0
- package/src/sources/provider-router/history.ts +4 -2
- package/src/sources/sec-edgar/identity.ts +36 -0
- package/src/sources/sec-edgar.ts +1 -34
- package/src/state/app/context/index.tsx +8 -0
- package/src/sync/core-contributors.ts +20 -2
- package/src/telemetry/attention-counts.ts +164 -0
- package/src/telemetry/live-config.ts +7 -0
- package/src/test-support/rpc-loopback.ts +7 -3
- package/src/test-support/shell-pane-keys.tsx +34 -0
- package/src/tickers/instrument-kind.ts +12 -6
- package/src/tickers/open-target.ts +1 -1
- package/src/tickers/search/asset-classes.ts +91 -0
- package/src/tickers/search/index.ts +62 -15
- package/src/tickers/search/ranking.ts +22 -3
- package/src/tickers/search/upsert.ts +4 -1
- package/src/time-series/live-bars.ts +8 -3
- package/src/time-series/resolve.ts +224 -17
- package/src/time-series/spec.ts +1 -0
- package/src/time-series/types.ts +9 -1
- package/src/types/config.ts +23 -1
- package/src/types/data-provider.ts +2 -0
- package/src/types/headless.ts +17 -0
- package/src/types/price-history.ts +2 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/double-escape-close.ts +20 -0
- package/src/utils/exchanges.ts +1 -0
- package/src/utils/html-entities.ts +15 -0
- package/src/utils/http-proxy-response.ts +44 -7
- package/src/utils/plugin-proxy-hosts.json +3 -0
- package/src/utils/price-history.ts +35 -1
- package/src/utils/sec.ts +21 -2
- package/src/utils/text-wrap.ts +13 -8
- package/src/utils/zoned-date-time.ts +67 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import type { NewsFeed, NewsQuery } from "../../../../news/types";
|
|
3
|
+
import { getSharedNewsService } from "../../../../news/hooks";
|
|
4
|
+
import { usePluginConfigState } from "../../../runtime";
|
|
5
|
+
import type {
|
|
6
|
+
PaneSettingField,
|
|
7
|
+
PaneSettingOption,
|
|
8
|
+
PaneSettingsContext,
|
|
9
|
+
PaneSettingsDef,
|
|
10
|
+
} from "../../../../types/plugin";
|
|
11
|
+
import { NEWS_QUERY_PRESETS, parseNewsIndustryCode } from "./news/query-presets";
|
|
12
|
+
|
|
13
|
+
/** Plugin id that owns the news settings in `config.pluginConfig`. */
|
|
14
|
+
const NEWS_PLUGIN_ID = "news";
|
|
15
|
+
|
|
16
|
+
/** Saved as `pluginConfig.news.newsMutedSources`: the picker writes string[]. */
|
|
17
|
+
export const NEWS_MUTED_SOURCES_KEY = "newsMutedSources";
|
|
18
|
+
/** Saved as `pluginConfig.news.newsMutedKeywords`: the text field edits a comma-separated string. */
|
|
19
|
+
export const NEWS_MUTED_KEYWORDS_KEY = "newsMutedKeywords";
|
|
20
|
+
|
|
21
|
+
/** Guard against a runaway saved value flooding every filter pass. */
|
|
22
|
+
export const MAX_MUTED_KEYWORDS = 200;
|
|
23
|
+
|
|
24
|
+
export interface NewsMutes {
|
|
25
|
+
sources: string[];
|
|
26
|
+
keywords: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function pushUnique(seen: Set<string>, values: string[], entry: string): void {
|
|
30
|
+
const key = entry.toLowerCase();
|
|
31
|
+
if (!key || seen.has(key)) return;
|
|
32
|
+
seen.add(key);
|
|
33
|
+
values.push(entry);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Muted publishers saved by the Muted Sources picker. */
|
|
37
|
+
export function parseNewsMutedSources(value: unknown): string[] {
|
|
38
|
+
if (!Array.isArray(value)) return [];
|
|
39
|
+
const seen = new Set<string>();
|
|
40
|
+
const sources: string[] = [];
|
|
41
|
+
for (const entry of value) {
|
|
42
|
+
if (typeof entry !== "string") continue;
|
|
43
|
+
pushUnique(seen, sources, entry.trim());
|
|
44
|
+
}
|
|
45
|
+
return sources;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function rawKeywordEntries(value: unknown): unknown[] {
|
|
49
|
+
if (Array.isArray(value)) return value;
|
|
50
|
+
if (typeof value === "string") return [value];
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Muted keywords saved by the Muted Keywords text field. Accepts the raw
|
|
56
|
+
* comma-separated string the field edits, plus a string[] for programmatic
|
|
57
|
+
* writes; entries may themselves contain separators.
|
|
58
|
+
*/
|
|
59
|
+
export function parseNewsMutedKeywords(value: unknown): string[] {
|
|
60
|
+
const seen = new Set<string>();
|
|
61
|
+
const keywords: string[] = [];
|
|
62
|
+
for (const raw of rawKeywordEntries(value)) {
|
|
63
|
+
if (typeof raw !== "string") continue;
|
|
64
|
+
for (const token of raw.split(/[,;\n]/)) {
|
|
65
|
+
pushUnique(seen, keywords, token.trim());
|
|
66
|
+
if (keywords.length >= MAX_MUTED_KEYWORDS) return keywords;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return keywords;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function readNewsMutesFromPluginConfig(
|
|
73
|
+
pluginConfig: Record<string, unknown> | undefined,
|
|
74
|
+
): NewsMutes {
|
|
75
|
+
return {
|
|
76
|
+
sources: parseNewsMutedSources(pluginConfig?.[NEWS_MUTED_SOURCES_KEY]),
|
|
77
|
+
keywords: parseNewsMutedKeywords(pluginConfig?.[NEWS_MUTED_KEYWORDS_KEY]),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Feed lists only. Top News and Breaking News keep every story. */
|
|
82
|
+
export function newsMutesApplyToFeed(feed: NewsFeed | undefined): boolean {
|
|
83
|
+
return feed === "latest" || feed === "ticker" || feed === "sector" || feed === "topic";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function normalizedMuteTerms(values: readonly string[]): string[] {
|
|
87
|
+
const terms: string[] = [];
|
|
88
|
+
const seen = new Set<string>();
|
|
89
|
+
for (const value of values) {
|
|
90
|
+
const key = value.trim().toLowerCase();
|
|
91
|
+
if (!key || seen.has(key)) continue;
|
|
92
|
+
seen.add(key);
|
|
93
|
+
terms.push(key);
|
|
94
|
+
}
|
|
95
|
+
return terms;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function articleMatchesMute(
|
|
99
|
+
article: { source?: string; title?: string },
|
|
100
|
+
sources: ReadonlySet<string>,
|
|
101
|
+
keywords: readonly string[],
|
|
102
|
+
): boolean {
|
|
103
|
+
const source = (article.source ?? "").trim().toLowerCase();
|
|
104
|
+
if (source && sources.has(source)) return true;
|
|
105
|
+
const title = (article.title ?? "").trim().toLowerCase();
|
|
106
|
+
if (!title) return false;
|
|
107
|
+
return keywords.some((keyword) => title.includes(keyword));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Drops stories whose publisher or headline matches a mute. Empty lists mute nothing. */
|
|
111
|
+
export function applyNewsMutes<T extends { source?: string; title?: string }>(
|
|
112
|
+
articles: readonly T[],
|
|
113
|
+
mutes: { sources: readonly string[]; keywords: readonly string[] } | null | undefined,
|
|
114
|
+
): T[] {
|
|
115
|
+
if (!mutes) return articles as T[];
|
|
116
|
+
const sources = normalizedMuteTerms(mutes.sources);
|
|
117
|
+
const keywords = normalizedMuteTerms(mutes.keywords);
|
|
118
|
+
if (sources.length === 0 && keywords.length === 0) return articles as T[];
|
|
119
|
+
const sourceSet = new Set(sources);
|
|
120
|
+
return articles.filter((article) => !articleMatchesMute(article, sourceSet, keywords));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function useNewsMuteFilter<T extends { source?: string; title?: string }>(
|
|
124
|
+
articles: readonly T[],
|
|
125
|
+
enabled: boolean,
|
|
126
|
+
): T[] {
|
|
127
|
+
const [sourcesValue] = usePluginConfigState<unknown>(NEWS_MUTED_SOURCES_KEY, null);
|
|
128
|
+
const [keywordsValue] = usePluginConfigState<unknown>(NEWS_MUTED_KEYWORDS_KEY, null);
|
|
129
|
+
return useMemo(() => {
|
|
130
|
+
if (!enabled) return articles as T[];
|
|
131
|
+
return applyNewsMutes(articles, {
|
|
132
|
+
sources: parseNewsMutedSources(sourcesValue),
|
|
133
|
+
keywords: parseNewsMutedKeywords(keywordsValue),
|
|
134
|
+
});
|
|
135
|
+
}, [articles, enabled, keywordsValue, sourcesValue]);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Cap keeps the picker usable when hundreds of feeds have loaded. */
|
|
139
|
+
const MAX_SOURCE_OPTIONS = 200;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Publisher vocabulary for the Muted Sources picker: distinct `source` values
|
|
143
|
+
* from recently loaded articles, plus already-muted names so a source with no
|
|
144
|
+
* recent stories can still be un-muted.
|
|
145
|
+
*/
|
|
146
|
+
export function collectNewsSourceOptions(
|
|
147
|
+
articles: readonly { source?: string }[],
|
|
148
|
+
extraSources: readonly string[] = [],
|
|
149
|
+
): PaneSettingOption[] {
|
|
150
|
+
const seen = new Set<string>();
|
|
151
|
+
const extraKeys = new Set<string>();
|
|
152
|
+
const names: string[] = [];
|
|
153
|
+
for (const source of extraSources) {
|
|
154
|
+
const trimmed = source.trim();
|
|
155
|
+
const key = trimmed.toLowerCase();
|
|
156
|
+
if (!key) continue;
|
|
157
|
+
extraKeys.add(key);
|
|
158
|
+
pushUnique(seen, names, trimmed);
|
|
159
|
+
}
|
|
160
|
+
for (const article of articles) {
|
|
161
|
+
pushUnique(seen, names, (article.source ?? "").trim());
|
|
162
|
+
}
|
|
163
|
+
const sorted = names.sort((left, right) => left.localeCompare(right));
|
|
164
|
+
const retainedExtraKeys = new Set([...extraKeys].slice(0, MAX_SOURCE_OPTIONS));
|
|
165
|
+
// Keep currently-muted sources selectable before filling the rest of the
|
|
166
|
+
// picker, so a muted name is not stranded behind the article cap.
|
|
167
|
+
let visible = sorted;
|
|
168
|
+
if (sorted.length > MAX_SOURCE_OPTIONS) {
|
|
169
|
+
const mutedNames = sorted.filter((name) => retainedExtraKeys.has(name.toLowerCase()));
|
|
170
|
+
const others = sorted
|
|
171
|
+
.filter((name) => !retainedExtraKeys.has(name.toLowerCase()))
|
|
172
|
+
.slice(0, Math.max(0, MAX_SOURCE_OPTIONS - retainedExtraKeys.size));
|
|
173
|
+
visible = [...mutedNames, ...others].sort((left, right) => left.localeCompare(right));
|
|
174
|
+
}
|
|
175
|
+
return visible.map((name) => ({ value: name, label: name }));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function pluginNewsState(paneState: Record<string, unknown>): Record<string, unknown> {
|
|
179
|
+
const pluginState = paneState.pluginState;
|
|
180
|
+
if (!pluginState || typeof pluginState !== "object") return {};
|
|
181
|
+
const news = (pluginState as Record<string, unknown>)[NEWS_PLUGIN_ID];
|
|
182
|
+
if (!news || typeof news !== "object") return {};
|
|
183
|
+
return news as Record<string, unknown>;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function articlesInPaneState(paneState: Record<string, unknown>): { source?: string }[] {
|
|
187
|
+
const articles: { source?: string }[] = [];
|
|
188
|
+
for (const value of Object.values(pluginNewsState(paneState))) {
|
|
189
|
+
if (!Array.isArray(value)) continue;
|
|
190
|
+
for (const entry of value) {
|
|
191
|
+
if (!entry || typeof entry !== "object") continue;
|
|
192
|
+
const source = (entry as { source?: unknown }).source;
|
|
193
|
+
if (typeof source === "string") articles.push({ source });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return articles;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function muteSourceQuery(context: PaneSettingsContext): NewsQuery | null {
|
|
200
|
+
if (context.paneType === "news-feed") return NEWS_QUERY_PRESETS.feed;
|
|
201
|
+
if (context.paneType === "ticker-news") {
|
|
202
|
+
if (!context.activeTicker) return null;
|
|
203
|
+
return NEWS_QUERY_PRESETS.ticker(context.activeTicker);
|
|
204
|
+
}
|
|
205
|
+
if (context.paneType !== "news-industry") return null;
|
|
206
|
+
const saved = pluginNewsState(context.paneState)["industry:category"];
|
|
207
|
+
const fromParams = context.pane.params?.code;
|
|
208
|
+
const code = typeof saved === "string" ? saved : fromParams;
|
|
209
|
+
const entry = parseNewsIndustryCode(typeof code === "string" ? code : "");
|
|
210
|
+
if (!entry) return null;
|
|
211
|
+
if (entry.topic) return NEWS_QUERY_PRESETS.topic(entry.topic);
|
|
212
|
+
return NEWS_QUERY_PRESETS.sectorAll;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function articlesForMuteSettings(context: PaneSettingsContext): { source?: string }[] {
|
|
216
|
+
const fromPane = articlesInPaneState(context.paneState);
|
|
217
|
+
const service = getSharedNewsService();
|
|
218
|
+
const query = muteSourceQuery(context);
|
|
219
|
+
if (!service || !query) return fromPane;
|
|
220
|
+
return [...fromPane, ...service.getQueryState(query).articles];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function newsMuteSettingFields(
|
|
224
|
+
articles: readonly { source?: string }[],
|
|
225
|
+
mutedSources: readonly string[],
|
|
226
|
+
): PaneSettingField[] {
|
|
227
|
+
return [
|
|
228
|
+
{
|
|
229
|
+
key: NEWS_MUTED_SOURCES_KEY,
|
|
230
|
+
label: "Muted Sources",
|
|
231
|
+
description: "Hide these publishers' stories in News Feed, Topic News and Ticker News. Top News and Breaking News still show them.",
|
|
232
|
+
type: "multi-select",
|
|
233
|
+
storage: "plugin",
|
|
234
|
+
options: collectNewsSourceOptions(articles, mutedSources),
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
key: NEWS_MUTED_KEYWORDS_KEY,
|
|
238
|
+
label: "Muted Keywords",
|
|
239
|
+
description: "Hide stories whose headline contains any of these, separated by commas, in News Feed, Topic News and Ticker News.",
|
|
240
|
+
type: "text",
|
|
241
|
+
storage: "plugin",
|
|
242
|
+
placeholder: "crypto, earnings call",
|
|
243
|
+
},
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export function newsMuteSettingsDef(context: PaneSettingsContext, title: string): PaneSettingsDef {
|
|
248
|
+
const mutes = readNewsMutesFromPluginConfig(context.config.pluginConfig[NEWS_PLUGIN_ID]);
|
|
249
|
+
return {
|
|
250
|
+
title,
|
|
251
|
+
fields: newsMuteSettingFields(articlesForMuteSettings(context), mutes.sources),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { apiClient } from "../../../../../api-client";
|
|
2
|
+
import { getSharedNewsService } from "../../../../../news/hooks";
|
|
3
|
+
import type { NewsService } from "../../../../../news/aggregator";
|
|
4
|
+
import type { NewsArticle } from "../../../../../news/types";
|
|
5
|
+
import type {
|
|
6
|
+
CommandBarResultDef,
|
|
7
|
+
CommandBarSearchProvider,
|
|
8
|
+
GloomPluginContext,
|
|
9
|
+
} from "../../../../../types/plugin";
|
|
10
|
+
import { formatFeedTime } from "../../../../../utils/datetime-format";
|
|
11
|
+
import { openNewsStoryPane } from "./pop-out";
|
|
12
|
+
import { NEWS_QUERY_PRESETS } from "./query-presets";
|
|
13
|
+
|
|
14
|
+
/** The corpus News section shows four as well, and each costs a row of the sheet. */
|
|
15
|
+
const STORY_ROW_LIMIT = 4;
|
|
16
|
+
|
|
17
|
+
/** A word keeps inner hyphens and dots, so "10-K" and "U.S." stay one word. */
|
|
18
|
+
const WORD = /[\p{L}\p{N}]+(?:[-.][\p{L}\p{N}]+)*/gu;
|
|
19
|
+
|
|
20
|
+
function queryTokens(query: string): string[] {
|
|
21
|
+
// One-letter words would match nearly every story by prefix.
|
|
22
|
+
return (query.toLowerCase().match(WORD) ?? []).filter((token) => token.length >= 2);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Each word, and the parts of a hyphenated one, so "driven" still finds "AI-driven". */
|
|
26
|
+
function storyWords(article: NewsArticle): string[] {
|
|
27
|
+
const words = `${article.title} ${article.summary ?? ""} ${article.source}`.toLowerCase().match(WORD) ?? [];
|
|
28
|
+
return words.flatMap((word) => (/[-.]/.test(word) ? [word, ...word.split(/[-.]/)] : [word]));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Loaded stories whose headline, summary, source or tickers have a word that
|
|
33
|
+
* starts with every word of the query, newest first. Prefixes rather than
|
|
34
|
+
* substrings, so "hor" finds Hormuz but not every "author" and "shortage".
|
|
35
|
+
*/
|
|
36
|
+
export function matchLoadedStories(
|
|
37
|
+
articles: readonly NewsArticle[],
|
|
38
|
+
query: string,
|
|
39
|
+
limit = STORY_ROW_LIMIT,
|
|
40
|
+
): NewsArticle[] {
|
|
41
|
+
const tokens = queryTokens(query);
|
|
42
|
+
if (tokens.length === 0) return [];
|
|
43
|
+
return articles
|
|
44
|
+
.filter((article) => {
|
|
45
|
+
const words = storyWords(article);
|
|
46
|
+
const tickers = article.tickers.map((ticker) => ticker.toLowerCase());
|
|
47
|
+
return tokens.every((token) => (
|
|
48
|
+
tickers.some((ticker) => ticker.startsWith(token))
|
|
49
|
+
|| words.some((word) => word.startsWith(token))
|
|
50
|
+
));
|
|
51
|
+
})
|
|
52
|
+
.sort((left, right) => right.publishedAt.getTime() - left.publishedAt.getTime())
|
|
53
|
+
.slice(0, limit);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface StorySearchDeps {
|
|
57
|
+
getService(): NewsService | null;
|
|
58
|
+
isSignedIn(): boolean;
|
|
59
|
+
now(): number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const defaultDeps: StorySearchDeps = {
|
|
63
|
+
getService: getSharedNewsService,
|
|
64
|
+
isSignedIn: () => apiClient.isSignedIn(),
|
|
65
|
+
now: Date.now,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
let warming: Promise<unknown> | null = null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Unless News Feed is open, the app may hold few stories or none, so a lookup
|
|
72
|
+
* first loads the latest feed News Feed reads (the same request, delayed when
|
|
73
|
+
* the account has no live news). The service keeps it for a while after, so
|
|
74
|
+
* later lookups reuse it instead of asking again.
|
|
75
|
+
*/
|
|
76
|
+
async function warmLatestStories(service: NewsService): Promise<void> {
|
|
77
|
+
if (service.getQueryState(NEWS_QUERY_PRESETS.feed).articles.length > 0) return;
|
|
78
|
+
warming ??= service.load(NEWS_QUERY_PRESETS.feed).catch(() => null).finally(() => {
|
|
79
|
+
warming = null;
|
|
80
|
+
});
|
|
81
|
+
await warming;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Stories the app has already loaded, for a signed-out command bar. Signed in,
|
|
86
|
+
* the News section comes from the Gloom Cloud corpus search instead, which
|
|
87
|
+
* covers these stories and much more, so this stays quiet rather than listing
|
|
88
|
+
* the same story twice.
|
|
89
|
+
*/
|
|
90
|
+
export function createLoadedStorySearchProvider(
|
|
91
|
+
ctx: Pick<GloomPluginContext, "createPaneFromTemplate">,
|
|
92
|
+
deps: StorySearchDeps = defaultDeps,
|
|
93
|
+
): CommandBarSearchProvider {
|
|
94
|
+
return {
|
|
95
|
+
id: "news:loaded-stories",
|
|
96
|
+
category: "News",
|
|
97
|
+
priority: 190,
|
|
98
|
+
minQueryLength: 3,
|
|
99
|
+
debounceMs: 150,
|
|
100
|
+
async provide(query, _context, signal): Promise<CommandBarResultDef[]> {
|
|
101
|
+
if (deps.isSignedIn()) return [];
|
|
102
|
+
const service = deps.getService();
|
|
103
|
+
if (!service) return [];
|
|
104
|
+
await warmLatestStories(service);
|
|
105
|
+
if (signal.aborted) return [];
|
|
106
|
+
const now = deps.now();
|
|
107
|
+
return matchLoadedStories(service.listArticles(), query).map((article) => ({
|
|
108
|
+
id: article.id,
|
|
109
|
+
label: article.title,
|
|
110
|
+
detail: article.source,
|
|
111
|
+
right: formatFeedTime(article.publishedAt, now),
|
|
112
|
+
keywords: article.tickers,
|
|
113
|
+
execute: () => openNewsStoryPane(article, ctx.createPaneFromTemplate),
|
|
114
|
+
}));
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -24,6 +24,7 @@ interface UseNewsArticleFooterOptions {
|
|
|
24
24
|
info?: PaneFooterSegment[];
|
|
25
25
|
loading?: boolean;
|
|
26
26
|
error?: string | null;
|
|
27
|
+
onPopOut?: () => void;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export function useNewsArticleFooter({
|
|
@@ -33,6 +34,7 @@ export function useNewsArticleFooter({
|
|
|
33
34
|
info,
|
|
34
35
|
loading = false,
|
|
35
36
|
error,
|
|
37
|
+
onPopOut,
|
|
36
38
|
}: UseNewsArticleFooterOptions) {
|
|
37
39
|
const language = useAppLanguage();
|
|
38
40
|
const { publicSharing } = useUiCapabilities();
|
|
@@ -54,6 +56,7 @@ export function useNewsArticleFooter({
|
|
|
54
56
|
delayLabel: tf("{count}h", { count: CLOUD_NEWS_DELAY_HOURS }),
|
|
55
57
|
focused,
|
|
56
58
|
segmentId: "news-access",
|
|
59
|
+
placement: "news-footer",
|
|
57
60
|
shortcutScope: `${registrationId}:news-upgrade`,
|
|
58
61
|
});
|
|
59
62
|
|
|
@@ -77,6 +80,7 @@ export function useNewsArticleFooter({
|
|
|
77
80
|
...(publicSharing && article?.title && paneInstanceId
|
|
78
81
|
? [{ id: "share", key: "y", label: " share", onPress: shareArticle }]
|
|
79
82
|
: []),
|
|
83
|
+
...(onPopOut ? [{ id: "pop-out", key: "p", label: "op out", onPress: onPopOut }] : []),
|
|
80
84
|
],
|
|
81
85
|
showOpenHint: true,
|
|
82
86
|
loading,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
import { usePaneFooter, useQueryBarSearch } from "../../../../../components";
|
|
3
|
+
import type { NewsArticle } from "../../../../../news/types";
|
|
4
|
+
import { filterNewsArticles } from "../filter-articles";
|
|
5
|
+
|
|
6
|
+
/** Only what the list has loaded is filtered; older stories load as the list scrolls. */
|
|
7
|
+
export const NEWS_LIST_SEARCH_PLACEHOLDER = "filter loaded stories";
|
|
8
|
+
|
|
9
|
+
export function useNewsListSearch<T extends NewsArticle>(articles: readonly T[]) {
|
|
10
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
11
|
+
const { active, focus, blur, searchProps } = useQueryBarSearch();
|
|
12
|
+
const filteredArticles = useMemo(
|
|
13
|
+
() => filterNewsArticles(articles, searchQuery),
|
|
14
|
+
[articles, searchQuery],
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
searchQuery,
|
|
19
|
+
searchFocused: active,
|
|
20
|
+
filteredArticles,
|
|
21
|
+
focusSearch: focus,
|
|
22
|
+
blurSearch: blur,
|
|
23
|
+
searchProps,
|
|
24
|
+
setSearchQuery,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function useNewsListSearchHint(registrationId: string, visible: boolean, onPress: () => void) {
|
|
29
|
+
usePaneFooter(`${registrationId}:search`, () => (
|
|
30
|
+
visible
|
|
31
|
+
? { hints: [{ id: "search", key: "/", label: "search", onPress }] }
|
|
32
|
+
: null
|
|
33
|
+
), [onPress, registrationId, visible]);
|
|
34
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
|
+
import type { NewsArticle } from "../../../../../news/types";
|
|
3
|
+
import { mergeNewsArticle } from "../../../../../news/news-model";
|
|
4
|
+
import { useLoadNewsStory } from "../../../../../news/hooks";
|
|
5
|
+
import { PaneStatusBody } from "../../../../../components";
|
|
6
|
+
import { usePaneInstance } from "../../../../../state/app/context";
|
|
7
|
+
import type { PaneProps, PaneTemplateCreateOptions, PaneTemplateDef } from "../../../../../types/plugin";
|
|
8
|
+
import { usePluginAppActions } from "../../../../runtime";
|
|
9
|
+
import { usePersistedNewsArticles } from "../persisted-articles";
|
|
10
|
+
import { NewsDetailView } from "./detail-view";
|
|
11
|
+
import { useNewsArticleFooter } from "./footer";
|
|
12
|
+
|
|
13
|
+
export const NEWS_STORY_PANE_ID = "news-story";
|
|
14
|
+
const NEWS_STORY_TEMPLATE_ID = "news-story-pane";
|
|
15
|
+
const NO_STORY: NewsArticle[] = [];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Stories on their way from a list to the pane just opened for them. Once
|
|
19
|
+
* open, the pane keeps its own copy in pane state, so this only has to cover
|
|
20
|
+
* the hand-off and stays small.
|
|
21
|
+
*/
|
|
22
|
+
const MAX_HANDED_OFF_STORIES = 20;
|
|
23
|
+
const handedOffStories = new Map<string, NewsArticle>();
|
|
24
|
+
|
|
25
|
+
function handOffNewsStory(article: NewsArticle): void {
|
|
26
|
+
handedOffStories.delete(article.id);
|
|
27
|
+
handedOffStories.set(article.id, article);
|
|
28
|
+
for (const id of handedOffStories.keys()) {
|
|
29
|
+
if (handedOffStories.size <= MAX_HANDED_OFF_STORIES) break;
|
|
30
|
+
handedOffStories.delete(id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function handedOffStory(articleId: string): NewsArticle | null {
|
|
35
|
+
if (!articleId) return null;
|
|
36
|
+
return handedOffStories.get(articleId) ?? null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const openNewsStoryPane = (
|
|
40
|
+
article: NewsArticle,
|
|
41
|
+
createPaneFromTemplate: (templateId: string, options?: PaneTemplateCreateOptions) => void,
|
|
42
|
+
): void => {
|
|
43
|
+
handOffNewsStory(article);
|
|
44
|
+
createPaneFromTemplate(NEWS_STORY_TEMPLATE_ID, {
|
|
45
|
+
arg: article.id,
|
|
46
|
+
values: { title: article.title },
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export function usePopOutNewsArticle(onReturnedToList?: () => void) {
|
|
51
|
+
const { createPaneFromTemplate } = usePluginAppActions();
|
|
52
|
+
|
|
53
|
+
return useCallback((article: NewsArticle | null | undefined) => {
|
|
54
|
+
if (!article) return;
|
|
55
|
+
openNewsStoryPane(article, createPaneFromTemplate);
|
|
56
|
+
onReturnedToList?.();
|
|
57
|
+
}, [createPaneFromTemplate, onReturnedToList]);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function createNewsStoryPaneTemplate(): PaneTemplateDef {
|
|
61
|
+
return {
|
|
62
|
+
id: NEWS_STORY_TEMPLATE_ID,
|
|
63
|
+
paneId: NEWS_STORY_PANE_ID,
|
|
64
|
+
label: "Story",
|
|
65
|
+
description: "One news story in its own pane.",
|
|
66
|
+
canCreate: (_context, options) => !!options?.arg?.trim(),
|
|
67
|
+
createInstance: (_context, options) => {
|
|
68
|
+
const articleId = options?.arg?.trim() ?? "";
|
|
69
|
+
if (!articleId) return null;
|
|
70
|
+
return {
|
|
71
|
+
title: options?.values?.title?.trim() || "Story",
|
|
72
|
+
params: { articleId },
|
|
73
|
+
placement: "floating",
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function NewsStoryPane({ focused, width }: PaneProps) {
|
|
80
|
+
const articleId = usePaneInstance()?.params?.articleId ?? "";
|
|
81
|
+
const loadNewsStory = useLoadNewsStory();
|
|
82
|
+
const [loaded, setLoaded] = useState<NewsArticle | null>(() => handedOffStory(articleId));
|
|
83
|
+
// The pane keeps a copy of its story, so a relaunch or a shared layout shows
|
|
84
|
+
// it at once, including a story from an RSS feed that cannot be fetched by id.
|
|
85
|
+
const story = useMemo(() => (loaded?.id === articleId ? [loaded] : NO_STORY), [articleId, loaded]);
|
|
86
|
+
const kept = usePersistedNewsArticles("story", story);
|
|
87
|
+
const article = kept.find((entry) => entry.id === articleId) ?? null;
|
|
88
|
+
const [loading, setLoading] = useState(false);
|
|
89
|
+
const [error, setError] = useState<string | null>(null);
|
|
90
|
+
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
setError(null);
|
|
93
|
+
if (!articleId) {
|
|
94
|
+
setLoading(false);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
let active = true;
|
|
98
|
+
setLoading(true);
|
|
99
|
+
void loadNewsStory(articleId)
|
|
100
|
+
.then((story) => {
|
|
101
|
+
if (!active) return;
|
|
102
|
+
if (story) {
|
|
103
|
+
setLoaded((current) => (current?.id === story.id ? mergeNewsArticle(current, story) : story));
|
|
104
|
+
} else {
|
|
105
|
+
setError("Story detail unavailable.");
|
|
106
|
+
}
|
|
107
|
+
setLoading(false);
|
|
108
|
+
})
|
|
109
|
+
.catch((cause: unknown) => {
|
|
110
|
+
if (!active) return;
|
|
111
|
+
setError(cause instanceof Error ? cause.message : "Story detail unavailable.");
|
|
112
|
+
setLoading(false);
|
|
113
|
+
});
|
|
114
|
+
return () => {
|
|
115
|
+
active = false;
|
|
116
|
+
};
|
|
117
|
+
}, [articleId, loadNewsStory]);
|
|
118
|
+
|
|
119
|
+
// A story already on screen stays readable when the refresh fails.
|
|
120
|
+
useNewsArticleFooter({
|
|
121
|
+
registrationId: "news-story",
|
|
122
|
+
focused,
|
|
123
|
+
article,
|
|
124
|
+
loading: loading && !article,
|
|
125
|
+
error: article ? null : error,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (!articleId) {
|
|
129
|
+
return (
|
|
130
|
+
<PaneStatusBody
|
|
131
|
+
empty
|
|
132
|
+
subject="Story"
|
|
133
|
+
emptyTitle="No story open."
|
|
134
|
+
emptyMessage="Open one from a news list."
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
if (!article) {
|
|
139
|
+
return (
|
|
140
|
+
<PaneStatusBody
|
|
141
|
+
loading={loading}
|
|
142
|
+
error={error}
|
|
143
|
+
empty={!loading && !error}
|
|
144
|
+
subject="Story"
|
|
145
|
+
emptyTitle="Story unavailable."
|
|
146
|
+
emptyMessage="Open it again from the list."
|
|
147
|
+
/>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
return (
|
|
151
|
+
<NewsDetailView
|
|
152
|
+
item={article}
|
|
153
|
+
focused={focused}
|
|
154
|
+
width={width}
|
|
155
|
+
showTitle={false}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
}
|