@guihz/trading-vue-editor-tes 0.1.22 → 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.
@@ -80429,7 +80429,6 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
80429
80429
  let y = "";
80430
80430
  const m = new V6("_$");
80431
80431
  let E = e ? "" : m.preParser(f);
80432
- console.log(E);
80433
80432
  const x = {};
80434
80433
  if (e && !i.some((T) => T.type === Ye.Error)) {
80435
80434
  const { code: T = "", hasLeftVisibleBarTime: _, hasRightVisibleBarTime: z } = m.parser(f) || {};
@@ -97953,7 +97952,6 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
97953
97952
  l === v0.Brackethesized && (m = `[${f.map((_) => _.type).join(", ")}]`);
97954
97953
  const { allowedTypeIDs: E = [], displayType: x, name: T } = t;
97955
97954
  if (m === `${P.SIMPLE} ${P.NA}`) {
97956
- console.log(E, x, n, T);
97957
97955
  const _ = this._removePrefix(x);
97958
97956
  let z = EE[_];
97959
97957
  if (z) {
@@ -98981,7 +98979,7 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
98981
98979
  let y = "";
98982
98980
  const { column: m, line: E } = f?.ctx?.start || {}, x = `${E}_${m}`;
98983
98981
  let T = this._isInFunc ? `$posStr + "__${x}"` : `"${x}"`;
98984
- 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);
98985
98983
  }
98986
98984
  if (e.expr && l.unshift(`(${this._parserSingleExpression(e.expr)})`), e.isBuiltIn) {
98987
98985
  const f = l.join(".");
@@ -99003,7 +99001,7 @@ ${this._prefixNameVar}.setCacheData("m${l}_" + ${f}, ${m})
99003
99001
  _parserMethodExpression(e) {
99004
99002
  const { exprs: t, ctx: n } = e, { column: i, line: s } = n.start, o = `${s}_${i}`;
99005
99003
  let p = this._isInFunc ? `$posStr + "__${o}"` : `"${o}"`;
99006
- 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());
99007
99005
  let l = [];
99008
99006
  for (const y of t) {
99009
99007
  let m = "";
@@ -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 = {
@@ -38421,6 +38428,7 @@ ${u}`), u;
38421
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 });
38422
38429
  }
38423
38430
  getCacheData(e, t, r) {
38431
+ e = e.replace(/\$[\d]+_\$/g, "");
38424
38432
  let i = this._cacheData[e], s = 1;
38425
38433
  if (!i || i.barIndex < this._barIndex ? i = this.setCacheData(e, r) : (i.barIndex < this._barIndex && (s = 0), i = i.data), t === 0)
38426
38434
  return r;
@@ -38428,6 +38436,7 @@ ${u}`), u;
38428
38436
  return t = Math.floor(t), o < t && (this._cacheSpace[e] = t), i[i.length - s - t];
38429
38437
  }
38430
38438
  setCacheData(e, t) {
38439
+ e = e.replace(/\$[\d]+_\$/g, "");
38431
38440
  let r = this._cacheData[e] || {
38432
38441
  barIndex: -1,
38433
38442
  data: []
@@ -38596,6 +38605,7 @@ ${u}`), u;
38596
38605
  _tmpInstance;
38597
38606
  _type;
38598
38607
  _tmpIds = [];
38608
+ _deleteKeys = [];
38599
38609
  constructor(e, t, r = 50) {
38600
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;
38601
38611
  }
@@ -38703,6 +38713,8 @@ ${u}`), u;
38703
38713
  this._variables._isRealTimeBar ? (this._tmpData.set(e, t), this._tmpInstance.set(e, r)) : (this._all.set(e, t), this._allInstance.set(e, r));
38704
38714
  }
38705
38715
  get(e) {
38716
+ if (this._deleteKeys.includes(e))
38717
+ return;
38706
38718
  const t = this._all.get(e);
38707
38719
  let r = this._tmpData.get(e);
38708
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);
@@ -38738,7 +38750,7 @@ ${u}`), u;
38738
38750
  s.push({
38739
38751
  key: e,
38740
38752
  id: i?.id || r
38741
- }), this._deleteIds.set(t, s);
38753
+ }), this._deleteKeys.push(e), this._deleteIds.set(t, s);
38742
38754
  }
38743
38755
  }
38744
38756
  _tmpDataHandle() {
@@ -38747,7 +38759,7 @@ ${u}`), u;
38747
38759
  const t = this._tmpData.get(e)?.id;
38748
38760
  t && this._tmpIds.push({ id: t, key: e });
38749
38761
  }
38750
- this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear();
38762
+ this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear(), this._deleteKeys = [];
38751
38763
  }
