gloomberb 0.20.4 → 0.20.5
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 -0
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +3 -1
- package/src/api-client/data.ts +138 -35
- package/src/api-client/types/econ.ts +12 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +6 -0
- package/src/app/keybindings/config.ts +2 -1
- package/src/app/keybindings/index.ts +1 -0
- package/src/app/keybindings/labels.ts +6 -1
- package/src/app/keybindings/resolve.ts +23 -4
- package/src/app/keybindings/terminal-keys.ts +35 -0
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
- package/src/architecture/ui-literals-allowlist.json +1 -1
- package/src/capabilities/chart-series.ts +27 -1
- package/src/cli/commands/keybindings.ts +5 -5
- package/src/cli/commands/market.ts +78 -21
- package/src/cli/commands/news-search.ts +59 -7
- package/src/cli/commands/overview.ts +16 -1
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +1 -1
- package/src/cli/fx-forward.ts +25 -7
- package/src/cli/glossary.ts +19 -5
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/known-gaps.ts +27 -1
- package/src/cli/listing-arg.ts +11 -1
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/function-help.ts +2 -2
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/onboarding/first-run-workspace.ts +44 -2
- package/src/components/onboarding/onboarding-frame.tsx +11 -2
- package/src/components/onboarding/onboarding-keyboard.ts +16 -0
- package/src/components/onboarding/onboarding-wizard.tsx +8 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
- package/src/components/onboarding/use-onboarding-progress.ts +12 -4
- package/src/components/pane-settings-dialog/desktop.tsx +2 -2
- package/src/components/pane-settings-dialog/tui.tsx +2 -2
- package/src/components/pane-settings-dialog/value.ts +6 -0
- package/src/components/pane-settings-dialog.tsx +3 -3
- package/src/components/reader/detail-reader.tsx +4 -0
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/page-stack-view.tsx +3 -0
- package/src/components/ui/pane-link-chip.tsx +269 -54
- package/src/components/ui/query-bar.tsx +2 -1
- package/src/components/ui/tabs.tsx +97 -19
- package/src/core/state/app/layout-reducer.ts +7 -0
- package/src/core/state/app/layout.ts +44 -7
- package/src/core/state/app/state.ts +1 -1
- package/src/core/state/app/types.ts +22 -2
- package/src/docs/snapshot.json +27 -10
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/market/dated-previous-close.ts +94 -15
- package/src/market-data/market/status.ts +17 -1
- package/src/plugins/builtin/analytics/risk-client.ts +10 -4
- package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
- package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
- package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
- package/src/plugins/builtin/awards/index.tsx +1 -1
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/index.tsx +2 -2
- package/src/plugins/builtin/cds/headless.ts +4 -0
- package/src/plugins/builtin/chart-composer/headless.ts +2 -1
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chat/content/composer.tsx +5 -4
- package/src/plugins/builtin/chat/content/index.tsx +12 -2
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
- package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
- package/src/plugins/builtin/chat/layout.ts +5 -2
- package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
- package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +3 -1
- package/src/plugins/builtin/company-kpis/index.tsx +2 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -1
- package/src/plugins/builtin/crypto-board/index.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
- package/src/plugins/builtin/doe/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/econ/calendar-model.ts +74 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/fixed-income/index.tsx +1 -0
- package/src/plugins/builtin/futures-curve/headless.ts +3 -3
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +18 -0
- package/src/plugins/builtin/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +11 -1
- package/src/plugins/builtin/help/keybindings-editor.tsx +1 -1
- package/src/plugins/builtin/holders/index.tsx +1 -0
- package/src/plugins/builtin/holders/report-header.ts +2 -2
- package/src/plugins/builtin/insider/index.tsx +1 -0
- package/src/plugins/builtin/iv-history/index.tsx +1 -1
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +27 -8
- package/src/plugins/builtin/macro-day/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/model.ts +19 -3
- package/src/plugins/builtin/macro-day/pane.tsx +14 -9
- package/src/plugins/builtin/macro-day/releases.ts +25 -7
- package/src/plugins/builtin/market-valuation/index.tsx +1 -0
- package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
- package/src/plugins/builtin/members/index.tsx +1 -1
- package/src/plugins/builtin/mna/index.tsx +1 -0
- package/src/plugins/builtin/news/index.tsx +1 -0
- package/src/plugins/builtin/news/wire/index.tsx +5 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
- package/src/plugins/builtin/options/index.tsx +1 -0
- package/src/plugins/builtin/options-positioning/index.tsx +1 -0
- package/src/plugins/builtin/pe-band/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/headless.ts +10 -4
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/pane.tsx +8 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/headless.ts +52 -13
- package/src/plugins/builtin/seasonality/index.tsx +1 -1
- package/src/plugins/builtin/sec/index.tsx +1 -0
- package/src/plugins/builtin/series-inventory.ts +1 -1
- package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
- package/src/plugins/builtin/short-interest/index.tsx +1 -0
- package/src/plugins/builtin/social-mentions/index.tsx +1 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -0
- package/src/plugins/builtin/thirteenf/data.ts +43 -10
- package/src/plugins/builtin/thirteenf/headless.ts +55 -11
- package/src/plugins/builtin/thirteenf/model.ts +25 -9
- package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
- package/src/plugins/builtin/thirteenf/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
- package/src/plugins/builtin/ticker-detail/financials/model.ts +12 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
- package/src/plugins/builtin/time-sales/client.ts +9 -11
- package/src/plugins/builtin/time-sales/index.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +18 -3
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
- package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
- package/src/plugins/builtin/vol-surface/index.tsx +1 -1
- package/src/plugins/builtin/world-venue-map/index.ts +1 -0
- package/src/plugins/builtin/yield-curve/curves.ts +10 -4
- package/src/plugins/builtin/yield-curve/headless.ts +6 -2
- package/src/plugins/builtin/yield-curve/index.tsx +3 -3
- package/src/plugins/builtin/yield-curve/series.ts +10 -0
- package/src/plugins/builtin/yield-curve/world.ts +3 -1
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +44 -18
- package/src/remote/schema.ts +21 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-tree.tsx +14 -2
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/series/standalone.ts +2 -2
- package/src/shares/api.ts +21 -4
- package/src/shares/item.ts +73 -0
- package/src/shares/pane-item.ts +205 -0
- package/src/shares/pane.ts +4 -0
- package/src/shares/payload.ts +9 -5
- package/src/sources/gloomberb-cloud/news.ts +2 -0
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/resolve.ts +2 -2
- package/src/types/financials.ts +1 -0
- package/src/types/plugin-pane-settings.ts +2 -0
- package/src/types/plugin-panes.ts +22 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { terminalItemCardRows, type PaneLinkChipContent } from "../../../../components/ui/pane-link-chip";
|
|
2
|
+
import type { ChatMessagePaneLink } from "./model";
|
|
3
|
+
import { chatPaneLinkPane, peekSharePreview, type SharePreview } from "./previews";
|
|
4
|
+
|
|
5
|
+
function sameName(a: string, b: string): boolean {
|
|
6
|
+
return a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* What a share's card says: the item its pane was on, a line or two of it, and
|
|
11
|
+
* the pane it opens. Without an item, or with one named as its pane, the pane
|
|
12
|
+
* is said once: its row (with the share's own title when that says more, as
|
|
13
|
+
* `DES SAMPL Options · Research`) under its own description. Before the share
|
|
14
|
+
* is read the card is its link in the room most cards take; once it is gone,
|
|
15
|
+
* its link alone.
|
|
16
|
+
*/
|
|
17
|
+
export function shareCardContent(url: string, preview: SharePreview): PaneLinkChipContent {
|
|
18
|
+
if (preview.status === "loading") return { title: url, detail: "", icon: "", pending: true };
|
|
19
|
+
if (preview.status !== "ready") return { title: url, detail: "", icon: "" };
|
|
20
|
+
const pane = chatPaneLinkPane(preview.paneId);
|
|
21
|
+
const paneName = pane?.name ?? preview.item?.pane ?? "";
|
|
22
|
+
const icon = pane?.icon ?? "";
|
|
23
|
+
const item = preview.item;
|
|
24
|
+
if (item && !sameName(item.title, paneName)) {
|
|
25
|
+
return { title: item.title, excerpt: item.excerpt ?? "", detail: paneName || preview.title, icon };
|
|
26
|
+
}
|
|
27
|
+
const row = !paneName ? preview.title
|
|
28
|
+
: sameName(preview.title, paneName) ? paneName
|
|
29
|
+
: `${preview.title} · ${paneName}`;
|
|
30
|
+
return { title: "", excerpt: preview.description ?? item?.excerpt ?? "", detail: row, icon };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The rows a message's chip takes in the terminal at `width`: a share's card as it reads now, or one row. */
|
|
34
|
+
export function terminalChatPaneChipRows(link: ChatMessagePaneLink, width: number): number {
|
|
35
|
+
return link.kind === "share" ? terminalItemCardRows(shareCardContent(link.url, peekSharePreview(link.id)), width) : 1;
|
|
36
|
+
}
|
|
@@ -86,6 +86,7 @@ const TOOL_TITLES: Record<string, string> = {
|
|
|
86
86
|
const RESOURCE_SUBJECTS: Record<string, string> = {
|
|
87
87
|
"app://accounts": "broker accounts",
|
|
88
88
|
"app://snapshot": "your layout",
|
|
89
|
+
"app://snapshot/full": "your layout",
|
|
89
90
|
"app://panes": "open panes",
|
|
90
91
|
"app://config": "settings",
|
|
91
92
|
"app://layout/current": "your layout",
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* through here, with every such value replaced, so an assistant steered by
|
|
7
7
|
* what it reads cannot copy a credential out of the terminal.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
import { SECRET_NAME } from "../../../../remote/secrets";
|
|
11
|
+
|
|
10
12
|
/** Fields of a form field or input that hold what was typed. */
|
|
11
13
|
const TYPED_VALUE_KEYS = ["value", "summary", "defaultValue", "initialValue"];
|
|
12
14
|
export const REDACTED = "[redacted]";
|
|
@@ -24,7 +26,7 @@ function redactSecrets(value: unknown, depth = 0, withheld?: (secret: unknown) =
|
|
|
24
26
|
const result: Record<string, unknown> = {};
|
|
25
27
|
for (const [key, entry] of Object.entries(record)) {
|
|
26
28
|
const filled = entry !== null && entry !== undefined && entry !== "" && typeof entry !== "boolean";
|
|
27
|
-
if (filled && (
|
|
29
|
+
if (filled && (SECRET_NAME.test(key) || (password && TYPED_VALUE_KEYS.includes(key)))) {
|
|
28
30
|
withheld?.(entry);
|
|
29
31
|
result[key] = REDACTED;
|
|
30
32
|
} else {
|
|
@@ -62,7 +64,7 @@ export function redactConfig(config: unknown): unknown {
|
|
|
62
64
|
/** Resources that carry the whole configuration, before the general pass. */
|
|
63
65
|
export function redactResource(resource: string, value: unknown): unknown {
|
|
64
66
|
if (resource === "app://config") return redactConfig(value);
|
|
65
|
-
if (resource === "app://snapshot" && value && typeof value === "object") {
|
|
67
|
+
if ((resource === "app://snapshot" || resource === "app://snapshot/full") && value && typeof value === "object") {
|
|
66
68
|
const snapshot = value as Record<string, unknown>;
|
|
67
69
|
return { ...snapshot, config: redactConfig(snapshot.config) };
|
|
68
70
|
}
|
|
@@ -9,6 +9,7 @@ export const commodityBalancesModule: PluginModule = {
|
|
|
9
9
|
id: "commodity-balances",
|
|
10
10
|
name: "Crop Balances",
|
|
11
11
|
icon: "B",
|
|
12
|
+
shareItem: { argument: true },
|
|
12
13
|
get component(): typeof import("./pane").CommodityBalancesPane { const { CommodityBalancesPane } = require("./pane"); return CommodityBalancesPane; },
|
|
13
14
|
defaultPosition: "right",
|
|
14
15
|
defaultMode: "floating",
|
|
@@ -30,6 +30,6 @@ export const companyAttentionModule: PluginModule = {
|
|
|
30
30
|
ctx.registerTickerResearchTab({ id: "app-attention", name: "Apps", order: 39, component: AppsPane, instruments: ["equity"] });
|
|
31
31
|
},
|
|
32
32
|
dispose() { attentionCache.reset(); movesCache.reset(); signalsCache.reset(); buildingCache.reset(); appRankCache.reset(); },
|
|
33
|
-
panes: definitions.map((def) => ({ id: def.id, name: def.label, icon: def.prefix[0]!, component: def.component, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 130, height: 32 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: attentionHeadless(def.id) })),
|
|
33
|
+
panes: definitions.map((def) => ({ id: def.id, name: def.label, icon: def.prefix[0]!, component: def.component, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 130, height: 32 }, shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: attentionHeadless(def.id) })),
|
|
34
34
|
paneTemplates: templates,
|
|
35
35
|
};
|
|
@@ -29,7 +29,9 @@ function reportColumns(mode: CompanyMode, history: boolean, revisions: boolean,
|
|
|
29
29
|
...(revisions ? [{ id: "revision", label: "Revision", width: 12, align: "left" as const }] : [])];
|
|
30
30
|
return [...withoutQuietColumns(columns, rows, (row, id) => companyCellText(row, id, observations), QUIET_COLUMNS).map((column): HeadlessPaneColumn => ({
|
|
31
31
|
key: column.id === "value" && mode === "guidance" ? "rangeText" : ROW_KEYS[column.id] ?? column.id, header: column.label, align: column.align === "right" ? "right" : "left",
|
|
32
|
-
format: (_value, row) =>
|
|
32
|
+
format: (_value, row) => mode === "guidance" && column.id === "value" && typeof row.rangeText === "string" && /plus or minus|±/i.test(row.rangeText)
|
|
33
|
+
? `${row.rangeText}${row.currency ? ` ${row.currency}` : ""}`
|
|
34
|
+
: companyCellText(row as unknown as CompanyRow, column.id, observations),
|
|
33
35
|
})), { key: "asOf", header: "As of", format: (value) => typeof value === "string" ? value.slice(0, 10) : "--" }];
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -11,9 +11,9 @@ export const companyKpisModule: PluginModule = {
|
|
|
11
11
|
dispose() { companyKpisCache.reset(); },
|
|
12
12
|
panes: [
|
|
13
13
|
{ id: "company-kpis", name: "Company KPIs", icon: "K", component: CompanyKpisPane, defaultPosition: "right", defaultMode: "floating",
|
|
14
|
-
defaultFloatingSize: { width: 130, height: 30 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: kpisHeadless },
|
|
14
|
+
defaultFloatingSize: { width: 130, height: 30 }, shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: kpisHeadless },
|
|
15
15
|
{ id: "company-guidance", name: "Company Guidance", icon: "G", component: CompanyGuidancePane, defaultPosition: "right", defaultMode: "floating",
|
|
16
|
-
defaultFloatingSize: { width: 130, height: 30 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: guidanceHeadless },
|
|
16
|
+
defaultFloatingSize: { width: 130, height: 30 }, shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: guidanceHeadless },
|
|
17
17
|
],
|
|
18
18
|
paneTemplates: [
|
|
19
19
|
{ ...createTickerSurfacePaneTemplate({ id: "company-kpis-pane", paneId: "company-kpis", label: "Company KPIs", shortcut: "KPIS",
|
|
@@ -6,7 +6,7 @@ import { COT_SERIES } from "./series";
|
|
|
6
6
|
|
|
7
7
|
export const cotModule: PluginModule = {
|
|
8
8
|
series: COT_SERIES,
|
|
9
|
-
panes: [{ id: "cot", name: "CFTC Positioning", icon: "P", get component(): typeof import("./pane").CotPane { const { CotPane } = require("./pane"); return CotPane; },
|
|
9
|
+
panes: [{ id: "cot", name: "CFTC Positioning", icon: "P", shareItem: { argument: true }, get component(): typeof import("./pane").CotPane { const { CotPane } = require("./pane"); return CotPane; },
|
|
10
10
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 106, height: 30 },
|
|
11
11
|
tableExport: true, headless: cotHeadless }],
|
|
12
12
|
paneTemplates: [{ id: "cot-cot", paneId: "cot", label: "CFTC Positioning",
|
|
@@ -13,7 +13,7 @@ function cpiInstance(options?: PaneTemplateCreateOptions): PaneTemplateInstanceC
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const cpiModule: PluginModule = {
|
|
16
|
-
panes: [{ id: "cpi", name: "US Consumer Prices", icon: "C", get component(): typeof import("./pane").CpiPane { const { CpiPane } = require("./pane"); return CpiPane; },
|
|
16
|
+
panes: [{ id: "cpi", name: "US Consumer Prices", icon: "C", shareItem: { argument: true }, get component(): typeof import("./pane").CpiPane { const { CpiPane } = require("./pane"); return CpiPane; },
|
|
17
17
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 100, height: 36 },
|
|
18
18
|
tableExport: true, headless: cpiHeadless }],
|
|
19
19
|
paneTemplates: [{
|
|
@@ -14,6 +14,7 @@ export const cryptoBoardModule: PluginModule = {
|
|
|
14
14
|
id: "crypto-board",
|
|
15
15
|
name: "Crypto",
|
|
16
16
|
icon: "C",
|
|
17
|
+
shareItem: { argument: true },
|
|
17
18
|
get component(): typeof import("./pane").CryptoBoardPane { const { CryptoBoardPane } = require("./pane"); return CryptoBoardPane; },
|
|
18
19
|
defaultPosition: "right",
|
|
19
20
|
defaultMode: "floating",
|
|
@@ -24,7 +24,7 @@ const shortcut = (prefix: string, tab: DoeTab | null) => ({
|
|
|
24
24
|
|
|
25
25
|
export const doeModule: PluginModule = {
|
|
26
26
|
series: DOE_CATALOG_SERIES,
|
|
27
|
-
panes: [{ id: "doe", name: "Oil and Gas Inventories", icon: "D", get component(): typeof import("./pane").DoePane { const { DoePane } = require("./pane"); return DoePane; },
|
|
27
|
+
panes: [{ id: "doe", name: "Oil and Gas Inventories", icon: "D", shareItem: { argument: true }, get component(): typeof import("./pane").DoePane { const { DoePane } = require("./pane"); return DoePane; },
|
|
28
28
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 96, height: 34 },
|
|
29
29
|
tableExport: true, headless: doeHeadless("all") }],
|
|
30
30
|
paneTemplates: [{
|
|
@@ -447,8 +447,12 @@ export function createEarningsCallsHeadless(
|
|
|
447
447
|
return projectEarningsCallsHeadless(calls, { ...args, options: { ...args.options, limit: args.options.limit ?? 50 } }, now);
|
|
448
448
|
}
|
|
449
449
|
const quarter = String(args.options.quarter || "latest");
|
|
450
|
-
|
|
450
|
+
// A call still to come has no transcript to read, and asking for one would ask the server to produce it before
|
|
451
|
+
// the call is held: the latest is the latest held, and a quarter whose call is ahead says when it is.
|
|
452
|
+
const selected = findCallForQuarter(calls.calls.filter((call) => !isUpcomingCall(call, now)), quarter);
|
|
451
453
|
if (!selected) {
|
|
454
|
+
const ahead = findCallForQuarter(calls.calls, quarter);
|
|
455
|
+
if (ahead) throw new Error(`${ticker}'s ${quarter} call is still to come. ${nextCallNotice(ahead, now)}`);
|
|
452
456
|
if (calls.unknownTicker) throw new Error(`${ticker} is not a known listed company.`);
|
|
453
457
|
if (calls.pending) throw new Error(`Earnings call discovery for ${ticker} is still pending.`);
|
|
454
458
|
if (calls.sourceLimitReached ?? calls.calls.length >= (calls.sourceLimit ?? 200)) {
|
|
@@ -314,9 +314,82 @@ export function eventSeriesId(event: Pick<EconEvent, "country" | "event">): stri
|
|
|
314
314
|
*/
|
|
315
315
|
export function eventSearchNames(event: Pick<EconEvent, "country" | "event" | "actual" | "forecast" | "prior">): string[] {
|
|
316
316
|
const series = resolveFredMapping(event.event, event.country)?.seriesId;
|
|
317
|
-
|
|
317
|
+
const policy = POLICY_DECISION.test(event.event) ? policyRateNames(event.country) : [];
|
|
318
|
+
return [...[event.event, econEventName(event)].map(compactName), ...series ? statNamesOf(series) : [], ...policy];
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
/** A central bank's decision or fixing, under the titles the calendar gives them. */
|
|
322
|
+
const POLICY_DECISION = /interest rate decision|rate decision|loan prime rate|policy rate|cash rate|bank rate|funds rate|deposit facility rate|selic|repo rate|key rate/i;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The names people give a bank's policy rate and its committee, so `--search
|
|
326
|
+
* selic` finds the Copom's decision and `--search banxico` Banxico's: by the
|
|
327
|
+
* calendar's country, with the names every bank's decision answers to.
|
|
328
|
+
*/
|
|
329
|
+
const POLICY_RATE_NAMES: Readonly<Record<string, readonly string[]>> = {
|
|
330
|
+
US: ["fed funds", "federal funds", "FOMC", "Federal Reserve"],
|
|
331
|
+
EU: ["ECB", "deposit rate", "deposit facility", "refi rate"],
|
|
332
|
+
GB: ["Bank Rate", "BoE", "MPC"],
|
|
333
|
+
JP: ["BoJ", "Bank of Japan"],
|
|
334
|
+
CA: ["BoC", "overnight rate"],
|
|
335
|
+
AU: ["RBA", "cash rate"],
|
|
336
|
+
NZ: ["RBNZ", "OCR", "official cash rate"],
|
|
337
|
+
CH: ["SNB"],
|
|
338
|
+
CN: ["LPR", "loan prime rate", "PBoC"],
|
|
339
|
+
IN: ["RBI", "repo rate"],
|
|
340
|
+
ID: ["BI rate", "Bank Indonesia"],
|
|
341
|
+
KR: ["BoK", "base rate"],
|
|
342
|
+
BR: ["Selic", "Copom", "Banco Central do Brasil", "BCB"],
|
|
343
|
+
MX: ["Banxico", "Banco de Mexico", "tasa objetivo", "target rate"],
|
|
344
|
+
RU: ["key rate", "Bank of Russia", "CBR"],
|
|
345
|
+
TR: ["CBRT", "TCMB", "one-week repo"],
|
|
346
|
+
ZA: ["SARB", "repo rate"],
|
|
347
|
+
NO: ["Norges Bank", "sight deposit rate"],
|
|
348
|
+
SE: ["Riksbank"],
|
|
349
|
+
};
|
|
350
|
+
const ANY_POLICY_RATE = ["policy rate", "rate decision", "interest rate", "central bank", "monetary policy"];
|
|
351
|
+
|
|
352
|
+
function policyRateNames(country: string): string[] {
|
|
353
|
+
return [...POLICY_RATE_NAMES[country.toUpperCase()] ?? [], ...ANY_POLICY_RATE].map(compactName);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const nameWords = (text: string) => text.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
|
|
357
|
+
/** Words of many banks' names that name none alone: "bank" is the BoE's, the BoJ's and three more. */
|
|
358
|
+
const SHARED_NAME_WORDS = new Set(["bank", "of", "de", "do", "rate", "central"]);
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The decisions a search for a bank's own names means, for an empty answer to
|
|
362
|
+
* say: `selic` is Brazil's Copom decision. Every word of the query must be a
|
|
363
|
+
* whole word of one of the bank's names, or the name run together (`fedfunds`):
|
|
364
|
+
* `cbr` is the Bank of Russia's and not the CBRT's, and words many names share
|
|
365
|
+
* name none alone (`bank`, SHARED_NAME_WORDS). Only the
|
|
366
|
+
* banks of the countries the calendar lists (`countries`, as --country reads).
|
|
367
|
+
* Empty for a query no bank's names hold, and for the names every bank's
|
|
368
|
+
* decision answers to (a query of those already lists them).
|
|
369
|
+
*/
|
|
370
|
+
export function policyDecisionsNamed(query: string, countries: CountryFilter = "all"): Array<{ country: string; event: string }> {
|
|
371
|
+
const words = nameWords(query);
|
|
372
|
+
if (words.every((word) => SHARED_NAME_WORDS.has(word))) return [];
|
|
373
|
+
return Object.entries(POLICY_RATE_NAMES).flatMap(([country, names]) => {
|
|
374
|
+
const event = POLICY_DECISION_TITLES[country] ?? "Interest Rate Decision";
|
|
375
|
+
if (!matchesCountry({ country, event }, countries)) return [];
|
|
376
|
+
const named = names.some((name) => {
|
|
377
|
+
const parts = nameWords(name);
|
|
378
|
+
return words.every((word) => parts.includes(word) || word === compactName(name));
|
|
379
|
+
});
|
|
380
|
+
return named ? [{ country, event }] : [];
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** How the calendar titles each bank's decision (China's is its LPR fixing). */
|
|
385
|
+
const POLICY_DECISION_TITLES: Readonly<Record<string, string>> = {
|
|
386
|
+
US: "Fed Interest Rate Decision", EU: "ECB Interest Rate Decision", GB: "BoE Interest Rate Decision", JP: "BoJ Interest Rate Decision",
|
|
387
|
+
CA: "BoC Interest Rate Decision", AU: "RBA Interest Rate Decision", NZ: "RBNZ Interest Rate Decision", CH: "SNB Interest Rate Decision",
|
|
388
|
+
CN: "1-y Loan Prime Rate", IN: "RBI Interest Rate Decision", ID: "BI Interest Rate Decision", KR: "BoK Interest Rate Decision",
|
|
389
|
+
BR: "Copom Interest Rate Decision", MX: "Banxico Interest Rate Decision", RU: "Bank of Russia Interest Rate Decision",
|
|
390
|
+
TR: "CBRT Interest Rate Decision", ZA: "SARB Interest Rate Decision", NO: "Norges Bank Interest Rate Decision", SE: "Riksbank Interest Rate Decision",
|
|
391
|
+
};
|
|
392
|
+
|
|
320
393
|
/**
|
|
321
394
|
* Whether a row carries every word of `query` in one of its names or its
|
|
322
395
|
* publisher's, case, spaces and hyphens aside: `nonfarm` finds Non Farm
|
|
@@ -184,11 +184,13 @@ const GROUPS: ReadonlyArray<{ group: string; rows: readonly FredRow[] }> = [
|
|
|
184
184
|
],
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
|
-
// The IMF's monthly world prices: the closest public series to LME copper and aluminium, which FUT does not list
|
|
187
|
+
// The IMF's monthly world prices: the closest public series to LME copper and aluminium, which FUT does not list,
|
|
188
|
+
// and to iron ore, whose futures are licensed.
|
|
188
189
|
group: "Commodities",
|
|
189
190
|
rows: [
|
|
190
191
|
["PCOPPUSDM", "Global price of copper", "USD/ton", "monthly", ["copper", "metals", "LME"]],
|
|
191
192
|
["PALUMUSDM", "Global price of aluminum", "USD/ton", "monthly", ["aluminum", "aluminium", "metals", "LME"]],
|
|
193
|
+
["PIORECRUSDM", "Global price of iron ore (dry metric ton)", "USD/ton", "monthly", ["iron ore", "iron", "steel", "metals"]],
|
|
192
194
|
],
|
|
193
195
|
},
|
|
194
196
|
{
|
|
@@ -544,6 +544,7 @@ export const economicCalendarModule: PluginModule = {
|
|
|
544
544
|
id: "econ-calendar",
|
|
545
545
|
reportFreshness: { status: "not-a-feed", basis: "calendar" },
|
|
546
546
|
name: "Economic Calendar",
|
|
547
|
+
shareItem: { argument: true },
|
|
547
548
|
icon: "E",
|
|
548
549
|
component: EconCalendarPane,
|
|
549
550
|
defaultPosition: "right",
|
|
@@ -12,6 +12,7 @@ export const econStatisticsModule: PluginModule = {
|
|
|
12
12
|
id: ECON_STATISTICS_PANE_ID,
|
|
13
13
|
name: "Economic Statistics",
|
|
14
14
|
icon: "E",
|
|
15
|
+
shareItem: { open: true, argument: true },
|
|
15
16
|
get component(): typeof import("./pane").EconStatisticsPane { const { EconStatisticsPane } = require("./pane"); return EconStatisticsPane; },
|
|
16
17
|
defaultPosition: "right",
|
|
17
18
|
defaultMode: "floating",
|
|
@@ -88,6 +88,11 @@ function buildColumns(width: number, stacked: boolean): Column[] {
|
|
|
88
88
|
];
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/** A link to the pane names the statistic its chart shows, with its latest print. */
|
|
92
|
+
function statShareItem(view: StatViewModel) {
|
|
93
|
+
return { title: view.stat.label, excerpt: [view.stat.formatValue(view.latest.value), view.period].filter(Boolean).join(" · ") };
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
/**
|
|
92
97
|
* The previous print rather than the difference. For a statistic that is already a
|
|
93
98
|
* change, like payrolls, a delta would be a second derivative and mean very little.
|
|
@@ -142,6 +147,7 @@ export function EconStatisticsPane({ focused, width, height }: PaneProps) {
|
|
|
142
147
|
onSelect: setStatId,
|
|
143
148
|
reload,
|
|
144
149
|
range: { value: range, options: RANGE_OPTIONS, onChange: setRange, chartRange: true },
|
|
150
|
+
shareItem: statShareItem,
|
|
145
151
|
});
|
|
146
152
|
const { selected, searchFocused } = list;
|
|
147
153
|
const rows = useMemo(() => withCategoryHeaders(list.visible), [list.visible]);
|
|
@@ -13,6 +13,7 @@ export const estimateRevisionsModule: PluginModule = {
|
|
|
13
13
|
icon: "E",
|
|
14
14
|
get component(): typeof import("./pane").EstimateRevisionsPane { const { EstimateRevisionsPane } = require("./pane"); return EstimateRevisionsPane; },
|
|
15
15
|
defaultPosition: "right",
|
|
16
|
+
shareItem: { ticker: true },
|
|
16
17
|
tickerFollower: true,
|
|
17
18
|
instruments: ["equity"],
|
|
18
19
|
defaultMode: "floating",
|
|
@@ -5,7 +5,7 @@ import { formatPercentRaw } from "../../../utils/format";
|
|
|
5
5
|
import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
|
|
6
6
|
import { newestReportTime, oldestReportTime } from "../../../utils/utc-time";
|
|
7
7
|
import { fetchFuturesCurve, loadCurveSpot, loadCurveSpotBars, loadCurveSpotCloses, loadFuturesCurveAsOf } from "./client";
|
|
8
|
-
import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSettleShown, curveUnitLabel, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
|
|
8
|
+
import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSettleShown, curveUnitLabel, curveRootNamed, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
|
|
9
9
|
import { COMMODITIES_VIEW_STATE } from "../commodities-energy/view-state";
|
|
10
10
|
import { knownGapMessage } from "../../../cli/known-gaps";
|
|
11
11
|
|
|
@@ -171,7 +171,7 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
171
171
|
"Ann Basis is simple actual/365, each last trade against spot in the same minute, and noisy under 7 days to expiry."],
|
|
172
172
|
intents: ["futures basis trade", "cash and carry", "basis against spot"],
|
|
173
173
|
opens: [{ words: ["VX", "vix futures", "vix futures curve"], argument: "VIX" }] },
|
|
174
|
-
shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "root", description: "FUT root such as CL, ES, ZN or VX,
|
|
174
|
+
shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "root", description: "FUT root such as CL, ES, ZN or VX, a CME crypto root (BTC, ETH, SOL, XRP), or a root's name (gold, natural gas, crude oil). Defaults to ES.",
|
|
175
175
|
examples: ["VIX", "CL", "BTC"] },
|
|
176
176
|
// Only the pane reads the tab; the report always carries both.
|
|
177
177
|
options: [{ key: "tab", description: "Curve or the full contract table.", type: "enum",
|
|
@@ -181,7 +181,7 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
181
181
|
describe: (args) => `Futures curve ${args.argument || DEFAULT_ROOT}`,
|
|
182
182
|
async load(args, ctx) {
|
|
183
183
|
const input = args.argument || DEFAULT_ROOT;
|
|
184
|
-
const root = normalizeCurveRoot(input);
|
|
184
|
+
const root = normalizeCurveRoot(input) ?? curveRootNamed(input);
|
|
185
185
|
if (!root) {
|
|
186
186
|
// A subject no source carries (`fn CTM BDI`, the Baltic Dry Index) is said with its proxies, as search says it.
|
|
187
187
|
const gap = typeof input === "string" ? knownGapMessage(input) : null;
|
|
@@ -4,7 +4,7 @@ import { futuresCurveHeadless } from "./headless";
|
|
|
4
4
|
import { BASIS_FORMULA, CURVE_HORIZONS, CURVE_ROOTS, curveRootForTicker, curveTitle, DEFAULT_CURVE_HORIZON, normalizeCurveRoot } from "./model";
|
|
5
5
|
|
|
6
6
|
export const futuresCurveModule: PluginModule = {
|
|
7
|
-
panes: [{ id: "futures-curve", name: "Futures Curve", icon: "F", get component(): typeof import("./pane").FuturesCurvePane { const { FuturesCurvePane } = require("./pane"); return FuturesCurvePane; },
|
|
7
|
+
panes: [{ id: "futures-curve", name: "Futures Curve", icon: "F", shareItem: { argument: true }, get component(): typeof import("./pane").FuturesCurvePane { const { FuturesCurvePane } = require("./pane"); return FuturesCurvePane; },
|
|
8
8
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 98, height: 30 },
|
|
9
9
|
tableExport: true, headless: futuresCurveHeadless,
|
|
10
10
|
settings: (context) => ({ title: "Futures Curve Settings",
|
|
@@ -32,6 +32,24 @@ export function normalizeCurveRoot(value: unknown): string | null {
|
|
|
32
32
|
return CURVE_ROOTS.some((row) => row.value === root) ? root : null;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/** What a commodity is called rather than coded: the WTI and Brent crude curves by the words they are asked for in. */
|
|
36
|
+
const CURVE_ROOT_WORDS: Readonly<Record<string, string>> = { "CRUDE": "CL", "CRUDE OIL": "CL", "OIL": "CL", "WTI": "CL", "BRENT": "BZ" };
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A root named in words, as a typed argument or a question asks for it
|
|
40
|
+
* ("gold", "Natural Gas futures", "crude oil"): a listed root's name, or a
|
|
41
|
+
* crude benchmark's. Not for the ticker under the cursor, where GOLD is a
|
|
42
|
+
* security, so only CTM's typed argument reads it.
|
|
43
|
+
*/
|
|
44
|
+
export function curveRootNamed(value: unknown): string | null {
|
|
45
|
+
if (typeof value !== "string") return null;
|
|
46
|
+
const words = value.trim().toUpperCase().replace(/\s+/g, " ").replace(/( (FUTURES?|CURVE))+$/, "");
|
|
47
|
+
if (!words) return null;
|
|
48
|
+
return CURVE_ROOT_WORDS[words]
|
|
49
|
+
?? CURVE_ROOTS.find((row) => row.label.toUpperCase() === `${row.value} ${words}`)?.value
|
|
50
|
+
?? null;
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
/**
|
|
36
54
|
* A curve's window title, its root ("Curve · BZ"), so two curves open at once
|
|
37
55
|
* are told apart in their windows and in the layout list.
|
|
@@ -5,7 +5,7 @@ import { GPU_MODELS, gpuArgument } from "./model";
|
|
|
5
5
|
import { GPU_SERIES } from "./series";
|
|
6
6
|
|
|
7
7
|
export const gpuModule: PluginModule = {
|
|
8
|
-
panes: [{ id: "gpu", name: "GPU Rental Prices", icon: "G", get component(): typeof import("./pane").GpuPane { const { GpuPane } = require("./pane"); return GpuPane; }, defaultPosition: "right", defaultMode: "floating",
|
|
8
|
+
panes: [{ id: "gpu", name: "GPU Rental Prices", icon: "G", shareItem: { argument: true }, get component(): typeof import("./pane").GpuPane { const { GpuPane } = require("./pane"); return GpuPane; }, defaultPosition: "right", defaultMode: "floating",
|
|
9
9
|
defaultFloatingSize: { width: 120, height: 34 }, tableExport: true, headless: gpuHeadless }],
|
|
10
10
|
paneTemplates: [{ id: "gpu-pane", paneId: "gpu", label: "GPU Rental Prices",
|
|
11
11
|
description: "Pro GPU rental list prices, provider-declared spot and marketplace asks, with sourced price history and related equities. Free preview available.",
|
|
@@ -154,7 +154,7 @@ export function FunctionsTable({
|
|
|
154
154
|
search={{
|
|
155
155
|
value: query,
|
|
156
156
|
onChange: setQuery,
|
|
157
|
-
placeholder: "function or description",
|
|
157
|
+
placeholder: ["function or description", "search functions"],
|
|
158
158
|
focused,
|
|
159
159
|
active: searching,
|
|
160
160
|
onActiveChange: onSearchingChange,
|
|
@@ -23,6 +23,8 @@ import { logFailure } from "../../../utils/log-failure";
|
|
|
23
23
|
import { VERSION } from "../../../version";
|
|
24
24
|
import { getCurrentPluginTarget } from "../../current-target";
|
|
25
25
|
import { openUrl } from "../../../components/ui/external-link";
|
|
26
|
+
import { useShortcut } from "../../../react/input";
|
|
27
|
+
import { isPlainKey } from "../../../utils/keyboard";
|
|
26
28
|
|
|
27
29
|
const HELP_TABS = [
|
|
28
30
|
{ label: "Basics", value: "basics" },
|
|
@@ -68,7 +70,15 @@ const KEY_COLUMN_MAX_SHARE = 0.4;
|
|
|
68
70
|
|
|
69
71
|
function HelpPane({ focused, width, height }: PaneProps) {
|
|
70
72
|
const registry = getSharedRegistry();
|
|
71
|
-
const { openCommandBar, showPane, createPaneFromTemplate } = usePluginAppActions();
|
|
73
|
+
const { openCommandBar, showPane, hidePane, createPaneFromTemplate } = usePluginAppActions();
|
|
74
|
+
// Esc closes Help, once nothing in it took the key: a search, a key
|
|
75
|
+
// capture or a form backs out first.
|
|
76
|
+
useShortcut((event) => {
|
|
77
|
+
if (!isPlainKey(event, "escape", "esc")) return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
hidePane("help");
|
|
81
|
+
}, { phase: "idle", enabled: focused });
|
|
72
82
|
// A key capture requested from the command bar belongs to the Shortcuts
|
|
73
83
|
// tab, whether the pane is already open or is being opened for it.
|
|
74
84
|
const [activeTabId, setActiveTabId] = usePluginPaneState<HelpTabId>("activeTab", "basics");
|
|
@@ -256,7 +256,7 @@ export function KeybindingsEditor({
|
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
258
|
// A built-in action's key is refused, so a binding never leaves the command bar or close pane dead.
|
|
259
|
-
const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined);
|
|
259
|
+
const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined, { command: isCommand });
|
|
260
260
|
if (core) {
|
|
261
261
|
setFeedback({ tone: "warning", text: takenChordMessage(formatChord(chord), core) });
|
|
262
262
|
return;
|
|
@@ -25,6 +25,7 @@ export const holdersModule: PluginModule = {
|
|
|
25
25
|
icon: "H",
|
|
26
26
|
get component(): typeof import("./pane").HoldersView { const { HoldersView } = require("./pane"); return HoldersView; },
|
|
27
27
|
defaultPosition: "right",
|
|
28
|
+
shareItem: { ticker: true },
|
|
28
29
|
tickerFollower: true,
|
|
29
30
|
defaultMode: "floating",
|
|
30
31
|
defaultFloatingSize: { width: 105, height: 34 },
|
|
@@ -139,10 +139,10 @@ export function holderShareBasisMarker(row: { shareBasis?: unknown }): string {
|
|
|
139
139
|
* line are positions in the receipts, or that a receipt line's rows all are.
|
|
140
140
|
*/
|
|
141
141
|
export function holderShareBasisNote(
|
|
142
|
-
data: Pick<HolderData, "shareBasis" | "adrRatio">,
|
|
142
|
+
data: Pick<HolderData, "shareBasis" | "adrRatio" | "depositaryPair">,
|
|
143
143
|
rows: ReadonlyArray<{ shareBasis?: unknown }>,
|
|
144
144
|
): string | null {
|
|
145
|
-
const ratio = adrRatioText(data.adrRatio);
|
|
145
|
+
const ratio = adrRatioText(data.adrRatio, data.depositaryPair?.ordinary[0]);
|
|
146
146
|
const each = ratio ? ` (${ratio})` : "";
|
|
147
147
|
if (rows.some((row) => holderShareBasisMarker(row))) return `ADR: shares held as depositary receipts${each}.`;
|
|
148
148
|
if (rows.length > 0 && data.shareBasis === "depositary_receipt") return `Shares are depositary receipts${each}.`;
|
|
@@ -10,7 +10,7 @@ export const ivHistoryModule: PluginModule = {
|
|
|
10
10
|
series: IV_SERIES,
|
|
11
11
|
panes: [{
|
|
12
12
|
id: "iv-history", name: "Implied Volatility History", icon: "V", get component(): typeof import("./pane").IvHistoryPane { const { IvHistoryPane } = require("./pane"); return IvHistoryPane; },
|
|
13
|
-
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 118, height: 36 },
|
|
13
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 118, height: 36 },
|
|
14
14
|
tableExport: true,
|
|
15
15
|
settings: { title: "Implied Volatility History", fields: [
|
|
16
16
|
{ key: "lookback", label: "Lookback", type: "select", options: [{ value: "1Y", label: "1 year" }, { value: "2Y", label: "2 years" }, { value: "ALL", label: "All stored" }] },
|