videomail-client 15.11.0 → 16.0.0
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/README.md +45 -91
- package/dist/cjs/index.cjs +207 -87
- package/dist/esm/index.js +30 -10
- package/dist/esm/resource.d.ts +1 -2
- package/dist/esm/wrappers/container.d.ts +3 -1
- package/dist/umd/index.js +194 -86
- package/package.json +13 -13
package/dist/umd/index.js
CHANGED
|
@@ -10978,7 +10978,7 @@
|
|
|
10978
10978
|
var client = __webpack_require__("Q");
|
|
10979
10979
|
var client_default = /*#__PURE__*/ __webpack_require__.n(client);
|
|
10980
10980
|
var package_namespaceObject = {
|
|
10981
|
-
rE: "
|
|
10981
|
+
rE: "16.0.0"
|
|
10982
10982
|
};
|
|
10983
10983
|
function isAudioEnabled(options) {
|
|
10984
10984
|
return Boolean(options.audio.enabled);
|
|
@@ -15064,6 +15064,7 @@
|
|
|
15064
15064
|
this.options.logger.debug(`Form: doTheSubmit(${string_pretty(e)})`);
|
|
15065
15065
|
e.preventDefault();
|
|
15066
15066
|
} else this.options.logger.debug("Form: doTheSubmit()");
|
|
15067
|
+
const hasHostAction = this.formElement.hasAttribute("action");
|
|
15067
15068
|
const url = this.formElement.getAttribute("action") ?? this.options.apiUrl;
|
|
15068
15069
|
const method = this.formElement.getAttribute("method");
|
|
15069
15070
|
let chosenMethod;
|
|
@@ -15077,7 +15078,7 @@
|
|
|
15077
15078
|
default:
|
|
15078
15079
|
chosenMethod = FormMethod.POST;
|
|
15079
15080
|
}
|
|
15080
|
-
if (this.container.hasElement()) await this.container.submitAll(this.getData(), chosenMethod, url);
|
|
15081
|
+
if (this.container.hasElement()) await this.container.submitAll(this.getData(), chosenMethod, url, hasHostAction);
|
|
15081
15082
|
return false;
|
|
15082
15083
|
}
|
|
15083
15084
|
getInvalidElement() {
|
|
@@ -15337,7 +15338,7 @@
|
|
|
15337
15338
|
audio: {
|
|
15338
15339
|
enabled: false,
|
|
15339
15340
|
switch: false,
|
|
15340
|
-
volume:
|
|
15341
|
+
volume: 1,
|
|
15341
15342
|
bufferSize: "auto"
|
|
15342
15343
|
},
|
|
15343
15344
|
video: {
|
|
@@ -15490,7 +15491,7 @@
|
|
|
15490
15491
|
main.A && main.A.locals && main.A.locals;
|
|
15491
15492
|
var document_visibility = __webpack_require__("xF");
|
|
15492
15493
|
var document_visibility_default = /*#__PURE__*/ __webpack_require__.n(document_visibility);
|
|
15493
|
-
/*! @license DOMPurify 3.4.
|
|
15494
|
+
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */ function _OverloadYield(e, d) {
|
|
15494
15495
|
this.v = e, this.k = d;
|
|
15495
15496
|
}
|
|
15496
15497
|
function _arrayLikeToArray(r, a) {
|
|
@@ -15612,9 +15613,12 @@
|
|
|
15612
15613
|
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
15613
15614
|
const arrayPop = unapply(Array.prototype.pop);
|
|
15614
15615
|
const arrayPush = unapply(Array.prototype.push);
|
|
15615
|
-
Array.prototype.slice;
|
|
15616
|
+
const arraySlice = unapply(Array.prototype.slice);
|
|
15616
15617
|
const arraySplice = unapply(Array.prototype.splice);
|
|
15617
15618
|
const arrayIsArray = Array.isArray;
|
|
15619
|
+
const setCreate = unconstruct(Set);
|
|
15620
|
+
const setAdd = unapply(Set.prototype.add);
|
|
15621
|
+
const setHas = unapply(Set.prototype.has);
|
|
15618
15622
|
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
15619
15623
|
const stringToString = unapply(String.prototype.toString);
|
|
15620
15624
|
const stringMatch = unapply(String.prototype.match);
|
|
@@ -15720,6 +15724,14 @@
|
|
|
15720
15724
|
}
|
|
15721
15725
|
return fallbackValue;
|
|
15722
15726
|
}
|
|
15727
|
+
function lookupAccessor(object, prop) {
|
|
15728
|
+
while(null !== object){
|
|
15729
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
15730
|
+
if (desc) return desc.get ? unapply(desc.get) : null;
|
|
15731
|
+
object = getPrototypeOf(object);
|
|
15732
|
+
}
|
|
15733
|
+
return null;
|
|
15734
|
+
}
|
|
15723
15735
|
function isRegex(value) {
|
|
15724
15736
|
try {
|
|
15725
15737
|
regExpTest(value, "");
|
|
@@ -16406,7 +16418,7 @@
|
|
|
16406
16418
|
documentFragment: 11,
|
|
16407
16419
|
notation: 12
|
|
16408
16420
|
};
|
|
16409
|
-
const
|
|
16421
|
+
const LITERAL_TEXT_ELEMENTS = purify_es_freeze(addToSet({}, [
|
|
16410
16422
|
"style",
|
|
16411
16423
|
"script",
|
|
16412
16424
|
"xmp",
|
|
@@ -16415,15 +16427,7 @@
|
|
|
16415
16427
|
"noframes",
|
|
16416
16428
|
"plaintext",
|
|
16417
16429
|
"noscript"
|
|
16418
|
-
];
|
|
16419
|
-
const LITERAL_TEXT_ELEMENTS = purify_es_freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));
|
|
16420
|
-
const LITERAL_TEXT_CLOSE = function() {
|
|
16421
|
-
const map = {};
|
|
16422
|
-
arrayForEach(LITERAL_TEXT_ELEMENT_NAMES, (name)=>{
|
|
16423
|
-
map[name] = purify_es_seal(new RegExp("</" + name + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
16424
|
-
});
|
|
16425
|
-
return purify_es_freeze(map);
|
|
16426
|
-
}();
|
|
16430
|
+
]));
|
|
16427
16431
|
const purify_es_getGlobal = function() {
|
|
16428
16432
|
return "u" < typeof window ? null : window;
|
|
16429
16433
|
};
|
|
@@ -16470,7 +16474,7 @@
|
|
|
16470
16474
|
function createDOMPurify() {
|
|
16471
16475
|
let window1 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : purify_es_getGlobal();
|
|
16472
16476
|
const DOMPurify = (root)=>createDOMPurify(root);
|
|
16473
|
-
DOMPurify.version = "3.4.
|
|
16477
|
+
DOMPurify.version = "3.4.17";
|
|
16474
16478
|
DOMPurify.removed = [];
|
|
16475
16479
|
if (!window1 || !window1.document || window1.document.nodeType !== NODE_TYPE.document || !window1.Element) {
|
|
16476
16480
|
DOMPurify.isSupported = false;
|
|
@@ -16502,6 +16506,10 @@
|
|
|
16502
16506
|
const _readNodeName = function(node) {
|
|
16503
16507
|
return getNodeName ? getNodeName(node) : node.nodeName;
|
|
16504
16508
|
};
|
|
16509
|
+
const getNamespaceURI = lookupAccessor(ElementPrototype, "namespaceURI");
|
|
16510
|
+
const _readNamespaceURI = function(element) {
|
|
16511
|
+
return getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;
|
|
16512
|
+
};
|
|
16505
16513
|
if ("function" == typeof HTMLTemplateElement) {
|
|
16506
16514
|
const template = document1.createElement("template");
|
|
16507
16515
|
if (template.content && template.content.ownerDocument) document1 = template.content.ownerDocument;
|
|
@@ -16615,6 +16623,7 @@
|
|
|
16615
16623
|
const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
|
|
16616
16624
|
let KEEP_CONTENT = true;
|
|
16617
16625
|
let IN_PLACE = false;
|
|
16626
|
+
let IN_PLACE_VISITED = null;
|
|
16618
16627
|
let USE_PROFILES = {};
|
|
16619
16628
|
let FORBID_CONTENTS = null;
|
|
16620
16629
|
const DEFAULT_FORBID_CONTENTS = addToSet({}, [
|
|
@@ -16875,18 +16884,27 @@
|
|
|
16875
16884
|
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
16876
16885
|
};
|
|
16877
16886
|
const _checkValidNamespace = function(element) {
|
|
16878
|
-
|
|
16879
|
-
|
|
16880
|
-
|
|
16881
|
-
|
|
16882
|
-
|
|
16883
|
-
|
|
16884
|
-
|
|
16885
|
-
|
|
16886
|
-
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16887
|
+
const elementNamespace = _readNamespaceURI(element);
|
|
16888
|
+
const tagName = stringToLowerCase(_readNodeName(element));
|
|
16889
|
+
const parentNode = getParentNode(element);
|
|
16890
|
+
let parent;
|
|
16891
|
+
let parentTagName;
|
|
16892
|
+
if (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {
|
|
16893
|
+
parent = {
|
|
16894
|
+
namespaceURI: _readNamespaceURI(parentNode)
|
|
16895
|
+
};
|
|
16896
|
+
parentTagName = stringToLowerCase(_readNodeName(parentNode));
|
|
16897
|
+
} else {
|
|
16898
|
+
parent = {
|
|
16899
|
+
namespaceURI: NAMESPACE
|
|
16900
|
+
};
|
|
16901
|
+
parentTagName = "template";
|
|
16902
|
+
}
|
|
16903
|
+
if (!ALLOWED_NAMESPACES[elementNamespace]) return false;
|
|
16904
|
+
if (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
16905
|
+
if (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
16906
|
+
if (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
16907
|
+
if ("application/xhtml+xml" === PARSER_MEDIA_TYPE && ALLOWED_NAMESPACES[elementNamespace]) return true;
|
|
16890
16908
|
return false;
|
|
16891
16909
|
};
|
|
16892
16910
|
const _forceRemove = function(node) {
|
|
@@ -16912,18 +16930,12 @@
|
|
|
16912
16930
|
const _neutralizeRoot = function(root) {
|
|
16913
16931
|
_neutralizeSubtree(root);
|
|
16914
16932
|
const childNodes = getChildNodes(root);
|
|
16915
|
-
if (childNodes) {
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
try {
|
|
16922
|
-
remove(child);
|
|
16923
|
-
} catch (_) {}
|
|
16924
|
-
});
|
|
16925
|
-
}
|
|
16926
|
-
const attributes = getAttributes(root);
|
|
16933
|
+
if (childNodes) arrayForEach(arraySlice(childNodes), (child)=>{
|
|
16934
|
+
try {
|
|
16935
|
+
remove(child);
|
|
16936
|
+
} catch (_) {}
|
|
16937
|
+
});
|
|
16938
|
+
const attributes = _readNodeType(root) === NODE_TYPE.element ? getAttributes(root) : null;
|
|
16927
16939
|
if (attributes) for(let i = attributes.length - 1; i >= 0; --i){
|
|
16928
16940
|
const attribute = attributes[i];
|
|
16929
16941
|
const name = attribute && attribute.name;
|
|
@@ -16964,17 +16976,98 @@
|
|
|
16964
16976
|
if ("string" == typeof name && !ALLOWED_ATTR[transformCaseFunc(name)]) _stripAttributeNode(element, attribute, name);
|
|
16965
16977
|
}
|
|
16966
16978
|
};
|
|
16967
|
-
const
|
|
16979
|
+
const _walkTree = function(root, visit) {
|
|
16980
|
+
let intoShadow = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false;
|
|
16968
16981
|
const stack = [
|
|
16969
16982
|
root
|
|
16970
16983
|
];
|
|
16971
16984
|
while(stack.length > 0){
|
|
16972
16985
|
const node = stack.pop();
|
|
16973
|
-
if (
|
|
16986
|
+
if (false === visit(node)) continue;
|
|
16987
|
+
if (intoShadow && _readNodeType(node) === NODE_TYPE.element) {
|
|
16988
|
+
const shadowRoot = getShadowRoot(node);
|
|
16989
|
+
if (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);
|
|
16990
|
+
}
|
|
16974
16991
|
const childNodes = getChildNodes(node);
|
|
16975
16992
|
if (childNodes) for(let i = childNodes.length - 1; i >= 0; --i)stack.push(childNodes[i]);
|
|
16976
16993
|
}
|
|
16977
16994
|
};
|
|
16995
|
+
const _neutralizeSubtree = function(root) {
|
|
16996
|
+
_walkTree(root, (node)=>{
|
|
16997
|
+
if (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);
|
|
16998
|
+
});
|
|
16999
|
+
};
|
|
17000
|
+
const _collectLiveNodes = function(root) {
|
|
17001
|
+
const nodes = [];
|
|
17002
|
+
_walkTree(root, (node)=>{
|
|
17003
|
+
nodes.push(node);
|
|
17004
|
+
}, true);
|
|
17005
|
+
return nodes;
|
|
17006
|
+
};
|
|
17007
|
+
const _neutralizeEscapedElements = function(root, before) {
|
|
17008
|
+
const reachable = setCreate();
|
|
17009
|
+
arrayForEach(_collectLiveNodes(root), (node)=>{
|
|
17010
|
+
if (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);
|
|
17011
|
+
});
|
|
17012
|
+
arrayForEach(before, (node)=>{
|
|
17013
|
+
if (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripDisallowedAttributes(node);
|
|
17014
|
+
});
|
|
17015
|
+
};
|
|
17016
|
+
const _neutralizeDiscarded = function(root, before) {
|
|
17017
|
+
let rootRemoved = false;
|
|
17018
|
+
arrayForEach(DOMPurify.removed, (entry)=>{
|
|
17019
|
+
if (entry.element) {
|
|
17020
|
+
rootRemoved = rootRemoved || entry.element === root;
|
|
17021
|
+
_neutralizeSubtree(entry.element);
|
|
17022
|
+
}
|
|
17023
|
+
});
|
|
17024
|
+
_neutralizeEscapedElements(root, before);
|
|
17025
|
+
return rootRemoved;
|
|
17026
|
+
};
|
|
17027
|
+
const MAX_UNVISITED_ROUNDS = 8;
|
|
17028
|
+
const _sanitizeUnvisitedNodes = function(root, before) {
|
|
17029
|
+
const visited = IN_PLACE_VISITED;
|
|
17030
|
+
let original = null;
|
|
17031
|
+
const getOriginal = ()=>{
|
|
17032
|
+
if (!original) {
|
|
17033
|
+
original = setCreate();
|
|
17034
|
+
arrayForEach(before, (beforeNode)=>{
|
|
17035
|
+
setAdd(original, beforeNode);
|
|
17036
|
+
});
|
|
17037
|
+
}
|
|
17038
|
+
return original;
|
|
17039
|
+
};
|
|
17040
|
+
for(let round = 0;; round++){
|
|
17041
|
+
const live = _collectLiveNodes(root);
|
|
17042
|
+
const containers = [
|
|
17043
|
+
root
|
|
17044
|
+
];
|
|
17045
|
+
let pending = false;
|
|
17046
|
+
arrayForEach(live, (node)=>{
|
|
17047
|
+
if (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);
|
|
17048
|
+
else if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);
|
|
17049
|
+
});
|
|
17050
|
+
if (!pending) return;
|
|
17051
|
+
if (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate("the tree kept changing during in-place sanitization; refusing to return it");
|
|
17052
|
+
arrayForEach(containers, (container, index)=>{
|
|
17053
|
+
_sanitizeUnvisitedIn(container, index > 0, root, getOriginal());
|
|
17054
|
+
});
|
|
17055
|
+
}
|
|
17056
|
+
};
|
|
17057
|
+
const _sanitizeUnvisitedIn = function(container, inShadow, root, original) {
|
|
17058
|
+
const iterator = _createNodeIterator(container);
|
|
17059
|
+
let node;
|
|
17060
|
+
while(node = iterator.nextNode()){
|
|
17061
|
+
if (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;
|
|
17062
|
+
if (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);
|
|
17063
|
+
_sanitizeElements(node, root);
|
|
17064
|
+
_sanitizeAttributes(node, root);
|
|
17065
|
+
if (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);
|
|
17066
|
+
}
|
|
17067
|
+
};
|
|
17068
|
+
const _markVisited = function(node) {
|
|
17069
|
+
if (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);
|
|
17070
|
+
};
|
|
16978
17071
|
const _isPatchLinkageAttribute = function(lcName, lcTag) {
|
|
16979
17072
|
if (!SAFE_FOR_XML) return false;
|
|
16980
17073
|
if ("patchsrc" === lcName) return true;
|
|
@@ -16982,17 +17075,13 @@
|
|
|
16982
17075
|
};
|
|
16983
17076
|
const _neutralizePatchLinkage = function(root) {
|
|
16984
17077
|
if (!SAFE_FOR_XML) return;
|
|
16985
|
-
|
|
16986
|
-
root
|
|
16987
|
-
];
|
|
16988
|
-
while(stack.length > 0){
|
|
16989
|
-
const node = stack.pop();
|
|
17078
|
+
_walkTree(root, (node)=>{
|
|
16990
17079
|
const nodeType = _readNodeType(node);
|
|
16991
17080
|
if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
|
|
16992
17081
|
try {
|
|
16993
17082
|
remove(node);
|
|
16994
17083
|
} catch (_) {}
|
|
16995
|
-
|
|
17084
|
+
return false;
|
|
16996
17085
|
}
|
|
16997
17086
|
if (nodeType === NODE_TYPE.element) {
|
|
16998
17087
|
const element = node;
|
|
@@ -17002,9 +17091,8 @@
|
|
|
17002
17091
|
if (element.hasAttribute && element.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) element.removeAttribute("for");
|
|
17003
17092
|
} catch (_) {}
|
|
17004
17093
|
}
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
}
|
|
17094
|
+
return true;
|
|
17095
|
+
});
|
|
17008
17096
|
};
|
|
17009
17097
|
const _initDocument = function(dirty) {
|
|
17010
17098
|
let doc = null;
|
|
@@ -17042,6 +17130,13 @@
|
|
|
17042
17130
|
};
|
|
17043
17131
|
const _scrubTemplateExpressions2 = function(node) {
|
|
17044
17132
|
var _node$querySelectorAl;
|
|
17133
|
+
_scrubOwnCharacterData(node);
|
|
17134
|
+
const templates = null == (_node$querySelectorAl = node.querySelectorAll) ? void 0 : _node$querySelectorAl.call(node, "template");
|
|
17135
|
+
if (templates) arrayForEach(templates, (tmpl)=>{
|
|
17136
|
+
if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
|
|
17137
|
+
});
|
|
17138
|
+
};
|
|
17139
|
+
const _scrubOwnCharacterData = function(node) {
|
|
17045
17140
|
node.normalize();
|
|
17046
17141
|
const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
|
|
17047
17142
|
const walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
@@ -17050,10 +17145,6 @@
|
|
|
17050
17145
|
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
17051
17146
|
currentNode = walker.nextNode();
|
|
17052
17147
|
}
|
|
17053
|
-
const templates = null == (_node$querySelectorAl = node.querySelectorAll) ? void 0 : _node$querySelectorAl.call(node, "template");
|
|
17054
|
-
if (templates) arrayForEach(templates, (tmpl)=>{
|
|
17055
|
-
if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
|
|
17056
|
-
});
|
|
17057
17148
|
};
|
|
17058
17149
|
const _isClobbered = function(element) {
|
|
17059
17150
|
const realTagName = getNodeName ? getNodeName(element) : null;
|
|
@@ -17085,7 +17176,7 @@
|
|
|
17085
17176
|
}
|
|
17086
17177
|
const _isUnsafeNode = function(currentNode, tagName) {
|
|
17087
17178
|
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;
|
|
17088
|
-
if (SAFE_FOR_XML && currentNode
|
|
17179
|
+
if (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && _readNodeType(currentNode) === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || "string" == typeof currentNode.textContent && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;
|
|
17089
17180
|
if (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;
|
|
17090
17181
|
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;
|
|
17091
17182
|
return false;
|
|
@@ -17100,7 +17191,7 @@
|
|
|
17100
17191
|
};
|
|
17101
17192
|
const _sanitizeDisallowedNode = function(currentNode, tagName, root) {
|
|
17102
17193
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
|
|
17103
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
17194
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {
|
|
17104
17195
|
const parentNode = getParentNode(currentNode);
|
|
17105
17196
|
const childNodes = getChildNodes(currentNode);
|
|
17106
17197
|
if (childNodes && parentNode) {
|
|
@@ -17124,6 +17215,7 @@
|
|
|
17124
17215
|
return true;
|
|
17125
17216
|
};
|
|
17126
17217
|
const _sanitizeElements = function(currentNode, root) {
|
|
17218
|
+
_markVisited(currentNode);
|
|
17127
17219
|
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
17128
17220
|
if (_handleHookDetachedNode(currentNode, root)) return true;
|
|
17129
17221
|
if (_isClobbered(currentNode)) {
|
|
@@ -17219,6 +17311,10 @@
|
|
|
17219
17311
|
return false;
|
|
17220
17312
|
}
|
|
17221
17313
|
};
|
|
17314
|
+
const _isUnsafeAttributeValue = function(name, value) {
|
|
17315
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) return true;
|
|
17316
|
+
return "attributename" === stringToLowerCase(name) && null !== stringMatch(value, "href");
|
|
17317
|
+
};
|
|
17222
17318
|
const _sanitizeAttributes = function(currentNode, root) {
|
|
17223
17319
|
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
17224
17320
|
if (_handleHookDetachedNode(currentNode, root)) return;
|
|
@@ -17252,11 +17348,7 @@
|
|
|
17252
17348
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
17253
17349
|
recreatedNamedProp = true;
|
|
17254
17350
|
}
|
|
17255
|
-
if (
|
|
17256
|
-
_removeAttribute(name, currentNode, attr);
|
|
17257
|
-
continue;
|
|
17258
|
-
}
|
|
17259
|
-
if ("attributename" === lcName && stringMatch(value, "href")) {
|
|
17351
|
+
if (_isUnsafeAttributeValue(name, value)) {
|
|
17260
17352
|
_removeAttribute(name, currentNode, attr);
|
|
17261
17353
|
continue;
|
|
17262
17354
|
}
|
|
@@ -17299,6 +17391,7 @@
|
|
|
17299
17391
|
}
|
|
17300
17392
|
}
|
|
17301
17393
|
}
|
|
17394
|
+
if (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);
|
|
17302
17395
|
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
17303
17396
|
};
|
|
17304
17397
|
const _sanitizeAttachedShadowRoots = function(root) {
|
|
@@ -17364,6 +17457,8 @@
|
|
|
17364
17457
|
if (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
17365
17458
|
DOMPurify.removed = [];
|
|
17366
17459
|
const inPlace = IN_PLACE && "string" != typeof dirty && _isNode(dirty);
|
|
17460
|
+
let inPlaceNodes = [];
|
|
17461
|
+
const outerVisited = IN_PLACE_VISITED;
|
|
17367
17462
|
if (inPlace) {
|
|
17368
17463
|
_neutralizePatchLinkage(dirty);
|
|
17369
17464
|
const nn = _readNodeName(dirty);
|
|
@@ -17378,12 +17473,8 @@
|
|
|
17378
17473
|
_neutralizeRoot(dirty);
|
|
17379
17474
|
throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
|
|
17380
17475
|
}
|
|
17381
|
-
|
|
17382
|
-
|
|
17383
|
-
} catch (error) {
|
|
17384
|
-
_neutralizeRoot(dirty);
|
|
17385
|
-
throw error;
|
|
17386
|
-
}
|
|
17476
|
+
inPlaceNodes = _collectLiveNodes(dirty);
|
|
17477
|
+
IN_PLACE_VISITED = setCreate();
|
|
17387
17478
|
} else if (_isNode(dirty)) {
|
|
17388
17479
|
body = _initDocument("<!---->");
|
|
17389
17480
|
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
@@ -17399,30 +17490,25 @@
|
|
|
17399
17490
|
if (body && FORCE_BODY) _forceRemove(body.firstChild);
|
|
17400
17491
|
const walkRoot = inPlace ? dirty : body;
|
|
17401
17492
|
try {
|
|
17493
|
+
if (inPlace) _sanitizeAttachedShadowRoots(dirty);
|
|
17402
17494
|
const nodeIterator = _createNodeIterator(walkRoot);
|
|
17403
17495
|
while(currentNode = nodeIterator.nextNode()){
|
|
17404
17496
|
_sanitizeElements(currentNode, walkRoot);
|
|
17405
17497
|
_sanitizeAttributes(currentNode, walkRoot);
|
|
17406
17498
|
if (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);
|
|
17407
17499
|
}
|
|
17500
|
+
if (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);
|
|
17408
17501
|
} catch (error) {
|
|
17409
17502
|
if (inPlace) {
|
|
17410
17503
|
_neutralizeRoot(dirty);
|
|
17411
|
-
|
|
17412
|
-
if (entry.element) _neutralizeSubtree(entry.element);
|
|
17413
|
-
});
|
|
17504
|
+
_neutralizeDiscarded(dirty, inPlaceNodes);
|
|
17414
17505
|
}
|
|
17415
17506
|
throw error;
|
|
17507
|
+
} finally{
|
|
17508
|
+
IN_PLACE_VISITED = outerVisited;
|
|
17416
17509
|
}
|
|
17417
17510
|
if (inPlace) {
|
|
17418
|
-
|
|
17419
|
-
arrayForEach(DOMPurify.removed, (entry)=>{
|
|
17420
|
-
if (entry.element) {
|
|
17421
|
-
if (entry.element === dirty) rootWasRemoved = true;
|
|
17422
|
-
_neutralizeSubtree(entry.element);
|
|
17423
|
-
}
|
|
17424
|
-
});
|
|
17425
|
-
if (rootWasRemoved) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
17511
|
+
if (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
17426
17512
|
if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);
|
|
17427
17513
|
return dirty;
|
|
17428
17514
|
}
|
|
@@ -17459,6 +17545,7 @@
|
|
|
17459
17545
|
if (!CONFIG) _parseConfig({});
|
|
17460
17546
|
const lcTag = transformCaseFunc(tag);
|
|
17461
17547
|
const lcName = transformCaseFunc(attr);
|
|
17548
|
+
if ("string" == typeof value && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;
|
|
17462
17549
|
return _isValidAttribute(lcTag, lcName, value);
|
|
17463
17550
|
};
|
|
17464
17551
|
DOMPurify.addHook = function(entryPoint, hookFunction) {
|
|
@@ -18925,7 +19012,8 @@
|
|
|
18925
19012
|
const l = this.float32Array.length;
|
|
18926
19013
|
const arr = new Int16Array(l);
|
|
18927
19014
|
this.float32Array.forEach((sample, i)=>{
|
|
18928
|
-
|
|
19015
|
+
const clampedSample = Number.isFinite(sample) ? Math.max(-1, sample) : sample;
|
|
19016
|
+
arr[i] = 0x7fff * Math.min(1, clampedSample);
|
|
18929
19017
|
});
|
|
18930
19018
|
return typedarray_to_buffer(arr);
|
|
18931
19019
|
}
|
|
@@ -18991,10 +19079,9 @@
|
|
|
18991
19079
|
});
|
|
18992
19080
|
volume.gain.value = this.options.audio.volume;
|
|
18993
19081
|
this.scriptProcessor = this.getAudioContext().createScriptProcessor(bufferSize, CHANNELS, CHANNELS);
|
|
18994
|
-
this.audioInput.connect(this.scriptProcessor);
|
|
18995
|
-
this.scriptProcessor.connect(this.getAudioContext().destination);
|
|
18996
19082
|
this.audioInput.connect(volume);
|
|
18997
19083
|
volume.connect(this.scriptProcessor);
|
|
19084
|
+
this.scriptProcessor.connect(this.getAudioContext().destination);
|
|
18998
19085
|
}
|
|
18999
19086
|
record(cb) {
|
|
19000
19087
|
this.options.logger.debug("AudioRecorder: record()");
|
|
@@ -21341,6 +21428,7 @@
|
|
|
21341
21428
|
form;
|
|
21342
21429
|
hasError = false;
|
|
21343
21430
|
submitted = false;
|
|
21431
|
+
pendingHostSubmission;
|
|
21344
21432
|
lastValidation = false;
|
|
21345
21433
|
containerElement;
|
|
21346
21434
|
built = false;
|
|
@@ -21575,6 +21663,7 @@
|
|
|
21575
21663
|
this.removeBrowserEventListeners();
|
|
21576
21664
|
this.removeAllListeners();
|
|
21577
21665
|
this.built = this.submitted = false;
|
|
21666
|
+
this.pendingHostSubmission = void 0;
|
|
21578
21667
|
}
|
|
21579
21668
|
}
|
|
21580
21669
|
show(params) {
|
|
@@ -21610,6 +21699,7 @@
|
|
|
21610
21699
|
const keepHidden = params?.keepHidden;
|
|
21611
21700
|
this.options.logger.debug(`Container: startOver(keepHidden = ${keepHidden})`);
|
|
21612
21701
|
this.submitted = false;
|
|
21702
|
+
this.pendingHostSubmission = void 0;
|
|
21613
21703
|
const replay = this.getReplay();
|
|
21614
21704
|
replay.hide();
|
|
21615
21705
|
replay.reset();
|
|
@@ -21739,10 +21829,15 @@
|
|
|
21739
21829
|
buttonsAreReady() {
|
|
21740
21830
|
return this.buttons.isReady();
|
|
21741
21831
|
}
|
|
21742
|
-
|
|
21832
|
+
getPendingHostSubmissionResponse(key) {
|
|
21833
|
+
return this.pendingHostSubmission?.key === key ? this.pendingHostSubmission?.response : void 0;
|
|
21834
|
+
}
|
|
21835
|
+
async submitAll(formData, method, url, hasHostAction = false) {
|
|
21743
21836
|
let response;
|
|
21837
|
+
let hostResponse;
|
|
21838
|
+
const videomailKey = formData[this.options.selectors.keyInputName];
|
|
21744
21839
|
try {
|
|
21745
|
-
const hasVideomailKey = Boolean(
|
|
21840
|
+
const hasVideomailKey = Boolean(videomailKey);
|
|
21746
21841
|
if (!hasVideomailKey && !this.options.enableAutoSubmission) return;
|
|
21747
21842
|
const output = [
|
|
21748
21843
|
method,
|
|
@@ -21753,7 +21848,19 @@
|
|
|
21753
21848
|
if (this.options.disableFormWhenSubmitting) this.disableForm(true);
|
|
21754
21849
|
this.emit("SUBMITTING");
|
|
21755
21850
|
if (hasVideomailKey) {
|
|
21756
|
-
response = await this.submitVideomail(formData, method);
|
|
21851
|
+
response = this.getPendingHostSubmissionResponse(videomailKey) ?? await this.submitVideomail(formData, method);
|
|
21852
|
+
if (this.options.enableAutoSubmission && hasHostAction) {
|
|
21853
|
+
if (videomailKey) this.pendingHostSubmission = {
|
|
21854
|
+
key: videomailKey,
|
|
21855
|
+
response
|
|
21856
|
+
};
|
|
21857
|
+
const hostFormData = {
|
|
21858
|
+
...formData
|
|
21859
|
+
};
|
|
21860
|
+
if (this.options.submitWithVideomail) hostFormData.videomail = response.body.videomail;
|
|
21861
|
+
hostResponse = await this.resource.form(hostFormData, url);
|
|
21862
|
+
this.pendingHostSubmission = void 0;
|
|
21863
|
+
}
|
|
21757
21864
|
this.submitted = true;
|
|
21758
21865
|
this.emit("SUBMITTED", {
|
|
21759
21866
|
videomail: response.body.videomail,
|
|
@@ -21776,7 +21883,8 @@
|
|
|
21776
21883
|
err
|
|
21777
21884
|
});
|
|
21778
21885
|
} finally{
|
|
21779
|
-
|
|
21886
|
+
const finalResponse = hostResponse ?? response;
|
|
21887
|
+
if (finalResponse?.text && "text/html" === finalResponse.type) document.body.innerHTML = purify_default.sanitize(finalResponse.text);
|
|
21780
21888
|
this.endWaiting();
|
|
21781
21889
|
}
|
|
21782
21890
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "videomail-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "A wicked npm package to record videos directly in the browser, for Deaf and Sign Language!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webcam",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"animitter": "3.0.0",
|
|
69
|
-
"audio-sample": "
|
|
69
|
+
"audio-sample": "8.0.1",
|
|
70
70
|
"canvas-to-buffer": "4.1.2",
|
|
71
71
|
"contains": "0.1.1",
|
|
72
72
|
"deepmerge": "4.3.1",
|
|
73
73
|
"defined": "1.0.1",
|
|
74
74
|
"document-visibility": "1.0.1",
|
|
75
|
-
"dompurify": "3.4.
|
|
75
|
+
"dompurify": "3.4.17",
|
|
76
76
|
"get-form-data": "3.0.0",
|
|
77
77
|
"is-power-of-two": "1.0.0",
|
|
78
78
|
"nanoevents": "10.0.0",
|
|
@@ -82,17 +82,17 @@
|
|
|
82
82
|
"websocket-stream": "5.5.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@chromatic-com/storybook": "5.
|
|
85
|
+
"@chromatic-com/storybook": "5.5.1",
|
|
86
86
|
"@eslint/config-inspector": "3.5.0",
|
|
87
87
|
"@eslint/js": "10.0.1",
|
|
88
88
|
"@rsbuild/plugin-node-polyfill": "1.4.6",
|
|
89
89
|
"@rsbuild/plugin-stylus": "2.0.1",
|
|
90
90
|
"@rsdoctor/rspack-plugin": "1.6.5",
|
|
91
91
|
"@rslib/core": "1.0.3",
|
|
92
|
-
"@storybook/addon-a11y": "10.6.
|
|
93
|
-
"@storybook/addon-docs": "10.6.
|
|
94
|
-
"@storybook/addon-links": "10.6.
|
|
95
|
-
"@storybook/html": "10.6.
|
|
92
|
+
"@storybook/addon-a11y": "10.6.2",
|
|
93
|
+
"@storybook/addon-docs": "10.6.2",
|
|
94
|
+
"@storybook/addon-links": "10.6.2",
|
|
95
|
+
"@storybook/html": "10.6.2",
|
|
96
96
|
"@tsconfig/node26": "26.0.1",
|
|
97
97
|
"@tsconfig/strictest": "2.0.8",
|
|
98
98
|
"@types/defined": "1.0.2",
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"@types/ua-parser-js": "0.7.39",
|
|
102
102
|
"@vitest/eslint-plugin": "1.6.27",
|
|
103
103
|
"audit-ci": "7.1.0",
|
|
104
|
-
"chromatic": "18.12.
|
|
104
|
+
"chromatic": "18.12.1",
|
|
105
105
|
"cross-env": "10.1.0",
|
|
106
106
|
"eslint": "10.12.0",
|
|
107
107
|
"eslint-import-resolver-typescript": "4.4.5",
|
|
108
|
-
"eslint-plugin-de-morgan": "2.2.
|
|
108
|
+
"eslint-plugin-de-morgan": "2.2.1",
|
|
109
109
|
"eslint-plugin-depend": "1.5.0",
|
|
110
110
|
"eslint-plugin-import-x": "4.17.1",
|
|
111
111
|
"eslint-plugin-package-json": "1.10.1",
|
|
@@ -121,12 +121,12 @@
|
|
|
121
121
|
"prettier-plugin-packagejson": "3.0.2",
|
|
122
122
|
"prettier-plugin-sh": "0.20.2",
|
|
123
123
|
"release-it": "21.1.1",
|
|
124
|
-
"storybook": "10.6.
|
|
124
|
+
"storybook": "10.6.2",
|
|
125
125
|
"storybook-html-rsbuild": "3.6.1",
|
|
126
126
|
"type-fest": "5.10.0",
|
|
127
127
|
"typescript": "6.0.3",
|
|
128
|
-
"typescript-eslint": "8.71.
|
|
129
|
-
"vitest": "5.0.
|
|
128
|
+
"typescript-eslint": "8.71.2",
|
|
129
|
+
"vitest": "5.0.4"
|
|
130
130
|
},
|
|
131
131
|
"engines": {
|
|
132
132
|
"node": "^26.5.0",
|