@box/unified-share-modal 2.12.14 → 2.12.16
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/chunks/classification-status.js +62 -0
- package/dist/chunks/collaboration-role.js +89 -0
- package/dist/chunks/collaboration-section.js +156 -0
- package/dist/chunks/collaborator-list-item.js +61 -0
- package/dist/chunks/collaborator-list.js +74 -0
- package/dist/chunks/remove-collaborator-modal.js +61 -0
- package/dist/chunks/remove-shared-link-modal.js +56 -0
- package/dist/chunks/shared-link-access.js +65 -0
- package/dist/chunks/shared-link-permission.js +67 -0
- package/dist/chunks/shared-link-section.js +176 -0
- package/dist/chunks/shared-link-settings-modal.js +86 -0
- package/dist/chunks/shared-with-avatars.js +48 -0
- package/dist/chunks/shield-restriction-notice.js +97 -0
- package/dist/chunks/text-area-container.js +36 -0
- package/dist/chunks/unified-share-form-modal.js +66 -0
- package/dist/chunks/unified-share-form.js +23 -0
- package/dist/esm/index.js +2 -4
- package/dist/esm/lib/components/classification-status/classification-status.js +2 -80
- package/dist/esm/lib/components/classification-status/index.js +2 -4
- package/dist/esm/lib/components/classification-status/messages.js +10 -12
- package/dist/esm/lib/components/index.js +5 -10
- package/dist/esm/lib/components/remove-collaborator-modal/index.js +2 -4
- package/dist/esm/lib/components/remove-collaborator-modal/messages.js +26 -28
- package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +2 -84
- package/dist/esm/lib/components/remove-shared-link-modal/index.js +2 -4
- package/dist/esm/lib/components/remove-shared-link-modal/messages.js +26 -28
- package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +2 -72
- package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +35 -61
- package/dist/esm/lib/components/shared-link-settings-modal/expiration-section.js +33 -50
- package/dist/esm/lib/components/shared-link-settings-modal/index.js +2 -4
- package/dist/esm/lib/components/shared-link-settings-modal/messages.js +138 -144
- package/dist/esm/lib/components/shared-link-settings-modal/password-section.js +32 -52
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +2 -98
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +97 -126
- package/dist/esm/lib/components/shared-link-settings-modal/vanity-section.js +33 -47
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +2 -128
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +2 -202
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +134 -136
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +2 -67
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +2 -134
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +2 -53
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +48 -60
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +2 -86
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +2 -101
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/messages.js +38 -40
- package/dist/esm/lib/components/unified-share-form-modal/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/messages.js +46 -48
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +142 -144
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +2 -102
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +2 -105
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +2 -191
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +2 -85
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +2 -29
- package/dist/esm/lib/constants.js +44 -28
- package/dist/esm/lib/contexts/index.js +4 -14
- package/dist/esm/lib/contexts/shared-link-settings-context.js +50 -59
- package/dist/esm/lib/contexts/unified-share-form-context.js +60 -57
- package/dist/esm/lib/contexts/unified-share-modal-context.js +65 -68
- package/dist/esm/lib/hooks/index.js +7 -14
- package/dist/esm/lib/hooks/use-access-levels.js +69 -93
- package/dist/esm/lib/hooks/use-collaboration-form.js +75 -95
- package/dist/esm/lib/hooks/use-form-validation.js +32 -43
- package/dist/esm/lib/hooks/use-link-settings-form.js +49 -64
- package/dist/esm/lib/hooks/use-permission-levels.js +33 -50
- package/dist/esm/lib/hooks/use-sharing-action.js +44 -59
- package/dist/esm/lib/messages.js +106 -108
- package/dist/esm/lib/unified-share-base.js +30 -40
- package/dist/esm/lib/unified-share-modal.js +41 -59
- package/dist/esm/lib/utils/collaborator.js +12 -27
- package/dist/esm/lib/utils/date.js +10 -14
- package/dist/esm/lib/utils/email.js +5 -7
- package/dist/esm/lib/utils/event.js +6 -13
- package/dist/esm/lib/utils/form.js +4 -14
- package/dist/esm/lib/utils/index.js +9 -34
- package/dist/esm/lib/utils/notification.js +19 -28
- package/dist/esm/lib/utils/permission.js +15 -22
- package/dist/esm/lib/utils/validation.js +2 -11
- package/dist/styles/classification-status.css +1 -1
- package/dist/styles/collaboration-role.css +1 -1
- package/dist/styles/collaboration-section.css +1 -1
- package/dist/styles/collaborator-list-item.css +1 -1
- package/dist/styles/collaborator-list.css +1 -1
- package/dist/styles/remove-collaborator-modal.css +1 -1
- package/dist/styles/shared-link-access.css +1 -1
- package/dist/styles/shared-link-section.css +1 -1
- package/dist/styles/shared-link-settings-modal.css +1 -1
- package/dist/styles/shared-with-avatars.css +1 -1
- package/dist/styles/shield-restriction-notice.css +1 -1
- package/dist/styles/text-area-container.css +1 -1
- package/dist/styles/unified-share-form-modal.css +1 -1
- package/dist/styles/unified-share-form.css +1 -1
- package/package.json +10 -10
|
@@ -1,138 +1,136 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
cancelButton: {
|
|
4
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.cancelButton",
|
|
5
|
+
defaultMessage: "Cancel"
|
|
6
|
+
},
|
|
7
|
+
closeButton: {
|
|
8
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.closeButton",
|
|
9
|
+
defaultMessage: "Close"
|
|
10
|
+
},
|
|
11
|
+
clearButton: {
|
|
12
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.clearButton",
|
|
13
|
+
defaultMessage: "Clear"
|
|
14
|
+
},
|
|
15
|
+
contentSharedWithExternalCollaborators: {
|
|
16
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contentSharedWithExternalCollaborators",
|
|
17
|
+
defaultMessage: "This content will be shared with external collaborators."
|
|
18
|
+
},
|
|
19
|
+
sendButton: {
|
|
20
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.sendButton",
|
|
21
|
+
defaultMessage: "Send"
|
|
22
|
+
},
|
|
23
|
+
loadingLabel: {
|
|
24
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingLabel",
|
|
25
|
+
defaultMessage: "Loading"
|
|
26
|
+
},
|
|
27
|
+
invitePeopleLabel: {
|
|
28
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeopleLabel",
|
|
29
|
+
defaultMessage: "Invite People"
|
|
30
|
+
},
|
|
31
|
+
invitePeoplePlaceholder: {
|
|
32
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeoplePlaceholder",
|
|
33
|
+
defaultMessage: "Add names or email addresses"
|
|
34
|
+
},
|
|
35
|
+
emailSharedLinkLabel: {
|
|
36
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.emailSharedLinkLabel",
|
|
37
|
+
defaultMessage: "Email Shared Link"
|
|
38
|
+
},
|
|
39
|
+
inviteAsRoleLabel: {
|
|
40
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteAsRoleLabel",
|
|
41
|
+
defaultMessage: "Invite as {role}"
|
|
42
|
+
},
|
|
43
|
+
sharedWithLabel: {
|
|
44
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.sharedWithLabel",
|
|
45
|
+
defaultMessage: "Shared with"
|
|
46
|
+
},
|
|
47
|
+
shareMessageLabel: {
|
|
48
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.shareMessageLabel",
|
|
49
|
+
defaultMessage: "Message (optional)"
|
|
50
|
+
},
|
|
51
|
+
shareMessagePlaceholder: {
|
|
52
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.shareMessagePlaceholder",
|
|
53
|
+
defaultMessage: "Add a message"
|
|
54
|
+
},
|
|
55
|
+
shareMessageCharacterCountAriaLabel: {
|
|
56
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.shareMessageCharacterCountAriaLabel",
|
|
57
|
+
defaultMessage: "{count} characters remaining"
|
|
58
|
+
},
|
|
59
|
+
coOwnerDescription: {
|
|
60
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.coOwnerDescription",
|
|
61
|
+
defaultMessage: "Manage security, upload, download, preview, share, edit, and delete"
|
|
62
|
+
},
|
|
63
|
+
editorDescription: {
|
|
64
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorDescription",
|
|
65
|
+
defaultMessage: "Upload, download, preview, share, and edit"
|
|
66
|
+
},
|
|
67
|
+
editorFolderDescription: {
|
|
68
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorFolderDescription",
|
|
69
|
+
defaultMessage: "Upload, download, preview, share, edit, and delete"
|
|
70
|
+
},
|
|
71
|
+
viewerUploaderDescription: {
|
|
72
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.viewerUploaderDescription",
|
|
73
|
+
defaultMessage: "Upload, download, preview, share, and edit"
|
|
74
|
+
},
|
|
75
|
+
previewerUploaderDescription: {
|
|
76
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerUploaderDescription",
|
|
77
|
+
defaultMessage: "Upload and preview"
|
|
78
|
+
},
|
|
79
|
+
viewerDescription: {
|
|
80
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.viewerDescription",
|
|
81
|
+
defaultMessage: "Download, preview, and share"
|
|
82
|
+
},
|
|
83
|
+
previewerDescription: {
|
|
84
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerDescription",
|
|
85
|
+
defaultMessage: "Preview-only"
|
|
86
|
+
},
|
|
87
|
+
uploaderDescription: {
|
|
88
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.uploaderDescription",
|
|
89
|
+
defaultMessage: "Upload-only"
|
|
90
|
+
},
|
|
91
|
+
inviteDisabledTooltip: {
|
|
92
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteDisabledTooltip",
|
|
93
|
+
defaultMessage: "You do not have permission to invite collaborators"
|
|
94
|
+
},
|
|
95
|
+
inviteWebLinkDisabledTooltip: {
|
|
96
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteWebLinkDisabledTooltip",
|
|
97
|
+
defaultMessage: "Collaborators cannot be added to bookmarks"
|
|
98
|
+
},
|
|
99
|
+
justifiableContactRestrictionNotice: {
|
|
100
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionNotice",
|
|
101
|
+
defaultMessage: "This content requires a business justification for {count, plural, one {{count} invitation} other {{count} invitations}}. Please select a business justification below. {justificationSelect} {removeLink}"
|
|
102
|
+
},
|
|
103
|
+
justifiableContactRestrictionRemoveButtonLabel: {
|
|
104
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionRemoveButtonLabel",
|
|
105
|
+
defaultMessage: "Alternatively, remove to continue"
|
|
106
|
+
},
|
|
107
|
+
contactRestrictionNotice: {
|
|
108
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionNotice",
|
|
109
|
+
defaultMessage: "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent because external collaboration is restricted due to the applied security policy. {removeLink}"
|
|
110
|
+
},
|
|
111
|
+
contactRestrictionInformationBarrierNotice: {
|
|
112
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionInformationBarrierNotice",
|
|
113
|
+
defaultMessage: "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent due to a security policy. {removeLink}"
|
|
114
|
+
},
|
|
115
|
+
contactRestrictionRemoveButtonLabel: {
|
|
116
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionRemoveButtonLabel",
|
|
117
|
+
defaultMessage: "Remove to continue"
|
|
118
|
+
},
|
|
119
|
+
justificationSelectPlaceholder: {
|
|
120
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justificationSelectPlaceholder",
|
|
121
|
+
defaultMessage: "Select Justification"
|
|
122
|
+
},
|
|
123
|
+
loadingJustificationReasonsLabel: {
|
|
124
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingJustificationReasonsLabel",
|
|
125
|
+
defaultMessage: "Loading justification reasons"
|
|
126
|
+
},
|
|
127
|
+
errorNoticeIconAriaLabel: {
|
|
128
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.errorNoticeIconAriaLabel",
|
|
129
|
+
defaultMessage: "Error"
|
|
130
|
+
},
|
|
131
|
+
businessJustification: {
|
|
132
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.businessJustification",
|
|
133
|
+
defaultMessage: "Business Justification"
|
|
134
|
+
}
|
|
135
135
|
});
|
|
136
|
-
export {
|
|
137
|
-
a as default
|
|
138
|
-
};
|
|
136
|
+
export { t as default };
|
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Gray10 as _ } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
-
import { CollaboratorAvatar as g } from "../collaborator-list/collaborator-avatar.js";
|
|
5
|
-
import I from "./messages.js";
|
|
6
|
-
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
7
|
-
import { useUnifiedShareModalContext as S } from "../../../contexts/unified-share-modal-context.js";
|
|
8
|
-
import { useUnifiedShareFormContext as k } from "../../../contexts/unified-share-form-context.js";
|
|
9
|
-
import { callOnKeyboardEvent as y } from "../../../utils/event.js";
|
|
10
|
-
import '../../../../../styles/shared-with-avatars.css';const W = "_container_1ku5s_2", O = "_avatars_1ku5s_19", c = {
|
|
11
|
-
container: W,
|
|
12
|
-
avatars: O
|
|
13
|
-
}, m = 3;
|
|
14
|
-
function D() {
|
|
15
|
-
const {
|
|
16
|
-
formatMessage: d
|
|
17
|
-
} = x(), {
|
|
18
|
-
collaborators: f,
|
|
19
|
-
currentUser: u,
|
|
20
|
-
eventService: h,
|
|
21
|
-
isSubmitting: o
|
|
22
|
-
} = S(), {
|
|
23
|
-
setIsCollaboratorsOpen: v
|
|
24
|
-
} = k(), {
|
|
25
|
-
onCollaboratorsClick: a
|
|
26
|
-
} = h, {
|
|
27
|
-
id: s
|
|
28
|
-
} = u, t = f.filter(({
|
|
29
|
-
isCurrentUser: r,
|
|
30
|
-
userId: b
|
|
31
|
-
}) => !(r || s && s === b));
|
|
32
|
-
if (!t.length)
|
|
33
|
-
return null;
|
|
34
|
-
const p = t.slice(0, m), n = t.length - m, i = () => {
|
|
35
|
-
if (a) {
|
|
36
|
-
a();
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
v(!0);
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ l("div", {
|
|
42
|
-
"aria-disabled": o,
|
|
43
|
-
className: c.container,
|
|
44
|
-
onClick: i,
|
|
45
|
-
onKeyDown: y(i),
|
|
46
|
-
role: "button",
|
|
47
|
-
tabIndex: o ? -1 : 0,
|
|
48
|
-
children: [/* @__PURE__ */ e(C, {
|
|
49
|
-
as: "span",
|
|
50
|
-
color: "textOnLightSecondary",
|
|
51
|
-
children: d(I.sharedWithLabel)
|
|
52
|
-
}), /* @__PURE__ */ l("div", {
|
|
53
|
-
className: c.avatars,
|
|
54
|
-
children: [p.map((r) => /* @__PURE__ */ e(g, {
|
|
55
|
-
collaborator: r,
|
|
56
|
-
size: "medium"
|
|
57
|
-
}, r.id)), n > 0 && /* @__PURE__ */ e(A, {
|
|
58
|
-
color: _,
|
|
59
|
-
size: "medium",
|
|
60
|
-
text: `+${n}`
|
|
61
|
-
})]
|
|
62
|
-
})]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
D as SharedWithAvatars
|
|
67
|
-
};
|
|
1
|
+
import { t as e } from "../../../../../chunks/shared-with-avatars.js";
|
|
2
|
+
export { e as SharedWithAvatars };
|
|
@@ -1,134 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { useIntl as O, FormattedMessage as P } from "react-intl";
|
|
4
|
-
import { Select as m, Link as z, InlineNotice as G, LoadingIndicator as T } from "@box/blueprint-web";
|
|
5
|
-
import t from "./messages.js";
|
|
6
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
-
import { isCollaboratorRestricted as V } from "../../../utils/collaborator.js";
|
|
8
|
-
import { useUnifiedShareFormContext as q } from "../../../contexts/unified-share-form-context.js";
|
|
9
|
-
import { useUnifiedShareModalContext as H } from "../../../contexts/unified-share-modal-context.js";
|
|
10
|
-
import { callOnKeyboardEvent as Q } from "../../../utils/event.js";
|
|
11
|
-
import '../../../../../styles/shield-restriction-notice.css';const W = "_select_1e0dl_1", X = "_link_1e0dl_5", Y = "_loading_1e0dl_9", Z = "_notice_1e0dl_15", r = {
|
|
12
|
-
select: W,
|
|
13
|
-
link: X,
|
|
14
|
-
loading: Y,
|
|
15
|
-
notice: Z
|
|
16
|
-
};
|
|
17
|
-
function lt({
|
|
18
|
-
error: L,
|
|
19
|
-
isLoading: h,
|
|
20
|
-
onSelectedUsersChange: N
|
|
21
|
-
}) {
|
|
22
|
-
const {
|
|
23
|
-
formatMessage: s
|
|
24
|
-
} = O(), [g, R] = _(!1), [c, J] = _([]), {
|
|
25
|
-
setShieldRestriction: o,
|
|
26
|
-
setUserContacts: j,
|
|
27
|
-
shieldRestriction: I,
|
|
28
|
-
userContacts: y
|
|
29
|
-
} = q(), {
|
|
30
|
-
eventService: w,
|
|
31
|
-
item: v,
|
|
32
|
-
contactService: x
|
|
33
|
-
} = H(), {
|
|
34
|
-
getJustificationReasons: l
|
|
35
|
-
} = x, {
|
|
36
|
-
onRestrictedUsersRemoveClick: b
|
|
37
|
-
} = w, {
|
|
38
|
-
isJustificationAllowed: a,
|
|
39
|
-
restrictionType: A,
|
|
40
|
-
restrictedEmails: p = [],
|
|
41
|
-
restrictedGroups: C = []
|
|
42
|
-
} = L, f = [...p, ...C];
|
|
43
|
-
k(() => (a && o({
|
|
44
|
-
isJustificationAllowed: !0
|
|
45
|
-
}), () => {
|
|
46
|
-
o({
|
|
47
|
-
isJustificationAllowed: !1
|
|
48
|
-
});
|
|
49
|
-
}), [a, o]), k(() => {
|
|
50
|
-
(async () => {
|
|
51
|
-
if (!(!l || c.length))
|
|
52
|
-
try {
|
|
53
|
-
R(!0);
|
|
54
|
-
const {
|
|
55
|
-
classificationId: n,
|
|
56
|
-
options: d
|
|
57
|
-
} = await l(v);
|
|
58
|
-
o({
|
|
59
|
-
classificationId: n
|
|
60
|
-
}), J(d);
|
|
61
|
-
} finally {
|
|
62
|
-
R(!1);
|
|
63
|
-
}
|
|
64
|
-
})();
|
|
65
|
-
}, [v, l, a, c, o]);
|
|
66
|
-
const B = a ? t.justifiableContactRestrictionRemoveButtonLabel : t.contactRestrictionRemoveButtonLabel, S = () => {
|
|
67
|
-
const [e, n] = K(y, (d) => V(d, p, C));
|
|
68
|
-
N(n), j(n), b && b(e);
|
|
69
|
-
}, F = (e) => {
|
|
70
|
-
o({
|
|
71
|
-
justificationReason: c.find((n) => n.id === e)
|
|
72
|
-
});
|
|
73
|
-
}, M = /* @__PURE__ */ i(m, {
|
|
74
|
-
className: r.select,
|
|
75
|
-
hideLabel: !0,
|
|
76
|
-
label: s(t.businessJustification),
|
|
77
|
-
onValueChange: F,
|
|
78
|
-
placeholder: s(t.justificationSelectPlaceholder),
|
|
79
|
-
value: I.justificationReason?.id,
|
|
80
|
-
children: /* @__PURE__ */ i(m.Content, {
|
|
81
|
-
align: "start",
|
|
82
|
-
children: c.map((e) => /* @__PURE__ */ i(m.Option, {
|
|
83
|
-
text: e.title,
|
|
84
|
-
value: e.id
|
|
85
|
-
}, e.id))
|
|
86
|
-
})
|
|
87
|
-
}), u = /* @__PURE__ */ i(z, {
|
|
88
|
-
"aria-disabled": h,
|
|
89
|
-
className: r.link,
|
|
90
|
-
onClick: S,
|
|
91
|
-
onKeyDown: Q(S, {
|
|
92
|
-
canPreventDefault: !0
|
|
93
|
-
}),
|
|
94
|
-
role: "button",
|
|
95
|
-
tabIndex: h ? -1 : 0,
|
|
96
|
-
children: s(B)
|
|
97
|
-
}), U = () => A === "information_barrier" ? {
|
|
98
|
-
message: t.contactRestrictionInformationBarrierNotice,
|
|
99
|
-
count: f.length,
|
|
100
|
-
removeLink: u
|
|
101
|
-
} : !g && a && c?.length > 0 ? {
|
|
102
|
-
message: t.justifiableContactRestrictionNotice,
|
|
103
|
-
count: f.length,
|
|
104
|
-
justificationSelect: M,
|
|
105
|
-
removeLink: u
|
|
106
|
-
} : {
|
|
107
|
-
message: t.contactRestrictionNotice,
|
|
108
|
-
count: f.length,
|
|
109
|
-
removeLink: u
|
|
110
|
-
}, {
|
|
111
|
-
message: E,
|
|
112
|
-
...D
|
|
113
|
-
} = U();
|
|
114
|
-
return /* @__PURE__ */ i(G, {
|
|
115
|
-
className: r.notice,
|
|
116
|
-
icon: () => null,
|
|
117
|
-
role: "alert",
|
|
118
|
-
variant: "error",
|
|
119
|
-
variantIconAriaLabel: s(t.errorNoticeIconAriaLabel),
|
|
120
|
-
children: g ? /* @__PURE__ */ i("div", {
|
|
121
|
-
className: r.loading,
|
|
122
|
-
children: /* @__PURE__ */ i(T, {
|
|
123
|
-
"aria-label": s(t.loadingJustificationReasonsLabel),
|
|
124
|
-
size: "small"
|
|
125
|
-
})
|
|
126
|
-
}) : /* @__PURE__ */ i(P, {
|
|
127
|
-
...E,
|
|
128
|
-
values: D
|
|
129
|
-
})
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
export {
|
|
133
|
-
lt as ShieldRestrictionNotice
|
|
134
|
-
};
|
|
1
|
+
import { t as e } from "../../../../../chunks/shield-restriction-notice.js";
|
|
2
|
+
export { e as ShieldRestrictionNotice };
|
|
@@ -1,53 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useUniqueId as C, TextArea as p, Text as b } from "@box/blueprint-web";
|
|
4
|
-
import a from "./messages.js";
|
|
5
|
-
import { jsxs as A, jsx as r } from "react/jsx-runtime";
|
|
6
|
-
import { useUnifiedShareModalContext as M } from "../../../contexts/unified-share-modal-context.js";
|
|
7
|
-
import { useUnifiedShareFormContext as _ } from "../../../contexts/unified-share-form-context.js";
|
|
8
|
-
import '../../../../../styles/text-area-container.css';const v = "_textArea_v76md_1", S = "_textCount_v76md_5", i = {
|
|
9
|
-
textArea: v,
|
|
10
|
-
textCount: S
|
|
11
|
-
};
|
|
12
|
-
function N(m) {
|
|
13
|
-
const {
|
|
14
|
-
formatMessage: t
|
|
15
|
-
} = f(), {
|
|
16
|
-
isSubmitting: l
|
|
17
|
-
} = M(), {
|
|
18
|
-
messageValue: c,
|
|
19
|
-
setMessageValue: u
|
|
20
|
-
} = _(), {
|
|
21
|
-
maxCount: e
|
|
22
|
-
} = m, [o, x] = g(e), s = C("text-count-"), d = (h) => {
|
|
23
|
-
const n = h.target.value;
|
|
24
|
-
typeof e == "number" && x(e - n.length), u(n);
|
|
25
|
-
};
|
|
26
|
-
return /* @__PURE__ */ A("div", {
|
|
27
|
-
children: [/* @__PURE__ */ r(p, {
|
|
28
|
-
className: i.textArea,
|
|
29
|
-
disabled: l,
|
|
30
|
-
label: t(a.shareMessageLabel),
|
|
31
|
-
maxLength: e,
|
|
32
|
-
minRows: 3,
|
|
33
|
-
onChange: d,
|
|
34
|
-
placeholder: t(a.shareMessagePlaceholder),
|
|
35
|
-
value: c,
|
|
36
|
-
...e && {
|
|
37
|
-
"aria-describedby": s
|
|
38
|
-
}
|
|
39
|
-
}), !!e && /* @__PURE__ */ r(b, {
|
|
40
|
-
"aria-label": t(a.shareMessageCharacterCountAriaLabel, {
|
|
41
|
-
count: o
|
|
42
|
-
}),
|
|
43
|
-
as: "span",
|
|
44
|
-
className: i.textCount,
|
|
45
|
-
color: "textOnLightSecondary",
|
|
46
|
-
id: s,
|
|
47
|
-
children: o
|
|
48
|
-
})]
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
N as TextAreaContainer
|
|
53
|
-
};
|
|
1
|
+
import { t as e } from "../../../../../chunks/text-area-container.js";
|
|
2
|
+
export { e as TextAreaContainer };
|
package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js
CHANGED
|
@@ -1,61 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
tooltipConfig: {
|
|
49
|
-
tooltipAriaLabel: p,
|
|
50
|
-
tooltipContent: p,
|
|
51
|
-
tooltipSide: "right"
|
|
52
|
-
},
|
|
53
|
-
variant: "status-pending",
|
|
54
|
-
children: n ? /* @__PURE__ */ t(l, {}) : /* @__PURE__ */ t(a, {})
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return e && n ? /* @__PURE__ */ t(l, {}) : /* @__PURE__ */ t(a, {});
|
|
1
|
+
import { getAvatarBadgeSize as e, getFirstInitial as t } from "../../../utils/collaborator.js";
|
|
2
|
+
import { formatDateFromTimestampToDateString as n } from "../../../utils/date.js";
|
|
3
|
+
import r from "./messages.js";
|
|
4
|
+
import { useCallback as i } from "react";
|
|
5
|
+
import { useIntl as a } from "react-intl";
|
|
6
|
+
import { Avatar as o, IconBadge as s } from "@box/blueprint-web";
|
|
7
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
8
|
+
function l({ collaborator: l, isBadgeable: u, size: d = "large" }) {
|
|
9
|
+
let { formatMessage: f } = a(), { avatarUrl: p, expiresAt: m, hasCustomAvatar: h, id: g, isExternal: _, name: v } = l, y = h === !1 ? void 0 : p, b = i(() => /* @__PURE__ */ c(o, {
|
|
10
|
+
alt: "",
|
|
11
|
+
colorIndex: parseInt(g, 10),
|
|
12
|
+
size: d,
|
|
13
|
+
src: y,
|
|
14
|
+
text: t(v)
|
|
15
|
+
}), [
|
|
16
|
+
y,
|
|
17
|
+
g,
|
|
18
|
+
v,
|
|
19
|
+
d
|
|
20
|
+
]), x = i(() => /* @__PURE__ */ c(s, {
|
|
21
|
+
offset: {
|
|
22
|
+
bottom: -4,
|
|
23
|
+
right: -4
|
|
24
|
+
},
|
|
25
|
+
size: e(d),
|
|
26
|
+
variant: "collaborator-external",
|
|
27
|
+
children: /* @__PURE__ */ c(b, {})
|
|
28
|
+
}), [b, d]);
|
|
29
|
+
if (u && m) {
|
|
30
|
+
let t = typeof m == "number" ? n(m) : m, i = f(r.expiresBadge, { date: t });
|
|
31
|
+
return /* @__PURE__ */ c(s, {
|
|
32
|
+
offset: {
|
|
33
|
+
bottom: 20,
|
|
34
|
+
right: 20
|
|
35
|
+
},
|
|
36
|
+
showTooltipOnBadge: !0,
|
|
37
|
+
size: e(d),
|
|
38
|
+
tooltipConfig: {
|
|
39
|
+
tooltipAriaLabel: i,
|
|
40
|
+
tooltipContent: i,
|
|
41
|
+
tooltipSide: "right"
|
|
42
|
+
},
|
|
43
|
+
variant: "status-pending",
|
|
44
|
+
children: c(_ ? x : b, {})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return c(u && _ ? x : b, {});
|
|
58
48
|
}
|
|
59
|
-
export {
|
|
60
|
-
k as CollaboratorAvatar
|
|
61
|
-
};
|
|
49
|
+
export { l as CollaboratorAvatar };
|