@soul-refiner/design-system 2.7.3 → 2.7.4-alpha.1

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 (42) hide show
  1. package/dist/common/date.js +1 -1
  2. package/dist/components/custom/help_center/help_center-auth.js +1 -0
  3. package/dist/components/custom/help_center/help_center-customModal.js +7 -0
  4. package/dist/components/custom/help_center/help_center-defaultArticle.js +60 -0
  5. package/dist/components/custom/help_center/help_center-editable-content.js +31 -0
  6. package/dist/components/custom/help_center/help_center-mainPage.js +32 -0
  7. package/dist/components/custom/help_center/help_center-sidebar.js +1 -0
  8. package/dist/components/custom/help_center/help_center.js +1 -0
  9. package/dist/components/custom/help_center/help_center_articlle-list.js +30 -0
  10. package/dist/components/custom/help_center/help_center_categoryList.js +55 -0
  11. package/dist/components/custom/help_center/help_center_dataStore.js +1 -0
  12. package/dist/components/custom/help_center/help_center_layout.js +64 -0
  13. package/dist/components/custom/help_center/help_center_sub-category.js +27 -0
  14. package/dist/components/custom/help_center/types.js +1 -0
  15. package/dist/components/editor/context.js +1 -1
  16. package/dist/components/editor/editor.js +1 -1
  17. package/dist/components/editor/plugins/blocks/qa.js +2 -2
  18. package/dist/components/media/audio-player/progress-bar.js +4 -0
  19. package/dist/components/surfaces/comment/comment.js +2 -1
  20. package/dist/icons/symbols/twitter.js +1 -1
  21. package/dist/src/common/date.d.ts +2 -2
  22. package/dist/src/components/custom/help_center/help_center-auth.d.ts +7 -0
  23. package/dist/src/components/custom/help_center/help_center-customModal.d.ts +4 -0
  24. package/dist/src/components/custom/help_center/help_center-defaultArticle.d.ts +15 -0
  25. package/dist/src/components/custom/help_center/help_center-editable-content.d.ts +7 -0
  26. package/dist/src/components/custom/help_center/help_center-mainPage.d.ts +3 -0
  27. package/dist/src/components/custom/help_center/help_center-sidebar.d.ts +3 -0
  28. package/dist/src/components/custom/help_center/help_center.d.ts +13 -0
  29. package/dist/src/components/custom/help_center/help_center_articlle-list.d.ts +7 -0
  30. package/dist/src/components/custom/help_center/help_center_categoryList.d.ts +6 -0
  31. package/dist/src/components/custom/help_center/help_center_dataStore.d.ts +4 -0
  32. package/dist/src/components/custom/help_center/help_center_layout.d.ts +3 -0
  33. package/dist/src/components/custom/help_center/help_center_seedData.d.ts +2 -0
  34. package/dist/src/components/custom/help_center/help_center_sub-category.d.ts +7 -0
  35. package/dist/src/components/custom/help_center/index.d.ts +1 -0
  36. package/dist/src/components/custom/help_center/types.d.ts +124 -0
  37. package/dist/src/components/editor/context.d.ts +4 -3
  38. package/dist/src/components/editor/editor.d.ts +2 -1
  39. package/dist/src/components/media/audio-player/progress-bar.d.ts +14 -0
  40. package/dist/src/components/surfaces/comment/comment.d.ts +2 -1
  41. package/dist/styles/output.css +1790 -0
  42. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ import { USER_ROLES, User } from './types';
