@selfcommunity/react-core 0.4.9-alpha.43 → 0.4.9-alpha.44

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 (38) hide show
  1. package/lib/cjs/components/provider/SCContextProvider/index.d.ts +2 -3
  2. package/lib/cjs/components/provider/SCContextProvider/index.js +2 -3
  3. package/lib/cjs/hooks/useSCFetchCommentObject.d.ts +2 -3
  4. package/lib/cjs/hooks/useSCFetchCommentObject.js +2 -3
  5. package/lib/cjs/hooks/useSCFetchCommentObjects.d.ts +1 -7
  6. package/lib/cjs/hooks/useSCFetchCommentObjects.js +1 -8
  7. package/lib/cjs/hooks/useSCFetchContributors.d.ts +1 -5
  8. package/lib/cjs/hooks/useSCFetchContributors.js +1 -5
  9. package/lib/cjs/hooks/useSCFetchCustomAdv.d.ts +3 -3
  10. package/lib/cjs/hooks/useSCFetchCustomAdv.js +3 -3
  11. package/lib/cjs/hooks/useSCFetchFeed.d.ts +1 -5
  12. package/lib/cjs/hooks/useSCFetchFeed.js +1 -5
  13. package/lib/cjs/hooks/useSCFetchUser.d.ts +2 -3
  14. package/lib/cjs/hooks/useSCFetchUser.js +2 -3
  15. package/lib/cjs/hooks/useSCFetchUserBlockedBy.d.ts +1 -0
  16. package/lib/cjs/hooks/useSCFetchUserBlockedBy.js +1 -0
  17. package/lib/cjs/hooks/useSCFetchUserProviders.d.ts +2 -3
  18. package/lib/cjs/hooks/useSCFetchUserProviders.js +2 -3
  19. package/lib/esm/components/provider/SCContextProvider/index.d.ts +2 -3
  20. package/lib/esm/components/provider/SCContextProvider/index.js +2 -3
  21. package/lib/esm/hooks/useSCFetchCommentObject.d.ts +2 -3
  22. package/lib/esm/hooks/useSCFetchCommentObject.js +2 -3
  23. package/lib/esm/hooks/useSCFetchCommentObjects.d.ts +1 -7
  24. package/lib/esm/hooks/useSCFetchCommentObjects.js +1 -8
  25. package/lib/esm/hooks/useSCFetchContributors.d.ts +1 -5
  26. package/lib/esm/hooks/useSCFetchContributors.js +1 -5
  27. package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +3 -3
  28. package/lib/esm/hooks/useSCFetchCustomAdv.js +3 -3
  29. package/lib/esm/hooks/useSCFetchFeed.d.ts +1 -5
  30. package/lib/esm/hooks/useSCFetchFeed.js +1 -5
  31. package/lib/esm/hooks/useSCFetchUser.d.ts +2 -3
  32. package/lib/esm/hooks/useSCFetchUser.js +2 -3
  33. package/lib/esm/hooks/useSCFetchUserBlockedBy.d.ts +1 -0
  34. package/lib/esm/hooks/useSCFetchUserBlockedBy.js +1 -0
  35. package/lib/esm/hooks/useSCFetchUserProviders.d.ts +2 -3
  36. package/lib/esm/hooks/useSCFetchUserProviders.js +2 -3
  37. package/lib/umd/react-core.js +1 -1
  38. package/package.json +3 -3
@@ -18,9 +18,8 @@ import { SCContextProviderType, SCContextType } from '../../../types';
18
18
  export declare const SCContext: React.Context<SCContextType>;
19
19
  /**
20
20
  * This component imports all providers
21
- * @param object
22
- * @param object.conf
23
- * @param object.children
21
+ * @param conf
22
+ * @param children
24
23
  * @return
25
24
  * ```jsx
26
25
  * <SCContext.Provider value={{settings}}>
@@ -25,9 +25,8 @@ const useIsComponentMountedRef_1 = tslib_1.__importDefault(require("../../../uti
25
25
  exports.SCContext = (0, react_1.createContext)({});
26
26
  /**
27
27
  * This component imports all providers
28
- * @param object
29
- * @param object.conf
30
- * @param object.children
28
+ * @param conf
29
+ * @param children
31
30
  * @return
32
31
  * ```jsx
33
32
  * <SCContext.Provider value={{settings}}>
@@ -5,9 +5,8 @@ import { CacheStrategies } from '@selfcommunity/utils';
5
5
  :::info
6
6
  This custom hooks is used to fetch a comment.
7
7
  :::
8
- * @param object
9
- * @param object.id
10
- * @param object.commentObject
8
+ * @param id
9
+ * @param commentObject
11
10
  * @param cacheStrategy
12
11
  */
