jsf.js_next_gen 4.0.0-RC.3 → 4.0.0-RC.30

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 (183) hide show
  1. package/dist/docs/assets/main.js +56 -52
  2. package/dist/docs/assets/style.css +23 -0
  3. package/dist/window/faces-development.js +2860 -2999
  4. package/dist/window/faces-development.js.br +0 -0
  5. package/dist/window/faces-development.js.gz +0 -0
  6. package/dist/window/faces-development.js.map +1 -1
  7. package/dist/window/faces.js +1 -1
  8. package/dist/window/faces.js.LICENSE.txt +0 -2
  9. package/dist/window/faces.js.br +0 -0
  10. package/dist/window/faces.js.gz +0 -0
  11. package/dist/window/faces.js.map +1 -1
  12. package/dist/window/jsf-development.js +2865 -3004
  13. package/dist/window/jsf-development.js.br +0 -0
  14. package/dist/window/jsf-development.js.gz +0 -0
  15. package/dist/window/jsf-development.js.map +1 -1
  16. package/dist/window/jsf.js +1 -1
  17. package/dist/window/jsf.js.LICENSE.txt +0 -2
  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 +16 -16
  22. package/src/main/test.xml +23 -0
  23. package/src/main/typescript/@types/definitions/index.d.ts +12 -7
  24. package/src/main/typescript/api/_api.ts +4 -3
  25. package/src/main/typescript/impl/AjaxImpl.ts +125 -41
  26. package/src/main/typescript/impl/core/Const.ts +52 -41
  27. package/src/main/typescript/impl/util/Assertions.ts +16 -8
  28. package/src/main/typescript/impl/util/ExtDomQuery.ts +12 -4
  29. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +89 -0
  30. package/src/main/typescript/impl/util/Lang.ts +9 -11
  31. package/src/main/typescript/impl/util/URLCodec.ts +71 -0
  32. package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
  33. package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
  34. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +15 -1
  35. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +69 -24
  36. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +4 -4
  37. package/src/main/typescript/impl/xhrCore/Response.ts +55 -38
  38. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +173 -98
  39. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +64 -158
  40. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +36 -21
  41. package/src/main/typescript/myfaces/OamSubmit.ts +29 -13
  42. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
  43. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +72 -0
  44. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
  45. package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
  46. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -3
  47. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
  48. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +2 -0
  49. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
  50. package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
  51. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +128 -15
  52. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +70 -3
  53. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +39 -3
  54. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +372 -34
  55. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
  56. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
  57. package/src/main/typescript/test.xml +6 -0
  58. package/src/main/typescript/tsconfig.json +2 -2
  59. package/src/test/resources/jsf-development.js +1 -1
  60. package/src/tmp/test.html +12 -88
  61. package/target/api/_api.js +16 -29
  62. package/target/api/_api.js.map +1 -1
  63. package/target/api/faces.js +4 -4
  64. package/target/api/faces.js.map +1 -1
  65. package/target/api/jsf.js +9 -9
  66. package/target/api/jsf.js.map +1 -1
  67. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  68. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  69. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  70. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  71. package/target/impl/AjaxImpl.js +155 -89
  72. package/target/impl/AjaxImpl.js.map +1 -1
  73. package/target/impl/PushImpl.js +45 -48
  74. package/target/impl/PushImpl.js.map +1 -1
  75. package/target/impl/core/Const.js +52 -40
  76. package/target/impl/core/Const.js.map +1 -1
  77. package/target/impl/core/Context.js +10 -0
  78. package/target/impl/core/Context.js.map +1 -0
  79. package/target/impl/core/ImplTypes.js +9 -14
  80. package/target/impl/core/ImplTypes.js.map +1 -1
  81. package/target/impl/i18n/Messages.js +3 -4
  82. package/target/impl/i18n/Messages.js.map +1 -1
  83. package/target/impl/util/Assertions.js +20 -24
  84. package/target/impl/util/Assertions.js.map +1 -1
  85. package/target/impl/util/AsyncQueue.js +28 -36
  86. package/target/impl/util/AsyncQueue.js.map +1 -1
  87. package/target/impl/util/ExtDomQuery.js +153 -221
  88. package/target/impl/util/ExtDomQuery.js.map +1 -1
  89. package/target/impl/util/HiddenElementBuilder.js +7 -0
  90. package/target/impl/util/HiddenElementBuilder.js.map +1 -0
  91. package/target/impl/util/HiddenInputBuilder.js +79 -0
  92. package/target/impl/util/HiddenInputBuilder.js.map +1 -0
  93. package/target/impl/util/Lang.js +23 -32
  94. package/target/impl/util/Lang.js.map +1 -1
  95. package/target/impl/util/URLCodec.js +69 -0
  96. package/target/impl/util/URLCodec.js.map +1 -0
  97. package/target/impl/xhrCore/ErrorData.js +41 -64
  98. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  99. package/target/impl/xhrCore/EventData.js +10 -13
  100. package/target/impl/xhrCore/EventData.js.map +1 -1
  101. package/target/impl/xhrCore/RequestContext.js +11 -0
  102. package/target/impl/xhrCore/RequestContext.js.map +1 -0
  103. package/target/impl/xhrCore/RequestDataResolver.js +71 -27
  104. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  105. package/target/impl/xhrCore/ResonseDataResolver.js +16 -16
  106. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  107. package/target/impl/xhrCore/Response.js +43 -28
  108. package/target/impl/xhrCore/Response.js.map +1 -1
  109. package/target/impl/xhrCore/ResponseProcessor.js +217 -162
  110. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  111. package/target/impl/xhrCore/XhrFormData.js +77 -199
  112. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  113. package/target/impl/xhrCore/XhrRequest.js +102 -103
  114. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  115. package/target/myfaces/OamSubmit.js +33 -24
  116. package/target/myfaces/OamSubmit.js.map +1 -1
  117. package/target/test/frameworkBase/LangTest.spec.js +46 -32
  118. package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
  119. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +238 -228
  120. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  121. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +45 -31
  122. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
  123. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +24 -33
  124. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
  125. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +8 -8
  126. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
  127. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +31 -31
  128. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  129. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +50 -48
  130. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
  131. package/target/test/frameworkBase/_ext/shared/StandardInits.js +310 -132
  132. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  133. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +235 -22
  134. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  135. package/target/test/impl/ImplTest.spec.js +32 -59
  136. package/target/test/impl/ImplTest.spec.js.map +1 -1
  137. package/target/test/impl/ImplTest_23.spec.js +32 -59
  138. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  139. package/target/test/impl/SeparatorCharsTest.spec.js +17 -17
  140. package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
  141. package/target/test/myfaces/OamSubmit.spec.js +25 -25
  142. package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
  143. package/target/test/queue/AsynchronousProbe.js +23 -29
  144. package/target/test/queue/AsynchronousProbe.js.map +1 -1
  145. package/target/test/queue/AsynchronousQueueTest.spec.js +39 -70
  146. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  147. package/target/test/xhrCore/EventTests.spec.js +43 -74
  148. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  149. package/target/test/xhrCore/FakeWebsocket.js +14 -16
  150. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  151. package/target/test/xhrCore/FileUploadTest.spec.js +47 -77
  152. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  153. package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
  154. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
  155. package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
  156. package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
  157. package/target/test/xhrCore/RequestParamsTest.spec.js +143 -72
  158. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  159. package/target/test/xhrCore/RequestTest.spec.js +173 -149
  160. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  161. package/target/test/xhrCore/RequestTest_23.spec.js +127 -142
  162. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  163. package/target/test/xhrCore/ResponseTest.spec.js +415 -100
  164. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  165. package/target/test/xhrCore/ResponseTest23.spec.js +152 -91
  166. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  167. package/target/test/xhrCore/ShadowDomTest.spec.js +30 -61
  168. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  169. package/target/test/xhrCore/WebsocketTest.js +60 -93
  170. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  171. package/target/test/xhrCore/XhrFormDataTest.spec.js +79 -30
  172. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  173. package/target/test-classes/.gz +0 -0
  174. package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
  175. package/target/test-classes/fileuploadtest.html +24 -0
  176. package/target/test-classes/jsf-development.js +3559 -0
  177. package/target/test-classes/jsf-development.js.br +0 -0
  178. package/target/test-classes/jsf-development.js.gz +0 -0
  179. package/target/test-classes/jsf-development.js.map +1 -0
  180. package/target/test-classes/jsf.js +3 -0
  181. package/target/test-classes/jsf.js.br +0 -0
  182. package/target/test-classes/jsf.js.gz +0 -0
  183. package/tmp.xml +36 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsf.js_next_gen",
