@trdrs/quickcharts 4.0.0 → 4.1.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +49 -20
  3. package/dist/adapters/rest.d.ts +1 -1
  4. package/dist/{ar-FXZ5QJUR.js → ar-VILLYPAA.js} +4 -1
  5. package/dist/ar-VILLYPAA.js.map +1 -0
  6. package/dist/{assets-Gg-UquDA.d.ts → assets-BF-NDyHl.d.ts} +7 -2
  7. package/dist/{ca_ES-3WVKFBIF.js → ca_ES-EJXLAXOA.js} +4 -1
  8. package/dist/ca_ES-EJXLAXOA.js.map +1 -0
  9. package/dist/{chunk-C4MEVUNK.js → chunk-TBOVLJAK.js} +908 -266
  10. package/dist/chunk-TBOVLJAK.js.map +1 -0
  11. package/dist/{de-V72Q3OI7.js → de-PHID4SVN.js} +4 -1
  12. package/dist/de-PHID4SVN.js.map +1 -0
  13. package/dist/drawings.d.ts +18 -7
  14. package/dist/drawings.js +7 -1
  15. package/dist/{es-CNQ3OJ6E.js → es-KD4FBLOP.js} +4 -1
  16. package/dist/es-KD4FBLOP.js.map +1 -0
  17. package/dist/feature-manifest.json +1 -1
  18. package/dist/{fr-5WQBCGR4.js → fr-KTTX3FF3.js} +4 -1
  19. package/dist/fr-KTTX3FF3.js.map +1 -0
  20. package/dist/{he_IL-WXKA77UE.js → he_IL-Z3DXMAKZ.js} +4 -1
  21. package/dist/he_IL-Z3DXMAKZ.js.map +1 -0
  22. package/dist/{id_ID-XPBAYSWK.js → id_ID-FFX6X4C5.js} +4 -1
  23. package/dist/id_ID-FFX6X4C5.js.map +1 -0
  24. package/dist/index.d.ts +94 -77
  25. package/dist/index.js +180 -84
  26. package/dist/index.js.map +1 -1
  27. package/dist/{it-DR2EBNWX.js → it-X2GFCLGU.js} +4 -1
  28. package/dist/it-X2GFCLGU.js.map +1 -0
  29. package/dist/{ja-URB2CPXO.js → ja-TG3WO2KH.js} +4 -1
  30. package/dist/ja-TG3WO2KH.js.map +1 -0
  31. package/dist/{ko-OE47NYVP.js → ko-4HHHO7KV.js} +4 -1
  32. package/dist/ko-4HHHO7KV.js.map +1 -0
  33. package/dist/{ms_MY-BKCFRK2K.js → ms_MY-HPVQKVPY.js} +4 -1
  34. package/dist/ms_MY-HPVQKVPY.js.map +1 -0
  35. package/dist/{pl-3IKQRG3Y.js → pl-2W2HP34O.js} +4 -1
  36. package/dist/pl-2W2HP34O.js.map +1 -0
  37. package/dist/{pt-PZHV5EZE.js → pt-XQUBSXO7.js} +4 -1
  38. package/dist/pt-XQUBSXO7.js.map +1 -0
  39. package/dist/quickcharts.css +41 -10
  40. package/dist/{resources-Le6flcEn.d.ts → resources-C0cYryO9.d.ts} +1 -1
  41. package/dist/{ru-BAL6RQUV.js → ru-XKFQPFDM.js} +4 -1
  42. package/dist/ru-XKFQPFDM.js.map +1 -0
  43. package/dist/{sv-Y6GBGDHM.js → sv-ZMEGAPCR.js} +4 -1
  44. package/dist/sv-ZMEGAPCR.js.map +1 -0
  45. package/dist/{th-MAMLMZKU.js → th-4735BUT4.js} +4 -1
  46. package/dist/th-4735BUT4.js.map +1 -0
  47. package/dist/{tr-3LQHINUZ.js → tr-PG3CW2L3.js} +4 -1
  48. package/dist/tr-PG3CW2L3.js.map +1 -0
  49. package/dist/{vi-GR4PSDKP.js → vi-YPRIAJ33.js} +4 -1
  50. package/dist/vi-YPRIAJ33.js.map +1 -0
  51. package/dist/{zh-2RJ5VNAI.js → zh-RVHEWNSW.js} +4 -1
  52. package/dist/zh-RVHEWNSW.js.map +1 -0
  53. package/dist/{zh_TW-XEBSACHU.js → zh_TW-ZFJMDA64.js} +4 -1
  54. package/dist/zh_TW-ZFJMDA64.js.map +1 -0
  55. package/package.json +1 -1
  56. package/dist/ar-FXZ5QJUR.js.map +0 -1
  57. package/dist/ca_ES-3WVKFBIF.js.map +0 -1
  58. package/dist/chunk-C4MEVUNK.js.map +0 -1
  59. package/dist/de-V72Q3OI7.js.map +0 -1
  60. package/dist/es-CNQ3OJ6E.js.map +0 -1
  61. package/dist/fr-5WQBCGR4.js.map +0 -1
  62. package/dist/he_IL-WXKA77UE.js.map +0 -1
  63. package/dist/id_ID-XPBAYSWK.js.map +0 -1
  64. package/dist/it-DR2EBNWX.js.map +0 -1
  65. package/dist/ja-URB2CPXO.js.map +0 -1
  66. package/dist/ko-OE47NYVP.js.map +0 -1
  67. package/dist/ms_MY-BKCFRK2K.js.map +0 -1
  68. package/dist/pl-3IKQRG3Y.js.map +0 -1
  69. package/dist/pt-PZHV5EZE.js.map +0 -1
  70. package/dist/ru-BAL6RQUV.js.map +0 -1
  71. package/dist/sv-Y6GBGDHM.js.map +0 -1
  72. package/dist/th-MAMLMZKU.js.map +0 -1
  73. package/dist/tr-3LQHINUZ.js.map +0 -1
  74. package/dist/vi-GR4PSDKP.js.map +0 -1
  75. package/dist/zh-2RJ5VNAI.js.map +0 -1
  76. package/dist/zh_TW-XEBSACHU.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { C as ChartDatafeed, F as FeedBar, S as SymbolRow, D as DatafeedSearchOptions, a as SearchPage, b as SearchClassNode } from './symbols-6V22WaRX.js';
