jsf.js_next_gen 4.0.0-beta-5 → 4.0.0-beta-6

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.
Files changed (128) hide show
  1. package/dist/window/faces-development.js +1928 -2521
  2. package/dist/window/faces-development.js.br +0 -0
  3. package/dist/window/faces-development.js.gz +0 -0
  4. package/dist/window/faces-development.js.map +1 -1
  5. package/dist/window/faces.js +1 -1
  6. package/dist/window/faces.js.br +0 -0
  7. package/dist/window/faces.js.gz +0 -0
  8. package/dist/window/faces.js.map +1 -1
  9. package/dist/window/jsf-development.js +1890 -2511
  10. package/dist/window/jsf-development.js.br +0 -0
  11. package/dist/window/jsf-development.js.gz +0 -0
  12. package/dist/window/jsf-development.js.map +1 -1
  13. package/dist/window/jsf.js +1 -1
  14. package/dist/window/jsf.js.br +0 -0
  15. package/dist/window/jsf.js.gz +0 -0
  16. package/dist/window/jsf.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/main/typescript/api/_api.ts +258 -0
  19. package/src/main/typescript/api/faces.ts +17 -245
  20. package/src/main/typescript/api/jsf.ts +24 -8
  21. package/src/main/typescript/impl/core/Const.ts +4 -2
  22. package/src/main/typescript/impl/util/ExtDomQuery.ts +12 -13
  23. package/src/main/typescript/impl/xhrCore/Response.ts +2 -2
  24. package/src/main/typescript/myfaces/OamSubmit.ts +6 -5
  25. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +2 -0
  26. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +14 -23
  27. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +20 -13
  28. package/src/main/typescript/tsconfig-typedoc.json +1 -1
  29. package/src/main/typescript/tsconfig.json +1 -2
  30. package/src/test/resources/jsf-development.js +1 -1
  31. package/target/api/Jsf.js +24 -11
  32. package/target/api/Jsf.js.map +1 -1
  33. package/target/api/_api.js +246 -0
  34. package/target/api/_api.js.map +1 -0
  35. package/target/api/_faces.js +251 -0
  36. package/target/api/_faces.js.map +1 -0
  37. package/target/api/faces.js +20 -247
  38. package/target/api/faces.js.map +1 -1
  39. package/target/impl/AjaxImpl.js +53 -61
  40. package/target/impl/AjaxImpl.js.map +1 -1
  41. package/target/impl/PushImpl.js +38 -41
  42. package/target/impl/PushImpl.js.map +1 -1
  43. package/target/impl/core/Const.js +4 -2
  44. package/target/impl/core/Const.js.map +1 -1
  45. package/target/impl/core/ImplTypes.js +9 -14
  46. package/target/impl/core/ImplTypes.js.map +1 -1
  47. package/target/impl/i18n/Messages.js +3 -4
  48. package/target/impl/i18n/Messages.js.map +1 -1
  49. package/target/impl/util/Assertions.js +9 -18
  50. package/target/impl/util/Assertions.js.map +1 -1
  51. package/target/impl/util/AsyncQueue.js +28 -36
  52. package/target/impl/util/AsyncQueue.js.map +1 -1
  53. package/target/impl/util/ExtDomQuery.js +137 -210
  54. package/target/impl/util/ExtDomQuery.js.map +1 -1
  55. package/target/impl/util/Lang.js +21 -28
  56. package/target/impl/util/Lang.js.map +1 -1
  57. package/target/impl/xhrCore/ErrorData.js +36 -61
  58. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  59. package/target/impl/xhrCore/EventData.js +10 -13
  60. package/target/impl/xhrCore/EventData.js.map +1 -1
  61. package/target/impl/xhrCore/RequestDataResolver.js +16 -19
  62. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  63. package/target/impl/xhrCore/ResonseDataResolver.js +16 -16
  64. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  65. package/target/impl/xhrCore/Response.js +18 -18
  66. package/target/impl/xhrCore/Response.js.map +1 -1
  67. package/target/impl/xhrCore/ResponseProcessor.js +116 -130
  68. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  69. package/target/impl/xhrCore/XhrFormData.js +68 -98
  70. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  71. package/target/impl/xhrCore/XhrRequest.js +81 -91
  72. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  73. package/target/myfaces/OamSubmit.js +20 -18
  74. package/target/myfaces/OamSubmit.js.map +1 -1
  75. package/target/test/frameworkBase/LangTest.spec.js +46 -32
  76. package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
  77. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +160 -82
  78. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  79. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +45 -31
  80. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
  81. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +24 -33
  82. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
  83. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +8 -8
  84. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
  85. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +31 -31
  86. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  87. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +50 -48
  88. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
  89. package/target/test/frameworkBase/_ext/shared/StandardInits.js +235 -130
  90. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  91. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +162 -18
  92. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  93. package/target/test/impl/ImplTest.spec.js +34 -61
  94. package/target/test/impl/ImplTest.spec.js.map +1 -1
  95. package/target/test/impl/ImplTest_23.spec.js +35 -64
  96. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  97. package/target/test/impl/SeparatorCharsTest.spec.js +19 -19
  98. package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
  99. package/target/test/myfaces/OamSubmit.spec.js +34 -41
  100. package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
  101. package/target/test/queue/AsynchronousProbe.js +23 -29
  102. package/target/test/queue/AsynchronousProbe.js.map +1 -1
  103. package/target/test/queue/AsynchronousQueueTest.spec.js +39 -70
  104. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  105. package/target/test/xhrCore/EventTests.spec.js +47 -78
  106. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  107. package/target/test/xhrCore/FakeWebsocket.js +14 -16
  108. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  109. package/target/test/xhrCore/FileUploadTest.spec.js +49 -80
  110. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  111. package/target/test/xhrCore/RequestParamsTest.spec.js +39 -70
  112. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  113. package/target/test/xhrCore/RequestTest.spec.js +76 -113
  114. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  115. package/target/test/xhrCore/RequestTest_23.spec.js +100 -140
  116. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  117. package/target/test/xhrCore/ResponseTest.spec.js +118 -87
  118. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  119. package/target/test/xhrCore/ResponseTest23.spec.js +120 -89
  120. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  121. package/target/test/xhrCore/ShadowDomTest.spec.js +31 -62
  122. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  123. package/target/test/xhrCore/WebsocketTest.js +60 -93
  124. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  125. package/target/test/xhrCore/XhrFormDataTest.spec.js +41 -15
  126. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  127. package/webpack.config.js +71 -0
  128. package/webpack.config.js.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/i18n/Messages.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;IAAA;QACI,aAAQ,GAAG,aAAa,CAAC;QA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nF,gBAAgB;QAChB,sBAAiB,GAAG,kEAAkE,CAAC;QACvF,gBAAgB;QAChB,yBAAoB,GAAG,wCAAwC,CAAC;QAChE,gBAAgB;QAChB,0BAAqB,GAAG,sBAAsB,CAAC;QAE/C,gBAAgB;QAChB,mBAAc,GAAG,wDAAwD,CAAC;QAE1E,gBAAgB;QAChB,uBAAkB,GAAG,4CAA4C,CAAC;QAClE,gBAAgB;QAChB,yBAAoB,GAAG,kDAAkD,CAAC;QAC1E,gBAAgB;QAChB,kBAAa,GAAG,8CAA8C,CAAC;QAC/D,gBAAgB;QAChB,wBAAmB,GAAG,iEAAiE,CAAC;QACxF,gBAAgB;QAChB,0BAAqB,GAAG,6EAA6E,CAAC;QACtG,gBAAgB;QAChB,0BAAqB,GAAG,4EAA4E,CAAC;QAErG,gBAAgB;QAChB,kBAAa,GAAG,4CAA4C,CAAC;QAC7D,gBAAgB;QAChB,uBAAkB,GAAG,sCAAsC,CAAC;QAE5D,gBAAgB;QAChB,wBAAmB,GAAG,uDAAuD,CAAC;QAC9E,gBAAgB;QAChB,oBAAe,GAAG,mDAAmD,CAAC;QACtE,gBAAgB;QAChB,gBAAW,GAAG,2BAA2B,CAAC;QAE1C,gBAAgB;QAChB,2BAAsB,GAAG,oCAAoC,CAAC;QAE9D,gBAAgB;QAChB,oBAAe,GAAG,+CAA+C,CAAC;QAElE,gBAAgB;QAChB,YAAO,GAAG,SAAS,CAAC;IACxB,CAAC;IAAD,eAAC;AAAD,CAAC,AArGD,IAqGC;AArGY,4BAAQ"}
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/i18n/Messages.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,MAAa,QAAQ;IAArB;QACI,aAAQ,GAAG,aAAa,CAAC;QAEzB,YAAY;QACZ,gBAAgB;QAChB,iBAAY,GAAG,+EAA+E;YAC1F,uCAAuC,CAAC;QAC5C,gBAAgB;QAChB,uBAAkB,GAAG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;QAChB,0BAAqB,GAAG,sBAAsB,CAAC;QAE/C,gBAAgB;QAChB,mBAAc,GAAG,wDAAwD,CAAC;QAE1E,gBAAgB;QAChB,uBAAkB,GAAG,4CAA4C,CAAC;QAClE,gBAAgB;QAChB,yBAAoB,GAAG,kDAAkD,CAAC;QAC1E,gBAAgB;QAChB,kBAAa,GAAG,8CAA8C,CAAC;QAC/D,gBAAgB;QAChB,wBAAmB,GAAG,iEAAiE,CAAC;QACxF,gBAAgB;QAChB,0BAAqB,GAAG,6EAA6E,CAAC;QACtG,gBAAgB;QAChB,0BAAqB,GAAG,4EAA4E,CAAC;QAErG,gBAAgB;QAChB,kBAAa,GAAG,4CAA4C,CAAC;QAC7D,gBAAgB;QAChB,uBAAkB,GAAG,sCAAsC,CAAC;QAE5D,gBAAgB;QAChB,wBAAmB,GAAG,uDAAuD,CAAC;QAC9E,gBAAgB;QAChB,oBAAe,GAAG,mDAAmD,CAAC;QACtE,gBAAgB;QAChB,gBAAW,GAAG,2BAA2B,CAAC;QAE1C,gBAAgB;QAChB,2BAAsB,GAAG,oCAAoC,CAAC;QAE9D,gBAAgB;QAChB,oBAAe,GAAG,+CAA+C,CAAC;QAElE,gBAAgB;QAChB,YAAO,GAAG,SAAS,CAAC;IACxB,CAAC;CAAA;AArGD,4BAqGC"}
@@ -16,11 +16,11 @@ exports.Assertions = void 0;
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
- var mona_dish_1 = require("mona-dish");
20
- var Lang_1 = require("./Lang");
19
+ const mona_dish_1 = require("mona-dish");
20
+ const Lang_1 = require("./Lang");
21
21
  var getMessage = Lang_1.ExtLang.getMessage;
