@soul-refiner/design-system 1.4.2 → 1.6.1-alpha.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/dist/components/actions/button/button.d.ts +1 -1
- package/dist/components/actions/dropdown/dropdown.stories.d.ts +5 -0
- package/dist/components/actions/rate/rate.js +4 -3
- package/dist/components/atoms/hide/hide.js +1 -1
- package/dist/components/card/feature/feature.js +1 -1
- package/dist/components/custom/courses_selection/courses_selection.js +5 -7
- package/dist/components/custom/courses_selection/courses_selection.stories.d.ts +5 -0
- package/dist/components/custom/users_selection/users_selection.stories.d.ts +5 -0
- package/dist/components/editor/constants.d.ts +9 -11
- package/dist/components/editor/constants.js +11 -7
- package/dist/components/editor/context.d.ts +1 -0
- package/dist/components/editor/context.js +1 -0
- package/dist/components/editor/editor.d.ts +3 -4
- package/dist/components/editor/editor.js +27 -5
- package/dist/components/editor/editor.stories.d.ts +6 -0
- package/dist/components/editor/icons/border-all.d.ts +3 -0
- package/dist/components/editor/icons/border-all.js +3 -0
- package/dist/components/editor/icons/border-bottom.d.ts +3 -0
- package/dist/components/editor/icons/border-bottom.js +3 -0
- package/dist/components/editor/icons/border-left.d.ts +3 -0
- package/dist/components/editor/icons/border-left.js +3 -0
- package/dist/components/editor/icons/border-none.d.ts +3 -0
- package/dist/components/editor/icons/border-none.js +3 -0
- package/dist/components/editor/icons/border-right.d.ts +3 -0
- package/dist/components/editor/icons/border-right.js +3 -0
- package/dist/components/editor/icons/border-top.d.ts +3 -0
- package/dist/components/editor/icons/border-top.js +3 -0
- package/dist/components/editor/icons/index.d.ts +6 -0
- package/dist/components/editor/icons/index.js +6 -0
- package/dist/components/editor/navbar/index.d.ts +0 -1
- package/dist/components/editor/navbar/navbar.d.ts +1 -4
- package/dist/components/editor/navbar/navbar.js +10 -14
- package/dist/components/editor/plugins/{blockquote.js → blocks/blockquote.js} +1 -1
- package/dist/components/editor/plugins/blocks/blocks.d.ts +1 -0
- package/dist/components/editor/plugins/blocks/blocks.js +50 -0
- package/dist/components/editor/plugins/{buttons.js → blocks/buttons.js} +2 -2
- package/dist/components/editor/plugins/blocks/dropdown-menu.d.ts +29 -0
- package/dist/components/editor/plugins/blocks/dropdown-menu.js +62 -0
- package/dist/components/editor/plugins/blocks/image.d.ts +9 -0
- package/dist/components/editor/plugins/blocks/image.js +36 -0
- package/dist/components/editor/plugins/blocks/index.d.ts +1 -0
- package/dist/components/editor/plugins/blocks/index.js +1 -0
- package/dist/components/editor/plugins/blocks/media-popover.d.ts +6 -0
- package/dist/components/editor/plugins/blocks/media-popover.js +32 -0
- package/dist/components/editor/plugins/blocks/plate-button.d.ts +14 -0
- package/dist/components/editor/plugins/blocks/plate-button.js +37 -0
- package/dist/components/editor/plugins/blocks/popover.d.ts +7 -0
- package/dist/components/editor/plugins/blocks/popover.js +11 -0
- package/dist/components/editor/plugins/{qa.js → blocks/qa.js} +8 -8
- package/dist/components/editor/plugins/blocks/resizable.d.ts +39 -0
- package/dist/components/editor/plugins/blocks/resizable.js +37 -0
- package/dist/components/editor/plugins/blocks/separator.d.ts +5 -0
- package/dist/components/editor/plugins/blocks/separator.js +19 -0
- package/dist/components/editor/plugins/blocks/table-cell.d.ts +23 -0
- package/dist/components/editor/plugins/blocks/table-cell.js +38 -0
- package/dist/components/editor/plugins/blocks/table-row.d.ts +11 -0
- package/dist/components/editor/plugins/blocks/table-row.js +7 -0
- package/dist/components/editor/plugins/blocks/table.d.ts +12 -0
- package/dist/components/editor/plugins/blocks/table.js +82 -0
- package/dist/components/editor/plugins/{text.js → blocks/text.js} +3 -3
- package/dist/components/editor/plugins/{video.js → blocks/video.js} +2 -2
- package/dist/components/editor/plugins/index.d.ts +4 -7
- package/dist/components/editor/plugins/index.js +4 -112
- package/dist/components/editor/plugins/leafs/index.d.ts +1 -0
- package/dist/components/editor/plugins/leafs/index.js +1 -0
- package/dist/components/editor/plugins/leafs/leafs.d.ts +1 -0
- package/dist/components/editor/plugins/leafs/leafs.js +33 -0
- package/dist/components/editor/plugins/{link.js → leafs/link.js} +2 -2
- package/dist/components/editor/plugins/marks/index.d.ts +1 -0
- package/dist/components/editor/plugins/marks/index.js +1 -0
- package/dist/components/editor/plugins/marks/marks.d.ts +1 -0
- package/dist/components/editor/plugins/marks/marks.js +12 -0
- package/dist/components/editor/plugins/plate.d.ts +99 -0
- package/dist/components/editor/plugins/plate.js +37 -0
- package/dist/components/editor/plugins/{exitBreak.js → utils/exitBreak.js} +1 -1
- package/dist/components/editor/plugins/utils/index.d.ts +1 -0
- package/dist/components/editor/plugins/utils/index.js +1 -0
- package/dist/components/editor/plugins/{resetBlockType.js → utils/resetBlockType.js} +1 -1
- package/dist/components/editor/plugins/{selectOnBackspace.js → utils/selectOnBackspace.js} +1 -1
- package/dist/components/editor/plugins/utils/utils.d.ts +1 -0
- package/dist/components/editor/plugins/utils/utils.js +12 -0
- package/dist/components/editor/simple_editor/plugins.js +7 -7
- package/dist/components/iconography/avatar/avatar.d.ts +2 -1
- package/dist/components/iconography/avatar/avatar.js +3 -2
- package/dist/components/iconography/avatar/avatar.stories.d.ts +7 -0
- package/dist/components/iconography/avatar/icons/default.js +2 -3
- package/dist/components/input/text_input/text_input.d.ts +1 -0
- package/dist/components/media/video-player/playlist-item.d.ts +2 -2
- package/dist/components/media/video-player/playlist-item.js +6 -6
- package/dist/components/media/video-player/video.d.ts +13 -3
- package/dist/components/media/video-player/video.js +28 -9
- package/dist/components/media/video-player/video.stories.d.ts +6 -0
- package/dist/components/surfaces/carousel/card/card.js +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +129 -0
- package/dist/styles/output.css +1771 -0
- package/package.json +20 -5
- package/dist/components/editor/plate.d.ts +0 -34
- package/dist/components/editor/plate.js +0 -27
- package/dist/components/editor/plugins/image.d.ts +0 -3
- package/dist/components/editor/plugins/image.js +0 -33
- /package/dist/components/editor/plugins/{blockquote.d.ts → blocks/blockquote.d.ts} +0 -0
- /package/dist/components/editor/plugins/{buttons.d.ts → blocks/buttons.d.ts} +0 -0
- /package/dist/components/editor/plugins/{list.d.ts → blocks/list.d.ts} +0 -0
- /package/dist/components/editor/plugins/{list.js → blocks/list.js} +0 -0
- /package/dist/components/editor/plugins/{qa.d.ts → blocks/qa.d.ts} +0 -0
- /package/dist/components/editor/plugins/{text.d.ts → blocks/text.d.ts} +0 -0
- /package/dist/components/editor/plugins/{video.d.ts → blocks/video.d.ts} +0 -0
- /package/dist/components/editor/plugins/{link.d.ts → leafs/link.d.ts} +0 -0
- /package/dist/components/editor/plugins/{exitBreak.d.ts → utils/exitBreak.d.ts} +0 -0
- /package/dist/components/editor/plugins/{resetBlockType.d.ts → utils/resetBlockType.d.ts} +0 -0
- /package/dist/components/editor/plugins/{selectOnBackspace.d.ts → utils/selectOnBackspace.d.ts} +0 -0
- /package/dist/components/editor/plugins/{softBreak.d.ts → utils/softBreak.d.ts} +0 -0
- /package/dist/components/editor/plugins/{softBreak.js → utils/softBreak.js} +0 -0
|
@@ -12,21 +12,28 @@ import { PlaylistItem } from './playlist-item';
|
|
|
12
12
|
* ReactPlayer props reference -> https://www.npmjs.com/package/react-player#props
|
|
13
13
|
* HLS Option props reference -> https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning
|
|
14
14
|
*/
|
|
15
|
-
export const VideoPlayer = ({ activeIndex, pip, playable, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, }) => {
|
|
15
|
+
export const VideoPlayer = ({ activeIndex, pip, playable, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, trailer, }) => {
|
|
16
16
|
const [showingAll, setShowingAll] = React.useState(false);
|
|
17
|
+
const [playingTrailer, setPlayingTrailer] = React.useState(!playable);
|
|
17
18
|
const ref = React.useRef(null);
|
|
18
|
-
const mediaItem = playlist?.[activeIndex];
|
|
19
|
+
const mediaItem = playingTrailer ? trailer : playlist?.[activeIndex];
|
|
19
20
|
const handleReady = () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
if (!playingTrailer) {
|
|
22
|
+
const currTime = ref?.current?.getCurrentTime();
|
|
23
|
+
if (currTime === 0 && mediaItem?.progress !== 0) {
|
|
24
|
+
ref.current.seekTo(mediaItem.progress);
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
};
|
|
28
|
+
const handleMediaItemChange = (id) => {
|
|
29
|
+
setPlayingTrailer(false);
|
|
30
|
+
setMediaItem(id);
|
|
31
|
+
};
|
|
25
32
|
const toggleShowingAll = () => setShowingAll((prev) => !prev);
|
|
26
33
|
if (!mediaItem)
|
|
27
34
|
return null;
|
|
28
35
|
return (React.createElement(Wrapper, { "$orientation": orientation },
|
|
29
|
-
React.createElement(InnerWrapper, { "$orientation": orientation, "$playable": playable },
|
|
36
|
+
React.createElement(InnerWrapper, { "$orientation": orientation, "$playable": playable || playingTrailer },
|
|
30
37
|
orientation === 'vertical' && (React.createElement(Box, { "$dir": "column", "$gap": 4, sx: "margin: 24px;" },
|
|
31
38
|
React.createElement(H, { as: "h2", "$bold": true, "$color": "white", "$fontSize": 28, "$lineHeight": 36 }, title),
|
|
32
39
|
React.createElement(P, { as: "h3", "$bold": true, "$color": "grey-8" }, subtitle))),
|
|
@@ -48,7 +55,7 @@ export const VideoPlayer = ({ activeIndex, pip, playable, playlist, onPipChange,
|
|
|
48
55
|
},
|
|
49
56
|
}, controls: true, height: "100%", light: React.createElement(Image, { alt: `thumbnail for ${title}`, layout: "fill", priority: true, quality: 100, style: {
|
|
50
57
|
objectFit: 'contain',
|
|
51
|
-
}, src: mediaItem.thumbnail }), progressInterval: 4000, onDisablePIP: () => onPipChange && onPipChange(false), onEnablePIP: () => onPipChange && onPipChange(true), onProgress: onProgress, onReady: handleReady, pip: pip, playIcon: playable ? (React.createElement(PlaySolid, { color: "white", size: 24, sx: "position: absolute; width: 54px; height: 54px;" })) : (React.createElement(LockCircle, { color: "white", size: 24, sx: "position: absolute; width: 54px; height: 54px;" })), playing: playable, ref: ref, style: {
|
|
58
|
+
}, src: mediaItem.thumbnail }), progressInterval: 4000, onDisablePIP: () => onPipChange && onPipChange(false), onEnablePIP: () => onPipChange && onPipChange(true), onProgress: onProgress, onReady: handleReady, pip: pip, playIcon: playable || playingTrailer ? (React.createElement(PlaySolid, { color: "white", size: 24, sx: "position: absolute; width: 54px; height: 54px;" })) : (React.createElement(LockCircle, { color: "white", size: 24, sx: "position: absolute; width: 54px; height: 54px;" })), playing: playable, ref: ref, style: {
|
|
52
59
|
backgroundColor: 'var(--color-grey-0)',
|
|
53
60
|
maxHeight: 720,
|
|
54
61
|
maxWidth: 1280,
|
|
@@ -60,14 +67,26 @@ export const VideoPlayer = ({ activeIndex, pip, playable, playlist, onPipChange,
|
|
|
60
67
|
React.createElement(Box, { "$dir": "column", "$gap": 4 },
|
|
61
68
|
React.createElement(H, { as: "h2", "$bold": true, "$color": "white", "$fontSize": 28, "$lineHeight": 36 }, title),
|
|
62
69
|
React.createElement(P, { as: "h3", "$bold": true, "$color": "grey-8" }, subtitle)),
|
|
70
|
+
!!trailer && (React.createElement(Box, { "$dir": "column", "$gap": 8, sx: `
|
|
71
|
+
margin-bottom: 8x;
|
|
72
|
+
border-bottom: 1px solid var(--color-grey-4);
|
|
73
|
+
padding-bottom: 16px;
|
|
74
|
+
` },
|
|
75
|
+
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px 8px 14px;" },
|
|
76
|
+
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "Trailer")),
|
|
77
|
+
React.createElement(PlaylistItem, { onClick: () => setPlayingTrailer(true), playable: true, thumbnail: trailer.thumbnail, title: `${title} Trailer` }))),
|
|
63
78
|
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px 8px 14px;" },
|
|
64
79
|
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "All lessons")),
|
|
65
|
-
React.createElement(HorizontalPlaylistWrapper, null, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () =>
|
|
80
|
+
React.createElement(HorizontalPlaylistWrapper, null, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () => handleMediaItemChange(index), playable: playable, progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))),
|
|
66
81
|
orientation === 'vertical' && (React.createElement(Box, { "$dir": "column", "$gap": 24 },
|
|
82
|
+
!!trailer && (React.createElement(Box, { "$dir": "column", "$gap": 8, sx: "margin: 0px 24px;" },
|
|
83
|
+
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px 8px 14px;" },
|
|
84
|
+
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "Trailer")),
|
|
85
|
+
React.createElement(PlaylistItem, { onClick: () => setPlayingTrailer(true), playable: true, thumbnail: trailer.thumbnail, title: `${title} Trailer` }))),
|
|
67
86
|
React.createElement(Box, { "$align": "center", "$justify": "space-between", sx: "padding: 8px 0px; margin: 0px 24px; border-bottom: 1px solid var(--color-grey-3);" },
|
|
68
87
|
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, "$semiBold": true }, "All lessons"),
|
|
69
88
|
React.createElement(Button, { onClick: toggleShowingAll, size: "small", sx: "background-color: var(--color-grey-2); border-color: var(--color-grey-8); color: var(--color-grey-8);", type: "text" }, showingAll ? 'Collapse' : 'View all')),
|
|
70
|
-
React.createElement(VerticalPlaylistWrapper, { "$showingAll": showingAll }, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () =>
|
|
89
|
+
React.createElement(VerticalPlaylistWrapper, { "$showingAll": showingAll }, playlist.map((playlistItem, index) => (React.createElement(PlaylistItem, { key: playlistItem.id, duration: playlistItem.duration, onClick: () => handleMediaItemChange(index), playable: playable, progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))))));
|
|
71
90
|
};
|
|
72
91
|
const Wrapper = styled.div `
|
|
73
92
|
display: flex;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
+
import { VideoPlayerProps } from './video';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
declare const Story: StoryFn<Pick<VideoPlayerProps, 'onProgress' | 'orientation' | 'playlist' | 'subtitle' | 'title' | 'pip' | 'playable' | 'trailer'>>;
|
|
5
|
+
export declare const Default: typeof Story;
|
|
6
|
+
export default meta;
|