eligius 1.0.19 → 1.0.20
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/action/action.d.ts +1 -1
- package/dist/eligius.cjs.development.js +31 -19
- package/dist/eligius.cjs.development.js.map +1 -1
- package/dist/eligius.cjs.production.min.js +1 -1
- package/dist/eligius.cjs.production.min.js.map +1 -1
- package/dist/eligius.esm.js +31 -19
- package/dist/eligius.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/action/action.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ export declare class Action implements IAction {
|
|
|
13
13
|
protected _initializeContextStack(): void;
|
|
14
14
|
private _pushContext;
|
|
15
15
|
private _popContext;
|
|
16
|
-
executeOperation(operations: IResolvedOperation[],
|
|
16
|
+
executeOperation(operations: IResolvedOperation[], operationIndex: number, resolve: (value?: any | PromiseLike<any>) => void, reject: (reason?: any) => void, previousOperationData?: TOperationData | undefined): void;
|
|
17
17
|
}
|
|
@@ -584,8 +584,14 @@ var Action = /*#__PURE__*/function () {
|
|
|
584
584
|
parentContext.currentIndex = value;
|
|
585
585
|
},
|
|
586
586
|
|
|
587
|
-
eventbus
|
|
588
|
-
|
|
587
|
+
get eventbus() {
|
|
588
|
+
return parentContext.eventbus;
|
|
589
|
+
},
|
|
590
|
+
|
|
591
|
+
get operations() {
|
|
592
|
+
return parentContext.operations;
|
|
593
|
+
},
|
|
594
|
+
|
|
589
595
|
parent: parentContext
|
|
590
596
|
};
|
|
591
597
|
|
|
@@ -598,7 +604,7 @@ var Action = /*#__PURE__*/function () {
|
|
|
598
604
|
this._contextStack.pop();
|
|
599
605
|
};
|
|
600
606
|
|
|
601
|
-
_proto.executeOperation = function executeOperation(operations,
|
|
607
|
+
_proto.executeOperation = function executeOperation(operations, operationIndex, resolve, reject, previousOperationData) {
|
|
602
608
|
var _this2 = this;
|
|
603
609
|
|
|
604
610
|
if (previousOperationData === void 0) {
|
|
@@ -608,16 +614,16 @@ var Action = /*#__PURE__*/function () {
|
|
|
608
614
|
var context = this._contextStack[this._contextStack.length - 1];
|
|
609
615
|
|
|
610
616
|
if (context.newIndex !== undefined) {
|
|
611
|
-
|
|
617
|
+
operationIndex = context.newIndex;
|
|
612
618
|
delete context.newIndex;
|
|
613
619
|
}
|
|
614
620
|
|
|
615
|
-
context.currentIndex =
|
|
621
|
+
context.currentIndex = operationIndex;
|
|
616
622
|
|
|
617
|
-
if (
|
|
623
|
+
if (operationIndex < operations.length) {
|
|
618
624
|
var _operationInfo$operat;
|
|
619
625
|
|
|
620
|
-
var operationInfo = operations[
|
|
626
|
+
var operationInfo = operations[operationIndex];
|
|
621
627
|
var copy = deepCopy((_operationInfo$operat = operationInfo.operationData) != null ? _operationInfo$operat : {});
|
|
622
628
|
var mergedOperationData = Object.assign(previousOperationData, copy);
|
|
623
629
|
|
|
@@ -643,12 +649,12 @@ var Action = /*#__PURE__*/function () {
|
|
|
643
649
|
|
|
644
650
|
if (isPromise(operationResult)) {
|
|
645
651
|
operationResult.then(function (promisedOperationResult) {
|
|
646
|
-
return _this2.executeOperation(operations, ++
|
|
652
|
+
return _this2.executeOperation(operations, ++operationIndex, resolve, reject, promisedOperationResult);
|
|
647
653
|
})["catch"](function (error) {
|
|
648
654
|
reject(error);
|
|
649
655
|
});
|
|
650
656
|
} else {
|
|
651
|
-
this.executeOperation(operations, ++
|
|
657
|
+
this.executeOperation(operations, ++operationIndex, resolve, reject, operationResult);
|
|
652
658
|
}
|
|
653
659
|
} else {
|
|
654
660
|
resolve(previousOperationData);
|
|
@@ -1333,9 +1339,12 @@ var createElement$1 = function createElement(operationData) {
|
|
|
1333
1339
|
elementName = _operationData.elementName,
|
|
1334
1340
|
attributes = _operationData.attributes,
|
|
1335
1341
|
text = _operationData.text;
|
|
1336
|
-
var serializedAttrs = attributes ? " " + Object.entries(attributes).
|
|
1337
|
-
var
|
|
1338
|
-
|
|
1342
|
+
var serializedAttrs = attributes ? " " + Object.entries(attributes).filter(function (_ref) {
|
|
1343
|
+
var value = _ref[1];
|
|
1344
|
+
return Boolean(value);
|
|
1345
|
+
}).map(function (_ref2) {
|
|
1346
|
+
var key = _ref2[0],
|
|
1347
|
+
value = _ref2[1];
|
|
1339
1348
|
return key + "=\"" + value + "\"";
|
|
1340
1349
|
}).join(' ') : '';
|
|
1341
1350
|
var template = text ? $__default["default"]("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $__default["default"]("<" + elementName + serializedAttrs + "/>");
|
|
@@ -1935,13 +1944,14 @@ var otherwise$1 = function otherwise(operationData) {
|
|
|
1935
1944
|
};
|
|
1936
1945
|
|
|
1937
1946
|
function findEndWhenIndex(context) {
|
|
1938
|
-
var
|
|
1947
|
+
var currentIndex = context.currentIndex + 1;
|
|
1948
|
+
var list = context.operations.slice(currentIndex);
|
|
1939
1949
|
var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
|
|
1940
1950
|
counter: 0,
|
|
1941
1951
|
self: 'when',
|
|
1942
1952
|
matchingName: 'endWhen'
|
|
1943
1953
|
}));
|
|
1944
|
-
return endWhenIndex > -1 ? endWhenIndex +
|
|
1954
|
+
return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
|
|
1945
1955
|
}
|
|
1946
1956
|
|
|
1947
1957
|
/**
|
|
@@ -2290,13 +2300,14 @@ var startLoop$1 = function startLoop(operationData) {
|
|
|
2290
2300
|
};
|
|
2291
2301
|
|
|
2292
2302
|
function findLoopEndIndex(context) {
|
|
2293
|
-
var
|
|
2303
|
+
var currentIndex = context.currentIndex + 1;
|
|
2304
|
+
var list = context.operations.slice(currentIndex);
|
|
2294
2305
|
var index = list.findIndex(findMatchingOperationIndex.bind({
|
|
2295
2306
|
counter: 0,
|
|
2296
2307
|
self: 'startLoop',
|
|
2297
2308
|
matchingName: 'endLoop'
|
|
2298
2309
|
}));
|
|
2299
|
-
var endLoopIndex = index > -1 ? index +
|
|
2310
|
+
var endLoopIndex = index > -1 ? index + currentIndex : context.operations.length;
|
|
2300
2311
|
return endLoopIndex;
|
|
2301
2312
|
}
|
|
2302
2313
|
|
|
@@ -2398,7 +2409,8 @@ var evaluations = {
|
|
|
2398
2409
|
};
|
|
2399
2410
|
|
|
2400
2411
|
function findNextFlowControlIndex(context) {
|
|
2401
|
-
var
|
|
2412
|
+
var currentIndex = context.currentIndex + 1;
|
|
2413
|
+
var list = context.operations.slice(currentIndex);
|
|
2402
2414
|
var otherWiseIndex = list.findIndex(findMatchingOperationIndex.bind({
|
|
2403
2415
|
counter: 0,
|
|
2404
2416
|
self: 'when',
|
|
@@ -2406,7 +2418,7 @@ function findNextFlowControlIndex(context) {
|
|
|
2406
2418
|
}));
|
|
2407
2419
|
|
|
2408
2420
|
if (otherWiseIndex > -1) {
|
|
2409
|
-
return otherWiseIndex +
|
|
2421
|
+
return otherWiseIndex + currentIndex;
|
|
2410
2422
|
}
|
|
2411
2423
|
|
|
2412
2424
|
var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
|
|
@@ -2414,7 +2426,7 @@ function findNextFlowControlIndex(context) {
|
|
|
2414
2426
|
self: 'when',
|
|
2415
2427
|
matchingName: 'endWhen'
|
|
2416
2428
|
}));
|
|
2417
|
-
return endWhenIndex > -1 ? endWhenIndex +
|
|
2429
|
+
return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
|
|
2418
2430
|
}
|
|
2419
2431
|
|
|
2420
2432
|
var ops = {
|