jsf.js_next_gen 4.0.1-beta.6 → 4.0.1-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/assets/style.css +4 -5
- package/dist/window/faces-development.js +43 -54
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +43 -54
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +10 -10
- package/src/main/typescript/impl/AjaxImpl.ts +5 -5
- package/src/main/typescript/impl/util/ExtDomQuery.ts +17 -22
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +2 -2
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +86 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +53 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/bootstrap-icons.css +15 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/tobago.css +15 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +15 -0
- package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +23 -0
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +19 -0
- package/target/AssocArray.js +281 -0
- package/target/AssocArray.js.map +1 -0
- package/target/Config.js +235 -0
- package/target/Config.js.map +1 -0
- package/target/CryptoExtensions.js +112 -0
- package/target/CryptoExtensions.js.map +1 -0
- package/target/DomQuery.js +1963 -0
- package/target/DomQuery.js.map +1 -0
- package/target/Es2019Array.js +117 -0
- package/target/Es2019Array.js.map +1 -0
- package/target/Global.js +38 -0
- package/target/Global.js.map +1 -0
- package/target/IDomQuery.js +3 -0
- package/target/IDomQuery.js.map +1 -0
- package/target/Lang.js +183 -0
- package/target/Lang.js.map +1 -0
- package/target/Messaging.js +645 -0
- package/target/Messaging.js.map +1 -0
- package/target/Monad.js +330 -0
- package/target/Monad.js.map +1 -0
- package/target/Promise.js +296 -0
- package/target/Promise.js.map +1 -0
- package/target/PromiseShim.js +30 -0
- package/target/PromiseShim.js.map +1 -0
- package/target/SourcesCollectors.js +444 -0
- package/target/SourcesCollectors.js.map +1 -0
- package/target/Stream.js +562 -0
- package/target/Stream.js.map +1 -0
- package/target/TagBuilder.js +178 -0
- package/target/TagBuilder.js.map +1 -0
- package/target/XmlQuery.js +84 -0
- package/target/XmlQuery.js.map +1 -0
- package/target/impl/AjaxImpl.js +4 -4
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +13 -19
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/index.js +80 -0
- package/target/index.js.map +1 -0
- package/target/index_core.js +76 -0
- package/target/index_core.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +85 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +53 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js +21 -0
- package/target/test/xhrCore/ErrorChainTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +14 -0
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/types/main/typescript/AssocArray.d.ts +86 -0
- package/target/types/main/typescript/Config.d.ts +94 -0
- package/target/types/main/typescript/CryptoExtensions.d.ts +87 -0
- package/target/types/main/typescript/DomQuery.d.ts +587 -0
- package/target/types/main/typescript/Es2019Array.d.ts +30 -0
- package/target/types/main/typescript/Global.d.ts +23 -0
- package/target/types/main/typescript/IDomQuery.d.ts +480 -0
- package/target/types/main/typescript/Lang.d.ts +97 -0
- package/target/types/main/typescript/Messaging.d.ts +285 -0
- package/target/types/main/typescript/Monad.d.ts +161 -0
- package/target/types/main/typescript/Promise.d.ts +58 -0
- package/target/types/main/typescript/PromiseShim.d.ts +22 -0
- package/target/types/main/typescript/SourcesCollectors.d.ts +280 -0
- package/target/types/main/typescript/Stream.d.ts +284 -0
- package/target/types/main/typescript/TagBuilder.d.ts +50 -0
- package/target/types/main/typescript/XmlQuery.d.ts +31 -0
- package/target/types/main/typescript/api/_api.d.ts +182 -0
- package/target/types/main/typescript/api/faces.d.ts +17 -0
- package/target/types/main/typescript/api/jsf.d.ts +17 -0
- package/target/types/main/typescript/impl/AjaxImpl.d.ts +164 -0
- package/target/types/main/typescript/impl/PushImpl.d.ts +38 -0
- package/target/types/main/typescript/impl/core/Const.d.ts +138 -0
- package/target/types/main/typescript/impl/core/ImplTypes.d.ts +16 -0
- package/target/types/main/typescript/impl/i18n/Messages.d.ts +102 -0
- package/target/types/main/typescript/impl/util/Assertions.d.ts +46 -0
- package/target/types/main/typescript/impl/util/AsyncRunnable.d.ts +112 -0
- package/target/types/main/typescript/impl/util/ExtDomQuery.d.ts +100 -0
- package/target/types/main/typescript/impl/util/FileUtils.d.ts +25 -0
- package/target/types/main/typescript/impl/util/HiddenInputBuilder.d.ts +37 -0
- package/target/types/main/typescript/impl/util/IListener.d.ts +18 -0
- package/target/types/main/typescript/impl/util/Lang.d.ts +138 -0
- package/target/types/main/typescript/impl/util/XhrQueueController.d.ts +51 -0
- package/target/types/main/typescript/impl/xhrCore/ErrorData.d.ts +37 -0
- package/target/types/main/typescript/impl/xhrCore/EventData.d.ts +25 -0
- package/target/types/main/typescript/impl/xhrCore/IResponseProcessor.d.ts +136 -0
- package/target/types/main/typescript/impl/xhrCore/RequestDataResolver.d.ts +84 -0
- package/target/types/main/typescript/impl/xhrCore/ResonseDataResolver.d.ts +60 -0
- package/target/types/main/typescript/impl/xhrCore/Response.d.ts +29 -0
- package/target/types/main/typescript/impl/xhrCore/ResponseProcessor.d.ts +208 -0
- package/target/types/main/typescript/impl/xhrCore/XhrFormData.d.ts +83 -0
- package/target/types/main/typescript/impl/xhrCore/XhrRequest.d.ts +102 -0
- package/target/types/main/typescript/index.d.ts +34 -0
- package/target/types/main/typescript/index_core.d.ts +29 -0
- package/target/types/main/typescript/myfaces/OamSubmit.d.ts +53 -0
- package/target/types/main/typescript/test/frameworkBase/LangTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.d.ts +39 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.d.ts +0 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.d.ts +1 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/shared/StandardInits.d.ts +63 -0
- package/target/types/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.d.ts +23 -0
- package/target/types/main/typescript/test/impl/ImplTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/impl/ImplTest_23.spec.d.ts +16 -0
- package/target/types/main/typescript/test/impl/SeparatorCharsTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/myfaces/OamSubmit.spec.d.ts +16 -0
- package/target/types/main/typescript/test/myfaces/OnLoad.spec.d.ts +16 -0
- package/target/types/main/typescript/test/queue/AsynchronousProbe.d.ts +38 -0
- package/target/types/main/typescript/test/queue/AsynchronousQueueTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ClientWindow.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/ErrorChainTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/EventTests.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/FakeWebsocket.d.ts +24 -0
- package/target/types/main/typescript/test/xhrCore/FileUploadTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/NamespacesRequestTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/OamSubmitTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/RequestParamsTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/RequestTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/RequestTest_23.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ResponseTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ResponseTest23.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/ShadowDomTest.spec.d.ts +16 -0
- package/target/types/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/WebsocketTest.d.ts +1 -0
- package/target/types/main/typescript/test/xhrCore/XhrFormDataTest.spec.d.ts +16 -0
- package/target/types/test/typescript/AssocArrayTest.spec.d.ts +1 -0
- package/target/types/test/typescript/DomQueryTest.spec.d.ts +1 -0
- package/target/types/test/typescript/ExtendedArrayTest.spec.d.ts +1 -0
- package/target/types/test/typescript/LangTest.spec.d.ts +1 -0
- package/target/types/test/typescript/MappingProbes.d.ts +24 -0
- package/target/types/test/typescript/MappingTest.spec.d.ts +1 -0
- package/target/types/test/typescript/MessagingTest.spec.d.ts +1 -0
- package/target/types/test/typescript/MonadTest.spec.d.ts +16 -0
- package/target/types/test/typescript/PromiseTest.spec.d.ts +1 -0
- package/target/types/test/typescript/StreamTest.spec.d.ts +1 -0
- package/target/types/test/typescript/XmlQueryTest.spec.d.ts +1 -0
- package/target/types/test/typescript/markups/tobago-with-header.d.ts +1 -0
- package/target/types/test/typescript/markups/tobago-without-header.d.ts +1 -0
- package/webpack.config.js +1 -1
- package/webpack.config.js.map +1 -1
- package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
- package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
- package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
- package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/src/test.html +0 -75
- package/src/tmp/test.html +0 -16
- package/tmp.xml +0 -36
|
@@ -248,7 +248,7 @@ function simpleShallowMerge(...assocArrays) {
|
|
|
248
248
|
}
|
|
249
249
|
exports.simpleShallowMerge = simpleShallowMerge;
|
|
250
250
|
/**
|
|
251
|
-
* Shallow merge as in config
|
|
251
|
+
* Shallow merge as in config, but on raw associative arrays
|
|
252
252
|
*
|
|
253
253
|
* @param overwrite
|
|
254
254
|
* @param withAppend
|
|
@@ -982,6 +982,10 @@ class DomQuery {
|
|
|
982
982
|
get asNodeArray() {
|
|
983
983
|
return new Es2019Array_1.Es2019Array(...this.rootNode.filter(item => item != null));
|
|
984
984
|
}
|
|
985
|
+
get nonce() {
|
|
986
|
+
var _a, _b, _c, _d, _e;
|
|
987
|
+
return Monad_1.Optional.fromNullable((_c = (_b = (_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.nonce) !== null && _c !== void 0 ? _c : (_e = (_d = this === null || this === void 0 ? void 0 : this.rootNode) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.getAttribute("nonce"));
|
|
988
|
+
}
|
|
985
989
|
static querySelectorAllDeep(selector) {
|
|
986
990
|
return new DomQuery(document).querySelectorAllDeep(selector);
|
|
987
991
|
}
|
|
@@ -1859,33 +1863,19 @@ class DomQuery {
|
|
|
1859
1863
|
const execCss = (toReplace) => {
|
|
1860
1864
|
const _toReplace = DomQuery.byId(toReplace);
|
|
1861
1865
|
const tagName = _toReplace.tagName.orElse("").value;
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
matches.replace(_toReplace);
|
|
1869
|
-
}
|
|
1870
|
-
else {
|
|
1871
|
-
head.append(_toReplace);
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
else if (tagName && eqi(tagName, "style")) {
|
|
1875
|
-
let innerText = _toReplace.innerHTML.replace(/\s+/gi, "");
|
|
1876
|
-
let styles = head.querySelectorAll("style");
|
|
1877
|
-
let filteredStyles = styles.asArray.filter(style => {
|
|
1878
|
-
return style.innerHTML.replace(/\s+/gi, "") == innerText;
|
|
1879
|
-
});
|
|
1880
|
-
styles = new DomQuery(...filteredStyles);
|
|
1881
|
-
if (!styles.length) { //already present
|
|
1882
|
-
head.append(_toReplace);
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1866
|
+
let newElement = DomQuery.fromMarkup(`<${tagName.toLowerCase()} />`);
|
|
1867
|
+
newElement = newElement.copyAttrs(_toReplace);
|
|
1868
|
+
newElement.innerHTML = toReplace.innerHTML;
|
|
1869
|
+
// css suffices a simple replace to get it eval-ed, no need
|
|
1870
|
+
// for a full head replace
|
|
1871
|
+
_toReplace.replace(newElement);
|
|
1885
1872
|
};
|
|
1886
|
-
const
|
|
1887
|
-
|
|
1873
|
+
const cssElems = new DomQuery(this.filterSelector("link, style"), this.querySelectorAll("link, style"));
|
|
1874
|
+
cssElems.asArray
|
|
1888
1875
|
.flatMap(item => [...item.values])
|
|
1876
|
+
// sort to make sure the execution order is correct
|
|
1877
|
+
// this is needed because we mix 2 queries together
|
|
1878
|
+
// -3 is needed due to the compareDocumentPosition return value
|
|
1889
1879
|
.sort((node1, node2) => node1.compareDocumentPosition(node2) - 3)
|
|
1890
1880
|
.forEach(item => execCss(item));
|
|
1891
1881
|
return this;
|
|
@@ -2482,12 +2472,12 @@ class DomQuery {
|
|
|
2482
2472
|
}
|
|
2483
2473
|
}
|
|
2484
2474
|
}
|
|
2485
|
-
exports.DomQuery = DomQuery;
|
|
2486
2475
|
DomQuery.absent = new DomQuery();
|
|
2487
2476
|
/**
|
|
2488
2477
|
* reference to the environmental global object
|
|
2489
2478
|
*/
|
|
2490
2479
|
DomQuery.global = Global_1._global$;
|
|
2480
|
+
exports.DomQuery = DomQuery;
|
|
2491
2481
|
/**
|
|
2492
2482
|
* Various collectors
|
|
2493
2483
|
* which can be used in conjunction with Streams
|
|
@@ -2642,7 +2632,12 @@ exports._Es2019Array = _Es2019Array;
|
|
|
2642
2632
|
* does not yet have flatMap support on arrays
|
|
2643
2633
|
*/
|
|
2644
2634
|
exports.Es2019Array = (Array.prototype.flatMap) ? function (...data) {
|
|
2645
|
-
|
|
2635
|
+
// sometimes the typescript compiler produces
|
|
2636
|
+
// an array without flatmap between boundaries (the result produces True for Array.isArray
|
|
2637
|
+
// but has no flatMap function, could be a node issue also or Typescript!
|
|
2638
|
+
// we remap that (could be related to: https://github.com/microsoft/TypeScript/issues/31033
|
|
2639
|
+
// the check and remap fixes the issue which should not exist in the first place
|
|
2640
|
+
return (data === null || data === void 0 ? void 0 : data.flatMap) ? data : _Es2019Array(...data);
|
|
2646
2641
|
} : _Es2019Array;
|
|
2647
2642
|
|
|
2648
2643
|
|
|
@@ -3164,9 +3159,9 @@ class Optional extends Monad {
|
|
|
3164
3159
|
});
|
|
3165
3160
|
}
|
|
3166
3161
|
}
|
|
3167
|
-
exports.Optional = Optional;
|
|
3168
3162
|
/*default value for absent*/
|
|
3169
3163
|
Optional.absent = Optional.fromNullable(null);
|
|
3164
|
+
exports.Optional = Optional;
|
|
3170
3165
|
// --------------------- From here onwards we break out the side effect free limits ------------
|
|
3171
3166
|
/**
|
|
3172
3167
|
* ValueEmbedder is the writeable version
|
|
@@ -3219,9 +3214,9 @@ class ValueEmbedder extends Optional {
|
|
|
3219
3214
|
return new ValueEmbedder(value, valueKey);
|
|
3220
3215
|
}
|
|
3221
3216
|
}
|
|
3222
|
-
exports.ValueEmbedder = ValueEmbedder;
|
|
3223
3217
|
/*default value for absent*/
|
|
3224
3218
|
ValueEmbedder.absent = ValueEmbedder.fromNullable(null);
|
|
3219
|
+
exports.ValueEmbedder = ValueEmbedder;
|
|
3225
3220
|
|
|
3226
3221
|
|
|
3227
3222
|
/***/ }),
|
|
@@ -4570,7 +4565,7 @@ var Implementation;
|
|
|
4570
4565
|
/*
|
|
4571
4566
|
* lazy helper to fetch the window id from the included faces.js
|
|
4572
4567
|
*/
|
|
4573
|
-
let fetchWindowIdFromJSFJS = () => ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null)
|
|
4568
|
+
let fetchWindowIdFromJSFJS = () => ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null);
|
|
4574
4569
|
/*
|
|
4575
4570
|
* fetch window id from the url
|
|
4576
4571
|
*/
|
|
@@ -4580,8 +4575,8 @@ var Implementation;
|
|
|
4580
4575
|
const results = regex.exec(href);
|
|
4581
4576
|
//initial trial over the url and a regexp
|
|
4582
4577
|
if (results != null)
|
|
4583
|
-
return results[1];
|
|
4584
|
-
return null;
|
|
4578
|
+
return mona_dish_1.Optional.fromNullable(results[1]);
|
|
4579
|
+
return mona_dish_1.Optional.fromNullable(null);
|
|
4585
4580
|
};
|
|
4586
4581
|
/*
|
|
4587
4582
|
* functional double check based on stream reduction
|
|
@@ -4617,7 +4612,7 @@ var Implementation;
|
|
|
4617
4612
|
/*
|
|
4618
4613
|
* return the window id or null
|
|
4619
4614
|
*/
|
|
4620
|
-
return formWindowId != INIT ? formWindowId : (fetchWindowIdFromURL() || fetchWindowIdFromJSFJS());
|
|
4615
|
+
return formWindowId != INIT ? formWindowId : (fetchWindowIdFromURL() || fetchWindowIdFromJSFJS()).value;
|
|
4621
4616
|
}
|
|
4622
4617
|
Implementation.getClientWindow = getClientWindow;
|
|
4623
4618
|
/**
|
|
@@ -5809,10 +5804,10 @@ class ExtDomQuery extends mona_dish_1.DQ {
|
|
|
5809
5804
|
if (result.length > 1) {
|
|
5810
5805
|
throw Error("Multiple different windowIds found in document");
|
|
5811
5806
|
}
|
|
5812
|
-
return (result.isPresent()) ? result.getAsElem(0).value.value : fetchWindowIdFromURL();
|
|
5807
|
+
return mona_dish_1.Optional.fromNullable((result.isPresent()) ? result.getAsElem(0).value.value : fetchWindowIdFromURL());
|
|
5813
5808
|
}
|
|
5814
5809
|
else {
|
|
5815
|
-
return fetchWindowIdFromURL();
|
|
5810
|
+
return mona_dish_1.Optional.fromNullable(fetchWindowIdFromURL());
|
|
5816
5811
|
}
|
|
5817
5812
|
}
|
|
5818
5813
|
/*
|
|
@@ -5820,29 +5815,27 @@ class ExtDomQuery extends mona_dish_1.DQ {
|
|
|
5820
5815
|
* this is done once and only lazily
|
|
5821
5816
|
*/
|
|
5822
5817
|
get nonce() {
|
|
5823
|
-
var _a;
|
|
5818
|
+
var _a, _b, _c;
|
|
5824
5819
|
//already processed
|
|
5825
5820
|
let myfacesConfig = new ExtConfig(window.myfaces);
|
|
5826
|
-
let
|
|
5827
|
-
if (
|
|
5828
|
-
return
|
|
5821
|
+
let globalNonce = myfacesConfig.getIf("config", "cspMeta", "nonce");
|
|
5822
|
+
if (!!globalNonce.value) {
|
|
5823
|
+
return mona_dish_1.Optional.fromNullable(globalNonce.value);
|
|
5829
5824
|
}
|
|
5830
5825
|
let curScript = new mona_dish_1.DQ(document.currentScript);
|
|
5831
5826
|
//since our baseline atm is ie11 we cannot use document.currentScript globally
|
|
5832
|
-
|
|
5827
|
+
let nonce = curScript.nonce;
|
|
5828
|
+
if (nonce.isPresent()) {
|
|
5833
5829
|
// fast-path for modern browsers
|
|
5834
|
-
return
|
|
5830
|
+
return nonce;
|
|
5835
5831
|
}
|
|
5836
5832
|
// fallback if the currentScript method fails, we just search the jsf tags for nonce, this is
|
|
5837
5833
|
// the last possibility
|
|
5838
5834
|
let nonceScript = mona_dish_1.Optional.fromNullable((_a = mona_dish_1.DQ
|
|
5839
5835
|
.querySelectorAll("script[src], link[src]").asArray
|
|
5840
|
-
.filter((item) =>
|
|
5836
|
+
.filter((item) => item.nonce.isPresent() && item.attr(ATTR_SRC) != null)
|
|
5841
5837
|
.filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))) === null || _a === void 0 ? void 0 : _a[0]);
|
|
5842
|
-
|
|
5843
|
-
return this.extractNonce(nonceScript.value);
|
|
5844
|
-
}
|
|
5845
|
-
return null;
|
|
5838
|
+
return mona_dish_1.Optional.fromNullable((_c = (_b = nonceScript.value) === null || _b === void 0 ? void 0 : _b.nonce) === null || _c === void 0 ? void 0 : _c.value);
|
|
5846
5839
|
}
|
|
5847
5840
|
static searchJsfJsFor(item) {
|
|
5848
5841
|
return new ExtDomQuery(document).searchJsfJsFor(item);
|
|
@@ -5864,12 +5857,12 @@ class ExtDomQuery extends mona_dish_1.DQ {
|
|
|
5864
5857
|
})) === null || _a === void 0 ? void 0 : _a[0]);
|
|
5865
5858
|
}
|
|
5866
5859
|
globalEval(code, nonce) {
|
|
5867
|
-
return new ExtDomQuery(super.globalEval(code, nonce !== null && nonce !== void 0 ? nonce : this.nonce));
|
|
5860
|
+
return new ExtDomQuery(super.globalEval(code, nonce !== null && nonce !== void 0 ? nonce : this.nonce.value));
|
|
5868
5861
|
}
|
|
5869
5862
|
// called from base class runScripts, do not delete
|
|
5870
5863
|
// noinspection JSUnusedGlobalSymbols
|
|
5871
5864
|
globalEvalSticky(code, nonce) {
|
|
5872
|
-
return new ExtDomQuery(super.globalEvalSticky(code, nonce !== null && nonce !== void 0 ? nonce : this.nonce));
|
|
5865
|
+
return new ExtDomQuery(super.globalEvalSticky(code, nonce !== null && nonce !== void 0 ? nonce : this.nonce.value));
|
|
5873
5866
|
}
|
|
5874
5867
|
/**
|
|
5875
5868
|
* decorated run scripts which takes our jsf extensions into consideration
|
|
@@ -5943,10 +5936,6 @@ class ExtDomQuery extends mona_dish_1.DQ {
|
|
|
5943
5936
|
const ret = mona_dish_1.DomQuery.byId(selector, deep);
|
|
5944
5937
|
return new ExtDomQuery(ret);
|
|
5945
5938
|
}
|
|
5946
|
-
extractNonce(curScript) {
|
|
5947
|
-
var _a, _b;
|
|
5948
|
-
return (_b = (_a = curScript.getAsElem(0).value) === null || _a === void 0 ? void 0 : _a.nonce) !== null && _b !== void 0 ? _b : curScript.attr("nonce").value;
|
|
5949
|
-
}
|
|
5950
5939
|
filter(func) {
|
|
5951
5940
|
return new ExtDomQuery(super.filter(func));
|
|
5952
5941
|
}
|
|
@@ -6878,7 +6867,7 @@ exports.resolveDelay = resolveDelay;
|
|
|
6878
6867
|
*/
|
|
6879
6868
|
function resolveWindowId(options) {
|
|
6880
6869
|
var _a, _b;
|
|
6881
|
-
return (_b = (_a = options === null || options === void 0 ? void 0 : options.value) === null || _a === void 0 ? void 0 : _a.windowId) !== null && _b !== void 0 ? _b : ExtDomQuery_1.ExtDomQuery.windowId;
|
|
6870
|
+
return (_b = (_a = options === null || options === void 0 ? void 0 : options.value) === null || _a === void 0 ? void 0 : _a.windowId) !== null && _b !== void 0 ? _b : ExtDomQuery_1.ExtDomQuery.windowId.value;
|
|
6882
6871
|
}
|
|
6883
6872
|
exports.resolveWindowId = resolveWindowId;
|
|
6884
6873
|
/**
|
|
Binary file
|
|
Binary file
|