jsf.js_next_gen 4.0.0-beta-15 → 4.0.0-beta-17

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 (90) hide show
  1. package/README.md +24 -0
  2. package/dist/docs/assets/highlight.css +21 -0
  3. package/dist/docs/assets/search.js +1 -1
  4. package/dist/docs/index.html +15 -0
  5. package/dist/window/faces-development.js +56 -14
  6. package/dist/window/faces-development.js.br +0 -0
  7. package/dist/window/faces-development.js.gz +0 -0
  8. package/dist/window/faces-development.js.map +1 -1
  9. package/dist/window/faces.js +1 -1
  10. package/dist/window/faces.js.br +0 -0
  11. package/dist/window/faces.js.gz +0 -0
  12. package/dist/window/faces.js.map +1 -1
  13. package/dist/window/jsf-development.js +49 -15
  14. package/dist/window/jsf-development.js.br +0 -0
  15. package/dist/window/jsf-development.js.gz +0 -0
  16. package/dist/window/jsf-development.js.map +1 -1
  17. package/dist/window/jsf.js +1 -1
  18. package/dist/window/jsf.js.br +0 -0
  19. package/dist/window/jsf.js.gz +0 -0
  20. package/dist/window/jsf.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +14 -0
  23. package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
  24. package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
  25. package/src/main/typescript/@types/definitions/index.d.ts +173 -0
  26. package/src/main/typescript/api/_api.ts +11 -13
  27. package/src/main/typescript/api/faces.ts +11 -6
  28. package/src/main/typescript/api/jsf.ts +5 -8
  29. package/src/main/typescript/impl/AjaxImpl.ts +1 -2
  30. package/src/main/typescript/impl/PushImpl.ts +2 -2
  31. package/src/main/typescript/impl/core/Const.ts +0 -3
  32. package/src/main/typescript/impl/util/ExtDomQuery.ts +1 -1
  33. package/src/main/typescript/impl/util/Lang.ts +3 -4
  34. package/src/main/typescript/impl/xhrCore/ErrorData.ts +1 -2
  35. package/src/main/typescript/impl/xhrCore/EventData.ts +1 -1
  36. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +1 -2
  37. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +28 -11
  38. package/src/main/typescript/myfaces/OamSubmit.ts +5 -8
  39. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +2 -2
  40. package/src/main/typescript/test/impl/ImplTest.spec.ts +2 -1
  41. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +4 -3
  42. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +2 -2
  43. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +2 -2
  44. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +2 -2
  45. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +2 -2
  46. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +5 -4
  47. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +7 -4
  48. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +2 -2
  49. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +2 -2
  50. package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +2 -2
  51. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +2 -2
  52. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +2 -2
  53. package/src/main/typescript/tsconfig.json +6 -3
  54. package/target/api/_api.js +0 -2
  55. package/target/api/_api.js.map +1 -1
  56. package/target/api/faces.js +8 -1
  57. package/target/api/faces.js.map +1 -1
  58. package/target/api/jsf.js +1 -2
  59. package/target/api/jsf.js.map +1 -1
  60. package/target/impl/AjaxImpl.js.map +1 -1
  61. package/target/impl/PushImpl.js +2 -0
  62. package/target/impl/PushImpl.js.map +1 -1
  63. package/target/impl/core/Const.js.map +1 -1
  64. package/target/impl/util/Lang.js +0 -1
  65. package/target/impl/util/Lang.js.map +1 -1
  66. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  67. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  68. package/target/impl/xhrCore/XhrRequest.js +35 -10
  69. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  70. package/target/myfaces/OamSubmit.js +11 -0
  71. package/target/myfaces/OamSubmit.js.map +1 -1
  72. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  73. package/target/test/impl/ImplTest.spec.js.map +1 -1
  74. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  75. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  76. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  77. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  78. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  79. package/target/test/xhrCore/RequestTest.spec.js +1 -0
  80. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  81. package/target/test/xhrCore/RequestTest_23.spec.js +2 -0
  82. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  83. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  84. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  85. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  86. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  87. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  88. package/target/types/index.js +18 -0
  89. package/target/types/index.js.map +1 -0
  90. package/src/main/types/typedefs.d.ts +0 -68