2
+ declare const auth: {
3
+ isAuthenticated: () => boolean;
4
+ getUser: () => User | null;
5
+ hasPermission: (role: (typeof USER_ROLES)[keyof typeof USER_ROLES], permission: string) => boolean;
6
+ };
7
+ export default auth;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CustomModalProps } from './types';
3
+ declare const CustomModal: React.FC<CustomModalProps>;
4
+ export default CustomModal;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface DefaultArticlePageProps {
3
+ articleId: string;
4
+ title: string;
5
+ handleCreateCategory: (value: string) => void;
6
+ handleCreateArticle: () => void;
7
+ }
8
+ export declare const HowCanWeHelpPage: React.FC;
9
+ export declare const DefaultArticlePage: React.FC<DefaultArticlePageProps>;
10
+ interface DefaultSubcategoryPageProps {
11
+ categoryId: string;
12
+ subcategoryId: string;
13
+ }
14
+ export declare const DefaultSubcategoryPage: React.FC<DefaultSubcategoryPageProps>;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ArticleCategory } from './types';
3
+ interface EditArticleFormProps {
4
+ articleCategory: ArticleCategory;
5
+ }
6
+ declare const ArticleCategoryWithQA: React.FC<EditArticleFormProps>;
7
+ export default ArticleCategoryWithQA;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const MainPage: React.FC;
3
+ export default MainPage;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Sidebar: React.FC;
3
+ export default Sidebar;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Category, USER_ROLES } from './types';
3
+ interface HelpCenterProps {
4
+ initialData: {
5
+ categories: Category[];
6
+ userRole: (typeof USER_ROLES)[keyof typeof USER_ROLES];
7
+ };
8
+ onDataChange?: (data: {
9
+ categories: Category[];
10
+ }) => void;
11
+ }
12
+ export declare const HelpCenter: React.FC<HelpCenterProps>;
13
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface ArticleListProps {
3
+ categoryId: string;
4
+ subcategoryId: string;
5
+ }
6
+ declare const ArticleList: React.FC<ArticleListProps>;
7
+ export default ArticleList;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface CategoryListProps {
3
+ children: (categoryId: string, subcategoryId?: string) => React.ReactNode;
4
+ }
5
+ declare const CategoryList: React.FC<CategoryListProps>;
6
+ export default CategoryList;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { HelpCenterContextValue, HelpCenterProviderProps } from './types';
3
+ export declare const HelpCenterContext: React.Context<HelpCenterContextValue | undefined>;
4
+ export declare const HelpCenterProvider: React.FC<HelpCenterProviderProps>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const AppLayout: React.FC;
3
+ export default AppLayout;
@@ -0,0 +1,2 @@
1
+ import { Category } from './types';
2
+ export declare const categoriesInitialData: Category[];
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface SubCategoryListProps {
3
+ categoryId: string;
4
+ children: (subcategoryId: string) => React.ReactNode;
5
+ }
6
+ declare const SubCategoryList: React.FC<SubCategoryListProps>;
7
+ export default SubCategoryList;
@@ -0,0 +1 @@
1
+ export { HelpCenter } from './help_center';
@@ -0,0 +1,124 @@
1
+ /// <reference types="react" />
2
+ import { TElement } from '@udecode/plate';
3
+ import { IStyledComponent } from 'styled-components';
4
+ import { FastOmit } from 'styled-components/dist/types';
5
+ export interface Category {
6
+ id: string;
7
+ name: string;
8
+ subcategories: Subcategory[];
9
+ }
10
+ export interface Subcategory {
11
+ id: string;
12
+ name: string;
13
+ categoryId: string;
14
+ articles: Article[];
15
+ }
16
+ export interface WithPermissionProps {
17
+ role: (typeof USER_ROLES)[keyof typeof USER_ROLES];
18
+ permission: string;
19
+ }
20
+ export declare const USER_ROLES: {
21
+ readonly ADMIN: "admin";
22
+ readonly EDITOR: "editor";
23
+ readonly VIEWER: "viewer";
24
+ };
25
+ export interface User {
26
+ id: string;
27
+ email: string;
28
+ role: (typeof USER_ROLES)[keyof typeof USER_ROLES];
29
+ }
30
+ export interface Category {
31
+ id: string;
32
+ name: string;
33
+ subcategories: Subcategory[];
34
+ }
35
+ export declare enum DropdownOptions {
36
+ RENAME = "Rename",
37
+ CREATE_SUBCATEGORY = "Create Sub-Category",
38
+ DELETE_CATEGORY = "Remove the Category",
39
+ CREATE_ARTICLES = "Create Articles",
40
+ DELETE_SUBCATEGORY = "Remove"
41
+ }
42
+ export interface CustomModalProps {
43
+ title: string;
44
+ isOpen: boolean;
45
+ setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
46
+ initialValue?: string;
47
+ modalType: modalType;
48
+ submitButtonText?: string;
49
+ cancelButtonText?: string;
50
+ mainContent?: React.ReactNode;
51
+ headerContent?: React.ReactNode;
52
+ footerContent?: React.ReactNode;
53
+ onSubmit: (value: string) => void;
54
+ trigger: React.ReactNode;
55
+ }
56
+ export type modalType = 'create' | 'edit' | 'delete' | 'create-article-category' | 'edit-article' | 'edit-article-category' | 'delete-article-category' | 'edit-article-QA' | 'delete-article-QA' | 'articleQuestion';
57
+ export interface Subcategory {
58
+ id: string;
59
+ name: string;
60
+ categoryId: string;
61
+ articles: Article[];
62
+ }
63
+ export interface ArticleCategory {
64
+ id: string;
65
+ title?: string;
66
+ articleId: string;
67
+ description?: string;
68
+ questions?: ArticleQuestion[];
69
+ }
70
+ export interface ArticleQuestion {
71
+ id: string;
72
+ articleCategoryId: string;
73
+ question?: string;
74
+ answer?: TElement[];
75
+ }
76
+ export interface Article {
77
+ id: string;
78
+ title: string;
79
+ content: ArticleCategory[];
80
+ categoryId: string;
81
+ subcategoryId: string;
82
+ }
83
+ export interface HelpCenterContextValue {
84
+ categories: Category[];
85
+ isLoading: boolean;
86
+ selectedArticle: Article | null;
87
+ isNewArticle: boolean;
88
+ selectedSubcategory: Subcategory | null;
89
+ error: string | null;
90
+ userRole: (typeof USER_ROLES)[keyof typeof USER_ROLES];
91
+ breadcrumbTrail: string[];
92
+ setSelectedSubcategory: React.Dispatch<React.SetStateAction<Subcategory | null>>;
93
+ setSelectedArticle: React.Dispatch<React.SetStateAction<Article | null>>;
94
+ setIsNewArticle: React.Dispatch<React.SetStateAction<boolean>>;
95
+ setBreadcrumbTrail: React.Dispatch<React.SetStateAction<string[]>>;
96
+ addCategory: (name: string) => void;
97
+ updateCategory: (id: string, name: string) => void;
98
+ deleteCategory: (id: string) => void;
99
+ addSubcategory: (categoryId: string, name: string) => void;
100
+ addArticleCategory: (categoryId: string, subcategoryId: string, articleId: string, newCategory: Omit<ArticleCategory, 'id'>) => void;
101
+ deleteArticleQuestion: (categoryId: string, subcategoryId: string, articleId: string, articleCategoryId: string, questionId: string) => void;
102
+ deleteArticleCategory: (categoryId: string, subcategoryId: string, articleId: string, articleCategoryId: string) => void;
103
+ updateArticleCategory: (categoryId: string, subcategoryId: string, articleId: string, articleCategoryId: string, updatedCategoryName: string) => void;
104
+ addArticleQuestion: (categoryId: string, subcategoryId: string, articleId: string, articleCategoryId: string, newQuestion: Omit<ArticleQuestion, 'id'>) => void;
105
+ updateArticleQuestion: (categoryId: string, subcategoryId: string, articleId: string, articleCategoryId: string, articleQuestionId: string, updatedQuestion: Omit<ArticleQuestion, 'id'>) => void;
106
+ updateSubcategory: (categoryId: string, subcategoryId: string, name: string) => void;
107
+ deleteSubcategory: (categoryId: string, subcategoryId: string) => void;
108
+ addArticle: (categoryId: string, subcategoryId: string, title: string, content: ArticleCategory[]) => string;
109
+ updateArticle: (categoryId: string, subcategoryId: string, articleId: string, title: string, content: ArticleCategory[]) => void;
110
+ deleteArticle: (categoryId: string, subcategoryId: string, articleId: string) => void;
111
+ }
112
+ export interface HelpCenterProviderProps extends HelpCenterProps {
113
+ children: React.ReactNode;
114
+ }
115
+ export interface HelpCenterProps {
116
+ initialData: {
117
+ categories: Category[];
118
+ userRole: (typeof USER_ROLES)[keyof typeof USER_ROLES];
119
+ };
120
+ onDataChange?: (data: {
121
+ categories: Category[];
122
+ }) => void;
123
+ }
124
+ export type StyledType = IStyledComponent<'web', FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- export type TCustomFilter = 'MEETING_ANSWERS' | 'MY_ANSWERS' | 'ALL_ANSWERS';
3
2
  export interface CommentLoaderProps {
4
3
  questionAnswerId: string;
5
- filterType: TCustomFilter;
4
+ filterType: string;
5
+ resetFilter: () => void;
6
6
  waitToLoad: boolean;
7
7
  }
