@forgecharts/sdk 1.5.72 → 1.5.73
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/index.js +19 -55
- package/dist/index.js.map +1 -1
- package/dist/internal.js +19 -55
- package/dist/internal.js.map +1 -1
- package/dist/pixi/PixiChart.d.ts +8 -1
- package/dist/pixi/PixiChart.d.ts.map +1 -1
- package/dist/pixi/PixiLastPriceRenderer.d.ts.map +1 -1
- package/dist/react/index.js +41 -63
- package/dist/react/index.js.map +1 -1
- package/dist/react/internal.js +42 -64
- package/dist/react/internal.js.map +1 -1
- package/dist/react/shell/ScriptDrawer.d.ts.map +1 -1
- package/dist/react/workspace/toolbars/TopToolbar.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,8 +20,14 @@ function timeframeToMs(tf) {
|
|
|
20
20
|
const secs = parseTfSeconds(tf);
|
|
21
21
|
return secs !== null ? secs * 1e3 : null;
|
|
22
22
|
}
|
|
23
|
+
function normalizeTimeframe(tf) {
|
|
24
|
+
const m = /^(\d+)([a-zA-Z])$/.exec(tf.trim());
|
|
25
|
+
if (!m) return tf.trim();
|
|
26
|
+
const unit = m[2];
|
|
27
|
+
return m[1] + (unit === "M" ? unit : unit.toLowerCase());
|
|
28
|
+
}
|
|
23
29
|
function parseTfSeconds(tf) {
|
|
24
|
-
const m = /^(\d+)(s|m|h|d|w|M)$/.exec(tf);
|
|
30
|
+
const m = /^(\d+)(s|m|h|d|w|M)$/.exec(normalizeTimeframe(tf));
|
|
25
31
|
if (!m) return null;
|
|
26
32
|
const n = parseInt(m[1], 10);
|
|
27
33
|
const unit = m[2];
|
|
@@ -37,6 +43,7 @@ function parseTfSeconds(tf) {
|
|
|
37
43
|
return unitSec !== void 0 ? n * unitSec : null;
|
|
38
44
|
}
|
|
39
45
|
function getBucketStart(timeMs, timeframe) {
|
|
46
|
+
timeframe = normalizeTimeframe(timeframe);
|
|
40
47
|
if (timeframe === "1w") return getWeekBucketStart(timeMs);
|
|
41
48
|
if (timeframe === "1M") return getMonthBucketStart(timeMs);
|
|
42
49
|
if (timeframe === "3M") return getQuarterBucketStart(timeMs);
|
|
@@ -7697,32 +7704,7 @@ function formatCountdown(secs) {
|
|
|
7697
7704
|
return `${m}:${String(s).padStart(2, "0")}`;
|
|
7698
7705
|
}
|
|
7699
7706
|
function tfToSeconds(tf) {
|
|
7700
|
-
|
|
7701
|
-
"1s": 1,
|
|
7702
|
-
"5s": 5,
|
|
7703
|
-
"10s": 10,
|
|
7704
|
-
"15s": 15,
|
|
7705
|
-
"30s": 30,
|
|
7706
|
-
"1m": 60,
|
|
7707
|
-
"3m": 180,
|
|
7708
|
-
"5m": 300,
|
|
7709
|
-
"15m": 900,
|
|
7710
|
-
"30m": 1800,
|
|
7711
|
-
"1h": 3600,
|
|
7712
|
-
"2h": 7200,
|
|
7713
|
-
"4h": 14400,
|
|
7714
|
-
"6h": 21600,
|
|
7715
|
-
"8h": 28800,
|
|
7716
|
-
"12h": 43200,
|
|
7717
|
-
"1D": 86400,
|
|
7718
|
-
"3D": 259200,
|
|
7719
|
-
"1W": 604800,
|
|
7720
|
-
"1M": 2592e3,
|
|
7721
|
-
"3M": 7776e3,
|
|
7722
|
-
"6M": 15552e3,
|
|
7723
|
-
"12M": 31536e3
|
|
7724
|
-
};
|
|
7725
|
-
return map[tf] ?? 3600;
|
|
7707
|
+
return parseTfSeconds(tf) ?? 3600;
|
|
7726
7708
|
}
|
|
7727
7709
|
var PixiLastPriceRenderer = class {
|
|
7728
7710
|
_lineGfx;
|
|
@@ -9707,34 +9689,16 @@ var PixiChart = class {
|
|
|
9707
9689
|
}
|
|
9708
9690
|
return { time: bestBar.time, price: snappedPrice };
|
|
9709
9691
|
}
|
|
9710
|
-
/**
|
|
9692
|
+
/**
|
|
9693
|
+
* Convert a Timeframe string to seconds (internal helper).
|
|
9694
|
+
*
|
|
9695
|
+
* Delegates to the shared parser — this was one of three private maps, and
|
|
9696
|
+
* the only one still keyed '1D'/'1W' uppercase, so canonical '1d' fell to
|
|
9697
|
+
* the 3600 fallback here while '1D' fell to the 1m fallback everywhere
|
|
9698
|
+
* else. One derivation, one dialect.
|
|
9699
|
+
*/
|
|
9711
9700
|
_tfToSeconds(tf) {
|
|
9712
|
-
|
|
9713
|
-
"1s": 1,
|
|
9714
|
-
"5s": 5,
|
|
9715
|
-
"10s": 10,
|
|
9716
|
-
"15s": 15,
|
|
9717
|
-
"30s": 30,
|
|
9718
|
-
"1m": 60,
|
|
9719
|
-
"3m": 180,
|
|
9720
|
-
"5m": 300,
|
|
9721
|
-
"15m": 900,
|
|
9722
|
-
"30m": 1800,
|
|
9723
|
-
"1h": 3600,
|
|
9724
|
-
"2h": 7200,
|
|
9725
|
-
"4h": 14400,
|
|
9726
|
-
"6h": 21600,
|
|
9727
|
-
"8h": 28800,
|
|
9728
|
-
"12h": 43200,
|
|
9729
|
-
"1D": 86400,
|
|
9730
|
-
"3D": 259200,
|
|
9731
|
-
"1W": 604800,
|
|
9732
|
-
"1M": 2592e3,
|
|
9733
|
-
"3M": 7776e3,
|
|
9734
|
-
"6M": 15552e3,
|
|
9735
|
-
"12M": 31536e3
|
|
9736
|
-
};
|
|
9737
|
-
return map[tf] ?? 3600;
|
|
9701
|
+
return parseTfSeconds(tf) ?? 3600;
|
|
9738
9702
|
}
|
|
9739
9703
|
// ─── Option resolvers ────────────────────────────────────────────────────────
|
|
9740
9704
|
_resolveOptions(opts) {
|
|
@@ -25612,7 +25576,7 @@ var demonstrationTool = {
|
|
|
25612
25576
|
};
|
|
25613
25577
|
|
|
25614
25578
|
// src/version.ts
|
|
25615
|
-
var FORGECHARTS_VERSION = "1.5.
|
|
25579
|
+
var FORGECHARTS_VERSION = "1.5.73" ;
|
|
25616
25580
|
|
|
25617
25581
|
// src/compatibility.ts
|
|
25618
25582
|
var MIN_KIT_API = 1;
|