@guihz/trading-vue-editor-tes 0.1.21 → 0.1.23

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.
@@ -97952,7 +97952,6 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
97952
97952
  l === v0.Brackethesized && (m = `[${f.map((_) => _.type).join(", ")}]`);
97953
97953
  const { allowedTypeIDs: E = [], displayType: x, name: T } = t;
97954
97954
  if (m === `${P.SIMPLE} ${P.NA}`) {
97955
- console.log(E, x, n, T);
97956
97955
  const _ = this._removePrefix(x);
97957
97956
  let z = EE[_];
97958
97957
  if (z) {
@@ -98980,7 +98979,7 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
98980
98979
  let y = "";
98981
98980
  const { column: m, line: E } = f?.ctx?.start || {}, x = `${E}_${m}`;
98982
98981
  let T = this._isInFunc ? `$posStr + "__${x}"` : `"${x}"`;
98983
- T = this._isInLoop ? `"$" + $$count${this._count} + "_$" + ${T}` : T, f.selfArg ? (y = this._parserMethodElement(f, T, l.join(".")), l = []) : y = this._parserMethodElement(f, T, ""), l.push(y);
98982
+ T = this._isInLoop ? `"($" + $$count${this._count} + "_$)" + ${T}` : T, f.selfArg ? (y = this._parserMethodElement(f, T, l.join(".")), l = []) : y = this._parserMethodElement(f, T, ""), l.push(y);
98984
98983
  }
98985
98984
  if (e.expr && l.unshift(`(${this._parserSingleExpression(e.expr)})`), e.isBuiltIn) {
98986
98985
  const f = l.join(".");
@@ -99002,7 +99001,7 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
99002
99001
  _parserMethodExpression(e) {
99003
99002
  const { exprs: t, ctx: n } = e, { column: i, line: s } = n.start, o = `${s}_${i}`;
99004
99003
  let p = this._isInFunc ? `$posStr + "__${o}"` : `"${o}"`;
99005
- p = this._isInLoop ? `"$" + $$count${this._count} + "_$" + ${p}` : p, i === 0 && (this._dependsObj[p] = /* @__PURE__ */ new Map());
99004
+ p = this._isInLoop ? `"($" + $$count${this._count} + "_$)" + ${p}` : p, i === 0 && (this._dependsObj[p] = /* @__PURE__ */ new Map());
99006
99005
  let l = [];
99007
99006
  for (const y of t) {
99008
99007
  let m = "";
@@ -99200,7 +99199,6 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
99200
99199
  let y = "";
99201
99200
  const m = new TE("_$");
99202
99201
  let E = e ? "" : m.preParser(f);
99203
- console.log(E);
99204
99202
  const x = {};
99205
99203
  if (e && !i.some((T) => T.type === Ft.Error)) {
99206
99204
  const { code: T = "", hasLeftVisibleBarTime: _, hasRightVisibleBarTime: z } = m.parser(f) || {};
@@ -8899,7 +8899,7 @@ function print() { __p += __j.call(arguments, '') }
8899
8899
  return isNaN(n) || isNaN(e) ? NaN : $i(n).div(e).toNumber();
8900
8900
  }
8901
8901
  function st(n, e = 5) {
8902
- return Number(n && $i(n).toFixed(e));
8902
+ return n ? $i(n).round(e + 1).round(e, 0).toNumber() : Number(n);
8903
8903
  }
8904
8904
  let db = class extends tR {
8905
8905
  _cacheData;
@@ -9106,6 +9106,7 @@ function print() { __p += __j.call(arguments, '') }
9106
9106
  this._priceVariables = { close: st(i, this._precision), open: st(s, this._precision), high: st(o, this._precision), low: st(a, this._precision), volume: Number(c) }, this._isRealTimeBar = l, this.current_time = d, this._isRepeated = t, this._timeTradingday = u, this._currentBarTime = p * 1e3, this._lastBarIndex = b, this._barIndex = r, this._lastBarTime = M * 1e3, this._nextBarTime = O * 1e3, this._barstate.update(r, b, l, !0), this.update({ ...this._priceVariables, hlc3: this.hlc3, barIndex: r });
9107
9107
  }
9108
9108
  getCacheData(e, t, r) {
9109
+ e = e.replace(/\$[\d]+_\$/g, "");
9109
9110
  let i = this._cacheData[e], s = 1;
9110
9111
  if (!i || i.barIndex < this._barIndex ? i = this.setCacheData(e, r) : (i.barIndex < this._barIndex && (s = 0), i = i.data), t === 0)
9111
9112
  return r;
@@ -9113,6 +9114,7 @@ function print() { __p += __j.call(arguments, '') }
9113
9114
  return t = Math.floor(t), o < t && (this._cacheSpace[e] = t), i[i.length - s - t];
9114
9115
  }
9115
9116
  setCacheData(e, t) {
9117
+ e = e.replace(/\$[\d]+_\$/g, "");
9116
9118
  let r = this._cacheData[e] || {
9117
9119
  barIndex: -1,
9118
9120
  data: []
@@ -22519,6 +22521,7 @@ ${u}`), u;
22519
22521
  this._isRepeated = t, this._timeTradingday = u, this._currentBarTime = p * 1e3, this._lastBarIndex = b, this._barIndex = r, this._lastBarTime = M * 1e3, this._nextBarTime = O * 1e3, this._barstate.update(r, b, l, !0), this.taUpdate({ ...this._priceVariables, hlc3: this.hlc3, barIndex: r });
22520
22522
  }
22521
22523
  getCacheData(e, t, r) {
22524
+ e = e.replace(/\$[\d]+_\$/g, "");
22522
22525
  let i = this._cacheData[e], s = 1;
22523
22526
  if (!i || i.barIndex < this._barIndex ? i = this.setCacheData(e, r) : (i.barIndex < this._barIndex && (s = 0), i = i.data), t === 0)
22524
22527
  return r;
@@ -22526,6 +22529,7 @@ ${u}`), u;
22526
22529
  return t = Math.floor(t), o < t && (this._cacheSpace[e] = t), i[i.length - s - t];
22527
22530
  }
22528
22531
  setCacheData(e, t) {
22532
+ e = e.replace(/\$[\d]+_\$/g, "");
22529
22533
  let r = this._cacheData[e] || {
22530
22534
  barIndex: -1,
22531
22535
  data: []
@@ -22675,6 +22679,7 @@ ${u}`), u;
22675
22679
  _tmpData;
22676
22680
  _tmpInstance;
22677
22681
  _tmpIds = [];
22682
+ _deleteKeys = [];
22678
22683
  constructor(e, t = 50) {
22679
22684
  this._all = /* @__PURE__ */ new Map(), this._allInstance = /* @__PURE__ */ new Map(), this._maxLength = t, this._deleteIds = /* @__PURE__ */ new Map(), this._variables = e, this._preDeleteIds = /* @__PURE__ */ new Map(), this._againAddItems = [], this._tmpData = /* @__PURE__ */ new Map(), this._tmpInstance = /* @__PURE__ */ new Map();
22680
22685
  }
@@ -22773,6 +22778,8 @@ ${u}`), u;
22773
22778
  this._variables._isRealTimeBar ? (this._tmpData.set(e, t), this._tmpInstance.set(e, r)) : (this._all.set(e, t), this._allInstance.set(e, r));
22774
22779
  }
22775
22780
  get(e) {
22781
+ if (this._deleteKeys.includes(e))
22782
+ return;
22776
22783
  const t = this._all.get(e);
22777
22784
  let r = this._tmpData.get(e);
22778
22785
  return this._variables._isRealTimeBar ? (r || (r = t ? { ...t } : void 0, r && this._tmpData.set(e, r)), r) : (this._tmpData.clear(), this._tmpInstance.clear(), t);
@@ -22802,7 +22809,7 @@ ${u}`), u;
22802
22809
  s.push({
22803
22810
  key: e,
22804
22811
  id: i?.id || r
22805
- }), this._deleteIds.set(t, s);
22812
+ }), this._deleteKeys.push(e), this._deleteIds.set(t, s);
22806
22813
  }
22807
22814
  }
22808
22815
  _tmpDataHandle() {
@@ -22811,7 +22818,7 @@ ${u}`), u;
22811
22818
  const t = this._tmpData.get(e)?.id;
22812
22819
  t && this._tmpIds.push({ id: t, key: e });
22813
22820
  }
22814
- this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear();
22821
+ this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear(), this._deleteKeys = [];
22815
22822
  }
22816
22823
  };
22817
22824
  const FB = {
@@ -34037,6 +34044,9 @@ ${Uf}`);
34037
34044
  get updateIds() {
34038
34045
  return [...this._updateIds.values()];
34039
34046
  }
34047
+ linefill(e) {
34048
+ return e.x;
34049
+ }
34040
34050
  new(e, t) {
34041
34051
  const { line1: r, line2: i } = e, { bar_index: s, linefill: o, line: a } = this._variables, c = `linefill_${t}_${s}`, p = r?.id ? a.get(r?.id) : void 0, b = i?.id ? a.get(i?.id) : void 0, M = `${p?.id || ""}${b?.id || ""}`;
34042
34052
  p && (p.linefills = p.linefills || [], p.linefills.push(c)), b && (b.linefills = b.linefills || [], b.linefills.push(c)), ae(e, ["color"]);
@@ -38418,6 +38428,7 @@ ${u}`), u;
38418
38428
  this._isRepeated = t, this._timeTradingday = u, this._currentBarTime = p * 1e3, this._lastBarIndex = b, this._barIndex = r, this._preTimeCacheData.preBarindex = r, this._lastBarTime = M * 1e3, this._nextBarTime = O * 1e3, this._barstate.update(r, b, l, !0), this.ta.update({ ...this._priceVariables, hlc3: this.hlc3, barIndex: r });
38419
38429
  }
