@wistia/wistia-player-react 0.3.16 → 0.3.18

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.
@@ -7108,38 +7108,50 @@ var init_wistia_player = __esm({
7108
7108
  return _createClass2(Color3, [{
7109
7109
  key: "parse",
7110
7110
  value: function parse2(input) {
7111
+ var parsed = false;
7111
7112
  if (Array.isArray(input)) {
7112
7113
  var _input$;
7113
7114
  this.r = input[0];
7114
7115
  this.g = input[1];
7115
7116
  this.b = input[2];
7116
7117
  this.a = (_input$ = input[3]) !== null && _input$ !== void 0 ? _input$ : 1;
7117
- } else if (rHex.test(input)) {
7118
- input = String(input);
7119
- var stripped = input.replace(/^#/, "");
7120
- if (stripped.length === 3 || stripped.length === 4) {
7121
- stripped = stripped.replace(hexBit, "$1$1");
7122
- }
7123
- this.r = parseInt(stripped.substr(0, 2), 16);
7124
- this.g = parseInt(stripped.substr(2, 2), 16);
7125
- this.b = parseInt(stripped.substr(4, 2), 16);
7126
- if (stripped.length === 8) {
7127
- this.a = parseInt(stripped.substr(6, 2), 16) / 255;
7128
- } else {
7129
- this.a = 1;
7130
- }
7131
- } else if (rRgb.test(input)) {
7132
- input = String(input);
7133
- var parts = input.match(rRgb);
7134
- this.r = parseFloat(p2v(parts[1]));
7135
- this.g = parseFloat(p2v(parts[2]));
7136
- this.b = parseFloat(p2v(parts[3]));
7137
- if (parts[4]) {
7138
- this.a = parseFloat(parts[4]);
7139
- } else {
7140
- this.a = 1;
7118
+ parsed = true;
7119
+ } else {
7120
+ var sanitized = String(input).replace(/\s+/g, "");
7121
+ if (rHex.test(sanitized)) {
7122
+ var stripped = sanitized.replace(/^#/, "");
7123
+ if (stripped.length === 3 || stripped.length === 4) {
7124
+ stripped = stripped.replace(hexBit, "$1$1");
7125
+ }
7126
+ this.r = parseInt(stripped.substr(0, 2), 16);
7127
+ this.g = parseInt(stripped.substr(2, 2), 16);
7128
+ this.b = parseInt(stripped.substr(4, 2), 16);
7129
+ if (stripped.length === 8) {
7130
+ this.a = parseInt(stripped.substr(6, 2), 16) / 255;
7131
+ } else {
7132
+ this.a = 1;
7133
+ }
7134
+ parsed = true;
7135
+ } else if (rRgb.test(sanitized)) {
7136
+ var parts = sanitized.match(rRgb);
7137
+ this.r = parseFloat(p2v(parts[1]));
7138
+ this.g = parseFloat(p2v(parts[2]));
7139
+ this.b = parseFloat(p2v(parts[3]));
7140
+ if (parts[4]) {
7141
+ this.a = parseFloat(parts[4]);
7142
+ } else {
7143
+ this.a = 1;
7144
+ }
7145
+ parsed = true;
7141
7146
  }
7142
7147
  }
7148
+ if (!parsed || isNaN(this.r) || isNaN(this.g) || isNaN(this.b) || isNaN(this.a) || this.r < 0 || this.g < 0 || this.b < 0 || this.a < 0) {
7149
+ this.r = 41;
7150
+ this.g = 73;
7151
+ this.b = 229;
7152
+ this.a = 1;
7153
+ console.error("An invalid color was provided, ".concat(input.toString(), ", using default color instead."));
7154
+ }
7143
7155
  return this;
7144
7156
  }
7145
7157
  }, {
@@ -8432,7 +8444,7 @@ var init_wistia_player = __esm({
8432
8444
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
8433
8445
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
8434
8446
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
8435
- var TAGGED_VERSION2 = "0.3.16";
8447
+ var TAGGED_VERSION2 = "0.3.18";
8436
8448
  var CURRENT_SHA2 = (
8437
8449
  /* unused pure expression or super */
8438
8450
  null
@@ -9338,7 +9350,6 @@ var init_wistia_player = __esm({
9338
9350
  var wrapperStyle = {
9339
9351
  borderRadius: "".concat(borderRadius, "px"),
9340
9352
  display: isVisible ? "block" : "none",
9341
- height: "".concat(scaledHeight, "px"),
9342
9353
  left: "calc(50% + ".concat((leftNudgeFraction || 0) * 100, "%)"),
9343
9354
  marginLeft: "-".concat(scaledWidth / 2, "px"),
9344
9355
  marginTop: "-".concat(scaledHeight / 2, "px"),
@@ -13602,7 +13613,7 @@ var init_wistia_player = __esm({
13602
13613
  var isNonEmptyString2 = (value) => isString2(value) && !isEmptyString(value);
13603
13614
  var isNumber3 = (value) => typeof value === "number";
13604
13615
  var isNotNumber = (value) => !isNumber3(value);
13605
- var isNaN = (value) => Number.isNaN(value);
13616
+ var isNaN2 = (value) => Number.isNaN(value);
13606
13617
  var isInteger = (value) => Number.isInteger(value);
13607
13618
  var isRecord = (value) => isNotNil2(value) && typeof value === "object" && !(value instanceof Array);
13608
13619
  var isNotRecord = (value) => !isRecord(value);
@@ -8,7 +8,7 @@ import {
8
8
  import { forwardRef, Suspense, lazy, Fragment } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  var WistiaPlayerWrapper = lazy(
11
- async () => import("./WistiaPlayerWrapper-Z76G2JEI.mjs").then((module) => ({
11
+ async () => import("./WistiaPlayerWrapper-5F5TFUHO.mjs").then((module) => ({
12
12
  default: module.WistiaPlayerWrapper
13
13
  }))
14
14
  );
@@ -37,7 +37,7 @@ var WistiaPlayerWrapper = forwardRef(
37
37
  setSwatchAspectRatio(ratio);
38
38
  });
39
39
  }
40
- void import("./wistia-player-JV5AKUF3.mjs");
40
+ void import("./wistia-player-HE5EHMCD.mjs");
41
41
  void customElements.whenDefined("wistia-player").then(() => {
42
42
  setIsWistiaPlayerDefined(true);
43
43
  });
@@ -6246,38 +6246,50 @@ var __webpack_modules__ = {
6246
6246
  return _createClass2(Color3, [{
6247
6247
  key: "parse",
6248
6248
  value: function parse2(input) {
6249
+ var parsed = false;
6249
6250
  if (Array.isArray(input)) {
6250
6251
  var _input$;
6251
6252
  this.r = input[0];
6252
6253
  this.g = input[1];
6253
6254
  this.b = input[2];
6254
6255
  this.a = (_input$ = input[3]) !== null && _input$ !== void 0 ? _input$ : 1;
6255
- } else if (rHex.test(input)) {
6256
- input = String(input);
6257
- var stripped = input.replace(/^#/, "");
6258
- if (stripped.length === 3 || stripped.length === 4) {
6259
- stripped = stripped.replace(hexBit, "$1$1");
6260
- }
6261
- this.r = parseInt(stripped.substr(0, 2), 16);
6262
- this.g = parseInt(stripped.substr(2, 2), 16);
6263
- this.b = parseInt(stripped.substr(4, 2), 16);
6264
- if (stripped.length === 8) {
6265
- this.a = parseInt(stripped.substr(6, 2), 16) / 255;
6266
- } else {
6267
- this.a = 1;
6268
- }
6269
- } else if (rRgb.test(input)) {
6270
- input = String(input);
6271
- var parts = input.match(rRgb);
6272
- this.r = parseFloat(p2v(parts[1]));
6273
- this.g = parseFloat(p2v(parts[2]));
6274
- this.b = parseFloat(p2v(parts[3]));
6275
- if (parts[4]) {
6276
- this.a = parseFloat(parts[4]);
6277
- } else {
6278
- this.a = 1;
6256
+ parsed = true;
6257
+ } else {
6258
+ var sanitized = String(input).replace(/\s+/g, "");
6259
+ if (rHex.test(sanitized)) {
6260
+ var stripped = sanitized.replace(/^#/, "");
6261
+ if (stripped.length === 3 || stripped.length === 4) {
6262
+ stripped = stripped.replace(hexBit, "$1$1");
6263
+ }
6264
+ this.r = parseInt(stripped.substr(0, 2), 16);
6265
+ this.g = parseInt(stripped.substr(2, 2), 16);
6266
+ this.b = parseInt(stripped.substr(4, 2), 16);
6267
+ if (stripped.length === 8) {
6268
+ this.a = parseInt(stripped.substr(6, 2), 16) / 255;
6269
+ } else {
6270
+ this.a = 1;
6271
+ }
6272
+ parsed = true;
6273
+ } else if (rRgb.test(sanitized)) {
6274
+ var parts = sanitized.match(rRgb);
6275
+ this.r = parseFloat(p2v(parts[1]));
6276
+ this.g = parseFloat(p2v(parts[2]));
6277
+ this.b = parseFloat(p2v(parts[3]));
6278
+ if (parts[4]) {
6279
+ this.a = parseFloat(parts[4]);
6280
+ } else {
6281
+ this.a = 1;
6282
+ }
6283
+ parsed = true;
6279
6284
  }
6280
6285
  }
6286
+ if (!parsed || isNaN(this.r) || isNaN(this.g) || isNaN(this.b) || isNaN(this.a) || this.r < 0 || this.g < 0 || this.b < 0 || this.a < 0) {
6287
+ this.r = 41;
6288
+ this.g = 73;
6289
+ this.b = 229;
6290
+ this.a = 1;
6291
+ console.error("An invalid color was provided, ".concat(input.toString(), ", using default color instead."));
6292
+ }
6281
6293
  return this;
6282
6294
  }
6283
6295
  }, {
@@ -7570,7 +7582,7 @@ var __webpack_modules__ = {
7570
7582
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
7571
7583
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
7572
7584
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
7573
- var TAGGED_VERSION2 = "0.3.16";
7585
+ var TAGGED_VERSION2 = "0.3.18";
7574
7586
  var CURRENT_SHA2 = (
7575
7587
  /* unused pure expression or super */
7576
7588
  null
@@ -8476,7 +8488,6 @@ var __webpack_modules__ = {
8476
8488
  var wrapperStyle = {
8477
8489
  borderRadius: "".concat(borderRadius, "px"),
8478
8490
  display: isVisible ? "block" : "none",
8479
- height: "".concat(scaledHeight, "px"),
8480
8491
  left: "calc(50% + ".concat((leftNudgeFraction || 0) * 100, "%)"),
8481
8492
  marginLeft: "-".concat(scaledWidth / 2, "px"),
8482
8493
  marginTop: "-".concat(scaledHeight / 2, "px"),
@@ -12740,7 +12751,7 @@ var __webpack_modules__ = {
12740
12751
  var isNonEmptyString2 = (value) => isString(value) && !isEmptyString(value);
12741
12752
  var isNumber2 = (value) => typeof value === "number";
12742
12753
  var isNotNumber = (value) => !isNumber2(value);
12743
- var isNaN = (value) => Number.isNaN(value);
12754
+ var isNaN2 = (value) => Number.isNaN(value);
12744
12755
  var isInteger = (value) => Number.isInteger(value);
12745
12756
  var isRecord = (value) => isNotNil(value) && typeof value === "object" && !(value instanceof Array);
12746
12757
  var isNotRecord = (value) => !isRecord(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/wistia-player-react",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "description": "An embeddable wistia-player web component and React wrapper to add responsive, lightweight, and SEO-friendly videos to your site.",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@wistia/type-guards": "^0.9.1",
49
- "@wistia/wistia-player": "0.3.16"
49
+ "@wistia/wistia-player": "0.3.18"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=18.0.0 <20.0.0",