2
2
  export { B as BarMark, c as BarsEvent, d as DatafeedConfig, e as FeedUnavailableError, H as HistoryPage, M as MarkColorRole, f as MarkPlacement, g as MarkShape, O as OlderPageVerdict, h as SubscribeHandlers, i as SymbolNames, T as TimescaleMark, o as olderPageVerdict, s as symbolNames } from './symbols-6V22WaRX.js';
3
- import { an as en, C as ChartMessageKey, G as GlyphSourcePort, M as MagnetMode, d as CursorMode, N as TextEditFrame, K as TextDraft, L as LineStyle, I as IDrawing, m as DrawingCounts, D as DrawingStyle, _ as VisibilityPreset, W as ToolPreset, X as ToolTemplate, S as SerializedDrawing, o as DrawingPreferences, l as DrawingAssetPort } from './assets-Gg-UquDA.js';
4
- import { R as ResourceRef, C as ChartSaveLoadAdapter, q as ChartMeta, t as ChartBody, f as DrawingResourceContext, i as ResourceStore, u as DrawingsMeta, h as DrawingsBody, j as TemplateMeta, T as TemplateBody, v as LayoutMeta, w as LayoutBody, c as DrawingContextKind } from './resources-Le6flcEn.js';
5
- export { a as ChartLocalDrawingContext, D as DRAWING_CONTEXT_VERSION, b as DRAWING_DOCUMENT_VERSION, d as DrawingEntry, e as DrawingGroup, g as DrawingTombstone, L as LayoutSharedDrawingContext, M as MemoryResourcesOptions, x as ResourceAbortError, S as SymbolGlobalDrawingContext, y as TemplateKind, W as WriteOutcome, k as drawingContextKey, l as emptyDrawingDocument, m as liveDrawingEntries, n as liveDrawingGroups, z as memorySaveLoadAdapter, o as mergeDrawingDocuments, p as parseDrawingDocument, r as reviseDrawingDocument, s as sameDrawingContext } from './resources-Le6flcEn.js';
3
+ import { ao as en, C as ChartMessageKey, G as GlyphSourcePort, M as MagnetMode, d as CursorMode, Q as TextEditFrame, N as TextDraft, L as LineStyle, I as IDrawing, m as DrawingCounts, D as DrawingStyle, $ as VisibilityPreset, X as ToolPreset, Y as ToolTemplate, S as SerializedDrawing, o as DrawingPreferences, l as DrawingAssetPort } from './assets-BF-NDyHl.js';
4
+ import { b as ResourceRef, C as ChartSaveLoadAdapter, q as ChartMeta, t as ChartBody, h as DrawingResourceContext, R as ResourceStore, u as DrawingsMeta, j as DrawingsBody, T as TemplateMeta, a as TemplateBody, v as LayoutMeta, w as LayoutBody, e as DrawingContextKind } from './resources-C0cYryO9.js';
5
+ export { c as ChartLocalDrawingContext, D as DRAWING_CONTEXT_VERSION, d as DRAWING_DOCUMENT_VERSION, f as DrawingEntry, g as DrawingGroup, i as DrawingTombstone, L as LayoutSharedDrawingContext, M as MemoryResourcesOptions, x as ResourceAbortError, S as SymbolGlobalDrawingContext, y as TemplateKind, W as WriteOutcome, k as drawingContextKey, l as emptyDrawingDocument, m as liveDrawingEntries, n as liveDrawingGroups, z as memorySaveLoadAdapter, o as mergeDrawingDocuments, p as parseDrawingDocument, r as reviseDrawingDocument, s as sameDrawingContext } from './resources-C0cYryO9.js';
6
6
  import { LineData, UTCTimestamp, HistogramData, WhitespaceData, IChartApi, ISeriesApi, CreatePriceLineOptions, PriceLineOptions, ISeriesPrimitive, Time, PriceScaleMode, SeriesType, SeriesAttachedParameter, TickMarkType } from 'lightweight-charts';
