@weing-dev/ui-kit-primitive 0.1.2 → 0.3.0
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/README.md +9 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -3
- package/dist/components/Avatar/Avatar.d.ts +2 -2
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +5 -5
- package/dist/components/Button/Button.d.ts +4 -4
- package/dist/components/Button/button.augment.d.ts +17 -0
- package/dist/components/Calendar/Calendar.d.ts +6 -6
- package/dist/components/Cascader/Cascader.d.ts +4 -4
- package/dist/components/Chips/Chips.d.ts +2 -2
- package/dist/components/Comment/Comment.d.ts +2 -2
- package/dist/components/Editor/Editor.context.d.ts +2 -0
- package/dist/components/Editor/Editor.d.ts +17 -1
- package/dist/components/Editor/constants/editor.constants.d.ts +73 -24
- package/dist/components/Form/CheckBox/CheckBox.d.ts +4 -4
- package/dist/components/Form/Dropdown/Dropdown.d.ts +4 -4
- package/dist/components/Form/OTPInput/OTPInput.d.ts +2 -2
- package/dist/components/Form/Radio/Radio.d.ts +4 -4
- package/dist/components/Form/Switch/Switch.d.ts +3 -3
- package/dist/components/Form/TextArea/TextArea.d.ts +6 -6
- package/dist/components/Form/TextInput/TextInput.d.ts +5 -5
- package/dist/components/GlobalStyle/GlobalStyle.d.ts +2 -0
- package/dist/components/HelperText/HelperText.d.ts +3 -2
- package/dist/components/Icon/Icon.constant.d.ts +6 -0
- package/dist/components/Icon/Icon.d.ts +12 -9
- package/dist/components/Icon/context/icon.context.d.ts +5 -0
- package/dist/components/Icon/context/icon.provider.d.ts +8 -0
- package/dist/components/Icon/context/icon.store.d.ts +16 -0
- package/dist/components/Icon/context/index.d.ts +3 -0
- package/dist/components/Icon/icon.augment.d.ts +17 -0
- package/dist/components/Icons/BackButton.d.ts +3 -0
- package/dist/components/Icons/FullScreen.d.ts +3 -0
- package/dist/components/Icons/FullScreenClose.d.ts +3 -0
- package/dist/components/Icons/Pause.d.ts +3 -0
- package/dist/components/Icons/PictureQuality.d.ts +3 -0
- package/dist/components/Icons/Pip.d.ts +3 -0
- package/dist/components/Icons/PipExit.d.ts +3 -0
- package/dist/components/Icons/Play.d.ts +3 -0
- package/dist/components/Icons/PlaybackSpeed.d.ts +3 -0
- package/dist/components/Icons/Share.d.ts +3 -0
- package/dist/components/Icons/SubtitleFilled.d.ts +3 -0
- package/dist/components/Icons/SubtitleOutlined.d.ts +3 -0
- package/dist/components/Icons/VolumeOff.d.ts +3 -0
- package/dist/components/Icons/VolumeUp.d.ts +3 -0
- package/dist/components/Icons/index.d.ts +14 -0
- package/dist/components/LNB/LNB.d.ts +4 -4
- package/dist/components/Label/Label.d.ts +2 -2
- package/dist/components/List/List.d.ts +3 -3
- package/dist/components/Pagination/Pagination.d.ts +5 -5
- package/dist/components/Tab/Tab.d.ts +5 -5
- package/dist/components/Table/Table.d.ts +6 -6
- package/dist/components/TimeInput/TimeInput.d.ts +8 -8
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +125 -0
- package/dist/components/VideoPlayer/VideoPlayer.utils.d.ts +45 -0
- package/dist/components/VideoPlayer/components/Error/Error.d.ts +15 -0
- package/dist/components/VideoPlayer/components/Error/index.d.ts +1 -0
- package/dist/components/VideoPlayer/components/Frame/Frame.d.ts +6 -0
- package/dist/components/VideoPlayer/components/Frame/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/Loading/Loading.d.ts +11 -0
- package/dist/components/VideoPlayer/components/Loading/index.d.ts +1 -0
- package/dist/components/VideoPlayer/components/Player/Player.d.ts +6 -0
- package/dist/components/VideoPlayer/components/Player/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/Thumbnail/Thumbnail.d.ts +8 -0
- package/dist/components/VideoPlayer/components/Thumbnail/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/VideoOverlay/VideoOverlay.d.ts +35 -0
- package/dist/components/VideoPlayer/components/VideoOverlay/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/Widgets/Button/Button.d.ts +13 -0
- package/dist/components/VideoPlayer/components/Widgets/Button/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/Widgets/ProgressBar/ProgressBar.d.ts +18 -0
- package/dist/components/VideoPlayer/components/Widgets/ProgressBar/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/Widgets/SpeedControl/SpeedControl.d.ts +21 -0
- package/dist/components/VideoPlayer/components/Widgets/SpeedControl/index.d.ts +1 -0
- package/dist/components/VideoPlayer/components/Widgets/Time/Time.d.ts +15 -0
- package/dist/components/VideoPlayer/components/Widgets/Time/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/Widgets/VolumeControl/VolumeControl.d.ts +34 -0
- package/dist/components/VideoPlayer/components/Widgets/VolumeControl/index.d.ts +2 -0
- package/dist/components/VideoPlayer/components/Widgets/index.d.ts +29 -0
- package/dist/components/VideoPlayer/components/index.d.ts +10 -0
- package/dist/components/VideoPlayer/context/index.d.ts +4 -0
- package/dist/components/VideoPlayer/context/videoPlayer.context.d.ts +15 -0
- package/dist/components/VideoPlayer/context/videoPlayer.provider.d.ts +3 -0
- package/dist/components/VideoPlayer/context/videoPlayer.store.d.ts +27 -0
- package/dist/components/VideoPlayer/context/videoPlayer.types.d.ts +351 -0
- package/dist/components/VideoPlayer/index.d.ts +18 -0
- package/dist/components/VideoPlayer/videoPlayer.constants.d.ts +55 -0
- package/dist/entry/augmentations.d.ts +4 -0
- package/dist/entry/components.d.ts +90 -0
- package/dist/entry/types.d.ts +36 -0
- package/dist/{index-BL3MWQXq.js → index-CsNmTnCb.js} +29 -38
- package/dist/index.css +2 -2
- package/dist/index.d.ts +3 -47
- package/dist/index.js +14884 -12979
- package/dist/index.umd.cjs +51 -15
- package/dist/static/icon/PictureQuality.svg +5 -0
- package/dist/static/icon/back_button.svg +8 -0
- package/dist/static/icon/full_screen.svg +3 -0
- package/dist/static/icon/full_screen_close.svg +1 -0
- package/dist/static/icon/pause.svg +1 -0
- package/dist/static/icon/pip.svg +8 -0
- package/dist/static/icon/pip_exit.svg +8 -0
- package/dist/static/icon/play.svg +3 -0
- package/dist/static/icon/playback_speed.svg +5 -0
- package/dist/static/icon/share.svg +1 -0
- package/dist/static/icon/subtitle_filled.svg +1 -0
- package/dist/static/icon/subtitle_outlined.svg +1 -0
- package/dist/static/icon/volume_off.svg +1 -0
- package/dist/static/icon/volume_up.svg +1 -0
- package/package.json +20 -19
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import * as DefaultIcons from "../../Icons";
|
|
3
|
+
export type IconComponent = (props: React.SVGProps<SVGSVGElement>) => JSX.Element | React.ReactNode;
|
|
4
|
+
export type IconRegistry = Partial<Record<string, IconComponent>>;
|
|
5
|
+
export type DefaultIconName = keyof typeof DefaultIcons;
|
|
6
|
+
export type IconStoreState = {
|
|
7
|
+
icons: IconRegistry;
|
|
8
|
+
};
|
|
9
|
+
export type IconStoreActions = {
|
|
10
|
+
registerIcons: (icons: IconRegistry) => void;
|
|
11
|
+
};
|
|
12
|
+
export type IconStore = IconStoreState & IconStoreActions;
|
|
13
|
+
export type IconStoreConfig = {
|
|
14
|
+
icons?: IconRegistry;
|
|
15
|
+
};
|
|
16
|
+
export declare const createIconStore: (config?: IconStoreConfig) => import('zustand').UseBoundStore<import('zustand').StoreApi<IconStore>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { IconStoreContext, useIconStore, type IconStoreApi, } from './icon.context';
|
|
2
|
+
export { default as IconProvider, type IconProviderProps } from './icon.provider';
|
|
3
|
+
export { createIconStore, type IconStore, type IconStoreState, type IconStoreActions, type IconStoreConfig, type DefaultIconName, type IconComponent, type IconRegistry, } from './icon.store';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@weing-dev/ui-kit-primitive` 모듈 확장 포인트 (Icon name).
|
|
3
|
+
*
|
|
4
|
+
* 소비자 프로젝트에서 아래처럼 확장하면 `Icon`/`Button.Icon`의 `name` 자동완성에 반영됩니다.
|
|
5
|
+
*
|
|
6
|
+
* declare module "@weing-dev/ui-kit-primitive" {
|
|
7
|
+
* interface IconNameOverrides {
|
|
8
|
+
* Sigma: true;
|
|
9
|
+
* }
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
declare module "@weing-dev/ui-kit-primitive" {
|
|
13
|
+
interface IconNameOverrides {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export type __UiKitIconAugmentMarker = true;
|
|
17
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export { default as ArrowUp } from './ArrowUp';
|
|
|
8
8
|
export { default as ArrowDropDown } from './ArrowDropDown';
|
|
9
9
|
export { default as ArticleOutlined } from './ArticleOutlined';
|
|
10
10
|
export { default as AttachFile } from './AttachFile';
|
|
11
|
+
export { default as BackButton } from './BackButton';
|
|
11
12
|
export { default as CalendarMonth } from './CalendarMonth';
|
|
12
13
|
export { default as CalendarToday } from './CalendarToday';
|
|
13
14
|
export { default as CancleFilled } from './CancleFilled';
|
|
@@ -47,6 +48,8 @@ export { default as FileUpload } from './FileUpload';
|
|
|
47
48
|
export { default as FilecheckInactive } from './FilecheckInactive';
|
|
48
49
|
export { default as FileDownloadDoneFilled } from './FileDownloadDoneFilled';
|
|
49
50
|
export { default as FileDownloadOutlined } from './FileDownloadOutlined';
|
|
51
|
+
export { default as FullScreen } from './FullScreen';
|
|
52
|
+
export { default as FullScreenClose } from './FullScreenClose';
|
|
50
53
|
export { default as GoBefore } from './GoBefore';
|
|
51
54
|
export { default as GoNext } from './GoNext';
|
|
52
55
|
export { default as HamburgerMenu } from './HamburgerMenu';
|
|
@@ -74,6 +77,7 @@ export { default as OrderApprove } from './OrderApprove';
|
|
|
74
77
|
export { default as OrderInactive } from './OrderInactive';
|
|
75
78
|
export { default as OrderPlay } from './OrderPlay';
|
|
76
79
|
export { default as Outward } from './Outward';
|
|
80
|
+
export { default as Pause } from './Pause';
|
|
77
81
|
export { default as PayApprove } from './PayApprove';
|
|
78
82
|
export { default as PayInactive } from './PayInactive';
|
|
79
83
|
export { default as Payment } from './Payment';
|
|
@@ -81,6 +85,11 @@ export { default as PersonAddAlt } from './PersonAddAlt';
|
|
|
81
85
|
export { default as Personcard } from './Personcard';
|
|
82
86
|
export { default as PersonFilled } from './PersonFilled';
|
|
83
87
|
export { default as PersonOutline } from './PersonOutline';
|
|
88
|
+
export { default as PictureQuality } from './PictureQuality';
|
|
89
|
+
export { default as Pip } from './Pip';
|
|
90
|
+
export { default as PipExit } from './PipExit';
|
|
91
|
+
export { default as Play } from './Play';
|
|
92
|
+
export { default as PlaybackSpeed } from './PlaybackSpeed';
|
|
84
93
|
export { default as PrintInactive } from './PrintInactive';
|
|
85
94
|
export { default as PrintPlay } from './PrintPlay';
|
|
86
95
|
export { default as Product } from './Product';
|
|
@@ -89,13 +98,18 @@ export { default as Search } from './Search';
|
|
|
89
98
|
export { default as Search2 } from './Search2';
|
|
90
99
|
export { default as SettingFilled } from './SettingFilled';
|
|
91
100
|
export { default as Settings } from './Settings';
|
|
101
|
+
export { default as Share } from './Share';
|
|
92
102
|
export { default as ShippingDone } from './ShippingDone';
|
|
103
|
+
export { default as SubtitleFilled } from './SubtitleFilled';
|
|
104
|
+
export { default as SubtitleOutlined } from './SubtitleOutlined';
|
|
93
105
|
export { default as SupportAgent } from './SupportAgent';
|
|
94
106
|
export { default as SwapVert } from './SwapVert';
|
|
95
107
|
export { default as Task } from './Task';
|
|
96
108
|
export { default as TrashOutlined } from './TrashOutlined';
|
|
97
109
|
export { default as Upload } from './Upload';
|
|
98
110
|
export { default as User } from './User';
|
|
111
|
+
export { default as VolumeOff } from './VolumeOff';
|
|
112
|
+
export { default as VolumeUp } from './VolumeUp';
|
|
99
113
|
export { default as WarningFilled } from './WarningFilled';
|
|
100
114
|
export { default as Warning } from './Warning';
|
|
101
115
|
export { default as WarningAmber } from './WarningAmber';
|
|
@@ -5,7 +5,7 @@ type LNBLogoProps = React.PropsWithChildren<{
|
|
|
5
5
|
className?: string;
|
|
6
6
|
src: string;
|
|
7
7
|
}>;
|
|
8
|
-
declare const Logo:
|
|
8
|
+
declare const Logo: (props: LNBLogoProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
type LNBItemProps = React.PropsWithChildren<{
|
|
10
10
|
className?: string;
|
|
11
11
|
label: string;
|
|
@@ -18,12 +18,12 @@ type LNBItemProps = React.PropsWithChildren<{
|
|
|
18
18
|
isOpen?: boolean;
|
|
19
19
|
isActive?: boolean;
|
|
20
20
|
}>;
|
|
21
|
-
declare const Item:
|
|
21
|
+
declare const Item: (props: LNBItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
type LNBListProps = React.PropsWithChildren<{
|
|
23
23
|
className?: string;
|
|
24
24
|
}>;
|
|
25
|
-
declare const List:
|
|
26
|
-
declare const Root:
|
|
25
|
+
declare const List: (props: LNBListProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare const Root: (props: LNBProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
export type Navigation<T = never> = {
|
|
28
28
|
label: string;
|
|
29
29
|
subtitle?: string;
|
|
@@ -6,5 +6,5 @@ interface LabelRootProps {
|
|
|
6
6
|
size?: "medium" | "small" | "xSmall";
|
|
7
7
|
onClick?: () => void;
|
|
8
8
|
}
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const Label: (props: LabelRootProps & React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Label;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Icon } from '../Icon/Icon';
|
|
3
3
|
type TextProps = {
|
|
4
|
-
value
|
|
4
|
+
value?: string;
|
|
5
5
|
} & React.JSX.IntrinsicElements["div"];
|
|
6
6
|
type BaseListProps = {
|
|
7
7
|
label: TextProps;
|
|
@@ -17,6 +17,6 @@ type ListProps = ({
|
|
|
17
17
|
title?: TextProps;
|
|
18
18
|
icon?: never;
|
|
19
19
|
} & BaseListProps);
|
|
20
|
+
declare const List: (props: ListProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export type { ListProps };
|
|
21
|
-
|
|
22
|
-
export default _default;
|
|
22
|
+
export default List;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { PaginationContextType } from './Pagination.context';
|
|
3
|
-
declare const Next:
|
|
4
|
-
declare const Prev:
|
|
3
|
+
declare const Next: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const Prev: () => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
type PageItemProps = {
|
|
6
6
|
active: boolean;
|
|
7
7
|
onClick: (page: number) => void;
|
|
8
8
|
page: number;
|
|
9
9
|
};
|
|
10
|
-
declare const PageItem:
|
|
10
|
+
declare const PageItem: (props: PageItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
type PageListProps = {
|
|
12
12
|
itemAs?: ({ page, active, onClick, }: {
|
|
13
13
|
page: number;
|
|
@@ -15,9 +15,9 @@ type PageListProps = {
|
|
|
15
15
|
onClick: (page: number) => void;
|
|
16
16
|
}) => React.ReactNode;
|
|
17
17
|
};
|
|
18
|
-
declare const PageList:
|
|
18
|
+
declare const PageList: (props: PageListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
19
|
type RootProps = {} & Omit<PaginationContextType, "currentPage">;
|
|
20
|
-
declare const Root:
|
|
20
|
+
declare const Root: (props: React.PropsWithChildren<RootProps>) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
interface IPagination {
|
|
22
22
|
Root: typeof Root;
|
|
23
23
|
Next: typeof Next;
|
|
@@ -5,15 +5,15 @@ type PanelProps = React.PropsWithChildren<{
|
|
|
5
5
|
id?: string;
|
|
6
6
|
index: number;
|
|
7
7
|
}>;
|
|
8
|
-
declare const Panel:
|
|
8
|
+
declare const Panel: (props: PanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
type PanelsProps = React.PropsWithChildren<{
|
|
10
10
|
className?: string;
|
|
11
11
|
}>;
|
|
12
|
-
declare const Panels:
|
|
12
|
+
declare const Panels: (props: PanelsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
type TabListProps = React.PropsWithChildren<{
|
|
14
14
|
className?: string;
|
|
15
15
|
}>;
|
|
16
|
-
declare const List:
|
|
16
|
+
declare const List: (props: TabListProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
type TabProps = React.PropsWithChildren<{
|
|
18
18
|
className?: string;
|
|
19
19
|
id?: string;
|
|
@@ -21,8 +21,8 @@ type TabProps = React.PropsWithChildren<{
|
|
|
21
21
|
onClick?: (...args: any) => void;
|
|
22
22
|
isActive?: boolean;
|
|
23
23
|
}>;
|
|
24
|
-
declare const Item:
|
|
25
|
-
declare const Root:
|
|
24
|
+
declare const Item: (props: TabProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const Root: (props: TabsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
interface ITab {
|
|
27
27
|
Root: typeof Root;
|
|
28
28
|
List: typeof List;
|
|
@@ -2,22 +2,22 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { TableProviderProps } from './Table.context';
|
|
3
3
|
import { useRowResize } from './Table.hook';
|
|
4
4
|
type TableRowProps = React.PropsWithChildren<React.JSX.IntrinsicElements["tr"]>;
|
|
5
|
-
declare const Row:
|
|
5
|
+
declare const Row: (props: TableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
type TableCellProps = React.PropsWithChildren<{
|
|
7
7
|
size?: number;
|
|
8
8
|
isSelected?: boolean;
|
|
9
9
|
} & React.JSX.IntrinsicElements["td"]>;
|
|
10
|
-
declare const Cell:
|
|
10
|
+
declare const Cell: (props: TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
type TableBodyProps = React.PropsWithChildren<React.JSX.IntrinsicElements["tbody"]>;
|
|
12
|
-
declare const Body:
|
|
12
|
+
declare const Body: (props: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
type TableHeaderCellProps = React.PropsWithChildren<{
|
|
14
14
|
size?: number;
|
|
15
15
|
} & React.JSX.IntrinsicElements["th"]>;
|
|
16
|
-
declare const HeaderCell:
|
|
16
|
+
declare const HeaderCell: (props: TableHeaderCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
type TableHeaderProps = React.PropsWithChildren<React.JSX.IntrinsicElements["thead"]>;
|
|
18
|
-
declare const Header:
|
|
18
|
+
declare const Header: (props: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
type TableRootProps = TableProviderProps & React.JSX.IntrinsicElements["table"];
|
|
20
|
-
declare const Root:
|
|
20
|
+
declare const Root: (props: TableRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
interface ITable {
|
|
22
22
|
Root: typeof Root;
|
|
23
23
|
Header: typeof Header;
|
|
@@ -4,13 +4,13 @@ type InputProps = {
|
|
|
4
4
|
index: number;
|
|
5
5
|
placeholder: string;
|
|
6
6
|
} & React.JSX.IntrinsicElements["input"];
|
|
7
|
-
declare const Input:
|
|
7
|
+
declare const Input: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
type TimeRangeProps = React.PropsWithChildren<React.JSX.IntrinsicElements["div"]>;
|
|
9
|
-
declare const TimeRange:
|
|
9
|
+
declare const TimeRange: (props: TimeRangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
type ColonProps = React.JSX.IntrinsicElements["span"];
|
|
11
|
-
declare const Colon:
|
|
11
|
+
declare const Colon: (props: ColonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
type SeparatorProps = React.JSX.IntrinsicElements["span"];
|
|
13
|
-
declare const Separator:
|
|
13
|
+
declare const Separator: (props: SeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
type HelperTextProps = React.PropsWithChildren<{
|
|
15
15
|
className?: string;
|
|
16
16
|
warningColor?: string;
|
|
@@ -21,18 +21,18 @@ type HelperTextProps = React.PropsWithChildren<{
|
|
|
21
21
|
size?: number;
|
|
22
22
|
iconVisible?: boolean;
|
|
23
23
|
}>;
|
|
24
|
-
declare const HelperText:
|
|
24
|
+
declare const HelperText: (props: HelperTextProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
25
25
|
type InputWrapperProps = React.PropsWithChildren<React.JSX.IntrinsicElements["div"]>;
|
|
26
|
-
declare const InputWrapper:
|
|
26
|
+
declare const InputWrapper: (props: InputWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
type LabelProps = React.PropsWithChildren<{
|
|
28
28
|
className?: string;
|
|
29
29
|
focusedColor?: string;
|
|
30
30
|
}>;
|
|
31
|
-
declare const Label:
|
|
31
|
+
declare const Label: (props: LabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
type RootProps = React.PropsWithChildren<Omit<TimeInputContextType, "inputRefs" | "handleChange" | "handleBlur" | "handleKeyDown"> & {
|
|
33
33
|
className?: string;
|
|
34
34
|
}>;
|
|
35
|
-
declare const Root:
|
|
35
|
+
declare const Root: (props: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
36
|
interface ITimeInput {
|
|
37
37
|
Root: typeof Root;
|
|
38
38
|
Label: typeof Label;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VideoOverlay, Loading, Error, Frame, Player, Thumbnail, Widgets } from './components';
|
|
3
|
+
import { VideoPlayerStoreContext, VideoPlayerImageContext, DefaultImage, VideoPlayerProvider, useVideoPlayerStore, useVideoPlayerShallow, useVideoPlayerImage, createVideoPlayerStore, resolveVideoPlayerStoreConfig, VideoPlayerImageComponent, VideoPlayerProviderProps } from './context';
|
|
4
|
+
import { VIDEO_PLAYER_DEFAULTS } from './videoPlayer.constants';
|
|
5
|
+
import { convertSrtToVtt, isSrtSubtitleSource, parseWebVttToCues } from './VideoPlayer.utils';
|
|
6
|
+
/**
|
|
7
|
+
* `VideoPlayer.Root` props. `VideoPlayerProviderProps`와 같으나 `children`은 선택이고,
|
|
8
|
+
* 썸네일에 쓸 커스텀 이미지 컴포넌트를 `Image`로 넘길 수 있다.
|
|
9
|
+
*/
|
|
10
|
+
export type RootProps = Omit<VideoPlayerProviderProps, "children"> & {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/** 썸네일·포스터 렌더에 사용. 미지정 시 HTML `img` 기본 구현 */
|
|
13
|
+
Image?: VideoPlayerImageComponent;
|
|
14
|
+
};
|
|
15
|
+
declare const Root: {
|
|
16
|
+
(props: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* `VideoPlayer` 기본 export 객체의 타입.
|
|
21
|
+
* 컴파운드 컴포넌트, 훅, Context, 스토어 팩토리, 기본 상수, 자막 유틸을 한곳에서 접근한다.
|
|
22
|
+
*/
|
|
23
|
+
interface IVideoPlayer {
|
|
24
|
+
/**
|
|
25
|
+
* 플레이어 루트. 스토어(Provider)·레이아웃·자막·이벤트 등 초기 설정을 넘기고, 하위에 `Frame`·`Player`·`Overlay`를 조립한다.
|
|
26
|
+
* `children`만 비우면 UI가 렌더되지 않는다.
|
|
27
|
+
*/
|
|
28
|
+
Root: typeof Root;
|
|
29
|
+
/**
|
|
30
|
+
* 플레이어 영역 래퍼. Root의 `width`/`height`를 CSS 변수로 반영한다.
|
|
31
|
+
*/
|
|
32
|
+
Frame: typeof Frame;
|
|
33
|
+
/**
|
|
34
|
+
* `<video>`와 Video.js 인스턴스를 마운트한다. 소스·옵션·이벤트는 스토어(Root가 넣은 값)를 읽는다.
|
|
35
|
+
*/
|
|
36
|
+
Player: typeof Player;
|
|
37
|
+
/**
|
|
38
|
+
* 재생 전·`currentTime === 0`일 때만 보이는 포스터(썸네일) 레이어. Root의 `Image` 슬롯으로 그린다.
|
|
39
|
+
*/
|
|
40
|
+
Thumbnail: typeof Thumbnail;
|
|
41
|
+
/**
|
|
42
|
+
* 오버레이 루트. children은 렌더 프롭으로 `onMouseMove`·`showControls` 등을 받는다. `Overlay.Grid`와 9개 슬롯을 제공한다.
|
|
43
|
+
*/
|
|
44
|
+
Overlay: typeof VideoOverlay;
|
|
45
|
+
/**
|
|
46
|
+
* 로딩 오버레이. 스토어 `isLoading`이 true일 때만 표시된다.
|
|
47
|
+
*/
|
|
48
|
+
Loading: typeof Loading;
|
|
49
|
+
/**
|
|
50
|
+
* 에러 오버레이. 스토어 `hasError`가 true일 때만 표시된다.
|
|
51
|
+
*/
|
|
52
|
+
Error: typeof Error;
|
|
53
|
+
/**
|
|
54
|
+
* 컨트롤 위젯 묶음 (`Button`, `ProgressBar`, `VolumeControl`, `SpeedControl`, `Time`).
|
|
55
|
+
*/
|
|
56
|
+
Widgets: typeof Widgets;
|
|
57
|
+
/**
|
|
58
|
+
* Zustand 스토어에서 값을 구독한다. 반드시 Provider(`Root` 또는 `VideoPlayerProvider`) 하위에서 호출한다.
|
|
59
|
+
*/
|
|
60
|
+
useVideoPlayerStore: typeof useVideoPlayerStore;
|
|
61
|
+
/**
|
|
62
|
+
* 스토어에서 여러 필드를 얕게(shallow) 골라온다. 키 배열 또는 selector 함수를 넘길 수 있다.
|
|
63
|
+
*/
|
|
64
|
+
useVideoPlayerShallow: typeof useVideoPlayerShallow;
|
|
65
|
+
/**
|
|
66
|
+
* Root에 주입한 `Image` 컴포넌트 타입을 반환한다. `Thumbnail`이 이 구현으로 렌더된다.
|
|
67
|
+
*/
|
|
68
|
+
useVideoPlayerImage: typeof useVideoPlayerImage;
|
|
69
|
+
/**
|
|
70
|
+
* VideoPlayer Zustand 스토어용 React Context.
|
|
71
|
+
*/
|
|
72
|
+
VideoPlayerStoreContext: typeof VideoPlayerStoreContext;
|
|
73
|
+
/**
|
|
74
|
+
* 썸네일용 이미지 컴포넌트를 담는 Context.
|
|
75
|
+
*/
|
|
76
|
+
VideoPlayerImageContext: typeof VideoPlayerImageContext;
|
|
77
|
+
/**
|
|
78
|
+
* 스토어 Provider. `Root` 없이 커스텀 트리에 직접 감쌀 때 사용한다.
|
|
79
|
+
*/
|
|
80
|
+
VideoPlayerProvider: typeof VideoPlayerProvider;
|
|
81
|
+
/**
|
|
82
|
+
* Zustand 스토어 인스턴스를 생성한다. 고급 통합·테스트용.
|
|
83
|
+
*/
|
|
84
|
+
createVideoPlayerStore: typeof createVideoPlayerStore;
|
|
85
|
+
/**
|
|
86
|
+
* `storeConfig` 부분 객체를 패키지 기본값과 병합해 완전한 설정 객체로 만든다.
|
|
87
|
+
*/
|
|
88
|
+
resolveVideoPlayerStoreConfig: typeof resolveVideoPlayerStoreConfig;
|
|
89
|
+
/**
|
|
90
|
+
* 레이아웃·오버레이·볼륨·배속·문구·aria·아이콘 이름 등 패키지 기본 상수.
|
|
91
|
+
*/
|
|
92
|
+
VIDEO_PLAYER_DEFAULTS: typeof VIDEO_PLAYER_DEFAULTS;
|
|
93
|
+
/**
|
|
94
|
+
* 기본 썸네일 이미지 구현(HTML `<img>`). Root `Image` 미지정 시 사용된다.
|
|
95
|
+
*/
|
|
96
|
+
DefaultImage: typeof DefaultImage;
|
|
97
|
+
/**
|
|
98
|
+
* SRT 자막 텍스트를 WebVTT 텍스트로 변환한다.
|
|
99
|
+
*
|
|
100
|
+
* - 줄바꿈을 `\n`으로 정규화
|
|
101
|
+
* - 타임스탬프 구분자 `,`를 `.`으로 변환
|
|
102
|
+
* - 가능한 경우 cue id/설정 정보를 보존
|
|
103
|
+
*
|
|
104
|
+
* @param srt - 원본 SRT 문자열
|
|
105
|
+
* @returns `WEBVTT` 헤더가 포함된 VTT 문자열
|
|
106
|
+
*/
|
|
107
|
+
convertSrtToVtt: typeof convertSrtToVtt;
|
|
108
|
+
/**
|
|
109
|
+
* 자막 URL/경로가 SRT 파일인지 판별한다.
|
|
110
|
+
*
|
|
111
|
+
* @param src - 자막 리소스 경로 또는 URL
|
|
112
|
+
* @returns `.srt` 확장자면 `true`
|
|
113
|
+
*/
|
|
114
|
+
isSrtSubtitleSource: typeof isSrtSubtitleSource;
|
|
115
|
+
/**
|
|
116
|
+
* WebVTT 문자열을 파싱해 cue 배열로 반환한다 (간단한 파서; 복잡한 설정 라인은 무시).
|
|
117
|
+
*
|
|
118
|
+
* @param input - 전체 WebVTT 문자열
|
|
119
|
+
* @returns `{ start, end, text }[]` (초 단위 구간)
|
|
120
|
+
*/
|
|
121
|
+
parseWebVttToCues: typeof parseWebVttToCues;
|
|
122
|
+
}
|
|
123
|
+
export type { IVideoPlayer, RootProps as VideoPlayerRootProps };
|
|
124
|
+
declare const VideoPlayer: IVideoPlayer;
|
|
125
|
+
export default VideoPlayer;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { VideoJsPlayer, VideoPlayerState } from './context/videoPlayer.types';
|
|
2
|
+
/**
|
|
3
|
+
* Video.js HTML5 tech에서 루트 `<video>` 요소를 가져온다.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getHtmlVideoElementFromVideoJs: (player: VideoJsPlayer) => HTMLVideoElement | null;
|
|
6
|
+
/** WebVTT cue 한 개 (초 단위 구간) */
|
|
7
|
+
export type VttCue = {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* WebVTT 문자열을 파싱해 cue 배열로 반환한다 (간단한 파서; 복잡한 설정 라인은 무시).
|
|
14
|
+
*/
|
|
15
|
+
export declare const parseWebVttToCues: (input: string) => VttCue[];
|
|
16
|
+
/**
|
|
17
|
+
* SRT 자막 텍스트를 WebVTT 텍스트로 변환한다.
|
|
18
|
+
*
|
|
19
|
+
* - 줄바꿈을 `\n`으로 정규화
|
|
20
|
+
* - 타임스탬프 구분자 `,`를 `.`으로 변환
|
|
21
|
+
* - 가능한 경우 cue id/설정 정보를 보존
|
|
22
|
+
*
|
|
23
|
+
* @param srt - 원본 SRT 문자열
|
|
24
|
+
* @returns `WEBVTT` 헤더가 포함된 VTT 문자열
|
|
25
|
+
*/
|
|
26
|
+
export declare const convertSrtToVtt: (srt: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* 자막 URL/경로가 SRT 파일인지 판별한다.
|
|
29
|
+
*
|
|
30
|
+
* @param src - 자막 리소스 경로 또는 URL
|
|
31
|
+
* @returns `.srt` 확장자면 `true`
|
|
32
|
+
*/
|
|
33
|
+
export declare const isSrtSubtitleSource: (src: string) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* SRT 문자열을 VTT Blob URL로 변환해 브라우저 `track.src`에 바로 연결할 수 있게 만든다.
|
|
36
|
+
*
|
|
37
|
+
* @param srt - 원본 SRT 문자열
|
|
38
|
+
* @returns `URL.revokeObjectURL`로 해제가 필요한 Blob URL
|
|
39
|
+
*/
|
|
40
|
+
export declare const createVttBlobUrlFromSrt: (srt: string) => string;
|
|
41
|
+
/**
|
|
42
|
+
* 스토어에 반영되는 `src` / `sources` 업데이트가 실제 미디어 소스 전환인지 판별한다.
|
|
43
|
+
* (썸네일만 바뀐 경우는 false)
|
|
44
|
+
*/
|
|
45
|
+
export declare const isMediaSourceChange: (previous: Pick<VideoPlayerState, "src" | "sources">, updates: Partial<VideoPlayerState>) => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type ErrorAsProps = {
|
|
3
|
+
defaultClassName: string;
|
|
4
|
+
errorTitle: string;
|
|
5
|
+
errorDescription: string;
|
|
6
|
+
errorRetry: string;
|
|
7
|
+
onRetry: () => void;
|
|
8
|
+
};
|
|
9
|
+
type ErrorProps = {
|
|
10
|
+
className?: string;
|
|
11
|
+
onRetry?: () => void;
|
|
12
|
+
as?: (props: ErrorAsProps) => React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare const Error: (props: ErrorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export default Error;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Error';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type LoadingAsProps = {
|
|
3
|
+
defaultClassName: string;
|
|
4
|
+
loadingText: string;
|
|
5
|
+
};
|
|
6
|
+
type LoadingProps = {
|
|
7
|
+
className?: string;
|
|
8
|
+
as?: (props: LoadingAsProps) => React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare const Loading: (props: LoadingProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export default Loading;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Loading';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ThumbnailProps = {
|
|
3
|
+
src: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & React.JSX.IntrinsicElements["div"];
|
|
7
|
+
declare const Thumbnail: (props: ThumbnailProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default Thumbnail;
|