@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
|
@@ -1,112 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { createLinkPlugin } from '@udecode/plate-link';
|
|
6
|
-
import { createButtonsPlugin } from './buttons';
|
|
7
|
-
import { exitBreakPlugin } from './exitBreak';
|
|
8
|
-
import { resetBlockTypePlugin } from './resetBlockType';
|
|
9
|
-
import { selectOnBackspace } from './selectOnBackspace';
|
|
10
|
-
import { softBreakPlugin } from './softBreak';
|
|
11
|
-
import { createParagraphPlugin, createHOnePlugin, createHTwoPlugin, createHThreePlugin, createHFourPlugin, createHFivePlugin, createHSixPlugin, } from './text';
|
|
12
|
-
import { LinkFloatingMenu } from './link';
|
|
13
|
-
import { createQAPlugin } from './qa';
|
|
14
|
-
import { createVideoTitlePlugin } from './video';
|
|
15
|
-
/**
|
|
16
|
-
* ELEMENT TYPES
|
|
17
|
-
*/
|
|
18
|
-
import { ELEMENT_PARAGRAPH, ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_OL, ELEMENT_UL, } from '../constants';
|
|
19
|
-
/**
|
|
20
|
-
* ELEMENT TYPES
|
|
21
|
-
*/
|
|
22
|
-
export const blocks = [
|
|
23
|
-
createButtonsPlugin(),
|
|
24
|
-
createBlockquotePlugin(),
|
|
25
|
-
createCodeBlockPlugin(),
|
|
26
|
-
createHeadingPlugin(),
|
|
27
|
-
createHorizontalRulePlugin(),
|
|
28
|
-
createImagePlugin({
|
|
29
|
-
options: {
|
|
30
|
-
disableUploadInsert: true,
|
|
31
|
-
disableEmbedInsert: true,
|
|
32
|
-
},
|
|
33
|
-
}),
|
|
34
|
-
createQAPlugin(),
|
|
35
|
-
createTextIndentPlugin(),
|
|
36
|
-
createIndentListPlugin({
|
|
37
|
-
inject: {
|
|
38
|
-
props: {
|
|
39
|
-
validTypes: [
|
|
40
|
-
ELEMENT_PARAGRAPH,
|
|
41
|
-
ELEMENT_H1,
|
|
42
|
-
ELEMENT_H2,
|
|
43
|
-
ELEMENT_H3,
|
|
44
|
-
ELEMENT_H4,
|
|
45
|
-
ELEMENT_H5,
|
|
46
|
-
ELEMENT_H6,
|
|
47
|
-
ELEMENT_OL,
|
|
48
|
-
ELEMENT_UL,
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
53
|
-
createListPlugin(),
|
|
54
|
-
createMediaEmbedPlugin(),
|
|
55
|
-
createParagraphPlugin(),
|
|
56
|
-
createHOnePlugin(),
|
|
57
|
-
createHTwoPlugin(),
|
|
58
|
-
createHThreePlugin(),
|
|
59
|
-
createHFourPlugin(),
|
|
60
|
-
createHFivePlugin(),
|
|
61
|
-
createHSixPlugin(),
|
|
62
|
-
createResetNodePlugin(),
|
|
63
|
-
createTablePlugin(),
|
|
64
|
-
createVideoTitlePlugin(),
|
|
65
|
-
];
|
|
66
|
-
export const marks = [
|
|
67
|
-
createBoldPlugin(),
|
|
68
|
-
createCodePlugin(),
|
|
69
|
-
createFontBackgroundColorPlugin(),
|
|
70
|
-
createFontSizePlugin(),
|
|
71
|
-
createFontFamilyPlugin(),
|
|
72
|
-
createItalicPlugin(),
|
|
73
|
-
createStrikethroughPlugin(),
|
|
74
|
-
createSubscriptPlugin(),
|
|
75
|
-
createSuperscriptPlugin(),
|
|
76
|
-
createUnderlinePlugin(),
|
|
77
|
-
];
|
|
78
|
-
export const inline = [
|
|
79
|
-
createAlignPlugin({
|
|
80
|
-
inject: {
|
|
81
|
-
props: {
|
|
82
|
-
validTypes: [
|
|
83
|
-
ELEMENT_PARAGRAPH,
|
|
84
|
-
ELEMENT_H1,
|
|
85
|
-
ELEMENT_H2,
|
|
86
|
-
ELEMENT_H3,
|
|
87
|
-
ELEMENT_H4,
|
|
88
|
-
ELEMENT_H5,
|
|
89
|
-
ELEMENT_H6,
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
}),
|
|
94
|
-
createIndentPlugin({
|
|
95
|
-
inject: {
|
|
96
|
-
props: {
|
|
97
|
-
validTypes: [ELEMENT_PARAGRAPH, ELEMENT_H1],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
createLineHeightPlugin(),
|
|
102
|
-
createLinkPlugin({
|
|
103
|
-
renderBeforeEditable: LinkFloatingMenu,
|
|
104
|
-
}),
|
|
105
|
-
];
|
|
106
|
-
export const utils = [
|
|
107
|
-
createExitBreakPlugin(exitBreakPlugin),
|
|
108
|
-
createHistoryPlugin(),
|
|
109
|
-
createResetNodePlugin(resetBlockTypePlugin),
|
|
110
|
-
createSelectOnBackspacePlugin(selectOnBackspace),
|
|
111
|
-
createSoftBreakPlugin(softBreakPlugin),
|
|
112
|
-
];
|
|
1
|
+
export { blocks } from './blocks';
|
|
2
|
+
export { leafs } from './leafs';
|
|
3
|
+
export { marks } from './marks';
|
|
4
|
+
export { utils } from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { leafs } from './leafs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { leafs } from './leafs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const leafs: (import("@udecode/plate-core").PlatePlugin<import("@udecode/utils").AnyObject, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-indent").IndentPlugin, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").ToggleMarkPlugin, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-link").LinkPlugin, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>>)[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createAlignPlugin, createCodePlugin, createIndentPlugin, createLineHeightPlugin, } from '@udecode/plate';
|
|
2
|
+
import { createLinkPlugin } from '@udecode/plate-link';
|
|
3
|
+
import { LinkFloatingMenu } from './link';
|
|
4
|
+
import { ELEMENT_PARAGRAPH, ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, } from '../../constants';
|
|
5
|
+
export const leafs = [
|
|
6
|
+
createAlignPlugin({
|
|
7
|
+
inject: {
|
|
8
|
+
props: {
|
|
9
|
+
validTypes: [
|
|
10
|
+
ELEMENT_PARAGRAPH,
|
|
11
|
+
ELEMENT_H1,
|
|
12
|
+
ELEMENT_H2,
|
|
13
|
+
ELEMENT_H3,
|
|
14
|
+
ELEMENT_H4,
|
|
15
|
+
ELEMENT_H5,
|
|
16
|
+
ELEMENT_H6,
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
createIndentPlugin({
|
|
22
|
+
inject: {
|
|
23
|
+
props: {
|
|
24
|
+
validTypes: [ELEMENT_PARAGRAPH, ELEMENT_H1],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
createLineHeightPlugin(),
|
|
29
|
+
createCodePlugin(),
|
|
30
|
+
createLinkPlugin({
|
|
31
|
+
renderBeforeEditable: LinkFloatingMenu,
|
|
32
|
+
}),
|
|
33
|
+
];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { FloatingLinkUrlInput, LinkOpenButton, PlateElement, useFloatingLinkEdit, useFloatingLinkEditState, useFloatingLinkInsert, useFloatingLinkInsertState, useFloatingLinkSelectors, useLink, } from '@udecode/plate';
|
|
4
|
-
import { Box } from '
|
|
5
|
-
import { AASansSerif, Link, Upload } from '
|
|
4
|
+
import { Box } from '../../..';
|
|
5
|
+
import { AASansSerif, Link, Upload } from '../../../../icons';
|
|
6
6
|
export const LinkElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
7
7
|
const { props: linkProps } = useLink({ element: props.element });
|
|
8
8
|
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...linkProps, ...props },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { marks } from './marks';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { marks } from './marks';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const marks: (import("@udecode/plate-core").PlatePlugin<import("@udecode/utils").AnyObject, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").ToggleMarkPlugin, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>>)[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createBoldPlugin, createFontBackgroundColorPlugin, createFontSizePlugin, createFontFamilyPlugin, createItalicPlugin, createStrikethroughPlugin, createSubscriptPlugin, createSuperscriptPlugin, createUnderlinePlugin, } from '@udecode/plate';
|
|
2
|
+
export const marks = [
|
|
3
|
+
createBoldPlugin(),
|
|
4
|
+
createFontBackgroundColorPlugin(),
|
|
5
|
+
createFontSizePlugin(),
|
|
6
|
+
createFontFamilyPlugin(),
|
|
7
|
+
createItalicPlugin(),
|
|
8
|
+
createStrikethroughPlugin(),
|
|
9
|
+
createSubscriptPlugin(),
|
|
10
|
+
createSuperscriptPlugin(),
|
|
11
|
+
createUnderlinePlugin(),
|
|
12
|
+
];
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const plateUI: {
|
|
3
|
+
p: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
4
|
+
h1: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
5
|
+
h2: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
6
|
+
h3: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
7
|
+
h4: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
8
|
+
h5: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
9
|
+
h6: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
10
|
+
blockquote: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
11
|
+
a: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps<import("@udecode/slate").Value, import("@udecode/plate-link").TLinkElement>, "ref"> & import("react").RefAttributes<any>>;
|
|
12
|
+
ol: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderElementProps, "element"> & {
|
|
13
|
+
element: import("@udecode/slate").TElement;
|
|
14
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
|
+
as?: import("react").ElementType<any> | undefined;
|
|
16
|
+
asChild?: boolean | undefined;
|
|
17
|
+
} & import("react").RefAttributes<any> & {
|
|
18
|
+
elementToAttributes?: ((element: import("@udecode/slate").TElement) => any) | undefined;
|
|
19
|
+
} & {
|
|
20
|
+
variant: "ol" | "ul";
|
|
21
|
+
}, "ref"> & import("react").RefAttributes<any>>;
|
|
22
|
+
ul: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderElementProps, "element"> & {
|
|
23
|
+
element: import("@udecode/slate").TElement;
|
|
24
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
25
|
+
as?: import("react").ElementType<any> | undefined;
|
|
26
|
+
asChild?: boolean | undefined;
|
|
27
|
+
} & import("react").RefAttributes<any> & {
|
|
28
|
+
elementToAttributes?: ((element: import("@udecode/slate").TElement) => any) | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
variant: "ol" | "ul";
|
|
31
|
+
}, "ref"> & import("react").RefAttributes<any>>;
|
|
32
|
+
img: import("react").ForwardRefExoticComponent<Omit<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderElementProps, "element"> & {
|
|
33
|
+
element: import("@udecode/slate").TElement;
|
|
34
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
35
|
+
as?: import("react").ElementType<any> | undefined;
|
|
36
|
+
asChild?: boolean | undefined;
|
|
37
|
+
} & import("react").RefAttributes<any> & {
|
|
38
|
+
elementToAttributes?: ((element: import("@udecode/slate").TElement) => any) | undefined;
|
|
39
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<any>, "ref"> & import("react").RefAttributes<unknown>>;
|
|
40
|
+
button: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-utils").PlateElementProps, "ref"> & import("react").RefAttributes<any>>;
|
|
41
|
+
table: import("react").ForwardRefExoticComponent<Omit<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderElementProps, "element"> & {
|
|
42
|
+
element: import("@udecode/slate").TElement;
|
|
43
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
44
|
+
as?: import("react").ElementType<any> | undefined;
|
|
45
|
+
asChild?: boolean | undefined;
|
|
46
|
+
} & import("react").RefAttributes<any> & {
|
|
47
|
+
elementToAttributes?: ((element: import("@udecode/slate").TElement) => any) | undefined;
|
|
48
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<any>, "ref"> & import("react").RefAttributes<unknown>>;
|
|
49
|
+
td: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderElementProps, "element"> & {
|
|
50
|
+
element: import("@udecode/slate").TElement;
|
|
51
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
52
|
+
as?: import("react").ElementType<any> | undefined;
|
|
53
|
+
asChild?: boolean | undefined;
|
|
54
|
+
} & import("react").RefAttributes<any> & {
|
|
55
|
+
elementToAttributes?: ((element: import("@udecode/slate").TElement) => any) | undefined;
|
|
56
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
57
|
+
hideBorder?: boolean | undefined;
|
|
58
|
+
isHeader?: boolean | undefined;
|
|
59
|
+
} & import("react").RefAttributes<any>>;
|
|
60
|
+
th: import("react").ForwardRefExoticComponent<Omit<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderElementProps, "element"> & {
|
|
61
|
+
element: import("@udecode/slate").TElement;
|
|
62
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
63
|
+
as?: import("react").ElementType<any> | undefined;
|
|
64
|
+
asChild?: boolean | undefined;
|
|
65
|
+
} & import("react").RefAttributes<any> & {
|
|
66
|
+
elementToAttributes?: ((element: import("@udecode/slate").TElement) => any) | undefined;
|
|
67
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
68
|
+
hideBorder?: boolean | undefined;
|
|
69
|
+
isHeader?: boolean | undefined;
|
|
70
|
+
} & import("react").RefAttributes<any>, "ref"> & import("react").RefAttributes<any>>;
|
|
71
|
+
tr: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderElementProps, "element"> & {
|
|
72
|
+
element: import("@udecode/slate").TElement;
|
|
73
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
74
|
+
as?: import("react").ElementType<any> | undefined;
|
|
75
|
+
asChild?: boolean | undefined;
|
|
76
|
+
} & import("react").RefAttributes<any> & {
|
|
77
|
+
elementToAttributes?: ((element: import("@udecode/slate").TElement) => any) | undefined;
|
|
78
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
79
|
+
hideBorder?: boolean | undefined;
|
|
80
|
+
} & import("react").RefAttributes<any>>;
|
|
81
|
+
subscript: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderLeafProps, "text" | "leaf"> & {
|
|
82
|
+
leaf: import("@udecode/slate").TText;
|
|
83
|
+
text: import("@udecode/slate").TText;
|
|
84
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
85
|
+
as?: import("react").ElementType<any> | undefined;
|
|
86
|
+
asChild?: boolean | undefined;
|
|
87
|
+
} & import("react").RefAttributes<any> & {
|
|
88
|
+
leafToAttributes?: ((leaf: import("@udecode/slate").TText) => any) | undefined;
|
|
89
|
+
} & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<any>>;
|
|
90
|
+
superscript: import("react").ForwardRefExoticComponent<Omit<import("@udecode/plate-core").PlateRenderNodeProps<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> & Omit<import("slate-react").RenderLeafProps, "text" | "leaf"> & {
|
|
91
|
+
leaf: import("@udecode/slate").TText;
|
|
92
|
+
text: import("@udecode/slate").TText;
|
|
93
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
94
|
+
as?: import("react").ElementType<any> | undefined;
|
|
95
|
+
asChild?: boolean | undefined;
|
|
96
|
+
} & import("react").RefAttributes<any> & {
|
|
97
|
+
leafToAttributes?: ((leaf: import("@udecode/slate").TText) => any) | undefined;
|
|
98
|
+
} & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<any>>;
|
|
99
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { withProps } from '@udecode/cn';
|
|
2
|
+
import { PlateLeaf } from '@udecode/plate-common';
|
|
3
|
+
import { BlockquoteElement } from './blocks/blockquote';
|
|
4
|
+
import { Button } from './blocks/buttons';
|
|
5
|
+
import { ImageElement } from './blocks/image';
|
|
6
|
+
import { ListElement } from './blocks/list';
|
|
7
|
+
import { TableElement } from './blocks/table';
|
|
8
|
+
import { TableCellElement, TableCellHeaderElement } from './blocks/table-cell';
|
|
9
|
+
import { TableRowElement } from './blocks/table-row';
|
|
10
|
+
import { ParagraphElement, HOneElement, HTwoElement, HThreeElement, HFourElement, HFiveElement, HSixElement, } from './blocks/text';
|
|
11
|
+
import { LinkElement } from './leafs/link';
|
|
12
|
+
import * as Elements from '../constants';
|
|
13
|
+
export const plateUI = {
|
|
14
|
+
[Elements.ELEMENT_PARAGRAPH]: ParagraphElement,
|
|
15
|
+
[Elements.ELEMENT_H1]: HOneElement,
|
|
16
|
+
[Elements.ELEMENT_H2]: HTwoElement,
|
|
17
|
+
[Elements.ELEMENT_H3]: HThreeElement,
|
|
18
|
+
[Elements.ELEMENT_H4]: HFourElement,
|
|
19
|
+
[Elements.ELEMENT_H5]: HFiveElement,
|
|
20
|
+
[Elements.ELEMENT_H6]: HSixElement,
|
|
21
|
+
[Elements.ELEMENT_BLOCKQUOTE]: BlockquoteElement,
|
|
22
|
+
[Elements.ELEMENT_LINK]: LinkElement,
|
|
23
|
+
[Elements.ELEMENT_OL]: withProps(ListElement, {
|
|
24
|
+
variant: Elements.ELEMENT_OL,
|
|
25
|
+
}),
|
|
26
|
+
[Elements.ELEMENT_UL]: withProps(ListElement, {
|
|
27
|
+
variant: Elements.ELEMENT_UL,
|
|
28
|
+
}),
|
|
29
|
+
[Elements.ELEMENT_IMAGE]: ImageElement,
|
|
30
|
+
[Elements.ELEMENT_BUTTON]: Button,
|
|
31
|
+
[Elements.ELEMENT_TABLE]: TableElement,
|
|
32
|
+
[Elements.ELEMENT_TD]: TableCellElement,
|
|
33
|
+
[Elements.ELEMENT_TH]: TableCellHeaderElement,
|
|
34
|
+
[Elements.ELEMENT_TR]: TableRowElement,
|
|
35
|
+
[Elements.MARK_SUBSCRIPT]: withProps(PlateLeaf, { as: 'sub' }),
|
|
36
|
+
[Elements.MARK_SUPERSCRIPT]: withProps(PlateLeaf, { as: 'sup' }),
|
|
37
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KEYS_HEADING } from '@udecode/plate';
|
|
2
|
-
import { ELEMENT_BLOCKQUOTE, ELEMENT_BUTTON, ELEMENT_MEDIA, ELEMENT_MEDIA_EMBED, ELEMENT_OL, ELEMENT_UL, } from '
|
|
2
|
+
import { ELEMENT_BLOCKQUOTE, ELEMENT_BUTTON, ELEMENT_MEDIA, ELEMENT_MEDIA_EMBED, ELEMENT_OL, ELEMENT_UL, } from '../../constants';
|
|
3
3
|
export const exitBreakPlugin = {
|
|
4
4
|
options: {
|
|
5
5
|
rules: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { utils } from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { utils } from './utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isBlockAboveEmpty, isSelectionAtBlockStart } from '@udecode/plate';
|
|
2
|
-
import { ELEMENT_BLOCKQUOTE, ELEMENT_PARAGRAPH, ELEMENT_TODO_LI, } from '
|
|
2
|
+
import { ELEMENT_BLOCKQUOTE, ELEMENT_PARAGRAPH, ELEMENT_TODO_LI, } from '../../constants';
|
|
3
3
|
const resetBlockTypesCommonRule = {
|
|
4
4
|
types: [ELEMENT_BLOCKQUOTE, ELEMENT_TODO_LI],
|
|
5
5
|
defaultType: ELEMENT_PARAGRAPH,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ELEMENT_HR, ELEMENT_IMAGE, ELEMENT_MEDIA_EMBED } from '
|
|
1
|
+
import { ELEMENT_HR, ELEMENT_IMAGE, ELEMENT_MEDIA_EMBED, } from '../../constants';
|
|
2
2
|
export const selectOnBackspace = {
|
|
3
3
|
options: {
|
|
4
4
|
query: { allow: [ELEMENT_HR, ELEMENT_IMAGE, ELEMENT_MEDIA_EMBED] },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const utils: (import("@udecode/plate-core").PlatePlugin<import("@udecode/utils").AnyObject, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-reset-node").ResetNodePlugin<import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>>, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-break").ExitBreakPlugin, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-select").SelectOnBackspacePlugin, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>> | import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-break").SoftBreakPlugin, import("@udecode/slate").Value, import("@udecode/plate-core").PlateEditor<import("@udecode/slate").Value>>)[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createResetNodePlugin, createExitBreakPlugin, createHistoryPlugin, createSelectOnBackspacePlugin, createSoftBreakPlugin, } from '@udecode/plate';
|
|
2
|
+
import { exitBreakPlugin } from './exitBreak';
|
|
3
|
+
import { resetBlockTypePlugin } from './resetBlockType';
|
|
4
|
+
import { selectOnBackspace } from './selectOnBackspace';
|
|
5
|
+
import { softBreakPlugin } from './softBreak';
|
|
6
|
+
export const utils = [
|
|
7
|
+
createExitBreakPlugin(exitBreakPlugin),
|
|
8
|
+
createHistoryPlugin(),
|
|
9
|
+
createResetNodePlugin(resetBlockTypePlugin),
|
|
10
|
+
createSelectOnBackspacePlugin(selectOnBackspace),
|
|
11
|
+
createSoftBreakPlugin(softBreakPlugin),
|
|
12
|
+
];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createPlugins, createHeadingPlugin, createIndentListPlugin, createImagePlugin, createTextIndentPlugin, createListPlugin, createMediaEmbedPlugin, createResetNodePlugin, createBoldPlugin, createCodePlugin, createFontBackgroundColorPlugin, createFontSizePlugin, createFontFamilyPlugin, createItalicPlugin, createStrikethroughPlugin, createSubscriptPlugin, createSuperscriptPlugin, createUnderlinePlugin, createAlignPlugin, createIndentPlugin, createLineHeightPlugin, createLinkPlugin, createExitBreakPlugin, createHistoryPlugin, createSelectOnBackspacePlugin, createSoftBreakPlugin, } from '@udecode/plate';
|
|
2
|
-
import { createParagraphPlugin, createHOnePlugin, createHTwoPlugin, createHThreePlugin, createHFourPlugin, createHFivePlugin, createHSixPlugin, } from '../plugins/text';
|
|
2
|
+
import { createParagraphPlugin, createHOnePlugin, createHTwoPlugin, createHThreePlugin, createHFourPlugin, createHFivePlugin, createHSixPlugin, } from '../plugins/blocks/text';
|
|
3
3
|
import { ELEMENT_PARAGRAPH, ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_OL, ELEMENT_UL, } from '../constants';
|
|
4
|
-
import { exitBreakPlugin } from '../plugins/exitBreak';
|
|
5
|
-
import { LinkFloatingMenu } from '../plugins/link';
|
|
6
|
-
import { resetBlockTypePlugin } from '../plugins/resetBlockType';
|
|
7
|
-
import { selectOnBackspace } from '../plugins/selectOnBackspace';
|
|
8
|
-
import { softBreakPlugin } from '../plugins/softBreak';
|
|
9
|
-
import { plateUI } from '../plate';
|
|
4
|
+
import { exitBreakPlugin } from '../plugins/utils/exitBreak';
|
|
5
|
+
import { LinkFloatingMenu } from '../plugins/leafs/link';
|
|
6
|
+
import { resetBlockTypePlugin } from '../plugins/utils/resetBlockType';
|
|
7
|
+
import { selectOnBackspace } from '../plugins/utils/selectOnBackspace';
|
|
8
|
+
import { softBreakPlugin } from '../plugins/utils/softBreak';
|
|
9
|
+
import { plateUI } from '../plugins/plate';
|
|
10
10
|
export const plugins = createPlugins([
|
|
11
11
|
createHeadingPlugin(),
|
|
12
12
|
createImagePlugin({
|
|
@@ -16,13 +16,14 @@ export interface AvatarProps extends NativeProps {
|
|
|
16
16
|
title?: React.ReactNode;
|
|
17
17
|
tooltipContent?: React.ReactElement;
|
|
18
18
|
tooltipSx?: string;
|
|
19
|
+
fallbackImg?: string;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
*
|
|
22
23
|
* Avatar
|
|
23
24
|
*/
|
|
24
25
|
declare const Avatar: {
|
|
25
|
-
({ as, href, image, size, status, subtitle, sx, textPosition, title, tooltipContent, tooltipSx, ...rest }: AvatarProps): React.JSX.Element;
|
|
26
|
+
({ as, href, image, fallbackImg, size, status, subtitle, sx, textPosition, title, tooltipContent, tooltipSx, ...rest }: AvatarProps): React.JSX.Element;
|
|
26
27
|
displayName: string;
|
|
27
28
|
Group: {
|
|
28
29
|
({ children, numDisplayed, total }: AvatarGroupProps): React.JSX.Element;
|
|
@@ -4,6 +4,7 @@ import Image from 'next/image';
|
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { Box, H, P } from '../../';
|
|
6
6
|
import { Approved, Busy, Declined, Default, Focus, Locked, Offline, Online, Subscribed, } from './icons';
|
|
7
|
+
import DefaultAvatar from './assets/default_avatar.png';
|
|
7
8
|
/**
|
|
8
9
|
* Lookup tables for sizes
|
|
9
10
|
*/
|
|
@@ -58,7 +59,7 @@ const iconOffsetY = {
|
|
|
58
59
|
*
|
|
59
60
|
* Avatar
|
|
60
61
|
*/
|
|
61
|
-
const Avatar = ({ as = 'button', href, image, size = 64, status, subtitle, sx, textPosition = 'left', title, tooltipContent, tooltipSx, ...rest }) => {
|
|
62
|
+
const Avatar = ({ as = 'button', href, image, fallbackImg = DefaultAvatar, size = 64, status, subtitle, sx, textPosition = 'left', title, tooltipContent, tooltipSx, ...rest }) => {
|
|
62
63
|
const [displayDefault, setDisplayDefault] = React.useState(false);
|
|
63
64
|
const Icon = iconReference?.[status ?? 'none'];
|
|
64
65
|
return (React.createElement(Box, { "$align": "center", "$gap": 18, sx: `
|
|
@@ -71,7 +72,7 @@ const Avatar = ({ as = 'button', href, image, size = 64, status, subtitle, sx, t
|
|
|
71
72
|
${sx}
|
|
72
73
|
`, ...rest },
|
|
73
74
|
React.createElement(Container, { as: as, "$size": size, href: href },
|
|
74
|
-
!displayDefault && (React.createElement(Image, { alt: "avatar image", height: size, onError: () => setDisplayDefault(true), quality: 100, sizes: "96 | 72 | 64 | 56 | 48 | 40 | 36 | 32 | 24 | 16", src: image ??
|
|
75
|
+
!displayDefault && (React.createElement(Image, { alt: "avatar image", height: size, onError: () => setDisplayDefault(true), quality: 100, sizes: "96 | 72 | 64 | 56 | 48 | 40 | 36 | 32 | 24 | 16", src: image ?? fallbackImg, width: size })),
|
|
75
76
|
displayDefault && React.createElement(Default, null),
|
|
76
77
|
React.createElement("div", null,
|
|
77
78
|
React.createElement(Icon, null))),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
+
import { AvatarGroupProps, AvatarProps } from './avatar';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export declare const Default: StoryFn<AvatarProps>;
|
|
5
|
+
export declare const Group: StoryFn<AvatarGroupProps>;
|
|
6
|
+
export declare const WithTooltip: StoryFn<AvatarProps>;
|
|
7
|
+
export default meta;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export const Default = () => (React.createElement("svg", {
|
|
3
|
-
React.createElement("
|
|
4
|
-
React.createElement("path", { d: "M114.6 114C107.381 114 101.202 111.43 96.0609 106.289C90.9203 101.148 88.35 94.9688 88.35 87.75C88.35 80.5312 90.9203 74.3516 96.0609 69.2109C101.202 64.0703 107.381 61.5 114.6 61.5C121.819 61.5 127.998 64.0703 133.139 69.2109C138.28 74.3516 140.85 80.5312 140.85 87.75C140.85 94.9688 138.28 101.148 133.139 106.289C127.998 111.43 121.819 114 114.6 114ZM62.1 166.5V148.125C62.1 144.406 63.0581 140.987 64.9744 137.868C66.8862 134.753 69.4281 132.375 72.6 130.734C79.3812 127.344 86.2719 124.8 93.2719 123.102C100.272 121.409 107.381 120.562 114.6 120.562C121.819 120.562 128.928 121.409 135.928 123.102C142.928 124.8 149.819 127.344 156.6 130.734C159.772 132.375 162.314 134.753 164.226 137.868C166.142 140.987 167.1 144.406 167.1 148.125V166.5H62.1ZM75.225 153.375H153.975V148.125C153.975 146.922 153.675 145.828 153.076 144.844C152.472 143.859 151.678 143.094 150.694 142.547C144.787 139.594 138.827 137.378 132.811 135.899C126.795 134.425 120.725 133.688 114.6 133.688C108.475 133.688 102.405 134.425 96.389 135.899C90.3734 137.378 84.4125 139.594 78.5062 142.547C77.5219 143.094 76.73 143.859 76.1306 144.844C75.5269 145.828 75.225 146.922 75.225 148.125V153.375ZM114.6 100.875C118.209 100.875 121.3 99.5887 123.873 97.0162C126.441 94.4481 127.725 91.3594 127.725 87.75C127.725 84.1406 126.441 81.0519 123.873 78.4837C121.3 75.9112 118.209 74.625 114.6 74.625C110.991 74.625 107.902 75.9112 105.334 78.4837C102.761 81.0519 101.475 84.1406 101.475 87.75C101.475 91.3594 102.761 94.4481 105.334 97.0162C107.902 99.5887 110.991 100.875 114.6 100.875Z", fill: "#D4E7FA" })));
|
|
2
|
+
export const Default = () => (React.createElement("svg", { version: "1.0", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 228.000000 228.000000", preserveAspectRatio: "xMidYMid meet" },
|
|
3
|
+
React.createElement("g", { transform: "translate(0.000000,228.000000) scale(0.100000,-0.100000)", fill: "#000000", stroke: "none" })));
|
|
@@ -13,6 +13,7 @@ export type Props = {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
15
15
|
onMultipleChange?: (values: string[]) => void;
|
|
16
|
+
onSubmit?: React.FormEventHandler<HTMLInputElement>;
|
|
16
17
|
placeholder?: string;
|
|
17
18
|
size?: TextInputSize;
|
|
18
19
|
sx?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface PlaylistItemProps {
|
|
3
|
-
duration
|
|
3
|
+
duration?: number;
|
|
4
4
|
onClick: () => void;
|
|
5
5
|
playable?: boolean;
|
|
6
6
|
progress?: number;
|
|
7
|
-
shortDescription
|
|
7
|
+
shortDescription?: string;
|
|
8
8
|
thumbnail: string;
|
|
9
9
|
title: string;
|
|
10
10
|
}
|
|
@@ -4,17 +4,17 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { Box } from '../../atoms/box';
|
|
5
5
|
import { SecToDuration } from '../../atoms/seconds_to_duration';
|
|
6
6
|
import { P } from '../../atoms/typography';
|
|
7
|
-
import { PlaySolid } from '../../../icons
|
|
7
|
+
import { Lock, PlaySolid } from '../../../icons';
|
|
8
8
|
export const PlaylistItem = ({ duration, onClick, playable, progress = 0, shortDescription, thumbnail, title, }) => {
|
|
9
9
|
return (React.createElement(Wrapper, { onClick: playable ? onClick : undefined, "$playable": playable },
|
|
10
|
-
React.createElement(PlaySolid, { color: "white", size: 16, sx: "position: absolute; left: 8px; bottom: 4px;" }),
|
|
10
|
+
playable ? (React.createElement(PlaySolid, { color: "white", size: 16, sx: "position: absolute; left: 8px; bottom: 4px;" })) : (React.createElement(Lock, { color: "white", size: 16, sx: "position: absolute; left: 8px; bottom: 4px;" })),
|
|
11
11
|
React.createElement(Image, { alt: `thumbnail for ${title}`, height: 75, quality: 100, src: thumbnail, width: 133 }),
|
|
12
|
-
React.createElement(ProgressBar, { progressPercent: progress / duration }),
|
|
12
|
+
progress && duration && (React.createElement(ProgressBar, { progressPercent: progress / duration })),
|
|
13
13
|
React.createElement(Box, { "$dir": "column", "$gap": 4, sx: "margin-left: 16px; margin-right: auto; flex: 0 1 auto; flex-basis: content;" },
|
|
14
14
|
React.createElement(P, { "$color": "grey-10", "$semiBold": true }, title),
|
|
15
|
-
React.createElement(P, { "$color": "grey-9", "$fontSize": 14, "$lineHeight": 20, "$textClampLines": 2, sx: "max-width: min(500px, 75%);" }, shortDescription)),
|
|
16
|
-
React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, sx: "flex-shrink: 0;" },
|
|
17
|
-
React.createElement(SecToDuration, { seconds: duration }))));
|
|
15
|
+
shortDescription && (React.createElement(P, { "$color": "grey-9", "$fontSize": 14, "$lineHeight": 20, "$textClampLines": 2, sx: "max-width: min(500px, 75%);" }, shortDescription))),
|
|
16
|
+
duration && (React.createElement(P, { "$color": "grey-8", "$fontSize": 14, "$lineHeight": 20, sx: "flex-shrink: 0;" },
|
|
17
|
+
React.createElement(SecToDuration, { seconds: duration })))));
|
|
18
18
|
};
|
|
19
19
|
const Wrapper = styled.div `
|
|
20
20
|
width: 100%;
|
|
@@ -10,6 +10,12 @@ interface MediaItem {
|
|
|
10
10
|
thumbnail: string;
|
|
11
11
|
title: string;
|
|
12
12
|
}
|
|
13
|
+
interface Trailer {
|
|
14
|
+
id: number;
|
|
15
|
+
src: string;
|
|
16
|
+
subtitles: Subtitle[];
|
|
17
|
+
thumbnail: string;
|
|
18
|
+
}
|
|
13
19
|
export interface VideoPlayerProps {
|
|
14
20
|
/**
|
|
15
21
|
* @param activeIndex the media item from the playlist currently playing
|
|
@@ -42,6 +48,10 @@ export interface VideoPlayerProps {
|
|
|
42
48
|
* @param playlist the media items in the player
|
|
43
49
|
*/
|
|
44
50
|
playlist: MediaItem[];
|
|
51
|
+
/**
|
|
52
|
+
* @param setMediaItem sets the index of the item to be played
|
|
53
|
+
*/
|
|
54
|
+
setMediaItem: (index: number) => void;
|
|
45
55
|
/**
|
|
46
56
|
* @param subtitle the video player's subtitle
|
|
47
57
|
*/
|
|
@@ -51,13 +61,13 @@ export interface VideoPlayerProps {
|
|
|
51
61
|
*/
|
|
52
62
|
title: string;
|
|
53
63
|
/**
|
|
54
|
-
* @param
|
|
64
|
+
* @param trailer if in
|
|
55
65
|
*/
|
|
56
|
-
|
|
66
|
+
trailer?: Trailer;
|
|
57
67
|
}
|
|
58
68
|
/**
|
|
59
69
|
* ReactPlayer props reference -> https://www.npmjs.com/package/react-player#props
|
|
60
70
|
* HLS Option props reference -> https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning
|
|
61
71
|
*/
|
|
62
|
-
export declare const VideoPlayer: ({ activeIndex, pip, playable, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, }: VideoPlayerProps) => React.JSX.Element | null;
|
|
72
|
+
export declare const VideoPlayer: ({ activeIndex, pip, playable, playlist, onPipChange, onProgress, orientation, setMediaItem, subtitle, title, trailer, }: VideoPlayerProps) => React.JSX.Element | null;
|
|
63
73
|
export {};
|