3
- "version": "4.0.0-RC.3",
3
+ "version": "4.0.0-RC.30",
4
4
  "description": "A next generation typescript reimplementation of jsf.js",
5
5
  "main": "dist/window/faces.js",
6
6
  "scripts": {
@@ -21,33 +21,33 @@
21
21
  "license": "Apache-2.0",
22
22
  "devDependencies": {
23
23
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
24
- "@types/chai": "^4.3.3",
25
- "@types/mocha": "^10.0.0",
26
- "@types/node": "^18.11.9",
24
+ "@types/chai": "^4.3.4",
25
+ "@types/mocha": "^10.0.1",
26
+ "@types/node": "^18.11.18",
27
27
  "@types/sinon": "^10.0.13",
28
28
  "babel-plugin-syntax-dynamic-import": "^6.18.0",
29
- "chai": "^4.3.6",
29
+ "chai": "^4.3.7",
30
30
  "compression-webpack-plugin": "^10.0.0",
31
31
  "html-webpack-plugin": "^5.5.0",
32
32
  "http-server": "^14.1.1",
33
- "jsdom": "^20.0.2",
33
+ "jsdom": "^21.1.0",
34
34
  "jsdom-global": "^3.0.2",
35
- "mocha": "^10.1.0",
36
- "npm-check-updates": "^16.3.16",
35
+ "mocha": "^10.2.0",
36
+ "npm-check-updates": "^16.6.3",
37
37
  "nyc": "^15.1.0",
38
38
  "replace-in-file": "^6.3.5",
39
- "rxjs": "^7.5.7",
40
- "sinon": "^14.0.1",
39
+ "rxjs": "^7.8.0",
40
+ "sinon": "^15.0.1",
41
41
  "terser-webpack-plugin": "^5.3.6",
42
- "ts-loader": "^9.4.1",
42
+ "ts-loader": "^9.4.2",
43
43
  "ts-node": "^10.9.1",
44
- "typedoc": "^0.23.20",
45
- "typescript": "^4.8.4",
46
- "webpack": "^5.74.0",
47
- "webpack-cli": "^4.10.0",
44
+ "typedoc": "^0.23.24",
45
+ "typescript": "^4.9.5",
46
+ "webpack": "^5.75.0",
47
+ "webpack-cli": "^5.0.1",
48
48
  "webpack-dev-server": "^4.11.1"
49
49
  },
50
50
  "dependencies": {
51
- "mona-dish": "^0.23.6"
51
+ "mona-dish": "^0.24.6"
52
52
  }
53
53
  }
