gloomberb 0.16.6 → 0.17.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/package.json +2 -1
- package/src/api-client/chat-pane-link.ts +47 -0
- package/src/api-client/chat.ts +9 -1
- package/src/api-client/data.ts +37 -1
- package/src/api-client/equity-screener.ts +3 -0
- package/src/api-client/europe-energy.ts +91 -0
- package/src/api-client/index.ts +6 -0
- package/src/api-client/letters.ts +41 -0
- package/src/api-client/normalizers.ts +36 -6
- package/src/api-client/organization-tickers.ts +44 -0
- package/src/api-client/request.ts +3 -1
- package/src/api-client/types.ts +27 -1
- package/src/app/runtime/desktop-deeplink.ts +48 -15
- package/src/architecture/core-builtin-allowlist.json +1 -1
- package/src/architecture/dom-cell-metrics-allowlist.json +28 -0
- package/src/ask-gloom/pane-context.ts +23 -19
- package/src/ask-gloom/pane-request.ts +2 -2
- package/src/cli/commands/fred-series.ts +77 -11
- package/src/cli/commands/market.ts +77 -20
- package/src/cli/commands/overview.ts +29 -20
- package/src/cli/commands/ticker.ts +64 -11
- package/src/cli/desktop-pane-shot-view.ts +114 -0
- package/src/cli/desktop-pane-shot.ts +30 -31
- package/src/cli/entry.ts +7 -0
- package/src/cli/export-source.ts +43 -0
- package/src/cli/freshness.ts +18 -3
- package/src/cli/glossary.ts +17 -0
- package/src/cli/history-rows.ts +174 -13
- package/src/cli/known-gaps.ts +14 -3
- package/src/cli/listing-arg.ts +20 -2
- package/src/cli/listing-suggestion.ts +159 -0
- package/src/cli/native-smoke.ts +13 -0
- package/src/cli/not-a-ticker.ts +13 -1
- package/src/cli/pane-functions/capabilities.ts +16 -8
- package/src/cli/pane-functions/dom.ts +28 -13
- package/src/cli/pane-functions/function-help.ts +51 -6
- package/src/cli/pane-functions/headless.ts +26 -7
- package/src/cli/pane-functions/index.ts +46 -3
- package/src/cli/pane-functions/report-notices.ts +6 -3
- package/src/cli/pane-functions/report.ts +16 -2
- package/src/cli/pane-functions/resolver.ts +7 -4
- package/src/cli/report-tables.ts +31 -7
- package/src/cli/result.ts +54 -11
- package/src/cli/symbol-rows.ts +18 -1
- package/src/components/chart/composite/axis-overlays.tsx +2 -0
- package/src/components/chart/composite/composite-chart.tsx +4 -21
- package/src/components/chart/composite/legend.tsx +10 -6
- package/src/components/chart/composite/price-axis-labels.tsx +1 -0
- package/src/components/command-bar/list/model.ts +2 -0
- package/src/components/command-bar/pane-templates/items.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/actions.ts +1 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +3 -1
- package/src/components/command-bar/workflow/ops.ts +8 -97
- package/src/components/command-bar/workflow/pane-reuse.ts +177 -0
- package/src/components/data-table/view.tsx +1 -0
- package/src/components/feed-data-table/stack-view.tsx +18 -42
- package/src/components/layout/missing-pane.tsx +2 -0
- package/src/components/layout/shell/index.tsx +1 -0
- package/src/components/layout/shell/pane/ask.ts +12 -7
- package/src/components/layout/shell/pane/capture.ts +8 -34
- package/src/components/markdown-text.tsx +37 -6
- package/src/components/reader/article-reader.tsx +91 -266
- package/src/components/reader/detail-reader.tsx +210 -0
- package/src/components/reader/reader-text.tsx +239 -0
- package/src/components/table-view-shared.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +15 -4
- package/src/components/ui/choice-dialog.tsx +3 -0
- package/src/components/ui/data-table/types.ts +7 -0
- package/src/components/ui/detail-scroll-body.tsx +31 -4
- package/src/components/ui/display.tsx +46 -1
- package/src/components/ui/icon.tsx +11 -1
- package/src/components/ui/list-view.tsx +3 -1
- package/src/components/ui/query-bar-keys.tsx +2 -0
- package/src/components/ui/query-bar.tsx +9 -1
- package/src/components/ui/select-button.tsx +3 -0
- package/src/data/config/store/fold-panes.ts +202 -11
- package/src/data/config/store/migrations.ts +13 -1
- package/src/docs/snapshot.json +29 -0
- package/src/i18n/es.ts +14 -0
- package/src/i18n/ja.ts +14 -0
- package/src/i18n/ko.ts +14 -0
- package/src/i18n/zh-cn.ts +14 -0
- package/src/i18n/zh-tw.ts +14 -0
- package/src/layout/desk-keys.ts +7 -0
- package/src/layout/desks.ts +2 -2
- package/src/market-data/market/status.ts +67 -6
- package/src/market-data/quotes/contributions.ts +15 -0
- package/src/market-data/quotes/regular-session-valuation.ts +131 -0
- package/src/market-data/quotes/resolution.ts +4 -0
- package/src/market-data/snapshot-provider.ts +6 -3
- package/src/notifications/app-badge.ts +30 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +1 -1
- package/src/plugins/builtin/account-management/form-components.tsx +53 -1
- package/src/plugins/builtin/account-management/keyboard.ts +5 -0
- package/src/plugins/builtin/account-management/model.ts +27 -0
- package/src/plugins/builtin/account-management/pane.tsx +62 -2
- package/src/plugins/builtin/alerts/cli.ts +6 -4
- package/src/plugins/builtin/analytics/index.tsx +1 -1
- package/src/plugins/builtin/awards/pane.tsx +29 -18
- package/src/plugins/builtin/backtest/pane.tsx +2 -1
- package/src/plugins/builtin/bond-calculator/index.tsx +3 -5
- package/src/plugins/builtin/buildout/detail/company.tsx +7 -4
- package/src/plugins/builtin/builtin-plugin-meta.ts +5 -4
- package/src/plugins/builtin/catalysts/model.ts +92 -10
- package/src/plugins/builtin/catalysts/pane.tsx +6 -4
- package/src/plugins/builtin/cds/index.tsx +21 -30
- package/src/plugins/builtin/changelog/index.tsx +11 -12
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
- package/src/plugins/builtin/chart-composer/headless.ts +87 -5
- package/src/plugins/builtin/chart-composer/pane.tsx +3 -2
- package/src/plugins/builtin/chart-composer/session-history.ts +20 -5
- package/src/plugins/builtin/chat/command-bar.ts +6 -8
- package/src/plugins/builtin/chat/content/composer-runtime.ts +2 -2
- package/src/plugins/builtin/chat/content/composer.tsx +13 -4
- package/src/plugins/builtin/chat/content/footer.tsx +15 -5
- package/src/plugins/builtin/chat/content/handle-prompt.tsx +326 -0
- package/src/plugins/builtin/chat/content/index.tsx +113 -9
- package/src/plugins/builtin/chat/content/layout-metrics.ts +4 -0
- package/src/plugins/builtin/chat/content/open-targets.ts +20 -4
- package/src/plugins/builtin/chat/content/scroll.ts +6 -1
- package/src/plugins/builtin/chat/content/transcript.tsx +11 -2
- package/src/plugins/builtin/chat/ghost-user.ts +1 -1
- package/src/plugins/builtin/chat/handle-prompt.ts +128 -0
- package/src/plugins/builtin/chat/index.tsx +44 -21
- package/src/plugins/builtin/chat/layout.ts +7 -14
- package/src/plugins/builtin/chat/message/desktop.tsx +59 -11
- package/src/plugins/builtin/chat/message/header.tsx +69 -21
- package/src/plugins/builtin/chat/message/pane-chip.tsx +223 -0
- package/src/plugins/builtin/chat/message/person-icons.tsx +53 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +73 -9
- package/src/plugins/builtin/chat/message/render-state.ts +15 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +33 -8
- package/src/plugins/builtin/chat/message/types.ts +3 -0
- package/src/plugins/builtin/chat/pane-links/model.ts +149 -0
- package/src/plugins/builtin/chat/pane-links/open.ts +29 -0
- package/src/plugins/builtin/chat/pane-links/previews.ts +119 -0
- package/src/plugins/builtin/chat/pane-state.ts +5 -8
- package/src/plugins/builtin/chat/people.ts +202 -0
- package/src/plugins/builtin/chat/profile-popover.ts +18 -2
- package/src/plugins/builtin/chat/status-widget.tsx +3 -8
- package/src/plugins/builtin/chat/unread-badge.ts +65 -0
- package/src/plugins/builtin/chat/unread-inbox-pane.tsx +9 -6
- package/src/plugins/builtin/clinical-trials/client.ts +26 -1
- package/src/plugins/builtin/clinical-trials/index.tsx +10 -2
- package/src/plugins/builtin/clinical-trials/model.ts +269 -0
- package/src/plugins/builtin/clinical-trials/pane.tsx +247 -62
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +156 -0
- package/src/plugins/builtin/cloud/askg/attached-pane.tsx +3 -3
- package/src/plugins/builtin/cloud/askg/pane-attachment.ts +3 -3
- package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +1 -0
- package/src/plugins/builtin/comment-letters/pane.tsx +30 -11
- package/src/plugins/builtin/commodities-energy/index.tsx +179 -0
- package/src/plugins/builtin/commodity-balances/client.ts +208 -0
- package/src/plugins/builtin/commodity-balances/headless.ts +66 -0
- package/src/plugins/builtin/commodity-balances/index.tsx +32 -0
- package/src/plugins/builtin/commodity-balances/model.ts +261 -0
- package/src/plugins/builtin/commodity-balances/pane.tsx +227 -0
- package/src/plugins/builtin/composite-plugins.ts +26 -1
- package/src/plugins/builtin/credit-boards/index.tsx +21 -42
- package/src/plugins/builtin/credit-boards/model.ts +0 -2
- package/src/plugins/builtin/credit-conditions/index.tsx +10 -19
- package/src/plugins/builtin/credit-documents/index.tsx +27 -10
- package/src/plugins/builtin/debt-maturities/index.tsx +3 -17
- package/src/plugins/builtin/debug/index.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +3 -1
- package/src/plugins/builtin/dividend-yield/headless.ts +3 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +3 -1
- package/src/plugins/builtin/dividend-yield/provider-client.ts +3 -1
- package/src/plugins/builtin/docs/blocks.tsx +4 -3
- package/src/plugins/builtin/docs/pane.tsx +16 -8
- package/src/plugins/builtin/earnings/index.tsx +2 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -12
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/headless.ts +36 -2
- package/src/plugins/builtin/equity-screener/model.ts +121 -68
- package/src/plugins/builtin/executives/pane.tsx +3 -1
- package/src/plugins/builtin/filing-events/index.tsx +20 -0
- package/src/plugins/builtin/fixed-income/index.tsx +46 -0
- package/src/plugins/builtin/fixed-income/model.ts +27 -0
- package/src/plugins/builtin/fixed-income/pane.tsx +162 -0
- package/src/plugins/builtin/fixed-income/shortcut.ts +52 -0
- package/src/plugins/builtin/futures/index.tsx +24 -7
- package/src/plugins/builtin/futures/series.ts +23 -2
- package/src/plugins/builtin/futures/use-front-returns.ts +3 -2
- package/src/plugins/builtin/futures-curve/pane.tsx +6 -4
- package/src/plugins/builtin/help/shortcut-table.tsx +4 -2
- package/src/plugins/builtin/insider/detail.tsx +20 -12
- package/src/plugins/builtin/insider/index.tsx +2 -2
- package/src/plugins/builtin/iv-history/index.tsx +3 -0
- package/src/plugins/builtin/iv-history/screen-pane.tsx +13 -5
- package/src/plugins/builtin/jodi/client.ts +220 -0
- package/src/plugins/builtin/jodi/headless.ts +63 -0
- package/src/plugins/builtin/jodi/index.tsx +32 -0
- package/src/plugins/builtin/jodi/model.ts +75 -0
- package/src/plugins/builtin/jodi/pane.tsx +141 -0
- package/src/plugins/builtin/market-heatmap/evidence.ts +13 -4
- package/src/plugins/builtin/market-heatmap/headless.ts +3 -3
- package/src/plugins/builtin/market-heatmap/index.tsx +41 -23
- package/src/plugins/builtin/market-heatmap/live.ts +2 -1
- package/src/plugins/builtin/market-heatmap/portfolio.ts +67 -21
- package/src/plugins/builtin/market-movers/table.ts +2 -2
- package/src/plugins/builtin/market-valuation/align.ts +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +52 -1
- package/src/plugins/builtin/mna/distress/pane.tsx +17 -12
- package/src/plugins/builtin/mna/index.tsx +2 -0
- package/src/plugins/builtin/news/wire/index.tsx +2 -2
- package/src/plugins/builtin/news/wire/industry-pane.tsx +28 -14
- package/src/plugins/builtin/news/wire/letters/client.ts +108 -0
- package/src/plugins/builtin/news/wire/letters/model.ts +69 -0
- package/src/plugins/builtin/news/wire/letters/pane.tsx +155 -0
- package/src/plugins/builtin/news/wire/mutes.ts +2 -1
- package/src/plugins/builtin/news/wire/news/query-presets.ts +4 -1
- package/src/plugins/builtin/openfda/client.ts +123 -15
- package/src/plugins/builtin/openfda/model.ts +163 -0
- package/src/plugins/builtin/openfda/pane.tsx +109 -65
- package/src/plugins/builtin/openfda/types.ts +25 -0
- package/src/plugins/builtin/options/view.tsx +1 -1
- package/src/plugins/builtin/pe-band/model.ts +3 -2
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +1 -1
- package/src/plugins/builtin/plugin-module.ts +3 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +1 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +19 -4
- package/src/plugins/builtin/portfolio-list/cli/render.ts +2 -2
- package/src/plugins/builtin/portfolio-list/cli/shared.ts +39 -0
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +18 -5
- package/src/plugins/builtin/portfolio-list/live-valuation.ts +25 -13
- package/src/plugins/builtin/power/evidence.ts +32 -3
- package/src/plugins/builtin/power/gas-client.ts +110 -0
- package/src/plugins/builtin/power/gas-model.ts +194 -0
- package/src/plugins/builtin/power/gas.tsx +145 -0
- package/src/plugins/builtin/power/headless.ts +4 -1
- package/src/plugins/builtin/power/index.tsx +19 -9
- package/src/plugins/builtin/power/pane.tsx +2 -3
- package/src/plugins/builtin/power/prices-headless.ts +75 -7
- package/src/plugins/builtin/power/prices.tsx +36 -13
- package/src/plugins/builtin/primary-dealers/client.ts +108 -0
- package/src/plugins/builtin/primary-dealers/headless.ts +53 -0
- package/src/plugins/builtin/primary-dealers/index.tsx +17 -0
- package/src/plugins/builtin/primary-dealers/model.ts +206 -0
- package/src/plugins/builtin/primary-dealers/pane.tsx +149 -0
- package/src/plugins/builtin/relative-rotation/index.tsx +3 -0
- package/src/plugins/builtin/research/analyst-model.ts +9 -5
- package/src/plugins/builtin/research/headless-schema.ts +2 -1
- package/src/plugins/builtin/research/relative-valuation-headless.ts +68 -32
- package/src/plugins/builtin/research/relative-valuation-model.ts +45 -24
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +39 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +8 -1
- package/src/plugins/builtin/sec/filing-display.tsx +3 -36
- package/src/plugins/builtin/sec/index.tsx +131 -43
- package/src/plugins/builtin/sec/model.ts +148 -2
- package/src/plugins/builtin/sec/row-summaries.ts +105 -0
- package/src/plugins/builtin/sectors/index.tsx +2 -0
- package/src/plugins/builtin/sectors/sector-model.ts +2 -2
- package/src/plugins/builtin/series-inventory.ts +1 -0
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/use-quote-board.ts +179 -43
- package/src/plugins/builtin/shared/wall-teaser.tsx +2 -2
- package/src/plugins/builtin/shared/zip-text.ts +46 -0
- package/src/plugins/builtin/short-interest/watch-model.ts +11 -2
- package/src/plugins/builtin/themes/model.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +11 -0
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +81 -19
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +2 -2
- package/src/plugins/builtin/ticker-detail/overview/model.ts +3 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +8 -6
- package/src/plugins/builtin/time-sales/headless.ts +22 -0
- package/src/plugins/builtin/trace-bonds/client.ts +196 -0
- package/src/plugins/builtin/trace-bonds/headless.ts +69 -0
- package/src/plugins/builtin/trace-bonds/index.tsx +33 -0
- package/src/plugins/builtin/trace-bonds/model.ts +115 -0
- package/src/plugins/builtin/trace-bonds/pane.tsx +191 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +33 -47
- package/src/plugins/builtin/treasury-daily/client.ts +96 -0
- package/src/plugins/builtin/treasury-daily/headless.ts +69 -0
- package/src/plugins/builtin/treasury-daily/index.tsx +17 -0
- package/src/plugins/builtin/treasury-daily/model.ts +69 -0
- package/src/plugins/builtin/treasury-daily/pane.tsx +140 -0
- package/src/plugins/builtin/world-venue-map/entity-detail.tsx +15 -2
- package/src/plugins/builtin/world-venue-map/map.tsx +1 -0
- package/src/plugins/builtin-editorial.ts +1 -1
- package/src/plugins/catalog-browser.ts +25 -2
- package/src/plugins/marketplace/model.ts +57 -21
- package/src/renderers/dom/build-assets.ts +14 -5
- package/src/renderers/dom/data-table/index.tsx +5 -3
- package/src/renderers/dom/desktop/controls.tsx +2 -1
- package/src/renderers/dom/desktop/icons.tsx +25 -0
- package/src/renderers/dom/desktop/list-view.tsx +1 -1
- package/src/renderers/dom/desktop/menu.tsx +1 -1
- package/src/renderers/dom/desktop/query-bar.tsx +3 -1
- package/src/renderers/dom/host/chart-surface.tsx +7 -2
- package/src/renderers/dom/host/resize-rows.ts +111 -0
- package/src/renderers/dom/host/sticky-scroll.ts +22 -3
- package/src/renderers/dom/host/style.ts +14 -0
- package/src/renderers/dom/host/surface-3d.tsx +2 -1
- package/src/renderers/dom/host/surface-fit.ts +10 -6
- package/src/renderers/dom/host/text.tsx +2 -2
- package/src/renderers/dom/styles.css +63 -6
- package/src/renderers/electrobun/bun/desktop/app-badge.ts +37 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +1 -0
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +8 -0
- package/src/renderers/electrobun/bun/desktop/macos-dock-badge.ts +37 -0
- package/src/renderers/electrobun/bun/desktop/macos-dock-icon.ts +2 -40
- package/src/renderers/electrobun/bun/desktop/macos-objc.ts +41 -0
- package/src/renderers/electrobun/bun/tui-entry.ts +18 -1
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/app-badge-host.ts +17 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +8 -3
- package/src/renderers/electrobun/view/main.tsx +2 -0
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +5 -1
- package/src/series/validate.ts +1 -1
- package/src/shares/api.ts +5 -1
- package/src/shares/location.ts +31 -0
- package/src/shares/open.ts +26 -0
- package/src/shares/pane-image.ts +18 -6
- package/src/shares/personal-pane.ts +42 -54
- package/src/sources/gloomberb-cloud/index.ts +7 -2
- package/src/sources/gloomberb-cloud/normalizers.ts +5 -0
- package/src/sources/history-coverage.ts +22 -4
- package/src/sources/history-result.ts +3 -1
- package/src/sources/provider-errors.ts +2 -1
- package/src/sources/provider-router/batches.ts +18 -2
- package/src/sources/provider-router/index.ts +2 -1
- package/src/state/app/context/index.tsx +3 -2
- package/src/test-support/builtin-panes.ts +31 -0
- package/src/tickers/listing-venues.ts +22 -0
- package/src/tickers/search/index.ts +7 -2
- package/src/tickers/search/ranking.ts +19 -0
- package/src/time-series/chart-data.ts +2 -0
- package/src/time-series/parsed-history-cache.ts +41 -11
- package/src/time-series/resolve.ts +47 -15
- package/src/types/config.ts +1 -1
- package/src/types/data-provider.ts +13 -1
- package/src/types/financials.ts +13 -0
- package/src/types/headless.ts +22 -0
- package/src/types/plugin.ts +33 -6
- package/src/types/price-history.ts +2 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/crypto-pair.ts +1 -1
- package/src/utils/currency-pair.ts +66 -0
- package/src/utils/decimal-comma.ts +57 -0
- package/src/utils/guards.ts +25 -0
- package/src/utils/local-utc-offset.ts +37 -0
- package/src/utils/plugin-proxy-hosts.json +8 -1
- package/src/components/chart/composite/crosshair-readout.tsx +0 -150
- package/src/plugins/builtin/chat/message/ai-badge.tsx +0 -18
- package/src/plugins/builtin/credit-boards/pane.tsx +0 -30
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { Box, Text, useUiCapabilities } from "../../../ui";
|
|
2
|
-
import { colors as themeColors } from "../../../theme/colors";
|
|
3
|
-
import { displayWidth, truncateToDisplayWidth } from "../../../utils/format";
|
|
4
|
-
import type { ResolvedSeries } from "../../../time-series/types";
|
|
5
|
-
import { formatCompositeCarriedStamp, formatCompositePointDetails } from "./format";
|
|
6
|
-
import { CompositeSeriesSwatch, formatLegendSeriesValue, withoutListingExchange } from "./legend";
|
|
7
|
-
import type { SeriesLineCue } from "./series-cues";
|
|
8
|
-
import type { CompositeChartColors, CompositeChartProps, CompositeChartScene } from "./types";
|
|
9
|
-
|
|
10
|
-
/** A label this long or longer is cut; the legend above keeps the whole name. */
|
|
11
|
-
const MAX_LABEL_CELLS = 24;
|
|
12
|
-
/** Clear space between the crosshair and the readout beside it, px. */
|
|
13
|
-
const CROSSHAIR_GAP_PX = 14;
|
|
14
|
-
/** A row's swatch and its margin, and the box's padding and border, px. */
|
|
15
|
-
const SWATCH_PX = 22;
|
|
16
|
-
const BOX_CHROME_PX = 18;
|
|
17
|
-
const NO_LINE_CUES: ReadonlyMap<string, SeriesLineCue> = new Map();
|
|
18
|
-
|
|
19
|
-
interface ReadoutRow {
|
|
20
|
-
series: ResolvedSeries;
|
|
21
|
-
label: string;
|
|
22
|
-
value: string;
|
|
23
|
-
carried: string | null;
|
|
24
|
-
/** The row in full, with the observation's dates and source: what the legend's entry says for it. */
|
|
25
|
-
detail: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Every series' value at the crosshair, beside it: desktop and web, where the
|
|
30
|
-
* legend keeps the latest values. One row per line in the legend's order, in
|
|
31
|
-
* the line's own unit; a value carried from an earlier observation is dimmed
|
|
32
|
-
* and says when it is from. The time is the time axis's, under the cursor.
|
|
33
|
-
*/
|
|
34
|
-
export function CompositeCrosshairReadout({
|
|
35
|
-
scene,
|
|
36
|
-
series,
|
|
37
|
-
visibleSeriesIds,
|
|
38
|
-
lineCues = NO_LINE_CUES,
|
|
39
|
-
formatValue,
|
|
40
|
-
colors,
|
|
41
|
-
plotWidth,
|
|
42
|
-
left,
|
|
43
|
-
right,
|
|
44
|
-
top,
|
|
45
|
-
}: {
|
|
46
|
-
scene: CompositeChartScene;
|
|
47
|
-
series: readonly ResolvedSeries[];
|
|
48
|
-
visibleSeriesIds: ReadonlySet<string>;
|
|
49
|
-
lineCues?: ReadonlyMap<string, SeriesLineCue>;
|
|
50
|
-
formatValue: CompositeChartProps["formatValue"];
|
|
51
|
-
colors: CompositeChartColors;
|
|
52
|
-
/** The plot's width in cells; the box is placed by CSS in the width the plot has, a fraction of a cell more. */
|
|
53
|
-
plotWidth: number;
|
|
54
|
-
/** The plot's inset from the chart's edges, in cells. */
|
|
55
|
-
left: number;
|
|
56
|
-
right: number;
|
|
57
|
-
top: number;
|
|
58
|
-
}) {
|
|
59
|
-
const { cellWidthPx = 8 } = useUiCapabilities();
|
|
60
|
-
const cursorDate = scene.cursorDate;
|
|
61
|
-
const cursorXRatio = scene.cursorXRatio;
|
|
62
|
-
if (!cursorDate || cursorXRatio === null) return null;
|
|
63
|
-
const values = new Map(scene.cursorValues.map((entry) => [entry.seriesId, entry] as const));
|
|
64
|
-
const rows: ReadoutRow[] = series.flatMap((entry) => {
|
|
65
|
-
const cursor = values.get(entry.id);
|
|
66
|
-
if (!cursor || entry.hidden || !visibleSeriesIds.has(entry.id)) return [];
|
|
67
|
-
const label = withoutListingExchange(entry.label);
|
|
68
|
-
const value = formatLegendSeriesValue(entry, cursor.value, formatValue, scene);
|
|
69
|
-
const carried = cursor.carried && cursor.value != null && cursor.point
|
|
70
|
-
? formatCompositeCarriedStamp(cursor.point.date, cursorDate, scene.timeZone)
|
|
71
|
-
: null;
|
|
72
|
-
return [{
|
|
73
|
-
series: entry,
|
|
74
|
-
label: displayWidth(label) > MAX_LABEL_CELLS ? truncateToDisplayWidth(label, MAX_LABEL_CELLS) : label,
|
|
75
|
-
value,
|
|
76
|
-
carried,
|
|
77
|
-
detail: [`${entry.label} ${value}${carried ? ` ${carried}` : ""}`, formatCompositePointDetails(cursor.point)].filter(Boolean).join(" · "),
|
|
78
|
-
}];
|
|
79
|
-
});
|
|
80
|
-
if (rows.length === 0) return null;
|
|
81
|
-
const labelWidth = Math.max(...rows.map((row) => displayWidth(row.label)));
|
|
82
|
-
// Beside the crosshair on the side with room for it, by the width its text
|
|
83
|
-
// takes; where neither side has, flush with the plot's edge farthest from it.
|
|
84
|
-
const tailCells = Math.max(...rows.map((row) => displayWidth(row.value) + (row.carried ? 1 + displayWidth(row.carried) : 0)));
|
|
85
|
-
const boxPx = SWATCH_PX + BOX_CHROME_PX + (labelWidth + 1 + tailCells) * cellWidthPx;
|
|
86
|
-
const plotPx = plotWidth * cellWidthPx;
|
|
87
|
-
const cursorPx = Math.max(0, Math.min(1, cursorXRatio)) * plotPx;
|
|
88
|
-
const placement = cursorPx + CROSSHAIR_GAP_PX + boxPx <= plotPx ? "right"
|
|
89
|
-
: cursorPx - CROSSHAIR_GAP_PX - boxPx >= 0 ? "left"
|
|
90
|
-
: cursorXRatio > 0.5 ? "start" : "end";
|
|
91
|
-
const position = placement === "start" ? { left: 0 }
|
|
92
|
-
: placement === "end" ? { right: 0 }
|
|
93
|
-
: {
|
|
94
|
-
left: `${Math.max(0, Math.min(1, cursorXRatio)) * 100}%`,
|
|
95
|
-
transform: placement === "left" ? `translateX(calc(-100% - ${CROSSHAIR_GAP_PX}px))` : `translateX(${CROSSHAIR_GAP_PX}px)`,
|
|
96
|
-
};
|
|
97
|
-
return (
|
|
98
|
-
<Box
|
|
99
|
-
position="absolute"
|
|
100
|
-
left={left}
|
|
101
|
-
top={top}
|
|
102
|
-
zIndex={30}
|
|
103
|
-
style={{
|
|
104
|
-
right: `calc(${right} * var(--cell-w))`,
|
|
105
|
-
width: "auto",
|
|
106
|
-
height: 0,
|
|
107
|
-
pointerEvents: "none",
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
<Box
|
|
111
|
-
flexDirection="column"
|
|
112
|
-
position="absolute"
|
|
113
|
-
data-placement={placement}
|
|
114
|
-
style={{
|
|
115
|
-
...position,
|
|
116
|
-
top: 6,
|
|
117
|
-
width: "max-content",
|
|
118
|
-
height: "auto",
|
|
119
|
-
padding: "4px 8px",
|
|
120
|
-
gap: 1,
|
|
121
|
-
borderRadius: 4,
|
|
122
|
-
border: `1px solid ${colors.grid}`,
|
|
123
|
-
backgroundColor: `color-mix(in srgb, ${colors.background} 94%, transparent)`,
|
|
124
|
-
whiteSpace: "pre",
|
|
125
|
-
}}
|
|
126
|
-
data-gloom-role="composite-chart-readout"
|
|
127
|
-
>
|
|
128
|
-
{rows.map((row) => (
|
|
129
|
-
<Box
|
|
130
|
-
key={row.series.id}
|
|
131
|
-
flexDirection="row"
|
|
132
|
-
alignItems="center"
|
|
133
|
-
height={1}
|
|
134
|
-
style={{ width: "auto" }}
|
|
135
|
-
data-gloom-role="composite-chart-readout-row"
|
|
136
|
-
data-gloom-label={row.detail}
|
|
137
|
-
data-carried={row.carried ? "true" : undefined}
|
|
138
|
-
>
|
|
139
|
-
<CompositeSeriesSwatch series={row.series} cue={lineCues.get(row.series.id) ?? null} filled={!row.carried} />
|
|
140
|
-
<Box width={labelWidth + 1} height={1} flexShrink={0}>
|
|
141
|
-
<Text fg={colors.textDim}>{row.label}</Text>
|
|
142
|
-
</Box>
|
|
143
|
-
<Text fg={row.carried ? colors.textDim : colors.text}>{row.value}</Text>
|
|
144
|
-
{row.carried ? <Text fg={themeColors.textMuted}>{` ${row.carried}`}</Text> : null}
|
|
145
|
-
</Box>
|
|
146
|
-
))}
|
|
147
|
-
</Box>
|
|
148
|
-
</Box>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Badge } from "../../../../components/ui";
|
|
2
|
-
import { Box } from "../../../../ui";
|
|
3
|
-
|
|
4
|
-
/** What the badge takes of a terminal line: the cell before it, then "AI" with a cell of padding either side. */
|
|
5
|
-
export const CHAT_AI_BADGE_WIDTH = 5;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* "AI" and a cell of space before it, beside the name of a managed assistant.
|
|
9
|
-
* The neutral badge is the quietest the kit has; a selected row passes its own
|
|
10
|
-
* text color so the chip stays legible on the selection.
|
|
11
|
-
*/
|
|
12
|
-
export function ChatAiBadge({ selectedColor }: { selectedColor?: string }) {
|
|
13
|
-
return (
|
|
14
|
-
<Box flexShrink={0} paddingLeft={1} data-gloom-role="chat-ai-badge">
|
|
15
|
-
<Badge label="AI" color={selectedColor} />
|
|
16
|
-
</Box>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { PaneFooterScope, usePaneTabs } from "../../../components";
|
|
3
|
-
import type { PaneProps } from "../../../types/plugin";
|
|
4
|
-
import { Box } from "../../../ui";
|
|
5
|
-
import { useCommandTab } from "../shared/command-tab";
|
|
6
|
-
import { CdxPane } from "./cdx-pane";
|
|
7
|
-
import { CDX_PANE_ID } from "./model";
|
|
8
|
-
import { SovrPane } from "./sovr-pane";
|
|
9
|
-
|
|
10
|
-
const TABS = [{ value: "index", label: "Index" }, { value: "sovereign", label: "Sovereign" }];
|
|
11
|
-
|
|
12
|
-
export function CreditBoardsPane(props: PaneProps) {
|
|
13
|
-
const [tab, setTab] = useCommandTab(CDX_PANE_ID, "credit-boards:tab", ["index", "sovereign"], "index");
|
|
14
|
-
const [mounted, setMounted] = useState<Set<string>>(() => new Set([tab]));
|
|
15
|
-
useEffect(() => { setMounted((current) => current.has(tab) ? current : new Set([...current, tab])); }, [tab]);
|
|
16
|
-
const { strip: tabStrip, rows: tabRows } = usePaneTabs({
|
|
17
|
-
tabs: TABS, activeValue: tab, onSelect: (value) => setTab(value === "sovereign" ? "sovereign" : "index"), focused: props.focused, dense: true,
|
|
18
|
-
});
|
|
19
|
-
const height = Math.max(1, props.height - tabRows);
|
|
20
|
-
return <Box width={props.width} height={props.height} flexDirection="column">
|
|
21
|
-
{tabStrip}
|
|
22
|
-
{TABS.map(({ value }) => mounted.has(value) || value === tab ? <Box key={value} visible={value === tab} height={height} flexGrow={1} flexBasis={0} overflow="hidden">
|
|
23
|
-
<PaneFooterScope active={value === tab}>
|
|
24
|
-
{value === "sovereign"
|
|
25
|
-
? <SovrPane {...props} height={height} focused={props.focused && value === tab} />
|
|
26
|
-
: <CdxPane {...props} height={height} focused={props.focused && value === tab} />}
|
|
27
|
-
</PaneFooterScope>
|
|
28
|
-
</Box> : null)}
|
|
29
|
-
</Box>;
|
|
30
|
-
}
|