@forgecharts/sdk 1.5.78 → 1.5.79

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/dist/internal.js CHANGED
@@ -11165,6 +11165,9 @@ var KIT_FEATURE_TO_CAPABILITY = {
11165
11165
  extended_drawing_tools: "extendedDrawings",
11166
11166
  indicators: "indicators",
11167
11167
  multi_pane: "multiPane",
11168
+ // Renamed candle_types in migration 050 (it gates the series-style picker);
11169
+ // the legacy key stays mapped so an un-migrated catalog keeps working.
11170
+ candle_types: "chartTypes",
11168
11171
  chart_types: "chartTypes",
11169
11172
  bar_replay: "barReplay",
11170
11173
  custom_timeframes: "customTimeframes",
@@ -12317,6 +12320,30 @@ var TChart = class _TChart {
12317
12320
  this._series.applyOptions(options);
12318
12321
  this._core.markDirty();
12319
12322
  }
12323
+ /**
12324
+ * Switch the primary series' render style (candlestick, heikinashi, line,
12325
+ * area, histogram). The renderers have always supported every style — the
12326
+ * draw pass branches on the series' type option — this is the missing
12327
+ * public switch, gated by the candle_types package feature (capability
12328
+ * `chartTypes`). Ungated attempts warn and keep the current style rather
12329
+ * than throwing: the toolbar hides the picker when ungated, so a call
12330
+ * landing here is a host integration slip, not a user action.
12331
+ */
12332
+ setSeriesType(type) {
12333
+ this._assertAlive();
12334
+ if (!canUseChartTypes()) {
12335
+ console.warn("[ForgeCharts] Series-style switching (candle_types) is not enabled on the active plan.");
12336
+ return;
12337
+ }
12338
+ this._series.applyOptions({ type });
12339
+ this._core.markDirty();
12340
+ this._bus.emit("seriesTypeChanged", { type });
12341
+ }
12342
+ /** The primary series' current render style. */
12343
+ getSeriesType() {
12344
+ this._assertAlive();
12345
+ return this._series.options().type;
12346
+ }
12320
12347
  /** Scrolls the viewport so the latest bar is visible at the right edge. */
12321
12348
  scrollToEnd() {
12322
12349
  this._assertAlive();
@@ -23206,6 +23233,7 @@ var ChartCanvas = forwardRef(
23206
23233
  initialActiveTool,
23207
23234
  onPointerToolChange,
23208
23235
  initialPointerTool,
23236
+ initialSeriesType,
23209
23237
  initialMagnetMode,
23210
23238
  onMagnetModeChange,
23211
23239
  drawingFavorites: drawingFavoritesProp,
@@ -23324,6 +23352,7 @@ var ChartCanvas = forwardRef(
23324
23352
  chartRef.current?.loadLayout(layout);
23325
23353
  },
23326
23354
  addIndicator: (config) => chartRef.current?.addIndicator(config) ?? null,
23355
+ setSeriesType: (type) => chartRef.current?.setSeriesType(type),
23327
23356
  removeIndicator: (id) => chartRef.current?.removeIndicator(id),
23328
23357
  moveIndicatorToOverlay: (id) => chartRef.current?.moveIndicatorToOverlay(id),
23329
23358
  moveIndicatorToPane: (id, targetPaneId) => chartRef.current?.moveIndicatorToPane(id, targetPaneId),
@@ -24343,7 +24372,12 @@ var ChartCanvas = forwardRef(
24343
24372
  handleToolSelectRef.current = handleToolSelect;
24344
24373
  selectPointerToolRef.current = handleToolSelect;
24345
24374
  const initialPointerAppliedRef = useRef(false);
24375
+ const initialSeriesAppliedRef = useRef(false);
24346
24376
  useEffect(() => {
24377
+ if (!initialSeriesAppliedRef.current && initialSeriesType && chartRef.current) {
24378
+ initialSeriesAppliedRef.current = true;
24379
+ chartRef.current.setSeriesType(initialSeriesType);
24380
+ }
24347
24381
  if (initialPointerAppliedRef.current || !initialPointerTool) return;
24348
24382
  initialPointerAppliedRef.current = true;
24349
24383
  selectPointerToolRef.current(initialPointerTool);
@@ -25586,7 +25620,7 @@ var demonstrationTool = {
25586
25620
  };
25587
25621
 
25588
25622
  // src/version.ts
25589
- var FORGECHARTS_VERSION = "1.5.78" ;
25623
+ var FORGECHARTS_VERSION = "1.5.79" ;
25590
25624
 
25591
25625
  // src/compatibility.ts
25592
25626
  var MIN_KIT_API = 1;