22
22
  var makeException = Lang_1.ExtLang.makeException;
23
- var Const_1 = require("../core/Const");
23
+ const Const_1 = require("../core/Const");
24
24
  /**
25
25
  * a set of internal code assertions
26
26
  * which raise an error
@@ -65,9 +65,9 @@ var Assertions;
65
65
  * @param name the name of the error (optional)
66
66
  */
67
67
  function raiseError(error, message, caller, title, name) {
68
- var finalTitle = title !== null && title !== void 0 ? title : Const_1.MALFORMEDXML;
69
- var finalName = name !== null && name !== void 0 ? name : Const_1.MALFORMEDXML;
70
- var finalMessage = message !== null && message !== void 0 ? message : Const_1.EMPTY_STR;
68
+ let finalTitle = title !== null && title !== void 0 ? title : Const_1.MALFORMEDXML;
69
+ let finalName = name !== null && name !== void 0 ? name : Const_1.MALFORMEDXML;
70
+ let finalMessage = message !== null && message !== void 0 ? message : Const_1.EMPTY_STR;
71
71
  //TODO clean up the messy makeException, this is a perfect case for encapsulation and sane defaults
72
72
  return makeException(error, finalTitle, finalName, "Response", caller || ((arguments.caller) ? arguments.caller.toString() : "_raiseError"), finalMessage);
73
73
  }
