videomail-client 11.5.1 → 11.5.3

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.
@@ -10496,8 +10496,7 @@ var __webpack_exports__ = {};
10496
10496
  "use strict";
10497
10497
  __webpack_require__.r(__webpack_exports__);
10498
10498
  __webpack_require__.d(__webpack_exports__, {
10499
- VideomailClient: ()=>src_client,
10500
- VideoType: ()=>VideoType
10499
+ VideomailClient: ()=>src_client
10501
10500
  });
10502
10501
  const constants = {
10503
10502
  SITE_NAME_LABEL: "x-videomail-site-name",
@@ -10660,7 +10659,7 @@ var __webpack_exports__ = {};
10660
10659
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10661
10660
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10662
10661
  var package_namespaceObject = {
10663
- rE: "11.5.1"
10662
+ rE: "11.5.3"
10664
10663
  };
10665
10664
  var defined = __webpack_require__("./node_modules/defined/index.js");
10666
10665
  var defined_default = /*#__PURE__*/ __webpack_require__.n(defined);
@@ -13841,7 +13840,7 @@ var __webpack_exports__ = {};
13841
13840
  return obj;
13842
13841
  }
13843
13842
  const FALLBACK_VIDEO_TYPE = VideoType.MP4;
13844
- class Browser_Browser {
13843
+ class Browser {
13845
13844
  isIOS() {
13846
13845
  return "iOS" === this.result.os.name;
13847
13846
  }
@@ -13874,7 +13873,7 @@ var __webpack_exports__ = {};
13874
13873
  isOkSafari() {
13875
13874
  const version = this.getBrowserVersion();
13876
13875
  if (!version) return false;
13877
- return this.isSafari() && parseFloat(version) >= 11;
13876
+ return this.isSafari() && Number.parseFloat(version) >= 11;
13878
13877
  }
13879
13878
  getVideoType(video) {
13880
13879
  if (!this.videoType) {
@@ -13915,10 +13914,10 @@ var __webpack_exports__ = {};
13915
13914
  this.result = userAgentParser.getResult();
13916
13915
  }
13917
13916
  }
13918
- const Browser = Browser_Browser;
13917
+ const util_Browser = Browser;
13919
13918
  let getBrowser_browser;
13920
13919
  function getBrowser(localOptions) {
13921
- if (!getBrowser_browser) getBrowser_browser = new Browser(localOptions);
13920
+ if (!getBrowser_browser) getBrowser_browser = new util_Browser(localOptions);
13922
13921
  return getBrowser_browser;
13923
13922
  }
13924
13923
  const util_getBrowser = getBrowser;
@@ -14917,6 +14916,7 @@ var __webpack_exports__ = {};
14917
14916
  displayErrors: true,
14918
14917
  adjustFormOnBrowserError: true,
14919
14918
  reportErrors: true,
14919
+ disableFormWhenSubmitting: true,
14920
14920
  fakeUaString: void 0,
14921
14921
  versions: {
14922
14922
  videomailNinjaFormPlugin: void 0
@@ -15528,7 +15528,7 @@ var __webpack_exports__ = {};
15528
15528
  }
15529
15529
  start(cb) {
15530
15530
  if (!this.countdownElement) throw new Error("Unable to start countdown without an element");
15531
- if ("number" != typeof this.options.video.countdown) throw new Error(`The defined countdown is not a valid number: ${this.options.video.countdown}`);
15531
+ if ("number" != typeof this.options.video.countdown) throw new TypeError(`The defined countdown is not a valid number: ${this.options.video.countdown}`);
15532
15532
  this.countdown = this.options.video.countdown;
15533
15533
  this.countdownElement.innerHTML = this.countdown.toString();
15534
15534
  this.show();
@@ -17916,7 +17916,7 @@ var __webpack_exports__ = {};
17916
17916
  const tracks = this.replayElement.getElementsByTagName("track");
17917
17917
  const firstTrack = tracks[0];
17918
17918
  if (firstTrack) if (src) firstTrack.setAttribute("src", src);
17919
- else this.replayElement.removeChild(firstTrack);
17919
+ else firstTrack.remove();
17920
17920
  else {
17921
17921
  const track = document.createElement("track");
17922
17922
  track.setAttribute("src", src);
@@ -17933,7 +17933,7 @@ var __webpack_exports__ = {};
17933
17933
  let url = src;
17934
17934
  if (url && bustCache) url += `?${Date.now()}`;
17935
17935
  if (source) if (src) source.setAttribute("src", src);
17936
- else this.replayElement.removeChild(source);
17936
+ else source.remove();
17937
17937
  else if (src) {
17938
17938
  const { fps } = this.options.video;
17939
17939
  const t = 1 / fps * 2;
@@ -18101,8 +18101,7 @@ var __webpack_exports__ = {};
18101
18101
  null == (_this_visualsElement = this.visualsElement) || _this_visualsElement.appendChild(child);
18102
18102
  }
18103
18103
  removeChild(child) {
18104
- var _this_visualsElement;
18105
- null == (_this_visualsElement = this.visualsElement) || _this_visualsElement.removeChild(child);
18104
+ child.remove();
18106
18105
  }
18107
18106
  reset() {
18108
18107
  this.endWaiting();
@@ -18687,7 +18686,7 @@ var __webpack_exports__ = {};
18687
18686
  ].filter(Boolean).join(": ");
18688
18687
  this.options.logger.debug(`Container: submitAll(${output})`);
18689
18688
  this.beginWaiting();
18690
- this.disableForm(true);
18689
+ if (this.options.disableFormWhenSubmitting) this.disableForm(true);
18691
18690
  this.emit("SUBMITTING");
18692
18691
  if (hasVideomailKey) {
18693
18692
  response = await this.submitVideomail(formData, method);
@@ -18885,10 +18884,8 @@ var __webpack_exports__ = {};
18885
18884
  client_define_property(VideomailClient, "ENC_TYPE_FORM", constants["public"].ENC_TYPE_FORM);
18886
18885
  const src_client = VideomailClient;
18887
18886
  })();
18888
- exports.VideoType = __webpack_exports__.VideoType;
18889
18887
  exports.VideomailClient = __webpack_exports__.VideomailClient;
18890
18888
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
18891
- "VideoType",
18892
18889
  "VideomailClient"
18893
18890
  ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
18894
18891
  Object.defineProperty(exports, '__esModule', {
@@ -1,5 +1,5 @@
1
1
  import { PartialVideomailClientOptions } from "./types/options";
2
- import Videomail from "./types/Videomail";
2
+ import { Videomail } from "./types/Videomail";
3
3
  import Despot from "./util/Despot";
4
4
  export interface StartOverParams {
5
5
  keepHidden?: boolean | undefined;
@@ -1,12 +1,11 @@
1
1
  import VideomailClient from "./client";
2
- import { Command, VideomailCommandArgs } from "./types/command";
3
- import DeliveryRecord from "./types/DeliveryRecord";
4
- import { EmailAddress, EmailAddresses } from "./types/EmailAddress";
5
- import { FullVideomailErrorData, VideomailErrorData } from "./types/error";
6
- import VideomailEvents, { VideomailPreviewParams } from "./types/events";
7
- import { VideomailClientOptions } from "./types/options";
8
- import RecordingStats from "./types/RecordingStats";
9
- import Videomail, { PartialVideomail } from "./types/Videomail";
10
- import { VideoType, VideoTypeType } from "./types/VideoType";
11
- export type { Command, DeliveryRecord, EmailAddress, EmailAddresses, FullVideomailErrorData, PartialVideomail, RecordingStats, Videomail, VideomailClientOptions, VideomailCommandArgs, VideomailErrorData, VideomailEvents, VideomailPreviewParams, VideoTypeType, };
12
- export { VideomailClient, VideoType };
2
+ export type { Command } from "./types/command";
3
+ export type DeliveryRecord = "./types/DeliveryRecord";
4
+ export type { VideomailCommandArgs } from "./types/command";
5
+ export type { EmailAddress, EmailAddresses } from "./types/EmailAddress";
6
+ export type { FullVideomailErrorData, VideomailErrorData } from "./types/error";
7
+ export type { VideomailEvents, VideomailPreviewParams } from "./types/events";
8
+ export type { VideomailClientOptions } from "./types/options";
9
+ export type RecordingStats = "./types/RecordingStats";
10
+ export type { PartialVideomail, Videomail } from "./types/Videomail";
11
+ export { VideomailClient };
package/dist/esm/index.js CHANGED
@@ -3602,7 +3602,7 @@ const constants = {
3602
3602
  }
3603
3603
  };
3604
3604
  var package_namespaceObject = {
3605
- rE: "11.5.1"
3605
+ rE: "11.5.3"
3606
3606
  };
3607
3607
  const VideoType = {
3608
3608
  WebM: "webm",
@@ -3657,7 +3657,7 @@ class Browser {
3657
3657
  isOkSafari() {
3658
3658
  const version = this.getBrowserVersion();
3659
3659
  if (!version) return false;
3660
- return this.isSafari() && parseFloat(version) >= 11;
3660
+ return this.isSafari() && Number.parseFloat(version) >= 11;
3661
3661
  }
3662
3662
  getVideoType(video) {
3663
3663
  if (!this.videoType) {
@@ -4536,6 +4536,7 @@ const options_options = {
4536
4536
  displayErrors: true,
4537
4537
  adjustFormOnBrowserError: true,
4538
4538
  reportErrors: true,
4539
+ disableFormWhenSubmitting: true,
4539
4540
  fakeUaString: void 0,
4540
4541
  versions: {
4541
4542
  videomailNinjaFormPlugin: void 0
@@ -5109,7 +5110,7 @@ class Countdown {
5109
5110
  }
5110
5111
  start(cb) {
5111
5112
  if (!this.countdownElement) throw new Error("Unable to start countdown without an element");
5112
- if ("number" != typeof this.options.video.countdown) throw new Error(`The defined countdown is not a valid number: ${this.options.video.countdown}`);
5113
+ if ("number" != typeof this.options.video.countdown) throw new TypeError(`The defined countdown is not a valid number: ${this.options.video.countdown}`);
5113
5114
  this.countdown = this.options.video.countdown;
5114
5115
  this.countdownElement.innerHTML = this.countdown.toString();
5115
5116
  this.show();
@@ -7288,7 +7289,7 @@ class Replay extends util_Despot {
7288
7289
  const tracks = this.replayElement.getElementsByTagName("track");
7289
7290
  const firstTrack = tracks[0];
7290
7291
  if (firstTrack) if (src) firstTrack.setAttribute("src", src);
7291
- else this.replayElement.removeChild(firstTrack);
7292
+ else firstTrack.remove();
7292
7293
  else {
7293
7294
  const track = document.createElement("track");
7294
7295
  track.setAttribute("src", src);
@@ -7305,7 +7306,7 @@ class Replay extends util_Despot {
7305
7306
  let url = src;
7306
7307
  if (url && bustCache) url += `?${Date.now()}`;
7307
7308
  if (source) if (src) source.setAttribute("src", src);
7308
- else this.replayElement.removeChild(source);
7309
+ else source.remove();
7309
7310
  else if (src) {
7310
7311
  const { fps } = this.options.video;
7311
7312
  const t = 1 / fps * 2;
@@ -7468,7 +7469,7 @@ class Visuals extends util_Despot {
7468
7469
  this.visualsElement?.appendChild(child);
7469
7470
  }
7470
7471
  removeChild(child) {
7471
- this.visualsElement?.removeChild(child);
7472
+ child.remove();
7472
7473
  }
7473
7474
  reset() {
7474
7475
  this.endWaiting();
@@ -8036,7 +8037,7 @@ class Container extends util_Despot {
8036
8037
  ].filter(Boolean).join(": ");
8037
8038
  this.options.logger.debug(`Container: submitAll(${output})`);
8038
8039
  this.beginWaiting();
8039
- this.disableForm(true);
8040
+ if (this.options.disableFormWhenSubmitting) this.disableForm(true);
8040
8041
  this.emit("SUBMITTING");
8041
8042
  if (hasVideomailKey) {
8042
8043
  response = await this.submitVideomail(formData, method);
@@ -8214,4 +8215,4 @@ class VideomailClient extends util_Despot {
8214
8215
  }
8215
8216
  }
8216
8217
  const client = VideomailClient;
8217
- export { VideoType, client as VideomailClient };
8218
+ export { client as VideomailClient };
@@ -1,6 +1,6 @@
1
1
  import Response from "superagent/lib/node/response";
2
2
  import { VideomailClientOptions } from "./types/options";
3
- import Videomail, { PartialVideomail } from "./types/Videomail";
3
+ import { PartialVideomail, Videomail } from "./types/Videomail";
4
4
  import VideomailError from "./util/error/VideomailError";
5
5
  import { FormInputs } from "./wrappers/form";
6
6
  declare class Resource {
@@ -3,7 +3,7 @@ import DeliveryRecord from "./DeliveryRecord";
3
3
  import { EmailAddress, EmailAddresses } from "./EmailAddress";
4
4
  import RecordingStats from "./RecordingStats";
5
5
  import VideoFormat from "./VideoFormat";
6
- interface Videomail {
6
+ export interface Videomail {
7
7
  subject?: string;
8
8
  body?: string;
9
9
  from: EmailAddress;
@@ -54,4 +54,3 @@ interface Videomail {
54
54
  rejectedBcc?: DeliveryRecord;
55
55
  }
56
56
  export type PartialVideomail = PartialDeep<Videomail>;
57
- export default Videomail;
@@ -2,7 +2,7 @@ import Response from "superagent/lib/node/response";
2
2
  import VideomailError from "../../util/error/VideomailError";
3
3
  import { FormReadyParams } from "../../wrappers/container";
4
4
  import RecordingStats from "../RecordingStats";
5
- import Videomail from "../Videomail";
5
+ import { Videomail } from "../Videomail";
6
6
  export interface UserMediaReadyParams {
7
7
  switchingFacingMode?: ConstrainDOMString | undefined;
8
8
  recordWhenReady?: boolean | undefined;
@@ -44,7 +44,7 @@ export interface InvalidParams {
44
44
  whyInvalid?: string | undefined;
45
45
  invalidData?: Record<string, string>;
46
46
  }
47
- interface VideomailEvents {
47
+ export interface VideomailEvents {
48
48
  ASKING_WEBCAM_PERMISSION: () => void;
49
49
  BEGIN_AUDIO_ENCODING: () => void;
50
50
  BEGIN_VIDEO_ENCODING: () => void;
@@ -89,4 +89,3 @@ interface VideomailEvents {
89
89
  VALIDATING: (params?: ValidatingParams) => void;
90
90
  VISIBLE: () => void;
91
91
  }
92
- export default VideomailEvents;
@@ -111,6 +111,7 @@ export interface VideomailClientOptions {
111
111
  displayErrors: boolean;
112
112
  adjustFormOnBrowserError: boolean;
113
113
  reportErrors: boolean;
114
+ disableFormWhenSubmitting?: boolean | undefined;
114
115
  fakeUaString?: string | undefined;
115
116
  versions?: {
116
117
  videomailNinjaFormPlugin?: string | undefined;
@@ -1,4 +1,4 @@
1
- import VideomailEvents from "../types/events";
1
+ import { VideomailEvents } from "../types/events";
2
2
  import { VideomailClientOptions } from "../types/options";
3
3
  declare class Despot {
4
4
  private readonly name;
@@ -1,7 +1,7 @@
1
1
  import "./../styles/main.styl";
2
2
  import { ShowParams, StartOverParams } from "../client";
3
3
  import { VideomailClientOptions } from "../types/options";
4
- import Videomail from "../types/Videomail";
4
+ import { Videomail } from "../types/Videomail";
5
5
  import Despot from "../util/Despot";
6
6
  import { FormInputs, FormMethodType } from "./form";
7
7
  interface BuildOptions {
@@ -1,5 +1,5 @@
1
1
  import { VideomailClientOptions } from "../types/options";
2
- import Videomail from "../types/Videomail";
2
+ import { Videomail } from "../types/Videomail";
3
3
  import Despot from "../util/Despot";
4
4
  import Container from "./container";
5
5
  export type FormInputs = Record<string, string>;
@@ -1,5 +1,5 @@
1
1
  import { VideomailClientOptions } from "../../types/options";
2
- import Videomail from "../../types/Videomail";
2
+ import { Videomail } from "../../types/Videomail";
3
3
  import Despot from "../../util/Despot";
4
4
  import { UnloadParams } from "../container";
5
5
  import Visuals from "../visuals";
@@ -41,7 +41,7 @@ declare class Visuals extends Despot {
41
41
  recordOrStop(): void;
42
42
  getRecorder(): Recorder;
43
43
  validate(): boolean;
44
- getRecordingStats(): import("..").RecordingStats | undefined;
44
+ getRecordingStats(): import("../types/RecordingStats").default | undefined;
45
45
  getAudioSampleRate(): number | undefined;
46
46
  isPaused(): boolean | undefined;
47
47
  error(err: VideomailError): void;
package/dist/umd/index.js CHANGED
@@ -10502,8 +10502,7 @@
10502
10502
  "use strict";
10503
10503
  __webpack_require__.r(__webpack_exports__);
10504
10504
  __webpack_require__.d(__webpack_exports__, {
10505
- VideomailClient: ()=>src_client,
10506
- VideoType: ()=>VideoType
10505
+ VideomailClient: ()=>src_client
10507
10506
  });
10508
10507
  const constants = {
10509
10508
  SITE_NAME_LABEL: "x-videomail-site-name",
@@ -10666,7 +10665,7 @@
10666
10665
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10667
10666
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10668
10667
  var package_namespaceObject = {
10669
- rE: "11.5.1"
10668
+ rE: "11.5.3"
10670
10669
  };
10671
10670
  var defined = __webpack_require__("./node_modules/defined/index.js");
10672
10671
  var defined_default = /*#__PURE__*/ __webpack_require__.n(defined);
@@ -13879,7 +13878,7 @@
13879
13878
  isOkSafari() {
13880
13879
  const version = this.getBrowserVersion();
13881
13880
  if (!version) return false;
13882
- return this.isSafari() && parseFloat(version) >= 11;
13881
+ return this.isSafari() && Number.parseFloat(version) >= 11;
13883
13882
  }
13884
13883
  getVideoType(video) {
13885
13884
  if (!this.videoType) {
@@ -14871,6 +14870,7 @@
14871
14870
  displayErrors: true,
14872
14871
  adjustFormOnBrowserError: true,
14873
14872
  reportErrors: true,
14873
+ disableFormWhenSubmitting: true,
14874
14874
  fakeUaString: void 0,
14875
14875
  versions: {
14876
14876
  videomailNinjaFormPlugin: void 0
@@ -15448,7 +15448,7 @@
15448
15448
  }
15449
15449
  start(cb) {
15450
15450
  if (!this.countdownElement) throw new Error("Unable to start countdown without an element");
15451
- if ("number" != typeof this.options.video.countdown) throw new Error(`The defined countdown is not a valid number: ${this.options.video.countdown}`);
15451
+ if ("number" != typeof this.options.video.countdown) throw new TypeError(`The defined countdown is not a valid number: ${this.options.video.countdown}`);
15452
15452
  this.countdown = this.options.video.countdown;
15453
15453
  this.countdownElement.innerHTML = this.countdown.toString();
15454
15454
  this.show();
@@ -17703,7 +17703,7 @@
17703
17703
  const tracks = this.replayElement.getElementsByTagName("track");
17704
17704
  const firstTrack = tracks[0];
17705
17705
  if (firstTrack) if (src) firstTrack.setAttribute("src", src);
17706
- else this.replayElement.removeChild(firstTrack);
17706
+ else firstTrack.remove();
17707
17707
  else {
17708
17708
  const track = document.createElement("track");
17709
17709
  track.setAttribute("src", src);
@@ -17720,7 +17720,7 @@
17720
17720
  let url = src;
17721
17721
  if (url && bustCache) url += `?${Date.now()}`;
17722
17722
  if (source) if (src) source.setAttribute("src", src);
17723
- else this.replayElement.removeChild(source);
17723
+ else source.remove();
17724
17724
  else if (src) {
17725
17725
  const { fps } = this.options.video;
17726
17726
  const t = 1 / fps * 2;
@@ -17883,7 +17883,7 @@
17883
17883
  this.visualsElement?.appendChild(child);
17884
17884
  }
17885
17885
  removeChild(child) {
17886
- this.visualsElement?.removeChild(child);
17886
+ child.remove();
17887
17887
  }
17888
17888
  reset() {
17889
17889
  this.endWaiting();
@@ -18451,7 +18451,7 @@
18451
18451
  ].filter(Boolean).join(": ");
18452
18452
  this.options.logger.debug(`Container: submitAll(${output})`);
18453
18453
  this.beginWaiting();
18454
- this.disableForm(true);
18454
+ if (this.options.disableFormWhenSubmitting) this.disableForm(true);
18455
18455
  this.emit("SUBMITTING");
18456
18456
  if (hasVideomailKey) {
18457
18457
  response = await this.submitVideomail(formData, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "11.5.1",
3
+ "version": "11.5.3",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -49,7 +49,7 @@
49
49
  "lint:fix": "eslint --color --fix .",
50
50
  "lint:inspect": "eslint --inspect-config",
51
51
  "prettier": "prettier --check ./etc ./src ./.storybook ./*.ts ./*.js",
52
- "prettier:fix": "prettier --write ./etc ./src ./.storybook ./*.ts",
52
+ "prettier:fix": "prettier --write ./etc ./src ./.storybook ./*.ts ./*.js",
53
53
  "release": "release-it --only-version --config ./etc/release-it.ts",
54
54
  "storybook": "cross-env BROWSER=chromium storybook dev -p 8443 --https --ssl-cert ./etc/ssl-certs/localhost.crt --ssl-key ./etc/ssl-certs/localhost.key",
55
55
  "test": "cross-env ENVIRON=test vitest --watch=false",
@@ -76,7 +76,7 @@
76
76
  "devDependencies": {
77
77
  "@chromatic-com/storybook": "4.1.1",
78
78
  "@eslint/config-inspector": "1.3.0",
79
- "@eslint/js": "9.37.0",
79
+ "@eslint/js": "9.38.0",
80
80
  "@rsbuild/plugin-node-polyfill": "1.4.2",
81
81
  "@rsbuild/plugin-stylus": "1.2.0",
82
82
  "@rsdoctor/rspack-plugin": "1.3.3",
@@ -91,11 +91,11 @@
91
91
  "@types/node": "22.18.6",
92
92
  "@types/superagent": "8.1.9",
93
93
  "@types/ua-parser-js": "0.7.39",
94
- "@vitest/eslint-plugin": "1.3.20",
94
+ "@vitest/eslint-plugin": "1.3.23",
95
95
  "audit-ci": "7.1.0",
96
96
  "chromatic": "13.3.0",
97
97
  "cross-env": "10.1.0",
98
- "eslint": "9.37.0",
98
+ "eslint": "9.38.0",
99
99
  "eslint-import-resolver-typescript": "4.4.4",
100
100
  "eslint-plugin-de-morgan": "2.0.0",
101
101
  "eslint-plugin-depend": "1.3.1",
@@ -107,7 +107,7 @@
107
107
  "eslint-plugin-simple-import-sort": "12.1.1",
108
108
  "eslint-plugin-storybook": "9.1.12",
109
109
  "globals": "16.4.0",
110
- "jsdom": "27.0.0",
110
+ "jsdom": "27.0.1",
111
111
  "msw": "2.11.5",
112
112
  "msw-storybook-addon": "2.0.6",
113
113
  "prettier": "3.6.2",