eligius 1.0.18 → 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 +41 -24
- 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 +41 -24
- package/dist/eligius.esm.js.map +1 -1
- package/dist/operation/types.d.ts +4 -0
- package/dist/operation/when.d.ts +1 -1
- package/package.json +2 -2
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
|
}
|
|
@@ -576,9 +576,23 @@ var Action = /*#__PURE__*/function () {
|
|
|
576
576
|
|
|
577
577
|
_proto._pushContext = function _pushContext(parentContext) {
|
|
578
578
|
var newContext = {
|
|
579
|
-
currentIndex
|
|
580
|
-
|
|
581
|
-
|
|
579
|
+
get currentIndex() {
|
|
580
|
+
return parentContext.currentIndex;
|
|
581
|
+
},
|
|
582
|
+
|
|
583
|
+
set currentIndex(value) {
|
|
584
|
+
parentContext.currentIndex = value;
|
|
585
|
+
},
|
|
586
|
+
|
|
587
|
+
get eventbus() {
|
|
588
|
+
return parentContext.eventbus;
|
|
589
|
+
},
|
|
590
|
+
|
|
591
|
+
get operations() {
|
|
592
|
+
return parentContext.operations;
|
|
593
|
+
},
|
|
594
|
+
|
|
595
|
+
parent: parentContext
|
|
582
596
|
};
|
|
583
597
|
|
|
584
598
|
this._contextStack.push(newContext);
|
|
@@ -587,13 +601,10 @@ var Action = /*#__PURE__*/function () {
|
|
|
587
601
|
};
|
|
588
602
|
|
|
589
603
|
_proto._popContext = function _popContext() {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
var newCurrentContext = this._contextStack[this._contextStack.length - 1];
|
|
593
|
-
newCurrentContext.currentIndex = previousContext.currentIndex;
|
|
604
|
+
this._contextStack.pop();
|
|
594
605
|
};
|
|
595
606
|
|
|
596
|
-
_proto.executeOperation = function executeOperation(operations,
|
|
607
|
+
_proto.executeOperation = function executeOperation(operations, operationIndex, resolve, reject, previousOperationData) {
|
|
597
608
|
var _this2 = this;
|
|
598
609
|
|
|
599
610
|
if (previousOperationData === void 0) {
|
|
@@ -603,16 +614,16 @@ var Action = /*#__PURE__*/function () {
|
|
|
603
614
|
var context = this._contextStack[this._contextStack.length - 1];
|
|
604
615
|
|
|
605
616
|
if (context.newIndex !== undefined) {
|
|
606
|
-
|
|
617
|
+
operationIndex = context.newIndex;
|
|
607
618
|
delete context.newIndex;
|
|
608
619
|
}
|
|
609
620
|
|
|
610
|
-
context.currentIndex =
|
|
621
|
+
context.currentIndex = operationIndex;
|
|
611
622
|
|
|
612
|
-
if (
|
|
623
|
+
if (operationIndex < operations.length) {
|
|
613
624
|
var _operationInfo$operat;
|
|
614
625
|
|
|
615
|
-
var operationInfo = operations[
|
|
626
|
+
var operationInfo = operations[operationIndex];
|
|
616
627
|
var copy = deepCopy((_operationInfo$operat = operationInfo.operationData) != null ? _operationInfo$operat : {});
|
|
617
628
|
var mergedOperationData = Object.assign(previousOperationData, copy);
|
|
618
629
|
|
|
@@ -638,12 +649,12 @@ var Action = /*#__PURE__*/function () {
|
|
|
638
649
|
|
|
639
650
|
if (isPromise(operationResult)) {
|
|
640
651
|
operationResult.then(function (promisedOperationResult) {
|
|
641
|
-
return _this2.executeOperation(operations, ++
|
|
652
|
+
return _this2.executeOperation(operations, ++operationIndex, resolve, reject, promisedOperationResult);
|
|
642
653
|
})["catch"](function (error) {
|
|
643
654
|
reject(error);
|
|
644
655
|
});
|
|
645
656
|
} else {
|
|
646
|
-
this.executeOperation(operations, ++
|
|
657
|
+
this.executeOperation(operations, ++operationIndex, resolve, reject, operationResult);
|
|
647
658
|
}
|
|
648
659
|
} else {
|
|
649
660
|
resolve(previousOperationData);
|
|
@@ -1328,9 +1339,12 @@ var createElement$1 = function createElement(operationData) {
|
|
|
1328
1339
|
elementName = _operationData.elementName,
|
|
1329
1340
|
attributes = _operationData.attributes,
|
|
1330
1341
|
text = _operationData.text;
|
|
1331
|
-
var serializedAttrs = attributes ? " " + Object.entries(attributes).
|
|
1332
|
-
var
|
|
1333
|
-
|
|
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];
|
|
1334
1348
|
return key + "=\"" + value + "\"";
|
|
1335
1349
|
}).join(' ') : '';
|
|
1336
1350
|
var template = text ? $__default["default"]("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $__default["default"]("<" + elementName + serializedAttrs + "/>");
|
|
@@ -1930,13 +1944,14 @@ var otherwise$1 = function otherwise(operationData) {
|
|
|
1930
1944
|
};
|
|
1931
1945
|
|
|
1932
1946
|
function findEndWhenIndex(context) {
|
|
1933
|
-
var
|
|
1947
|
+
var currentIndex = context.currentIndex + 1;
|
|
1948
|
+
var list = context.operations.slice(currentIndex);
|
|
1934
1949
|
var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
|
|
1935
1950
|
counter: 0,
|
|
1936
1951
|
self: 'when',
|
|
1937
1952
|
matchingName: 'endWhen'
|
|
1938
1953
|
}));
|
|
1939
|
-
return endWhenIndex > -1 ? endWhenIndex +
|
|
1954
|
+
return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
|
|
1940
1955
|
}
|
|
1941
1956
|
|
|
1942
1957
|
/**
|
|
@@ -2285,13 +2300,14 @@ var startLoop$1 = function startLoop(operationData) {
|
|
|
2285
2300
|
};
|
|
2286
2301
|
|
|
2287
2302
|
function findLoopEndIndex(context) {
|
|
2288
|
-
var
|
|
2303
|
+
var currentIndex = context.currentIndex + 1;
|
|
2304
|
+
var list = context.operations.slice(currentIndex);
|
|
2289
2305
|
var index = list.findIndex(findMatchingOperationIndex.bind({
|
|
2290
2306
|
counter: 0,
|
|
2291
2307
|
self: 'startLoop',
|
|
2292
2308
|
matchingName: 'endLoop'
|
|
2293
2309
|
}));
|
|
2294
|
-
var endLoopIndex = index > -1 ? index +
|
|
2310
|
+
var endLoopIndex = index > -1 ? index + currentIndex : context.operations.length;
|
|
2295
2311
|
return endLoopIndex;
|
|
2296
2312
|
}
|
|
2297
2313
|
|
|
@@ -2393,7 +2409,8 @@ var evaluations = {
|
|
|
2393
2409
|
};
|
|
2394
2410
|
|
|
2395
2411
|
function findNextFlowControlIndex(context) {
|
|
2396
|
-
var
|
|
2412
|
+
var currentIndex = context.currentIndex + 1;
|
|
2413
|
+
var list = context.operations.slice(currentIndex);
|
|
2397
2414
|
var otherWiseIndex = list.findIndex(findMatchingOperationIndex.bind({
|
|
2398
2415
|
counter: 0,
|
|
2399
2416
|
self: 'when',
|
|
@@ -2401,7 +2418,7 @@ function findNextFlowControlIndex(context) {
|
|
|
2401
2418
|
}));
|
|
2402
2419
|
|
|
2403
2420
|
if (otherWiseIndex > -1) {
|
|
2404
|
-
return otherWiseIndex +
|
|
2421
|
+
return otherWiseIndex + currentIndex;
|
|
2405
2422
|
}
|
|
2406
2423
|
|
|
2407
2424
|
var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
|
|
@@ -2409,7 +2426,7 @@ function findNextFlowControlIndex(context) {
|
|
|
2409
2426
|
self: 'when',
|
|
2410
2427
|
matchingName: 'endWhen'
|
|
2411
2428
|
}));
|
|
2412
|
-
return endWhenIndex > -1 ? endWhenIndex +
|
|
2429
|
+
return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
|
|
2413
2430
|
}
|
|
2414
2431
|
|
|
2415
2432
|
var ops = {
|