@player-ui/markdown-plugin 0.11.1 → 0.11.2--canary.649.23032
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.
|
@@ -1405,6 +1405,22 @@ var MarkdownPlugin = function() {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
});
|
|
1407
1407
|
};
|
|
1408
|
+
var unpackNode = function unpackNode(item) {
|
|
1409
|
+
var _item_children_, _item_children, _item_children_1, _item_children1;
|
|
1410
|
+
var unpacked = [];
|
|
1411
|
+
if ("children" in item && ((_item_children = item.children) === null || _item_children === void 0 ? void 0 : (_item_children_ = _item_children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.value.type) === "asset" && ((_item_children1 = item.children) === null || _item_children1 === void 0 ? void 0 : (_item_children_1 = _item_children1[0]) === null || _item_children_1 === void 0 ? void 0 : _item_children_1.value).children) {
|
|
1412
|
+
var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
|
|
1413
|
+
if (((_item_children__value_children = ((_item_children2 = item.children) === null || _item_children2 === void 0 ? void 0 : (_item_children_2 = _item_children2[0]) === null || _item_children_2 === void 0 ? void 0 : _item_children_2.value).children) === null || _item_children__value_children === void 0 ? void 0 : (_item_children__value_children_ = _item_children__value_children[0]) === null || _item_children__value_children_ === void 0 ? void 0 : _item_children__value_children_.value.type) === "multi-node") {
|
|
1414
|
+
var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
|
|
1415
|
+
((_item_children__value_children1 = ((_item_children3 = item.children) === null || _item_children3 === void 0 ? void 0 : (_item_children_3 = _item_children3[0]) === null || _item_children_3 === void 0 ? void 0 : _item_children_3.value).children) === null || _item_children__value_children1 === void 0 ? void 0 : (_item_children__value_children_1 = _item_children__value_children1[0]) === null || _item_children__value_children_1 === void 0 ? void 0 : _item_children__value_children_1.value).values.forEach(function(value) {
|
|
1416
|
+
unpacked.push(value);
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
} else {
|
|
1420
|
+
unpacked.push(item);
|
|
1421
|
+
}
|
|
1422
|
+
return unpacked;
|
|
1423
|
+
};
|
|
1408
1424
|
var hasSomethingToResolve = function hasSomethingToResolve(str) {
|
|
1409
1425
|
return bindingResolveLookup(str) || expressionResolveLookup(str);
|
|
1410
1426
|
};
|
|
@@ -7815,6 +7831,9 @@ var MarkdownPlugin = function() {
|
|
|
7815
7831
|
},
|
|
7816
7832
|
setDataVal: function() {
|
|
7817
7833
|
return setDataVal;
|
|
7834
|
+
},
|
|
7835
|
+
waitFor: function() {
|
|
7836
|
+
return waitFor;
|
|
7818
7837
|
}
|
|
7819
7838
|
});
|
|
7820
7839
|
var setDataVal = function(_context, binding, value) {
|
|
@@ -7842,6 +7861,27 @@ var MarkdownPlugin = function() {
|
|
|
7842
7861
|
return null;
|
|
7843
7862
|
};
|
|
7844
7863
|
conditional.resolveParams = false;
|
|
7864
|
+
var waitFor = function() {
|
|
7865
|
+
var _ref = _async_to_generator(function(ctx, promise) {
|
|
7866
|
+
return _ts_generator(this, function(_state) {
|
|
7867
|
+
switch(_state.label){
|
|
7868
|
+
case 0:
|
|
7869
|
+
return [
|
|
7870
|
+
4,
|
|
7871
|
+
promise
|
|
7872
|
+
];
|
|
7873
|
+
case 1:
|
|
7874
|
+
return [
|
|
7875
|
+
2,
|
|
7876
|
+
_state.sent()
|
|
7877
|
+
];
|
|
7878
|
+
}
|
|
7879
|
+
});
|
|
7880
|
+
});
|
|
7881
|
+
return function waitFor(ctx, promise) {
|
|
7882
|
+
return _ref.apply(this, arguments);
|
|
7883
|
+
};
|
|
7884
|
+
}();
|
|
7845
7885
|
var andandOperator = function(ctx, a, b) {
|
|
7846
7886
|
return ctx.evaluate(a) && ctx.evaluate(b);
|
|
7847
7887
|
};
|
|
@@ -7947,7 +7987,12 @@ var MarkdownPlugin = function() {
|
|
|
7947
7987
|
this.operators = {
|
|
7948
7988
|
binary: new Map(Object.entries(DEFAULT_BINARY_OPERATORS)),
|
|
7949
7989
|
unary: new Map(Object.entries(DEFAULT_UNARY_OPERATORS)),
|
|
7950
|
-
expressions: new Map(Object.entries(evaluator_functions_exports))
|
|
7990
|
+
expressions: new Map(_to_consumable_array(Object.entries(evaluator_functions_exports)).concat([
|
|
7991
|
+
[
|
|
7992
|
+
"await",
|
|
7993
|
+
waitFor
|
|
7994
|
+
]
|
|
7995
|
+
]))
|
|
7951
7996
|
};
|
|
7952
7997
|
this.defaultHookOptions = _object_spread_props(_object_spread({}, defaultOptions), {
|
|
7953
7998
|
evaluate: function(expr) {
|
|
@@ -7957,7 +8002,12 @@ var MarkdownPlugin = function() {
|
|
|
7957
8002
|
return _this._execAST(node2, _this.defaultHookOptions);
|
|
7958
8003
|
}
|
|
7959
8004
|
});
|
|
7960
|
-
this.hooks.resolve.tap("ExpressionEvaluator",
|
|
8005
|
+
this.hooks.resolve.tap("ExpressionEvaluator", function(result, node2, options) {
|
|
8006
|
+
if (options.async) {
|
|
8007
|
+
return _this._resolveNodeAsync(result, node2, options);
|
|
8008
|
+
}
|
|
8009
|
+
return _this._resolveNode(result, node2, options);
|
|
8010
|
+
});
|
|
7961
8011
|
this.evaluate = this.evaluate.bind(this);
|
|
7962
8012
|
}
|
|
7963
8013
|
_create_class(ExpressionEvaluator, [
|
|
@@ -7995,6 +8045,14 @@ var MarkdownPlugin = function() {
|
|
|
7995
8045
|
return this._execString(String(expression), resolvedOpts);
|
|
7996
8046
|
}
|
|
7997
8047
|
},
|
|
8048
|
+
{
|
|
8049
|
+
key: "evaluateAsync",
|
|
8050
|
+
value: function evaluateAsync(expr, options) {
|
|
8051
|
+
return this.evaluate(expr, _object_spread_props(_object_spread({}, options), {
|
|
8052
|
+
async: true
|
|
8053
|
+
}));
|
|
8054
|
+
}
|
|
8055
|
+
},
|
|
7998
8056
|
{
|
|
7999
8057
|
key: "addExpressionFunction",
|
|
8000
8058
|
value: function addExpressionFunction(name, handler) {
|
|
@@ -8040,8 +8098,10 @@ var MarkdownPlugin = function() {
|
|
|
8040
8098
|
var matches = exp.match(/^@\[(.*)\]@$/);
|
|
8041
8099
|
var matchedExp = exp;
|
|
8042
8100
|
if (matches) {
|
|
8043
|
-
var
|
|
8044
|
-
|
|
8101
|
+
var _Array_from = _sliced_to_array(Array.from(matches), 2), matched = _Array_from[1];
|
|
8102
|
+
if (matched) {
|
|
8103
|
+
matchedExp = matched;
|
|
8104
|
+
}
|
|
8045
8105
|
}
|
|
8046
8106
|
var storedAST;
|
|
8047
8107
|
try {
|
|
@@ -8202,6 +8262,452 @@ var MarkdownPlugin = function() {
|
|
|
8202
8262
|
return resolveNode(node2.left);
|
|
8203
8263
|
}
|
|
8204
8264
|
}
|
|
8265
|
+
},
|
|
8266
|
+
{
|
|
8267
|
+
key: "_resolveNodeAsync",
|
|
8268
|
+
value: function _resolveNodeAsync(_currentValue, node2, options) {
|
|
8269
|
+
var _this = this;
|
|
8270
|
+
return _async_to_generator(function() {
|
|
8271
|
+
var resolveNode, model, expressionContext, operator, _tmp, _tmp1, operator1, _tmp2, _tmp3, attributes, resolvedAttributes, expressionName, operator2, args, obj, prop, value, value1, result, operation, newValue, _tmp4, _tmp5;
|
|
8272
|
+
return _ts_generator(this, function(_state) {
|
|
8273
|
+
switch(_state.label){
|
|
8274
|
+
case 0:
|
|
8275
|
+
resolveNode = options.resolveNode, model = options.model;
|
|
8276
|
+
expressionContext = _object_spread_props(_object_spread({}, options), {
|
|
8277
|
+
evaluate: function(expr) {
|
|
8278
|
+
return _this.evaluate(expr, options);
|
|
8279
|
+
}
|
|
8280
|
+
});
|
|
8281
|
+
if (!(node2.type === "BinaryExpression" || node2.type === "LogicalExpression")) return [
|
|
8282
|
+
3,
|
|
8283
|
+
7
|
|
8284
|
+
];
|
|
8285
|
+
operator = _this.operators.binary.get(node2.operator);
|
|
8286
|
+
if (!operator) return [
|
|
8287
|
+
3,
|
|
8288
|
+
6
|
|
8289
|
+
];
|
|
8290
|
+
if (!("resolveParams" in operator)) return [
|
|
8291
|
+
3,
|
|
8292
|
+
3
|
|
8293
|
+
];
|
|
8294
|
+
if (operator.resolveParams === false) {
|
|
8295
|
+
return [
|
|
8296
|
+
2,
|
|
8297
|
+
operator(expressionContext, node2.left, node2.right)
|
|
8298
|
+
];
|
|
8299
|
+
}
|
|
8300
|
+
_tmp = [
|
|
8301
|
+
expressionContext
|
|
8302
|
+
];
|
|
8303
|
+
return [
|
|
8304
|
+
4,
|
|
8305
|
+
resolveNode(node2.left)
|
|
8306
|
+
];
|
|
8307
|
+
case 1:
|
|
8308
|
+
_tmp = _tmp.concat([
|
|
8309
|
+
_state.sent()
|
|
8310
|
+
]);
|
|
8311
|
+
return [
|
|
8312
|
+
4,
|
|
8313
|
+
resolveNode(node2.right)
|
|
8314
|
+
];
|
|
8315
|
+
case 2:
|
|
8316
|
+
return [
|
|
8317
|
+
2,
|
|
8318
|
+
operator.apply(void 0, _tmp.concat([
|
|
8319
|
+
_state.sent()
|
|
8320
|
+
]))
|
|
8321
|
+
];
|
|
8322
|
+
case 3:
|
|
8323
|
+
return [
|
|
8324
|
+
4,
|
|
8325
|
+
resolveNode(node2.left)
|
|
8326
|
+
];
|
|
8327
|
+
case 4:
|
|
8328
|
+
_tmp1 = [
|
|
8329
|
+
_state.sent()
|
|
8330
|
+
];
|
|
8331
|
+
return [
|
|
8332
|
+
4,
|
|
8333
|
+
resolveNode(node2.right)
|
|
8334
|
+
];
|
|
8335
|
+
case 5:
|
|
8336
|
+
return [
|
|
8337
|
+
2,
|
|
8338
|
+
operator.apply(void 0, _tmp1.concat([
|
|
8339
|
+
_state.sent()
|
|
8340
|
+
]))
|
|
8341
|
+
];
|
|
8342
|
+
case 6:
|
|
8343
|
+
return [
|
|
8344
|
+
2
|
|
8345
|
+
];
|
|
8346
|
+
case 7:
|
|
8347
|
+
if (!(node2.type === "UnaryExpression")) return [
|
|
8348
|
+
3,
|
|
8349
|
+
14
|
|
8350
|
+
];
|
|
8351
|
+
operator1 = _this.operators.unary.get(node2.operator);
|
|
8352
|
+
if (!operator1) return [
|
|
8353
|
+
3,
|
|
8354
|
+
13
|
|
8355
|
+
];
|
|
8356
|
+
if (!("resolveParams" in operator1)) return [
|
|
8357
|
+
3,
|
|
8358
|
+
11
|
|
8359
|
+
];
|
|
8360
|
+
_tmp2 = [
|
|
8361
|
+
expressionContext
|
|
8362
|
+
];
|
|
8363
|
+
if (!(operator1.resolveParams === false)) return [
|
|
8364
|
+
3,
|
|
8365
|
+
8
|
|
8366
|
+
];
|
|
8367
|
+
_tmp3 = node2.argument;
|
|
8368
|
+
return [
|
|
8369
|
+
3,
|
|
8370
|
+
10
|
|
8371
|
+
];
|
|
8372
|
+
case 8:
|
|
8373
|
+
return [
|
|
8374
|
+
4,
|
|
8375
|
+
resolveNode(node2.argument)
|
|
8376
|
+
];
|
|
8377
|
+
case 9:
|
|
8378
|
+
_tmp3 = _state.sent();
|
|
8379
|
+
_state.label = 10;
|
|
8380
|
+
case 10:
|
|
8381
|
+
return [
|
|
8382
|
+
2,
|
|
8383
|
+
operator1.apply(void 0, _tmp2.concat([
|
|
8384
|
+
_tmp3
|
|
8385
|
+
]))
|
|
8386
|
+
];
|
|
8387
|
+
case 11:
|
|
8388
|
+
return [
|
|
8389
|
+
4,
|
|
8390
|
+
resolveNode(node2.argument)
|
|
8391
|
+
];
|
|
8392
|
+
case 12:
|
|
8393
|
+
return [
|
|
8394
|
+
2,
|
|
8395
|
+
operator1.apply(void 0, [
|
|
8396
|
+
_state.sent()
|
|
8397
|
+
])
|
|
8398
|
+
];
|
|
8399
|
+
case 13:
|
|
8400
|
+
return [
|
|
8401
|
+
2
|
|
8402
|
+
];
|
|
8403
|
+
case 14:
|
|
8404
|
+
if (!(node2.type === "Object")) return [
|
|
8405
|
+
3,
|
|
8406
|
+
16
|
|
8407
|
+
];
|
|
8408
|
+
attributes = node2.attributes;
|
|
8409
|
+
resolvedAttributes = {};
|
|
8410
|
+
return [
|
|
8411
|
+
4,
|
|
8412
|
+
Promise.all(attributes.map(function() {
|
|
8413
|
+
var _ref = _async_to_generator(function(attr) {
|
|
8414
|
+
var key, value;
|
|
8415
|
+
return _ts_generator(this, function(_state) {
|
|
8416
|
+
switch(_state.label){
|
|
8417
|
+
case 0:
|
|
8418
|
+
return [
|
|
8419
|
+
4,
|
|
8420
|
+
resolveNode(attr.key)
|
|
8421
|
+
];
|
|
8422
|
+
case 1:
|
|
8423
|
+
key = _state.sent();
|
|
8424
|
+
return [
|
|
8425
|
+
4,
|
|
8426
|
+
resolveNode(attr.value)
|
|
8427
|
+
];
|
|
8428
|
+
case 2:
|
|
8429
|
+
value = _state.sent();
|
|
8430
|
+
resolvedAttributes[key] = value;
|
|
8431
|
+
return [
|
|
8432
|
+
2
|
|
8433
|
+
];
|
|
8434
|
+
}
|
|
8435
|
+
});
|
|
8436
|
+
});
|
|
8437
|
+
return function(attr) {
|
|
8438
|
+
return _ref.apply(this, arguments);
|
|
8439
|
+
};
|
|
8440
|
+
}()))
|
|
8441
|
+
];
|
|
8442
|
+
case 15:
|
|
8443
|
+
_state.sent();
|
|
8444
|
+
return [
|
|
8445
|
+
2,
|
|
8446
|
+
resolvedAttributes
|
|
8447
|
+
];
|
|
8448
|
+
case 16:
|
|
8449
|
+
if (!(node2.type === "CallExpression")) return [
|
|
8450
|
+
3,
|
|
8451
|
+
18
|
|
8452
|
+
];
|
|
8453
|
+
expressionName = node2.callTarget.name;
|
|
8454
|
+
operator2 = _this.operators.expressions.get(expressionName);
|
|
8455
|
+
if (!operator2) {
|
|
8456
|
+
throw new Error("Unknown expression function: ".concat(expressionName));
|
|
8457
|
+
}
|
|
8458
|
+
if ("resolveParams" in operator2 && operator2.resolveParams === false) {
|
|
8459
|
+
return [
|
|
8460
|
+
2,
|
|
8461
|
+
operator2.apply(void 0, [
|
|
8462
|
+
expressionContext
|
|
8463
|
+
].concat(_to_consumable_array(node2.args)))
|
|
8464
|
+
];
|
|
8465
|
+
}
|
|
8466
|
+
return [
|
|
8467
|
+
4,
|
|
8468
|
+
Promise.all(node2.args.map(function() {
|
|
8469
|
+
var _ref = _async_to_generator(function(n) {
|
|
8470
|
+
return _ts_generator(this, function(_state) {
|
|
8471
|
+
switch(_state.label){
|
|
8472
|
+
case 0:
|
|
8473
|
+
return [
|
|
8474
|
+
4,
|
|
8475
|
+
resolveNode(n)
|
|
8476
|
+
];
|
|
8477
|
+
case 1:
|
|
8478
|
+
return [
|
|
8479
|
+
2,
|
|
8480
|
+
_state.sent()
|
|
8481
|
+
];
|
|
8482
|
+
}
|
|
8483
|
+
});
|
|
8484
|
+
});
|
|
8485
|
+
return function(n) {
|
|
8486
|
+
return _ref.apply(this, arguments);
|
|
8487
|
+
};
|
|
8488
|
+
}()))
|
|
8489
|
+
];
|
|
8490
|
+
case 17:
|
|
8491
|
+
args = _state.sent();
|
|
8492
|
+
return [
|
|
8493
|
+
2,
|
|
8494
|
+
operator2.apply(void 0, [
|
|
8495
|
+
expressionContext
|
|
8496
|
+
].concat(_to_consumable_array(args)))
|
|
8497
|
+
];
|
|
8498
|
+
case 18:
|
|
8499
|
+
if (node2.type === "ModelRef") {
|
|
8500
|
+
return [
|
|
8501
|
+
2,
|
|
8502
|
+
model.get(node2.ref, {
|
|
8503
|
+
context: {
|
|
8504
|
+
model: options.model
|
|
8505
|
+
}
|
|
8506
|
+
})
|
|
8507
|
+
];
|
|
8508
|
+
}
|
|
8509
|
+
if (!(node2.type === "MemberExpression")) return [
|
|
8510
|
+
3,
|
|
8511
|
+
21
|
|
8512
|
+
];
|
|
8513
|
+
return [
|
|
8514
|
+
4,
|
|
8515
|
+
resolveNode(node2.object)
|
|
8516
|
+
];
|
|
8517
|
+
case 19:
|
|
8518
|
+
obj = _state.sent();
|
|
8519
|
+
return [
|
|
8520
|
+
4,
|
|
8521
|
+
resolveNode(node2.property)
|
|
8522
|
+
];
|
|
8523
|
+
case 20:
|
|
8524
|
+
prop = _state.sent();
|
|
8525
|
+
return [
|
|
8526
|
+
2,
|
|
8527
|
+
obj[prop]
|
|
8528
|
+
];
|
|
8529
|
+
case 21:
|
|
8530
|
+
if (!(node2.type === "Assignment")) return [
|
|
8531
|
+
3,
|
|
8532
|
+
26
|
|
8533
|
+
];
|
|
8534
|
+
if (!(node2.left.type === "ModelRef")) return [
|
|
8535
|
+
3,
|
|
8536
|
+
23
|
|
8537
|
+
];
|
|
8538
|
+
return [
|
|
8539
|
+
4,
|
|
8540
|
+
resolveNode(node2.right)
|
|
8541
|
+
];
|
|
8542
|
+
case 22:
|
|
8543
|
+
value = _state.sent();
|
|
8544
|
+
model.set([
|
|
8545
|
+
[
|
|
8546
|
+
node2.left.ref,
|
|
8547
|
+
value
|
|
8548
|
+
]
|
|
8549
|
+
]);
|
|
8550
|
+
return [
|
|
8551
|
+
2,
|
|
8552
|
+
value
|
|
8553
|
+
];
|
|
8554
|
+
case 23:
|
|
8555
|
+
if (!(node2.left.type === "Identifier")) return [
|
|
8556
|
+
3,
|
|
8557
|
+
25
|
|
8558
|
+
];
|
|
8559
|
+
return [
|
|
8560
|
+
4,
|
|
8561
|
+
resolveNode(node2.right)
|
|
8562
|
+
];
|
|
8563
|
+
case 24:
|
|
8564
|
+
value1 = _state.sent();
|
|
8565
|
+
_this.vars[node2.left.name] = value1;
|
|
8566
|
+
return [
|
|
8567
|
+
2,
|
|
8568
|
+
value1
|
|
8569
|
+
];
|
|
8570
|
+
case 25:
|
|
8571
|
+
return [
|
|
8572
|
+
2
|
|
8573
|
+
];
|
|
8574
|
+
case 26:
|
|
8575
|
+
if (!(node2.type === "ConditionalExpression")) return [
|
|
8576
|
+
3,
|
|
8577
|
+
28
|
|
8578
|
+
];
|
|
8579
|
+
return [
|
|
8580
|
+
4,
|
|
8581
|
+
resolveNode(node2.test)
|
|
8582
|
+
];
|
|
8583
|
+
case 27:
|
|
8584
|
+
result = _state.sent() ? node2.consequent : node2.alternate;
|
|
8585
|
+
return [
|
|
8586
|
+
2,
|
|
8587
|
+
resolveNode(result)
|
|
8588
|
+
];
|
|
8589
|
+
case 28:
|
|
8590
|
+
if (node2.type === "ArrayExpression") {
|
|
8591
|
+
return [
|
|
8592
|
+
2,
|
|
8593
|
+
Promise.all(node2.elements.map(function() {
|
|
8594
|
+
var _ref = _async_to_generator(function(ele) {
|
|
8595
|
+
return _ts_generator(this, function(_state) {
|
|
8596
|
+
switch(_state.label){
|
|
8597
|
+
case 0:
|
|
8598
|
+
return [
|
|
8599
|
+
4,
|
|
8600
|
+
resolveNode(ele)
|
|
8601
|
+
];
|
|
8602
|
+
case 1:
|
|
8603
|
+
return [
|
|
8604
|
+
2,
|
|
8605
|
+
_state.sent()
|
|
8606
|
+
];
|
|
8607
|
+
}
|
|
8608
|
+
});
|
|
8609
|
+
});
|
|
8610
|
+
return function(ele) {
|
|
8611
|
+
return _ref.apply(this, arguments);
|
|
8612
|
+
};
|
|
8613
|
+
}()))
|
|
8614
|
+
];
|
|
8615
|
+
}
|
|
8616
|
+
if (!(node2.type === "Modification")) return [
|
|
8617
|
+
3,
|
|
8618
|
+
38
|
|
8619
|
+
];
|
|
8620
|
+
operation = _this.operators.binary.get(node2.operator);
|
|
8621
|
+
if (!operation) return [
|
|
8622
|
+
3,
|
|
8623
|
+
37
|
|
8624
|
+
];
|
|
8625
|
+
if (!("resolveParams" in operation)) return [
|
|
8626
|
+
3,
|
|
8627
|
+
33
|
|
8628
|
+
];
|
|
8629
|
+
if (!(operation.resolveParams === false)) return [
|
|
8630
|
+
3,
|
|
8631
|
+
29
|
|
8632
|
+
];
|
|
8633
|
+
newValue = operation(expressionContext, node2.left, node2.right);
|
|
8634
|
+
return [
|
|
8635
|
+
3,
|
|
8636
|
+
32
|
|
8637
|
+
];
|
|
8638
|
+
case 29:
|
|
8639
|
+
_tmp4 = [
|
|
8640
|
+
expressionContext
|
|
8641
|
+
];
|
|
8642
|
+
return [
|
|
8643
|
+
4,
|
|
8644
|
+
resolveNode(node2.left)
|
|
8645
|
+
];
|
|
8646
|
+
case 30:
|
|
8647
|
+
_tmp4 = _tmp4.concat([
|
|
8648
|
+
_state.sent()
|
|
8649
|
+
]);
|
|
8650
|
+
return [
|
|
8651
|
+
4,
|
|
8652
|
+
resolveNode(node2.right)
|
|
8653
|
+
];
|
|
8654
|
+
case 31:
|
|
8655
|
+
newValue = operation.apply(void 0, _tmp4.concat([
|
|
8656
|
+
_state.sent()
|
|
8657
|
+
]));
|
|
8658
|
+
_state.label = 32;
|
|
8659
|
+
case 32:
|
|
8660
|
+
return [
|
|
8661
|
+
3,
|
|
8662
|
+
36
|
|
8663
|
+
];
|
|
8664
|
+
case 33:
|
|
8665
|
+
return [
|
|
8666
|
+
4,
|
|
8667
|
+
resolveNode(node2.left)
|
|
8668
|
+
];
|
|
8669
|
+
case 34:
|
|
8670
|
+
_tmp5 = [
|
|
8671
|
+
_state.sent()
|
|
8672
|
+
];
|
|
8673
|
+
return [
|
|
8674
|
+
4,
|
|
8675
|
+
resolveNode(node2.right)
|
|
8676
|
+
];
|
|
8677
|
+
case 35:
|
|
8678
|
+
newValue = operation.apply(void 0, _tmp5.concat([
|
|
8679
|
+
_state.sent()
|
|
8680
|
+
]));
|
|
8681
|
+
_state.label = 36;
|
|
8682
|
+
case 36:
|
|
8683
|
+
if (node2.left.type === "ModelRef") {
|
|
8684
|
+
model.set([
|
|
8685
|
+
[
|
|
8686
|
+
node2.left.ref,
|
|
8687
|
+
newValue
|
|
8688
|
+
]
|
|
8689
|
+
]);
|
|
8690
|
+
} else if (node2.left.type === "Identifier") {
|
|
8691
|
+
_this.vars[node2.left.name] = newValue;
|
|
8692
|
+
}
|
|
8693
|
+
return [
|
|
8694
|
+
2,
|
|
8695
|
+
newValue
|
|
8696
|
+
];
|
|
8697
|
+
case 37:
|
|
8698
|
+
return [
|
|
8699
|
+
2,
|
|
8700
|
+
resolveNode(node2.left)
|
|
8701
|
+
];
|
|
8702
|
+
case 38:
|
|
8703
|
+
return [
|
|
8704
|
+
2,
|
|
8705
|
+
_this._resolveNode(_currentValue, node2, options)
|
|
8706
|
+
];
|
|
8707
|
+
}
|
|
8708
|
+
});
|
|
8709
|
+
})();
|
|
8710
|
+
}
|
|
8205
8711
|
}
|
|
8206
8712
|
]);
|
|
8207
8713
|
return ExpressionEvaluator;
|
|
@@ -8727,15 +9233,6 @@ var MarkdownPlugin = function() {
|
|
|
8727
9233
|
]);
|
|
8728
9234
|
return Parser;
|
|
8729
9235
|
}();
|
|
8730
|
-
function unpackAndPush(item, initial) {
|
|
8731
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
8732
|
-
item.asset.values.forEach(function(i) {
|
|
8733
|
-
unpackAndPush(i, initial);
|
|
8734
|
-
});
|
|
8735
|
-
} else {
|
|
8736
|
-
initial.push(item);
|
|
8737
|
-
}
|
|
8738
|
-
}
|
|
8739
9236
|
var withContext = function(model) {
|
|
8740
9237
|
return {
|
|
8741
9238
|
get: function(binding, options) {
|
|
@@ -8858,7 +9355,7 @@ var MarkdownPlugin = function() {
|
|
|
8858
9355
|
key: "computeTree",
|
|
8859
9356
|
value: function computeTree(node2, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
8860
9357
|
var _this = this;
|
|
8861
|
-
var _partiallyResolvedParent_parent;
|
|
9358
|
+
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
8862
9359
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
8863
9360
|
dependencyModel.trackSubset("core");
|
|
8864
9361
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -8884,7 +9381,8 @@ var MarkdownPlugin = function() {
|
|
|
8884
9381
|
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
8885
9382
|
type: "empty"
|
|
8886
9383
|
};
|
|
8887
|
-
var
|
|
9384
|
+
var isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent === void 0 ? void 0 : (_partiallyResolvedParent_parent_parent = _partiallyResolvedParent_parent.parent) === null || _partiallyResolvedParent_parent_parent === void 0 ? void 0 : _partiallyResolvedParent_parent_parent.type) === "multi-node" && partiallyResolvedParent.parent.type === "value" && ((_resolvedAST_parent = resolvedAST.parent) === null || _resolvedAST_parent === void 0 ? void 0 : _resolvedAST_parent.type) === "asset" && resolvedAST.parent.value.id.includes("async");
|
|
9385
|
+
var isNestedMultiNode = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent1 = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent1 === void 0 ? void 0 : _partiallyResolvedParent_parent1.type) === "multi-node" && partiallyResolvedParent.type === "value";
|
|
8888
9386
|
if (previousResult && shouldUseLastValue) {
|
|
8889
9387
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
8890
9388
|
updated: false
|
|
@@ -8918,7 +9416,11 @@ var MarkdownPlugin = function() {
|
|
|
8918
9416
|
repopulateASTMapFromCache(previousResult, node2, rawParent);
|
|
8919
9417
|
return update2;
|
|
8920
9418
|
}
|
|
8921
|
-
|
|
9419
|
+
if (isNestedMultiNodeWithAsync) {
|
|
9420
|
+
resolvedAST.parent = partiallyResolvedParent.parent;
|
|
9421
|
+
} else {
|
|
9422
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
9423
|
+
}
|
|
8922
9424
|
resolveOptions.node = resolvedAST;
|
|
8923
9425
|
this.ASTMap.set(resolvedAST, node2);
|
|
8924
9426
|
var resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
|
|
@@ -8953,6 +9455,11 @@ var MarkdownPlugin = function() {
|
|
|
8953
9455
|
} else if (resolvedAST.type === "multi-node") {
|
|
8954
9456
|
var childValue = [];
|
|
8955
9457
|
var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node2;
|
|
9458
|
+
var hasAsync = resolvedAST.values.map(function(value, index2) {
|
|
9459
|
+
return value.type === "async" ? index2 : -1;
|
|
9460
|
+
}).filter(function(index2) {
|
|
9461
|
+
return index2 !== -1;
|
|
9462
|
+
});
|
|
8956
9463
|
var newValues = resolvedAST.values.map(function(mValue) {
|
|
8957
9464
|
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
8958
9465
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
@@ -8968,7 +9475,19 @@ var MarkdownPlugin = function() {
|
|
|
8968
9475
|
updated = updated || mTree.updated;
|
|
8969
9476
|
return mTree.node;
|
|
8970
9477
|
});
|
|
8971
|
-
|
|
9478
|
+
if (hasAsync.length > 0) {
|
|
9479
|
+
var copy = newValues;
|
|
9480
|
+
hasAsync.forEach(function(index2) {
|
|
9481
|
+
var _copy;
|
|
9482
|
+
if (copy[index2]) (_copy = copy).splice.apply(_copy, [
|
|
9483
|
+
index2,
|
|
9484
|
+
1
|
|
9485
|
+
].concat(_to_consumable_array(unpackNode(copy[index2]))));
|
|
9486
|
+
});
|
|
9487
|
+
resolvedAST.values = copy;
|
|
9488
|
+
} else {
|
|
9489
|
+
resolvedAST.values = newValues;
|
|
9490
|
+
}
|
|
8972
9491
|
resolved = childValue;
|
|
8973
9492
|
}
|
|
8974
9493
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -8997,6 +9516,15 @@ var MarkdownPlugin = function() {
|
|
|
8997
9516
|
]);
|
|
8998
9517
|
return Resolver;
|
|
8999
9518
|
}();
|
|
9519
|
+
function unpackAndPush(item, initial) {
|
|
9520
|
+
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
9521
|
+
item.asset.values.forEach(function(i) {
|
|
9522
|
+
unpackAndPush(i, initial);
|
|
9523
|
+
});
|
|
9524
|
+
} else {
|
|
9525
|
+
initial.push(item);
|
|
9526
|
+
}
|
|
9527
|
+
}
|
|
9000
9528
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
9001
9529
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
9002
9530
|
_class_call_check(this, CrossfieldProvider);
|
|
@@ -11617,15 +12145,56 @@ var MarkdownPlugin = function() {
|
|
|
11617
12145
|
validationController.reset();
|
|
11618
12146
|
}
|
|
11619
12147
|
});
|
|
11620
|
-
flow3.hooks.afterTransition.tap("player", function(
|
|
11621
|
-
var
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
12148
|
+
flow3.hooks.afterTransition.tap("player", function() {
|
|
12149
|
+
var _ref = _async_to_generator(function(flowInstance) {
|
|
12150
|
+
var _flowInstance_currentState, value, exp, result, e;
|
|
12151
|
+
return _ts_generator(this, function(_state) {
|
|
12152
|
+
switch(_state.label){
|
|
12153
|
+
case 0:
|
|
12154
|
+
value = (_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value;
|
|
12155
|
+
if (!(value && value.state_type === "ACTION")) return [
|
|
12156
|
+
3,
|
|
12157
|
+
4
|
|
12158
|
+
];
|
|
12159
|
+
exp = value.exp;
|
|
12160
|
+
_state.label = 1;
|
|
12161
|
+
case 1:
|
|
12162
|
+
_state.trys.push([
|
|
12163
|
+
1,
|
|
12164
|
+
3,
|
|
12165
|
+
,
|
|
12166
|
+
4
|
|
12167
|
+
]);
|
|
12168
|
+
return [
|
|
12169
|
+
4,
|
|
12170
|
+
expressionEvaluator.evaluateAsync(exp)
|
|
12171
|
+
];
|
|
12172
|
+
case 2:
|
|
12173
|
+
result = _state.sent();
|
|
12174
|
+
flowController === null || flowController === void 0 ? void 0 : flowController.transition(String(result));
|
|
12175
|
+
return [
|
|
12176
|
+
3,
|
|
12177
|
+
4
|
|
12178
|
+
];
|
|
12179
|
+
case 3:
|
|
12180
|
+
e = _state.sent();
|
|
12181
|
+
flowResultDeferred.reject(e);
|
|
12182
|
+
return [
|
|
12183
|
+
3,
|
|
12184
|
+
4
|
|
12185
|
+
];
|
|
12186
|
+
case 4:
|
|
12187
|
+
expressionEvaluator.reset();
|
|
12188
|
+
return [
|
|
12189
|
+
2
|
|
12190
|
+
];
|
|
12191
|
+
}
|
|
12192
|
+
});
|
|
12193
|
+
});
|
|
12194
|
+
return function(flowInstance) {
|
|
12195
|
+
return _ref.apply(this, arguments);
|
|
12196
|
+
};
|
|
12197
|
+
}());
|
|
11629
12198
|
});
|
|
11630
12199
|
this.hooks.dataController.call(dataController);
|
|
11631
12200
|
validationController.setOptions({
|