38420
38430
  getCacheData(e, t, r) {
38431
+ e = e.replace(/\$[\d]+_\$/g, "");
38421
38432
  let i = this._cacheData[e], s = 1;
38422
38433
  if (!i || i.barIndex < this._barIndex ? i = this.setCacheData(e, r) : (i.barIndex < this._barIndex && (s = 0), i = i.data), t === 0)
38423
38434
  return r;
@@ -38425,6 +38436,7 @@ ${u}`), u;
38425
38436
  return t = Math.floor(t), o < t && (this._cacheSpace[e] = t), i[i.length - s - t];
38426
38437
  }
38427
38438
  setCacheData(e, t) {
38439
+ e = e.replace(/\$[\d]+_\$/g, "");
38428
38440
  let r = this._cacheData[e] || {
38429
38441
  barIndex: -1,
38430
38442
  data: []
@@ -38593,6 +38605,7 @@ ${u}`), u;
38593
38605
  _tmpInstance;
38594
38606
  _type;
38595
38607
  _tmpIds = [];
38608
+ _deleteKeys = [];
38596
38609
  constructor(e, t, r = 50) {
38597
38610
  this._all = /* @__PURE__ */ new Map(), this._allInstance = /* @__PURE__ */ new Map(), this._pseudoArrayAll = I1(0, void 0, t), this._maxLength = r, this._deleteIds = /* @__PURE__ */ new Map(), this._variables = e, this._preDeleteIds = /* @__PURE__ */ new Map(), this._againAddItems = [], this._tmpData = /* @__PURE__ */ new Map(), this._tmpInstance = /* @__PURE__ */ new Map(), this._type = t;
38598
38611
  }
