@box/unified-share-modal 1.35.2 → 1.36.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.
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +68 -69
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +32 -32
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +24 -24
- package/dist/esm/lib/components/unified-share-form-modal/collaborators-view/collaborator-list-item.js +39 -38
- package/dist/esm/lib/components/unified-share-form-modal/collaborators-view/collaborators-view.js +61 -61
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +32 -32
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +25 -25
- package/dist/i18n/bn-IN.js +4 -4
- package/dist/i18n/bn-IN.properties +4 -4
- package/dist/i18n/da-DK.js +4 -4
- package/dist/i18n/da-DK.properties +4 -4
- package/dist/i18n/de-DE.js +4 -4
- package/dist/i18n/de-DE.properties +4 -4
- package/dist/i18n/en-AU.js +1 -1
- package/dist/i18n/en-AU.properties +1 -1
- package/dist/i18n/en-GB.js +1 -1
- package/dist/i18n/en-GB.properties +1 -1
- package/dist/i18n/es-419.js +4 -4
- package/dist/i18n/es-419.properties +4 -4
- package/dist/i18n/es-ES.js +4 -4
- package/dist/i18n/es-ES.properties +4 -4
- package/dist/i18n/fi-FI.js +4 -4
- package/dist/i18n/fi-FI.properties +4 -4
- package/dist/i18n/fr-CA.js +4 -4
- package/dist/i18n/fr-CA.properties +4 -4
- package/dist/i18n/fr-FR.js +4 -4
- package/dist/i18n/fr-FR.properties +4 -4
- package/dist/i18n/hi-IN.js +4 -4
- package/dist/i18n/hi-IN.properties +4 -4
- package/dist/i18n/ja-JP.js +4 -4
- package/dist/i18n/ja-JP.properties +4 -4
- package/dist/i18n/ko-KR.js +4 -4
- package/dist/i18n/ko-KR.properties +4 -4
- package/dist/i18n/nl-NL.js +4 -4
- package/dist/i18n/nl-NL.properties +4 -4
- package/dist/i18n/pl-PL.js +4 -4
- package/dist/i18n/pl-PL.properties +4 -4
- package/dist/i18n/pt-BR.js +4 -4
- package/dist/i18n/pt-BR.properties +4 -4
- package/dist/i18n/ru-RU.js +4 -4
- package/dist/i18n/ru-RU.properties +4 -4
- package/dist/i18n/sv-SE.js +4 -4
- package/dist/i18n/sv-SE.properties +4 -4
- package/dist/i18n/tr-TR.js +4 -4
- package/dist/i18n/tr-TR.properties +4 -4
- package/dist/i18n/zh-CN.js +4 -4
- package/dist/i18n/zh-CN.properties +4 -4
- package/dist/i18n/zh-TW.js +4 -4
- package/dist/i18n/zh-TW.properties +4 -4
- 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/shared-link-access.css +1 -1
- package/dist/types/lib/components/unified-share-form-modal/collaborators-view/collaborator-list-item.d.ts +2 -1
- package/package.json +9 -9
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { Modal as t, LoadingIndicator as
|
|
4
|
-
import { DownloadSection as
|
|
5
|
-
import { ExpirationSection as
|
|
6
|
-
import { PasswordSection as
|
|
7
|
-
import { VanitySection as
|
|
1
|
+
import { useState as R, useMemo as q, useEffect as G } from "react";
|
|
2
|
+
import { useIntl as J } from "react-intl";
|
|
3
|
+
import { Modal as t, LoadingIndicator as K, Text as Q, Link as W } from "@box/blueprint-web";
|
|
4
|
+
import { DownloadSection as X } from "./download-section.js";
|
|
5
|
+
import { ExpirationSection as Y } from "./expiration-section.js";
|
|
6
|
+
import { PasswordSection as Z } from "./password-section.js";
|
|
7
|
+
import { VanitySection as $ } from "./vanity-section.js";
|
|
8
8
|
import s from "./messages.js";
|
|
9
9
|
import { jsx as a, jsxs as w } from "react/jsx-runtime";
|
|
10
|
-
import { useAccessLevels as
|
|
11
|
-
import { formatDateFromTimestampToCalendarDate as
|
|
12
|
-
import { useLinkSettingsForm as
|
|
13
|
-
import { useUnifiedShareModalContext as
|
|
14
|
-
import '../../../../styles/shared-link-settings-modal.css';const
|
|
15
|
-
content:
|
|
16
|
-
body:
|
|
17
|
-
loading:
|
|
10
|
+
import { useAccessLevels as O } from "../../hooks/use-access-levels.js";
|
|
11
|
+
import { formatDateFromTimestampToCalendarDate as ee } from "../../utils/date.js";
|
|
12
|
+
import { useLinkSettingsForm as ae } from "../../hooks/use-link-settings-form.js";
|
|
13
|
+
import { useUnifiedShareModalContext as ne } from "../../contexts/unified-share-modal-context.js";
|
|
14
|
+
import '../../../../styles/shared-link-settings-modal.css';const oe = "_content_1r0kk_1", ie = "_body_1r0kk_5", te = "_loading_1r0kk_17", f = {
|
|
15
|
+
content: oe,
|
|
16
|
+
body: ie,
|
|
17
|
+
loading: te
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function ve({
|
|
20
20
|
isOpen: c,
|
|
21
21
|
onOpenChange: v
|
|
22
22
|
}) {
|
|
23
23
|
const {
|
|
24
24
|
formatMessage: i
|
|
25
|
-
} =
|
|
26
|
-
eventService:
|
|
27
|
-
isSubmitting:
|
|
28
|
-
sharedLink:
|
|
29
|
-
} =
|
|
25
|
+
} = J(), [g, k] = R(!1), {
|
|
26
|
+
eventService: E,
|
|
27
|
+
isSubmitting: x,
|
|
28
|
+
sharedLink: L
|
|
29
|
+
} = ne(), {
|
|
30
30
|
expiresAt: m = 0,
|
|
31
31
|
settings: n = {},
|
|
32
|
-
vanityDomain:
|
|
32
|
+
vanityDomain: D = "",
|
|
33
33
|
vanityName: h = ""
|
|
34
|
-
} =
|
|
34
|
+
} = L, {
|
|
35
35
|
onSharedLinkSettingsClose: y,
|
|
36
36
|
onSharedLinkSettingsLoad: p
|
|
37
|
-
} =
|
|
38
|
-
selectedAccess:
|
|
39
|
-
} =
|
|
40
|
-
expiration: m ?
|
|
37
|
+
} = E, {
|
|
38
|
+
selectedAccess: N
|
|
39
|
+
} = O(), b = q(() => ({
|
|
40
|
+
expiration: m ? ee(m) : null,
|
|
41
41
|
isDownloadEnabled: !!n.isDownloadEnabled,
|
|
42
42
|
isExpirationEnabled: !!m,
|
|
43
43
|
isPasswordEnabled: !!n.isPasswordEnabled,
|
|
@@ -47,41 +47,40 @@ function ye({
|
|
|
47
47
|
}), [m, n, h]), {
|
|
48
48
|
errors: u,
|
|
49
49
|
formData: o,
|
|
50
|
-
handleFormReset:
|
|
50
|
+
handleFormReset: S,
|
|
51
51
|
handleFormSubmit: F,
|
|
52
52
|
isUpdating: P,
|
|
53
|
-
setErrors: T,
|
|
54
53
|
setFieldError: r,
|
|
55
54
|
setFieldValue: d,
|
|
56
|
-
validatePassword:
|
|
57
|
-
} =
|
|
58
|
-
|
|
59
|
-
(async () => p && (c && await p(),
|
|
55
|
+
validatePassword: T
|
|
56
|
+
} = ae(b);
|
|
57
|
+
G(() => {
|
|
58
|
+
(async () => p && (c && await p(), k(!c)))();
|
|
60
59
|
}, [c, p]);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
await F() || (
|
|
65
|
-
},
|
|
60
|
+
const C = () => {
|
|
61
|
+
S(), y && y(), v(!1);
|
|
62
|
+
}, B = async () => {
|
|
63
|
+
await F() || (S(), v(!1));
|
|
64
|
+
}, A = (e) => {
|
|
66
65
|
r("expiration", void 0), d("isExpirationEnabled", e);
|
|
67
|
-
},
|
|
66
|
+
}, _ = (e) => {
|
|
68
67
|
r("expiration", void 0), d("expiration", e);
|
|
69
|
-
},
|
|
68
|
+
}, V = (e) => {
|
|
70
69
|
r("vanityName", void 0), d("isVanityNameEnabled", e);
|
|
71
|
-
},
|
|
70
|
+
}, M = (e) => {
|
|
72
71
|
r("vanityName", void 0), d("vanityName", e.target.value);
|
|
73
|
-
},
|
|
72
|
+
}, I = (e) => {
|
|
74
73
|
r("password", void 0), d("isPasswordEnabled", e);
|
|
75
|
-
},
|
|
74
|
+
}, j = (e) => {
|
|
76
75
|
r("password", void 0), d("password", e.target.value);
|
|
77
|
-
},
|
|
76
|
+
}, z = (e) => {
|
|
78
77
|
d("isDownloadEnabled", e);
|
|
79
|
-
},
|
|
80
|
-
const
|
|
81
|
-
b.isPasswordEnabled && !o.password ||
|
|
82
|
-
}, l =
|
|
78
|
+
}, U = (e) => {
|
|
79
|
+
const H = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")?.contains(e.relatedTarget);
|
|
80
|
+
b.isPasswordEnabled && !o.password || H || T(o.password);
|
|
81
|
+
}, l = x || P;
|
|
83
82
|
return /* @__PURE__ */ a(t, {
|
|
84
|
-
onOpenChange:
|
|
83
|
+
onOpenChange: C,
|
|
85
84
|
open: c,
|
|
86
85
|
children: /* @__PURE__ */ w(t.Content, {
|
|
87
86
|
className: f.content,
|
|
@@ -93,68 +92,68 @@ function ye({
|
|
|
93
92
|
inert: g ? "" : null,
|
|
94
93
|
children: [g && /* @__PURE__ */ a("div", {
|
|
95
94
|
className: f.loading,
|
|
96
|
-
children: /* @__PURE__ */ a(
|
|
95
|
+
children: /* @__PURE__ */ a(K, {
|
|
97
96
|
"aria-label": i(s.loadingLabel),
|
|
98
97
|
size: "large"
|
|
99
98
|
})
|
|
100
|
-
}), /* @__PURE__ */ a(
|
|
99
|
+
}), /* @__PURE__ */ a(Q, {
|
|
101
100
|
as: "p",
|
|
102
101
|
color: "textOnLightSecondary",
|
|
103
102
|
children: i(s.subtitle, {
|
|
104
|
-
learnSharedLinkSettingsLink: /* @__PURE__ */ a(
|
|
103
|
+
learnSharedLinkSettingsLink: /* @__PURE__ */ a(W, {
|
|
105
104
|
href: "https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings",
|
|
106
105
|
rel: "noreferrer",
|
|
107
106
|
target: "_blank",
|
|
108
107
|
children: i(s.learnSharedLinkSettingsLink)
|
|
109
108
|
})
|
|
110
109
|
})
|
|
111
|
-
}), /* @__PURE__ */ a(
|
|
110
|
+
}), /* @__PURE__ */ a(Y, {
|
|
112
111
|
canChange: !!n.canChangeExpiration,
|
|
113
112
|
error: u.expiration,
|
|
114
113
|
expiration: o.expiration,
|
|
115
114
|
isChecked: o.isExpirationEnabled,
|
|
116
115
|
isDisabled: l,
|
|
117
|
-
onChange:
|
|
118
|
-
onToggle:
|
|
119
|
-
}), /* @__PURE__ */ a(
|
|
116
|
+
onChange: _,
|
|
117
|
+
onToggle: A
|
|
118
|
+
}), /* @__PURE__ */ a(Z, {
|
|
120
119
|
canChange: !!n.canChangePassword,
|
|
121
120
|
error: u.password,
|
|
122
|
-
isAvailable: n.isPasswordAvailable &&
|
|
121
|
+
isAvailable: n.isPasswordAvailable && N?.id === "open",
|
|
123
122
|
isChecked: o.isPasswordEnabled,
|
|
124
123
|
isDefaultChecked: b.isPasswordEnabled,
|
|
125
124
|
isDisabled: l,
|
|
126
|
-
onBlur:
|
|
127
|
-
onChange:
|
|
125
|
+
onBlur: U,
|
|
126
|
+
onChange: j,
|
|
128
127
|
onFocus: () => r("password", void 0),
|
|
129
|
-
onToggle:
|
|
128
|
+
onToggle: I,
|
|
130
129
|
password: o.password
|
|
131
|
-
}), /* @__PURE__ */ a(
|
|
130
|
+
}), /* @__PURE__ */ a($, {
|
|
132
131
|
canChange: !!n.canChangeVanityName,
|
|
133
132
|
error: u.vanityName,
|
|
134
133
|
isAvailable: !!n.isVanityNameAvailable,
|
|
135
134
|
isChecked: o.isVanityNameEnabled,
|
|
136
135
|
isDisabled: l,
|
|
137
|
-
onChange:
|
|
138
|
-
onToggle:
|
|
139
|
-
vanityDomain:
|
|
136
|
+
onChange: M,
|
|
137
|
+
onToggle: V,
|
|
138
|
+
vanityDomain: D,
|
|
140
139
|
vanityName: o.vanityName
|
|
141
|
-
}), /* @__PURE__ */ a(
|
|
140
|
+
}), /* @__PURE__ */ a(X, {
|
|
142
141
|
canChange: !!n.canChangeDownload,
|
|
143
142
|
isAvailable: !!n.isDownloadAvailable,
|
|
144
143
|
isChecked: o.isDownloadEnabled,
|
|
145
144
|
isDisabled: l,
|
|
146
|
-
onToggle:
|
|
145
|
+
onToggle: z
|
|
147
146
|
})]
|
|
148
147
|
}), !g && /* @__PURE__ */ w(t.Footer, {
|
|
149
148
|
children: [/* @__PURE__ */ a(t.Footer.SecondaryButton, {
|
|
150
149
|
disabled: l,
|
|
151
|
-
onClick:
|
|
150
|
+
onClick: C,
|
|
152
151
|
children: i(s.cancelButton)
|
|
153
152
|
}), /* @__PURE__ */ a(t.Footer.PrimaryButton, {
|
|
154
153
|
id: "usm-SharedLinkSettingsModal-primaryButton",
|
|
155
154
|
loading: l,
|
|
156
155
|
loadingAriaLabel: i(s.loadingLabel),
|
|
157
|
-
onClick:
|
|
156
|
+
onClick: B,
|
|
158
157
|
children: i(s.saveButton)
|
|
159
158
|
})]
|
|
160
159
|
}), /* @__PURE__ */ a(t.Close, {
|
|
@@ -164,5 +163,5 @@ function ye({
|
|
|
164
163
|
});
|
|
165
164
|
}
|
|
166
165
|
export {
|
|
167
|
-
|
|
166
|
+
ve as SharedLinkSettingsModal
|
|
168
167
|
};
|
package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import _ from "clsx";
|
|
2
2
|
import L from "lodash/camelCase";
|
|
3
|
-
import { useState as k, useMemo as w, useEffect as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { jsx as e, jsxs as
|
|
9
|
-
import { isInvitationRoleSupported as
|
|
10
|
-
import { useUnifiedShareFormContext as
|
|
11
|
-
import { useUnifiedShareModalContext as
|
|
12
|
-
import '../../../../../styles/collaboration-role.css';const
|
|
13
|
-
container:
|
|
14
|
-
overrides:
|
|
15
|
-
focusable:
|
|
3
|
+
import { useState as k, useMemo as w, useEffect as F } from "react";
|
|
4
|
+
import { useIntl as N } from "react-intl";
|
|
5
|
+
import { Tooltip as O, Focusable as $, TriggerButton as D, DropdownMenu as r } from "@box/blueprint-web";
|
|
6
|
+
import j from "../messages.js";
|
|
7
|
+
import l from "./messages.js";
|
|
8
|
+
import { jsx as e, jsxs as z } from "react/jsx-runtime";
|
|
9
|
+
import { isInvitationRoleSupported as A, getDefaultCollaborationRole as P } from "../../../utils/collaborator.js";
|
|
10
|
+
import { useUnifiedShareFormContext as U } from "../../../contexts/unified-share-form-context.js";
|
|
11
|
+
import { useUnifiedShareModalContext as B } from "../../../contexts/unified-share-modal-context.js";
|
|
12
|
+
import '../../../../../styles/collaboration-role.css';const E = "_container_120dl_1", W = "_overrides_120dl_9", q = "_focusable_120dl_14", n = {
|
|
13
|
+
container: E,
|
|
14
|
+
overrides: W,
|
|
15
|
+
focusable: q
|
|
16
16
|
};
|
|
17
17
|
function te() {
|
|
18
18
|
const {
|
|
19
19
|
formatMessage: o
|
|
20
|
-
} =
|
|
20
|
+
} = N(), [f, M] = k(!1), {
|
|
21
21
|
collaborationRole: u,
|
|
22
22
|
setCollaborationRole: d
|
|
23
|
-
} =
|
|
23
|
+
} = U(), {
|
|
24
24
|
collaborationRoles: g,
|
|
25
25
|
isSubmitting: S,
|
|
26
26
|
item: I
|
|
27
|
-
} =
|
|
27
|
+
} = B(), {
|
|
28
28
|
permissions: T = {},
|
|
29
29
|
type: m
|
|
30
30
|
} = I, s = w(() => g.map((i) => {
|
|
@@ -32,18 +32,18 @@ function te() {
|
|
|
32
32
|
description: p,
|
|
33
33
|
id: t,
|
|
34
34
|
label: c
|
|
35
|
-
} = i,
|
|
35
|
+
} = i, b = A(t), h = L(t);
|
|
36
36
|
let x = h;
|
|
37
37
|
t === "editor" && m === "folder" && (x += "Folder");
|
|
38
38
|
let C = t, R = "";
|
|
39
|
-
return
|
|
39
|
+
return b && (C = o(j[`${h}Role`]), R = o(l[`${x}Description`])), {
|
|
40
40
|
...i,
|
|
41
41
|
description: p ?? R,
|
|
42
42
|
label: c ?? C
|
|
43
43
|
};
|
|
44
44
|
}), [g, o, m]);
|
|
45
|
-
if (
|
|
46
|
-
d(
|
|
45
|
+
if (F(() => {
|
|
46
|
+
d(P(s));
|
|
47
47
|
}, [s, d]), !s.length || !u)
|
|
48
48
|
return null;
|
|
49
49
|
const {
|
|
@@ -51,33 +51,33 @@ function te() {
|
|
|
51
51
|
label: v
|
|
52
52
|
} = u;
|
|
53
53
|
let a;
|
|
54
|
-
return T.canInviteCollaborator || (a = o(
|
|
54
|
+
return T.canInviteCollaborator || (a = o(l.inviteDisabledTooltip)), m === "web_link" && (a = o(l.inviteWebLinkDisabledTooltip)), a ? /* @__PURE__ */ e(O, {
|
|
55
55
|
align: "start",
|
|
56
56
|
content: a,
|
|
57
57
|
"data-testid": "collaboration-role-tooltip",
|
|
58
58
|
side: "bottom",
|
|
59
|
-
children: /* @__PURE__ */ e(
|
|
60
|
-
className:
|
|
59
|
+
children: /* @__PURE__ */ e($, {
|
|
60
|
+
className: n.focusable,
|
|
61
61
|
children: /* @__PURE__ */ e(D, {
|
|
62
62
|
caretDirection: "down",
|
|
63
|
-
className: _(
|
|
63
|
+
className: _(n.container, n.overrides),
|
|
64
64
|
disabled: !0,
|
|
65
|
-
label: o(
|
|
65
|
+
label: o(l.inviteAsRoleLabel, {
|
|
66
66
|
role: v
|
|
67
67
|
}),
|
|
68
68
|
size: "extraSmall",
|
|
69
69
|
variant: "tertiary"
|
|
70
70
|
})
|
|
71
71
|
})
|
|
72
|
-
}) : /* @__PURE__ */
|
|
72
|
+
}) : /* @__PURE__ */ z(r.Root, {
|
|
73
73
|
onOpenChange: M,
|
|
74
|
-
open:
|
|
74
|
+
open: f,
|
|
75
75
|
children: [/* @__PURE__ */ e(r.Trigger, {
|
|
76
76
|
children: /* @__PURE__ */ e(D, {
|
|
77
|
-
caretDirection:
|
|
78
|
-
className: _(
|
|
77
|
+
caretDirection: f ? "up" : "down",
|
|
78
|
+
className: _(n.container, n.overrides),
|
|
79
79
|
disabled: S,
|
|
80
|
-
label: o(
|
|
80
|
+
label: o(l.inviteAsRoleLabel, {
|
|
81
81
|
role: v
|
|
82
82
|
}),
|
|
83
83
|
size: "extraSmall",
|
|
@@ -90,7 +90,7 @@ function te() {
|
|
|
90
90
|
description: p,
|
|
91
91
|
isDisabled: t,
|
|
92
92
|
id: c,
|
|
93
|
-
label:
|
|
93
|
+
label: b
|
|
94
94
|
} = i;
|
|
95
95
|
return /* @__PURE__ */ e(r.CheckboxItem, {
|
|
96
96
|
checked: y === c,
|
|
@@ -98,7 +98,7 @@ function te() {
|
|
|
98
98
|
onSelect: () => d(i),
|
|
99
99
|
children: /* @__PURE__ */ e(r.Item.MainContent, {
|
|
100
100
|
caption: p,
|
|
101
|
-
label:
|
|
101
|
+
label: b
|
|
102
102
|
})
|
|
103
103
|
}, c);
|
|
104
104
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as ce, useRef as de, useEffect as N, useCallback as F } from "react";
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import { useIntl as
|
|
2
|
+
import { createPortal as ue } from "react-dom";
|
|
3
|
+
import { useIntl as me } from "react-intl";
|
|
4
4
|
import { useNotification as he, useUniqueId as fe, useLabelable as pe, Tooltip as be, Focusable as Ce, Text as ve, Modal as h } from "@box/blueprint-web";
|
|
5
5
|
import { Globe as ge } from "@box/blueprint-web-assets/icons/Medium";
|
|
6
6
|
import { UserSelectorContainer as Se } from "@box/user-selector";
|
|
@@ -15,7 +15,7 @@ import { useFormValidation as _e } from "../../../hooks/use-form-validation.js";
|
|
|
15
15
|
import { useCollaborationForm as xe } from "../../../hooks/use-collaboration-form.js";
|
|
16
16
|
import { useUnifiedShareFormContext as Ee } from "../../../contexts/unified-share-form-context.js";
|
|
17
17
|
import { useUnifiedShareModalContext as Be } from "../../../contexts/unified-share-modal-context.js";
|
|
18
|
-
import '../../../../../styles/collaboration-section.css';const Ve = "
|
|
18
|
+
import '../../../../../styles/collaboration-section.css';const Ve = "_container_1d5sq_2", Ne = "_label_1d5sq_8", Re = "_securityIndicator_1d5sq_23", Te = "_collaborationAccessContainer_1d5sq_29", f = {
|
|
19
19
|
container: Ve,
|
|
20
20
|
label: Ne,
|
|
21
21
|
securityIndicator: Re,
|
|
@@ -24,24 +24,24 @@ import '../../../../../styles/collaboration-section.css';const Ve = "_container_
|
|
|
24
24
|
function Ye() {
|
|
25
25
|
const {
|
|
26
26
|
formatMessage: t
|
|
27
|
-
} =
|
|
27
|
+
} = me(), [p, y] = ce(), {
|
|
28
28
|
addNotification: R
|
|
29
29
|
} = he(), {
|
|
30
30
|
validateShieldRestriction: T
|
|
31
31
|
} = _e(), {
|
|
32
|
-
contactValue:
|
|
32
|
+
contactValue: O,
|
|
33
33
|
container: b,
|
|
34
34
|
onModalOpenChange: I,
|
|
35
35
|
onShareViewChange: C,
|
|
36
|
-
setUserContacts:
|
|
36
|
+
setUserContacts: P,
|
|
37
37
|
shareView: n,
|
|
38
38
|
userContacts: a
|
|
39
39
|
} = Ee(), {
|
|
40
|
-
collaborationAccess:
|
|
41
|
-
collaborationNotices:
|
|
40
|
+
collaborationAccess: k,
|
|
41
|
+
collaborationNotices: M,
|
|
42
42
|
config: v,
|
|
43
|
-
contactService:
|
|
44
|
-
isFetching:
|
|
43
|
+
contactService: q,
|
|
44
|
+
isFetching: w,
|
|
45
45
|
isSubmitting: D,
|
|
46
46
|
item: G,
|
|
47
47
|
sharingService: W
|
|
@@ -51,7 +51,7 @@ function Ye() {
|
|
|
51
51
|
} = G, {
|
|
52
52
|
getContacts: g,
|
|
53
53
|
getContactsAvatarUrls: S
|
|
54
|
-
} =
|
|
54
|
+
} = q, {
|
|
55
55
|
sendInvitations: K,
|
|
56
56
|
sendSharedLink: $
|
|
57
57
|
} = W;
|
|
@@ -98,15 +98,15 @@ function Ye() {
|
|
|
98
98
|
return;
|
|
99
99
|
const {
|
|
100
100
|
shieldRestriction: U
|
|
101
|
-
} = e, V = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []], le = a.map((
|
|
102
|
-
...
|
|
101
|
+
} = e, V = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []], le = a.map((m) => V.includes(m.email) || V.includes(`${m.id}`) ? {
|
|
102
|
+
...m,
|
|
103
103
|
chipVariant: "error"
|
|
104
|
-
} :
|
|
105
|
-
y(U),
|
|
104
|
+
} : m);
|
|
105
|
+
y(U), P(le);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
let d,
|
|
109
|
-
s && !j.canInviteCollaborator && (d = t(o.inviteDisabledTooltip),
|
|
108
|
+
let d, u = !1;
|
|
109
|
+
s && !j.canInviteCollaborator && (d = t(o.inviteDisabledTooltip), u = !0), s && H === "web_link" && (d = t(o.inviteWebLinkDisabledTooltip), u = !0);
|
|
110
110
|
const B = fe("user-contacts-"), ie = t(s ? o.invitePeopleLabel : o.emailSharedLinkLabel), se = pe(ie, B);
|
|
111
111
|
return /* @__PURE__ */ i("form", {
|
|
112
112
|
className: f.container,
|
|
@@ -115,7 +115,7 @@ function Ye() {
|
|
|
115
115
|
error: p,
|
|
116
116
|
isLoading: c,
|
|
117
117
|
onSelectedUsersChange: x
|
|
118
|
-
}),
|
|
118
|
+
}), M, /* @__PURE__ */ i("div", {
|
|
119
119
|
children: [s && v.collaborators && /* @__PURE__ */ r(Le, {}), /* @__PURE__ */ r(se, {
|
|
120
120
|
className: f.label
|
|
121
121
|
}), /* @__PURE__ */ r(be, {
|
|
@@ -124,19 +124,19 @@ function Ye() {
|
|
|
124
124
|
open: d ? void 0 : !1,
|
|
125
125
|
side: "bottom",
|
|
126
126
|
children: /* @__PURE__ */ r(Ce, {
|
|
127
|
-
focusable:
|
|
127
|
+
focusable: u,
|
|
128
128
|
children: /* @__PURE__ */ r(Se, {
|
|
129
129
|
className: "collaboration-user-selector",
|
|
130
130
|
clearButtonAriaLabel: t(o.clearButton),
|
|
131
131
|
clearOnBlur: !1,
|
|
132
|
-
disabled:
|
|
132
|
+
disabled: u || c,
|
|
133
133
|
displayChipVariant: (e) => e.chipVariant,
|
|
134
134
|
error: z["user-contact"],
|
|
135
135
|
fetchAvatarUrls: oe,
|
|
136
136
|
fetchUsers: te,
|
|
137
137
|
hideOnEscape: ee,
|
|
138
138
|
idForLabel: B,
|
|
139
|
-
inputValue:
|
|
139
|
+
inputValue: O,
|
|
140
140
|
label: null,
|
|
141
141
|
onBlur: Q,
|
|
142
142
|
onInputValueChange: re,
|
|
@@ -150,7 +150,7 @@ function Ye() {
|
|
|
150
150
|
})
|
|
151
151
|
}), s && /* @__PURE__ */ i("div", {
|
|
152
152
|
className: f.collaborationAccessContainer,
|
|
153
|
-
children: [v.collaborationRole && /* @__PURE__ */ r(Ae, {}),
|
|
153
|
+
children: [v.collaborationRole && /* @__PURE__ */ r(Ae, {}), k]
|
|
154
154
|
})]
|
|
155
155
|
}), l && v.collaborationMessage && /* @__PURE__ */ r(Fe, {
|
|
156
156
|
maxCount: ye
|
|
@@ -161,8 +161,8 @@ function Ye() {
|
|
|
161
161
|
color: "textOnLightSecondary",
|
|
162
162
|
children: t(o.contentSharedWithExternalCollaborators)
|
|
163
163
|
})]
|
|
164
|
-
}), l && b && /* @__PURE__ */
|
|
165
|
-
children: [!
|
|
164
|
+
}), l && b && /* @__PURE__ */ ue(/* @__PURE__ */ i(Ie, {
|
|
165
|
+
children: [!w && /* @__PURE__ */ i(h.Footer, {
|
|
166
166
|
children: [/* @__PURE__ */ r(h.Footer.SecondaryButton, {
|
|
167
167
|
disabled: c,
|
|
168
168
|
onClick: ne,
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import
|
|
1
|
+
import y from "lodash/camelCase";
|
|
2
2
|
import { useIntl as D } from "react-intl";
|
|
3
|
-
import { Row as S, Cell as m, Text as n, Tooltip as
|
|
4
|
-
import { XMark as
|
|
5
|
-
import { CollaboratorAvatar as
|
|
6
|
-
import
|
|
3
|
+
import { Row as S, Cell as m, Text as n, Tooltip as z, IconButton as B } from "@box/blueprint-web";
|
|
4
|
+
import { XMark as L } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
+
import { CollaboratorAvatar as M } from "./collaborator-avatar.js";
|
|
6
|
+
import N from "../messages.js";
|
|
7
7
|
import s from "./messages.js";
|
|
8
8
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
9
|
-
import { isCollaboratorRoleSupported as
|
|
10
|
-
import { useUnifiedShareModalContext as
|
|
11
|
-
import { useUnifiedShareFormContext as
|
|
12
|
-
import '../../../../../styles/collaborator-list-item.css';const
|
|
13
|
-
nameCell:
|
|
14
|
-
nameDetails:
|
|
15
|
-
roleCell:
|
|
16
|
-
text:
|
|
9
|
+
import { isCollaboratorRoleSupported as I } from "../../../utils/collaborator.js";
|
|
10
|
+
import { useUnifiedShareModalContext as j } from "../../../contexts/unified-share-modal-context.js";
|
|
11
|
+
import { useUnifiedShareFormContext as k } from "../../../contexts/unified-share-form-context.js";
|
|
12
|
+
import '../../../../../styles/collaborator-list-item.css';const w = "_nameCell_y1zd0_1", O = "_nameDetails_y1zd0_7", T = "_roleCell_y1zd0_15", U = "_text_y1zd0_22", l = {
|
|
13
|
+
nameCell: w,
|
|
14
|
+
nameDetails: O,
|
|
15
|
+
roleCell: T,
|
|
16
|
+
text: U
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
collaborator: a
|
|
18
|
+
function K({
|
|
19
|
+
collaborator: a,
|
|
20
|
+
isSmall: c
|
|
20
21
|
}) {
|
|
21
22
|
const {
|
|
22
23
|
formatMessage: o
|
|
23
24
|
} = D(), {
|
|
24
25
|
email: i,
|
|
25
|
-
hasCustomRole:
|
|
26
|
-
id:
|
|
27
|
-
isPending:
|
|
28
|
-
isRemovable:
|
|
29
|
-
name:
|
|
26
|
+
hasCustomRole: d,
|
|
27
|
+
id: p,
|
|
28
|
+
isPending: C,
|
|
29
|
+
isRemovable: f,
|
|
30
|
+
name: h,
|
|
30
31
|
role: r
|
|
31
32
|
} = a, {
|
|
32
|
-
item:
|
|
33
|
-
setCollaborator:
|
|
34
|
-
} =
|
|
35
|
-
permissions:
|
|
36
|
-
} =
|
|
37
|
-
onModalViewChange:
|
|
38
|
-
} =
|
|
39
|
-
|
|
33
|
+
item: u,
|
|
34
|
+
setCollaborator: v
|
|
35
|
+
} = j(), {
|
|
36
|
+
permissions: x = {}
|
|
37
|
+
} = u, {
|
|
38
|
+
onModalViewChange: _
|
|
39
|
+
} = k(), b = I(r) ? o(N[`${y(r)}Role`]) : "", g = d ? r : b, R = () => {
|
|
40
|
+
v(a), _("remove-collaborator");
|
|
40
41
|
};
|
|
41
42
|
return /* @__PURE__ */ t(S, {
|
|
42
|
-
id:
|
|
43
|
+
id: p,
|
|
43
44
|
children: [/* @__PURE__ */ e(m, {
|
|
44
45
|
children: /* @__PURE__ */ t("div", {
|
|
45
46
|
className: l.nameCell,
|
|
46
|
-
children: [/* @__PURE__ */ e(
|
|
47
|
+
children: [/* @__PURE__ */ e(M, {
|
|
47
48
|
collaborator: a,
|
|
48
49
|
isBadgeable: !0,
|
|
49
50
|
size: "large"
|
|
@@ -52,7 +53,7 @@ function J({
|
|
|
52
53
|
children: [/* @__PURE__ */ e(n, {
|
|
53
54
|
as: "span",
|
|
54
55
|
variant: "bodyDefaultSemibold",
|
|
55
|
-
children:
|
|
56
|
+
children: h
|
|
56
57
|
}), i && /* @__PURE__ */ e(n, {
|
|
57
58
|
as: "span",
|
|
58
59
|
color: "textOnLightSecondary",
|
|
@@ -61,20 +62,20 @@ function J({
|
|
|
61
62
|
})]
|
|
62
63
|
})]
|
|
63
64
|
})
|
|
64
|
-
}), /* @__PURE__ */ e(m, {
|
|
65
|
+
}), !c && /* @__PURE__ */ e(m, {
|
|
65
66
|
children: /* @__PURE__ */ t("div", {
|
|
66
67
|
className: l.roleCell,
|
|
67
68
|
children: [/* @__PURE__ */ e(n, {
|
|
68
69
|
as: "span",
|
|
69
70
|
className: l.text,
|
|
70
71
|
color: "textOnLightSecondary",
|
|
71
|
-
children:
|
|
72
|
-
}),
|
|
72
|
+
children: C ? o(s.pendingRole) : g
|
|
73
|
+
}), f && x.canRemoveCollaborator && /* @__PURE__ */ e(z, {
|
|
73
74
|
content: o(s.removeButton),
|
|
74
|
-
children: /* @__PURE__ */ e(
|
|
75
|
+
children: /* @__PURE__ */ e(B, {
|
|
75
76
|
"aria-label": o(s.removeButton),
|
|
76
|
-
icon:
|
|
77
|
-
onClick:
|
|
77
|
+
icon: L,
|
|
78
|
+
onClick: R
|
|
78
79
|
})
|
|
79
80
|
})]
|
|
80
81
|
})
|
|
@@ -82,5 +83,5 @@ function J({
|
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
K as CollaboratorListItem
|
|
86
87
|
};
|