@wistia/vhs 4.0.0-beta.15b04477.c41d423 → 4.0.0-beta.297d7ed5.4ab52c0
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.cjs +35 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +38 -36
- package/dist/index.d.ts +38 -36
- package/dist/index.mjs +47 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +26 -25
package/dist/index.d.mts
CHANGED
|
@@ -2,14 +2,15 @@ import * as styled_components from 'styled-components';
|
|
|
2
2
|
import { css, DefaultTheme } from 'styled-components';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import { JSX, ReactNode, ComponentPropsWithoutRef, Dispatch, SetStateAction, RefObject, MutableRefObject, MouseEvent, ComponentPropsWithRef, ChangeEvent, ElementType, FocusEvent, HTMLInputTypeAttribute, KeyboardEvent as KeyboardEvent$1, ReactElement, ComponentType, PropsWithChildren } from 'react';
|
|
5
|
+
import { JSX, ReactNode, ComponentPropsWithoutRef, Dispatch, SetStateAction, RefObject, MutableRefObject, MouseEvent, ComponentPropsWithRef, ChangeEvent, ElementType, Ref, ComponentClass, ComponentProps, FocusEvent, HTMLInputTypeAttribute, KeyboardEvent as KeyboardEvent$1, ReactElement, ComponentType, PropsWithChildren } from 'react';
|
|
6
6
|
import { FormikProps, FormikHelpers, FormikErrors, Field } from 'formik';
|
|
7
7
|
export { useFormikContext } from 'formik';
|
|
8
|
+
import { BaseEditor, Descendant } from 'slate';
|
|
9
|
+
import { ReactEditor } from 'slate-react';
|
|
10
|
+
import { HistoryEditor } from 'slate-history';
|
|
8
11
|
import { DropdownMenuProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuCheckboxItemProps, DropdownMenuRadioItemProps } from '@radix-ui/react-dropdown-menu';
|
|
9
12
|
export { DropdownMenuRadioGroup as MenuRadioGroup } from '@radix-ui/react-dropdown-menu';
|
|
10
13
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
11
|
-
import { Descendant } from 'slate';
|
|
12
|
-
import { ReactEditor } from 'slate-react';
|
|
13
14
|
|
|
14
15
|
interface VHSTheme {
|
|
15
16
|
readonly breakpoint: {
|
|
@@ -547,7 +548,7 @@ type Rect = {
|
|
|
547
548
|
x: number;
|
|
548
549
|
y: number;
|
|
549
550
|
};
|
|
550
|
-
declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T>, Rect];
|
|
551
|
+
declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T | null>, Rect];
|
|
551
552
|
|
|
552
553
|
type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
|
|
553
554
|
type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
|
|
@@ -555,7 +556,7 @@ declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListener
|
|
|
555
556
|
|
|
556
557
|
type UseFocusTrapOptions = {
|
|
557
558
|
disableAriaHider?: boolean;
|
|
558
|
-
focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
|
|
559
|
+
focusSelector?: HTMLElement | RefObject<HTMLElement | null> | string | null | undefined;
|
|
559
560
|
};
|
|
560
561
|
declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
|
|
561
562
|
|
|
@@ -1786,7 +1787,7 @@ type FormProps = {
|
|
|
1786
1787
|
/**
|
|
1787
1788
|
* Ref to access the form's state and API
|
|
1788
1789
|
*/
|
|
1789
|
-
innerRef?:
|
|
1790
|
+
innerRef?: Ref<FormState>;
|
|
1790
1791
|
/**
|
|
1791
1792
|
* On-submit callback
|
|
1792
1793
|
*/
|
|
@@ -1868,6 +1869,35 @@ type CustomComponentClass = {
|
|
|
1868
1869
|
};
|
|
1869
1870
|
};
|
|
1870
1871
|
|
|
1872
|
+
type NodeElementObject = {
|
|
1873
|
+
attributes?: Record<string, string>;
|
|
1874
|
+
children?: NodeLeafObject[];
|
|
1875
|
+
type?: string;
|
|
1876
|
+
url?: string;
|
|
1877
|
+
};
|
|
1878
|
+
type NodeObject = NodeElementObject | NodeLeafObject;
|
|
1879
|
+
type NodeLeafObject = {
|
|
1880
|
+
attributes?: Record<string, string>;
|
|
1881
|
+
bold?: boolean;
|
|
1882
|
+
code?: boolean;
|
|
1883
|
+
italic?: boolean;
|
|
1884
|
+
parent?: NodeObject;
|
|
1885
|
+
children?: NodeLeafObject[];
|
|
1886
|
+
strikethrough?: boolean;
|
|
1887
|
+
text?: string;
|
|
1888
|
+
type?: string;
|
|
1889
|
+
url?: string;
|
|
1890
|
+
underline?: boolean;
|
|
1891
|
+
};
|
|
1892
|
+
type CustomEditor = BaseEditor & HistoryEditor & ReactEditor;
|
|
1893
|
+
declare module 'slate' {
|
|
1894
|
+
interface CustomTypes {
|
|
1895
|
+
Editor: CustomEditor;
|
|
1896
|
+
Element: NodeElementObject;
|
|
1897
|
+
Text: NodeLeafObject;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1871
1901
|
declare const rteFormatTypes: Readonly<{
|
|
1872
1902
|
BOLD: "BOLD";
|
|
1873
1903
|
ITALIC: "ITALIC";
|
|
@@ -1886,7 +1916,7 @@ type FormFieldProps = Omit<ComponentPropsWithRef<'input'>, 'placeholder'> & {
|
|
|
1886
1916
|
/**
|
|
1887
1917
|
* A custom component that acts as a field and that needs access to Formik fields
|
|
1888
1918
|
*/
|
|
1889
|
-
customComponent?:
|
|
1919
|
+
customComponent?: ComponentClass<CustomComponentClass> | ((arg?: ComponentProps<typeof Field>) => ReactNode) | ((arg?: Record<string, unknown>) => ReactNode) | undefined;
|
|
1890
1920
|
/**
|
|
1891
1921
|
* Should the radio buttons be displayed vertically as a column or horizontally as a row
|
|
1892
1922
|
*/
|
|
@@ -2532,7 +2562,7 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2532
2562
|
/**
|
|
2533
2563
|
* Ref to the element that should receive focus when the modal opens
|
|
2534
2564
|
*/
|
|
2535
|
-
initialFocusRef?: RefObject<HTMLElement>;
|
|
2565
|
+
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
2536
2566
|
/**
|
|
2537
2567
|
* Whether or not the modal is open, and should be rendered
|
|
2538
2568
|
*/
|
|
@@ -2837,34 +2867,6 @@ declare const RangeSelector: {
|
|
|
2837
2867
|
displayName: string;
|
|
2838
2868
|
};
|
|
2839
2869
|
|
|
2840
|
-
type NodeElementObject = {
|
|
2841
|
-
attributes?: Record<string, string>;
|
|
2842
|
-
children?: NodeLeafObject[];
|
|
2843
|
-
type?: string;
|
|
2844
|
-
url?: string;
|
|
2845
|
-
};
|
|
2846
|
-
type NodeObject = NodeElementObject | NodeLeafObject;
|
|
2847
|
-
type NodeLeafObject = {
|
|
2848
|
-
attributes?: Record<string, string>;
|
|
2849
|
-
bold?: boolean;
|
|
2850
|
-
code?: boolean;
|
|
2851
|
-
italic?: boolean;
|
|
2852
|
-
parent?: NodeObject;
|
|
2853
|
-
children?: NodeLeafObject[];
|
|
2854
|
-
strikethrough?: boolean;
|
|
2855
|
-
text?: string;
|
|
2856
|
-
type?: string;
|
|
2857
|
-
url?: string;
|
|
2858
|
-
underline?: boolean;
|
|
2859
|
-
};
|
|
2860
|
-
declare module 'slate' {
|
|
2861
|
-
interface CustomTypes {
|
|
2862
|
-
Editor: ReactEditor;
|
|
2863
|
-
Element: NodeElementObject;
|
|
2864
|
-
Text: NodeLeafObject;
|
|
2865
|
-
}
|
|
2866
|
-
}
|
|
2867
|
-
|
|
2868
2870
|
type RichTextEditorProps = {
|
|
2869
2871
|
/**
|
|
2870
2872
|
* Optional id to set aria-labelledby
|
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,15 @@ import * as styled_components from 'styled-components';
|
|
|
2
2
|
import { css, DefaultTheme } from 'styled-components';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import { JSX, ReactNode, ComponentPropsWithoutRef, Dispatch, SetStateAction, RefObject, MutableRefObject, MouseEvent, ComponentPropsWithRef, ChangeEvent, ElementType, FocusEvent, HTMLInputTypeAttribute, KeyboardEvent as KeyboardEvent$1, ReactElement, ComponentType, PropsWithChildren } from 'react';
|
|
5
|
+
import { JSX, ReactNode, ComponentPropsWithoutRef, Dispatch, SetStateAction, RefObject, MutableRefObject, MouseEvent, ComponentPropsWithRef, ChangeEvent, ElementType, Ref, ComponentClass, ComponentProps, FocusEvent, HTMLInputTypeAttribute, KeyboardEvent as KeyboardEvent$1, ReactElement, ComponentType, PropsWithChildren } from 'react';
|
|
6
6
|
import { FormikProps, FormikHelpers, FormikErrors, Field } from 'formik';
|
|
7
7
|
export { useFormikContext } from 'formik';
|
|
8
|
+
import { BaseEditor, Descendant } from 'slate';
|
|
9
|
+
import { ReactEditor } from 'slate-react';
|
|
10
|
+
import { HistoryEditor } from 'slate-history';
|
|
8
11
|
import { DropdownMenuProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuCheckboxItemProps, DropdownMenuRadioItemProps } from '@radix-ui/react-dropdown-menu';
|
|
9
12
|
export { DropdownMenuRadioGroup as MenuRadioGroup } from '@radix-ui/react-dropdown-menu';
|
|
10
13
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
11
|
-
import { Descendant } from 'slate';
|
|
12
|
-
import { ReactEditor } from 'slate-react';
|
|
13
14
|
|
|
14
15
|
interface VHSTheme {
|
|
15
16
|
readonly breakpoint: {
|
|
@@ -547,7 +548,7 @@ type Rect = {
|
|
|
547
548
|
x: number;
|
|
548
549
|
y: number;
|
|
549
550
|
};
|
|
550
|
-
declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T>, Rect];
|
|
551
|
+
declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T | null>, Rect];
|
|
551
552
|
|
|
552
553
|
type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
|
|
553
554
|
type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
|
|
@@ -555,7 +556,7 @@ declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListener
|
|
|
555
556
|
|
|
556
557
|
type UseFocusTrapOptions = {
|
|
557
558
|
disableAriaHider?: boolean;
|
|
558
|
-
focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
|
|
559
|
+
focusSelector?: HTMLElement | RefObject<HTMLElement | null> | string | null | undefined;
|
|
559
560
|
};
|
|
560
561
|
declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
|
|
561
562
|
|
|
@@ -1786,7 +1787,7 @@ type FormProps = {
|
|
|
1786
1787
|
/**
|
|
1787
1788
|
* Ref to access the form's state and API
|
|
1788
1789
|
*/
|
|
1789
|
-
innerRef?:
|
|
1790
|
+
innerRef?: Ref<FormState>;
|
|
1790
1791
|
/**
|
|
1791
1792
|
* On-submit callback
|
|
1792
1793
|
*/
|
|
@@ -1868,6 +1869,35 @@ type CustomComponentClass = {
|
|
|
1868
1869
|
};
|
|
1869
1870
|
};
|
|
1870
1871
|
|
|
1872
|
+
type NodeElementObject = {
|
|
1873
|
+
attributes?: Record<string, string>;
|
|
1874
|
+
children?: NodeLeafObject[];
|
|
1875
|
+
type?: string;
|
|
1876
|
+
url?: string;
|
|
1877
|
+
};
|
|
1878
|
+
type NodeObject = NodeElementObject | NodeLeafObject;
|
|
1879
|
+
type NodeLeafObject = {
|
|
1880
|
+
attributes?: Record<string, string>;
|
|
1881
|
+
bold?: boolean;
|
|
1882
|
+
code?: boolean;
|
|
1883
|
+
italic?: boolean;
|
|
1884
|
+
parent?: NodeObject;
|
|
1885
|
+
children?: NodeLeafObject[];
|
|
1886
|
+
strikethrough?: boolean;
|
|
1887
|
+
text?: string;
|
|
1888
|
+
type?: string;
|
|
1889
|
+
url?: string;
|
|
1890
|
+
underline?: boolean;
|
|
1891
|
+
};
|
|
1892
|
+
type CustomEditor = BaseEditor & HistoryEditor & ReactEditor;
|
|
1893
|
+
declare module 'slate' {
|
|
1894
|
+
interface CustomTypes {
|
|
1895
|
+
Editor: CustomEditor;
|
|
1896
|
+
Element: NodeElementObject;
|
|
1897
|
+
Text: NodeLeafObject;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1871
1901
|
declare const rteFormatTypes: Readonly<{
|
|
1872
1902
|
BOLD: "BOLD";
|
|
1873
1903
|
ITALIC: "ITALIC";
|
|
@@ -1886,7 +1916,7 @@ type FormFieldProps = Omit<ComponentPropsWithRef<'input'>, 'placeholder'> & {
|
|
|
1886
1916
|
/**
|
|
1887
1917
|
* A custom component that acts as a field and that needs access to Formik fields
|
|
1888
1918
|
*/
|
|
1889
|
-
customComponent?:
|
|
1919
|
+
customComponent?: ComponentClass<CustomComponentClass> | ((arg?: ComponentProps<typeof Field>) => ReactNode) | ((arg?: Record<string, unknown>) => ReactNode) | undefined;
|
|
1890
1920
|
/**
|
|
1891
1921
|
* Should the radio buttons be displayed vertically as a column or horizontally as a row
|
|
1892
1922
|
*/
|
|
@@ -2532,7 +2562,7 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2532
2562
|
/**
|
|
2533
2563
|
* Ref to the element that should receive focus when the modal opens
|
|
2534
2564
|
*/
|
|
2535
|
-
initialFocusRef?: RefObject<HTMLElement>;
|
|
2565
|
+
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
2536
2566
|
/**
|
|
2537
2567
|
* Whether or not the modal is open, and should be rendered
|
|
2538
2568
|
*/
|
|
@@ -2837,34 +2867,6 @@ declare const RangeSelector: {
|
|
|
2837
2867
|
displayName: string;
|
|
2838
2868
|
};
|
|
2839
2869
|
|
|
2840
|
-
type NodeElementObject = {
|
|
2841
|
-
attributes?: Record<string, string>;
|
|
2842
|
-
children?: NodeLeafObject[];
|
|
2843
|
-
type?: string;
|
|
2844
|
-
url?: string;
|
|
2845
|
-
};
|
|
2846
|
-
type NodeObject = NodeElementObject | NodeLeafObject;
|
|
2847
|
-
type NodeLeafObject = {
|
|
2848
|
-
attributes?: Record<string, string>;
|
|
2849
|
-
bold?: boolean;
|
|
2850
|
-
code?: boolean;
|
|
2851
|
-
italic?: boolean;
|
|
2852
|
-
parent?: NodeObject;
|
|
2853
|
-
children?: NodeLeafObject[];
|
|
2854
|
-
strikethrough?: boolean;
|
|
2855
|
-
text?: string;
|
|
2856
|
-
type?: string;
|
|
2857
|
-
url?: string;
|
|
2858
|
-
underline?: boolean;
|
|
2859
|
-
};
|
|
2860
|
-
declare module 'slate' {
|
|
2861
|
-
interface CustomTypes {
|
|
2862
|
-
Editor: ReactEditor;
|
|
2863
|
-
Element: NodeElementObject;
|
|
2864
|
-
Text: NodeLeafObject;
|
|
2865
|
-
}
|
|
2866
|
-
}
|
|
2867
|
-
|
|
2868
2870
|
type RichTextEditorProps = {
|
|
2869
2871
|
/**
|
|
2870
2872
|
* Optional id to set aria-labelledby
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/vhs v4.0.0-beta.
|
|
3
|
+
* @license @wistia/vhs v4.0.0-beta.297d7ed5.4ab52c0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -3707,7 +3707,7 @@ var normalize = css3`
|
|
|
3707
3707
|
[type='button'],
|
|
3708
3708
|
[type='reset'],
|
|
3709
3709
|
[type='submit'] {
|
|
3710
|
-
appearance:
|
|
3710
|
+
appearance: auto;
|
|
3711
3711
|
}
|
|
3712
3712
|
|
|
3713
3713
|
/**
|
|
@@ -3817,7 +3817,7 @@ var normalize = css3`
|
|
|
3817
3817
|
*/
|
|
3818
3818
|
|
|
3819
3819
|
::-webkit-file-upload-button {
|
|
3820
|
-
appearance:
|
|
3820
|
+
appearance: auto; /* 1 */
|
|
3821
3821
|
font: inherit; /* 2 */
|
|
3822
3822
|
}
|
|
3823
3823
|
|
|
@@ -3937,7 +3937,7 @@ import { useCallback as useCallback5 } from "react";
|
|
|
3937
3937
|
import { useEffect as useEffect2, useRef as useRef2, useState as useState5 } from "react";
|
|
3938
3938
|
var useTimedToggle = (initialValue) => {
|
|
3939
3939
|
const [value, setValue] = useState5(false);
|
|
3940
|
-
const timeoutRef = useRef2();
|
|
3940
|
+
const timeoutRef = useRef2(void 0);
|
|
3941
3941
|
const initialValueRef = useRef2(initialValue);
|
|
3942
3942
|
const toggleValue = (timeout2) => {
|
|
3943
3943
|
clearTimeout(timeoutRef.current);
|
|
@@ -4010,8 +4010,8 @@ var isEventTargetSupported = (eventTarget) => (
|
|
|
4010
4010
|
Boolean(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
4011
4011
|
);
|
|
4012
4012
|
var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
|
|
4013
|
-
const savedEventHandler = useRef4();
|
|
4014
|
-
const savedEventOptions = useRef4();
|
|
4013
|
+
const savedEventHandler = useRef4(void 0);
|
|
4014
|
+
const savedEventOptions = useRef4(void 0);
|
|
4015
4015
|
useEffect3(() => {
|
|
4016
4016
|
savedEventHandler.current = eventHandler;
|
|
4017
4017
|
}, [eventHandler]);
|
|
@@ -4448,7 +4448,7 @@ var usePreventScroll = (locked) => {
|
|
|
4448
4448
|
// src/hooks/usePreviousValue/usePreviousValue.ts
|
|
4449
4449
|
import { useEffect as useEffect7, useRef as useRef7 } from "react";
|
|
4450
4450
|
var usePreviousValue = (value) => {
|
|
4451
|
-
const ref = useRef7();
|
|
4451
|
+
const ref = useRef7(void 0);
|
|
4452
4452
|
useEffect7(() => {
|
|
4453
4453
|
ref.current = value;
|
|
4454
4454
|
});
|
|
@@ -4545,7 +4545,7 @@ var ModalBaseContent = ({
|
|
|
4545
4545
|
const wasJustShown = usePreviousValue(isShown);
|
|
4546
4546
|
const hide = () => setIsShownAttempted(false);
|
|
4547
4547
|
const show = useCallback8(() => setIsShownAttempted(true), []);
|
|
4548
|
-
const toggleButtonRef = useRef8();
|
|
4548
|
+
const toggleButtonRef = useRef8(void 0);
|
|
4549
4549
|
const modalEl = document.createElement("div");
|
|
4550
4550
|
modalEl.classList.add("Modal");
|
|
4551
4551
|
if (isNotUndefined2(className)) {
|
|
@@ -4976,8 +4976,7 @@ import { isNotNil as isNotNil7 } from "@wistia/type-guards";
|
|
|
4976
4976
|
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
4977
4977
|
var screenReaderOnlyStyle = css7`
|
|
4978
4978
|
border: 0;
|
|
4979
|
-
clip:
|
|
4980
|
-
clip-path: inset(50%); /* modern but less support */
|
|
4979
|
+
clip-path: inset(50%);
|
|
4981
4980
|
height: 1px;
|
|
4982
4981
|
overflow: hidden;
|
|
4983
4982
|
padding: 0;
|
|
@@ -6623,7 +6622,9 @@ var disabledStyle3 = css13`
|
|
|
6623
6622
|
var errorHoverStyle = css13`
|
|
6624
6623
|
border-color: transparent;
|
|
6625
6624
|
`;
|
|
6626
|
-
var errorFocusedStyle = css13
|
|
6625
|
+
var errorFocusedStyle = css13`
|
|
6626
|
+
outline: none;
|
|
6627
|
+
`;
|
|
6627
6628
|
var errorStyle = css13`
|
|
6628
6629
|
background-color: ${({ theme: theme2 }) => theme2.color.error100};
|
|
6629
6630
|
border: 1px solid ${({ theme: theme2 }) => theme2.color.error500};
|
|
@@ -7555,7 +7556,7 @@ import { useEffect as useEffect13 } from "react";
|
|
|
7555
7556
|
import { useCallback as useCallback10, useEffect as useEffect12, useRef as useRef10 } from "react";
|
|
7556
7557
|
var useTimeoutFunc = (func, timeout2 = 0) => {
|
|
7557
7558
|
const readyRef = useRef10(false);
|
|
7558
|
-
const timeoutRef = useRef10();
|
|
7559
|
+
const timeoutRef = useRef10(void 0);
|
|
7559
7560
|
const callbackRef = useRef10(func);
|
|
7560
7561
|
const isReady = useCallback10(() => readyRef.current, []);
|
|
7561
7562
|
const set = useCallback10(() => {
|
|
@@ -7931,7 +7932,7 @@ FormConnectorCheckboxGroup.displayName = "FormConnectorCheckboxGroup";
|
|
|
7931
7932
|
import { isNotUndefined as isNotUndefined6 } from "@wistia/type-guards";
|
|
7932
7933
|
import { jsx as jsx158 } from "react/jsx-runtime";
|
|
7933
7934
|
var FormConnectorCustomField = ({
|
|
7934
|
-
customComponent:
|
|
7935
|
+
customComponent: Element8,
|
|
7935
7936
|
field,
|
|
7936
7937
|
form,
|
|
7937
7938
|
label = "",
|
|
@@ -7950,7 +7951,7 @@ var FormConnectorCustomField = ({
|
|
|
7950
7951
|
labelProps,
|
|
7951
7952
|
name,
|
|
7952
7953
|
children: /* @__PURE__ */ jsx158(
|
|
7953
|
-
|
|
7954
|
+
Element8,
|
|
7954
7955
|
{
|
|
7955
7956
|
field,
|
|
7956
7957
|
form,
|
|
@@ -8920,9 +8921,9 @@ import { isNotUndefined as isNotUndefined11 } from "@wistia/type-guards";
|
|
|
8920
8921
|
import { useCallback as useCallback12, useMemo as useMemo7, useEffect as useEffect18 } from "react";
|
|
8921
8922
|
import { styled as styled41 } from "styled-components";
|
|
8922
8923
|
import { Editable, withReact, Slate, ReactEditor } from "slate-react";
|
|
8923
|
-
import { createEditor, Transforms as Transforms5, Element as
|
|
8924
|
+
import { createEditor, Transforms as Transforms5, Element as Element7, Text as Text4 } from "slate";
|
|
8924
8925
|
import { withHistory } from "slate-history";
|
|
8925
|
-
import isHotkey from "is-hotkey";
|
|
8926
|
+
import { isHotkey } from "is-hotkey";
|
|
8926
8927
|
import { isNil as isNil14, isNotNil as isNotNil26, isNonEmptyString as isNonEmptyString11 } from "@wistia/type-guards";
|
|
8927
8928
|
import isEqual2 from "react-fast-compare";
|
|
8928
8929
|
|
|
@@ -9171,7 +9172,10 @@ var deserializeHTMLNode = (el) => {
|
|
|
9171
9172
|
return null;
|
|
9172
9173
|
}
|
|
9173
9174
|
const children = getNodeChildren(el, deserializeHTMLNode);
|
|
9174
|
-
const
|
|
9175
|
+
const filteredChildren = children.filter(
|
|
9176
|
+
(child) => child === null || typeof child === "string" || typeof child === "object" && ("text" in child || "type" in child)
|
|
9177
|
+
);
|
|
9178
|
+
const safeChildren = filteredChildren.length > 0 && filteredChildren[0] != null ? filteredChildren : [emptyTextNode];
|
|
9175
9179
|
if (el.nodeName === "BODY") {
|
|
9176
9180
|
return jsx168("fragment", {}, safeChildren);
|
|
9177
9181
|
}
|
|
@@ -9232,7 +9236,7 @@ import { useSelected, useFocused } from "slate-react";
|
|
|
9232
9236
|
import { styled as styled39, css as css21 } from "styled-components";
|
|
9233
9237
|
import { jsx as jsx170, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9234
9238
|
var Wrapper = styled39.span`
|
|
9235
|
-
display:
|
|
9239
|
+
display: inline-block;
|
|
9236
9240
|
user-select: none;
|
|
9237
9241
|
`;
|
|
9238
9242
|
var Image = styled39.img`
|
|
@@ -9358,10 +9362,10 @@ import { Transforms as Transforms2, Element as Element4, Text as Text3 } from "s
|
|
|
9358
9362
|
import { isNotUndefined as isNotUndefined10, isNotNil as isNotNil25 } from "@wistia/type-guards";
|
|
9359
9363
|
|
|
9360
9364
|
// src/components/RichTextEditor/utilities/toggle.ts
|
|
9361
|
-
import { Element as Element3,
|
|
9365
|
+
import { Element as Element3, Transforms, Editor as SlateEditor } from "slate";
|
|
9362
9366
|
import { isNotNil as isNotNil24, isNonEmptyString as isNonEmptyString8 } from "@wistia/type-guards";
|
|
9363
9367
|
var isBlockActive = (editor, format) => {
|
|
9364
|
-
const [match] =
|
|
9368
|
+
const [match] = SlateEditor.nodes(editor, {
|
|
9365
9369
|
match: (node) => Element3.isElement(node) && node.type === format
|
|
9366
9370
|
});
|
|
9367
9371
|
return Boolean(match);
|
|
@@ -9384,15 +9388,15 @@ var toggleBlck = (editor, format) => {
|
|
|
9384
9388
|
}
|
|
9385
9389
|
};
|
|
9386
9390
|
var isMarkActive = (editor, format) => {
|
|
9387
|
-
const valueMarks =
|
|
9391
|
+
const valueMarks = SlateEditor.marks(editor);
|
|
9388
9392
|
return isNonEmptyString8(valueMarks && Object.keys(valueMarks).find((mark) => mark === format));
|
|
9389
9393
|
};
|
|
9390
9394
|
var toggleMark = (editor, format) => {
|
|
9391
9395
|
const isActive = isMarkActive(editor, format);
|
|
9392
9396
|
if (isActive) {
|
|
9393
|
-
|
|
9397
|
+
SlateEditor.removeMark(editor, format);
|
|
9394
9398
|
} else {
|
|
9395
|
-
|
|
9399
|
+
SlateEditor.addMark(editor, format, true);
|
|
9396
9400
|
}
|
|
9397
9401
|
};
|
|
9398
9402
|
|
|
@@ -9449,14 +9453,14 @@ var withImages = (editor) => {
|
|
|
9449
9453
|
};
|
|
9450
9454
|
|
|
9451
9455
|
// src/components/RichTextEditor/utilities/withLinksPlugin.ts
|
|
9452
|
-
import { Transforms as Transforms3, Element as Element5, Node, Editor
|
|
9456
|
+
import { Transforms as Transforms3, Element as Element5, Node, Editor, Range, Path } from "slate";
|
|
9453
9457
|
import { isNonEmptyString as isNonEmptyString9 } from "@wistia/type-guards";
|
|
9454
9458
|
var isHashUrl = (urlString) => {
|
|
9455
9459
|
const urlPattern = /^#.+$/i;
|
|
9456
9460
|
return Boolean(urlPattern.test(urlString));
|
|
9457
9461
|
};
|
|
9458
9462
|
var isLinkActive = (editor) => {
|
|
9459
|
-
const [link] =
|
|
9463
|
+
const [link] = Editor.nodes(editor, {
|
|
9460
9464
|
match: (node) => Element5.isElement(node) && node.type === "link"
|
|
9461
9465
|
});
|
|
9462
9466
|
return Boolean(link);
|
|
@@ -9485,7 +9489,8 @@ var wrapLink = (editor, url) => {
|
|
|
9485
9489
|
}
|
|
9486
9490
|
};
|
|
9487
9491
|
var withLinks = (editor) => {
|
|
9488
|
-
const {
|
|
9492
|
+
const { insertText, isInline, normalizeNode } = editor;
|
|
9493
|
+
const { insertData } = editor;
|
|
9489
9494
|
editor.isInline = (element) => element.type === "link" ? true : isInline(element);
|
|
9490
9495
|
editor.insertText = (text) => {
|
|
9491
9496
|
if (text && isUrl(text)) {
|
|
@@ -9540,10 +9545,10 @@ var insertLink = (editor) => {
|
|
|
9540
9545
|
};
|
|
9541
9546
|
|
|
9542
9547
|
// src/components/RichTextEditor/utilities/handleListEscape.ts
|
|
9543
|
-
import { Transforms as Transforms4, Range as Range2, Editor as
|
|
9548
|
+
import { Transforms as Transforms4, Range as Range2, Editor as Editor2, Element as Element6 } from "slate";
|
|
9544
9549
|
var OverriddenEditor = {
|
|
9545
|
-
...
|
|
9546
|
-
isBlck:
|
|
9550
|
+
...Editor2,
|
|
9551
|
+
isBlck: Editor2.isBlock
|
|
9547
9552
|
};
|
|
9548
9553
|
var newLine = {
|
|
9549
9554
|
type: "paragraph",
|
|
@@ -9567,7 +9572,7 @@ var handleListEscape = (editor) => {
|
|
|
9567
9572
|
const selectedElement = editor.children[selection.anchor.path[0]];
|
|
9568
9573
|
const isList = selectedElement.type === "bulleted-list" || selectedElement.type === "numbered-list";
|
|
9569
9574
|
const blockAbove = OverriddenEditor.above(editor, {
|
|
9570
|
-
match: (node) => OverriddenEditor.isBlck(editor, node)
|
|
9575
|
+
match: (node) => Element6.isElement(node) && OverriddenEditor.isBlck(editor, node)
|
|
9571
9576
|
});
|
|
9572
9577
|
if ((textIsNotSelected ?? false) && isList && isLastChildBlankText(blockAbove[0].children)) {
|
|
9573
9578
|
Transforms4.removeNodes(editor, { hanging: true });
|
|
@@ -10055,17 +10060,19 @@ var RichTextEditor = ({
|
|
|
10055
10060
|
return;
|
|
10056
10061
|
}
|
|
10057
10062
|
const selectedElement = editor.children[selection.anchor.path[0]];
|
|
10058
|
-
if (
|
|
10063
|
+
if (Element7.isElement(selectedElement) && selectedElement.type === "image") {
|
|
10059
10064
|
toggleBlck(editor, "image");
|
|
10060
10065
|
Transforms5.removeNodes(editor, { at: selection });
|
|
10061
10066
|
Transforms5.move(editor, { reverse: true });
|
|
10062
|
-
const spanElement = editor.children.filter(
|
|
10063
|
-
|
|
10067
|
+
const spanElement = editor.children.filter(
|
|
10068
|
+
(child) => Element7.isElement(child) && child.type === "span"
|
|
10069
|
+
)[0];
|
|
10070
|
+
if (Element7.isElement(spanElement) && spanElement.type === "span" && isNotNil26(spanElement.children) && isNotNil26(spanElement.children[0]) && isNotNil26(spanElement.children[0].text) && spanElement.children[0].text.trim() !== "") {
|
|
10064
10071
|
Transforms5.setNodes(
|
|
10065
10072
|
editor,
|
|
10066
10073
|
{ type: "paragraph" },
|
|
10067
10074
|
{
|
|
10068
|
-
match: (node) => node.type === "span" && isNotNil26(node.children) && Text4.isText(node.children[0]) && isNotNil26(node.children[0].text) && node.children[0].text.trim() !== "",
|
|
10075
|
+
match: (node) => Element7.isElement(node) && node.type === "span" && isNotNil26(node.children) && Text4.isText(node.children[0]) && isNotNil26(node.children[0].text) && node.children[0].text.trim() !== "",
|
|
10069
10076
|
split: true,
|
|
10070
10077
|
mode: "highest"
|
|
10071
10078
|
}
|
|
@@ -10081,7 +10088,9 @@ var RichTextEditor = ({
|
|
|
10081
10088
|
"data-testid": dataTestId,
|
|
10082
10089
|
disabled,
|
|
10083
10090
|
height,
|
|
10084
|
-
onClick: () =>
|
|
10091
|
+
onClick: () => {
|
|
10092
|
+
ReactEditor.focus(editor);
|
|
10093
|
+
},
|
|
10085
10094
|
children: /* @__PURE__ */ jsxs30(
|
|
10086
10095
|
Slate,
|
|
10087
10096
|
{
|
|
@@ -11307,7 +11316,7 @@ var Menu2 = forwardRef16(
|
|
|
11307
11316
|
onClose,
|
|
11308
11317
|
...otherProps
|
|
11309
11318
|
}, ref) => {
|
|
11310
|
-
const menuRef = useRef12();
|
|
11319
|
+
const menuRef = useRef12(void 0);
|
|
11311
11320
|
const onClickOutsideFn = isNotNil32(onClickOutside) ? onClickOutside : () => {
|
|
11312
11321
|
};
|
|
11313
11322
|
useOnClickOutside(menuRef, onClickOutsideFn);
|
|
@@ -12633,7 +12642,7 @@ var setCursorPosition = (ref, start, end) => {
|
|
|
12633
12642
|
var getSelectionFromMove = (selection, move, positions) => {
|
|
12634
12643
|
const currentIndex = positions.findIndex((pos) => pos.start === selection[0]);
|
|
12635
12644
|
let nextPosition = positions[currentIndex + move];
|
|
12636
|
-
if (nextPosition
|
|
12645
|
+
if (nextPosition?.type === "skip") {
|
|
12637
12646
|
nextPosition = positions[currentIndex + move * 2];
|
|
12638
12647
|
}
|
|
12639
12648
|
if (nextPosition) {
|
|
@@ -13728,7 +13737,7 @@ var ThumbnailCollageContainer = styled71.div`
|
|
|
13728
13737
|
grid-template-columns: 3fr 2fr;
|
|
13729
13738
|
grid-template-rows: 1fr 1fr;
|
|
13730
13739
|
width: 100%;
|
|
13731
|
-
|
|
13740
|
+
gap: ${({ theme: theme2 }) => theme2.spacing.space01};
|
|
13732
13741
|
height: 100%;
|
|
13733
13742
|
`;
|
|
13734
13743
|
var CollageImage2 = styled71.div`
|