@@ -38700,6 +38713,8 @@ ${u}`), u;
38700
38713
  this._variables._isRealTimeBar ? (this._tmpData.set(e, t), this._tmpInstance.set(e, r)) : (this._all.set(e, t), this._allInstance.set(e, r));
38701
38714
  }
38702
38715
  get(e) {
38716
+ if (this._deleteKeys.includes(e))
38717
+ return;
38703
38718
  const t = this._all.get(e);
38704
38719
  let r = this._tmpData.get(e);
38705
38720
  return this._variables._isRealTimeBar ? (r || (r = t ? { ...t } : void 0, r && this._tmpData.set(e, r)), r) : (this._tmpData.clear(), this._tmpInstance.clear(), t);
@@ -38735,7 +38750,7 @@ ${u}`), u;
38735
38750
  s.push({
38736
38751
  key: e,
38737
38752
  id: i?.id || r
38738
- }), this._deleteIds.set(t, s);
38753
+ }), this._deleteKeys.push(e), this._deleteIds.set(t, s);
38739
38754
  }
38740
38755
  }
38741
38756
  _tmpDataHandle() {
@@ -38744,7 +38759,7 @@ ${u}`), u;
38744
38759
  const t = this._tmpData.get(e)?.id;
38745
38760
  t && this._tmpIds.push({ id: t, key: e });
38746
38761
  }
38747
- this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear();
38762
+ this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear(), this._deleteKeys = [];
38748
38763
  }
38749
38764
  };
38750
38765
  async function IC(n, e, t) {
@@ -42382,6 +42397,9 @@ ${u}`), u;
42382
42397
  const O = DE(c, l, M, r, i);
42383
42398
  return t.startsWith("export") || (p || b) && o.add(c, l, O), O;
42384
42399
  }