13
12
  export default function useSCFetchCommentObject({ id, commentObject, cacheStrategy, }: {
@@ -10,9 +10,8 @@ const use_deep_compare_effect_1 = require("use-deep-compare-effect");
10
10
  :::info
11
11
  This custom hooks is used to fetch a comment.
12
12
  :::
13
- * @param object
14
- * @param object.id
15
- * @param object.commentObject
13
+ * @param id
14
+ * @param commentObject
16
15
  * @param cacheStrategy
17
16
  */
18
17
  function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
@@ -34,13 +34,7 @@ export declare const commentsObjectActionTypes: {
34
34
  :::info
35
35
  This custom hooks is used to fetch paginated comments.
36
36
  :::
37
- * @param id
38
- * @param feedObject
39
- * @param feedObjectType
40
- * @param offset
41
- * @param pageSize
42
- * @param orderBy
43
- * @param parent
37
+ * @param props
44
38
  */
45
39
  export default function useSCFetchCommentObjects(props: {
46
40
  id?: number;
@@ -98,20 +98,13 @@ function stateInitializer(data) {
98
98
  :::info
99
99
  This custom hooks is used to fetch paginated comments.
100
100
  :::
101
- * @param id
102
- * @param feedObject
103
- * @param feedObjectType
104
- * @param offset
105
- * @param pageSize
106
- * @param orderBy
107
- * @param parent
101
+ * @param props
108
102
  */
109
103
  function useSCFetchCommentObjects(props) {
110
104
  // PROPS
111
105
  const { id, feedObject, feedObjectType, offset = 0, pageSize = 5, orderBy = types_1.SCCommentsOrderBy.ADDED_AT_DESC, parent, onChangePage, cacheStrategy = utils_1.CacheStrategies.NETWORK_ONLY, } = props;
112
106
  // FeedObject
113
107
  const { obj, setObj } = (0, useSCFetchFeedObject_1.default)({ id, feedObject, feedObjectType, cacheStrategy });
114
- const objId = obj ? obj.id : null;
115
108
  /**
116
109
  * Get next url
117
110
  */
@@ -33,11 +33,7 @@ export declare const contributorsObjectActionTypes: {
33
33
  :::info
34
34
  This custom hooks is used to fetch paginated contributors.
35
35
  :::
36
- * @param id
37
- * @param feedObject
38
- * @param feedObjectType
39
- * @param offset
40
- * @param pageSize
36
+ * @param props
41
37
  */
42
38
  export default function useSCFetchContributors(props: {
43
39
  id?: number;
@@ -76,11 +76,7 @@ function stateInitializer(data) {
76
76
  :::info
77
77
  This custom hooks is used to fetch paginated contributors.
78
78
  :::
79
- * @param id
80
- * @param feedObject
81
- * @param feedObjectType
82
- * @param offset
83
- * @param pageSize
79
+ * @param props
84
80
  */
85
81
  function useSCFetchContributors(props) {
86
82
  // PROPS
@@ -5,9 +5,9 @@ import { SCCustomAdvPosition, SCCustomAdvType } from '@selfcommunity/types';
5
5
  :::info
6
6
  This custom hook is used to fetch a custom adv object.
7
7
  :::
8
- * @param object
9
- * @param object.position
10
- * @param object.categoryId
8
+ * @param id
9
+ * @param position
10
+ * @param categoriesId
11
11
  * @param cacheStrategy
12
12
  */
13
13
  export default function useSCFetchCustomAdv({ id, position, categoriesId, cacheStrategy, }: {
@@ -11,9 +11,9 @@ const Cache_1 = require("../constants/Cache");
11
11
  :::info
12
12
  This custom hook is used to fetch a custom adv object.
13
13
  :::
14
- * @param object
15
- * @param object.position
16
- * @param object.categoryId
14
+ * @param id
15
+ * @param position
16
+ * @param categoriesId
17
17
  * @param cacheStrategy
18
18
  */
19
19
  function useSCFetchCustomAdv({ id = null, position = null, categoriesId = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
@@ -38,11 +38,7 @@ export declare const feedDataActionTypes: {
38
38
  :::info
39
39
  This custom hooks is used to fetch paginated Data.
40
40
  :::
41
- * @param endpoint
42
- * @param offset
43
- * @param pageSize
44
- * @param onChangePage
45
- * @param cacheStrategy
41
+ * @param props
46
42
  */
47
43
  export default function useSCFetchFeed(props: {
48
44
  id: string;
@@ -90,11 +90,7 @@ function stateInitializer(data) {
90
90
  :::info
91
91
  This custom hooks is used to fetch paginated Data.
92
92
  :::
93
- * @param endpoint
94
- * @param offset
95
- * @param pageSize
96
- * @param onChangePage
97
- * @param cacheStrategy
93
+ * @param props
98
94
  */
99
95
  function useSCFetchFeed(props) {
100
96
  // PROPS
@@ -4,9 +4,8 @@ import { SCUserType } from '@selfcommunity/types';
4
4
  :::info
5
5
  This custom hook is used to fetch a user object.
6
6
  :::
7
- * @param object
8
- * @param object.id
9
- * @param object.user
7
+ * @param id
8
+ * @param user
10
9
  */
11
10
  export default function useSCFetchUser({ id, user }: {
12
11
  id?: number | string;
@@ -9,9 +9,8 @@ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
9
9
  :::info
10
10
  This custom hook is used to fetch a user object.
11
11
  :::
12
- * @param object
13
- * @param object.id
14
- * @param object.user
12
+ * @param id
13
+ * @param user
15
14
  */
16
15
  function useSCFetchUser({ id = null, user = null }) {
17
16
  // CONTEXT
@@ -5,6 +5,7 @@ import { SCUserType } from '@selfcommunity/types';
5
5
  :::
6
6
  * @param user
7
7
  * @param blockedByUser
8
+ * @param sync
8
9
  */
9
10
  export default function useSCFetchUserBlockedBy({ user, blockedByUser, sync, }: {
10
11
  user: SCUserType;
@@ -11,6 +11,7 @@ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
11
11
  :::
12
12
  * @param user
13
13
  * @param blockedByUser
14
+ * @param sync
14
15
  */
15
16
  function useSCFetchUserBlockedBy({ user = null, blockedByUser = null, sync = true, }) {
16
17
  const [blockedBy, setBlockedBy] = (0, react_1.useState)(null);
@@ -4,9 +4,8 @@ import { SCUserProviderAssociationType } from '@selfcommunity/types';
4
4
  :::info
5
5
  This custom hook is used to fetch the listo of user providers.
6
6
  :::
7
- * @param object
8
- * @param object.id
9
- * @param object.user
7
+ * @param id
8
+ * @param providers
10
9
  */
11
10
  export default function useSCFetchUserProviders({ id, providers }: {
12
11
  id: number | string;
@@ -8,9 +8,8 @@ const utils_1 = require("@selfcommunity/utils");
8
8
  :::info
9
9
  This custom hook is used to fetch the listo of user providers.
10
10
  :::
11
- * @param object
12
- * @param object.id
13
- * @param object.user
11
+ * @param id
12
+ * @param providers
14
13
  */
15
14
  function useSCFetchUserProviders({ id, providers = null }) {
16
15
  const [scUserProviders, setSCUserProviders] = (0, react_1.useState)(providers || []);
@@ -18,9 +18,8 @@ import { SCContextProviderType, SCContextType } from '../../../types';
18
18
  export declare const SCContext: React.Context<SCContextType>;
19
19
  /**
20
20
  * This component imports all providers
21
- * @param object
22
- * @param object.conf
23
- * @param object.children
21
+ * @param conf
22
+ * @param children
24
23
  * @return
25
24
  * ```jsx
26
25
  * <SCContext.Provider value={{settings}}>
@@ -21,9 +21,8 @@ import useIsComponentMountedRef from '../../../utils/hooks/useIsComponentMounted
21
21
  export const SCContext = createContext({});
22
22
  /**
23
23
  * This component imports all providers
24
- * @param object
25
- * @param object.conf
26
- * @param object.children
24
+ * @param conf
25
+ * @param children
27
26
  * @return
28
27
  * ```jsx
29
28
  * <SCContext.Provider value={{settings}}>
@@ -5,9 +5,8 @@ import { CacheStrategies } from '@selfcommunity/utils';
5
5
  :::info
6
6
  This custom hooks is used to fetch a comment.
7
7
  :::
8
- * @param object
9
- * @param object.id
10
- * @param object.commentObject
8
+ * @param id
9
+ * @param commentObject
11
10
  * @param cacheStrategy
12
11
  */
13
12
  export default function useSCFetchCommentObject({ id, commentObject, cacheStrategy, }: {
@@ -8,9 +8,8 @@ import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
8
8
  :::info
9
9
  This custom hooks is used to fetch a comment.
10
10
  :::
11
- * @param object
12
- * @param object.id
13
- * @param object.commentObject
11
+ * @param id
12
+ * @param commentObject
14
13
  * @param cacheStrategy
15
14
  */
16
15
  export default function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
@@ -34,13 +34,7 @@ export declare const commentsObjectActionTypes: {
34
34
  :::info
35
35
  This custom hooks is used to fetch paginated comments.
36
36
  :::
37
- * @param id
38
- * @param feedObject
39
- * @param feedObjectType
40
- * @param offset
41
- * @param pageSize
42
- * @param orderBy
43
- * @param parent
37
+ * @param props
44
38
  */
45
39
  export default function useSCFetchCommentObjects(props: {
46
40
  id?: number;
@@ -94,20 +94,13 @@ function stateInitializer(data) {
94
94
  :::info
95
95
  This custom hooks is used to fetch paginated comments.
96
96
  :::
97
- * @param id
98
- * @param feedObject
99
- * @param feedObjectType
100
- * @param offset
101
- * @param pageSize
102
- * @param orderBy
103
- * @param parent
97
+ * @param props
104
98
  */
105
99
  export default function useSCFetchCommentObjects(props) {
106
100
  // PROPS
107
101
  const { id, feedObject, feedObjectType, offset = 0, pageSize = 5, orderBy = SCCommentsOrderBy.ADDED_AT_DESC, parent, onChangePage, cacheStrategy = CacheStrategies.NETWORK_ONLY, } = props;
108
102
  // FeedObject
109
103
  const { obj, setObj } = useSCFetchFeedObject({ id, feedObject, feedObjectType, cacheStrategy });
110
- const objId = obj ? obj.id : null;
111
104
  /**
112
105
  * Get next url
113
106
  */
@@ -33,11 +33,7 @@ export declare const contributorsObjectActionTypes: {
33
33
  :::info
34
34
  This custom hooks is used to fetch paginated contributors.
35
35
  :::
36
- * @param id
37
- * @param feedObject
38
- * @param feedObjectType
39
- * @param offset
40
- * @param pageSize
36
+ * @param props
41
37
  */
42
38
  export default function useSCFetchContributors(props: {
43
39
  id?: number;
@@ -72,11 +72,7 @@ function stateInitializer(data) {
72
72
  :::info
73
73
  This custom hooks is used to fetch paginated contributors.
74
74
  :::
75
- * @param id
76
- * @param feedObject
77
- * @param feedObjectType
78
- * @param offset
79
- * @param pageSize
75
+ * @param props
80
76
  */
81
77
  export default function useSCFetchContributors(props) {
82
78
  // PROPS
@@ -5,9 +5,9 @@ import { SCCustomAdvPosition, SCCustomAdvType } from '@selfcommunity/types';
5
5
  :::info
6
6
  This custom hook is used to fetch a custom adv object.
7
7
  :::
8
- * @param object
9
- * @param object.position
10
- * @param object.categoryId
8
+ * @param id
9
+ * @param position
10
+ * @param categoriesId
11
11
  * @param cacheStrategy
12
12
  */
13
13
  export default function useSCFetchCustomAdv({ id, position, categoriesId, cacheStrategy, }: {
@@ -8,9 +8,9 @@ import { getAdvObjectCacheKey } from '../constants/Cache';
8
8
  :::info
9
9
  This custom hook is used to fetch a custom adv object.
10
10
  :::
11
- * @param object
12
- * @param object.position
13
- * @param object.categoryId
11
+ * @param id
12
+ * @param position
13
+ * @param categoriesId
14
14
  * @param cacheStrategy
15
15
  */
16
16
  export default function useSCFetchCustomAdv({ id = null, position = null, categoriesId = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
@@ -38,11 +38,7 @@ export declare const feedDataActionTypes: {
38
38
  :::info
39
39
  This custom hooks is used to fetch paginated Data.
40
40
  :::
41
- * @param endpoint
42
- * @param offset
43
- * @param pageSize
44
- * @param onChangePage
45
- * @param cacheStrategy
41
+ * @param props
46
42
  */
47
43
  export default function useSCFetchFeed(props: {
48
44
  id: string;
@@ -86,11 +86,7 @@ function stateInitializer(data) {
86
86
  :::info
87
87
  This custom hooks is used to fetch paginated Data.
88
88
  :::
89
- * @param endpoint
90
- * @param offset
91
- * @param pageSize
92
- * @param onChangePage
93
- * @param cacheStrategy
89
+ * @param props
94
90
  */
95
91
  export default function useSCFetchFeed(props) {
96
92
  // PROPS
@@ -4,9 +4,8 @@ import { SCUserType } from '@selfcommunity/types';
4
4
  :::info
5
5
  This custom hook is used to fetch a user object.
6
6
  :::
7
- * @param object
8
- * @param object.id
9
- * @param object.user
7
+ * @param id
8
+ * @param user
10
9
  */
11
10
  export default function useSCFetchUser({ id, user }: {
12
11
  id?: number | string;
@@ -7,9 +7,8 @@ import { useSCUser } from '../components/provider/SCUserProvider';
7
7
  :::info
8
8
  This custom hook is used to fetch a user object.
9
9
  :::
10
- * @param object
11
- * @param object.id
12
- * @param object.user
10
+ * @param id
11
+ * @param user
13
12
  */
14
13
  export default function useSCFetchUser({ id = null, user = null }) {
15
14
  // CONTEXT
@@ -5,6 +5,7 @@ import { SCUserType } from '@selfcommunity/types';
5
5
  :::
6
6
  * @param user
7
7
  * @param blockedByUser
8
+ * @param sync
8
9
  */
9
10
  export default function useSCFetchUserBlockedBy({ user, blockedByUser, sync, }: {
10
11
  user: SCUserType;
@@ -9,6 +9,7 @@ import { useSCUser } from '../components/provider/SCUserProvider';
9
9
  :::
10
10
  * @param user
11
11
  * @param blockedByUser
12
+ * @param sync
12
13
  */
13
14
  export default function useSCFetchUserBlockedBy({ user = null, blockedByUser = null, sync = true, }) {
14
15
  const [blockedBy, setBlockedBy] = useState(null);
@@ -4,9 +4,8 @@ import { SCUserProviderAssociationType } from '@selfcommunity/types';
4
4
  :::info
5
5
  This custom hook is used to fetch the listo of user providers.
6
6
  :::
7
- * @param object
8
- * @param object.id
9
- * @param object.user
7
+ * @param id
8
+ * @param providers
10
9
  */
11
10
  export default function useSCFetchUserProviders({ id, providers }: {
12
11
  id: number | string;
@@ -6,9 +6,8 @@ import { Logger } from '@selfcommunity/utils';
6
6
  :::info
7
7
  This custom hook is used to fetch the listo of user providers.
8
8
  :::
9
- * @param object
10
- * @param object.id
11
- * @param object.user
9
+ * @param id
10
+ * @param providers
12
11
  */
13
12
  export default function useSCFetchUserProviders({ id, providers = null }) {
14
13
  const [scUserProviders, setSCUserProviders] = useState(providers || []);