@edifice.io/react 2.5.5-develop-b2school.20260106144020 → 2.5.5-develop-b2school.20260107142656
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ID, PutShareResponse, RightStringified, ShareRight, ShareRightActionDisplayName, ShareUrls } from '@edifice.io/client';
|
|
1
|
+
import { ID, PutShareResponse, RightStringified, ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareUrls } from '@edifice.io/client';
|
|
2
2
|
import { UseMutationResult } from '../../../node_modules/@tanstack/react-query';
|
|
3
3
|
/**
|
|
4
4
|
* Configuration options for sharing a resource
|
|
@@ -22,6 +22,12 @@ import { UseMutationResult } from '../../../node_modules/@tanstack/react-query';
|
|
|
22
22
|
* resourceRights: [],
|
|
23
23
|
* resourceCreatorId: 'user-67890',
|
|
24
24
|
* filteredActions: ['read', 'contrib'],
|
|
25
|
+
* defaultActions: [
|
|
26
|
+
* {
|
|
27
|
+
* id: 'read',
|
|
28
|
+
* displayName: 'read',
|
|
29
|
+
* },
|
|
30
|
+
* ],
|
|
25
31
|
* shareUrls: {
|
|
26
32
|
* getResourceRights: '/api/V1/thread/shares', (get endpoint)
|
|
27
33
|
* saveResourceRights: '/api/V1/thread/shares', (put endpoint)
|
|
@@ -37,6 +43,12 @@ import { UseMutationResult } from '../../../node_modules/@tanstack/react-query';
|
|
|
37
43
|
* resourceRights: [],
|
|
38
44
|
* resourceCreatorId: 'user-67890',
|
|
39
45
|
* filteredActions: ['read', 'contrib'],
|
|
46
|
+
* defaultActions: [
|
|
47
|
+
* {
|
|
48
|
+
* id: 'read',
|
|
49
|
+
* displayName: 'read',
|
|
50
|
+
* },
|
|
51
|
+
* ],
|
|
40
52
|
* shareUrls: {
|
|
41
53
|
* getResourceRights: '/api/V1/info/shares', (get endpoint)
|
|
42
54
|
* saveResourceRights: '/api/V1/info/shares', (put endpoint)
|
|
@@ -51,6 +63,7 @@ export type ShareOptions = {
|
|
|
51
63
|
resourceCreatorId: string;
|
|
52
64
|
filteredActions?: ShareRightActionDisplayName[];
|
|
53
65
|
shareUrls?: ShareUrls;
|
|
66
|
+
defaultActions?: ShareRightAction[];
|
|
54
67
|
};
|
|
55
68
|
/**
|
|
56
69
|
* React Query mutation result for share operations
|
|
@@ -33,7 +33,14 @@ const ShareResources = /* @__PURE__ */ forwardRef(({
|
|
|
33
33
|
resourceCreatorId,
|
|
34
34
|
resourceRights,
|
|
35
35
|
filteredActions,
|
|
36
|
-
shareUrls
|
|
36
|
+
shareUrls,
|
|
37
|
+
defaultActions = [{
|
|
38
|
+
id: "read",
|
|
39
|
+
displayName: "read"
|
|
40
|
+
}, {
|
|
41
|
+
id: "comment",
|
|
42
|
+
displayName: "comment"
|
|
43
|
+
}]
|
|
37
44
|
} = shareOptions, [isLoading, setIsLoading] = useState(!0), [isSavingBookmark, setIsSavingBookmark] = useState(!1), {
|
|
38
45
|
state: {
|
|
39
46
|
isSharing,
|
|
@@ -72,7 +79,8 @@ const ShareResources = /* @__PURE__ */ forwardRef(({
|
|
|
72
79
|
resourceCreatorId,
|
|
73
80
|
shareRights,
|
|
74
81
|
shareDispatch,
|
|
75
|
-
urlResourceRights: shareUrls == null ? void 0 : shareUrls.getResourceRights
|
|
82
|
+
urlResourceRights: shareUrls == null ? void 0 : shareUrls.getResourceRights,
|
|
83
|
+
defaultActions
|
|
76
84
|
}), {
|
|
77
85
|
refBookmark,
|
|
78
86
|
showBookmark,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ChangeEvent, Dispatch } from 'react';
|
|
2
|
-
import { ShareRightWithVisibles, ShareSubject } from '@edifice.io/client';
|
|
2
|
+
import { ShareRightAction, ShareRightWithVisibles, ShareSubject } from '@edifice.io/client';
|
|
3
3
|
import { OptionListItemType } from '../../../../components';
|
|
4
|
-
import { ShareOptions } from '../
|
|
4
|
+
import { ShareOptions } from '../ShareResources';
|
|
5
5
|
import { ShareAction } from './useShare';
|
|
6
|
-
export declare const useSearch: ({ resourceId, resourceCreatorId, shareRights, shareDispatch, urlResourceRights, }: {
|
|
6
|
+
export declare const useSearch: ({ resourceId, resourceCreatorId, shareRights, shareDispatch, urlResourceRights, defaultActions, }: {
|
|
7
7
|
resourceId: ShareOptions["resourceCreatorId"];
|
|
8
8
|
resourceCreatorId: ShareOptions["resourceCreatorId"];
|
|
9
9
|
shareRights: ShareRightWithVisibles;
|
|
10
10
|
shareDispatch: Dispatch<ShareAction>;
|
|
11
11
|
urlResourceRights?: string;
|
|
12
|
+
defaultActions?: ShareRightAction[];
|
|
12
13
|
}) => {
|
|
13
14
|
state: {
|
|
14
15
|
searchInputValue: string;
|
|
@@ -48,18 +48,19 @@ function reducer(state, action) {
|
|
|
48
48
|
throw new Error("Unhandled action type");
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
id: "read",
|
|
53
|
-
displayName: "read"
|
|
54
|
-
}, {
|
|
55
|
-
id: "comment",
|
|
56
|
-
displayName: "comment"
|
|
57
|
-
}], useSearch = ({
|
|
51
|
+
const useSearch = ({
|
|
58
52
|
resourceId,
|
|
59
53
|
resourceCreatorId,
|
|
60
54
|
shareRights,
|
|
61
55
|
shareDispatch,
|
|
62
|
-
urlResourceRights
|
|
56
|
+
urlResourceRights,
|
|
57
|
+
defaultActions = [{
|
|
58
|
+
id: "read",
|
|
59
|
+
displayName: "read"
|
|
60
|
+
}, {
|
|
61
|
+
id: "comment",
|
|
62
|
+
displayName: "comment"
|
|
63
|
+
}]
|
|
63
64
|
}) => {
|
|
64
65
|
const [state, dispatch] = useReducer(reducer, initialState), debouncedSearchInputValue = useDebounce(state.searchInputValue, 500), {
|
|
65
66
|
isAdml
|
|
@@ -152,13 +153,7 @@ const defaultActions = [{
|
|
|
152
153
|
} else
|
|
153
154
|
rightsToAdd = [{
|
|
154
155
|
...shareSubject,
|
|
155
|
-
actions:
|
|
156
|
-
id: "read",
|
|
157
|
-
displayName: "read"
|
|
158
|
-
}, {
|
|
159
|
-
id: "comment",
|
|
160
|
-
displayName: "comment"
|
|
161
|
-
}]
|
|
156
|
+
actions: defaultActions
|
|
162
157
|
}];
|
|
163
158
|
shareDispatch({
|
|
164
159
|
type: "updateShareRights",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.5.5-develop-b2school.
|
|
3
|
+
"version": "2.5.5-develop-b2school.20260107142656",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
"react-slugify": "^3.0.3",
|
|
134
134
|
"swiper": "^10.1.0",
|
|
135
135
|
"ua-parser-js": "^1.0.36",
|
|
136
|
-
"@edifice.io/bootstrap": "2.5.5-develop-b2school.
|
|
137
|
-
"@edifice.io/
|
|
138
|
-
"@edifice.io/
|
|
136
|
+
"@edifice.io/bootstrap": "2.5.5-develop-b2school.20260107142656",
|
|
137
|
+
"@edifice.io/utilities": "2.5.5-develop-b2school.20260107142656",
|
|
138
|
+
"@edifice.io/tiptap-extensions": "2.5.5-develop-b2school.20260107142656"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"vite": "^5.4.11",
|
|
167
167
|
"vite-plugin-dts": "^4.1.0",
|
|
168
168
|
"vite-tsconfig-paths": "^5.0.1",
|
|
169
|
-
"@edifice.io/client": "2.5.5-develop-b2school.
|
|
170
|
-
"@edifice.io/config": "2.5.5-develop-b2school.
|
|
169
|
+
"@edifice.io/client": "2.5.5-develop-b2school.20260107142656",
|
|
170
|
+
"@edifice.io/config": "2.5.5-develop-b2school.20260107142656"
|
|
171
171
|
},
|
|
172
172
|
"peerDependencies": {
|
|
173
173
|
"@react-spring/web": "^9.7.5",
|