42400
+ linefill(e) {
42401
+ return e.x;
42402
+ }
42385
42403
  _verifyLineKey(e) {
42386
42404
  for (const [t, r] of this._variables.linefill.__allInstance)
42387
42405
  if (r.lineKey === e)
@@ -46829,6 +46847,7 @@ ${u}`), u;
46829
46847
  this._isRepeated = t, this._timeTradingday = u, this._currentBarTime = p * 1e3, this._lastBarIndex = b, this._barIndex = r, this._preTimeCacheData.preBarindex = r, this._lastBarTime = M * 1e3, this._nextBarTime = O * 1e3, this._barstate.update(r, b, l, !0), this.ta.update({ ...this._priceVariables, hlc3: this.hlc3, barIndex: r });
46830
46848
  }
46831
46849
  getCacheData(e, t, r) {
46850
+ e = e.replace(/\(\$\d+_\$\)/g, "");
46832
46851
  let i = this._cacheData[e], s = 1;
46833
46852
  if (!i || i.barIndex < this._barIndex ? i = this.setCacheData(e, r) : (i.barIndex < this._barIndex && (s = 0), i = i.data), t === 0)
46834
46853
  return r;
@@ -46836,6 +46855,7 @@ ${u}`), u;
46836
46855
  return t = Math.floor(t), o < t && (this._cacheSpace[e] = t), i[i.length - s - t];
46837
46856
  }
46838
46857
  setCacheData(e, t) {
46858
+ e = e.replace(/\(\$\d+_\$\)/g, "");
46839
46859
  let r = this._cacheData[e] || {
46840
46860
  barIndex: -1,
46841
46861
  data: []
@@ -46856,14 +46876,14 @@ ${u}`), u;
46856
46876
  return new ih(e, t, r);
46857
46877
  }
46858
46878
  verifyVarAndVarip(e, t, r) {
46859
- const i = `${e}_${t.replace(/\$[\d]+_\$/g, "")}`, s = this._isRepeated || this.__isReqRepeated ? this._preCacheData : this._cacheData;
46879
+ const i = `${e}_${t.replace(/\(\$\d+_\$\)/g, "")}`, s = this._isRepeated || this.__isReqRepeated ? this._preCacheData : this._cacheData;
46860
46880
  if (r === "var" && s.varData.hasOwnProperty(i))
46861
46881
  return this._upadteChartDraws(s.varData, i), !0;
46862
46882
  const o = this.__isReqRepeated ? this._preCacheData.varipData : this._cacheData.varipData;
46863
46883
  return r === "varip" && o.hasOwnProperty(i) ? (this._upadteChartDraws(o, i), !0) : !1;
46864
46884
  }
46865
46885
  getVarValue(e, t, r) {
46866
- const i = `${e}_${t.replace(/\$[\d]+_\$/g, "")}`;
46886
+ const i = `${e}_${t.replace(/\(\$\d+_\$\)/g, "")}`;
46867
46887
  (this._isRepeated || this.__isReqRepeated) && (this._cacheData.varData[i] = this._preCacheData.varData[i], this.__isReqRepeated && (this._cacheData.varipData[i] = this._preCacheData.varipData[i]));
46868
46888
  const s = this._cacheData;
46869
46889
  if (r === "var") {
@@ -46873,7 +46893,7 @@ ${u}`), u;
46873
46893
  return this._cacheData.varipData[i];
46874
46894
  }
46875
46895
  setVarValue(e, t, r, i) {
46876
- const s = `${e}_${t.replace(/\$[\d]+_\$/g, "")}`;
46896
+ const s = `${e}_${t.replace(/\(\$\d+_\$\)/g, "")}`;
46877
46897
  let o;
46878
46898
  switch (typeof r == "object" && r?.varipKeys?.length && i !== "varip" && (i = "var", o = r.varipKeys), i) {
46879
46899
  case "var":
@@ -47005,6 +47025,7 @@ ${u}`), u;
47005
47025
  _tmpInstance;
47006
47026
  _type;
47007
47027
  _tmpIds = [];
47028
+ _deleteKeys = [];
47008
47029
  constructor(e, t, r = 50) {
47009
47030
  this._all = /* @__PURE__ */ new Map(), this._allInstance = /* @__PURE__ */ new Map(), this._pseudoArrayAll = $1(0, void 0, t), this._maxLength = r, this._deleteIds = /* @__PURE__ */ new Map(), this._variables = e, this._preDeleteIds = /* @__PURE__ */ new Map(), this._againAddItems = [], this._tmpData = /* @__PURE__ */ new Map(), this._tmpInstance = /* @__PURE__ */ new Map(), this._type = t;
47010
47031
  }
@@ -47112,6 +47133,8 @@ ${u}`), u;
47112
47133
  this._variables._isRealTimeBar ? (this._tmpData.set(e, t), this._tmpInstance.set(e, r)) : (this._all.set(e, t), this._allInstance.set(e, r));
47113
47134
  }
