@wistia/vhs 6.0.0-beta.edb1da9a.6991690 → 6.0.0-beta.f2b77d85.92e2bfa

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v6.0.0-beta.edb1da9a.6991690
3
+ * @license @wistia/vhs v6.0.0-beta.f2b77d85.92e2bfa
4
4
  *
5
5
  * Copyright (c) 2021-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -2718,7 +2718,7 @@ const ModalBaseContent = ({ className, initialShownState = false, isDismissible
2718
2718
  const modalRoot = useRef(modalEl);
2719
2719
  const attemptHide = useCallback(() => {
2720
2720
  if (isNotUndefined(onBeforeHide)) {
2721
- const { shouldShowMessage, message } = new Object(onBeforeHide());
2721
+ const { shouldShowMessage, message } = Object(onBeforeHide());
2722
2722
  if (shouldShowMessage) {
2723
2723
  if (!window.confirm(message)) return;
2724
2724
  }
@@ -2752,7 +2752,7 @@ const ModalBaseContent = ({ className, initialShownState = false, isDismissible
2752
2752
  };
2753
2753
  if (isShown) {
2754
2754
  const focusable = getFocusableElements(modalRoot.current);
2755
- if (!focusable.some((element) => element === document.activeElement)) {
2755
+ if (!focusable.find((element) => element === document.activeElement)) {
2756
2756
  const firstFocusable = focusable[0];
2757
2757
  if (firstFocusable) firstFocusable.focus();
2758
2758
  }
@@ -3799,7 +3799,11 @@ const colorVariants = {
3799
3799
  };
3800
3800
  const colorVariantKeys = Object.keys(colorVariants);
3801
3801
  const multiplier = 31;
3802
- const hashCode = (str) => Array.from(str).reduce((sum, char) => Math.imul(multiplier, sum) + char.charCodeAt(0) | 0, 0);
3802
+ const hashCode = (str) => {
3803
+ let sum = 0;
3804
+ for (let i = 0; i < str.length; i += 1) sum = Math.imul(multiplier, sum) + str.charCodeAt(i) | 0;
3805
+ return sum;
3806
+ };
3803
3807
  const generateContactAvatarColors = ({ seed, themeColors }) => {
3804
3808
  return colorVariants[colorVariantKeys[Math.abs(hashCode(seed)) % colorVariantKeys.length]].map((themeColorToken) => themeColors[themeColorToken]).filter((color) => color !== void 0);
3805
3809
  };
@@ -5657,8 +5661,8 @@ const copyToClipboard = async (textToCopy) => {
5657
5661
  }
5658
5662
  selection?.removeAllRanges();
5659
5663
  span.remove();
5660
- if (success) return;
5661
- throw new DOMException("The request is not allowed", "NotAllowedError");
5664
+ if (success) return Promise.resolve();
5665
+ return Promise.reject(new DOMException("The request is not allowed", "NotAllowedError"));
5662
5666
  };
5663
5667
  //#endregion
5664
5668
  //#region src/components/Input/ClickToCopy.tsx
@@ -5767,7 +5771,7 @@ const timeUnitsToString = (seconds, minutes, hours) => {
5767
5771
  return formattedString;
5768
5772
  };
5769
5773
  const formatString = (string) => {
5770
- const [initialSeconds, initialMinutes, initialHours] = string.split(":").toReversed().map((stringNumber) => parseNumber(stringNumber));
5774
+ const [initialSeconds, initialMinutes, initialHours] = string.split(":").reverse().map((stringNumber) => parseNumber(stringNumber));
5771
5775
  let seconds = 0;
5772
5776
  let minutes = 0;
5773
5777
  if (isNotNil(initialSeconds)) {
@@ -7152,7 +7156,7 @@ const RichTextEditor = ({ enabledFormats = Object.values(rteFormatTypes), value
7152
7156
  toggleBlock(editor, "image");
7153
7157
  Transforms.removeNodes(editor, { at: selection });
7154
7158
  Transforms.move(editor, { reverse: true });
7155
- const spanElement = editor.children.find((child) => Element.isElement(child) && child.type === "span");
7159
+ const spanElement = editor.children.filter((child) => Element.isElement(child) && child.type === "span")[0];
7156
7160
  if (Element.isElement(spanElement) && spanElement.type === "span" && isNotNil(spanElement.children) && isNotNil(spanElement.children[0]) && isNotNil(spanElement.children[0].text) && spanElement.children[0].text.trim() !== "") Transforms.setNodes(editor, { type: "paragraph" }, {
7157
7161
  match: (node) => Element.isElement(node) && node.type === "span" && isNotNil(node.children) && Text$1.isText(node.children[0]) && isNotNil(node.children[0].text) && node.children[0].text.trim() !== "",
7158
7162
  split: true,