@@ -76,28 +76,19 @@ var Assertions;
76
76
  * using the new typescript 3.7 compiler assertion functionality to improve compiler hinting
77
77
  * we are not fully there yet, but soon
78
78
  */
79
- function assert(value, msg, caller, title) {
80
- if (msg === void 0) { msg = Const_1.EMPTY_STR; }
81
- if (caller === void 0) { caller = Const_1.EMPTY_STR; }
82
- if (title === void 0) { title = "Assertion Error"; }
79
+ function assert(value, msg = Const_1.EMPTY_STR, caller = Const_1.EMPTY_STR, title = "Assertion Error") {
83
80
  if (!value) {
84
81
  throw Assertions.raiseError(new Error(), msg, caller, title);
85
82
  }
86
83
  }
87
84
  Assertions.assert = assert;
88
- function assertType(value, theType, msg, caller, title) {
89
- if (msg === void 0) { msg = Const_1.EMPTY_STR; }
90
- if (caller === void 0) { caller = Const_1.EMPTY_STR; }
91
- if (title === void 0) { title = "Type Assertion Error"; }
85
+ function assertType(value, theType, msg = Const_1.EMPTY_STR, caller = Const_1.EMPTY_STR, title = "Type Assertion Error") {
92
86
  if ((!!value) && !mona_dish_1.Lang.assertType(value, theType)) {
93
87
  throw Assertions.raiseError(new Error(), msg, caller, title);
94
88
  }
95
89
  }
96
90
  Assertions.assertType = assertType;
97
- function assertFunction(value, msg, caller, title) {
98
- if (msg === void 0) { msg = Const_1.EMPTY_STR; }
99
- if (caller === void 0) { caller = Const_1.EMPTY_STR; }
100
- if (title === void 0) { title = "Assertion Error"; }
91
+ function assertFunction(value, msg = Const_1.EMPTY_STR, caller = Const_1.EMPTY_STR, title = "Assertion Error") {
101
92
  assertType(value, "function", msg, caller, title);
102
93
  }
103
94
  Assertions.assertFunction = assertFunction;
@@ -1 +1 @@
1
- {"version":3,"file":"Assertions.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/util/Assertions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,uCAAiD;AAGjD,+BAA+B;AAC/B,IAAO,UAAU,GAAG,cAAO,CAAC,UAAU,CAAC;AACvC,IAAO,aAAa,GAAG,cAAO,CAAC,aAAa,CAAC;AAC7C,uCAQuB;AAEvB;;;;GAIG;AACH,IAAc,UAAU,CAqEvB;AArED,WAAc,UAAU;IAEpB,SAAgB,sBAAsB,CAAC,OAAe,EAAE,IAAQ;QAC5D,kFAAkF;QAClF,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9C,kFAAkF;QAClF,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9C,uDAAuD;QACvD,uCAAuC;QACvC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,UAAU,CAAC,uBAAuB,EAAE,wCAAwC,EAAE,mBAAmB,CAAC,EAAE,oBAAoB,EAAE,WAAW,CAAI,CAAA;IACtK,CAAC;IARe,iCAAsB,yBAQrC,CAAA;IAED,SAAgB,eAAe,CAAC,IAAc;QAC1C,IAAI,IAAI,CAAC,IAAI,CAAC,gBAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChC,MAAM,UAAU,CAAC,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE,UAAU,CAAC,aAAa,EAAE,IAAI,EAAE,2BAA2B,CAAC,EAAE,iBAAiB,CAAC,CAAC;SAC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zB,CAAA;IAED,SAAgB,cAAc,CAAC,KAAU,EAAE,GAAG,GAAG,iBAAS,EAAE,MAAM,GAAC,iBAAS,EAAE,KAAK,GAAC,iBAAiB;QACjG,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAFe,yBAAc,iBAE7B,CAAA;AACL,CAAC,EArEa,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAqEvB"}
@@ -12,20 +12,16 @@ exports.AsynchronousQueue = void 0;
12
12
  * This interface can be used as wrapper contract
13
13
  * for normal promises if needed.
14
14
  */
15
- var AsynchronousQueue = /** @class */ (function () {
16
- function AsynchronousQueue() {
15
+ class AsynchronousQueue {
16
+ constructor() {
17
17
  this.runnableQueue = [];
18
18
  }
19
- Object.defineProperty(AsynchronousQueue.prototype, "isEmpty", {
20
- /**
21
- * simple is empty accessor, returns true if queue is empty atm
22
- */
23
- get: function () {
24
- return !this.runnableQueue.length;
25
- },
26
- enumerable: false,
27
- configurable: true
28
- });
19
+ /**
20
+ * simple is empty accessor, returns true if queue is empty atm
21
+ */
22
+ get isEmpty() {
23
+ return !this.runnableQueue.length;
24
+ }
29
25
  /**
30
26
  * enqueues an element and starts the
31
27
  * asynchronous work loop if not already running
@@ -33,40 +29,38 @@ var AsynchronousQueue = /** @class */ (function () {
33
29
  * @param element the element to be queued and processed
34
30
  * @param delay possible delay after our usual process or drop if something newer is incoming algorithm
35
31
  */
36
- AsynchronousQueue.prototype.enqueue = function (element, delay) {
37
- var _this = this;
38
- if (delay === void 0) { delay = 0; }
32
+ enqueue(element, delay = 0) {
39
33
  if (this.delayTimeout) {
40
34
  clearTimeout(this.delayTimeout);
41
35
  this.delayTimeout = null;
42
36
  }
43
37
  if (delay) {
44
- this.delayTimeout = setTimeout(function () {
45
- _this.appendElement(element);
38
+ this.delayTimeout = setTimeout(() => {
39
+ this.appendElement(element);
46
40
  });
47
41
  }
48
42
  else {
49
43
  this.appendElement(element);
50
44
  }
51
- };
45
+ }
52
46
  /**
53
47
  * fetches the next element from the queue (first in first out order)
54
48
  */
55
- AsynchronousQueue.prototype.dequeue = function () {
49
+ dequeue() {
56
50
  return this.runnableQueue.shift();
57
- };
51
+ }
58
52
  /**
59
53
  * clears up all elements from the queue
60
54
  */
61
- AsynchronousQueue.prototype.cleanup = function () {
55
+ cleanup() {
62
56
  this.currentlyRunning = null;
63
57
  this.runnableQueue.length = 0;
64
- };
58
+ }
65
59
  /**
66
60
  * cancels the currently running element and then cleans up the queue
67
61
  * aka cancel the queue entirely
68
62
  */
69
- AsynchronousQueue.prototype.cancel = function () {
63
+ cancel() {
70
64
  try {
71
65
  if (this.currentlyRunning) {
72
66
  this.currentlyRunning.cancel();
@@ -75,11 +69,11 @@ var AsynchronousQueue = /** @class */ (function () {
75
69
  finally {
76
70
  this.cleanup();
77
71
  }
78
- };
79
- AsynchronousQueue.prototype.callForNextElementToProcess = function () {
72
+ }
73
+ callForNextElementToProcess() {
80
74
  this.runEntry();
81
- };
82
- AsynchronousQueue.prototype.appendElement = function (element) {
75
+ }
76
+ appendElement(element) {
83
77
  //only if the first element is added we start with a trigger
84
78
  //otherwise a process already is running and not finished yet at that
85
79
  //time
@@ -87,19 +81,18 @@ var AsynchronousQueue = /** @class */ (function () {
87
81
  if (!this.currentlyRunning) {
88
82
  this.runEntry();
89
83
  }
90
- };
91
- AsynchronousQueue.prototype.runEntry = function () {
92
- var _this = this;
84
+ }
85
+ runEntry() {
93
86
  if (this.isEmpty) {
94
87
  this.currentlyRunning = null;
95
88
  return;
96
89
  }
97
90
  this.currentlyRunning = this.dequeue();
98
91
  this.currentlyRunning
99
- .catch(function (e) {
92
+ .catch((e) => {
100
93
  //in case of an error we always clean up the remaining calls
101
94
  //to allow a clean recovery of the application
102
- _this.cleanup();
95
+ this.cleanup();
103
96
  throw e;
104
97
  })
105
98
  .then(
@@ -109,9 +102,8 @@ var AsynchronousQueue = /** @class */ (function () {
109
102
  //naturally give we have a DOM, the DOM is the natural event dispatch system
110
103
  //which we can use, to decouple the calls from a recursive stack call
111
104
  //(the browser engine will take care of that)
112
- function () { return _this.callForNextElementToProcess(); }).start();
113
- };
114
- return AsynchronousQueue;
115
- }());
105
+ () => this.callForNextElementToProcess()).start();
106
+ }
107
+ }
116
108
  exports.AsynchronousQueue = AsynchronousQueue;
117
109
  //# sourceMappingURL=AsyncQueue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncQueue.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/util/AsyncQueue.ts"],"names":[],"mappings":";;;AAiBA;;;;;;;;;;GAUG;AACH;IAOI;QALQ,kBAAa,GAAG,EAAE,CAAC;IAM3B,CAAC;IAKD,sBAAI,sCAAO;QAHX;;WAEG;aACH;YACI,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;QACtC,CAAC;;;OAAA;IAED;;;;;;OAMG;IACH,mCAAO,GAAP,UAAQ,OAAU,EAAE,KAAS;QAA7B,iBAYC;QAZmB,sBAAA,EAAA,SAAS;QACzB,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;SAC5B;QACD,IAAI,KAAK,EAAE;YACP,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;gBAC3B,KAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;SACN;aAAM;YACH,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;SAC/B;IACL,CAAC;IAED;;OAEG;IACH,mCAAO,GAAP;QACI,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,mCAAO,GAAP;QACI,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,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CAAC,gBAAgB,EAAE;YACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;SACnB;IACL,CAAC;IAEO,QAAQ;QACZ,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC7B,OAAO;SACV;QACD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB;aAChB,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACT,4DAA4D;YAC5D,8CAA8C;YAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,MAAM,CAAC,CAAC;QACZ,CAAC,CAAC;aACD,IAAI;QACD,yDAAyD;QACzD,wDAAwD;QACxD,kBAAkB;QAClB,4EAA4E;QAC5E,qEAAqE;QACrE,6CAA6C;QAC7C,GAAG,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAC3C,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;CACJ;AAxGD,8CAwGC"}
@@ -1,28 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
18
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
- if (ar || !(i in from)) {
20
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
21
- ar[i] = from[i];
22
- }
23
- }
24
- return to.concat(ar || Array.prototype.slice.call(from));
25
- };
26
2
  Object.defineProperty(exports, "__esModule", { value: true });
27
3
  exports.ExtConfig = exports.ExtDQ = exports.ExtDomquery = void 0;
28
4
  /*! Licensed to the Apache Software Foundation (ASF) under one or more
@@ -40,8 +16,8 @@ exports.ExtConfig = exports.ExtDQ = exports.ExtDomquery = void 0;
40
16
  * See the License for the specific language governing permissions and
41
17
  * limitations under the License.
42
18
  */
43
- var mona_dish_1 = require("mona-dish");
44
- var Const_1 = require("../core/Const");
19
+ const mona_dish_1 = require("mona-dish");
20
+ const Const_1 = require("../core/Const");
45
21
  /**
46
22
  * detects whether a source is a faces.js request
47
23
  *
@@ -49,19 +25,17 @@ var Const_1 = require("../core/Const");
49
25
  * @return true if a faces.js loading pattern is detected
50
26
  * @constructor
51
27
  */
52
- var IS_FACES_SOURCE = function (source) {
28
+ const IS_FACES_SOURCE = (source) => {
53
29
  //spec version smaller 4 we have to deal with the jsf namespace
54
- if (window.jsf) {
55
- // fallback into 2.3 api level
56
- return source && !!((source === null || source === void 0 ? void 0 : source.search(/\/javax\.faces\.resource.*\/jsf\.js.*/)) != -1 ||
57
- (source === null || source === void 0 ? void 0 : source.search(/\/jsf-development\.js.*/)) != -1 ||
58
- (source === null || source === void 0 ? void 0 : source.search(/\/jsf-uncompressed\.js.*/)) != -1 ||
59
- (source === null || source === void 0 ? void 0 : source.search(/\/jsf[^.]*\.js.*ln=javax.faces.*/gi)) != -1);
60
- }
61
30
  return source && !!((source === null || source === void 0 ? void 0 : source.search(/\/jakarta\.faces\.resource.*\/faces\.js.*/)) != -1 ||
62
31
  (source === null || source === void 0 ? void 0 : source.search(/\/faces-development\.js.*/)) != -1 ||
63
32
  (source === null || source === void 0 ? void 0 : source.search(/\/faces-uncompressed\.js.*/)) != -1 ||
64
- (source === null || source === void 0 ? void 0 : source.search(/\/faces[^.]*\.js.*ln=jakarta.faces.*/gi)) != -1);
33
+ (source === null || source === void 0 ? void 0 : source.search(/\/faces[^.]*\.js.*ln=jakarta.faces.*/gi)) != -1 ||
34
+ //fallback without check for jsf, that way we allow both bookmarks
35
+ (source === null || source === void 0 ? void 0 : source.search(/\/javax\.faces\.resource.*\/jsf\.js.*/)) != -1 ||
36
+ (source === null || source === void 0 ? void 0 : source.search(/\/jsf-development\.js.*/)) != -1 ||
37
+ (source === null || source === void 0 ? void 0 : source.search(/\/jsf-uncompressed\.js.*/)) != -1 ||
38
+ (source === null || source === void 0 ? void 0 : source.search(/\/jsf[^.]*\.js.*ln=javax.faces.*/gi)) != -1);
65
39
  };
66
40
  /**
67
41
  * namespace myfaces.testscripts can be used as extension point for internal
@@ -71,13 +45,10 @@ var IS_FACES_SOURCE = function (source) {
71
45
  * @param source the source to check
72
46
  * @constructor
73
47
  */
74
- var IS_INTERNAL_SOURCE = function (source) {
75
- if (window === null || window === void 0 ? void 0 : window.jsf) {
76
- return source.search(/\/jsf[^.]*\.js.*ln=myfaces.testscripts.*/gi) != -1;
77
- }
78
- return source.search(/\/faces[^.]*\.js.*ln=myfaces.testscripts.*/gi) != -1;
48
+ const IS_INTERNAL_SOURCE = (source) => {
49
+ return source.search(/\/faces[^.]*\.js.*ln=myfaces.testscripts.*/gi) != -1 || source.search(/\/jsf[^.]*\.js.*ln=myfaces.testscripts.*/gi) != -1;
79
50
  };
80
- var ATTR_SRC = 'src';
51
+ const ATTR_SRC = 'src';
81
52
  /**
82
53
  * Extension which adds implementation specific
83
54
  * meta data to our dom query
@@ -87,119 +58,99 @@ var ATTR_SRC = 'src';
87
58
  * nonce = el.nonce
88
59
  * windowId = el.getWindowId
89
60
  */
90
- var ExtDomquery = /** @class */ (function (_super) {
91
- __extends(ExtDomquery, _super);
92
- function ExtDomquery() {
93
- return _super !== null && _super.apply(this, arguments) || this;
61
+ class ExtDomquery extends mona_dish_1.DQ {
62
+ static get windowId() {
63
+ return new ExtDomquery(document.body).windowId;
94
64
  }
95
- Object.defineProperty(ExtDomquery, "windowId", {
96
- get: function () {
97
- return new ExtDomquery(document.body).windowId;
98
- },
99
- enumerable: false,
100
- configurable: true
101
- });
102
- Object.defineProperty(ExtDomquery, "nonce", {
103
- get: function () {
104
- return new ExtDomquery(document.body).nonce;
105
- },
106
- enumerable: false,
107
- configurable: true
108
- });
109
- Object.defineProperty(ExtDomquery.prototype, "windowId", {
110
- get: function () {
111
- var fetchWindowIdFromURL = function () {
112
- var href = window.location.href;
113
- var windowId = "windowId";
114
- var regex = new RegExp("[\\?&]" + windowId + "=([^&#\\;]*)");
115
- var results = regex.exec(href);
116
- //initial trial over the url and a regexp
117
- if (results != null)
118
- return results[1];
119
- return null;
120
- };
121
- //byId ($)
122
- if (this.value.isPresent()) {
123
- var result = this.querySelectorAll("form input[name='" + Const_1.P_WINDOW_ID + "']");
124
- if (result.length > 1) {
125
- throw Error("Multiple different windowIds found in document");
126
- }
127
- return (result.isPresent()) ? result.getAsElem(0).value.value : fetchWindowIdFromURL();
128
- }
129
- else {
130
- return fetchWindowIdFromURL();
131
- }
132
- },
133
- enumerable: false,
134
- configurable: true
135
- });
136
- Object.defineProperty(ExtDomquery.prototype, "nonce", {
137
- /*
138
- * determines the faces.js nonce and adds them to the namespace
139
- * this is done once and only lazily
140
- */
141
- get: function () {
142
- //already processed
143
- var myfacesConfig = new ExtConfig(window.myfaces);
144
- var nonce = myfacesConfig.getIf("config", "cspMeta", "nonce");
145
- if (nonce.value) {
146
- return nonce.value;
147
- }
148
- var curScript = new mona_dish_1.DQ(document.currentScript);
149
- //since our baseline atm is ie11 we cannot use document.currentScript globally
150
- if (curScript.attr("nonce").value != null) {
151
- // fastpath for modern browsers
152
- return curScript.attr("nonce").value;
153
- }
154
- // fallback if the currentScript method fails, we just search the jsf tags for nonce, this is
155
- // the last possibility
156
- var nonceScript = mona_dish_1.DQ
157
- .querySelectorAll("script[src], link[src]")
158
- .lazyStream
159
- .filter(function (item) { return item.attr("nonce").value != null && item.attr(ATTR_SRC) != null; })
160
- .map(function (item) { return IS_FACES_SOURCE(item.attr(ATTR_SRC).value); })
161
- .first();
162
- if (nonceScript.isPresent()) {
163
- nonce.value = mona_dish_1.DomQuery.byId(nonceScript.value, true).attr("nonce").value;
65
+ static get nonce() {
66
+ return new ExtDomquery(document.body).nonce;
67
+ }
68
+ get windowId() {
69
+ const fetchWindowIdFromURL = function () {
70
+ let href = window.location.href;
71
+ let windowId = "windowId";
72
+ let regex = new RegExp("[\\?&]" + windowId + "=([^&#\\;]*)");
73
+ let results = regex.exec(href);
74
+ //initial trial over the url and a regexp
75
+ if (results != null)
76
+ return results[1];
77
+ return null;
78
+ };
79
+ //byId ($)
80
+ if (this.value.isPresent()) {
81
+ let result = this.querySelectorAll("form input[name='" + Const_1.P_WINDOW_ID + "']");
82
+ if (result.length > 1) {
83
+ throw Error("Multiple different windowIds found in document");
164
84
  }
85
+ return (result.isPresent()) ? result.getAsElem(0).value.value : fetchWindowIdFromURL();
86
+ }
87
+ else {
88
+ return fetchWindowIdFromURL();
89
+ }
90
+ }
91
+ /*
92
+ * determines the faces.js nonce and adds them to the namespace
93
+ * this is done once and only lazily
94
+ */
95
+ get nonce() {
96
+ //already processed
97
+ let myfacesConfig = new ExtConfig(window.myfaces);
98
+ let nonce = myfacesConfig.getIf("config", "cspMeta", "nonce");
99
+ if (nonce.value) {
165
100
  return nonce.value;
166
- },
167
- enumerable: false,
168
- configurable: true
169
- });
170
- ExtDomquery.searchJsfJsFor = function (item) {
101
+ }
102
+ let curScript = new mona_dish_1.DQ(document.currentScript);
103
+ //since our baseline atm is ie11 we cannot use document.currentScript globally
104
+ if (curScript.attr("nonce").value != null) {
105
+ // fastpath for modern browsers
106
+ return curScript.attr("nonce").value;
107
+ }
108
+ // fallback if the currentScript method fails, we just search the jsf tags for nonce, this is
109
+ // the last possibility
110
+ let nonceScript = mona_dish_1.DQ
111
+ .querySelectorAll("script[src], link[src]")
112
+ .lazyStream
113
+ .filter((item) => item.attr("nonce").value != null && item.attr(ATTR_SRC) != null)
114
+ .map(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))
115
+ .first();
116
+ if (nonceScript.isPresent()) {
117
+ nonce.value = mona_dish_1.DomQuery.byId(nonceScript.value, true).attr("nonce").value;
118
+ }
119
+ return nonce.value;
120
+ }
121
+ static searchJsfJsFor(item) {
171
122
  return new ExtDomquery(document).searchJsfJsFor(item);
172
- };
123
+ }
173
124
  /**
174
125
  * searches the embedded faces.js for items like separator char etc..
175
126
  * expects a match as variable under position 1 in the result match
176
127
  * @param rexp
177
128
  */
178
- ExtDomquery.prototype.searchJsfJsFor = function (rexp) {
129
+ searchJsfJsFor(rexp) {
179
130
  //perfect application for lazy stream
180
131
  return mona_dish_1.DQ.querySelectorAll("script[src], link[src]").lazyStream
181
- .filter(function (item) { return IS_FACES_SOURCE(item.attr(ATTR_SRC).value); })
182
- .map(function (item) { return item.attr(ATTR_SRC).value.match(rexp); })
183
- .filter(function (item) { return item != null && item.length > 1; })
184
- .map(function (result) {
132
+ .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))
133
+ .map(item => item.attr(ATTR_SRC).value.match(rexp))
134
+ .filter(item => item != null && item.length > 1)
135
+ .map((result) => {
185
136
  return decodeURIComponent(result[1]);
186
137
  }).first();
187
- };
188
- ExtDomquery.prototype.globalEval = function (code, nonce) {
189
- return new ExtDomquery(_super.prototype.globalEval.call(this, code, nonce !== null && nonce !== void 0 ? nonce : this.nonce));
190
- };
138
+ }
139
+ globalEval(code, nonce) {
140
+ return new ExtDomquery(super.globalEval(code, nonce !== null && nonce !== void 0 ? nonce : this.nonce));
141
+ }
191
142
  /**
192
143
  * decorated run scripts which takes our jsf extensions into consideration
193
144
  * (standard DomQuery will let you pass anything)
194
145
  * @param whilteListed
195
146
  */
196
- ExtDomquery.prototype.runScripts = function (whilteListed) {
197
- var whitelistFunc = function (src) {
147
+ runScripts(whilteListed) {
148
+ const whitelistFunc = (src) => {
198
149
  var _a;
199
150
  return ((_a = whilteListed === null || whilteListed === void 0 ? void 0 : whilteListed(src)) !== null && _a !== void 0 ? _a : true) && !IS_FACES_SOURCE(src) && !IS_INTERNAL_SOURCE(src);
200
151
  };
201
- return _super.prototype.runScripts.call(this, whitelistFunc);
202
- };
152
+ return super.runScripts(whitelistFunc);
153
+ }
203
154
  /**
204
155
  * byId producer
205
156
  *
@@ -207,97 +158,73 @@ var ExtDomquery = /** @class */ (function (_super) {
207
158
  * @param deep whether the search should go into embedded shadow dom elements
208
159
  * @return a DomQuery containing the found elements
209
160
  */
210
- ExtDomquery.byId = function (selector, deep) {
211
- if (deep === void 0) { deep = false; }
212
- var ret = mona_dish_1.DomQuery.byId(selector, deep);
161
+ static byId(selector, deep = false) {
162
+ const ret = mona_dish_1.DomQuery.byId(selector, deep);
213
163
  return new ExtDomquery(ret);
214
- };
215
- return ExtDomquery;
216
- }(mona_dish_1.DQ));
164
+ }
165
+ }
217
166
  exports.ExtDomquery = ExtDomquery;
218
167
  exports.ExtDQ = ExtDomquery;
219
- var ExtConfig = /** @class */ (function (_super) {
220
- __extends(ExtConfig, _super);
221
- function ExtConfig(root) {
222
- return _super.call(this, root) || this;
168
+ /**
169
+ * in order to reduce the number of interception points for the fallbacks we add
170
+ * the namespace remapping straight to our config accessors
171
+ */
172
+ class ExtConfig extends mona_dish_1.Config {
173
+ constructor(root) {
174
+ super(root);
175
+ }
176
+ assignIf(condition, ...accessPath) {
177
+ const acessPathMapped = this.remap(accessPath);
178
+ return super.assignIf(condition, ...acessPathMapped);
179
+ }
180
+ assign(...accessPath) {
181
+ const acessPathMapped = this.remap(accessPath);
182
+ return super.assign(...acessPathMapped);
183
+ }
184
+ append(...accessPath) {
185
+ return super.append(...accessPath);
186
+ }
187
+ appendIf(condition, ...accessPath) {
188
+ const acessPathMapped = this.remap(accessPath);
189
+ return super.appendIf(condition, ...acessPathMapped);
190
+ }
191
+ getIf(...accessPath) {
192
+ const acessPathMapped = this.remap(accessPath);
193
+ return super.getIf(...acessPathMapped);
194
+ }
195
+ get(defaultVal) {
196
+ return super.get((0, Const_1.$nsp)(defaultVal));
197
+ }
198
+ delete(key) {
199
+ return super.delete((0, Const_1.$nsp)(key));
223
200
  }
224
- ExtConfig.prototype.assignIf = function (condition) {
225
- var accessPath = [];
226
- for (var _i = 1; _i < arguments.length; _i++) {
227
- accessPath[_i - 1] = arguments[_i];
228
- }
229
- var acessPathMapped = this.remap(accessPath);
230
- return _super.prototype.assignIf.apply(this, __spreadArray([condition], acessPathMapped, false));
231
- };
232
- ExtConfig.prototype.assign = function () {
233
- var accessPath = [];
234
- for (var _i = 0; _i < arguments.length; _i++) {
235
- accessPath[_i] = arguments[_i];
236
- }
237
- var acessPathMapped = this.remap(accessPath);
238
- return _super.prototype.assign.apply(this, acessPathMapped);
239
- };
240
- ExtConfig.prototype.append = function () {
241
- var accessPath = [];
242
- for (var _i = 0; _i < arguments.length; _i++) {
243
- accessPath[_i] = arguments[_i];
244
- }
245
- return _super.prototype.append.apply(this, accessPath);
246
- };
247
- ExtConfig.prototype.appendIf = function (condition) {
248
- var accessPath = [];
249
- for (var _i = 1; _i < arguments.length; _i++) {
250
- accessPath[_i - 1] = arguments[_i];
251
- }
252
- var acessPathMapped = this.remap(accessPath);
253
- return _super.prototype.appendIf.apply(this, __spreadArray([condition], acessPathMapped, false));
254
- };
255
- ExtConfig.prototype.getIf = function () {
256
- var accessPath = [];
257
- for (var _i = 0; _i < arguments.length; _i++) {
258
- accessPath[_i] = arguments[_i];
259
- }
260
- var acessPathMapped = this.remap(accessPath);
261
- return _super.prototype.getIf.apply(this, acessPathMapped);
262
- };
263
- ExtConfig.prototype.get = function (defaultVal) {
264
- return _super.prototype.get.call(this, (0, Const_1.$nsp)(defaultVal));
265
- };
266
- ExtConfig.prototype.delete = function (key) {
267
- return _super.prototype.delete.call(this, (0, Const_1.$nsp)(key));
268
- };
269
201
  /**
270
202
  * creates a config from an initial value or null
271
203
  * @param value
272
204
  */
273
- ExtConfig.fromNullable = function (value) {
205
+ static fromNullable(value) {
274
206
  return new ExtConfig(value);
275
- };
276
- ExtConfig.prototype.getClass = function () {
207
+ }
208
+ getClass() {
277
209
  return ExtConfig;
278
- };
210
+ }
279
211
  /**
280
212
  * shallow copy getter, copies only the first level, references the deeper nodes
281
213
  * in a shared manner
282
214
  */
283
- ExtConfig.prototype.shallowCopy$ = function () {
284
- var ret = _super.prototype.shallowCopy$.call(this);
215
+ shallowCopy$() {
216
+ const ret = super.shallowCopy$();
285
217
  return new ExtConfig(ret);
286
- };
287
- Object.defineProperty(ExtConfig.prototype, "deepCopy", {
288
- /**
289
- * deep copy, copies all config nodes
290
- */
291
- get: function () {
292
- return new ExtConfig(_super.prototype.deepCopy$.call(this));
293
- },
294
- enumerable: false,
295
- configurable: true
296
- });
297
- ExtConfig.prototype.remap = function (accessPath) {
298
- return mona_dish_1.Stream.of.apply(mona_dish_1.Stream, accessPath).map(function (key) { return (0, Const_1.$nsp)(key); }).collect(new mona_dish_1.ArrayCollector());
299
- };
300
- return ExtConfig;
301
- }(mona_dish_1.Config));
218
+ }
219
+ /**
220
+ * deep copy, copies all config nodes
221
+ */
222
+ get deepCopy() {
223
+ return new ExtConfig(super.deepCopy$());
224
+ }
225
+ remap(accessPath) {
226
+ return mona_dish_1.Stream.of(...accessPath).map(key => (0, Const_1.$nsp)(key)).collect(new mona_dish_1.ArrayCollector());
227
+ }
228
+ }
302
229
  exports.ExtConfig = ExtConfig;
303
230
  //# sourceMappingURL=ExtDomQuery.js.map