47114
47135
  get(e) {
47136
+ if (this._deleteKeys.includes(e))
47137
+ return;
47115
47138
  const t = this._all.get(e);
47116
47139
  let r = this._tmpData.get(e);
47117
47140
  return this._variables._isRealTimeBar ? (r || (r = t ? { ...t } : void 0, r && this._tmpData.set(e, r)), r) : (this._tmpData.clear(), this._tmpInstance.clear(), t);
@@ -47147,7 +47170,7 @@ ${u}`), u;
47147
47170
  s.push({
47148
47171
  key: e,
47149
47172
  id: i?.id || r
47150
- }), this._deleteIds.set(t, s);
47173
+ }), this._deleteKeys.push(e), this._deleteIds.set(t, s);
47151
47174
  }
47152
47175
  }
47153
47176
  _tmpDataHandle() {
@@ -47156,7 +47179,7 @@ ${u}`), u;
47156
47179
  const t = this._tmpData.get(e)?.id;
47157
47180
  t && this._tmpIds.push({ id: t, key: e });
47158
47181
  }
47159
- this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear();
47182
+ this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear(), this._deleteKeys = [];
47160
47183
  }
47161
47184
  }
47162
47185
  async function rT(n, e, t) {
@@ -19,6 +19,9 @@ export default class BuildInLinefill {
19
19
  private _updateIds;
20
20
  constructor(variables: BuiltInVariables);
21
21
  get updateIds(): string[];
22
+ linefill(args: {
23
+ x?: ILinefill;
24
+ }): ILinefill | undefined;
22
25
  new(args: ILinefillArgs, posStr: string): ILinefill;
23
26
  private _verifyLineKey;
24
27
  updateId(id: ILinefill): string;
@@ -20,6 +20,9 @@ export default class BuildInLinefill {
20
20
  constructor(variables: BuiltInVariables);
21
21
  get updateIds(): string[];
22
22
  new(args: ILinefillArgs, posStr: string): ILinefill;
23
+ linefill(args: {
24
+ x?: ILinefill;
25
+ }): ILinefill | undefined;
23
26
  private _verifyLineKey;
24
27
  updateId(id: ILinefill): string;
25
28
  delete({ id }: ILinefillArgs): void;
@@ -9170,14 +9170,14 @@ function mr(i, n, r) {
9170
9170
  function I1() {
9171
9171
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
9172
9172
  }
9173
- const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-NE25FJXj.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9173
+ const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-BBT4QHtH.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9174
9174
  Lf.onerror = (i) => {
9175
9175
  console.error(i);
9176
9176
  };
9177
9177
  async function Tf(i) {
9178
9178
  return await bo.setInlayHints(i);
9179
9179
  }
9180
- const Nf = ma(Lf), Rf = ma(new Worker(new URL("" + new URL("assets/parserTccWorker-DoVd1Ini.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser MineScript Server" }));
9180
+ const Nf = ma(Lf), Rf = ma(new Worker(new URL("" + new URL("assets/parserTccWorker-C3j7GaiS.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser MineScript Server" }));
9181
9181
  async function A1(i, n = !1, r = Xt) {
9182
9182
  const s = i.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];
9183
9183
  s && (r = parseInt(s), r = r < 3 ? 3 : r > 6 ? 6 : r);
@@ -9852,7 +9852,8 @@ const ay = (i, n) => {
9852
9852
  return Z.current && ye.observe(Z.current), () => {
9853
9853
  Z.current && ye.unobserve(Z.current), ye.disconnect(), I.current?.dispose();
9854
9854
  };
9855
- }, []), C.jsx("div", { ref: Z, children: C.jsx(cb, { height: r, width: s || "100%", defaultLanguage: Ke, defaultValue: h || `indicator("我的脚本")
9855
+ }, []), C.jsx("div", { ref: Z, children: C.jsx(cb, { height: r, width: s || "100%", defaultLanguage: Ke, defaultValue: h || `//@version=6
9856
+ indicator("我的脚本")
9856
9857
  plot(close)
9857
9858
  `, theme: a || "vs-dark", className: `tvue-script ${a || "vs-dark"}`, options: {
9858
9859
  colorDecorators: !0,