38752
38764
  };
38753
38765
  async function IC(n, e, t) {
@@ -46835,6 +46847,7 @@ ${u}`), u;
46835
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 });
46836
46848
  }
46837
46849
  getCacheData(e, t, r) {
46850
+ e = e.replace(/\(\$\d+_\$\)/g, "");
46838
46851
  let i = this._cacheData[e], s = 1;
46839
46852
  if (!i || i.barIndex < this._barIndex ? i = this.setCacheData(e, r) : (i.barIndex < this._barIndex && (s = 0), i = i.data), t === 0)
46840
46853
  return r;
@@ -46842,6 +46855,7 @@ ${u}`), u;
46842
46855
  return t = Math.floor(t), o < t && (this._cacheSpace[e] = t), i[i.length - s - t];
46843
46856
  }
46844
46857
  setCacheData(e, t) {
46858
+ e = e.replace(/\(\$\d+_\$\)/g, "");
46845
46859
  let r = this._cacheData[e] || {
46846
46860
  barIndex: -1,
46847
46861
  data: []
@@ -46862,14 +46876,14 @@ ${u}`), u;
46862
46876
  return new ih(e, t, r);
46863
46877
  }
46864
46878
  verifyVarAndVarip(e, t, r) {
46865
- 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;
46866
46880
  if (r === "var" && s.varData.hasOwnProperty(i))
46867
46881
  return this._upadteChartDraws(s.varData, i), !0;
46868
46882
  const o = this.__isReqRepeated ? this._preCacheData.varipData : this._cacheData.varipData;
46869
46883
  return r === "varip" && o.hasOwnProperty(i) ? (this._upadteChartDraws(o, i), !0) : !1;
46870
46884
  }
46871
46885
  getVarValue(e, t, r) {
46872
- const i = `${e}_${t.replace(/\$[\d]+_\$/g, "")}`;
46886
+ const i = `${e}_${t.replace(/\(\$\d+_\$\)/g, "")}`;
46873
46887
  (this._isRepeated || this.__isReqRepeated) && (this._cacheData.varData[i] = this._preCacheData.varData[i], this.__isReqRepeated && (this._cacheData.varipData[i] = this._preCacheData.varipData[i]));
46874
46888
  const s = this._cacheData;
46875
46889
  if (r === "var") {
@@ -46879,7 +46893,7 @@ ${u}`), u;
46879
46893
  return this._cacheData.varipData[i];
46880
46894
  }
46881
46895
  setVarValue(e, t, r, i) {
46882
- const s = `${e}_${t.replace(/\$[\d]+_\$/g, "")}`;
46896
+ const s = `${e}_${t.replace(/\(\$\d+_\$\)/g, "")}`;
46883
46897
  let o;
46884
46898
  switch (typeof r == "object" && r?.varipKeys?.length && i !== "varip" && (i = "var", o = r.varipKeys), i) {
46885
46899
  case "var":
@@ -47011,6 +47025,7 @@ ${u}`), u;
47011
47025
  _tmpInstance;
47012
47026
  _type;
47013
47027
  _tmpIds = [];
47028
+ _deleteKeys = [];
47014
47029
  constructor(e, t, r = 50) {
47015
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;
47016
47031
  }
@@ -47118,6 +47133,8 @@ ${u}`), u;
47118
47133
  this._variables._isRealTimeBar ? (this._tmpData.set(e, t), this._tmpInstance.set(e, r)) : (this._all.set(e, t), this._allInstance.set(e, r));
47119
47134
  }
47120
47135
  get(e) {
47136
+ if (this._deleteKeys.includes(e))
47137
+ return;
47121
47138
  const t = this._all.get(e);
47122
47139
  let r = this._tmpData.get(e);
47123
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);
@@ -47153,7 +47170,7 @@ ${u}`), u;
47153
47170
  s.push({
47154
47171
  key: e,
47155
47172
  id: i?.id || r
47156
- }), this._deleteIds.set(t, s);
47173
+ }), this._deleteKeys.push(e), this._deleteIds.set(t, s);
47157
47174
  }
47158
47175
  }
47159
47176
  _tmpDataHandle() {
@@ -47162,7 +47179,7 @@ ${u}`), u;
47162
47179
  const t = this._tmpData.get(e)?.id;
47163
47180
  t && this._tmpIds.push({ id: t, key: e });
47164
47181
  }
47165
- this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear();
47182
+ this._tmpData.clear(), this._tmpInstance.clear(), this._deleteIds.clear(), this._deleteKeys = [];
47166
47183
  }
47167
47184
  }
47168
47185
  async function rT(n, e, t) {
@@ -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-DXmuwBvo.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-DGNOKwGq.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,