videomail-client 11.0.5 → 11.0.7
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/cjs/index.cjs +142 -121
- package/dist/esm/index.js +60 -54
- package/dist/esm/util/html/isHidden.d.ts +2 -0
- package/dist/esm/wrappers/form.d.ts +1 -1
- package/dist/esm/wrappers/visuals.d.ts +1 -1
- package/dist/umd/index.js +142 -121
- package/package.json +11 -12
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import superagent from "superagent";
|
|
|
3
3
|
import defined from "defined";
|
|
4
4
|
import { UAParser } from "ua-parser-js";
|
|
5
5
|
import get_form_data from "get-form-data";
|
|
6
|
-
import hidden_0 from "hidden";
|
|
7
6
|
import { createNanoEvents } from "nanoevents";
|
|
8
7
|
import deepmerge from "deepmerge";
|
|
9
8
|
import document_visibility from "document-visibility";
|
|
@@ -3608,7 +3607,7 @@ const constants = {
|
|
|
3608
3607
|
}
|
|
3609
3608
|
};
|
|
3610
3609
|
var package_namespaceObject = {
|
|
3611
|
-
rE: "11.0.
|
|
3610
|
+
rE: "11.0.7"
|
|
3612
3611
|
};
|
|
3613
3612
|
var VideoType_VideoType = /*#__PURE__*/ function(VideoType) {
|
|
3614
3613
|
VideoType["WebM"] = "webm";
|
|
@@ -3988,10 +3987,20 @@ class Despot {
|
|
|
3988
3987
|
}
|
|
3989
3988
|
}
|
|
3990
3989
|
const util_Despot = Despot;
|
|
3990
|
+
function hideElement(element) {
|
|
3991
|
+
if (!element) return;
|
|
3992
|
+
element.style.setProperty("display", "none", "important");
|
|
3993
|
+
}
|
|
3994
|
+
const html_hideElement = hideElement;
|
|
3991
3995
|
function isNotButton(element) {
|
|
3992
3996
|
return "BUTTON" !== element.tagName && "submit" !== element.getAttribute("type");
|
|
3993
3997
|
}
|
|
3994
3998
|
const html_isNotButton = isNotButton;
|
|
3999
|
+
function showElement(element) {
|
|
4000
|
+
if (!element) return;
|
|
4001
|
+
element.style.removeProperty("display");
|
|
4002
|
+
}
|
|
4003
|
+
const html_showElement = showElement;
|
|
3995
4004
|
const REGEX = /[ ,]+/u;
|
|
3996
4005
|
function trimEmail(email) {
|
|
3997
4006
|
return email.replace(REGEX, "");
|
|
@@ -4094,8 +4103,8 @@ class Form extends util_Despot {
|
|
|
4094
4103
|
else formControl.removeAttribute("disabled");
|
|
4095
4104
|
}
|
|
4096
4105
|
hideAll() {
|
|
4097
|
-
for (const formElement of this.formElement.elements)
|
|
4098
|
-
if (!this.formElement.classList.contains(this.options.selectors.containerClass))
|
|
4106
|
+
for (const formElement of this.formElement.elements)html_hideElement(formElement);
|
|
4107
|
+
if (!this.formElement.classList.contains(this.options.selectors.containerClass)) html_hideElement(this.formElement);
|
|
4099
4108
|
}
|
|
4100
4109
|
isRegisteredFormField(formElement) {
|
|
4101
4110
|
const formElementName = formElement.getAttribute("name");
|
|
@@ -4179,7 +4188,7 @@ class Form extends util_Despot {
|
|
|
4179
4188
|
}
|
|
4180
4189
|
hideSubmitButton() {
|
|
4181
4190
|
const submitButton = this.findSubmitButton();
|
|
4182
|
-
|
|
4191
|
+
html_hideElement(submitButton);
|
|
4183
4192
|
}
|
|
4184
4193
|
unload() {
|
|
4185
4194
|
this.options.logger.debug("Form: unload()");
|
|
@@ -4238,10 +4247,10 @@ class Form extends util_Despot {
|
|
|
4238
4247
|
return this.formElement.querySelector("[type='submit']");
|
|
4239
4248
|
}
|
|
4240
4249
|
hide() {
|
|
4241
|
-
|
|
4250
|
+
html_hideElement(this.formElement);
|
|
4242
4251
|
}
|
|
4243
4252
|
show() {
|
|
4244
|
-
|
|
4253
|
+
html_showElement(this.formElement);
|
|
4245
4254
|
}
|
|
4246
4255
|
}
|
|
4247
4256
|
const wrappers_form = Form;
|
|
@@ -4632,7 +4641,7 @@ function getOuterWidth_getOuterWidth(element) {
|
|
|
4632
4641
|
return outerWidth;
|
|
4633
4642
|
}
|
|
4634
4643
|
const getOuterWidth = getOuterWidth_getOuterWidth;
|
|
4635
|
-
function
|
|
4644
|
+
function limitWidth(element, options, width) {
|
|
4636
4645
|
let limitedWidth;
|
|
4637
4646
|
const outerWidth = getOuterWidth(element);
|
|
4638
4647
|
limitedWidth = width && "number" == typeof width ? outerWidth > 0 && outerWidth < width ? outerWidth : width : outerWidth;
|
|
@@ -4642,18 +4651,13 @@ function limitWidth_limitWidth(element, options, width) {
|
|
|
4642
4651
|
});
|
|
4643
4652
|
return limitedWidth;
|
|
4644
4653
|
}
|
|
4645
|
-
const
|
|
4654
|
+
const dimensions_limitWidth = limitWidth;
|
|
4646
4655
|
function disableElement(element) {
|
|
4647
4656
|
if (!element) return;
|
|
4648
4657
|
if ("INPUT" === element.tagName || "BUTTON" === element.tagName) element.setAttribute("disabled", "true");
|
|
4649
4658
|
else element.classList.add("disabled");
|
|
4650
4659
|
}
|
|
4651
4660
|
const html_disableElement = disableElement;
|
|
4652
|
-
function hideElement(element) {
|
|
4653
|
-
if (!element) return;
|
|
4654
|
-
hidden_0(element, true);
|
|
4655
|
-
}
|
|
4656
|
-
const html_hideElement = hideElement;
|
|
4657
4661
|
function adjustButton(buttonElement, show, type, disabled) {
|
|
4658
4662
|
if (disabled) html_disableElement(buttonElement);
|
|
4659
4663
|
if (type) buttonElement.type = type;
|
|
@@ -4669,14 +4673,10 @@ function enableElement(element) {
|
|
|
4669
4673
|
const html_enableElement = enableElement;
|
|
4670
4674
|
function isShown(element) {
|
|
4671
4675
|
if (!element) return false;
|
|
4672
|
-
|
|
4676
|
+
const display = element.style.getPropertyValue("display");
|
|
4677
|
+
return !display.includes("none");
|
|
4673
4678
|
}
|
|
4674
4679
|
const html_isShown = isShown;
|
|
4675
|
-
function showElement(element) {
|
|
4676
|
-
if (!element) return;
|
|
4677
|
-
hidden_0(element, false);
|
|
4678
|
-
}
|
|
4679
|
-
const html_showElement = showElement;
|
|
4680
4680
|
class Buttons extends util_Despot {
|
|
4681
4681
|
container;
|
|
4682
4682
|
buttonsElement;
|
|
@@ -5074,6 +5074,12 @@ class Buttons extends util_Despot {
|
|
|
5074
5074
|
}
|
|
5075
5075
|
}
|
|
5076
5076
|
const buttons = Buttons;
|
|
5077
|
+
function isHidden_isHidden(element) {
|
|
5078
|
+
if (!element) return true;
|
|
5079
|
+
const display = element.style.getPropertyValue("display");
|
|
5080
|
+
return display.includes("none");
|
|
5081
|
+
}
|
|
5082
|
+
const isHidden = isHidden_isHidden;
|
|
5077
5083
|
class Countdown {
|
|
5078
5084
|
visuals;
|
|
5079
5085
|
options;
|
|
@@ -5127,7 +5133,7 @@ class Countdown {
|
|
|
5127
5133
|
}
|
|
5128
5134
|
}
|
|
5129
5135
|
show() {
|
|
5130
|
-
|
|
5136
|
+
html_showElement(this.countdownElement);
|
|
5131
5137
|
}
|
|
5132
5138
|
isCountingDown() {
|
|
5133
5139
|
return Boolean(this.intervalId);
|
|
@@ -5138,7 +5144,7 @@ class Countdown {
|
|
|
5138
5144
|
this.intervalId = void 0;
|
|
5139
5145
|
}
|
|
5140
5146
|
hide() {
|
|
5141
|
-
|
|
5147
|
+
html_hideElement(this.countdownElement);
|
|
5142
5148
|
this.unload();
|
|
5143
5149
|
}
|
|
5144
5150
|
}
|
|
@@ -5178,10 +5184,10 @@ class FacingMode extends util_Despot {
|
|
|
5178
5184
|
this.initEvents();
|
|
5179
5185
|
}
|
|
5180
5186
|
hide() {
|
|
5181
|
-
|
|
5187
|
+
html_hideElement(this.facingModeElement);
|
|
5182
5188
|
}
|
|
5183
5189
|
show() {
|
|
5184
|
-
|
|
5190
|
+
html_showElement(this.facingModeElement);
|
|
5185
5191
|
}
|
|
5186
5192
|
}
|
|
5187
5193
|
const facingMode = FacingMode;
|
|
@@ -5226,10 +5232,10 @@ class PausedNote {
|
|
|
5226
5232
|
}
|
|
5227
5233
|
}
|
|
5228
5234
|
hide() {
|
|
5229
|
-
|
|
5235
|
+
html_hideElement(this.pausedBlockElement);
|
|
5230
5236
|
}
|
|
5231
5237
|
show() {
|
|
5232
|
-
|
|
5238
|
+
html_showElement(this.pausedBlockElement);
|
|
5233
5239
|
}
|
|
5234
5240
|
}
|
|
5235
5241
|
const pausedNote = PausedNote;
|
|
@@ -5261,10 +5267,10 @@ class RecordNote {
|
|
|
5261
5267
|
this.recordNoteElement?.classList.add("nigh");
|
|
5262
5268
|
}
|
|
5263
5269
|
hide() {
|
|
5264
|
-
|
|
5270
|
+
html_hideElement(this.recordNoteElement);
|
|
5265
5271
|
}
|
|
5266
5272
|
show() {
|
|
5267
|
-
|
|
5273
|
+
html_showElement(this.recordNoteElement);
|
|
5268
5274
|
}
|
|
5269
5275
|
}
|
|
5270
5276
|
const recorder_recordNote = RecordNote;
|
|
@@ -5338,12 +5344,12 @@ class RecordTimer {
|
|
|
5338
5344
|
if (this.recordTimerElement) this.recordTimerElement.innerHTML = `${mins}:${util_pad(secs)}`;
|
|
5339
5345
|
}
|
|
5340
5346
|
hide() {
|
|
5341
|
-
|
|
5347
|
+
html_hideElement(this.recordTimerElement);
|
|
5342
5348
|
}
|
|
5343
5349
|
show() {
|
|
5344
5350
|
this.recordTimerElement?.classList.remove("near");
|
|
5345
5351
|
this.recordTimerElement?.classList.remove("nigh");
|
|
5346
|
-
|
|
5352
|
+
html_showElement(this.recordTimerElement);
|
|
5347
5353
|
}
|
|
5348
5354
|
getSecondsRecorded() {
|
|
5349
5355
|
if (void 0 === this.countdown) return this.getSecondsRecorded();
|
|
@@ -5583,7 +5589,7 @@ class Notifier extends util_Despot {
|
|
|
5583
5589
|
}
|
|
5584
5590
|
}
|
|
5585
5591
|
show() {
|
|
5586
|
-
|
|
5592
|
+
html_showElement(this.notifyElement);
|
|
5587
5593
|
}
|
|
5588
5594
|
runEntertainment() {
|
|
5589
5595
|
if (this.options.notifier.entertain) {
|
|
@@ -5631,7 +5637,7 @@ class Notifier extends util_Despot {
|
|
|
5631
5637
|
this.messageElement.innerHTML = (problem ? "☹ " : "") + message;
|
|
5632
5638
|
} else this.options.logger.warn("There is no message element for displaying a message");
|
|
5633
5639
|
else this.options.logger.warn("Not going to update notifierMessage element because message is empty");
|
|
5634
|
-
|
|
5640
|
+
html_showElement(this.messageElement);
|
|
5635
5641
|
}
|
|
5636
5642
|
setExplanation(explanation) {
|
|
5637
5643
|
this.options.logger.debug(`Notifier: setExplanation(${explanation})`);
|
|
@@ -5642,7 +5648,7 @@ class Notifier extends util_Despot {
|
|
|
5642
5648
|
else this.options.logger.warn(`Unable to show explanation because notifyElement is empty: ${explanation}`);
|
|
5643
5649
|
}
|
|
5644
5650
|
this.explanationElement.innerHTML = explanation;
|
|
5645
|
-
|
|
5651
|
+
html_showElement(this.explanationElement);
|
|
5646
5652
|
}
|
|
5647
5653
|
build() {
|
|
5648
5654
|
this.options.logger.debug("Notifier: build()");
|
|
@@ -5657,15 +5663,15 @@ class Notifier extends util_Despot {
|
|
|
5657
5663
|
this.built = true;
|
|
5658
5664
|
}
|
|
5659
5665
|
hideMessage() {
|
|
5660
|
-
|
|
5666
|
+
html_hideElement(this.getMessageElement());
|
|
5661
5667
|
}
|
|
5662
5668
|
hideExplanation() {
|
|
5663
|
-
|
|
5669
|
+
html_hideElement(this.explanationElement);
|
|
5664
5670
|
}
|
|
5665
5671
|
hide() {
|
|
5666
5672
|
this.cancelEntertainment();
|
|
5667
5673
|
if (this.notifyElement) {
|
|
5668
|
-
|
|
5674
|
+
html_hideElement(this.notifyElement);
|
|
5669
5675
|
this.notifyElement.classList.remove("blocking");
|
|
5670
5676
|
}
|
|
5671
5677
|
this.hideMessage();
|
|
@@ -5673,7 +5679,7 @@ class Notifier extends util_Despot {
|
|
|
5673
5679
|
}
|
|
5674
5680
|
isVisible() {
|
|
5675
5681
|
if (!this.built) return false;
|
|
5676
|
-
return this.notifyElement && !
|
|
5682
|
+
return this.notifyElement && !isHidden(this.notifyElement);
|
|
5677
5683
|
}
|
|
5678
5684
|
isBuilt() {
|
|
5679
5685
|
return this.built;
|
|
@@ -5744,7 +5750,7 @@ function calculateHeight(responsive, videoWidth, options, target, ratio, element
|
|
|
5744
5750
|
message: `Unable to calculate height for target ${target} when width is less than 1 (= ${width}) and responsive mode is set to ${responsive}`,
|
|
5745
5751
|
options
|
|
5746
5752
|
});
|
|
5747
|
-
if (responsive && element) width =
|
|
5753
|
+
if (responsive && element) width = dimensions_limitWidth(element, options, width);
|
|
5748
5754
|
const chosenRatio = ratio ?? getRatio(options, void 0, videoWidth);
|
|
5749
5755
|
const height = Math.round(width * chosenRatio);
|
|
5750
5756
|
if (Number.isInteger(height) && height < 1) throw error_createError({
|
|
@@ -6272,7 +6278,7 @@ class Recorder extends util_Despot {
|
|
|
6272
6278
|
this.writeStream(audioBuffer);
|
|
6273
6279
|
}
|
|
6274
6280
|
show() {
|
|
6275
|
-
|
|
6281
|
+
html_showElement(this.recorderElement);
|
|
6276
6282
|
}
|
|
6277
6283
|
onUserMediaReady(params) {
|
|
6278
6284
|
try {
|
|
@@ -6656,7 +6662,7 @@ class Recorder extends util_Despot {
|
|
|
6656
6662
|
return this.visuals.isNotifying();
|
|
6657
6663
|
}
|
|
6658
6664
|
isHidden() {
|
|
6659
|
-
return !this.recorderElement ||
|
|
6665
|
+
return !this.recorderElement || isHidden(this.recorderElement);
|
|
6660
6666
|
}
|
|
6661
6667
|
writeCommand(command, args, cb) {
|
|
6662
6668
|
if (this.connected) {
|
|
@@ -7046,7 +7052,7 @@ class Recorder extends util_Despot {
|
|
|
7046
7052
|
}
|
|
7047
7053
|
hide() {
|
|
7048
7054
|
if (!this.isHidden()) {
|
|
7049
|
-
if (this.recorderElement)
|
|
7055
|
+
if (this.recorderElement) html_hideElement(this.recorderElement);
|
|
7050
7056
|
this.clearUserMediaTimeout();
|
|
7051
7057
|
this.clearRetryTimeout();
|
|
7052
7058
|
}
|
|
@@ -7190,9 +7196,9 @@ class Replay extends util_Despot {
|
|
|
7190
7196
|
const hasMedia = Boolean(this.videomail?.webm) || Boolean(this.videomail?.mp4) || Boolean(this.videomail?.poster);
|
|
7191
7197
|
if (hasMedia) this.correctDimensions(true, videomailWidth ?? this.replayElement.videoWidth, videomailHeight ?? this.replayElement.videoHeight);
|
|
7192
7198
|
if (playerOnly) {
|
|
7193
|
-
if (hasMedia)
|
|
7194
|
-
} else
|
|
7195
|
-
if (playerOnly)
|
|
7199
|
+
if (hasMedia) html_showElement(this.replayElement);
|
|
7200
|
+
} else html_showElement(this.replayElement);
|
|
7201
|
+
if (playerOnly) html_showElement(this.replayElement.parentElement);
|
|
7196
7202
|
else this.visuals.show();
|
|
7197
7203
|
if (hasAudio) this.replayElement.setAttribute("volume", "1");
|
|
7198
7204
|
else if (!isAudioEnabled(this.options)) this.replayElement.setAttribute("muted", "true");
|
|
@@ -7339,15 +7345,15 @@ class Replay extends util_Despot {
|
|
|
7339
7345
|
});
|
|
7340
7346
|
}
|
|
7341
7347
|
hide() {
|
|
7342
|
-
if (this.isStandalone())
|
|
7348
|
+
if (this.isStandalone()) this.visuals.hide();
|
|
7343
7349
|
else if (this.replayElement) {
|
|
7344
|
-
|
|
7345
|
-
|
|
7350
|
+
html_hideElement(this.replayElement);
|
|
7351
|
+
html_hideElement(this.replayElement.parentElement);
|
|
7346
7352
|
}
|
|
7347
7353
|
}
|
|
7348
7354
|
isShown() {
|
|
7349
7355
|
if (!this.replayElement) return false;
|
|
7350
|
-
return !
|
|
7356
|
+
return !isHidden(this.replayElement) && !this.visuals.isHidden();
|
|
7351
7357
|
}
|
|
7352
7358
|
getVisuals() {
|
|
7353
7359
|
return this.visuals;
|
|
@@ -7550,16 +7556,16 @@ class Visuals extends util_Despot {
|
|
|
7550
7556
|
}
|
|
7551
7557
|
hide() {
|
|
7552
7558
|
if (this.visualsElement) {
|
|
7553
|
-
|
|
7559
|
+
html_hideElement(this.visualsElement);
|
|
7554
7560
|
this.emit("HIDE");
|
|
7555
7561
|
}
|
|
7556
7562
|
}
|
|
7557
7563
|
isHidden() {
|
|
7558
7564
|
if (!this.built) return true;
|
|
7559
|
-
|
|
7565
|
+
return isHidden(this.visualsElement);
|
|
7560
7566
|
}
|
|
7561
7567
|
showVisuals() {
|
|
7562
|
-
|
|
7568
|
+
html_showElement(this.visualsElement);
|
|
7563
7569
|
}
|
|
7564
7570
|
show(params) {
|
|
7565
7571
|
if (!params?.playerOnly) if (this.isReplayShown()) {
|
|
@@ -7787,7 +7793,7 @@ class Container extends util_Despot {
|
|
|
7787
7793
|
this.endWaiting();
|
|
7788
7794
|
}
|
|
7789
7795
|
hideMySelf() {
|
|
7790
|
-
|
|
7796
|
+
html_hideElement(this.containerElement);
|
|
7791
7797
|
}
|
|
7792
7798
|
async submitVideomail(formInputs, method) {
|
|
7793
7799
|
const videomailFormData = this.form?.transformFormData(formInputs);
|
|
@@ -7806,7 +7812,7 @@ class Container extends util_Despot {
|
|
|
7806
7812
|
}
|
|
7807
7813
|
limitWidth(width) {
|
|
7808
7814
|
if (!this.containerElement) return;
|
|
7809
|
-
return
|
|
7815
|
+
return dimensions_limitWidth(this.containerElement, this.options, width);
|
|
7810
7816
|
}
|
|
7811
7817
|
limitHeight(height) {
|
|
7812
7818
|
return dimensions_limitHeight(height, this.options, "containers limitHeight fn");
|
|
@@ -7860,7 +7866,7 @@ class Container extends util_Despot {
|
|
|
7860
7866
|
message: "No container element exists.",
|
|
7861
7867
|
options: this.options
|
|
7862
7868
|
});
|
|
7863
|
-
|
|
7869
|
+
html_showElement(this.containerElement);
|
|
7864
7870
|
this.visuals.show(params);
|
|
7865
7871
|
if (!this.hasError) {
|
|
7866
7872
|
const paused = this.isPaused();
|
|
@@ -213,7 +213,7 @@ declare class Form extends Despot {
|
|
|
213
213
|
private stopListeningToSubmitEvents;
|
|
214
214
|
doTheSubmit(e?: any): Promise<boolean>;
|
|
215
215
|
getInvalidElement(): Element | null;
|
|
216
|
-
findSubmitButton():
|
|
216
|
+
findSubmitButton(): HTMLButtonElement | null;
|
|
217
217
|
hide(): void;
|
|
218
218
|
show(): void;
|
|
219
219
|
}
|