@edifice.io/react 2.5.5-develop-b2school.20251229113453 → 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.
- package/dist/components/Combobox/Combobox.js +1 -1
- package/dist/components/Combobox/ComboboxTrigger.js +1 -1
- package/dist/modules/editor/components/Editor/Editor.js +1 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.js +2 -2
- package/dist/modules/modals/ShareModal/ShareBookmarkLine.js +4 -4
- package/dist/modules/modals/ShareModal/ShareResources.d.ts +14 -1
- package/dist/modules/modals/ShareModal/ShareResources.js +11 -3
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +4 -3
- package/dist/modules/modals/ShareModal/hooks/useSearch.js +10 -15
- package/package.json +6 -6
|
@@ -51,7 +51,7 @@ const ComboboxComponent = /* @__PURE__ */ forwardRef(({
|
|
|
51
51
|
/* @__PURE__ */ jsx(Combobox.Trigger, { placeholder, searchMinLength, handleSearchInputChange: onSearchInputChange, handleSearchInputKeyUp: (event) => {
|
|
52
52
|
onSearchInputKeyUp == null || onSearchInputKeyUp(event);
|
|
53
53
|
}, value, variant, renderInputGroup, renderSelectedItems, hasDefault: !!options.length, onFocus, onBlur, inputRef }),
|
|
54
|
-
/* @__PURE__ */ jsx(Dropdown.Menu, { children: renderContent() })
|
|
54
|
+
/* @__PURE__ */ jsx(Dropdown.Menu, { "data-testid": "combobox-search-menu", children: renderContent() })
|
|
55
55
|
] });
|
|
56
56
|
}), Combobox = /* @__PURE__ */ Object.assign(ComboboxComponent, {
|
|
57
57
|
Trigger: ComboboxTrigger
|
|
@@ -48,7 +48,7 @@ const ComboboxTrigger = ({
|
|
|
48
48
|
!!renderInputGroup && /* @__PURE__ */ jsx("label", { className: "input-group-text pe-0" + classNameVariant, htmlFor: triggerProps.id, children: renderInputGroup }),
|
|
49
49
|
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center flex-wrap flex-fill", children: [
|
|
50
50
|
renderSelectedItems,
|
|
51
|
-
/* @__PURE__ */ jsx(Input, { ...inputProps, className: classNameInput, onFocus, onBlur, noValidationIcon: !0, placeholder, size: "md", type: "search", onKeyDown: itemProps.onMenuItemKeyDown })
|
|
51
|
+
/* @__PURE__ */ jsx(Input, { "data-testid": "combobox-search-input", ...inputProps, className: classNameInput, onFocus, onBlur, noValidationIcon: !0, placeholder, size: "md", type: "search", onKeyDown: itemProps.onMenuItemKeyDown })
|
|
52
52
|
] })
|
|
53
53
|
] });
|
|
54
54
|
};
|
|
@@ -78,7 +78,7 @@ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/
|
|
|
78
78
|
/* @__PURE__ */ jsxs("div", { className: borderClass, children: [
|
|
79
79
|
toolbar !== "none" && editable && /* @__PURE__ */ jsx(EditorToolbar, { mediaLibraryRef: mediaLibraryModalRef, toggleMathsModal, cantooEditor: contooEditor }),
|
|
80
80
|
/* @__PURE__ */ jsxs(Flex, { direction: "row", children: [
|
|
81
|
-
/* @__PURE__ */ jsx(EditorContent, { id: id ?? editorId, editor, className: contentClass, style: {
|
|
81
|
+
/* @__PURE__ */ jsx(EditorContent, { "data-testid": "editor-content", id: id ?? editorId, editor, className: contentClass, style: {
|
|
82
82
|
flex: 1
|
|
83
83
|
} }),
|
|
84
84
|
editable && contooEditor.openPositionAdaptText.right && /* @__PURE__ */ jsx(CantooAdaptTextBoxView, { openPosition: contooEditor.openPositionAdaptText })
|
|
@@ -16,8 +16,8 @@ const ShareBookmark = ({
|
|
|
16
16
|
setIsSaving(!0), await onSave(), setIsSaving(!1);
|
|
17
17
|
};
|
|
18
18
|
return /* @__PURE__ */ jsx("div", { className: "mt-16", children: /* @__PURE__ */ jsxs(FormControl, { id: "bookmarkName", className: "d-flex flex-wrap align-items-center gap-16", children: [
|
|
19
|
-
/* @__PURE__ */ jsx("div", { className: "flex-fill", children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refBookmark, onChange: onBookmarkChange, placeholder: t("explorer.modal.share.sharebookmark.placeholder"), size: "sm", type: "text" }, bookmark.id) }),
|
|
20
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0 || isSaving, leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), onClick: handleSaveClick, className: "text-nowrap", isLoading: isSaving, children: t("explorer.modal.share.sharebookmark.save") })
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "flex-fill", children: /* @__PURE__ */ jsx(FormControl.Input, { "data-testid": "share-bookmark-name-input", ref: refBookmark, onChange: onBookmarkChange, placeholder: t("explorer.modal.share.sharebookmark.placeholder"), size: "sm", type: "text" }, bookmark.id) }),
|
|
20
|
+
/* @__PURE__ */ jsx(Button, { "data-testid": "share-bookmark-save-button", type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0 || isSaving, leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), onClick: handleSaveClick, className: "text-nowrap", isLoading: isSaving, children: t("explorer.modal.share.sharebookmark.save") })
|
|
21
21
|
] }) });
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
@@ -4,10 +4,10 @@ import SvgIconBookmark from "../../icons/components/IconBookmark.js";
|
|
|
4
4
|
import SvgIconClose from "../../icons/components/IconClose.js";
|
|
5
5
|
import SvgIconRafterDown from "../../icons/components/IconRafterDown.js";
|
|
6
6
|
import SvgIconUsers from "../../icons/components/IconUsers.js";
|
|
7
|
-
import { hasRight } from "./utils/hasRight.js";
|
|
8
|
-
import { showShareRightLine } from "./utils/showShareRightLine.js";
|
|
9
7
|
import { useShareRightDisabled } from "./hooks/useShareRightDisabled.js";
|
|
10
8
|
import { useShareRightVisible } from "./hooks/useShareRightVisible.js";
|
|
9
|
+
import { hasRight } from "./utils/hasRight.js";
|
|
10
|
+
import { showShareRightLine } from "./utils/showShareRightLine.js";
|
|
11
11
|
import Avatar from "../../../components/Avatar/Avatar.js";
|
|
12
12
|
import Button from "../../../components/Button/Button.js";
|
|
13
13
|
import Checkbox from "../../../components/Checkbox/Checkbox.js";
|
|
@@ -45,8 +45,8 @@ const ShareBookmarkLine = ({
|
|
|
45
45
|
] }) }),
|
|
46
46
|
shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("td", { style: {
|
|
47
47
|
width: "80px"
|
|
48
|
-
}, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: hasRight(shareRight, shareRightAction), onChange: () => toggleRight(shareRight, shareRightAction.id), disabled: isDisabled }) }, shareRightAction.displayName)),
|
|
49
|
-
/* @__PURE__ */ jsx("td", { children: !shareRight.isBookmarkMember && !isDisabled && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("close"), color: "tertiary", icon: /* @__PURE__ */ jsx(SvgIconClose, {}), type: "button", variant: "ghost", title: t("close"), onClick: () => onDeleteRow(shareRight) }) })
|
|
48
|
+
}, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: hasRight(shareRight, shareRightAction), onChange: () => toggleRight(shareRight, shareRightAction.id), disabled: isDisabled, "data-testid": `share-right-${shareRightAction.id}-checkbox` }) }, shareRightAction.displayName)),
|
|
49
|
+
/* @__PURE__ */ jsx("td", { children: !shareRight.isBookmarkMember && !isDisabled && /* @__PURE__ */ jsx(IconButton, { "data-testid": "share-right-close-button", "aria-label": t("close"), color: "tertiary", icon: /* @__PURE__ */ jsx(SvgIconClose, {}), type: "button", variant: "ghost", title: t("close"), onClick: () => onDeleteRow(shareRight) }) })
|
|
50
50
|
] }, shareRight.id) : null;
|
|
51
51
|
});
|
|
52
52
|
};
|
|
@@ -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,
|
|
@@ -124,7 +132,7 @@ const ShareResources = /* @__PURE__ */ forwardRef(({
|
|
|
124
132
|
] })
|
|
125
133
|
] }) }),
|
|
126
134
|
/* @__PURE__ */ jsxs("div", { className: "mt-16", children: [
|
|
127
|
-
/* @__PURE__ */ jsx(Button, { color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconBookmark, {}), rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: t("show"), className: "w-16 min-w-0", style: {
|
|
135
|
+
/* @__PURE__ */ jsx(Button, { "data-testid": "share-bookmark-show-button", color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconBookmark, {}), rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: t("show"), className: "w-16 min-w-0", style: {
|
|
128
136
|
transition: "rotate 0.2s ease-out",
|
|
129
137
|
rotate: showBookmarkInput ? "-180deg" : "0deg"
|
|
130
138
|
} }), type: "button", variant: "ghost", className: "fw-normal", onClick: () => toggleBookmarkInput(!showBookmarkInput), children: t("share.save.sharebookmark") }),
|
|
@@ -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",
|