@@ -3549,7 +3549,6 @@ const Const_1 = __webpack_require__(/*! ../impl/core/Const */ "./src/main/typesc
3549
3549
  //as per spec requirement
3550
3550
  var faces;
3551
3551
  (function (faces) {
3552
- faces.contextpath = '#{facesContext.externalContext.requestContextPath}';
3553
3552
  /**
3554
3553
  * Version of the implementation for the faces.ts.
3555
3554
  * <p />
@@ -3649,7 +3648,6 @@ var faces;
3649
3648
  */
3650
3649
  function request(element, event, options) {
3651
3650
  AjaxImpl_1.Implementation.request(element, event, options);
3652
- //Implementation.getInstance().requestInternal(element, event, options);
3653
3651
  }
3654
3652
  ajax.request = request;
3655
3653
  /**
@@ -4445,11 +4443,13 @@ exports.PushImpl = void 0;
4445
4443
  //TODO still work in progress
4446
4444
  //this is a 1:1 port for the time being
4447
4445
  const Const_1 = __webpack_require__(/*! ./core/Const */ "./src/main/typescript/impl/core/Const.ts");
4446
+ ;
4448
4447
  /**
4449
4448
  * Implementation class for the push functionality
4450
4449
  */
4451
4450
  var PushImpl;
4452
4451
  (function (PushImpl) {
4452
+ debugger;
4453
4453
  const URL_PROTOCOL = window.location.protocol.replace("http", "ws") + "//";
4454
4454
  //we expose the member variables for testing purposes
4455
4455
  //they are not directly touched outside of tests
@@ -5648,7 +5648,6 @@ var ExtLang;
5648
5648
  ExtLang.getLocalOrGlobalConfig = getLocalOrGlobalConfig;
5649
5649
  /**
5650
5650
  * assert that the form exists and throw an exception in the case it does not
5651
- * (TODO move this into the assertions)
5652
5651
  *
5653
5652
  * @param form the form to check for
5654
5653
  */
@@ -6915,6 +6914,15 @@ const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/im
6915
6914
  const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
6916
6915
  const RequestDataResolver_1 = __webpack_require__(/*! ./RequestDataResolver */ "./src/main/typescript/impl/xhrCore/RequestDataResolver.ts");
6917
6916
  var failSaveExecute = Lang_1.ExtLang.failSaveExecute;
6917
+ /**
6918
+ * Faces XHR Request Wrapper
6919
+ * as Asyncrunnable for our Asynchronous queue
6920
+ *
6921
+ * The idea is that we basically just enqueue
6922
+ * a single ajax request into our queue
6923
+ * and let the queue do the processing.
6924
+ *
6925
+ */
6918
6926
  class XhrRequest {
6919
6927
  /**
6920
6928
  * Reqired Parameters
@@ -7035,13 +7043,11 @@ class XhrRequest {
7035
7043
  }, data);
7036
7044
  }
7037
7045
  catch(func) {
7038
- //this.$promise.catch(func);
7039
7046
  this.catchFuncs.push(func);
7040
7047
  return this;
7041
7048
  }
7042
7049
  finally(func) {
7043
7050
  //no ie11 support we probably are going to revert to shims for that one
7044
- //(<any>this.$promise).then(func).catch(func);
7045
7051
  this.catchFuncs.push(func);
7046
7052
  this.thenFunc.push(func);
7047
7053
  return this;
@@ -7073,15 +7079,32 @@ class XhrRequest {
7073
7079
  this.onDone(this.xhrObject, resolve);
7074
7080
  };
7075
7081
  xhrObject.onerror = (errorData) => {
7082
+ // some browsers trigger an error when cancelling a request internally
7083
+ // in this case we simply ignore the request and clear up the queue, because
7084
+ // it is not safe anymore to proceed with the current queue
7085
+ // This bypasses a Safari issue where it keeps requests hanging after page unload
7086
+ // and then triggers a cancel error on then instead of just stopping
7087
+ // and clearing the code
7088
+ if (this.isCancelledResponse(this.xhrObject)) {
7089
+ reject();
7090
+ this.stopProgress = true;
7091
+ return;
7092
+ }
7076
7093
  this.onError(errorData, reject);
7077
7094
  };
7078
7095
  }
7096
+ isCancelledResponse(currentTarget) {
7097
+ return (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.status) === 0 && //cancelled by browser
7098
+ (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.readyState) === 4 &&
7099
+ (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.responseText) === '' &&
7100
+ (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.responseXML) === null;
7101
+ }
7079
7102
  /*
7080
- * xhr processing callbacks
7081
- *
7082
- * Those methods are the callbacks called by
7083
- * the xhr object depending on its own state
7084
- */
7103
+ * xhr processing callbacks
7104
+ *
7105
+ * Those methods are the callbacks called by
7106
+ * the xhr object depending on its own state
7107
+ */
7085
7108
  onAbort(reject) {
7086
7109
  reject();
7087
7110
  }
@@ -7115,13 +7138,14 @@ class XhrRequest {
7115
7138
  this.handleError(errorData, true);
7116
7139
  }
7117
7140
  finally {
7118
- //we issue a resolve in this case to allow the system to recover
7141
+ // we issue a resolve in this case to allow the system to recover
7142
+ // reject would clean up the queue
7119
7143
  resolve(errorData);
7120
- //reject();
7121
7144
  }
7122
7145
  //non blocking non clearing
7123
7146
  }
7124
7147
  onDone(data, resolve) {
7148
+ // if stop progress a special handling including resolve is already performed
7125
7149
  if (this.stopProgress) {
7126
7150
  return;
7127
7151
  }
@@ -7150,7 +7174,7 @@ class XhrRequest {
7150
7174
  try {
7151
7175
  //user code error, we might cover
7152
7176
  //this in onError but also we cannot swallow it
7153
- //we need to resolve the local handlers lazyly,
7177
+ //we need to resolve the local handlers lazily,
7154
7178
  //because some frameworks might decorate them over the context in the response
7155
7179
  let eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_EVENT);
7156
7180
  AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
@@ -7196,6 +7220,17 @@ exports.XhrRequest = XhrRequest;
7196
7220
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7197
7221
  exports.oam = void 0;
7198
7222
  const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
7223
+ /**
7224
+ * legacy code to enable various aspects
7225
+ * of myfaces, used to be rendered inline
7226
+ * for jsf 2.0 we can externalize it into its own custom resource
7227
+ *
7228
+ * note this is a straight 1:1 port from the existing codebase
7229
+ * (not too much work has been spent here, the important thing is, that
7230
+ * the namespace and functions need to be kept intact for legacy code)
7231
+ *
7232
+ * we might move the code over in the future, but for now a straight 1:1 port suffices
7233
+ */
7199
7234
  var oam;
7200
7235
  (function (oam) {
7201
7236
  /**
@@ -7335,7 +7370,6 @@ var exports = __webpack_exports__;
7335
7370
  * See the License for the specific language governing permissions and
7336
7371
  * limitations under the License.
7337
7372
  */
7338
- ///<reference types='../../types/typedefs'/>
7339
7373
 
7340
7374
  var _a, _b, _c, _d, _e;
7341
7375
  Object.defineProperty(exports, "__esModule", ({ value: true }));
@@ -7346,7 +7380,7 @@ exports.myfaces = exports.jsf = void 0;
7346
7380
  * if this file is included then the code falls back with its namespaces
7347
7381
  * on jsf2.3 or earlier level, for 4.0+ please include faces.js
7348
7382
  */
7349
- if (!window.jsf) {
7383
+ if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
7350
7384
  const faces = (__webpack_require__(/*! ./_api */ "./src/main/typescript/api/_api.ts").faces);
7351
7385
  window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces;
7352
7386
  window.jsf.specversion = 230000;
Binary file
Binary file