gloomberb 0.16.1 → 0.16.2
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 +2 -1
- package/package.json +2 -1
- package/src/api-client/beneficial-owners.ts +92 -0
- package/src/api-client/data.ts +26 -8
- package/src/api-client/errors.ts +12 -0
- package/src/api-client/geo.ts +363 -0
- package/src/api-client/index.ts +2 -0
- package/src/api-client/market-discovery.ts +10 -0
- package/src/api-client/paths.ts +30 -1
- package/src/api-client/perps.ts +37 -0
- package/src/api-client/request.ts +5 -2
- package/src/api-client/types.ts +2 -0
- package/src/brokers/account-cache.ts +24 -0
- package/src/cli/commands/command-utils.ts +8 -0
- package/src/cli/commands/crypto-hints.ts +75 -0
- package/src/cli/commands/market.ts +414 -106
- package/src/cli/commands/overview.ts +77 -32
- package/src/cli/commands/ticker.ts +101 -43
- package/src/cli/desktop-pane-shot.ts +34 -4
- package/src/cli/freshness.ts +61 -0
- package/src/cli/help.ts +1 -0
- package/src/cli/helpers.ts +4 -8
- package/src/cli/index.ts +12 -2
- package/src/cli/listing-arg.ts +321 -0
- package/src/cli/pane-functions/access-gate.ts +42 -0
- package/src/cli/pane-functions/catalog.ts +28 -1
- package/src/cli/pane-functions/data.ts +3 -1
- package/src/cli/pane-functions/dom.ts +20 -2
- package/src/cli/pane-functions/freshness.ts +400 -0
- package/src/cli/pane-functions/function-help.ts +27 -20
- package/src/cli/pane-functions/headless.ts +39 -11
- package/src/cli/pane-functions/index.ts +15 -4
- package/src/cli/pane-functions/options.ts +3 -0
- package/src/cli/pane-functions/report.ts +4 -0
- package/src/cli/pane-functions/resolver.ts +35 -7
- package/src/cli/pane-functions/screenshot-evidence.ts +2 -0
- package/src/cli/pane-functions/screenshot.ts +7 -3
- package/src/cli/result.ts +41 -27
- package/src/cli/ticker-resolution.ts +7 -5
- package/src/components/chart/composite/composite-chart.tsx +88 -2536
- package/src/components/chart/composite/drawing-store.ts +59 -0
- package/src/components/chart/composite/legend.tsx +319 -0
- package/src/components/chart/composite/panel-bitmap.ts +139 -0
- package/src/components/chart/composite/panel-gestures.ts +59 -0
- package/src/components/chart/composite/panel-labels.ts +107 -0
- package/src/components/chart/composite/panel-surface.tsx +876 -0
- package/src/components/chart/composite/tool-catalog.ts +98 -0
- package/src/components/chart/composite/toolbar.tsx +186 -0
- package/src/components/chart/composite/tools.ts +8 -0
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +703 -0
- package/src/components/chart/composite/use-composite-viewport.ts +143 -0
- package/src/components/command-bar/list/model.ts +5 -0
- package/src/components/command-bar/list/view.tsx +16 -3
- package/src/components/command-bar/pane-templates/workflow.ts +1 -0
- package/src/components/command-bar/routes/ticker-search/actions.ts +5 -0
- package/src/components/command-bar/workflow/ops.ts +1 -1
- package/src/components/command-bar/workflow/tickers.ts +6 -0
- package/src/components/data-table/view.tsx +29 -10
- package/src/components/feedback-dialog.tsx +2 -1
- package/src/components/form-modal/field-row.tsx +2 -2
- package/src/components/layout/detached-pane-shell.tsx +6 -3
- package/src/components/layout/pane/content.tsx +23 -10
- package/src/components/layout/pane/error-boundary.tsx +103 -0
- package/src/components/layout/pane/footer/registration.tsx +68 -23
- package/src/components/layout/pane/header.tsx +11 -11
- package/src/components/layout/shell/menu.ts +2 -1
- package/src/components/layout/shell/pane/actions.ts +2 -1
- package/src/components/layout/shell/pane/layers.tsx +14 -3
- package/src/components/metric-treemap/heat-surface.tsx +43 -16
- package/src/components/metric-treemap/heat-tiles.ts +18 -0
- package/src/components/metric-treemap/layout.ts +2 -0
- package/src/components/onboarding/onboarding-keyboard.ts +311 -0
- package/src/components/onboarding/onboarding-wizard.tsx +101 -788
- package/src/components/onboarding/use-onboarding-broker-form.ts +263 -0
- package/src/components/onboarding/use-onboarding-progress.ts +298 -0
- package/src/components/onboarding/use-onboarding-upgrade.ts +83 -0
- package/src/components/ticker/list-table-view.tsx +13 -1
- package/src/components/ui/fields.tsx +8 -0
- package/src/components/ui/range-track.tsx +10 -3
- package/src/components/ui/status.tsx +8 -2
- package/src/components/ui/tabs.tsx +7 -4
- package/src/components/ui/text-prompt-dialog.tsx +4 -2
- package/src/data/config/store/normalize.ts +17 -1
- package/src/i18n/es.ts +19 -1
- package/src/i18n/ja.ts +19 -1
- package/src/i18n/ko.ts +19 -1
- package/src/i18n/zh-cn.ts +19 -1
- package/src/i18n/zh-tw.ts +19 -1
- package/src/market-data/coordinator/chart.ts +1 -1
- package/src/market-data/coordinator/quotes.ts +23 -4
- package/src/market-data/fx-closes.ts +72 -0
- package/src/market-data/market/freshness.ts +78 -6
- package/src/market-data/market/session-close-note.ts +57 -0
- package/src/market-data/market/status.ts +151 -0
- package/src/market-data/published-apac-sessions.ts +66 -0
- package/src/market-data/quotes/contributions.ts +2 -0
- package/src/market-data/quotes/resolution.ts +2 -0
- package/src/market-data/quotes/screener-live-quotes.ts +49 -4
- package/src/plugins/builtin/account-management/pane.tsx +4 -0
- package/src/plugins/builtin/alerts/cli.ts +10 -5
- package/src/plugins/builtin/alerts/index.tsx +1 -0
- package/src/plugins/builtin/analytics/metrics.ts +8 -3
- package/src/plugins/builtin/analytics/risk-client.ts +191 -66
- package/src/plugins/builtin/analytics/risk-fx.ts +102 -0
- package/src/plugins/builtin/analytics/risk-headless.ts +19 -13
- package/src/plugins/builtin/analytics/risk-model.ts +45 -17
- package/src/plugins/builtin/analytics/risk-pane.tsx +1 -0
- package/src/plugins/builtin/analytics/risk-test-data.ts +25 -1
- package/src/plugins/builtin/attention/headless.ts +6 -4
- package/src/plugins/builtin/attention/index.tsx +1 -1
- package/src/plugins/builtin/attention/pane.tsx +1 -1
- package/src/plugins/builtin/awards/headless.ts +1 -0
- package/src/plugins/builtin/awards/pane.tsx +1 -1
- package/src/plugins/builtin/backtest/headless.ts +1 -0
- package/src/plugins/builtin/bond-calculator/headless.ts +1 -0
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/headless.ts +3 -1
- package/src/plugins/builtin/cds/headless.ts +2 -0
- package/src/plugins/builtin/central-bank-rates/headless.ts +1 -0
- package/src/plugins/builtin/chart-composer/headless.ts +38 -3
- package/src/plugins/builtin/chart-composer/index.tsx +3 -1
- package/src/plugins/builtin/chart-composer/series-expression.ts +18 -2
- package/src/plugins/builtin/chat/channels.ts +19 -3
- package/src/plugins/builtin/chat/content/composer-runtime.ts +28 -13
- package/src/plugins/builtin/chat/content/footer.tsx +15 -6
- package/src/plugins/builtin/chat/content/index.tsx +120 -21
- package/src/plugins/builtin/chat/content/new-dm-dialog.tsx +261 -113
- package/src/plugins/builtin/chat/content/transcript.tsx +20 -2
- package/src/plugins/builtin/chat/direct-messages.ts +200 -0
- package/src/plugins/builtin/chat/index.tsx +1 -0
- package/src/plugins/builtin/chat/message/desktop.tsx +3 -0
- package/src/plugins/builtin/chat/message/header.tsx +16 -6
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +72 -32
- package/src/plugins/builtin/chat/message/profile-popover.tsx +96 -12
- package/src/plugins/builtin/chat/message/terminal.tsx +3 -0
- package/src/plugins/builtin/chat/message/types.ts +14 -2
- package/src/plugins/builtin/chat/profile-popover.ts +18 -13
- package/src/plugins/builtin/clinical-trials/index.tsx +1 -0
- package/src/plugins/builtin/cloud/askg/executor.ts +2 -1
- package/src/plugins/builtin/cloud/plugin.tsx +1 -0
- package/src/plugins/builtin/cloud/team/module.tsx +1 -0
- package/src/plugins/builtin/cloud/thesis/module.tsx +1 -0
- package/src/plugins/builtin/cloud-tweets/registration.ts +1 -0
- package/src/plugins/builtin/comment-letters/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/headless.ts +5 -1
- package/src/plugins/builtin/company-attention/pane.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +1 -0
- package/src/plugins/builtin/congress-trades/headless.ts +1 -0
- package/src/plugins/builtin/correlation/compute.ts +59 -16
- package/src/plugins/builtin/correlation/geo.ts +34 -0
- package/src/plugins/builtin/correlation/headless-schema.ts +4 -1
- package/src/plugins/builtin/correlation/headless.ts +42 -8
- package/src/plugins/builtin/correlation/history.ts +2 -0
- package/src/plugins/builtin/correlation/index.tsx +68 -14
- package/src/plugins/builtin/correlation/matrix/model.ts +17 -2
- package/src/plugins/builtin/correlation/matrix/selection.ts +5 -3
- package/src/plugins/builtin/correlation/relationship/model.ts +1 -1
- package/src/plugins/builtin/correlation/relationship/pane.tsx +4 -2
- package/src/plugins/builtin/correlation/relationship/view-model.ts +16 -1
- package/src/plugins/builtin/correlation/settings.ts +1 -1
- package/src/plugins/builtin/cot/headless.ts +6 -3
- package/src/plugins/builtin/cot/index.tsx +3 -3
- package/src/plugins/builtin/cot/model.ts +36 -3
- package/src/plugins/builtin/cpi/headless.ts +4 -0
- package/src/plugins/builtin/credit-boards/headless.ts +2 -0
- package/src/plugins/builtin/credit-conditions/headless.ts +1 -0
- package/src/plugins/builtin/credit-documents/gauge.tsx +5 -8
- package/src/plugins/builtin/credit-documents/headless.ts +2 -0
- package/src/plugins/builtin/crypto-board/headless.ts +3 -0
- package/src/plugins/builtin/custom-view/loader.ts +1 -1
- package/src/plugins/builtin/debt-maturities/headless.ts +4 -0
- package/src/plugins/builtin/dividend-yield/headless.ts +1 -0
- package/src/plugins/builtin/doe/headless.ts +7 -0
- package/src/plugins/builtin/doe/range-bar.tsx +7 -37
- package/src/plugins/builtin/earnings/headless.ts +5 -0
- package/src/plugins/builtin/earnings-calls/headless.ts +1 -0
- package/src/plugins/builtin/earnings-ripple/client.ts +91 -18
- package/src/plugins/builtin/earnings-ripple/headless.ts +28 -8
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -2
- package/src/plugins/builtin/earnings-ripple/model.ts +97 -7
- package/src/plugins/builtin/earnings-ripple/pane.tsx +148 -23
- package/src/plugins/builtin/econ/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/headless.ts +2 -0
- package/src/plugins/builtin/equity-screener/headless.ts +2 -0
- package/src/plugins/builtin/estimate-revisions/headless.ts +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/exposure/headless.ts +3 -1
- package/src/plugins/builtin/fear-greed/headless.ts +2 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/futures-curve/client.ts +12 -3
- package/src/plugins/builtin/futures-curve/headless.ts +39 -10
- package/src/plugins/builtin/futures-curve/index.tsx +3 -3
- package/src/plugins/builtin/futures-curve/model.ts +188 -4
- package/src/plugins/builtin/futures-curve/pane.tsx +51 -9
- package/src/plugins/builtin/gpu/headless.ts +7 -3
- package/src/plugins/builtin/gpu/ladder.tsx +26 -30
- package/src/plugins/builtin/gpu/model.ts +27 -1
- package/src/plugins/builtin/holders/beneficial-client.ts +209 -0
- package/src/plugins/builtin/holders/beneficial-model.ts +279 -0
- package/src/plugins/builtin/holders/beneficial-report.ts +126 -0
- package/src/plugins/builtin/holders/beneficial-view.tsx +241 -0
- package/src/plugins/builtin/holders/headless.ts +139 -5
- package/src/plugins/builtin/holders/index.tsx +10 -3
- package/src/plugins/builtin/holders/pane.tsx +20 -3
- package/src/plugins/builtin/holders/report-header.ts +95 -0
- package/src/plugins/builtin/holders/table-model.ts +20 -5
- package/src/plugins/builtin/holders/thirteenf-match.ts +29 -1
- package/src/plugins/builtin/holders/types.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +2 -0
- package/src/plugins/builtin/ipo-calendar/headless.ts +1 -0
- package/src/plugins/builtin/iv-history/headless.ts +4 -1
- package/src/plugins/builtin/jobs/headless.ts +1 -0
- package/src/plugins/builtin/kelly-sizer/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +2 -0
- package/src/plugins/builtin/market-halts/index.tsx +1 -0
- package/src/plugins/builtin/market-heatmap/data.ts +2 -0
- package/src/plugins/builtin/market-heatmap/headless.ts +135 -0
- package/src/plugins/builtin/market-heatmap/index.tsx +39 -46
- package/src/plugins/builtin/market-heatmap/model.ts +146 -0
- package/src/plugins/builtin/market-heatmap/portfolio.ts +23 -4
- package/src/plugins/builtin/market-movers/headless.ts +2 -0
- package/src/plugins/builtin/market-valuation/headless.ts +2 -0
- package/src/plugins/builtin/members/client.ts +20 -3
- package/src/plugins/builtin/members/headless.ts +5 -3
- package/src/plugins/builtin/members/model.ts +10 -2
- package/src/plugins/builtin/members/pane.tsx +13 -6
- package/src/plugins/builtin/mna/distress/headless.ts +1 -0
- package/src/plugins/builtin/mna/headless.ts +1 -0
- package/src/plugins/builtin/money-markets/headless.ts +1 -0
- package/src/plugins/builtin/news/headless.ts +2 -0
- package/src/plugins/builtin/news/wire/index.tsx +8 -1
- package/src/plugins/builtin/notes/cli.ts +14 -6
- package/src/plugins/builtin/notes/index.tsx +1 -0
- package/src/plugins/builtin/openfda/index.tsx +1 -0
- package/src/plugins/builtin/options-calculator/headless.ts +2 -0
- package/src/plugins/builtin/options-positioning/headless.ts +3 -0
- package/src/plugins/builtin/options-scenario/headless.ts +5 -0
- package/src/plugins/builtin/pe-band/client.ts +48 -3
- package/src/plugins/builtin/pe-band/headless.ts +25 -7
- package/src/plugins/builtin/pe-band/model.ts +92 -16
- package/src/plugins/builtin/pe-band/pane.tsx +33 -16
- package/src/plugins/builtin/perps/client.ts +50 -3
- package/src/plugins/builtin/perps/headless.ts +144 -16
- package/src/plugins/builtin/perps/index.tsx +6 -6
- package/src/plugins/builtin/perps/model.ts +189 -12
- package/src/plugins/builtin/perps/pane.tsx +248 -47
- package/src/plugins/builtin/portfolio-list/allocation.ts +245 -0
- package/src/plugins/builtin/portfolio-list/cached-account.ts +33 -0
- package/src/plugins/builtin/portfolio-list/cell-version.ts +19 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +328 -29
- package/src/plugins/builtin/portfolio-list/cli/render.ts +230 -39
- package/src/plugins/builtin/portfolio-list/cli/shared.ts +67 -2
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +35 -31
- package/src/plugins/builtin/portfolio-list/column-values.ts +124 -47
- package/src/plugins/builtin/portfolio-list/headless.ts +98 -16
- package/src/plugins/builtin/portfolio-list/index.tsx +14 -3
- package/src/plugins/builtin/portfolio-list/live-valuation.ts +7 -5
- package/src/plugins/builtin/portfolio-list/mutations.ts +55 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +6 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +47 -13
- package/src/plugins/builtin/portfolio-list/settings.ts +33 -2
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +24 -1
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +26 -7
- package/src/plugins/builtin/power/headless.ts +3 -1
- package/src/plugins/builtin/rate-path/headless.ts +2 -0
- package/src/plugins/builtin/realized-vol/headless.ts +2 -0
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -0
- package/src/plugins/builtin/research/analyst-headless.ts +3 -0
- package/src/plugins/builtin/research/events-headless.ts +2 -0
- package/src/plugins/builtin/research/headless.ts +2 -0
- package/src/plugins/builtin/research/index.tsx +1 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +10 -5
- package/src/plugins/builtin/research/relative-valuation-model.ts +11 -3
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -3
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/revenue-breakdown/headless.ts +2 -0
- package/src/plugins/builtin/reverse-dcf/headless.ts +2 -0
- package/src/plugins/builtin/risk-factors/headless.ts +2 -0
- package/src/plugins/builtin/scanner/flow-history.ts +2 -13
- package/src/plugins/builtin/scanner/headless.ts +14 -0
- package/src/plugins/builtin/seasonality/headless.ts +2 -0
- package/src/plugins/builtin/sec/command-bar-search.ts +14 -4
- package/src/plugins/builtin/sec/filing-content.ts +42 -17
- package/src/plugins/builtin/sec/forms.ts +12 -0
- package/src/plugins/builtin/sec/headless.ts +2 -0
- package/src/plugins/builtin/sectors/client.ts +1 -0
- package/src/plugins/builtin/sectors/headless.ts +9 -1
- package/src/plugins/builtin/sectors/sector-model.ts +2 -0
- package/src/plugins/builtin/shared/crypto-pair.ts +14 -0
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/report-freshness.ts +57 -0
- package/src/plugins/builtin/shared/research-cells.tsx +4 -9
- package/src/plugins/builtin/short-interest/headless.ts +2 -0
- package/src/plugins/builtin/short-interest/watch-headless.ts +1 -0
- package/src/plugins/builtin/short-volume/headless.ts +1 -0
- package/src/plugins/builtin/social-mentions/headless.ts +1 -0
- package/src/plugins/builtin/supply-chain/headless.ts +7 -1
- package/src/plugins/builtin/supply-chain/index.tsx +10 -1
- package/src/plugins/builtin/supply-chain/model.ts +27 -2
- package/src/plugins/builtin/supply-chain/pane.tsx +71 -32
- package/src/plugins/builtin/themes/headless.ts +3 -0
- package/src/plugins/builtin/thirteenf/headless.ts +110 -25
- package/src/plugins/builtin/thirteenf/report-notes.ts +149 -0
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -1
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +9 -2
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +26 -26
- package/src/plugins/builtin/time-sales/headless.ts +5 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +1 -0
- package/src/plugins/builtin/volatility/headless.ts +6 -1
- package/src/plugins/builtin/world-indices/headless.ts +2 -0
- package/src/plugins/builtin/world-venue-map/basemap-layer.tsx +157 -0
- package/src/plugins/builtin/world-venue-map/basemap.ts +214 -0
- package/src/plugins/builtin/world-venue-map/client.ts +45 -0
- package/src/plugins/builtin/world-venue-map/entity-detail.tsx +147 -0
- package/src/plugins/builtin/world-venue-map/entity-table.ts +59 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +77 -0
- package/src/plugins/builtin/world-venue-map/feed.ts +293 -0
- package/src/plugins/builtin/world-venue-map/geo-draw.tsx +248 -0
- package/src/plugins/builtin/world-venue-map/geo-series.ts +142 -0
- package/src/plugins/builtin/world-venue-map/geo-svg.tsx +447 -0
- package/src/plugins/builtin/world-venue-map/headless.ts +146 -0
- package/src/plugins/builtin/world-venue-map/ids.ts +1 -0
- package/src/plugins/builtin/world-venue-map/index.ts +67 -4
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +552 -0
- package/src/plugins/builtin/world-venue-map/layers.ts +348 -0
- package/src/plugins/builtin/world-venue-map/map-symbols.ts +220 -0
- package/src/plugins/builtin/world-venue-map/map.tsx +381 -45
- package/src/plugins/builtin/world-venue-map/model.ts +7 -4
- package/src/plugins/builtin/world-venue-map/natural-earth/index.chunk.ts +199 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e000s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e015s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e030s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e045s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e060s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e075s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e090s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e105s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e120s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e135s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e150s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/e165s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w015s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w030s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w045s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w060s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w075s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w090s60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w105s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w120s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135n75.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w135s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w150s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w165s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n00.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180n60.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180s15.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180s30.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/tiles/w180s45.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/natural-earth/world-50m.chunk.ts +4 -0
- package/src/plugins/builtin/world-venue-map/pane.tsx +28 -43
- package/src/plugins/builtin/world-venue-map/use-geo.ts +55 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +32 -0
- package/src/plugins/builtin/yield-curve/headless.ts +16 -0
- package/src/plugins/loader.ts +13 -1
- package/src/plugins/registry/pane-settings.ts +1 -0
- package/src/renderers/dom/build-assets.ts +81 -3
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/desktop/controls.tsx +7 -3
- package/src/renderers/dom/desktop/list-view.tsx +35 -10
- package/src/renderers/dom/desktop/popover.tsx +73 -14
- package/src/renderers/dom/host/input.tsx +14 -3
- package/src/renderers/dom/styles.css +6 -7
- package/src/renderers/electrobun/view/backend-rpc.ts +10 -4
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +14 -3
- package/src/renderers/opentui/host.tsx +5 -0
- package/src/sources/gloomberb-cloud/index.ts +25 -4
- package/src/sources/gloomberb-cloud/normalizers.ts +27 -3
- package/src/sources/provider-router/cached-routes.ts +4 -1
- package/src/sources/provider-router/financials.ts +8 -7
- package/src/sources/provider-router/history.ts +15 -10
- package/src/sources/sec-registrant.ts +75 -0
- package/src/state/app/context/index.tsx +24 -8
- package/src/state/hooks/quote-streaming.ts +41 -26
- package/src/sync/core-contributors.ts +4 -0
- package/src/telemetry/crash-reports.ts +4 -1
- package/src/test-support/cli-context.ts +10 -2
- package/src/theme/heat-colors.ts +266 -84
- package/src/time-series/resolve.ts +1 -1
- package/src/time-series/use-chart-resolution.ts +1 -1
- package/src/types/context-menu.ts +6 -0
- package/src/types/data-provider.ts +2 -0
- package/src/types/financials.ts +3 -0
- package/src/types/headless.ts +79 -2
- package/src/types/plugin.ts +20 -1
- package/src/types/ticker.ts +15 -0
- package/src/ui/host.tsx +14 -0
- package/src/updater/index.ts +9 -11
- package/src/utils/async-deadline.ts +21 -0
- package/src/utils/cli-output.ts +5 -1
- package/src/utils/crypto-pair.ts +41 -0
- package/src/utils/currency-units.ts +14 -0
- package/src/utils/depositary-receipt.ts +26 -0
- package/src/utils/exchanges.ts +72 -0
- package/src/utils/fire-and-forget.ts +24 -0
- package/src/utils/format.ts +13 -0
- package/src/utils/price-earnings.ts +70 -3
- package/src/utils/price-history.ts +58 -13
- package/src/utils/rpc-timeout-error.ts +27 -0
- package/src/utils/sec.ts +13 -1
- package/src/utils/utc-time.ts +79 -0
|
@@ -1,43 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useCallback,
|
|
3
|
-
useEffect,
|
|
4
|
-
useMemo,
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
useSyncExternalStore,
|
|
8
|
-
} from "react";
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
2
|
import { recordResearchActivity, type ResearchActivity } from "../../api-client/research-activity";
|
|
10
|
-
import { apiClient } from "../../api-client";
|
|
11
3
|
import type { AppBrokerImportRuntime } from "../../app/runtime/broker-import";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
subscribeSignedInBrokers,
|
|
17
|
-
} from "../../brokers/signed-in/catalog";
|
|
18
|
-
import { SIGNED_IN_BROKER_TYPE } from "../../brokers/signed-in/profile";
|
|
19
|
-
import type { SyncBrokerInstanceResult } from "../../brokers/sync-broker-instance";
|
|
20
|
-
import { saveConfigImmediately } from "../../state/config-save-scheduler";
|
|
21
|
-
import {
|
|
22
|
-
type AppConfig,
|
|
23
|
-
findPaneInstance,
|
|
24
|
-
type OnboardingProgress,
|
|
25
|
-
type OnboardingStage,
|
|
26
|
-
} from "../../types/config";
|
|
27
|
-
import { resolveBrokerConfigFields, type BrokerConfigField } from "../../types/broker";
|
|
28
|
-
import { useShortcut, useViewport, type KeyEventLike } from "../../react/input";
|
|
29
|
-
import {
|
|
30
|
-
matchKeybinding,
|
|
31
|
-
matchesKeybindingAction,
|
|
32
|
-
useKeybindings,
|
|
33
|
-
type ResolvedKeybindings,
|
|
34
|
-
} from "../../app/keybindings";
|
|
35
|
-
import {
|
|
36
|
-
useAppDispatch,
|
|
37
|
-
useAppSelector,
|
|
38
|
-
useAppStateRef,
|
|
39
|
-
} from "../../state/app/context";
|
|
40
|
-
import { useAppActive } from "../../state/app/activity";
|
|
4
|
+
import { type AppConfig, findPaneInstance, type OnboardingStage } from "../../types/config";
|
|
5
|
+
import { useViewport } from "../../react/input";
|
|
6
|
+
import { useKeybindings } from "../../app/keybindings";
|
|
7
|
+
import { useAppDispatch, useAppSelector, useAppStateRef } from "../../state/app/context";
|
|
41
8
|
import {
|
|
42
9
|
Box,
|
|
43
10
|
Text,
|
|
@@ -48,25 +15,14 @@ import {
|
|
|
48
15
|
type InputRenderable,
|
|
49
16
|
} from "../../ui";
|
|
50
17
|
import { useDialogState } from "../../ui/dialog";
|
|
51
|
-
import { isPlainKey } from "../../utils/keyboard";
|
|
52
|
-
import { isCopyShortcut, isPasteShortcut } from "../../utils/selection-clipboard";
|
|
53
18
|
import { useThemeColors } from "../../theme/theme-context";
|
|
54
19
|
import { t, tf } from "../../i18n";
|
|
55
20
|
import { useAppLanguage } from "../../i18n/react";
|
|
56
21
|
import type { PluginRegistry } from "../../plugins/registry";
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
monthsFreeYearly,
|
|
62
|
-
} from "../../plugins/builtin/account-management/model";
|
|
63
|
-
import { loadUpgradeOffer, proStepCopy, type UpgradeOffer } from "../../plugins/builtin/cloud/upgrade-dialog";
|
|
64
|
-
import { useCloudUpgradeAction } from "../../plugins/builtin/shared/cloud-upgrade";
|
|
65
|
-
import { resolvePlanAccess, usePlanAccess } from "../../api-client/plan-access";
|
|
66
|
-
import { Button, SegmentedControl, type ListViewItem } from "../ui";
|
|
67
|
-
import { AccountStep, PortfolioStep, type PortfolioSub } from "./onboarding-steps";
|
|
68
|
-
import { BROKER_GUIDE_KEY, brokerSetupGuideUrl } from "./portfolio-step/broker-setup-panel";
|
|
69
|
-
import { REMOVE_POSITION_KEY } from "./portfolio-step/positions-panel";
|
|
22
|
+
import { formatCloudPrice, monthsFreeYearly } from "../../plugins/builtin/account-management/model";
|
|
23
|
+
import { proStepCopy } from "../../plugins/builtin/cloud/upgrade-dialog";
|
|
24
|
+
import { Button, SegmentedControl } from "../ui";
|
|
25
|
+
import { AccountStep, PortfolioStep } from "./onboarding-steps";
|
|
70
26
|
import {
|
|
71
27
|
ONBOARDING_DESKTOP,
|
|
72
28
|
OnboardingActions,
|
|
@@ -80,29 +36,22 @@ import {
|
|
|
80
36
|
} from "./onboarding-frame";
|
|
81
37
|
import { useOnboardingAccount } from "./wizard-account";
|
|
82
38
|
import { useOnboardingBrokerSync } from "./wizard-broker-sync";
|
|
83
|
-
import {
|
|
84
|
-
import { applyFirstRunLayout, buildFirstRunLayout, planFirstRunWatchlist } from "./first-run-workspace";
|
|
39
|
+
import { useOnboardingPositions } from "./wizard-positions";
|
|
85
40
|
import { DesksStep, toggleDeskChoice } from "./desks-step";
|
|
41
|
+
import { getOnboardingProgress } from "./wizard-model";
|
|
86
42
|
import {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} from "
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
pickLargestBrokerPosition,
|
|
100
|
-
pickLargestPosition,
|
|
101
|
-
withOnboardingProgress,
|
|
102
|
-
type BrokerOption,
|
|
103
|
-
} from "./wizard-model";
|
|
104
|
-
|
|
105
|
-
const onboardingLog = debugLog.createLogger("onboarding");
|
|
43
|
+
useOnboardingKeyboard,
|
|
44
|
+
SKIP_SETUP_KEY,
|
|
45
|
+
KEEP_FREE_KEY,
|
|
46
|
+
CONNECT_BROKER_KEY,
|
|
47
|
+
BROWSER_SIGN_IN_KEY,
|
|
48
|
+
SKIP_DESKS_KEY,
|
|
49
|
+
} from "./onboarding-keyboard";
|
|
50
|
+
import { useOnboardingBrokerFields, useOnboardingBrokerForm } from "./use-onboarding-broker-form";
|
|
51
|
+
import { useOnboardingProgress, useOnboardingWorkspace, useOnboardingCompletion } from "./use-onboarding-progress";
|
|
52
|
+
import { useOnboardingUpgrade } from "./use-onboarding-upgrade";
|
|
53
|
+
|
|
54
|
+
export { keyReachesPastOnboardingModal } from "./onboarding-keyboard";
|
|
106
55
|
|
|
107
56
|
interface OnboardingWizardProps {
|
|
108
57
|
pluginRegistry: PluginRegistry;
|
|
@@ -117,42 +66,7 @@ const STAGE_ACTIVITY: Partial<Record<OnboardingStage, ResearchActivity>> = {
|
|
|
117
66
|
account: "onboarding_account_viewed",
|
|
118
67
|
upgrade: "onboarding_pro_viewed",
|
|
119
68
|
};
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Card keys, shown on the buttons they press. Letters only act while no field
|
|
123
|
-
* is being typed in (Esc leaves the field first); F10, the old skip key, still
|
|
124
|
-
* works everywhere.
|
|
125
|
-
*/
|
|
126
|
-
const SKIP_SETUP_KEY = "s";
|
|
127
|
-
const KEEP_FREE_KEY = "f";
|
|
128
|
-
const CONNECT_BROKER_KEY = "b";
|
|
129
|
-
const BROWSER_SIGN_IN_KEY = "b";
|
|
130
|
-
const SKIP_DESKS_KEY = "s";
|
|
131
|
-
|
|
132
|
-
/** Digits jump straight to a section the header would let you click. */
|
|
133
|
-
const SECTION_DIGITS: Record<string, OnboardingSectionId> = { "1": "portfolio", "2": "cloud", "3": "pro" };
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Whether a key the onboarding card did not use may still reach the app
|
|
137
|
-
* behind it. Toasts float above the card, copy and paste work anywhere, and
|
|
138
|
-
* Help is the way out (the card steps aside while Help has focus). A field
|
|
139
|
-
* keeps its typing and editing keys; of the chords that reach app shortcuts
|
|
140
|
-
* while typing, only the ones the app binds are held back. Everything else
|
|
141
|
-
* would act on a pane hidden behind the scrim.
|
|
142
|
-
*/
|
|
143
|
-
export function keyReachesPastOnboardingModal(event: KeyEventLike, keybindings: ResolvedKeybindings): boolean {
|
|
144
|
-
if (isCopyShortcut(event) || isPasteShortcut(event)) return true;
|
|
145
|
-
const match = matchKeybinding(keybindings, event);
|
|
146
|
-
const action = match?.kind === "action" ? match.id : null;
|
|
147
|
-
if (action === "notification-action" || action === "notification-dismiss") return true;
|
|
148
|
-
if (event.targetEditable) {
|
|
149
|
-
const chord = event.ctrl || event.meta || event.super === true;
|
|
150
|
-
return !chord || !match;
|
|
151
|
-
}
|
|
152
|
-
return action === "help";
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete }: OnboardingWizardProps) {
|
|
69
|
+
function useOnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete }: OnboardingWizardProps) {
|
|
156
70
|
const language = useAppLanguage();
|
|
157
71
|
const colors = useThemeColors();
|
|
158
72
|
const desktop = useUiCapabilities().nativePaneChrome === true;
|
|
@@ -169,93 +83,24 @@ export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComp
|
|
|
169
83
|
const config = useAppSelector((state) => state.config);
|
|
170
84
|
const progress = getOnboardingProgress(config);
|
|
171
85
|
const stage = progress.stage;
|
|
172
|
-
const [persistenceError, setPersistenceError] = useState<string | null>(null);
|
|
173
|
-
const [isFinishing, setIsFinishing] = useState(false);
|
|
174
86
|
const researchOpenedRef = useRef<string | null>(null);
|
|
175
|
-
const [offer, setOffer] = useState<UpgradeOffer | null>(null);
|
|
176
|
-
const pricing = offer?.pricing ?? null;
|
|
177
|
-
const [billingInterval, setBillingInterval] = useState<CloudBillingInterval>("month");
|
|
178
|
-
|
|
179
|
-
const [portfolioSub, setPortfolioSub] = useState<PortfolioSub>("positions");
|
|
180
|
-
const [portfolioOptionIdx, setPortfolioOptionIdx] = useState(0);
|
|
181
|
-
const [brokerValues, setBrokerValues] = useState<Record<string, Record<string, string>>>({});
|
|
182
|
-
const [selectedBrokerId, setSelectedBrokerId] = useState<string | null>(null);
|
|
183
|
-
const [brokerFieldIdx, setBrokerFieldIdx] = useState(0);
|
|
184
|
-
const [brokerSelectIdx, setBrokerSelectIdx] = useState(0);
|
|
185
87
|
const [editingField, setEditingField] = useState(false);
|
|
186
88
|
/** The added position the keyboard acts on once no field is being typed in. */
|
|
187
89
|
const [positionCursorSymbol, setPositionCursorSymbol] = useState<string | null>(null);
|
|
188
|
-
const [chosenDesks, setChosenDesks] = useState<DeskKey[]>([]);
|
|
189
|
-
const [deskCursor, setDeskCursor] = useState(0);
|
|
190
|
-
const [buildingDesks, setBuildingDesks] = useState(false);
|
|
191
90
|
const inputRef = useRef<InputRenderable>(null);
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
signedIn: signedInBrokers,
|
|
206
|
-
adapters: pluginRegistry.brokers.values(),
|
|
207
|
-
})),
|
|
208
|
-
[pluginRegistry.brokers, signedInBrokers],
|
|
209
|
-
);
|
|
210
|
-
const brokerChoices = useMemo<ListViewItem[]>(() => brokerOptions.map((broker) => ({
|
|
211
|
-
id: broker.id,
|
|
212
|
-
label: tf("Connect {broker}", { broker: broker.name }),
|
|
213
|
-
// A broker offered two ways shows which way each choice connects.
|
|
214
|
-
description: broker.methodLabel ?? tf("Import positions from {broker}", { broker: broker.name }),
|
|
215
|
-
})), [brokerOptions, language]);
|
|
216
|
-
const activeBrokerFields = useMemo((): BrokerConfigField[] => {
|
|
217
|
-
if (!selectedBrokerId) return [];
|
|
218
|
-
const adapter = brokerOptions.find((option) => option.id === selectedBrokerId)?.adapter;
|
|
219
|
-
return adapter
|
|
220
|
-
? resolveBrokerConfigFields(adapter, brokerValues[selectedBrokerId] ?? {}).filter((field) => field.required)
|
|
221
|
-
: [];
|
|
222
|
-
}, [brokerOptions, brokerValues, selectedBrokerId]);
|
|
223
|
-
|
|
224
|
-
const persistProgress = useCallback(async (
|
|
225
|
-
patch: Partial<OnboardingProgress> & Pick<OnboardingProgress, "stage">,
|
|
226
|
-
baseConfig?: AppConfig,
|
|
227
|
-
): Promise<AppConfig> => {
|
|
228
|
-
if (finishingRef.current) return stateRef.current.config;
|
|
229
|
-
setPersistenceError(null);
|
|
230
|
-
const operation = progressSaveQueueRef.current
|
|
231
|
-
.catch(() => {})
|
|
232
|
-
.then(async () => {
|
|
233
|
-
if (finishingRef.current) return stateRef.current.config;
|
|
234
|
-
const nextConfig = withOnboardingProgress(baseConfig ?? stateRef.current.config, patch);
|
|
235
|
-
try {
|
|
236
|
-
await saveConfigImmediately(nextConfig);
|
|
237
|
-
dispatch({
|
|
238
|
-
type: "SET_ONBOARDING_STATE",
|
|
239
|
-
complete: false,
|
|
240
|
-
progress: nextConfig.onboardingProgress,
|
|
241
|
-
});
|
|
242
|
-
return nextConfig;
|
|
243
|
-
} catch (error) {
|
|
244
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
245
|
-
setPersistenceError(message || t("Unable to save onboarding progress."));
|
|
246
|
-
throw error;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
progressSaveQueueRef.current = operation.then(() => {}, () => {});
|
|
250
|
-
return operation;
|
|
251
|
-
}, [dispatch, stateRef]);
|
|
252
|
-
|
|
253
|
-
const saveProgressInBackground = useCallback((
|
|
254
|
-
patch: Partial<OnboardingProgress> & Pick<OnboardingProgress, "stage">,
|
|
255
|
-
baseConfig?: AppConfig,
|
|
256
|
-
) => {
|
|
257
|
-
void persistProgress(patch, baseConfig).catch(() => {});
|
|
258
|
-
}, [persistProgress]);
|
|
91
|
+
const {
|
|
92
|
+
portfolioSub, setPortfolioSub, portfolioOptionIdx, setPortfolioOptionIdx, brokerValues, setBrokerValues,
|
|
93
|
+
selectedBrokerId, setSelectedBrokerId, brokerFieldIdx, setBrokerFieldIdx, brokerSelectIdx,
|
|
94
|
+
setBrokerSelectIdx, brokerOptions, brokerChoices, activeBrokerFields,
|
|
95
|
+
} = useOnboardingBrokerFields({
|
|
96
|
+
pluginRegistry, language,
|
|
97
|
+
});
|
|
98
|
+
const {
|
|
99
|
+
persistenceError, setPersistenceError, isFinishing, setIsFinishing, progressSaveQueueRef, finishingRef,
|
|
100
|
+
persistProgress, saveProgressInBackground,
|
|
101
|
+
} = useOnboardingProgress({
|
|
102
|
+
stateRef, dispatch,
|
|
103
|
+
});
|
|
259
104
|
|
|
260
105
|
// Pro follows sign-in directly. Email verification continues in the status
|
|
261
106
|
// bar, so an unread inbox never stalls the first session.
|
|
@@ -290,152 +135,13 @@ export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComp
|
|
|
290
135
|
useEffect(() => {
|
|
291
136
|
if (stage === "portfolio" && portfolioSub === "positions") setEditingField(true);
|
|
292
137
|
}, [portfolioSub, stage]);
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
baseConfig: AppConfig,
|
|
301
|
-
symbol: string,
|
|
302
|
-
portfolioId: string,
|
|
303
|
-
desks: readonly DeskKey[],
|
|
304
|
-
): Promise<AppConfig> => {
|
|
305
|
-
let config = baseConfig;
|
|
306
|
-
let watchlistId = config.watchlists[0]?.id;
|
|
307
|
-
if (!watchlistId) {
|
|
308
|
-
watchlistId = "watchlist";
|
|
309
|
-
config = { ...config, watchlists: [{ id: watchlistId, name: "Watchlist" }] };
|
|
310
|
-
}
|
|
311
|
-
const plan = planFirstRunWatchlist(stateRef.current.tickers, watchlistId, portfolioId);
|
|
312
|
-
for (const metadata of plan.create) {
|
|
313
|
-
try {
|
|
314
|
-
const ticker = await pluginRegistry.tickerRepository.createTicker(metadata);
|
|
315
|
-
dispatch({ type: "UPDATE_TICKER", ticker });
|
|
316
|
-
pluginRegistry.events.emit("ticker:added", { symbol: ticker.metadata.ticker, ticker });
|
|
317
|
-
} catch (error) {
|
|
318
|
-
onboardingLog.error("First-run watchlist seed failed", { symbol: metadata.ticker, error: String(error) });
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
for (const ticker of plan.update) {
|
|
322
|
-
try {
|
|
323
|
-
await pluginRegistry.tickerRepository.saveTicker(ticker);
|
|
324
|
-
dispatch({ type: "UPDATE_TICKER", ticker });
|
|
325
|
-
} catch (error) {
|
|
326
|
-
onboardingLog.error("First-run watchlist update failed", { symbol: ticker.metadata.ticker, error: String(error) });
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
const home = buildFirstRunLayout({
|
|
330
|
-
symbol,
|
|
331
|
-
portfolioId,
|
|
332
|
-
watchlistId,
|
|
333
|
-
hasPane: (paneId) => pluginRegistry.panes?.has(paneId) ?? false,
|
|
334
|
-
});
|
|
335
|
-
const workspace = applyFirstRunLayout(config, home);
|
|
336
|
-
if (desks.length === 0) return workspace;
|
|
337
|
-
const { tickers, financials } = stateRef.current;
|
|
338
|
-
const held = [...tickers.values()]
|
|
339
|
-
.filter((ticker) => ticker.metadata.portfolios.includes(portfolioId))
|
|
340
|
-
.map((ticker) => ticker.metadata.ticker);
|
|
341
|
-
const company = pickDeskCompany([symbol, ...held], (candidate) => (
|
|
342
|
-
isDeskStock(tickers.get(candidate), financials.get(candidate))
|
|
343
|
-
));
|
|
344
|
-
const pro = resolvePlanAccess(apiClient.getCurrentUser()).hasProAccess;
|
|
345
|
-
// A desk that fails to build is left out; it never holds up the first run.
|
|
346
|
-
const deskTabs = await Promise.all(desks.map((key) => (
|
|
347
|
-
buildDesk(getDesk(key), { catalog: pluginRegistry, config: workspace, company, pro }).catch((error) => {
|
|
348
|
-
onboardingLog.error("Desk build failed", { desk: key, error: String(error) });
|
|
349
|
-
return null;
|
|
350
|
-
})
|
|
351
|
-
)));
|
|
352
|
-
const tabs = deskTabs.filter((tab) => tab !== null);
|
|
353
|
-
return { ...workspace, layouts: [workspace.layouts[0]!, ...tabs, ...workspace.layouts.slice(1)] };
|
|
354
|
-
}, [dispatch, pluginRegistry, stateRef]);
|
|
355
|
-
|
|
356
|
-
const commitWorkspaceProgress = useCallback(async (
|
|
357
|
-
nextConfig: AppConfig,
|
|
358
|
-
patch: Partial<OnboardingProgress> & Pick<OnboardingProgress, "stage">,
|
|
359
|
-
) => {
|
|
360
|
-
const withProgress = withOnboardingProgress(nextConfig, patch);
|
|
361
|
-
await saveConfigImmediately(withProgress);
|
|
362
|
-
dispatch({ type: "SET_CONFIG", config: withProgress });
|
|
363
|
-
pluginRegistry.events.emit("config:changed", { config: withProgress });
|
|
364
|
-
}, [dispatch, pluginRegistry.events]);
|
|
365
|
-
|
|
366
|
-
const continueFromPositions = useCallback(() => {
|
|
367
|
-
const largest = pickLargestPosition(positions.positions);
|
|
368
|
-
if (!largest) {
|
|
369
|
-
positions.focusField(0);
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
setEditingField(false);
|
|
373
|
-
saveProgressInBackground({
|
|
374
|
-
stage: "desks",
|
|
375
|
-
path: "manual",
|
|
376
|
-
portfolioId: positions.portfolioId,
|
|
377
|
-
tickerSymbol: largest.symbol,
|
|
378
|
-
positionsImported: positions.positions.length,
|
|
379
|
-
brokerName: undefined,
|
|
380
|
-
});
|
|
381
|
-
}, [positions, saveProgressInBackground]);
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* Leaves "What do you trade?": builds the workspace with the picked desks as
|
|
385
|
-
* tabs (none when skipped, which is today's workspace) and moves on.
|
|
386
|
-
*/
|
|
387
|
-
const finishDesks = useCallback((desks: readonly DeskKey[]) => {
|
|
388
|
-
if (buildingDesksRef.current) return;
|
|
389
|
-
const { tickerSymbol, portfolioId } = getOnboardingProgress(stateRef.current.config);
|
|
390
|
-
if (!tickerSymbol) {
|
|
391
|
-
saveProgressInBackground({ stage: "portfolio" });
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
buildingDesksRef.current = true;
|
|
395
|
-
setBuildingDesks(true);
|
|
396
|
-
setPersistenceError(null);
|
|
397
|
-
void (async () => {
|
|
398
|
-
try {
|
|
399
|
-
const nextConfig = await buildFirstRunWorkspace(
|
|
400
|
-
stateRef.current.config,
|
|
401
|
-
tickerSymbol,
|
|
402
|
-
portfolioId ?? positions.portfolioId,
|
|
403
|
-
desks,
|
|
404
|
-
);
|
|
405
|
-
if (finishingRef.current) return;
|
|
406
|
-
await commitWorkspaceProgress(nextConfig, { stage: "research", desks: [...desks] });
|
|
407
|
-
} catch (error) {
|
|
408
|
-
setPersistenceError(error instanceof Error ? error.message : String(error));
|
|
409
|
-
} finally {
|
|
410
|
-
buildingDesksRef.current = false;
|
|
411
|
-
setBuildingDesks(false);
|
|
412
|
-
}
|
|
413
|
-
})();
|
|
414
|
-
}, [buildFirstRunWorkspace, commitWorkspaceProgress, positions.portfolioId, saveProgressInBackground, stateRef]);
|
|
415
|
-
|
|
416
|
-
const handleBrokerSynced = useCallback(async (
|
|
417
|
-
result: SyncBrokerInstanceResult,
|
|
418
|
-
syncedConfig: AppConfig,
|
|
419
|
-
) => {
|
|
420
|
-
if (finishingRef.current) return;
|
|
421
|
-
const tickerSymbol = pickLargestBrokerPosition(result.positions)?.ticker
|
|
422
|
-
?? result.addedTickers[0]?.metadata.ticker
|
|
423
|
-
?? result.updatedTickers[0]?.metadata.ticker;
|
|
424
|
-
const brokerName = brokerOptions.find((option) => option.id === selectedBrokerId)?.name;
|
|
425
|
-
const portfolioId = tickerSymbol ? (result.portfolioIds[0] ?? "main") : "main";
|
|
426
|
-
dispatch({ type: "SET_TICKERS", tickers: result.tickers });
|
|
427
|
-
// The workspace is built once the desks are picked.
|
|
428
|
-
await commitWorkspaceProgress(syncedConfig, {
|
|
429
|
-
stage: tickerSymbol ? "desks" : "portfolio",
|
|
430
|
-
path: "broker",
|
|
431
|
-
portfolioId,
|
|
432
|
-
tickerSymbol,
|
|
433
|
-
brokerName,
|
|
434
|
-
positionsImported: result.positions.length,
|
|
435
|
-
});
|
|
436
|
-
setEditingField(false);
|
|
437
|
-
setPortfolioSub("positions");
|
|
438
|
-
}, [brokerOptions, commitWorkspaceProgress, dispatch, selectedBrokerId]);
|
|
138
|
+
const {
|
|
139
|
+
chosenDesks, setChosenDesks, deskCursor, setDeskCursor, buildingDesks, continueFromPositions,
|
|
140
|
+
finishDesks, handleBrokerSynced,
|
|
141
|
+
} = useOnboardingWorkspace({
|
|
142
|
+
stateRef, pluginRegistry, dispatch, positions, setEditingField, saveProgressInBackground,
|
|
143
|
+
setPersistenceError, finishingRef, brokerOptions, selectedBrokerId, setPortfolioSub,
|
|
144
|
+
});
|
|
439
145
|
|
|
440
146
|
const {
|
|
441
147
|
isBrokerSyncing,
|
|
@@ -456,45 +162,22 @@ export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComp
|
|
|
456
162
|
setEditingField,
|
|
457
163
|
setPortfolioSub,
|
|
458
164
|
});
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
dispatch({
|
|
476
|
-
type: "SET_ONBOARDING_STATE",
|
|
477
|
-
complete: true,
|
|
478
|
-
progress: undefined,
|
|
479
|
-
});
|
|
480
|
-
recordResearchActivity(skipped ? "onboarding_skipped" : "onboarding_completed", undefined, undefined, { desks });
|
|
481
|
-
await Promise.resolve(onComplete(nextConfig));
|
|
482
|
-
} catch (error) {
|
|
483
|
-
setPersistenceError(error instanceof Error ? error.message : String(error));
|
|
484
|
-
finishingRef.current = false;
|
|
485
|
-
setIsFinishing(false);
|
|
486
|
-
}
|
|
487
|
-
}, [dispatch, onComplete, resetBrokerSync, stateRef]);
|
|
488
|
-
const skipSetup = useCallback(() => { void finish(true); }, [finish]);
|
|
489
|
-
|
|
490
|
-
useEffect(() => {
|
|
491
|
-
if (!selectedBrokerId) return;
|
|
492
|
-
const field = activeBrokerFields[brokerFieldIdx];
|
|
493
|
-
if (!field || field.type !== "select") return;
|
|
494
|
-
const currentValue = brokerValues[selectedBrokerId]?.[field.key] ?? field.options?.[0]?.value ?? "";
|
|
495
|
-
const index = Math.max(0, field.options?.findIndex((option) => option.value === currentValue) ?? 0);
|
|
496
|
-
setBrokerSelectIdx(index);
|
|
497
|
-
}, [activeBrokerFields, brokerFieldIdx, brokerValues, selectedBrokerId]);
|
|
165
|
+
const {
|
|
166
|
+
finish, skipSetup,
|
|
167
|
+
} = useOnboardingCompletion({
|
|
168
|
+
finishingRef, resetBrokerSync, setIsFinishing, setPersistenceError, progressSaveQueueRef, stateRef,
|
|
169
|
+
dispatch, onComplete,
|
|
170
|
+
});
|
|
171
|
+
const {
|
|
172
|
+
setBrokerFieldValue, chooseBroker, openBrokerConnect, submitBrokerField, continuePortfolio,
|
|
173
|
+
backPortfolio, openBrokerGuide,
|
|
174
|
+
} = useOnboardingBrokerForm({
|
|
175
|
+
selectedBrokerId, activeBrokerFields, brokerFieldIdx, brokerValues, setBrokerSelectIdx, resetBrokerSync,
|
|
176
|
+
setBrokerValues, setSelectedBrokerId, setBrokerFieldIdx, brokerOptions, setEditingField,
|
|
177
|
+
connectSignedInBroker, setPortfolioSub, portfolioOptionIdx, brokerChoices, setPortfolioOptionIdx,
|
|
178
|
+
isBrokerSyncing, syncSelectedBroker, brokerSelectIdx, portfolioSub, continueFromPositions,
|
|
179
|
+
brokerSyncError, rendererHost,
|
|
180
|
+
});
|
|
498
181
|
|
|
499
182
|
useEffect(() => {
|
|
500
183
|
if (!editingField) return;
|
|
@@ -512,180 +195,11 @@ export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComp
|
|
|
512
195
|
researchOpenedRef.current = progress.tickerSymbol;
|
|
513
196
|
recordResearchActivity("ticker_saved");
|
|
514
197
|
}, [stage, progress.tickerSymbol]);
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
// whichever account reaches the step.
|
|
521
|
-
const accountId = planAccess.signedIn ? apiClient.getCurrentUser()?.id ?? null : null;
|
|
522
|
-
useEffect(() => {
|
|
523
|
-
if (stage !== "upgrade") return;
|
|
524
|
-
let live = true;
|
|
525
|
-
void loadUpgradeOffer().then((loaded) => {
|
|
526
|
-
if (live) setOffer(loaded);
|
|
527
|
-
});
|
|
528
|
-
return () => {
|
|
529
|
-
live = false;
|
|
530
|
-
};
|
|
531
|
-
}, [accountId, stage]);
|
|
532
|
-
useEffect(() => {
|
|
533
|
-
if (stage !== "upgrade" || !progress.checkoutOpenedAt || !appActive) return;
|
|
534
|
-
void apiClient.getSession()
|
|
535
|
-
.then(() => chatController.refreshSession())
|
|
536
|
-
.catch(() => {});
|
|
537
|
-
}, [appActive, progress.checkoutOpenedAt, stage]);
|
|
538
|
-
|
|
539
|
-
useEffect(() => {
|
|
540
|
-
if (stage === "upgrade" && planAccess.hasProAccess) {
|
|
541
|
-
saveProgressInBackground({ stage: "ready", accountStatus: "signed-in" });
|
|
542
|
-
}
|
|
543
|
-
}, [planAccess.hasProAccess, saveProgressInBackground, stage]);
|
|
544
|
-
|
|
545
|
-
const setBrokerFieldValue = useCallback((brokerId: string, key: string, value: string) => {
|
|
546
|
-
resetBrokerSync();
|
|
547
|
-
setBrokerValues((previous) => ({
|
|
548
|
-
...previous,
|
|
549
|
-
[brokerId]: { ...previous[brokerId], [key]: value },
|
|
550
|
-
}));
|
|
551
|
-
}, [resetBrokerSync]);
|
|
552
|
-
|
|
553
|
-
const selectBroker = useCallback((brokerId: string) => {
|
|
554
|
-
resetBrokerSync();
|
|
555
|
-
setSelectedBrokerId(brokerId);
|
|
556
|
-
setBrokerFieldIdx(0);
|
|
557
|
-
const broker = brokerOptions.find((option) => option.id === brokerId);
|
|
558
|
-
if (broker?.signedIn) {
|
|
559
|
-
// Nothing to fill in: the connect dialog opens over this step.
|
|
560
|
-
setEditingField(false);
|
|
561
|
-
void connectSignedInBroker(broker.signedIn);
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
setPortfolioSub("broker-fields");
|
|
565
|
-
const firstField = broker?.adapter
|
|
566
|
-
? resolveBrokerConfigFields(broker.adapter, brokerValues[brokerId] ?? {}).filter((field) => field.required)[0]
|
|
567
|
-
: null;
|
|
568
|
-
setEditingField(firstField?.type !== "select");
|
|
569
|
-
}, [brokerOptions, brokerValues, connectSignedInBroker, resetBrokerSync]);
|
|
570
|
-
|
|
571
|
-
const chooseBroker = useCallback((choiceIndex = portfolioOptionIdx) => {
|
|
572
|
-
const choice = brokerChoices[choiceIndex];
|
|
573
|
-
if (choice) selectBroker(choice.id);
|
|
574
|
-
}, [brokerChoices, portfolioOptionIdx, selectBroker]);
|
|
575
|
-
|
|
576
|
-
/** Broker import is the secondary path: one broker goes straight to its fields. */
|
|
577
|
-
const openBrokerConnect = useCallback(() => {
|
|
578
|
-
if (brokerOptions.length === 0) return;
|
|
579
|
-
setEditingField(false);
|
|
580
|
-
if (brokerOptions.length === 1) {
|
|
581
|
-
selectBroker(brokerOptions[0]!.id);
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
setPortfolioOptionIdx(0);
|
|
585
|
-
setPortfolioSub("choose");
|
|
586
|
-
}, [brokerOptions, selectBroker]);
|
|
587
|
-
|
|
588
|
-
const submitBrokerField = useCallback(() => {
|
|
589
|
-
if (!selectedBrokerId || isBrokerSyncing) return;
|
|
590
|
-
const field = activeBrokerFields[brokerFieldIdx];
|
|
591
|
-
if (!field) {
|
|
592
|
-
void syncSelectedBroker();
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
const currentValues = brokerValues[selectedBrokerId] ?? {};
|
|
597
|
-
if (field.type === "select") {
|
|
598
|
-
const option = field.options?.[brokerSelectIdx];
|
|
599
|
-
if (!option) return;
|
|
600
|
-
const nextValues = { ...currentValues, [field.key]: option.value };
|
|
601
|
-
setBrokerFieldValue(selectedBrokerId, field.key, option.value);
|
|
602
|
-
const adapter = brokerOptions.find((entry) => entry.id === selectedBrokerId)?.adapter;
|
|
603
|
-
const nextFields = adapter
|
|
604
|
-
? resolveBrokerConfigFields(adapter, nextValues).filter((entry) => entry.required)
|
|
605
|
-
: activeBrokerFields;
|
|
606
|
-
if (brokerFieldIdx < nextFields.length - 1) {
|
|
607
|
-
const nextIndex = brokerFieldIdx + 1;
|
|
608
|
-
setBrokerFieldIdx(nextIndex);
|
|
609
|
-
if (field.key === "connectionMode") {
|
|
610
|
-
setPortfolioSub("broker-setup");
|
|
611
|
-
} else {
|
|
612
|
-
setEditingField(nextFields[nextIndex]?.type !== "select");
|
|
613
|
-
}
|
|
614
|
-
return;
|
|
615
|
-
}
|
|
616
|
-
void syncSelectedBroker(nextValues);
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
const rawValue = currentValues[field.key]?.trim() ?? "";
|
|
621
|
-
const value = rawValue || field.defaultValue || "";
|
|
622
|
-
if (!value) {
|
|
623
|
-
setEditingField(true);
|
|
624
|
-
return;
|
|
625
|
-
}
|
|
626
|
-
const nextValues = { ...currentValues, [field.key]: value };
|
|
627
|
-
if (!rawValue && field.defaultValue) {
|
|
628
|
-
setBrokerFieldValue(selectedBrokerId, field.key, field.defaultValue);
|
|
629
|
-
}
|
|
630
|
-
setEditingField(false);
|
|
631
|
-
if (brokerFieldIdx < activeBrokerFields.length - 1) {
|
|
632
|
-
const nextIndex = brokerFieldIdx + 1;
|
|
633
|
-
setBrokerFieldIdx(nextIndex);
|
|
634
|
-
setEditingField(activeBrokerFields[nextIndex]?.type !== "select");
|
|
635
|
-
return;
|
|
636
|
-
}
|
|
637
|
-
void syncSelectedBroker(nextValues);
|
|
638
|
-
}, [
|
|
639
|
-
activeBrokerFields,
|
|
640
|
-
brokerFieldIdx,
|
|
641
|
-
brokerOptions,
|
|
642
|
-
brokerSelectIdx,
|
|
643
|
-
brokerValues,
|
|
644
|
-
isBrokerSyncing,
|
|
645
|
-
selectedBrokerId,
|
|
646
|
-
setBrokerFieldValue,
|
|
647
|
-
syncSelectedBroker,
|
|
648
|
-
]);
|
|
649
|
-
|
|
650
|
-
const continuePortfolio = useCallback(() => {
|
|
651
|
-
if (portfolioSub === "positions") {
|
|
652
|
-
continueFromPositions();
|
|
653
|
-
return;
|
|
654
|
-
}
|
|
655
|
-
if (portfolioSub === "choose") {
|
|
656
|
-
chooseBroker();
|
|
657
|
-
return;
|
|
658
|
-
}
|
|
659
|
-
if (portfolioSub === "broker-setup") {
|
|
660
|
-
setPortfolioSub("broker-fields");
|
|
661
|
-
setEditingField(activeBrokerFields[brokerFieldIdx]?.type !== "select");
|
|
662
|
-
return;
|
|
663
|
-
}
|
|
664
|
-
if (portfolioSub === "broker-sync") {
|
|
665
|
-
if (!isBrokerSyncing && brokerSyncError) void syncSelectedBroker();
|
|
666
|
-
return;
|
|
667
|
-
}
|
|
668
|
-
submitBrokerField();
|
|
669
|
-
}, [
|
|
670
|
-
activeBrokerFields,
|
|
671
|
-
brokerFieldIdx,
|
|
672
|
-
brokerSyncError,
|
|
673
|
-
chooseBroker,
|
|
674
|
-
continueFromPositions,
|
|
675
|
-
isBrokerSyncing,
|
|
676
|
-
portfolioSub,
|
|
677
|
-
submitBrokerField,
|
|
678
|
-
syncSelectedBroker,
|
|
679
|
-
]);
|
|
680
|
-
|
|
681
|
-
const backPortfolio = useCallback(() => {
|
|
682
|
-
if (portfolioSub === "positions") return;
|
|
683
|
-
if (portfolioSub === "broker-sync" && !resetBrokerSync()) return;
|
|
684
|
-
setPortfolioSub("positions");
|
|
685
|
-
setSelectedBrokerId(null);
|
|
686
|
-
setBrokerFieldIdx(0);
|
|
687
|
-
setEditingField(false);
|
|
688
|
-
}, [portfolioSub, resetBrokerSync]);
|
|
198
|
+
const {
|
|
199
|
+
offer, pricing, billingInterval, setBillingInterval, planAccess, primaryUpgradeAction, continueFree,
|
|
200
|
+
} = useOnboardingUpgrade({
|
|
201
|
+
stage, progress, saveProgressInBackground, persistProgress,
|
|
202
|
+
});
|
|
689
203
|
|
|
690
204
|
const movePositionCursor = useCallback((delta: number) => {
|
|
691
205
|
if (positionCursorIndex < 0) return;
|
|
@@ -701,11 +215,6 @@ export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComp
|
|
|
701
215
|
void positions.removePosition(selectedPositionSymbol);
|
|
702
216
|
}, [positionCursorIndex, positions, selectedPositionSymbol]);
|
|
703
217
|
|
|
704
|
-
const openBrokerGuide = useCallback(() => {
|
|
705
|
-
const url = selectedBrokerId ? brokerSetupGuideUrl(selectedBrokerId, brokerValues) : null;
|
|
706
|
-
if (url) void rendererHost.openExternal(url).catch(() => {});
|
|
707
|
-
}, [brokerValues, rendererHost, selectedBrokerId]);
|
|
708
|
-
|
|
709
218
|
const submitAccountField = useCallback(() => {
|
|
710
219
|
setEditingField(false);
|
|
711
220
|
account.submitAccountField();
|
|
@@ -726,34 +235,6 @@ export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComp
|
|
|
726
235
|
if (stage === "account" && (account.accountSub === "signup" || account.accountSub === "login")) setEditingField(true);
|
|
727
236
|
}, [account.accountSub, stage]);
|
|
728
237
|
|
|
729
|
-
const startUpgrade = useCallback(() => {
|
|
730
|
-
void openUpgrade({
|
|
731
|
-
interval: billingInterval,
|
|
732
|
-
sheet: false,
|
|
733
|
-
// Stamped once per checkout that opens, not per keypress: the repeats
|
|
734
|
-
// of a held Enter are ignored.
|
|
735
|
-
onOpening: () => {
|
|
736
|
-
void persistProgress({
|
|
737
|
-
stage: "upgrade",
|
|
738
|
-
accountStatus: progress.accountStatus,
|
|
739
|
-
checkoutOpenedAt: new Date().toISOString(),
|
|
740
|
-
}).catch(() => {});
|
|
741
|
-
},
|
|
742
|
-
});
|
|
743
|
-
}, [billingInterval, openUpgrade, persistProgress, progress.accountStatus]);
|
|
744
|
-
|
|
745
|
-
const primaryUpgradeAction = useCallback(() => {
|
|
746
|
-
if (planAccess.hasProAccess) {
|
|
747
|
-
saveProgressInBackground({ stage: "ready", accountStatus: "signed-in" });
|
|
748
|
-
return;
|
|
749
|
-
}
|
|
750
|
-
startUpgrade();
|
|
751
|
-
}, [planAccess.hasProAccess, saveProgressInBackground, startUpgrade]);
|
|
752
|
-
|
|
753
|
-
const continueFree = useCallback(() => {
|
|
754
|
-
saveProgressInBackground({ stage: "ready", accountStatus: progress.accountStatus });
|
|
755
|
-
}, [progress.accountStatus, saveProgressInBackground]);
|
|
756
|
-
|
|
757
238
|
const focusedPaneId = useAppSelector((state) => state.focusedPaneId);
|
|
758
239
|
const focusedInstance = focusedPaneId
|
|
759
240
|
? findPaneInstance(config.layout, focusedPaneId)
|
|
@@ -787,212 +268,44 @@ export function OnboardingWizard({ pluginRegistry, importBrokerPositions, onComp
|
|
|
787
268
|
|| progress.accountStatus === "signed-in"
|
|
788
269
|
),
|
|
789
270
|
};
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
* so nothing reaches the workspace behind the scrim. The scope carries the
|
|
802
|
-
* stage so each step registers afresh and runs ahead of any pane that
|
|
803
|
-
* mounted since (the first-run workspace mounts after the wizard).
|
|
804
|
-
*/
|
|
805
|
-
useShortcut((event) => {
|
|
806
|
-
const name = event.name ?? event.key ?? "";
|
|
807
|
-
const chord = event.ctrl || event.meta || event.super === true || event.alt;
|
|
808
|
-
const enter = !chord && (name === "enter" || name === "return");
|
|
809
|
-
const escape = !chord && (name === "escape" || name === "backspace");
|
|
810
|
-
const letter = (key: string) => !chord && !event.shift && name === key;
|
|
811
|
-
const tab = !chord && name === "tab";
|
|
812
|
-
const sectionDigit = !chord && !editingField && !event.targetEditable ? SECTION_DIGITS[name] : undefined;
|
|
813
|
-
|
|
814
|
-
const handled = ((): boolean => {
|
|
815
|
-
if (isPlainKey(event, "f10")) {
|
|
816
|
-
if (stage === "portfolio" || stage === "desks" || isBrokerCommitting) return true;
|
|
817
|
-
if (stage === "upgrade" && !planAccess.hasProAccess) continueFree();
|
|
818
|
-
else void finish(true);
|
|
819
|
-
return true;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
if (sectionDigit) {
|
|
823
|
-
if (sectionDigit !== activeSection && sectionAvailability[sectionDigit]) goToSection(sectionDigit);
|
|
824
|
-
return true;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
if (stage === "portfolio" && portfolioSub === "positions") {
|
|
828
|
-
if (editingField) {
|
|
829
|
-
if (enter) {
|
|
830
|
-
positions.submitField();
|
|
831
|
-
} else if (tab) {
|
|
832
|
-
positions.setFieldIdx((index) => (
|
|
833
|
-
event.shift ? Math.max(0, index - 1) : Math.min(POSITION_FIELDS.length - 1, index + 1)
|
|
834
|
-
));
|
|
835
|
-
} else if (!chord && name === "escape") {
|
|
836
|
-
setEditingField(false);
|
|
837
|
-
} else {
|
|
838
|
-
return false;
|
|
839
|
-
}
|
|
840
|
-
return true;
|
|
841
|
-
}
|
|
842
|
-
if (enter) {
|
|
843
|
-
if (positionCount > 0) continueFromPositions();
|
|
844
|
-
else positions.focusField(0);
|
|
845
|
-
} else if (letter("a") || tab) {
|
|
846
|
-
// Tab from the list goes back into the form, at its far end for Shift+Tab.
|
|
847
|
-
positions.focusField(tab && event.shift ? POSITION_FIELDS.length - 1 : 0);
|
|
848
|
-
} else if (letter(CONNECT_BROKER_KEY) && positionCount > 0) {
|
|
849
|
-
openBrokerConnect();
|
|
850
|
-
} else if (!chord && (name === "up" || name === "k")) {
|
|
851
|
-
movePositionCursor(-1);
|
|
852
|
-
} else if (!chord && (name === "down" || name === "j")) {
|
|
853
|
-
movePositionCursor(1);
|
|
854
|
-
} else if (letter(REMOVE_POSITION_KEY) || (!chord && name === "delete")) {
|
|
855
|
-
removePositionAtCursor();
|
|
856
|
-
} else {
|
|
857
|
-
return false;
|
|
858
|
-
}
|
|
859
|
-
return true;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
if (editingField && (stage === "portfolio" || (stage === "account" && accountForm))) {
|
|
863
|
-
if (enter) {
|
|
864
|
-
if (stage === "portfolio") submitBrokerField();
|
|
865
|
-
else submitAccountField();
|
|
866
|
-
} else if (!chord && name === "escape") {
|
|
867
|
-
setEditingField(false);
|
|
868
|
-
if (stage === "portfolio") backPortfolio();
|
|
869
|
-
} else if (stage === "account" && tab) {
|
|
870
|
-
account.focusAccountField(event.shift ? 0 : 1);
|
|
871
|
-
} else {
|
|
872
|
-
return false;
|
|
873
|
-
}
|
|
874
|
-
return true;
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
if (stage === "portfolio") {
|
|
878
|
-
if (enter) {
|
|
879
|
-
continuePortfolio();
|
|
880
|
-
} else if (escape) {
|
|
881
|
-
backPortfolio();
|
|
882
|
-
} else if (!chord && (name === "up" || name === "k")) {
|
|
883
|
-
if (portfolioSub === "choose") setPortfolioOptionIdx((index) => Math.max(0, index - 1));
|
|
884
|
-
else if (activeBrokerFields[brokerFieldIdx]?.type === "select") setBrokerSelectIdx((index) => Math.max(0, index - 1));
|
|
885
|
-
} else if (!chord && (name === "down" || name === "j")) {
|
|
886
|
-
if (portfolioSub === "choose") setPortfolioOptionIdx((index) => Math.min(brokerChoices.length - 1, index + 1));
|
|
887
|
-
else if (activeBrokerFields[brokerFieldIdx]?.type === "select") {
|
|
888
|
-
const optionCount = activeBrokerFields[brokerFieldIdx]?.options?.length ?? 0;
|
|
889
|
-
setBrokerSelectIdx((index) => Math.min(Math.max(0, optionCount - 1), index + 1));
|
|
890
|
-
}
|
|
891
|
-
} else if (portfolioSub === "broker-setup" && letter(BROKER_GUIDE_KEY)) {
|
|
892
|
-
openBrokerGuide();
|
|
893
|
-
} else {
|
|
894
|
-
return false;
|
|
895
|
-
}
|
|
896
|
-
return true;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
if (stage === "desks") {
|
|
900
|
-
if (enter) {
|
|
901
|
-
if (chosenDesks.length > 0) finishDesks(chosenDesks);
|
|
902
|
-
} else if (letter(SKIP_DESKS_KEY)) {
|
|
903
|
-
finishDesks([]);
|
|
904
|
-
} else if (!chord && (name === "up" || name === "k")) {
|
|
905
|
-
setDeskCursor((index) => Math.max(0, index - 1));
|
|
906
|
-
} else if (!chord && (name === "down" || name === "j")) {
|
|
907
|
-
setDeskCursor((index) => Math.min(DESKS.length - 1, index + 1));
|
|
908
|
-
} else if (!chord && (name === "space" || event.sequence === " ")) {
|
|
909
|
-
const desk = DESKS[deskCursor];
|
|
910
|
-
if (desk) setChosenDesks((current) => toggleDeskChoice(current, desk.key));
|
|
911
|
-
} else {
|
|
912
|
-
return false;
|
|
913
|
-
}
|
|
914
|
-
return true;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
if (stage === "account") {
|
|
918
|
-
if (enter) {
|
|
919
|
-
continueAccount();
|
|
920
|
-
} else if (escape) {
|
|
921
|
-
if (account.accountSub === "qr" || account.accountSub === "login") account.returnToAccountForm();
|
|
922
|
-
else goToSection("portfolio");
|
|
923
|
-
} else if (letter(BROWSER_SIGN_IN_KEY) && accountForm) {
|
|
924
|
-
account.beginQrSignIn();
|
|
925
|
-
} else if (letter(SKIP_SETUP_KEY)) {
|
|
926
|
-
skipSetup();
|
|
927
|
-
} else if (tab && accountForm) {
|
|
928
|
-
account.focusAccountField(account.accountFieldIdx > 0 ? 1 : 0);
|
|
929
|
-
} else {
|
|
930
|
-
return false;
|
|
931
|
-
}
|
|
932
|
-
return true;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
if (stage === "upgrade") {
|
|
936
|
-
if (enter) {
|
|
937
|
-
primaryUpgradeAction();
|
|
938
|
-
} else if (escape) {
|
|
939
|
-
goToSection("cloud");
|
|
940
|
-
} else if (!planAccess.hasProAccess && letter(KEEP_FREE_KEY)) {
|
|
941
|
-
continueFree();
|
|
942
|
-
} else if (!planAccess.hasProAccess && (isPlainKey(event, "left") || letter("h"))) {
|
|
943
|
-
setBillingInterval("month");
|
|
944
|
-
} else if (!planAccess.hasProAccess && (isPlainKey(event, "right") || letter("l"))) {
|
|
945
|
-
setBillingInterval("year");
|
|
946
|
-
} else {
|
|
947
|
-
return false;
|
|
948
|
-
}
|
|
949
|
-
return true;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
if (stage === "ready") {
|
|
953
|
-
if (enter) void finish();
|
|
954
|
-
else if (escape) goToSection(progress.accountStatus === "signed-in" ? "pro" : "cloud");
|
|
955
|
-
else return false;
|
|
956
|
-
return true;
|
|
957
|
-
}
|
|
958
|
-
return false;
|
|
959
|
-
})();
|
|
960
|
-
|
|
961
|
-
if (handled) {
|
|
962
|
-
event.preventDefault();
|
|
963
|
-
event.stopPropagation();
|
|
964
|
-
return;
|
|
965
|
-
}
|
|
966
|
-
if (keyReachesPastOnboardingModal(event, keybindings)) return;
|
|
967
|
-
// An app chord held here still must not fall through to the browser's own
|
|
968
|
-
// meaning for it (Cmd+digit switches tabs in a web host).
|
|
969
|
-
if (matchKeybinding(keybindings, event)) event.preventDefault();
|
|
970
|
-
event.stopPropagation();
|
|
971
|
-
}, {
|
|
972
|
-
phase: "before",
|
|
973
|
-
allowEditable: true,
|
|
974
|
-
scope: `onboarding:${stage}`,
|
|
975
|
-
enabled: modalShown && !dialogOpen && !commandBarOpen,
|
|
271
|
+
// Enter inside every form is handled once, by the shortcut below: the
|
|
272
|
+
// fields deliberately get no onSubmit, because the host input fires it in
|
|
273
|
+
// the same keystroke and the two paths used to submit twice.
|
|
274
|
+
useOnboardingKeyboard({
|
|
275
|
+
stage, progress, account, helpFocused, editingField, isBrokerCommitting, planAccess, continueFree,
|
|
276
|
+
finish, sectionAvailability, goToSection, portfolioSub, positions, setEditingField, positionCount,
|
|
277
|
+
continueFromPositions, openBrokerConnect, movePositionCursor, removePositionAtCursor, submitBrokerField,
|
|
278
|
+
submitAccountField, backPortfolio, continuePortfolio, setPortfolioOptionIdx, activeBrokerFields,
|
|
279
|
+
brokerFieldIdx, setBrokerSelectIdx, brokerChoices, openBrokerGuide, chosenDesks, finishDesks,
|
|
280
|
+
setDeskCursor, deskCursor, setChosenDesks, continueAccount, skipSetup, primaryUpgradeAction,
|
|
281
|
+
setBillingInterval, keybindings, dialogOpen, commandBarOpen, saveProgressInBackground,
|
|
976
282
|
});
|
|
977
283
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
284
|
+
return {
|
|
285
|
+
helpFocused, stage, progress, notificationDismissShortcut, finish, notificationActionShortcut,
|
|
286
|
+
saveProgressInBackground, colors, commandBarShortcut, selectedBrokerId, brokerOptions, portfolioSub,
|
|
287
|
+
sectionAvailability, goToSection, skipSetup, isFinishing, isBrokerCommitting, desktop, positions,
|
|
288
|
+
inputRef, editingField, selectedPositionSymbol, brokerChoices, portfolioOptionIdx, setPortfolioOptionIdx,
|
|
289
|
+
chooseBroker, activeBrokerFields, brokerFieldIdx, brokerSelectIdx, setBrokerSelectIdx, brokerValues,
|
|
290
|
+
setBrokerFieldValue, isBrokerSyncing, brokerSyncError, persistenceError, positionCount,
|
|
291
|
+
openBrokerConnect, continueFromPositions, backPortfolio, continuePortfolio, chosenDesks, deskCursor,
|
|
292
|
+
setDeskCursor, setChosenDesks, buildingDesks, finishDesks, account, viewportHeight, continueAccount,
|
|
293
|
+
offer, planAccess, pricing, billingInterval, setBillingInterval, continueFree, primaryUpgradeAction,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export function OnboardingWizard(props: OnboardingWizardProps) {
|
|
298
|
+
const {
|
|
299
|
+
helpFocused, stage, progress, notificationDismissShortcut, finish, notificationActionShortcut,
|
|
300
|
+
saveProgressInBackground, colors, commandBarShortcut, selectedBrokerId, brokerOptions, portfolioSub,
|
|
301
|
+
sectionAvailability, goToSection, skipSetup, isFinishing, isBrokerCommitting, desktop, positions,
|
|
302
|
+
inputRef, editingField, selectedPositionSymbol, brokerChoices, portfolioOptionIdx, setPortfolioOptionIdx,
|
|
303
|
+
chooseBroker, activeBrokerFields, brokerFieldIdx, brokerSelectIdx, setBrokerSelectIdx, brokerValues,
|
|
304
|
+
setBrokerFieldValue, isBrokerSyncing, brokerSyncError, persistenceError, positionCount,
|
|
305
|
+
openBrokerConnect, continueFromPositions, backPortfolio, continuePortfolio, chosenDesks, deskCursor,
|
|
306
|
+
setDeskCursor, setChosenDesks, buildingDesks, finishDesks, account, viewportHeight, continueAccount,
|
|
307
|
+
offer, planAccess, pricing, billingInterval, setBillingInterval, continueFree, primaryUpgradeAction,
|
|
308
|
+
} = useOnboardingWizard(props);
|
|
996
309
|
|
|
997
310
|
if (helpFocused) {
|
|
998
311
|
return null;
|