7
7
  import { D as DataStatus, S as SymbolInfo, P as PriceFormat } from './symbology-D3SLclrU.js';
8
8
  export { a as Subsession, b as SubsessionId, T as TickBand, p as parseTickBands, t as tickBandFor } from './symbology-D3SLclrU.js';
@@ -871,9 +871,16 @@ interface DictionaryLoader<Source extends Catalog, Code extends string = ChartLo
871
871
  has(code: Code): boolean;
872
872
  }
873
873
 
874
+ declare const KEYS_ADDED_IN_MAJOR: readonly ["drawing.distance", "drawing.drawingMenu", "drawing.hintRemove"];
875
+ type KeyAddedInMajor = (typeof KEYS_ADDED_IN_MAJOR)[number];
876
+
874
877
  type ChartTranslate = Translate<typeof en>;
875
- /** The widget's catalog in one language: every key of the English source, in the same shape. */
876
- type ChartDictionary = Translation<typeof en>;
878
+ /** The widget's catalog in one language, as a dictionary of your own supplies it: the keys of the
879
+ * English source in the same shape, a string for a string and a plural for a plural. Every key of
880
+ * the major's first release is required. A key the catalog gains within the major is optional:
881
+ * until your dictionary carries it, the chart reads it in English and reports it to `onMissing`,
882
+ * and the next major makes it required. Each built-in language carries every key. */
883
+ type ChartDictionary = Omit<Translation<typeof en>, KeyAddedInMajor> & Partial<Pick<Translation<typeof en>, KeyAddedInMajor>>;
877
884
  /** A locale a host adds beyond the built-in inventory: its stable code, canonical BCP 47 tag,
878
885
  * reading direction, endonym, and the dictionary chunk to fetch the first time it is chosen. */