@@ -0,0 +1,23 @@
1
+ <partial-response id="viewroot_1">
2
+ <changes>
3
+ <update id="panel2"><![CDATA[
4
+ <div id="panel2">
5
+ after update
6
+ <form id="form2" name="form2" method="post" action="booga2"
7
+ ><a href="#" id="form2:link" name="form2:link"></a>
8
+ <input type="hidden" name="form2_SUBMIT" value="1"/></form>
9
+ </div>
10
+ ]]>
11
+ </update>
12
+ <update id="panel3"><![CDATA[
13
+ <div id="panel3">
14
+ after update
15
+ <form id="form3" name="form3" method="post" action="booga3"
16
+ ><a href="#" id="form3:link" name="form3:link"></a>
17
+ </form>
18
+ </div>
19
+ ]]>
20
+ </update>
21
+ <update id="j_id__v_0:jakarta.faces.ViewState:1"><![CDATA[booga_after_update]]></update>
22
+ </changes>
23
+ </partial-response>
@@ -23,17 +23,20 @@
23
23
  declare global {
24
24
 
25
25
  type Consumer<T> = (s?: T) => void;
26
+ type Tuple<V,K> = [V, K];
27
+ type Tuples<V,K> = [Tuple<V, K>];
26
28
  type AssocArr<T> = { [key: string]: T };
27
29
  type EvalFuncs = Array<Function | string>;
28
30
 
29
31
 
30
32
  type Options = {
31
- execute ?: string, //space separated list of client ids
32
- onevent ?: Function, // event handler callback
33
- onerror ?: Function, // error handler callback
34
- params ?: {[key: string]: any} | [[string, any]], //passthrough params
35
- delay ?: number, // delay in milliseconds
36
- resetValues ?: boolean, //if set to true jakarta.faces.partial.resetValues is sent
33
+ render ?: string,
34
+ execute ?: string, //space separated list of client ids
35
+ onevent ?: Function, // event handler callback
36
+ onerror ?: Function, // error handler callback
37
+ params ?: AssocArr<any>, // passthrough params
38
+ delay ?: number, // delay in milliseconds
39
+ resetValues ?: boolean, // if set to true jakarta.faces.partial.resetValues is sent
37
40
  /* @deprecated non-spec conform fallback behavior that anything can be passed and is used as passthrough */
38
41
  [key: string]: any
39
42
  }
@@ -118,7 +121,7 @@ declare global {
118
121
  interface OAM {
119
122
  clearHiddenInput(formName: string, name: string): void;
120
123
  setHiddenInput(formName: string, name: string, value: string): void;
121
- submitForm(formName: string, linkId: string, target: string, params: { [key: string]: any }): boolean;
124
+ submitForm(formName: string, linkId?: string |null, target?: string | null, params?: AssocArr<any> |Tuples<string, any> | null): boolean;
122
125
  }
123
126
 
124
127
  interface MyFacesAPI {
@@ -131,6 +134,8 @@ declare global {
131
134
  };
132
135
  }
133
136
 
137
+
138
+
134
139
  /*
135
140
  * Global namespaces type definitions
136
141
  */
@@ -16,7 +16,7 @@
16
16
  import {Implementation} from "../impl/AjaxImpl";
17
17
  import {PushImpl} from "../impl/PushImpl";
18
18
  import {oam as _oam} from "../myfaces/OamSubmit";
19
- import {$nsp, CTX_PARAM_EXECUTE, CTX_PARAM_RENDER, P_BEHAVIOR_EVENT} from "../impl/core/Const";
19
+ import {$nsp, CTX_OPTIONS_EXECUTE, CTX_OPTIONS_PARAMS, CTX_PARAM_RENDER, P_BEHAVIOR_EVENT} from "../impl/core/Const";
20
20
  import {ErrorData} from "../impl/xhrCore/ErrorData";
21
21
  import {EventData} from "../impl/xhrCore/EventData";
22
22
 
@@ -254,10 +254,11 @@ export module myfaces {
254
254
  */
255
255
  export function ab(source: Element, event: Event, eventName: string, execute: string, render: string, options: Options = {}): void {
256
256
  if (eventName) {
257
- options[$nsp(P_BEHAVIOR_EVENT)] = eventName;
257
+ options[CTX_OPTIONS_PARAMS] = options?.[CTX_OPTIONS_PARAMS] ?? {};
258
+ options[CTX_OPTIONS_PARAMS][$nsp(P_BEHAVIOR_EVENT)] = eventName;
258
259
  }
259
260
  if (execute) {
260
- options[CTX_PARAM_EXECUTE] = execute;
261
+ options[CTX_OPTIONS_EXECUTE] = execute;
261
262
  }
262
263
  if (render) {
263
264
  options[CTX_PARAM_RENDER] = render;
@@ -21,17 +21,16 @@ import {AsynchronousQueue} from "./util/AsyncQueue";
21
21
  import {AssocArrayCollector, Config, DQ, Lang, LazyStream, Optional, Stream} from "mona-dish";
22
22
  import {Assertions} from "./util/Assertions";
23
23
  import {XhrFormData} from "./xhrCore/XhrFormData";
24
- import {ExtDomQuery} from "./util/ExtDomQuery";
24
+ import {ExtConfig, ExtDomQuery} from "./util/ExtDomQuery";
25
25
  import {ErrorData} from "./xhrCore/ErrorData";
26
26
  import {EventData} from "./xhrCore/EventData";
27
27
  import {ExtLang} from "./util/Lang";
28
28
 
29
29
  import {
30
- CTX_PARAM_EXECUTE,
31
- CTX_PARAM_PASS_THR,
30
+ CTX_OPTIONS_EXECUTE,
31
+ CTX_PARAM_REQ_PASS_THR,
32
32
  CTX_PARAM_SRC_CTL_ID,
33
33
  CTX_PARAM_SRC_FRM_ID,
34
- CTX_PARAM_TR_TYPE,
35
34
  IDENT_ALL,
36
35
  IDENT_FORM,
37
36
  IDENT_NONE,
@@ -48,16 +47,23 @@ import {
48
47
  P_RESET_VALUES,
49
48
  P_WINDOW_ID,
50
49
  CTX_PARAM_RENDER,
51
- REQ_TYPE_POST,
52
50
  SOURCE,
53
- TAG_FORM, CTX_PARAM_SPEC_PARAMS
51
+ HTML_TAG_FORM,
52
+ CTX_OPTIONS_PARAMS,
53
+ VIEW_ID,
54
+ $faces,
55
+ EMPTY_STR,
56
+ CTX_PARAM_MF_INTERNAL,
57
+ NAMED_VIEWROOT,
58
+ NAMING_CONTAINER_ID
54
59
  } from "./core/Const";
55
60
  import {
56
61
  resolveDefaults,
57
62
  resolveDelay,
58
63
  resolveForm,
59
- resolveTimeout
64
+ resolveTimeout, resolveViewId, resolveViewRootId, resoveNamingContainerMapper
60
65
  } from "./xhrCore/RequestDataResolver";
66
+ import {encodeFormData} from "./util/URLCodec";
61
67
 
62
68
  /*
63
69
  * allowed project stages
@@ -243,15 +249,14 @@ export module Implementation {
243
249
  export function request(el: ElemDef, event?: Event, opts ?: Options) {
244
250
 
245
251
  const {
246
- resolvedEvent,
247
252
  options,
248
253
  elem,
249
254
  elementId,
250
- requestCtx,
251
- internalCtx,
252
255
  windowId,
253
256
  isResetValues
254
257
  } = resolveDefaults(event, opts, el);
258
+ const requestCtx = new ExtConfig({});
259
+ const internalCtx = new ExtConfig({});
255
260
 
256
261
  Assertions.assertRequestIntegrity(options, elem);
257
262
 
@@ -262,7 +267,8 @@ export module Implementation {
262
267
  * so that people can use dummy forms and work
263
268
  * with detached objects
264
269
  */
265
- const form: DQ = resolveForm(requestCtx, elem, resolvedEvent);
270
+ const form: DQ = resolveForm(elem, event);
271
+ const viewId: string = resolveViewId(form);
266
272
  const formId = form.id.value;
267
273
  const delay: number = resolveDelay(options);
268
274
  const timeout: number = resolveTimeout(options);
@@ -270,12 +276,19 @@ export module Implementation {
270
276
  requestCtx.assignIf(!!windowId, P_WINDOW_ID).value = windowId;
271
277
 
272
278
  // old non spec behavior will be removed after it is clear whether the removal breaks any code
273
- requestCtx.assign(CTX_PARAM_PASS_THR).value = filterPassThroughValues(options.value);
279
+ requestCtx.assign(CTX_PARAM_REQ_PASS_THR).value = extractLegacyParams(options.value);
274
280
 
275
281
  // spec conform behavior, all passthrough params must be under "passthrough
276
- const params = remapArrayToAssocArr(options.getIf(CTX_PARAM_SPEC_PARAMS).orElse({}).value);
277
- requestCtx.getIf(CTX_PARAM_PASS_THR).shallowMerge(new Config(params), true);
278
- requestCtx.assignIf(!!resolvedEvent, CTX_PARAM_PASS_THR, P_EVT).value = resolvedEvent?.type;
282
+ const params = remapArrayToAssocArr(options.getIf(CTX_OPTIONS_PARAMS).orElse({}).value);
283
+ //we turn off the remapping for the param merge, because we do not want to have
284
+ //any namespacing to be remapped
285
+
286
+ let ctxPassthrough = requestCtx.getIf(CTX_PARAM_REQ_PASS_THR) as ExtConfig;
287
+ ctxPassthrough.$nspEnabled = false;
288
+ ctxPassthrough.shallowMerge(new Config(params), true);
289
+ //now we turn it on again
290
+ ctxPassthrough.$nspEnabled = true;
291
+ requestCtx.assignIf(!!event, CTX_PARAM_REQ_PASS_THR, P_EVT).value = event?.type;
279
292
 
280
293
  /**
281
294
  * ajax pass through context with the source
@@ -283,6 +296,8 @@ export module Implementation {
283
296
  */
284
297
  requestCtx.assign(SOURCE).value = elementId;
285
298
 
299
+ requestCtx.assign(VIEW_ID).value = viewId;
300
+
286
301
  /**
287
302
  * on resolvedEvent and onError...
288
303
  * those values will be traversed later on
@@ -299,12 +314,12 @@ export module Implementation {
299
314
  /**
300
315
  * binding contract the jakarta.faces.source must be set
301
316
  */
302
- requestCtx.assign(CTX_PARAM_PASS_THR, P_PARTIAL_SOURCE).value = elementId;
317
+ requestCtx.assign(CTX_PARAM_REQ_PASS_THR, P_PARTIAL_SOURCE).value = elementId;
303
318
 
304
319
  /**
305
320
  * jakarta.faces.partial.ajax must be set to true
306
321
  */
307
- requestCtx.assign(CTX_PARAM_PASS_THR, P_AJAX).value = true;
322
+ requestCtx.assign(CTX_PARAM_REQ_PASS_THR, P_AJAX).value = true;
308
323
 
309
324
  /**
310
325
  * if resetValues is set to true
@@ -313,7 +328,7 @@ export module Implementation {
313
328
  * the value has to be explicitly true, according to
314
329
  * the specs jsdoc
315
330
  */
316
- requestCtx.assignIf(isResetValues, CTX_PARAM_PASS_THR, P_RESET_VALUES).value = true;
331
+ requestCtx.assignIf(isResetValues, CTX_PARAM_REQ_PASS_THR, P_RESET_VALUES).value = true;
317
332
 
318
333
  // additional meta information to speed things up, note internal non jsf
319
334
  // pass through options are stored under _mfInternal in the context
@@ -324,13 +339,13 @@ export module Implementation {
324
339
  // mojarra under blackbox conditions.
325
340
  // I assume it does the same as our formId_submit=1 so leaving it out
326
341
  // won't hurt but for the sake of compatibility we are going to add it
327
- requestCtx.assign(CTX_PARAM_PASS_THR, formId).value = formId;
342
+ requestCtx.assign(CTX_PARAM_REQ_PASS_THR, formId).value = formId;
328
343
  internalCtx.assign(CTX_PARAM_SRC_CTL_ID).value = elementId;
329
- internalCtx.assign(CTX_PARAM_TR_TYPE).value = REQ_TYPE_POST;
330
344
 
331
345
  assignClientWindowId(form, requestCtx);
332
346
  assignExecute(options, requestCtx, form, elementId);
333
347
  assignRender(options, requestCtx, form, elementId);
348
+ assignNamingContainerData(internalCtx, form);
334
349
 
335
350
  //now we enqueue the request as asynchronous runnable into our request
336
351
  //queue and let the queue take over the rest
@@ -512,12 +527,18 @@ export module Implementation {
512
527
  */
513
528
 
514
529
  let element: DQ = DQ.byId(form, true);
515
- if (!element.isTag(TAG_FORM)) {
530
+ if (!element.isTag(HTML_TAG_FORM)) {
516
531
  throw new Error(getMessage("ERR_VIEWSTATE"));
517
532
  }
518
533
 
519
- let formData = new XhrFormData(element);
520
- return formData.toString();
534
+ // determine the naming container scenario
535
+ const dummyContext = new Config({});
536
+ assignNamingContainerData(dummyContext, DQ.byId(form))
537
+ // fetch all non file input form elements
538
+ let formElements = element.deepElements.encodeFormElement()
539
+
540
+ // encode them! (file inputs are handled differently and are not part of the viewstate)
541
+ return encodeFormData(formElements, resoveNamingContainerMapper(dummyContext));
521
542
  }
522
543
 
523
544
  /**
@@ -531,7 +552,7 @@ export module Implementation {
531
552
  *
532
553
  * adds a new request to our queue for further processing
533
554
  */
534
- addRequestToQueue: function (elem: DQ, form: DQ, reqCtx: Config, respPassThr: Config, delay = 0, timeout = 0) {
555
+ addRequestToQueue: function (elem: DQ, form: DQ, reqCtx: ExtConfig, respPassThr: Config, delay = 0, timeout = 0) {
535
556
  requestQueue = requestQueue ?? new AsynchronousQueue<XhrRequest>();
536
557
  requestQueue.enqueue(new XhrRequest(elem, form, reqCtx, respPassThr, [], timeout), delay);
537
558
  }
@@ -553,7 +574,7 @@ export module Implementation {
553
574
  */
554
575
  function assignRender(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {
555
576
  if (requestOptions.getIf(CTX_PARAM_RENDER).isPresent()) {
556
- remapDefaultConstants(targetContext.getIf(CTX_PARAM_PASS_THR).get({}), P_RENDER, <string>requestOptions.getIf(CTX_PARAM_RENDER).value, issuingForm, <any>sourceElementId);
577
+ remapDefaultConstants(targetContext.getIf(CTX_PARAM_REQ_PASS_THR).get({}), P_RENDER, <string>requestOptions.getIf(CTX_PARAM_RENDER).value, issuingForm, <any>sourceElementId, targetContext.getIf(VIEW_ID).value);
557
578
  }
558
579
  }
559
580
 
@@ -571,15 +592,15 @@ export module Implementation {
571
592
  */
572
593
  function assignExecute(requestOptions: Config, targetContext: Config, issuingForm: DQ, sourceElementId: string) {
573
594
 
574
- if (requestOptions.getIf(CTX_PARAM_EXECUTE).isPresent()) {
595
+ if (requestOptions.getIf(CTX_OPTIONS_EXECUTE).isPresent()) {
575
596
  /*the options must be a blank delimited list of strings*/
576
597
  /*compliance with Mojarra which automatically adds @this to an execute
577
598
  * the spec rev 2.0a however states, if none is issued nothing at all should be sent down
578
599
  */
579
- requestOptions.assign(CTX_PARAM_EXECUTE).value = [requestOptions.getIf(CTX_PARAM_EXECUTE).value, IDENT_THIS].join(" ");
580
- remapDefaultConstants(targetContext.getIf(CTX_PARAM_PASS_THR).get({}), P_EXECUTE, <string>requestOptions.getIf(CTX_PARAM_EXECUTE).value, issuingForm, <any>sourceElementId);
600
+ requestOptions.assign(CTX_OPTIONS_EXECUTE).value = [requestOptions.getIf(CTX_OPTIONS_EXECUTE).value, IDENT_THIS].join(" ");
601
+ remapDefaultConstants(targetContext.getIf(CTX_PARAM_REQ_PASS_THR).get({}), P_EXECUTE, <string>requestOptions.getIf(CTX_OPTIONS_EXECUTE).value, issuingForm, <any>sourceElementId, targetContext.getIf(VIEW_ID).value);
581
602
  } else {
582
- targetContext.assign(CTX_PARAM_PASS_THR, P_EXECUTE).value = sourceElementId;
603
+ targetContext.assign(CTX_PARAM_REQ_PASS_THR, P_EXECUTE).value = sourceElementId;
583
604
  }
584
605
  }
585
606
 
@@ -591,16 +612,33 @@ export module Implementation {
591
612
  */
592
613
  function assignClientWindowId(form: DQ, targetContext: Config) {
593
614
 
594
- let clientWindow = (window?.faces ?? window?.jsf).getClientWindow(form.getAsElem(0).value);
615
+ let clientWindow = $faces().getClientWindow(form.getAsElem(0).value);
595
616
  if (clientWindow) {
596
- targetContext.assign(CTX_PARAM_PASS_THR, P_CLIENT_WINDOW).value = clientWindow;
617
+ targetContext.assign(CTX_PARAM_REQ_PASS_THR, P_CLIENT_WINDOW).value = clientWindow;
618
+ }
619
+ }
620
+
621
+ /**
622
+ * determines the current naming container
623
+ * and assigns it internally
624
+ *
625
+ * @param internalContext
626
+ * @param formElement
627
+ * @private
628
+ */
629
+ function assignNamingContainerData(internalContext: Config, formElement: DQ) {
630
+ const viewRootId = resolveViewRootId(formElement);
631
+
632
+ if(!!viewRootId) {
633
+ internalContext.assign(NAMED_VIEWROOT).value = true;
634
+ internalContext.assign(NAMING_CONTAINER_ID).value = viewRootId;
597
635
  }
598
636
  }
599
637
 
600
638
  /**
601
639
  * transforms the user values to the expected one
602
640
  * with the proper none all form and this handling
603
- * (note we also could use a simple string replace but then
641
+ * (note we also could use a simple string replace, but then
604
642
  * we would have had double entries under some circumstances)
605
643
  *
606
644
  * there are several standardized constants which need a special treatment
@@ -611,14 +649,60 @@ export module Implementation {
611
649
  * @param userValues the passed user values (aka input string which needs to be transformed)
612
650
  * @param issuingForm the form where the issuing element originates
613
651
  * @param issuingElementId the issuing element
652
+ * @param rootNamingContainerId the naming container id ("" default if none is given)
614
653
  */
615
- function remapDefaultConstants(targetConfig: Config, targetKey: string, userValues: string, issuingForm: DQ, issuingElementId: string): Config {
654
+ function remapDefaultConstants(targetConfig: Config, targetKey: string, userValues: string, issuingForm: DQ, issuingElementId: string, rootNamingContainerId: string = ""): Config {
616
655
  //a cleaner implementation of the transform list method
617
-
656
+ const SEP = $faces().separatorchar;
618
657
  let iterValues: string[] = (userValues) ? trim(userValues).split(/\s+/gi) : [];
619
658
  let ret = [];
620
659
  let processed: {[key: string]: boolean} = {};
621
660
 
661
+ /**
662
+ * remaps the client ids for the portlet case so that the server
663
+ * can deal with them either prefixed ir not
664
+ * also resolves the absolute id case (it was assumed the server does this, but
665
+ * apparently the RI does not, so we have to follow the RI behavior here)
666
+ * @param componentIdToTransform the componentId which needs post processing
667
+ */
668
+ const remapNamingContainer = componentIdToTransform => {
669
+ // pattern :<anything> must be prepended by viewRoot if there is one,
670
+ // otherwise we are in a not namespaced then only the id has to match
671
+ const rootNamingContainerPrefix = (rootNamingContainerId.length) ? rootNamingContainerId+SEP : EMPTY_STR;
672
+ let formClientId = issuingForm.id.value;
673
+ // nearest parent naming container relative to the form
674
+ const nearestNamingContainer = formClientId.substring(0, formClientId.lastIndexOf(SEP));
675
+ const nearestNamingContainerPrefix = (nearestNamingContainer.length) ? nearestNamingContainer + SEP : EMPTY_STR;
676
+ // Absolute search expressions, always start with SEP or the name of the root naming container
677
+ const hasLeadingSep = componentIdToTransform.indexOf(SEP) === 0;
678
+ const isAbsolutSearchExpr = hasLeadingSep || (rootNamingContainerId.length
679
+ && componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0);
680
+ let finalIdentifier = "";
681
+ if (isAbsolutSearchExpr) {
682
+ //we cut off the leading sep if there is one
683
+ componentIdToTransform = hasLeadingSep ? componentIdToTransform.substring(1) : componentIdToTransform;
684
+ componentIdToTransform = componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0 ? componentIdToTransform.substring(rootNamingContainerPrefix.length) : componentIdToTransform;
685
+ //now we prepend either the prefix or "" from the cut-off string to get the final result
686
+ finalIdentifier = [rootNamingContainerPrefix, componentIdToTransform].join(EMPTY_STR);
687
+ } else { //relative search according to the javadoc
688
+ //we cut off the root naming container id from the form
689
+ if (formClientId.indexOf(rootNamingContainerPrefix) == 0) {
690
+ formClientId = formClientId.substring(rootNamingContainerPrefix.length);
691
+ }
692
+
693
+ //If prependId = true, the outer form id must be present in the id if same form
694
+ let hasPrependId = componentIdToTransform.indexOf(formClientId) == 0;
695
+ finalIdentifier = hasPrependId ?
696
+ [rootNamingContainerPrefix, componentIdToTransform].join(EMPTY_STR) :
697
+ [nearestNamingContainerPrefix, componentIdToTransform].join(EMPTY_STR);
698
+ }
699
+ // We need to double check because we have scenarios where we have a naming container
700
+ // and no prepend (aka tobago testcase "must handle ':' in IDs properly", scenario 3,
701
+ // in this case we return the component id, and be happy
702
+ // we can roll a dom check here
703
+ return (!!document.getElementById(finalIdentifier)) ? finalIdentifier : componentIdToTransform;
704
+ };
705
+
622
706
  // in this case we do not use lazy stream because it wont bring any code reduction
623
707
  // or speedup
624
708
  for (let cnt = 0; cnt < iterValues.length; cnt++) {
@@ -636,39 +720,39 @@ export module Implementation {
636
720
  return targetConfig;
637
721
  //@form pushes the issuing form id into our list
638
722
  case IDENT_FORM:
639
- ret.push(issuingForm.id.value);
723
+ ret.push(remapNamingContainer(issuingForm.id.value));
640
724
  processed[issuingForm.id.value] = true;
641
725
  break;
642
726
  //@this is replaced with the current issuing element id
643
727
  case IDENT_THIS:
644
728
  if (!(issuingElementId in processed)) {
645
- ret.push(issuingElementId);
729
+ ret.push(remapNamingContainer(issuingElementId));
646
730
  processed[issuingElementId] = true;
647
731
  }
648
732
  break;
649
733
  default:
650
- ret.push(iterValues[cnt]);
734
+ ret.push(remapNamingContainer(iterValues[cnt]));
651
735
  processed[iterValues[cnt]] = true;
652
736
  }
653
737
  }
654
- //We now add the target as joined list
738
+
655
739
  targetConfig.assign(targetKey).value = ret.join(" ");
656
740
  return targetConfig;
657
741
  }
658
742
 
659
743
  /**
660
744
  * Filter the options given with a blacklist, so that only
661
- * the values required for pass-through are processed in the ajax request
745
+ * the values required for params-through are processed in the ajax request
662
746
  *
663
747
  * Note this is a bug carried over from the old implementation
664
748
  * the spec conform behavior is to use params for passthrough values
665
- * this will be removed soon, after it is cleared up wheter removing
749
+ * this will be removed soon, after it is cleared up whether removing
666
750
  * it breaks any legacy code
667
751
  *
668
752
  * @param {Context} mappedOpts the options to be filtered
669
753
  * @deprecated
670
754
  */
671
- function filterPassThroughValues(mappedOpts: Context): Context {
755
+ function extractLegacyParams(mappedOpts: Options): Context {
672
756
  //we now can use the full code reduction given by our stream api
673
757
  //to filter
674
758
  return Stream.ofAssoc(mappedOpts)
@@ -17,9 +17,16 @@
17
17
  /*
18
18
  * [export const] constants
19
19
  */
20
+
21
+ export const XML_ATTR_NAMED_VIEWROOT = "namedViewRoot";
22
+ export const NAMED_VIEWROOT = "namedViewRoot";
23
+
20
24
  export const P_PARTIAL_SOURCE = "jakarta.faces.source";
21
- export const PARTIAL_ID = "partialId";
25
+ export const NAMING_CONTAINER_ID = "myfaces.partialId";
26
+
27
+ export const VIEW_ID = "myfaces.viewId";
22
28
  export const P_VIEWSTATE = "jakarta.faces.ViewState";
29
+ export const P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
23
30
  export const P_VIEWROOT = "jakarta.faces.ViewRoot";
24
31
  export const P_VIEWHEAD = "jakarta.faces.ViewHead";
25
32
  export const P_VIEWBODY = "jakarta.faces.ViewBody";
@@ -33,7 +40,8 @@ export const EMPTY_FUNC = Object.freeze(() => {
33
40
  export const EMPTY_STR = "";
34
41
  export const EMPTY_MAP = Object.freeze({});
35
42
 
36
- export const HTML_VIEWSTATE = ["<input type='hidden'", "id='", P_VIEWSTATE, "' name='", P_VIEWSTATE, "' value='' />"].join(EMPTY_STR);
43
+ export const HTML_VIEWSTATE = ["<input type='hidden'", "name='", P_VIEWSTATE, "' value='' />"].join(EMPTY_STR);
44
+ export const HTML_CLIENT_WINDOW = ["<input type='hidden'", "' name='", P_CLIENT_WINDOW, "' value='' />"].join(EMPTY_STR);
37
45
 
38
46
 
39
47
  /*internal identifiers for options*/
@@ -46,8 +54,10 @@ export const IDENT_FORM = "@form";
46
54
  export const P_AJAX = "jakarta.faces.partial.ajax";
47
55
  export const P_EXECUTE = "jakarta.faces.partial.execute";
48
56
  export const P_RENDER = "jakarta.faces.partial.render";
57
+ /*render override for viewbody or viewroot, in both cases an all is performed*/
58
+ export const P_RENDER_OVERRIDE = "_myfaces.rendeOverride";
49
59
  export const P_EVT = "jakarta.faces.partial.event";
50
- export const P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
60
+
51
61
  export const P_RESET_VALUES = "jakarta.faces.partial.resetValues";
52
62
  export const P_WINDOW_ID = "jakarta.faces.windowId";
53
63
 
@@ -87,21 +97,17 @@ export const SERVER_ERROR = "serverError";
87
97
  export const CLIENT_ERROR = "clientError";
88
98
  export const TIMEOUT_EVENT = "timeout";
89
99
 
90
- export const CTX_PARAM_MF_INTERNAL = "_mfInternal";
91
-
92
- export const CTX_PARAM_SRC_FRM_ID = "_mfSourceFormId";
93
- export const CTX_PARAM_SRC_CTL_ID = "_mfSourceControlId";
94
- export const CTX_PARAM_TR_TYPE = "_mfTransportType";
95
- export const CTX_PARAM_PASS_THR = "passThrgh";
96
- export const CTX_PARAM_SPEC_PARAMS = "params";
97
-
98
- export const CTX_PARAM_DELAY = "delay";
99
- export const CTX_PARAM_TIMEOUT = "timeout";
100
- export const CTX_PARAM_RST = "resetValues";
101
- export const CTX_PARAM_EXECUTE = "execute";
102
-
103
- export const STAGE_DEVELOPMENT = "Development";
100
+ export const CTX_OPTIONS_PARAMS = "params";
101
+ export const CTX_OPTIONS_DELAY = "delay";
102
+ export const DELAY_NONE = 'none';
103
+ export const CTX_OPTIONS_TIMEOUT = "timeout";
104
+ export const CTX_OPTIONS_RESET = "resetValues";
105
+ export const CTX_OPTIONS_EXECUTE = "execute";
104
106
 
107
+ export const CTX_PARAM_MF_INTERNAL = "myfaces.internal";
108
+ export const CTX_PARAM_SRC_FRM_ID = "myfaces.source.formId";
109
+ export const CTX_PARAM_SRC_CTL_ID = "myfaces.source.controlId";
110
+ export const CTX_PARAM_REQ_PASS_THR = "myfaces.request.passThrough";
105
111
 
106
112
  export const CONTENT_TYPE = "Content-Type";
107
113
  export const HEAD_FACES_REQ = "Faces-Request";
@@ -118,13 +124,12 @@ export const MULTIPART = "multipart/form-data";
118
124
  export const NO_TIMEOUT = 0;
119
125
  export const STD_ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
120
126
 
121
- export const TAG_HEAD = "head";
122
- export const TAG_FORM = "form";
123
- export const TAG_BODY = "body";
124
- export const TAG_BEFORE = "before";
125
- export const TAG_AFTER = "after";
126
-
127
- export const TAG_ATTR = "attribute";
127
+ export const HTML_TAG_HEAD = "HEAD";
128
+ export const HTML_TAG_FORM = "FORM";
129
+ export const HTML_TAG_BODY = "BODY";
130
+ export const HTML_TAG_LINK = "LINK";
131
+ export const HTML_TAG_SCRIPT = "SCRIPT";
132
+ export const HTML_TAG_STYLE = "STYLE";
128
133
 
129
134
 
130
135
  export const SEL_VIEWSTATE_ELEM = "[name='" + P_VIEWSTATE + "']";
@@ -142,38 +147,40 @@ export const ATTR_VALUE = "value";
142
147
  export const ATTR_ID = "id";
143
148
 
144
149
  /*partial response types*/
145
- export const RESP_PARTIAL = "partial-response";
150
+ export const XML_TAG_PARTIAL_RESP = "partial-response";
146
151
 
147
152
  /*partial commands*/
148
- export const CMD_CHANGES = "changes";
149
- export const CMD_UPDATE = "update";
150
- export const CMD_DELETE = "delete";
151
- export const CMD_INSERT = "insert";
152
- export const CMD_EVAL = "eval";
153
- export const CMD_ERROR = "error";
154
- export const CMD_ATTRIBUTES = "attributes";
155
- export const CMD_EXTENSION = "extension";
156
- export const CMD_REDIRECT = "redirect";
153
+ export const XML_TAG_CHANGES = "changes";
154
+ export const XML_TAG_UPDATE = "update";
155
+ export const XML_TAG_DELETE = "delete";
156
+ export const XML_TAG_INSERT = "insert";
157
+ export const XML_TAG_EVAL = "eval";
158
+ export const XML_TAG_ERROR = "error";
159
+ export const XML_TAG_ATTRIBUTES = "attributes";
160
+ export const XML_TAG_EXTENSION = "extension";
161
+ export const XML_TAG_REDIRECT = "redirect";
162
+ export const XML_TAG_BEFORE = "before";
163
+ export const XML_TAG_AFTER = "after";
164
+ export const XML_TAG_ATTR = "attribute";
165
+
157
166
 
158
167
  /*other constants*/
159
168
 
160
- export const UPDATE_FORMS = "_updateForms";
161
- export const UPDATE_ELEMS = "_updateElems";
169
+ export const UPDATE_FORMS = "myfaces.updateForms";
170
+ export const UPDATE_ELEMS = "myfaces.updateElems";
162
171
 
163
172
  //we want the head elements to be processed before we process the body
164
173
  //but after the inner html is done
165
- export const DEFERRED_HEAD_INSERTS = "_headElems";
174
+ export const DEFERRED_HEAD_INSERTS = "myfaces.headElems";
166
175
 
167
176
  export const MYFACES = "myfaces";
168
177
 
169
- export const SEL_SCRIPTS_STYLES = "script, style, link";
170
-
171
178
  export const MF_NONE = "__mf_none__";
172
179
 
173
180
  export const REASON_EXPIRED = "Expired";
174
181
 
175
- export const APPLIED_VST = "appliedViewState";
176
- export const APPLIED_CLIENT_WINDOW = "appliedClientWindow";
182
+ export const APPLIED_VST = "myfaces.appliedViewState";
183
+ export const APPLIED_CLIENT_WINDOW = "myfaces.appliedClientWindow";
177
184
 
178
185
  export const RECONNECT_INTERVAL = 500;
179
186
  export const MAX_RECONNECT_ATTEMPTS = 25;
@@ -188,6 +195,10 @@ export const UNKNOWN = "UNKNOWN";
188
195
  * changed to a simple value passthrough
189
196
  */
190
197
 
198
+ export function $faces(): FacesAPI {
199
+ return (window?.faces ?? window?.jsf) as FacesAPI;
200
+ }
201
+
191
202
  export function $nsp(inputNamespace?: any): any {
192
203
  if((!inputNamespace) || !inputNamespace?.replace) {
193
204
  return inputNamespace;