@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.
Files changed (114) hide show
  1. package/dist/components/actions/button/button.d.ts +1 -1
  2. package/dist/components/actions/dropdown/dropdown.stories.d.ts +5 -0
  3. package/dist/components/actions/rate/rate.js +4 -3
  4. package/dist/components/atoms/hide/hide.js +1 -1
  5. package/dist/components/card/feature/feature.js +1 -1
  6. package/dist/components/custom/courses_selection/courses_selection.js +5 -7
  7. package/dist/components/custom/courses_selection/courses_selection.stories.d.ts +5 -0
  8. package/dist/components/custom/users_selection/users_selection.stories.d.ts +5 -0
  9. package/dist/components/editor/constants.d.ts +9 -11
  10. package/dist/components/editor/constants.js +11 -7
  11. package/dist/components/editor/context.d.ts +1 -0
  12. package/dist/components/editor/context.js +1 -0
  13. package/dist/components/editor/editor.d.ts +3 -4
  14. package/dist/components/editor/editor.js +27 -5
  15. package/dist/components/editor/editor.stories.d.ts +6 -0
  16. package/dist/components/editor/icons/border-all.d.ts +3 -0
  17. package/dist/components/editor/icons/border-all.js +3 -0
  18. package/dist/components/editor/icons/border-bottom.d.ts +3 -0
  19. package/dist/components/editor/icons/border-bottom.js +3 -0
  20. package/dist/components/editor/icons/border-left.d.ts +3 -0
  21. package/dist/components/editor/icons/border-left.js +3 -0
  22. package/dist/components/editor/icons/border-none.d.ts +3 -0
  23. package/dist/components/editor/icons/border-none.js +3 -0
  24. package/dist/components/editor/icons/border-right.d.ts +3 -0
  25. package/dist/components/editor/icons/border-right.js +3 -0
  26. package/dist/components/editor/icons/border-top.d.ts +3 -0
  27. package/dist/components/editor/icons/border-top.js +3 -0
  28. package/dist/components/editor/icons/index.d.ts +6 -0
  29. package/dist/components/editor/icons/index.js +6 -0
  30. package/dist/components/editor/navbar/index.d.ts +0 -1
  31. package/dist/components/editor/navbar/navbar.d.ts +1 -4
  32. package/dist/components/editor/navbar/navbar.js +10 -14
  33. package/dist/components/editor/plugins/{blockquote.js → blocks/blockquote.js} +1 -1
  34. package/dist/components/editor/plugins/blocks/blocks.d.ts +1 -0
  35. package/dist/components/editor/plugins/blocks/blocks.js +50 -0
  36. package/dist/components/editor/plugins/{buttons.js → blocks/buttons.js} +2 -2
  37. package/dist/components/editor/plugins/blocks/dropdown-menu.d.ts +29 -0
  38. package/dist/components/editor/plugins/blocks/dropdown-menu.js +62 -0
  39. package/dist/components/editor/plugins/blocks/image.d.ts +9 -0
  40. package/dist/components/editor/plugins/blocks/image.js +36 -0
  41. package/dist/components/editor/plugins/blocks/index.d.ts +1 -0
  42. package/dist/components/editor/plugins/blocks/index.js +1 -0
  43. package/dist/components/editor/plugins/blocks/media-popover.d.ts +6 -0
  44. package/dist/components/editor/plugins/blocks/media-popover.js +32 -0
  45. package/dist/components/editor/plugins/blocks/plate-button.d.ts +14 -0
  46. package/dist/components/editor/plugins/blocks/plate-button.js +37 -0
  47. package/dist/components/editor/plugins/blocks/popover.d.ts +7 -0
  48. package/dist/components/editor/plugins/blocks/popover.js +11 -0
  49. package/dist/components/editor/plugins/{qa.js → blocks/qa.js} +8 -8
  50. package/dist/components/editor/plugins/blocks/resizable.d.ts +39 -0
  51. package/dist/components/editor/plugins/blocks/resizable.js +37 -0
  52. package/dist/components/editor/plugins/blocks/separator.d.ts +5 -0
  53. package/dist/components/editor/plugins/blocks/separator.js +19 -0
  54. package/dist/components/editor/plugins/blocks/table-cell.d.ts +23 -0
  55. package/dist/components/editor/plugins/blocks/table-cell.js +38 -0
  56. package/dist/components/editor/plugins/blocks/table-row.d.ts +11 -0
  57. package/dist/components/editor/plugins/blocks/table-row.js +7 -0
  58. package/dist/components/editor/plugins/blocks/table.d.ts +12 -0
  59. package/dist/components/editor/plugins/blocks/table.js +82 -0
  60. package/dist/components/editor/plugins/{text.js → blocks/text.js} +3 -3
  61. package/dist/components/editor/plugins/{video.js → blocks/video.js} +2 -2
  62. package/dist/components/editor/plugins/index.d.ts +4 -7
  63. package/dist/components/editor/plugins/index.js +4 -112
  64. package/dist/components/editor/plugins/leafs/index.d.ts +1 -0
  65. package/dist/components/editor/plugins/leafs/index.js +1 -0
  66. package/dist/components/editor/plugins/leafs/leafs.d.ts +1 -0
  67. package/dist/components/editor/plugins/leafs/leafs.js +33 -0
  68. package/dist/components/editor/plugins/{link.js → leafs/link.js} +2 -2
  69. package/dist/components/editor/plugins/marks/index.d.ts +1 -0
  70. package/dist/components/editor/plugins/marks/index.js +1 -0
  71. package/dist/components/editor/plugins/marks/marks.d.ts +1 -0
  72. package/dist/components/editor/plugins/marks/marks.js +12 -0
  73. package/dist/components/editor/plugins/plate.d.ts +99 -0
  74. package/dist/components/editor/plugins/plate.js +37 -0
  75. package/dist/components/editor/plugins/{exitBreak.js → utils/exitBreak.js} +1 -1
  76. package/dist/components/editor/plugins/utils/index.d.ts +1 -0
  77. package/dist/components/editor/plugins/utils/index.js +1 -0
  78. package/dist/components/editor/plugins/{resetBlockType.js → utils/resetBlockType.js} +1 -1
  79. package/dist/components/editor/plugins/{selectOnBackspace.js → utils/selectOnBackspace.js} +1 -1
  80. package/dist/components/editor/plugins/utils/utils.d.ts +1 -0
  81. package/dist/components/editor/plugins/utils/utils.js +12 -0
  82. package/dist/components/editor/simple_editor/plugins.js +7 -7
  83. package/dist/components/iconography/avatar/avatar.d.ts +2 -1
  84. package/dist/components/iconography/avatar/avatar.js +3 -2
  85. package/dist/components/iconography/avatar/avatar.stories.d.ts +7 -0
  86. package/dist/components/iconography/avatar/icons/default.js +2 -3
  87. package/dist/components/input/text_input/text_input.d.ts +1 -0
  88. package/dist/components/media/video-player/playlist-item.d.ts +2 -2
  89. package/dist/components/media/video-player/playlist-item.js +6 -6
  90. package/dist/components/media/video-player/video.d.ts +13 -3
  91. package/dist/components/media/video-player/video.js +28 -9
  92. package/dist/components/media/video-player/video.stories.d.ts +6 -0
  93. package/dist/components/surfaces/carousel/card/card.js +1 -1
  94. package/dist/main.js +2 -0
  95. package/dist/main.js.LICENSE.txt +129 -0
  96. package/dist/styles/output.css +1771 -0
  97. package/package.json +20 -5
  98. package/dist/components/editor/plate.d.ts +0 -34
  99. package/dist/components/editor/plate.js +0 -27
  100. package/dist/components/editor/plugins/image.d.ts +0 -3
  101. package/dist/components/editor/plugins/image.js +0 -33
  102. /package/dist/components/editor/plugins/{blockquote.d.ts → blocks/blockquote.d.ts} +0 -0
  103. /package/dist/components/editor/plugins/{buttons.d.ts → blocks/buttons.d.ts} +0 -0
  104. /package/dist/components/editor/plugins/{list.d.ts → blocks/list.d.ts} +0 -0
  105. /package/dist/components/editor/plugins/{list.js → blocks/list.js} +0 -0
  106. /package/dist/components/editor/plugins/{qa.d.ts → blocks/qa.d.ts} +0 -0
  107. /package/dist/components/editor/plugins/{text.d.ts → blocks/text.d.ts} +0 -0
  108. /package/dist/components/editor/plugins/{video.d.ts → blocks/video.d.ts} +0 -0
  109. /package/dist/components/editor/plugins/{link.d.ts → leafs/link.d.ts} +0 -0
  110. /package/dist/components/editor/plugins/{exitBreak.d.ts → utils/exitBreak.d.ts} +0 -0
  111. /package/dist/components/editor/plugins/{resetBlockType.d.ts → utils/resetBlockType.d.ts} +0 -0
  112. /package/dist/components/editor/plugins/{selectOnBackspace.d.ts → utils/selectOnBackspace.d.ts} +0 -0
  113. /package/dist/components/editor/plugins/{softBreak.d.ts → utils/softBreak.d.ts} +0 -0
  114. /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
- const currTime = ref?.current?.getCurrentTime();
21
- if (currTime === 0 && mediaItem?.progress !== 0) {
22
- ref.current.seekTo(mediaItem.progress);
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: () => setMediaItem(index), playable: playable, progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))),
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: () => setMediaItem(index), progress: playlistItem.progress, shortDescription: playlistItem.shortDescription, thumbnail: playlistItem.thumbnail, title: playlistItem.title })))))))));
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;
@@ -71,7 +71,7 @@ const Inner = styled.div `
71
71
  `;
72
72
  const Button = styled.button `
73
73
  position: absolute;
74
- z-index: 25;
74
+ z-index: 1;
75
75
  top: 0px;
76
76
  height: 100%;
77
77
  display: flex;