@guihz/trading-vue-editor-tes 0.1.9 → 0.1.11
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/lib/assets/{parserTccWorker-BK-BIMe9.js → parserTccWorker-DKPoUI3S.js} +50 -40
- package/lib/assets/{scriptsRunWorker-D_5gdYgS.js → scriptsRunWorker-CT8EnATn.js} +243 -241
- package/lib/components/editor/v5/parseScript/constants.d.ts +2 -0
- package/lib/trading-vue-editor.es.packages.js +2 -2
- package/lib/trading-vue-editor.umd.packages.mjs +24 -24
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
var Yd = (n, e) => () => (e || n((e = { exports: {} }).exports, e), e.exports);
|
2
|
-
var
|
2
|
+
var Cg = Yd((GE, q2) => {
|
3
3
|
/**
|
4
4
|
* @license
|
5
5
|
* Copyright 2019 Google LLC
|
@@ -75039,7 +75039,8 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75039
75039
|
requestLowerTfPeriodErr: "The chart's timeframe must be greater or equal to the `$period` timeframe used with `request.security_lower_tf()`.",
|
75040
75040
|
optionsRepeatErr: "options have to be unique, but there is at least one duplicate in options. Duplicated values: $option",
|
75041
75041
|
scriptLongTimeErr: "Script execution takes too long, the limit is 40 seconds",
|
75042
|
-
plotFillForceOverlayErr: "Cannot call `fill()` with two plots that may not show in the same pane. Both plots must have the same `force_overlay` value."
|
75042
|
+
plotFillForceOverlayErr: "Cannot call `fill()` with two plots that may not show in the same pane. Both plots must have the same `force_overlay` value.",
|
75043
|
+
constModifyErr: "A variable declared with the `const` type form cannot be modified"
|
75043
75044
|
}, vt = {
|
75044
75045
|
repeatVar: "Shadowing variable '$name' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ?",
|
75045
75046
|
typeMismatch: "The `$index` parameter of the `$operator` function accepts a '$type' argument. To avoid potential unexpected results, pass a '$type' value or expression to this parameter.",
|
@@ -75051,7 +75052,15 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75051
75052
|
lineWidthWarning: "Passing a value below 1 to `linewidth` will be replaced with 1 during compilation.",
|
75052
75053
|
boolVarNumWarning: "The `$name` variable casts a numeric value to the 'bool' type. To avoid potential unexpected results, assign a 'bool' value to this variable.",
|
75053
75054
|
transpDeprecatedTips: "The `transp` argument is deprecated. We recommend using color.new() or color.rgb() functions to specify the transparency of the plots instead. Additionally, note that `transp` has no effect in plots where the color is calculated at runtime"
|
75054
|
-
},
|
75055
|
+
}, mg = [
|
75056
|
+
D.LINE,
|
75057
|
+
D.LINEFILL,
|
75058
|
+
D.POLYLINE,
|
75059
|
+
D.CHART_POINT,
|
75060
|
+
D.TABLE,
|
75061
|
+
D.BOX,
|
75062
|
+
D.LABEL
|
75063
|
+
], Ir = [
|
75055
75064
|
D.SERIES,
|
75056
75065
|
D.SIMPLE,
|
75057
75066
|
D.INPUT,
|
@@ -75074,7 +75083,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75074
75083
|
"barcolor",
|
75075
75084
|
"bgcolor",
|
75076
75085
|
"fill"
|
75077
|
-
],
|
75086
|
+
], _g = [
|
75078
75087
|
...HM,
|
75079
75088
|
"indicator",
|
75080
75089
|
"library",
|
@@ -75085,7 +75094,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75085
75094
|
"strategy.risk.max_intraday_filled_orders",
|
75086
75095
|
"strategy.risk.max_intraday_loss",
|
75087
75096
|
"strategy.risk.max_position_size"
|
75088
|
-
],
|
75097
|
+
], qg = [
|
75089
75098
|
...HM,
|
75090
75099
|
"table.new",
|
75091
75100
|
"label.new",
|
@@ -75093,7 +75102,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75093
75102
|
"box.new",
|
75094
75103
|
"polyline.new",
|
75095
75104
|
"linefill.new"
|
75096
|
-
],
|
75105
|
+
], yg = [
|
75097
75106
|
"strategy.entry",
|
75098
75107
|
"strategy.order",
|
75099
75108
|
"strategy.exit",
|
@@ -75120,7 +75129,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75120
75129
|
"hlcc4",
|
75121
75130
|
"ohlc4",
|
75122
75131
|
"volume"
|
75123
|
-
],
|
75132
|
+
], gg = /^\/\/\s*@(description|field|function|param|returns|type|enum|variable)/, Ne = [
|
75124
75133
|
"case",
|
75125
75134
|
"catch",
|
75126
75135
|
"default",
|
@@ -75231,7 +75240,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75231
75240
|
var e = encodeURI(n), t = btoa(e);
|
75232
75241
|
return t;
|
75233
75242
|
}
|
75234
|
-
class
|
75243
|
+
class Eg extends El {
|
75235
75244
|
/**
|
75236
75245
|
* Visit a parse tree produced by `tccScriptParser.program`.
|
75237
75246
|
* @param ctx the parse tree
|
@@ -75661,7 +75670,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75661
75670
|
*/
|
75662
75671
|
visitEnumElement;
|
75663
75672
|
}
|
75664
|
-
class
|
75673
|
+
class Rg extends Eg {
|
75665
75674
|
_buildinVariables;
|
75666
75675
|
_buildinTypes;
|
75667
75676
|
_buildinConstants;
|
@@ -75847,7 +75856,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
75847
75856
|
return t = this._removePrefix(t), this._isMapType(t) || this._isMatrixType(t) ? t : this._isArrayType(t) ? this._arrayTypeConvert(t) : (t = e.startsWith(D.SERIES) ? e.replace("<type>", t) : e.replace("type", t), r || (t = this._removePrefix(t)), this._arrayTypeConvert(t));
|
75848
75857
|
}
|
75849
75858
|
}
|
75850
|
-
class dh extends
|
75859
|
+
class dh extends Rg {
|
75851
75860
|
_loopCount;
|
75852
75861
|
_errors;
|
75853
75862
|
_variables;
|
@@ -76075,6 +76084,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
76075
76084
|
const c = this._currentBlockVars[0].get(r);
|
76076
76085
|
if (!c)
|
76077
76086
|
return;
|
76087
|
+
c?.prefix === D.CONST && this._errorHandle(O0.constModifyErr, t);
|
76078
76088
|
const { column: b, lineNumber: O } = c.pos || {};
|
76079
76089
|
this._isInFunc && b === i.column && O === i.lineNumber ? this._errorHandle(d0(O0.modifyGlobalVarErr, { name: r }), t) : c.hasAssigned = !0;
|
76080
76090
|
}
|
@@ -76238,7 +76248,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
76238
76248
|
_commentsParser = (e, t, r = !1) => {
|
76239
76249
|
const i = this._comments.filter((O) => O.line < e && O.line >= this._currentLine), o = {}, c = { line: 0, key: "", secKey: "" }, b = [Me.field, Me.param];
|
76240
76250
|
for (const O of i) {
|
76241
|
-
const [m, y] =
|
76251
|
+
const [m, y] = gg.exec(O.text) || [];
|
76242
76252
|
if (y && t.includes(y)) {
|
76243
76253
|
const q = O.text.replace(m, "").trim();
|
76244
76254
|
if (Object.assign(c, { line: O.line, key: y }), b.includes(y)) {
|
@@ -77005,7 +77015,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
77005
77015
|
}
|
77006
77016
|
}
|
77007
77017
|
const O = r.join("");
|
77008
|
-
return
|
77018
|
+
return qg.includes(O) ? this._hasDrawFunc = !0 : yg.includes(O) && (this._hasCreateOrderFunc = !0), [O, i, c, b];
|
77009
77019
|
};
|
77010
77020
|
visitArrowFunction = (e) => {
|
77011
77021
|
const { children: t, start: r, stop: i } = e, o = {
|
@@ -77775,12 +77785,12 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
77775
77785
|
const o = i?.type || i?.returnedTypes?.[0];
|
77776
77786
|
(i?.types?.isBrackethesized || i?.returnedTypes?.isBrackethesized || i?.types?.length > 1) && this._errorHandle(d0(O0.tupleLeftVarErr, {
|
77777
77787
|
name: r.name
|
77778
|
-
}), t), !r.type && o === `${D.SIMPLE} ${D.NA}` && this._errorHandle(O0.naVarErr, t), r.prefix && Ir.indexOf(r.prefix) > Ir.indexOf(this._getPrefix(o)) && this._errorHandle(d0(O0.declaredErr, {
|
77788
|
+
}), t), !r.type && o === `${D.SIMPLE} ${D.NA}` && this._errorHandle(O0.naVarErr, t), r.prefix && !mg.includes(this._removePrefix(o)) && Ir.indexOf(r.prefix) > Ir.indexOf(this._getPrefix(o)) && this._errorHandle(d0(O0.declaredErr, {
|
77779
77789
|
prefix: r.prefix,
|
77780
77790
|
type: o
|
77781
77791
|
}), t);
|
77782
77792
|
const c = this._varTypeJudge(r.type, o || D.UNDETERMINED, r.name, t);
|
77783
|
-
r.type = c, this._addVarToMap(r.name, c, r.pos, !0, r.isForVar, r.declare, i?.type, r.desc);
|
77793
|
+
r.type = c, this._addVarToMap(r.name, c, r.pos, !0, r.isForVar, r.declare, i?.type, r.desc, r.prefix);
|
77784
77794
|
}
|
77785
77795
|
}
|
77786
77796
|
_checkVarMultiple(e, t, r) {
|
@@ -77803,21 +77813,22 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
77803
77813
|
};
|
77804
77814
|
i.set(e, c), this._currentBlockVars[this._blockCount] = i;
|
77805
77815
|
}
|
77806
|
-
_addVarToMap(e, t, r, i = !0, o = !1, c, b, O) {
|
77807
|
-
const
|
77808
|
-
if (
|
77809
|
-
for (const
|
77810
|
-
const
|
77811
|
-
|
77816
|
+
_addVarToMap(e, t, r, i = !0, o = !1, c, b, O, m) {
|
77817
|
+
const y = this._currentBlockVars[this._blockCount] || /* @__PURE__ */ new Map(), q = this._types.get(t)?.[0];
|
77818
|
+
if (q && q.fields)
|
77819
|
+
for (const N of q.fields) {
|
77820
|
+
const S = `${e}.${N.name}`;
|
77821
|
+
y.set(S, { ...N, name: S });
|
77812
77822
|
}
|
77813
|
-
const
|
77823
|
+
const v = {
|
77814
77824
|
name: e,
|
77815
77825
|
type: t,
|
77816
77826
|
pos: r,
|
77817
77827
|
valueType: b,
|
77818
|
-
desc: O
|
77828
|
+
desc: O,
|
77829
|
+
prefix: m
|
77819
77830
|
};
|
77820
|
-
i && this._setVariablesMap(
|
77831
|
+
i && this._setVariablesMap(v), y.set(e, Object.assign(v, { isForVar: o, declare: c })), this._currentBlockVars[this._blockCount] = y;
|
77821
77832
|
}
|
77822
77833
|
_setVariablesMap(e, t = !1) {
|
77823
77834
|
const r = this._blockRanges[this._blockCount];
|
@@ -78039,7 +78050,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
78039
78050
|
}), t[0]), r;
|
78040
78051
|
}
|
78041
78052
|
_globalFuncVerify(e, t) {
|
78042
|
-
this._blockCount !== 0 &&
|
78053
|
+
this._blockCount !== 0 && _g.includes(e.name) && this._errorHandle(d0(O0.globalFuncErr, {
|
78043
78054
|
name: e.name
|
78044
78055
|
}), t);
|
78045
78056
|
}
|
@@ -78761,7 +78772,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
78761
78772
|
return [D.UNDETERMINED];
|
78762
78773
|
}
|
78763
78774
|
}
|
78764
|
-
class
|
78775
|
+
class Wg {
|
78765
78776
|
_nameMap;
|
78766
78777
|
_argChangeMap;
|
78767
78778
|
// 用户自定义方法传入参数会改变的参数索引
|
@@ -79608,7 +79619,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
79608
79619
|
})()`;
|
79609
79620
|
}
|
79610
79621
|
}
|
79611
|
-
class
|
79622
|
+
class vg {
|
79612
79623
|
_nameMap;
|
79613
79624
|
_prefixNameVar;
|
79614
79625
|
_prefixNameFunc;
|
@@ -80423,7 +80434,7 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
80423
80434
|
t.removeErrorListeners();
|
80424
80435
|
const r = new Al(t), i = new T(r);
|
80425
80436
|
i._interp.predictionMode = vl.SLL, i.removeErrorListeners();
|
80426
|
-
const o = new
|
80437
|
+
const o = new Sg();
|
80427
80438
|
t.addErrorListener(o), i.addErrorListener(o), i.buildParseTrees = !0;
|
80428
80439
|
const c = i.program(), b = r.tokens.filter((O) => O.channel === 2);
|
80429
80440
|
return {
|
@@ -80432,16 +80443,15 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
80432
80443
|
comments: b
|
80433
80444
|
};
|
80434
80445
|
}
|
80435
|
-
async function
|
80446
|
+
async function Tg(n, e, t, r) {
|
80436
80447
|
const { errors: i, ast: o, comments: c } = Ah(n + `
|
80437
80448
|
|
80438
80449
|
`), b = new dh(r, c, t), O = await b.visit(o);
|
80439
80450
|
let m = i.splice(0, 1);
|
80440
80451
|
m.length || (m = b.errors);
|
80441
80452
|
let y = "";
|
80442
|
-
const q = new
|
80453
|
+
const q = new Wg("_$");
|
80443
80454
|
let v = e ? "" : q.preParser(O);
|
80444
|
-
console.log(v);
|
80445
80455
|
const N = {};
|
80446
80456
|
if (e && !m.some((S) => S.type === Pe.Error)) {
|
80447
80457
|
const { code: S = "", hasLeftVisibleBarTime: _, hasRightVisibleBarTime: z } = q.parser(O) || {};
|
@@ -80507,17 +80517,17 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
80507
80517
|
config: N
|
80508
80518
|
};
|
80509
80519
|
}
|
80510
|
-
async function
|
80520
|
+
async function Lg(n, e, t, r) {
|
80511
80521
|
const { ast: i, comments: o } = Ah(n + `
|
80512
80522
|
|
80513
|
-
`), c = new dh(r, o, t), b = await c.visit(i), { name: O, index: m } = c.endExport, y = b.findIndex((_) => _.name === O && _.index === m), q = b.slice(0, y + 1), N = new
|
80523
|
+
`), c = new dh(r, o, t), b = await c.visit(i), { name: O, index: m } = c.endExport, y = b.findIndex((_) => _.name === O && _.index === m), q = b.slice(0, y + 1), N = new vg("$", e).parser(q) || "", S = await Ep(N, { compress: !0, mangle: !0 });
|
80514
80524
|
return {
|
80515
80525
|
...c.exportLibs,
|
80516
80526
|
description: c.description,
|
80517
80527
|
codeStr: S.code || ""
|
80518
80528
|
};
|
80519
80529
|
}
|
80520
|
-
class
|
80530
|
+
class Sg extends ml {
|
80521
80531
|
errors = [];
|
80522
80532
|
syntaxError(e, t, r, i, o) {
|
80523
80533
|
this.errors.push({
|
@@ -80530,15 +80540,15 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
|
|
80530
80540
|
});
|
80531
80541
|
}
|
80532
80542
|
}
|
80533
|
-
async function
|
80534
|
-
return i === 3 ? (console.log("parseTccV3"), Oy(n, e, r)) : i === 4 ? (console.log("parseTccV4"), Yy(n, e, r)) : (console.log("parseTccV5"),
|
80543
|
+
async function Ng(n, e, t, r, i) {
|
80544
|
+
return i === 3 ? (console.log("parseTccV3"), Oy(n, e, r)) : i === 4 ? (console.log("parseTccV4"), Yy(n, e, r)) : (console.log("parseTccV5"), Tg(n, e, t, r));
|
80535
80545
|
}
|
80536
|
-
async function
|
80537
|
-
return
|
80546
|
+
async function xg(n, e, t, r) {
|
80547
|
+
return Lg(n, e, t, r);
|
80538
80548
|
}
|
80539
80549
|
hl({
|
80540
|
-
parseTcc:
|
80541
|
-
parseLibraryCode:
|
80550
|
+
parseTcc: Ng,
|
80551
|
+
parseLibraryCode: xg
|
80542
80552
|
});
|
80543
80553
|
});
|
80544
|
-
export default
|
80554
|
+
export default Cg();
|