x-block-lib 0.6.44 → 0.6.46
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 +65 -55
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3805,7 +3805,9 @@ const Vf = {
|
|
|
3805
3805
|
console.assert(!1);
|
|
3806
3806
|
return;
|
|
3807
3807
|
}
|
|
3808
|
-
this.func.id = t.id, this.func.inputs = t.inputs, this.func.outputs = t.outputs
|
|
3808
|
+
this.func.id = t.id, this.func.inputs = t.inputs, this.func.outputs = t.outputs, this.updateShape_(), this.updateCheck_(), this.updateShadow_(), setTimeout(() => {
|
|
3809
|
+
this.rebuildBlocks_(), this.checkWarning_();
|
|
3810
|
+
}, 0);
|
|
3809
3811
|
},
|
|
3810
3812
|
updateShape_: function() {
|
|
3811
3813
|
var e, t, n, o;
|
|
@@ -3825,8 +3827,8 @@ const Vf = {
|
|
|
3825
3827
|
s && s.dispose(), this.removeInput("INPUT" + i);
|
|
3826
3828
|
}
|
|
3827
3829
|
for (let i = 0; i < this.func.inputs.length; i++) {
|
|
3828
|
-
const { name: s } = this.func.inputs[i];
|
|
3829
|
-
this.
|
|
3830
|
+
const { name: s } = this.func.inputs[i], a = this.getInput("INPUT" + i);
|
|
3831
|
+
a ? (this.setFieldValue(s, "NAME" + i), a.setCheck(null)) : (this.appendValueInput("INPUT" + i).setAlign(te.Align.RIGHT).appendField(s, "NAME" + i).setCheck(null), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + i, "OUTPUT0") : this.moveInputBefore("INPUT" + i, "CALLBACK"));
|
|
3830
3832
|
}
|
|
3831
3833
|
},
|
|
3832
3834
|
updateCheck_: function() {
|
|
@@ -3901,13 +3903,19 @@ r.forBlock.call_func_v1 = function(e) {
|
|
|
3901
3903
|
const c = n(o.space.name + "/" + o.func.name);
|
|
3902
3904
|
let l = "";
|
|
3903
3905
|
o.func.outputs.forEach(({ id: h }) => {
|
|
3904
|
-
l += `${t}var __output_${h}__ =
|
|
3906
|
+
l += `${t}var __output_${h}__ = __result__[${n(h)}];
|
|
3905
3907
|
`;
|
|
3906
3908
|
});
|
|
3907
3909
|
const _ = r.statementToCode(o, "CALLBACK");
|
|
3908
3910
|
return `{
|
|
3909
3911
|
${a}
|
|
3910
|
-
|
|
3912
|
+
${t}var __result__ = __callFuncV1__(
|
|
3913
|
+
${t}${t}${i},
|
|
3914
|
+
${t}${t}${s},
|
|
3915
|
+
${t}${t}__inputs__,
|
|
3916
|
+
${t}${t}__getEnvV1__(),
|
|
3917
|
+
${t}${t}${c}
|
|
3918
|
+
${t});
|
|
3911
3919
|
${l}${_}}
|
|
3912
3920
|
`;
|
|
3913
3921
|
};
|
|
@@ -3989,7 +3997,9 @@ const Ff = {
|
|
|
3989
3997
|
console.assert(!1);
|
|
3990
3998
|
return;
|
|
3991
3999
|
}
|
|
3992
|
-
this.func.id = t.id, this.func.inputs = t.inputs, this.func.outputs = t.outputs
|
|
4000
|
+
this.func.id = t.id, this.func.inputs = t.inputs, this.func.outputs = t.outputs, this.updateShape_(), this.updateCheck_(), this.updateShadow_(), setTimeout(() => {
|
|
4001
|
+
this.rebuildBlocks_(), this.checkWarning_();
|
|
4002
|
+
}, 0);
|
|
3993
4003
|
},
|
|
3994
4004
|
updateShape_: function() {
|
|
3995
4005
|
var e, t, n, o;
|
|
@@ -4009,8 +4019,8 @@ const Ff = {
|
|
|
4009
4019
|
s && s.dispose(), this.removeInput("INPUT" + i);
|
|
4010
4020
|
}
|
|
4011
4021
|
for (let i = 0; i < this.func.inputs.length; i++) {
|
|
4012
|
-
const { name: s } = this.func.inputs[i];
|
|
4013
|
-
this.
|
|
4022
|
+
const { name: s } = this.func.inputs[i], a = this.getInput("INPUT" + i);
|
|
4023
|
+
a ? (this.setFieldValue(s, "NAME" + i), a.setCheck(null)) : (this.appendValueInput("INPUT" + i).setAlign(te.Align.RIGHT).appendField(s, "NAME" + i).setCheck(null), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + i, "OUTPUT0") : this.moveInputBefore("INPUT" + i, "CALLBACK"));
|
|
4014
4024
|
}
|
|
4015
4025
|
},
|
|
4016
4026
|
updateCheck_: function() {
|
|
@@ -4091,10 +4101,10 @@ r.forBlock.call_func_internal_v1 = function(e) {
|
|
|
4091
4101
|
const _ = r.statementToCode(o, "CALLBACK");
|
|
4092
4102
|
return `{
|
|
4093
4103
|
${a}
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4104
|
+
${t}var __result__ = __callFuncInternalV1__(${i}, ${s}, __inputs__);
|
|
4105
|
+
${t}if (!__result__.success) {
|
|
4106
|
+
${t}${t}throw 'call func<${c}> failed, reason: ' + __result__.message;
|
|
4107
|
+
${t}}
|
|
4098
4108
|
${l}${_}}
|
|
4099
4109
|
`;
|
|
4100
4110
|
};
|
|
@@ -4317,22 +4327,21 @@ const $f = {
|
|
|
4317
4327
|
},
|
|
4318
4328
|
rebuildBlocks_: function() {
|
|
4319
4329
|
this.isInsertionMarker() || Ge(this, [
|
|
4320
|
-
["SUCCESS", "
|
|
4321
|
-
["MESSAGE", "
|
|
4322
|
-
["DATA", "
|
|
4330
|
+
["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
|
|
4331
|
+
["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0],
|
|
4332
|
+
["DATA", "__result__.data", "PARAM_DATA", !0]
|
|
4323
4333
|
]);
|
|
4324
4334
|
}
|
|
4325
4335
|
};
|
|
4326
4336
|
k.add_data_v1 = $f;
|
|
4327
4337
|
r.forBlock.add_data_v1 = function(e) {
|
|
4328
|
-
const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null",
|
|
4338
|
+
const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.statementToCode(e, "HANDLE");
|
|
4329
4339
|
return `{
|
|
4330
|
-
${t}var
|
|
4331
|
-
${t}
|
|
4332
|
-
${t}
|
|
4333
|
-
${t}
|
|
4334
|
-
${
|
|
4335
|
-
${o}}
|
|
4340
|
+
${t}var __result__ = __addDataV1__(
|
|
4341
|
+
${t}${t}${n},
|
|
4342
|
+
${t}${t}${o}
|
|
4343
|
+
${t});
|
|
4344
|
+
${i}}
|
|
4336
4345
|
`;
|
|
4337
4346
|
};
|
|
4338
4347
|
function kn() {
|
|
@@ -4631,20 +4640,21 @@ const zf = {
|
|
|
4631
4640
|
},
|
|
4632
4641
|
rebuildBlocks_: function() {
|
|
4633
4642
|
this.isInsertionMarker() || Ge(this, [
|
|
4634
|
-
["SUCCESS", "
|
|
4635
|
-
["MESSAGE", "
|
|
4643
|
+
["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
|
|
4644
|
+
["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0]
|
|
4636
4645
|
]);
|
|
4637
4646
|
}
|
|
4638
4647
|
};
|
|
4639
4648
|
k.delete_data_v1 = zf;
|
|
4640
4649
|
r.forBlock.delete_data_v1 = function(e) {
|
|
4641
|
-
const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null",
|
|
4650
|
+
const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null", s = r.statementToCode(e, "HANDLE");
|
|
4642
4651
|
return `{
|
|
4643
|
-
${t}var
|
|
4644
|
-
${t}
|
|
4645
|
-
${t}
|
|
4646
|
-
${t}
|
|
4647
|
-
${
|
|
4652
|
+
${t}var __result__ = __deleteDataV1__(
|
|
4653
|
+
${t}${t}${n},
|
|
4654
|
+
${t}${t}${o},
|
|
4655
|
+
${t}${t}${i}
|
|
4656
|
+
${t});
|
|
4657
|
+
${s}}
|
|
4648
4658
|
`;
|
|
4649
4659
|
};
|
|
4650
4660
|
C([
|
|
@@ -4690,27 +4700,27 @@ const Jf = {
|
|
|
4690
4700
|
},
|
|
4691
4701
|
rebuildBlocks_: function() {
|
|
4692
4702
|
this.isInsertionMarker() || Ge(this, [
|
|
4693
|
-
["SUCCESS", "
|
|
4694
|
-
["MESSAGE", "
|
|
4695
|
-
["MAIN_DATA", "
|
|
4696
|
-
["EXTRA_DATA", "
|
|
4703
|
+
["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
|
|
4704
|
+
["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0],
|
|
4705
|
+
["MAIN_DATA", "__result__.mainData", "PARAM_MAIN_DATA", !0],
|
|
4706
|
+
["EXTRA_DATA", "__result__.extraData", "PARAM_EXTRA_DATA", !0]
|
|
4697
4707
|
]);
|
|
4698
4708
|
}
|
|
4699
4709
|
};
|
|
4700
4710
|
k.query_data_v1 = Jf;
|
|
4701
4711
|
r.forBlock.query_data_v1 = function(e) {
|
|
4702
|
-
const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null",
|
|
4703
|
-
let
|
|
4704
|
-
e.getInput("EXTRA") && (
|
|
4705
|
-
const
|
|
4712
|
+
const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null";
|
|
4713
|
+
let s = "null";
|
|
4714
|
+
e.getInput("EXTRA") && (s = r.valueToCode(e, "EXTRA", u.ATOMIC) || "null");
|
|
4715
|
+
const a = r.statementToCode(e, "HANDLE");
|
|
4706
4716
|
return `{
|
|
4707
|
-
${t}var
|
|
4708
|
-
${t}
|
|
4709
|
-
${t}
|
|
4710
|
-
${t}
|
|
4711
|
-
${t}
|
|
4712
|
-
${t}
|
|
4713
|
-
${
|
|
4717
|
+
${t}var __result__ = __queryDataV1__(
|
|
4718
|
+
${t}${t}${n},
|
|
4719
|
+
${t}${t}${o},
|
|
4720
|
+
${t}${t}${i},
|
|
4721
|
+
${t}${t}${s}
|
|
4722
|
+
${t});
|
|
4723
|
+
${a}}
|
|
4714
4724
|
`;
|
|
4715
4725
|
};
|
|
4716
4726
|
C([
|
|
@@ -5312,22 +5322,22 @@ const im = {
|
|
|
5312
5322
|
},
|
|
5313
5323
|
rebuildBlocks_: function() {
|
|
5314
5324
|
this.isInsertionMarker() || Ge(this, [
|
|
5315
|
-
["SUCCESS", "
|
|
5316
|
-
["MESSAGE", "
|
|
5317
|
-
["DATA", "
|
|
5325
|
+
["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
|
|
5326
|
+
["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0],
|
|
5327
|
+
["DATA", "__result__.data", "PARAM_DATA", !0]
|
|
5318
5328
|
]);
|
|
5319
5329
|
}
|
|
5320
5330
|
};
|
|
5321
5331
|
k.update_data_v1 = im;
|
|
5322
5332
|
r.forBlock.update_data_v1 = function(e) {
|
|
5323
|
-
const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null",
|
|
5333
|
+
const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null", s = r.statementToCode(e, "HANDLE");
|
|
5324
5334
|
return `{
|
|
5325
|
-
${t}var
|
|
5326
|
-
${t}
|
|
5327
|
-
${t}
|
|
5328
|
-
${t}
|
|
5329
|
-
${t}
|
|
5330
|
-
${
|
|
5335
|
+
${t}var __result__ = __updateDataV1__(
|
|
5336
|
+
${t}${t}${n},
|
|
5337
|
+
${t}${t}${o},
|
|
5338
|
+
${t}${t}${i}
|
|
5339
|
+
${t});
|
|
5340
|
+
${s}}
|
|
5331
5341
|
`;
|
|
5332
5342
|
};
|
|
5333
5343
|
const sm = G.xml, am = {
|