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.
@@ -564,9 +564,23 @@ var Action = /*#__PURE__*/function () {
564
564
 
565
565
  _proto._pushContext = function _pushContext(parentContext) {
566
566
  var newContext = {
567
- currentIndex: parentContext.currentIndex,
568
- eventbus: parentContext.eventbus,
569
- operations: parentContext.operations
567
+ get currentIndex() {
568
+ return parentContext.currentIndex;
569
+ },
570
+
571
+ set currentIndex(value) {
572
+ parentContext.currentIndex = value;
573
+ },
574
+
575
+ get eventbus() {
576
+ return parentContext.eventbus;
577
+ },
578
+
579
+ get operations() {
580
+ return parentContext.operations;
581
+ },
582
+
583
+ parent: parentContext
570
584
  };
571
585
 
572
586
  this._contextStack.push(newContext);
@@ -575,13 +589,10 @@ var Action = /*#__PURE__*/function () {
575
589
  };
576
590
 
577
591
  _proto._popContext = function _popContext() {
578
- var previousContext = this._contextStack.pop();
579
-
580
- var newCurrentContext = this._contextStack[this._contextStack.length - 1];
581
- newCurrentContext.currentIndex = previousContext.currentIndex;
592
+ this._contextStack.pop();
582
593
  };
583
594
 
584
- _proto.executeOperation = function executeOperation(operations, idx, resolve, reject, previousOperationData) {
595
+ _proto.executeOperation = function executeOperation(operations, operationIndex, resolve, reject, previousOperationData) {
585
596
  var _this2 = this;
586
597
 
587
598
  if (previousOperationData === void 0) {
@@ -591,16 +602,16 @@ var Action = /*#__PURE__*/function () {
591
602
  var context = this._contextStack[this._contextStack.length - 1];
592
603
 
593
604
  if (context.newIndex !== undefined) {
594
- idx = context.newIndex;
605
+ operationIndex = context.newIndex;
595
606
  delete context.newIndex;
596
607
  }
597
608
 
598
- context.currentIndex = idx;
609
+ context.currentIndex = operationIndex;
599
610
 
600
- if (idx < operations.length) {
611
+ if (operationIndex < operations.length) {
601
612
  var _operationInfo$operat;
602
613
 
603
- var operationInfo = operations[idx];
614
+ var operationInfo = operations[operationIndex];
604
615
  var copy = deepCopy((_operationInfo$operat = operationInfo.operationData) != null ? _operationInfo$operat : {});
605
616
  var mergedOperationData = Object.assign(previousOperationData, copy);
606
617
 
@@ -626,12 +637,12 @@ var Action = /*#__PURE__*/function () {
626
637
 
627
638
  if (isPromise(operationResult)) {
628
639
  operationResult.then(function (promisedOperationResult) {
629
- return _this2.executeOperation(operations, ++idx, resolve, reject, promisedOperationResult);
640
+ return _this2.executeOperation(operations, ++operationIndex, resolve, reject, promisedOperationResult);
630
641
  })["catch"](function (error) {
631
642
  reject(error);
632
643
  });
633
644
  } else {
634
- this.executeOperation(operations, ++idx, resolve, reject, operationResult);
645
+ this.executeOperation(operations, ++operationIndex, resolve, reject, operationResult);
635
646
  }
636
647
  } else {
637
648
  resolve(previousOperationData);
@@ -1316,9 +1327,12 @@ var createElement$1 = function createElement(operationData) {
1316
1327
  elementName = _operationData.elementName,
1317
1328
  attributes = _operationData.attributes,
1318
1329
  text = _operationData.text;
1319
- var serializedAttrs = attributes ? " " + Object.entries(attributes).map(function (_ref) {
1320
- var key = _ref[0],
1321
- value = _ref[1];
1330
+ var serializedAttrs = attributes ? " " + Object.entries(attributes).filter(function (_ref) {
1331
+ var value = _ref[1];
1332
+ return Boolean(value);
1333
+ }).map(function (_ref2) {
1334
+ var key = _ref2[0],
1335
+ value = _ref2[1];
1322
1336
  return key + "=\"" + value + "\"";
1323
1337
  }).join(' ') : '';
1324
1338
  var template = text ? $("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $("<" + elementName + serializedAttrs + "/>");
@@ -1918,13 +1932,14 @@ var otherwise$1 = function otherwise(operationData) {
1918
1932
  };
1919
1933
 
1920
1934
  function findEndWhenIndex(context) {
1921
- var list = context.operations.slice(context.currentIndex);
1935
+ var currentIndex = context.currentIndex + 1;
1936
+ var list = context.operations.slice(currentIndex);
1922
1937
  var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
1923
1938
  counter: 0,
1924
1939
  self: 'when',
1925
1940
  matchingName: 'endWhen'
1926
1941
  }));
1927
- return endWhenIndex > -1 ? endWhenIndex + (context.currentIndex + 1) : context.operations.length;
1942
+ return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
1928
1943
  }
1929
1944
 
1930
1945
  /**
@@ -2273,13 +2288,14 @@ var startLoop$1 = function startLoop(operationData) {
2273
2288
  };
2274
2289
 
2275
2290
  function findLoopEndIndex(context) {
2276
- var list = context.operations.slice(context.currentIndex + 1);
2291
+ var currentIndex = context.currentIndex + 1;
2292
+ var list = context.operations.slice(currentIndex);
2277
2293
  var index = list.findIndex(findMatchingOperationIndex.bind({
2278
2294
  counter: 0,
2279
2295
  self: 'startLoop',
2280
2296
  matchingName: 'endLoop'
2281
2297
  }));
2282
- var endLoopIndex = index > -1 ? index + (context.currentIndex + 1) : context.operations.length;
2298
+ var endLoopIndex = index > -1 ? index + currentIndex : context.operations.length;
2283
2299
  return endLoopIndex;
2284
2300
  }
2285
2301
 
@@ -2381,7 +2397,8 @@ var evaluations = {
2381
2397
  };
2382
2398
 
2383
2399
  function findNextFlowControlIndex(context) {
2384
- var list = context.operations.slice(context.currentIndex + 1);
2400
+ var currentIndex = context.currentIndex + 1;
2401
+ var list = context.operations.slice(currentIndex);
2385
2402
  var otherWiseIndex = list.findIndex(findMatchingOperationIndex.bind({
2386
2403
  counter: 0,
2387
2404
  self: 'when',
@@ -2389,7 +2406,7 @@ function findNextFlowControlIndex(context) {
2389
2406
  }));
2390
2407
 
2391
2408
  if (otherWiseIndex > -1) {
2392
- return otherWiseIndex + context.currentIndex + 1;
2409
+ return otherWiseIndex + currentIndex;
2393
2410
  }
2394
2411
 
2395
2412
  var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
@@ -2397,7 +2414,7 @@ function findNextFlowControlIndex(context) {
2397
2414
  self: 'when',
2398
2415
  matchingName: 'endWhen'
2399
2416
  }));
2400
- return endWhenIndex > -1 ? endWhenIndex + (context.currentIndex + 1) : context.operations.length;
2417
+ return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
2401
2418
  }
2402
2419
 
2403
2420
  var ops = {