8
8
  export interface CommentInputProps {
@@ -10,7 +10,7 @@ export interface CommentInputProps {
10
10
  questionAnswerId: string;
11
11
  }
12
12
  export interface FilterComponentProps {
13
- filter: TCustomFilter;
13
+ filter: string;
14
14
  onFilterChange: (event: React.MouseEvent) => void;
15
15
  questionAnswerId: string;
16
16
  }
@@ -23,4 +23,5 @@ export declare const EditorContext: React.Context<{
23
23
  courseMediaId: number;
24
24
  }) => React.ReactElement;
25
25
  filterComponent?: React.ComponentType<FilterComponentProps> | undefined;
26
+ defaultFilter?: string | undefined;
26
27
  }>;
@@ -9,10 +9,11 @@ export interface EditorProps {
9
9
  imageSrcLoader: (id: number) => Promise<string>;
10
10
  onChange: (newNodes: TElement[]) => void;
11
11
  previousContent?: TElement[];
12
+ defaultFilter?: string;
12
13
  videoTitleLoader: (props: {
13
14
  courseMediaId: number;
14
15
  }) => React.ReactElement;
15
16
  filterComponent?: React.ComponentType<FilterComponentProps>;
16
17
  }
17
18
  export type EditorContent = TElement;
18
- export declare const Editor: ({ commentInputLoader, commentLoader, editable, handleVideoClick, imageSrcLoader, onChange, previousContent, videoTitleLoader, filterComponent, }: EditorProps) => React.JSX.Element;
19
+ export declare const Editor: ({ commentInputLoader, commentLoader, editable, handleVideoClick, imageSrcLoader, onChange, previousContent, defaultFilter, videoTitleLoader, filterComponent, }: EditorProps) => React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface AudioProgressBarProps {
3
+ /**
4
+ * @param duration the total duration of the audio media in seconds
5
+ * */
6
+ duration: number;
7
+ /**
8
+ * @param progress the amount of the audio media listened to
9
+ * */
10
+ progress: number;
11
+ onSeek: (percent: number) => void;
12
+ }
13
+ export declare const AudioProgressBar: ({ duration, progress, onSeek, }: AudioProgressBarProps) => React.JSX.Element;
14
+ export {};
@@ -20,5 +20,6 @@ export interface CommentProps {
20
20
  userName: string;
21
21
  userReactions?: string[];
22
22
  userProfileUri: string;
23
+ sx?: string;
23
24
  }
24
- export declare const Comment: ({ avatarTooltipContent, avatarTooltipSx, content, createdDate, hasMoreReplies, id, onComment, onReact, onShowReplies, dropdown, reactionModal, reactions, replies, userImageUri, userName, userReactions, visibilityIcon, customPlaceHolder, userProfileUri, }: CommentProps) => React.JSX.Element;
25
+ export declare const Comment: ({ avatarTooltipContent, avatarTooltipSx, content, createdDate, hasMoreReplies, id, onComment, onReact, onShowReplies, dropdown, reactionModal, reactions, replies, userImageUri, userName, userReactions, visibilityIcon, customPlaceHolder, userProfileUri, sx, }: CommentProps) => React.JSX.Element;