879
886
  interface ChartCustomLocale extends LocaleDefinition {
@@ -885,8 +892,9 @@ interface ChartI18nOptions {
885
892
  /** Locales registered beside the built-in inventory. A code or tag the inventory already holds
886
893
  * is refused: the built-in dictionaries are not overridden through this door. */
887
894
  locales?: readonly ChartCustomLocale[];
888
- /** Hears every key a loaded dictionary is missing; the text falls back to English. The typed
889
- * catalogs cannot miss a key, so this only ever reports a dictionary loaded from data. */
895
+ /** Hears every key a loaded dictionary is missing; the text falls back to English. A built-in
896
+ * language carries every key, so this reports a dictionary of your own: one loaded from data,
897
+ * or one without a key the catalog gained within the major. */
890
898
  onMissing?: (key: ChartMessageKey, locale: string) => void;
891
899
  }
892
900
  interface ChartI18n {
@@ -1207,6 +1215,8 @@ declare const chartDictionaries: DictionaryLoader<{
1207
1215
  readonly 'drawing.modifierCommand': "Cmd";
1208
1216
  readonly 'drawing.hintClone': "{modifier} + Drag";
1209
1217
  readonly 'drawing.hintCopy': "{modifier} + C";
1218
+ readonly 'drawing.hintRemove': "Del";
1219
+ readonly 'drawing.drawingMenu': "Drawing menu";
1210
1220
  readonly 'drawing.hintPaste': "{modifier} + V";
1211
1221
  readonly 'drawing.deleteWithKey': "Delete (Del)";
1212
1222
  readonly 'drawing.statusDrawingsHidden': "Drawings hidden";
@@ -1297,6 +1307,7 @@ declare const chartDictionaries: DictionaryLoader<{
1297
1307
  readonly 'drawing.sectionInfo': "Info";
1298
1308
  readonly 'drawing.priceRange': "Price range";
1299
1309
  readonly 'drawing.barsRange': "Bars range";
1310
+ readonly 'drawing.distance': "Distance";
1300
1311
  readonly 'drawing.angle': "Angle";
1301
1312
  readonly 'drawing.statsPosition': "Stats position";
1302
1313
  readonly 'drawing.statsHidden': "Hidden";
@@ -2870,6 +2881,12 @@ interface ChartExtensionMenuContext {
2870
2881
  /** Viewport coordinates of the press. */
2871
2882
  clientX: number;
2872
2883
  clientY: number;
2884
+ /** The table the press landed on, and whether a cell of it is being typed in; absent where it
2885
+ * landed on none. A press on a drawing raises that drawing's own menu, which carries the rows a
2886
+ * host contributes here in the places the chart's menu gives them. */
2887
+ table?: {
2888
+ cell: boolean;
2889
+ };
2873
2890
  }
2874
2891
  /** One filled or stroked shape of a contributed glyph, on the menu's own 28-unit grid. Path data
2875
2892
  * and a closed set of paint values are the whole vocabulary: a contribution carries no markup, no
@@ -4066,6 +4083,76 @@ interface ChartReplayApi {
4066
4083
  /** Off, waiting to be told where to start, or running. */
4067
4084
  type ReplayPhase = 'off' | 'arming' | 'on';
4068
4085
 
4086
+ /** Every action the menu can offer. A host handles the ids it supports and passes `has` flags for
4087
+ * the rest — an unsupported action simply never becomes a row. */
4088
+ type ChartMenuAction = 'table-add-column' | 'table-add-row' | 'table-remove-row' | 'table-remove-column' | 'reset-view' | 'copy-price' | 'paste' | 'remove-indicators' | 'remove-drawings' | 'settings';
4089
+ /** The glyph a row wears, named rather than drawn — the host owns the artwork. */
4090
+ type ChartMenuIcon = 'reset' | 'settings' | 'check' | 'table-add-column' | 'table-add-row' | 'delete';
4091
+ type ChartMenuRow = {
4092
+ kind: 'separator';
4093
+ } | {
4094
+ kind: 'item';
4095
+ id: ChartMenuAction;
4096
+ label: string;
4097
+ shortcut?: string;
4098
+ icon?: ChartMenuIcon;
4099
+ /** A CHECKABLE row: state is marked with a checkmark in the icon cell and never by
4100
+ * rewording the label, so "Lock vertical cursor line by time" reads the same either way. */
4101
+ checked?: boolean;
4102
+ };
4103
+ interface ChartMenuContext {
4104
+ /** The level the pointer landed on, already formatted in the pane's own precision. */
4105
+ priceText: string;
4106
+ /** The pane's display symbol — a contributed row that acts on the market names it. */
4107
+ symbol: string;
4108
+ /** Counts drive both the wording and whether the row appears at all. */
4109
+ indicatorCount: number;
4110
+ drawingCount: number;
4111
+ /** A drawing clipboard exists. Default true: Paste is offered whether or not anything
4112
+ * is copied, and pasting nothing is a no-op — but a host with no clipboard at all omits it. */
4113
+ canPaste?: boolean;
4114
+ /** A settings surface exists to open. Default true; a host without one omits the row. */
4115
+ canSettings?: boolean;
4116
+ /** The level lies on a table. Its rows add a column right of the cell being typed in and a row
4117
+ * below it, or at the table's ends where no cell is, and with a cell, remove its row and its
4118
+ * column. Omitted where the level lies on none. */
4119
+ table?: {
4120
+ cell: boolean;
4121
+ };
4122
+ /** The widget's language for the row labels. Omitted ⇒ English. */
4123
+ t?: ChartTranslate;
4124
+ }
4125
+ /** The menu a level offers, in one fixed order. */
4126
+ declare function chartContextMenu(c: ChartMenuContext): ChartMenuRow[];
4127
+
4128
+ /** A row the HOST contributed for this raise (through the chart's extension seam). It carries its
4129
+ * own action, so the painter routes nothing and a contributed row can never collide with a
4130
+ * built-in id. Structural on purpose: the menu has no dependency on who contributed or why. */
4131
+ interface ContextMenuExtraRow {
4132
+ label: string;
4133
+ shortcut?: string;
4134
+ checked?: boolean;
4135
+ /** An inert vector glyph for the shared gutter. */
4136
+ icon?: ChartExtensionIcon;
4137
+ /** `level` rows (the default) group under Copy price and Paste; `view` rows under the removes. */
4138
+ group?: 'level' | 'view';
4139
+ run(): void;
4140
+ }
4141
+ interface ContextMenuHandle {
4142
+ /** Raise the menu at a viewport point, for the level the caller resolved. `extra` places the
4143
+ * contributed rows by their group between the built-ins; an empty list adds no separator. */
4144
+ open(at: {
4145
+ clientX: number;
4146
+ clientY: number;
4147
+ }, ctx: ChartMenuContext, extra?: readonly ContextMenuExtraRow[]): void;
4148
+ close(): void;
4149
+ destroy(): void;
4150
+ }
4151
+ /** `strings` is the chart's language: the rows are built through it every time the menu is raised,
4152
+ * and an open menu re-labels in place if the language changes under it. `icons` are the host's
4153
+ * drawings for the menu's own glyphs, as a chart takes them. */
4154
+ declare function mountContextMenu(container: HTMLElement, run: (id: ChartMenuAction) => void, strings?: ChartI18n, icons?: ChartIcons): ContextMenuHandle;
4155
+
4069
4156
  /** The drawing surface a host drives: the layer's handle minus what the chart owns (symbol,
4070
4157
  * timeframe, tick, price format, teardown) and minus the session verbs only the package's own
4071
4158
  * surfaces use (the live `IDrawing`, the preview and edit session, the inline text session, the
@@ -5355,76 +5442,6 @@ declare function planPaneOp(state: PaneState, op: PaneOp): PanePlan;
5355
5442
  * not collapsed anything. */
5356
5443
  declare function isCollapsed(height: number | undefined): boolean;
5357
5444
 
5358
- /** Every action the menu can offer. A host handles the ids it supports and passes `has` flags for
5359
- * the rest — an unsupported action simply never becomes a row. */
5360
- type ChartMenuAction = 'table-add-column' | 'table-add-row' | 'table-remove-row' | 'table-remove-column' | 'reset-view' | 'copy-price' | 'paste' | 'remove-indicators' | 'remove-drawings' | 'settings';
5361
- /** The glyph a row wears, named rather than drawn — the host owns the artwork. */
5362
- type ChartMenuIcon = 'reset' | 'settings' | 'check' | 'table-add-column' | 'table-add-row' | 'delete';
5363
- type ChartMenuRow = {
5364
- kind: 'separator';
5365
- } | {
5366
- kind: 'item';
5367
- id: ChartMenuAction;
5368
- label: string;
5369
- shortcut?: string;
5370
- icon?: ChartMenuIcon;
5371
- /** A CHECKABLE row: state is marked with a checkmark in the icon cell and never by
5372
- * rewording the label, so "Lock vertical cursor line by time" reads the same either way. */
5373
- checked?: boolean;
5374
- };
5375
- interface ChartMenuContext {
5376
- /** The level the pointer landed on, already formatted in the pane's own precision. */
5377
- priceText: string;
5378
- /** The pane's display symbol — a contributed row that acts on the market names it. */
5379
- symbol: string;
5380
- /** Counts drive both the wording and whether the row appears at all. */
5381
- indicatorCount: number;
5382
- drawingCount: number;
5383
- /** A drawing clipboard exists. Default true: Paste is offered whether or not anything
5384
- * is copied, and pasting nothing is a no-op — but a host with no clipboard at all omits it. */
5385
- canPaste?: boolean;
5386
- /** A settings surface exists to open. Default true; a host without one omits the row. */
5387
- canSettings?: boolean;
5388
- /** The level lies on a table. Its rows add a column right of the cell being typed in and a row
5389
- * below it, or at the table's ends where no cell is, and with a cell, remove its row and its
5390
- * column. Omitted where the level lies on none. */
5391
- table?: {
5392
- cell: boolean;
5393
- };
5394
- /** The widget's language for the row labels. Omitted ⇒ English. */
5395
- t?: ChartTranslate;
5396
- }
5397
- /** The menu a level offers, in one fixed order. */
5398
- declare function chartContextMenu(c: ChartMenuContext): ChartMenuRow[];
5399
-
5400
- /** A row the HOST contributed for this raise (through the chart's extension seam). It carries its
5401
- * own action, so the painter routes nothing and a contributed row can never collide with a
5402
- * built-in id. Structural on purpose: the menu has no dependency on who contributed or why. */
5403
- interface ContextMenuExtraRow {
5404
- label: string;
5405
- shortcut?: string;
5406
- checked?: boolean;
5407
- /** An inert vector glyph for the shared gutter. */
5408
- icon?: ChartExtensionIcon;
5409
- /** `level` rows (the default) group under Copy price and Paste; `view` rows under the removes. */
5410
- group?: 'level' | 'view';
5411
- run(): void;
5412
- }
5413
- interface ContextMenuHandle {
5414
- /** Raise the menu at a viewport point, for the level the caller resolved. `extra` places the
5415
- * contributed rows by their group between the built-ins; an empty list adds no separator. */
5416
- open(at: {
5417
- clientX: number;
5418
- clientY: number;
5419
- }, ctx: ChartMenuContext, extra?: readonly ContextMenuExtraRow[]): void;
5420
- close(): void;
5421
- destroy(): void;
5422
- }
5423
- /** `strings` is the chart's language: the rows are built through it every time the menu is raised,
5424
- * and an open menu re-labels in place if the language changes under it. `icons` are the host's
5425
- * drawings for the menu's own glyphs, as a chart takes them. */
5426
- declare function mountContextMenu(container: HTMLElement, run: (id: ChartMenuAction) => void, strings?: ChartI18n, icons?: ChartIcons): ContextMenuHandle;
5427
-
5428
5445
  /** The session's name in English — what a host renders when it shows status text of its own. The
5429
5446
  * widget's catalog carries the same five under `session.<state>`, keyed by these very names, so a
5430
5447
  * host reading the catalog and a host reading this table always say the same thing. */