@box/unified-share-modal 1.36.5 → 1.36.7
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/unified-share-form-modal/collaboration-section/collaboration-role.js +62 -64
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +134 -124
- package/dist/esm/lib/components/unified-share-form-modal/collaborators-view/collaborators-view.js +62 -56
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +42 -44
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +36 -38
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +102 -96
- package/dist/styles/collaboration-role.css +1 -1
- package/dist/styles/collaboration-section.css +1 -1
- package/dist/styles/collaborators-view.css +1 -1
- package/dist/styles/shared-link-access.css +1 -1
- package/dist/styles/shared-link-section.css +1 -1
- package/package.json +9 -9
package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js
CHANGED
|
@@ -1,110 +1,108 @@
|
|
|
1
|
-
import
|
|
2
|
-
import L from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import j from "../messages.js";
|
|
1
|
+
import y from "lodash/camelCase";
|
|
2
|
+
import { useState as L, useMemo as k, useEffect as w } from "react";
|
|
3
|
+
import { useIntl as F } from "react-intl";
|
|
4
|
+
import { Tooltip as N, Focusable as O, TriggerButton as D, DropdownMenu as n } from "@box/blueprint-web";
|
|
5
|
+
import $ from "../messages.js";
|
|
7
6
|
import l from "./messages.js";
|
|
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
|
-
|
|
15
|
-
focusable: q
|
|
7
|
+
import { jsx as e, jsxs as j } from "react/jsx-runtime";
|
|
8
|
+
import { isInvitationRoleSupported as z, getDefaultCollaborationRole as A } from "../../../utils/collaborator.js";
|
|
9
|
+
import { useUnifiedShareFormContext as P } from "../../../contexts/unified-share-form-context.js";
|
|
10
|
+
import { useUnifiedShareModalContext as U } from "../../../contexts/unified-share-modal-context.js";
|
|
11
|
+
import '../../../../../styles/collaboration-role.css';const B = "_container_h88vi_1", E = "_focusable_h88vi_10", b = {
|
|
12
|
+
container: B,
|
|
13
|
+
focusable: E
|
|
16
14
|
};
|
|
17
|
-
function
|
|
15
|
+
function Z() {
|
|
18
16
|
const {
|
|
19
|
-
formatMessage:
|
|
20
|
-
} =
|
|
17
|
+
formatMessage: t
|
|
18
|
+
} = F(), [f, M] = L(!1), {
|
|
21
19
|
collaborationRole: u,
|
|
22
|
-
setCollaborationRole:
|
|
23
|
-
} =
|
|
20
|
+
setCollaborationRole: c
|
|
21
|
+
} = P(), {
|
|
24
22
|
collaborationRoles: g,
|
|
25
23
|
isSubmitting: S,
|
|
26
24
|
item: I
|
|
27
|
-
} =
|
|
25
|
+
} = U(), {
|
|
28
26
|
permissions: T = {},
|
|
29
|
-
type:
|
|
30
|
-
} = I,
|
|
27
|
+
type: d
|
|
28
|
+
} = I, r = k(() => g.map((i) => {
|
|
31
29
|
const {
|
|
32
|
-
description:
|
|
33
|
-
id:
|
|
34
|
-
label:
|
|
35
|
-
} = i,
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
return
|
|
30
|
+
description: m,
|
|
31
|
+
id: o,
|
|
32
|
+
label: s
|
|
33
|
+
} = i, p = z(o), C = y(o);
|
|
34
|
+
let R = C;
|
|
35
|
+
o === "editor" && d === "folder" && (R += "Folder");
|
|
36
|
+
let v = o, x = "";
|
|
37
|
+
return p && (v = t($[`${C}Role`]), x = t(l[`${R}Description`])), {
|
|
40
38
|
...i,
|
|
41
|
-
description:
|
|
42
|
-
label:
|
|
39
|
+
description: m ?? x,
|
|
40
|
+
label: s ?? v
|
|
43
41
|
};
|
|
44
|
-
}), [g,
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
}, [
|
|
42
|
+
}), [g, t, d]);
|
|
43
|
+
if (w(() => {
|
|
44
|
+
c(A(r));
|
|
45
|
+
}, [r, c]), !r.length || !u)
|
|
48
46
|
return null;
|
|
49
47
|
const {
|
|
50
|
-
id:
|
|
51
|
-
label:
|
|
48
|
+
id: _,
|
|
49
|
+
label: h
|
|
52
50
|
} = u;
|
|
53
51
|
let a;
|
|
54
|
-
return T.canInviteCollaborator || (a =
|
|
52
|
+
return T.canInviteCollaborator || (a = t(l.inviteDisabledTooltip)), d === "web_link" && (a = t(l.inviteWebLinkDisabledTooltip)), a ? /* @__PURE__ */ e(N, {
|
|
55
53
|
align: "start",
|
|
56
54
|
content: a,
|
|
57
55
|
"data-testid": "collaboration-role-tooltip",
|
|
58
56
|
side: "bottom",
|
|
59
|
-
children: /* @__PURE__ */ e(
|
|
60
|
-
className:
|
|
57
|
+
children: /* @__PURE__ */ e(O, {
|
|
58
|
+
className: b.focusable,
|
|
61
59
|
children: /* @__PURE__ */ e(D, {
|
|
62
60
|
caretDirection: "down",
|
|
63
|
-
className:
|
|
61
|
+
className: b.container,
|
|
64
62
|
disabled: !0,
|
|
65
|
-
label:
|
|
66
|
-
role:
|
|
63
|
+
label: t(l.inviteAsRoleLabel, {
|
|
64
|
+
role: h
|
|
67
65
|
}),
|
|
68
66
|
size: "extraSmall",
|
|
69
67
|
variant: "tertiary"
|
|
70
68
|
})
|
|
71
69
|
})
|
|
72
|
-
}) : /* @__PURE__ */
|
|
70
|
+
}) : /* @__PURE__ */ j(n.Root, {
|
|
73
71
|
onOpenChange: M,
|
|
74
72
|
open: f,
|
|
75
|
-
children: [/* @__PURE__ */ e(
|
|
73
|
+
children: [/* @__PURE__ */ e(n.Trigger, {
|
|
76
74
|
children: /* @__PURE__ */ e(D, {
|
|
77
75
|
caretDirection: f ? "up" : "down",
|
|
78
|
-
className:
|
|
76
|
+
className: b.container,
|
|
79
77
|
disabled: S,
|
|
80
|
-
label:
|
|
81
|
-
role:
|
|
78
|
+
label: t(l.inviteAsRoleLabel, {
|
|
79
|
+
role: h
|
|
82
80
|
}),
|
|
83
81
|
size: "extraSmall",
|
|
84
82
|
variant: "tertiary"
|
|
85
83
|
})
|
|
86
|
-
}), /* @__PURE__ */ e(
|
|
84
|
+
}), /* @__PURE__ */ e(n.Content, {
|
|
87
85
|
align: "start",
|
|
88
|
-
children:
|
|
86
|
+
children: r.map((i) => {
|
|
89
87
|
const {
|
|
90
|
-
description:
|
|
91
|
-
isDisabled:
|
|
92
|
-
id:
|
|
93
|
-
label:
|
|
88
|
+
description: m,
|
|
89
|
+
isDisabled: o,
|
|
90
|
+
id: s,
|
|
91
|
+
label: p
|
|
94
92
|
} = i;
|
|
95
|
-
return /* @__PURE__ */ e(
|
|
96
|
-
checked:
|
|
97
|
-
disabled:
|
|
98
|
-
onSelect: () =>
|
|
99
|
-
children: /* @__PURE__ */ e(
|
|
100
|
-
caption:
|
|
101
|
-
label:
|
|
93
|
+
return /* @__PURE__ */ e(n.CheckboxItem, {
|
|
94
|
+
checked: _ === s,
|
|
95
|
+
disabled: o,
|
|
96
|
+
onSelect: () => c(i),
|
|
97
|
+
children: /* @__PURE__ */ e(n.Item.MainContent, {
|
|
98
|
+
caption: m,
|
|
99
|
+
label: p
|
|
102
100
|
})
|
|
103
|
-
},
|
|
101
|
+
}, s);
|
|
104
102
|
})
|
|
105
103
|
})]
|
|
106
104
|
});
|
|
107
105
|
}
|
|
108
106
|
export {
|
|
109
|
-
|
|
107
|
+
Z as CollaborationRole
|
|
110
108
|
};
|
|
@@ -1,86 +1,92 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import me from "clsx";
|
|
2
|
+
import { useState as ue, useRef as pe, useEffect as I, useCallback as F } from "react";
|
|
3
|
+
import { createPortal as he } from "react-dom";
|
|
4
|
+
import { useIntl as fe } from "react-intl";
|
|
5
|
+
import { useBlueprintModernization as be, useNotification as Ce, useUniqueId as ge, useLabelable as ve, Tooltip as Se, Focusable as _e, Text as Le, Modal as h } from "@box/blueprint-web";
|
|
6
|
+
import { Globe as Ue } from "@box/blueprint-web-assets/icons/Medium";
|
|
7
|
+
import { bpSize040 as R } from "@box/blueprint-web-assets/tokens/tokens";
|
|
8
|
+
import { UserSelectorContainer as Fe } from "@box/user-selector";
|
|
9
|
+
import { CollaborationRole as ye } from "./collaboration-role.js";
|
|
10
|
+
import { SharedWithAvatars as Ae } from "./shared-with-avatars.js";
|
|
11
|
+
import { ShieldRestrictionNotice as xe } from "./shield-restriction-notice.js";
|
|
12
|
+
import { TextAreaContainer as Ee } from "./text-area-container.js";
|
|
13
|
+
import { COLLABORATION_MESSAGE_CHARACTER_LIMIT as Be } from "../../../constants.js";
|
|
12
14
|
import o from "./messages.js";
|
|
13
|
-
import { jsxs as
|
|
14
|
-
import { useFormValidation as
|
|
15
|
-
import { useCollaborationForm as
|
|
16
|
-
import { useUnifiedShareFormContext as
|
|
17
|
-
import { useUnifiedShareModalContext as
|
|
18
|
-
import '../../../../../styles/collaboration-section.css';const
|
|
19
|
-
container:
|
|
20
|
-
label:
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
import { jsxs as a, jsx as r, Fragment as Ne } from "react/jsx-runtime";
|
|
16
|
+
import { useFormValidation as Ve } from "../../../hooks/use-form-validation.js";
|
|
17
|
+
import { useCollaborationForm as Ie } from "../../../hooks/use-collaboration-form.js";
|
|
18
|
+
import { useUnifiedShareFormContext as Re } from "../../../contexts/unified-share-form-context.js";
|
|
19
|
+
import { useUnifiedShareModalContext as Te } from "../../../contexts/unified-share-modal-context.js";
|
|
20
|
+
import '../../../../../styles/collaboration-section.css';const Me = "_container_1spii_2", Oe = "_label_1spii_8", Pe = "_modernized_1spii_15", ke = "_security_1spii_33", ze = "_icon_1spii_37", we = "_access_1spii_43", s = {
|
|
21
|
+
container: Me,
|
|
22
|
+
label: Oe,
|
|
23
|
+
modernized: Pe,
|
|
24
|
+
security: ke,
|
|
25
|
+
icon: ze,
|
|
26
|
+
access: we
|
|
23
27
|
};
|
|
24
|
-
function
|
|
28
|
+
function at() {
|
|
25
29
|
const {
|
|
26
30
|
formatMessage: t
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
} =
|
|
32
|
-
|
|
31
|
+
} = fe(), [f, y] = ue(), {
|
|
32
|
+
enableModernizedComponents: T
|
|
33
|
+
} = be(), {
|
|
34
|
+
addNotification: M
|
|
35
|
+
} = Ce(), {
|
|
36
|
+
validateShieldRestriction: O
|
|
37
|
+
} = Ve(), {
|
|
38
|
+
contactValue: P,
|
|
33
39
|
container: b,
|
|
34
|
-
onModalOpenChange:
|
|
40
|
+
onModalOpenChange: A,
|
|
35
41
|
onShareViewChange: C,
|
|
36
|
-
setUserContacts:
|
|
37
|
-
shareView:
|
|
38
|
-
userContacts:
|
|
39
|
-
} =
|
|
40
|
-
collaborationAccess:
|
|
41
|
-
collaborationNotices:
|
|
42
|
-
config:
|
|
43
|
-
contactService:
|
|
44
|
-
isFetching:
|
|
45
|
-
isSubmitting:
|
|
46
|
-
item:
|
|
47
|
-
sharingService:
|
|
48
|
-
} =
|
|
49
|
-
permissions:
|
|
50
|
-
type:
|
|
51
|
-
} =
|
|
52
|
-
getContacts:
|
|
42
|
+
setUserContacts: k,
|
|
43
|
+
shareView: i,
|
|
44
|
+
userContacts: n
|
|
45
|
+
} = Re(), {
|
|
46
|
+
collaborationAccess: z,
|
|
47
|
+
collaborationNotices: w,
|
|
48
|
+
config: g,
|
|
49
|
+
contactService: D,
|
|
50
|
+
isFetching: G,
|
|
51
|
+
isSubmitting: W,
|
|
52
|
+
item: j,
|
|
53
|
+
sharingService: q
|
|
54
|
+
} = Te(), {
|
|
55
|
+
permissions: H = {},
|
|
56
|
+
type: K
|
|
57
|
+
} = j, {
|
|
58
|
+
getContacts: v,
|
|
53
59
|
getContactsAvatarUrls: S
|
|
54
|
-
} =
|
|
55
|
-
sendInvitations:
|
|
56
|
-
sendSharedLink:
|
|
57
|
-
} =
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
+
} = D, {
|
|
61
|
+
sendInvitations: $,
|
|
62
|
+
sendSharedLink: J
|
|
63
|
+
} = q;
|
|
64
|
+
let _, L;
|
|
65
|
+
i === "invite" && (_ = $, L = "invite-collaborators"), i === "email" && (_ = J, L = "email-shared-link");
|
|
60
66
|
const {
|
|
61
|
-
errors:
|
|
62
|
-
handleFormReset:
|
|
63
|
-
handleFormSubmit:
|
|
64
|
-
handleSelectedUsersChange:
|
|
65
|
-
handleUserSelectorBlur:
|
|
66
|
-
isFormSubmitting:
|
|
67
|
-
updateContactValue:
|
|
68
|
-
} =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
(!
|
|
73
|
-
}, [
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
67
|
+
errors: Q,
|
|
68
|
+
handleFormReset: x,
|
|
69
|
+
handleFormSubmit: X,
|
|
70
|
+
handleSelectedUsersChange: E,
|
|
71
|
+
handleUserSelectorBlur: Y,
|
|
72
|
+
isFormSubmitting: Z,
|
|
73
|
+
updateContactValue: ee
|
|
74
|
+
} = Ie(_, L), l = i === "default" || i === "invite", c = i === "invite" || i === "email", d = W ?? Z, te = n.some((e) => e.isExternalUser), B = pe(i === "email" ? "email" : "invite");
|
|
75
|
+
I(() => {
|
|
76
|
+
B.current = i === "email" ? "email" : "invite";
|
|
77
|
+
}, [i]), I(() => {
|
|
78
|
+
(!n.length || !n.some((e) => e.chipVariant === "error")) && y(null);
|
|
79
|
+
}, [n]);
|
|
80
|
+
const oe = F((e) => (e.stopPropagation(), !0), []), re = F((e) => v ? v(e, B.current) : Promise.resolve([]), [v]), ie = F((e) => S ? S(e) : Promise.resolve({}), [S]), ne = (e) => {
|
|
81
|
+
c || C("invite"), ee(e);
|
|
82
|
+
}, ae = () => {
|
|
83
|
+
x(), C("default");
|
|
84
|
+
}, se = async () => {
|
|
79
85
|
try {
|
|
80
|
-
if (
|
|
81
|
-
const e =
|
|
86
|
+
if (f) {
|
|
87
|
+
const e = O(n);
|
|
82
88
|
if (e) {
|
|
83
|
-
|
|
89
|
+
M({
|
|
84
90
|
closeButtonAriaLabel: t(o.closeButton),
|
|
85
91
|
sensitivity: "foreground",
|
|
86
92
|
styledText: e,
|
|
@@ -90,87 +96,91 @@ function Ye() {
|
|
|
90
96
|
return;
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
|
-
if (await
|
|
99
|
+
if (await X())
|
|
94
100
|
return;
|
|
95
|
-
|
|
101
|
+
x(), A && A(!1), C("default");
|
|
96
102
|
} catch (e) {
|
|
97
103
|
if (!e.shieldRestriction)
|
|
98
104
|
return;
|
|
99
105
|
const {
|
|
100
106
|
shieldRestriction: U
|
|
101
|
-
} = e, V = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []],
|
|
102
|
-
...
|
|
107
|
+
} = e, V = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []], de = n.map((p) => V.includes(p.email) || V.includes(`${p.id}`) ? {
|
|
108
|
+
...p,
|
|
103
109
|
chipVariant: "error"
|
|
104
|
-
} :
|
|
105
|
-
y(U),
|
|
110
|
+
} : p);
|
|
111
|
+
y(U), k(de);
|
|
106
112
|
}
|
|
107
113
|
};
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
className:
|
|
114
|
+
let m, u = !1;
|
|
115
|
+
l && !H.canInviteCollaborator && (m = t(o.inviteDisabledTooltip), u = !0), l && K === "web_link" && (m = t(o.inviteWebLinkDisabledTooltip), u = !0);
|
|
116
|
+
const N = ge("user-contacts-"), le = t(l ? o.invitePeopleLabel : o.emailSharedLinkLabel), ce = ve(le, N);
|
|
117
|
+
return /* @__PURE__ */ a("form", {
|
|
118
|
+
className: s.container,
|
|
113
119
|
onSubmit: (e) => e.preventDefault(),
|
|
114
|
-
children: [
|
|
115
|
-
error:
|
|
116
|
-
isLoading:
|
|
117
|
-
onSelectedUsersChange:
|
|
118
|
-
}),
|
|
119
|
-
children: [
|
|
120
|
-
className:
|
|
121
|
-
}), /* @__PURE__ */ r(
|
|
122
|
-
content:
|
|
120
|
+
children: [f && /* @__PURE__ */ r(xe, {
|
|
121
|
+
error: f,
|
|
122
|
+
isLoading: d,
|
|
123
|
+
onSelectedUsersChange: E
|
|
124
|
+
}), w, /* @__PURE__ */ a("div", {
|
|
125
|
+
children: [l && g.collaborators && /* @__PURE__ */ r(Ae, {}), /* @__PURE__ */ r(ce, {
|
|
126
|
+
className: me(s.label, T && s.modernized)
|
|
127
|
+
}), /* @__PURE__ */ r(Se, {
|
|
128
|
+
content: m,
|
|
123
129
|
"data-testid": "user-contacts-tooltip",
|
|
124
|
-
open:
|
|
130
|
+
open: m ? void 0 : !1,
|
|
125
131
|
side: "bottom",
|
|
126
|
-
children: /* @__PURE__ */ r(
|
|
132
|
+
children: /* @__PURE__ */ r(_e, {
|
|
127
133
|
focusable: u,
|
|
128
|
-
children: /* @__PURE__ */ r(
|
|
134
|
+
children: /* @__PURE__ */ r(Fe, {
|
|
129
135
|
className: "collaboration-user-selector",
|
|
130
136
|
clearButtonAriaLabel: t(o.clearButton),
|
|
131
137
|
clearOnBlur: !1,
|
|
132
|
-
disabled: u ||
|
|
138
|
+
disabled: u || d,
|
|
133
139
|
displayChipVariant: (e) => e.chipVariant,
|
|
134
|
-
error:
|
|
135
|
-
fetchAvatarUrls:
|
|
136
|
-
fetchUsers:
|
|
137
|
-
hideOnEscape:
|
|
138
|
-
idForLabel:
|
|
139
|
-
inputValue:
|
|
140
|
+
error: Q["user-contact"],
|
|
141
|
+
fetchAvatarUrls: ie,
|
|
142
|
+
fetchUsers: re,
|
|
143
|
+
hideOnEscape: oe,
|
|
144
|
+
idForLabel: N,
|
|
145
|
+
inputValue: P,
|
|
140
146
|
label: null,
|
|
141
|
-
onBlur:
|
|
142
|
-
onInputValueChange:
|
|
143
|
-
onSelectedUsersChange:
|
|
144
|
-
placeholder:
|
|
147
|
+
onBlur: Y,
|
|
148
|
+
onInputValueChange: ne,
|
|
149
|
+
onSelectedUsersChange: E,
|
|
150
|
+
placeholder: n.length ? "" : t(o.invitePeoplePlaceholder),
|
|
145
151
|
portalElement: b,
|
|
146
|
-
selectedUsers:
|
|
152
|
+
selectedUsers: n,
|
|
147
153
|
selectOnEnterOrTab: !0,
|
|
148
|
-
variant:
|
|
154
|
+
variant: c ? "textarea" : "input"
|
|
149
155
|
})
|
|
150
156
|
})
|
|
151
|
-
}),
|
|
152
|
-
className:
|
|
153
|
-
children: [
|
|
157
|
+
}), l && /* @__PURE__ */ a("div", {
|
|
158
|
+
className: s.access,
|
|
159
|
+
children: [g.collaborationRole && /* @__PURE__ */ r(ye, {}), z]
|
|
154
160
|
})]
|
|
155
|
-
}),
|
|
156
|
-
maxCount:
|
|
157
|
-
}),
|
|
158
|
-
className:
|
|
159
|
-
children: [/* @__PURE__ */ r(
|
|
161
|
+
}), c && g.collaborationMessage && /* @__PURE__ */ r(Ee, {
|
|
162
|
+
maxCount: Be
|
|
163
|
+
}), c && te && /* @__PURE__ */ a("div", {
|
|
164
|
+
className: s.security,
|
|
165
|
+
children: [/* @__PURE__ */ r(Ue, {
|
|
166
|
+
className: s.icon,
|
|
167
|
+
height: R,
|
|
168
|
+
width: R
|
|
169
|
+
}), /* @__PURE__ */ r(Le, {
|
|
160
170
|
as: "span",
|
|
161
171
|
color: "textOnLightSecondary",
|
|
162
172
|
children: t(o.contentSharedWithExternalCollaborators)
|
|
163
173
|
})]
|
|
164
|
-
}),
|
|
165
|
-
children: [!
|
|
174
|
+
}), c && b && /* @__PURE__ */ he(/* @__PURE__ */ a(Ne, {
|
|
175
|
+
children: [!G && /* @__PURE__ */ a(h.Footer, {
|
|
166
176
|
children: [/* @__PURE__ */ r(h.Footer.SecondaryButton, {
|
|
167
|
-
disabled:
|
|
168
|
-
onClick:
|
|
177
|
+
disabled: d,
|
|
178
|
+
onClick: ae,
|
|
169
179
|
children: t(o.cancelButton)
|
|
170
180
|
}), /* @__PURE__ */ r(h.Footer.PrimaryButton, {
|
|
171
|
-
loading:
|
|
181
|
+
loading: d,
|
|
172
182
|
loadingAriaLabel: t(o.loadingLabel),
|
|
173
|
-
onClick:
|
|
183
|
+
onClick: se,
|
|
174
184
|
children: t(o.sendButton)
|
|
175
185
|
})]
|
|
176
186
|
}), /* @__PURE__ */ r(h.Close, {
|
|
@@ -180,5 +190,5 @@ function Ye() {
|
|
|
180
190
|
});
|
|
181
191
|
}
|
|
182
192
|
export {
|
|
183
|
-
|
|
193
|
+
at as CollaborationSection
|
|
184
194
|
};
|
package/dist/esm/lib/components/unified-share-form-modal/collaborators-view/collaborators-view.js
CHANGED
|
@@ -1,88 +1,94 @@
|
|
|
1
1
|
import { createPortal as C } from "react-dom";
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { useBreakpoint as
|
|
4
|
-
import { CollaboratorListItem as
|
|
5
|
-
import
|
|
6
|
-
import { jsxs as
|
|
7
|
-
import { useUnifiedShareModalContext as
|
|
8
|
-
import { useUnifiedShareFormContext as
|
|
9
|
-
import
|
|
2
|
+
import { useIntl as v } from "react-intl";
|
|
3
|
+
import { useBreakpoint as y, Breakpoint as S, Link as h, Table as x, TableHeader as B, Column as f, TableBody as L, Modal as t } from "@box/blueprint-web";
|
|
4
|
+
import { CollaboratorListItem as q } from "./collaborator-list-item.js";
|
|
5
|
+
import l from "./messages.js";
|
|
6
|
+
import { jsxs as a, jsx as e, Fragment as F } from "react/jsx-runtime";
|
|
7
|
+
import { useUnifiedShareModalContext as M } from "../../../contexts/unified-share-modal-context.js";
|
|
8
|
+
import { useUnifiedShareFormContext as N } from "../../../contexts/unified-share-form-context.js";
|
|
9
|
+
import { callOnKeyboardEvent as w } from "../../../utils/event.js";
|
|
10
|
+
import '../../../../../styles/collaborators-view.css';const H = "_manage_1ilfq_1", I = "_link_1ilfq_7", T = "_list_1ilfq_11", j = "_scroll_1ilfq_28", A = "_header_1ilfq_34", n = {
|
|
10
11
|
manage: H,
|
|
11
|
-
|
|
12
|
-
list:
|
|
12
|
+
link: I,
|
|
13
|
+
list: T,
|
|
13
14
|
scroll: j,
|
|
14
|
-
header:
|
|
15
|
+
header: A
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
+
function G() {
|
|
17
18
|
const {
|
|
18
19
|
formatMessage: o
|
|
19
|
-
} =
|
|
20
|
+
} = v(), i = y() === S.Small, {
|
|
20
21
|
collaborators: u,
|
|
21
|
-
config:
|
|
22
|
-
eventService:
|
|
23
|
-
isFetching:
|
|
22
|
+
config: s,
|
|
23
|
+
eventService: b,
|
|
24
|
+
isFetching: c,
|
|
24
25
|
item: p
|
|
25
|
-
} =
|
|
26
|
+
} = M(), {
|
|
26
27
|
id: _,
|
|
27
|
-
type:
|
|
28
|
+
type: g
|
|
28
29
|
} = p, {
|
|
29
|
-
onCollaboratorsManagementClick:
|
|
30
|
-
} =
|
|
31
|
-
container:
|
|
32
|
-
onShareViewChange:
|
|
33
|
-
} =
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
inert:
|
|
36
|
-
children: [
|
|
37
|
-
className:
|
|
38
|
-
children:
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
onCollaboratorsManagementClick: r
|
|
31
|
+
} = b, {
|
|
32
|
+
container: m,
|
|
33
|
+
onShareViewChange: k
|
|
34
|
+
} = N();
|
|
35
|
+
return /* @__PURE__ */ a("div", {
|
|
36
|
+
inert: c ? "" : null,
|
|
37
|
+
children: [s.collaboratorsManagement && /* @__PURE__ */ e("div", {
|
|
38
|
+
className: n.manage,
|
|
39
|
+
children: r ? /* @__PURE__ */ e(h, {
|
|
40
|
+
className: n.link,
|
|
41
|
+
onClick: r,
|
|
42
|
+
onKeyDown: w(r, {
|
|
43
|
+
canPreventDefault: !0
|
|
44
|
+
}),
|
|
45
|
+
role: "button",
|
|
46
|
+
tabIndex: 0,
|
|
47
|
+
variant: "standalone",
|
|
48
|
+
children: o(l.manageAllLink)
|
|
49
|
+
}) : /* @__PURE__ */ e(h, {
|
|
50
|
+
href: `/${g}/${_}/collaborators`,
|
|
45
51
|
rel: "noopener",
|
|
46
52
|
target: "_blank",
|
|
47
53
|
variant: "standalone",
|
|
48
|
-
children: o(
|
|
54
|
+
children: o(l.manageAllLink)
|
|
49
55
|
})
|
|
50
56
|
}), /* @__PURE__ */ e("div", {
|
|
51
|
-
className:
|
|
57
|
+
className: n.list,
|
|
52
58
|
children: /* @__PURE__ */ e("div", {
|
|
53
|
-
className:
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
"aria-label": o(
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
children: [/* @__PURE__ */ e(
|
|
59
|
+
className: n.scroll,
|
|
60
|
+
children: /* @__PURE__ */ a(x, {
|
|
61
|
+
"aria-label": o(l.listLabel),
|
|
62
|
+
children: [/* @__PURE__ */ a(B, {
|
|
63
|
+
className: n.header,
|
|
64
|
+
children: [/* @__PURE__ */ e(f, {
|
|
59
65
|
hideHeader: !0,
|
|
60
66
|
isRowHeader: !0,
|
|
61
|
-
children: o(
|
|
62
|
-
}), !
|
|
67
|
+
children: o(l.nameColumn)
|
|
68
|
+
}), !i && /* @__PURE__ */ e(f, {
|
|
63
69
|
hideHeader: !0,
|
|
64
|
-
children: o(
|
|
70
|
+
children: o(l.roleColumn)
|
|
65
71
|
})]
|
|
66
72
|
}), /* @__PURE__ */ e(L, {
|
|
67
|
-
children: u.slice(0,
|
|
73
|
+
children: u.slice(0, s.collaboratorsLimit).map((d) => /* @__PURE__ */ e(q, {
|
|
68
74
|
collaborator: d,
|
|
69
|
-
isSmall:
|
|
75
|
+
isSmall: i
|
|
70
76
|
}, d.id))
|
|
71
77
|
})]
|
|
72
78
|
})
|
|
73
79
|
})
|
|
74
|
-
}),
|
|
75
|
-
children: [!
|
|
76
|
-
children: /* @__PURE__ */ e(
|
|
77
|
-
onClick: () =>
|
|
78
|
-
children: o(
|
|
80
|
+
}), m && /* @__PURE__ */ C(/* @__PURE__ */ a(F, {
|
|
81
|
+
children: [!c && /* @__PURE__ */ e(t.Footer, {
|
|
82
|
+
children: /* @__PURE__ */ e(t.Footer.SecondaryButton, {
|
|
83
|
+
onClick: () => k("default"),
|
|
84
|
+
children: o(l.doneButton)
|
|
79
85
|
})
|
|
80
|
-
}), /* @__PURE__ */ e(
|
|
81
|
-
"aria-label": o(
|
|
86
|
+
}), /* @__PURE__ */ e(t.Close, {
|
|
87
|
+
"aria-label": o(l.closeButton)
|
|
82
88
|
})]
|
|
83
|
-
}),
|
|
89
|
+
}), m)]
|
|
84
90
|
});
|
|
85
91
|
}
|
|
86
92
|
export {
|
|
87
|
-
|
|
93
|
+
G as CollaboratorsView
|
|
88
94
|
};
|
package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js
CHANGED
|
@@ -1,85 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { DropdownMenu as n, TriggerButton as j, Tooltip as T, Focusable as w } from "@box/blueprint-web";
|
|
1
|
+
import { useState as I } from "react";
|
|
2
|
+
import { useIntl as _ } from "react-intl";
|
|
3
|
+
import { DropdownMenu as n, TriggerButton as v, Tooltip as T, Focusable as w } from "@box/blueprint-web";
|
|
5
4
|
import O from "./messages.js";
|
|
6
|
-
import { jsxs as
|
|
7
|
-
import { useUnifiedShareModalContext as
|
|
8
|
-
import { useSharingAction as
|
|
9
|
-
import { useAccessLevels as
|
|
10
|
-
import '../../../../../styles/shared-link-access.css';const
|
|
11
|
-
container:
|
|
12
|
-
|
|
13
|
-
content: F
|
|
5
|
+
import { jsxs as j, jsx as e } from "react/jsx-runtime";
|
|
6
|
+
import { useUnifiedShareModalContext as y } from "../../../contexts/unified-share-modal-context.js";
|
|
7
|
+
import { useSharingAction as D } from "../../../hooks/use-sharing-action.js";
|
|
8
|
+
import { useAccessLevels as N } from "../../../hooks/use-access-levels.js";
|
|
9
|
+
import '../../../../../styles/shared-link-access.css';const R = "_container_1um3f_1", z = "_content_1um3f_9", l = {
|
|
10
|
+
container: R,
|
|
11
|
+
content: z
|
|
14
12
|
};
|
|
15
|
-
function
|
|
13
|
+
function K() {
|
|
16
14
|
const {
|
|
17
15
|
formatMessage: d
|
|
18
|
-
} =
|
|
16
|
+
} = _(), [s, m] = I(!1), {
|
|
19
17
|
isSubmitting: h,
|
|
20
18
|
item: p,
|
|
21
19
|
sharedLink: u,
|
|
22
|
-
sharingService:
|
|
23
|
-
} =
|
|
24
|
-
permissions:
|
|
20
|
+
sharingService: f
|
|
21
|
+
} = y(), {
|
|
22
|
+
permissions: g = {}
|
|
25
23
|
} = p, {
|
|
26
24
|
access: S
|
|
27
25
|
} = u, {
|
|
28
26
|
changeSharedLinkAccess: b
|
|
29
|
-
} =
|
|
30
|
-
isLoading:
|
|
31
|
-
onAction:
|
|
32
|
-
} =
|
|
27
|
+
} = f, {
|
|
28
|
+
isLoading: A,
|
|
29
|
+
onAction: C
|
|
30
|
+
} = D(b), {
|
|
33
31
|
allowedLevels: c,
|
|
34
32
|
selectedAccess: i
|
|
35
|
-
} =
|
|
33
|
+
} = N();
|
|
36
34
|
if (!c.length || !i)
|
|
37
35
|
return null;
|
|
38
36
|
const {
|
|
39
|
-
label:
|
|
37
|
+
label: L
|
|
40
38
|
} = i;
|
|
41
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ j(n.Root, {
|
|
42
40
|
onOpenChange: m,
|
|
43
|
-
open:
|
|
41
|
+
open: s,
|
|
44
42
|
children: [/* @__PURE__ */ e(n.Trigger, {
|
|
45
|
-
children: /* @__PURE__ */ e(
|
|
46
|
-
caretDirection:
|
|
47
|
-
className:
|
|
48
|
-
disabled: !
|
|
49
|
-
label:
|
|
43
|
+
children: /* @__PURE__ */ e(v, {
|
|
44
|
+
caretDirection: s ? "up" : "down",
|
|
45
|
+
className: l.container,
|
|
46
|
+
disabled: !g.canSetShareAccess || (h ?? A),
|
|
47
|
+
label: L,
|
|
50
48
|
size: "extraSmall",
|
|
51
49
|
variant: "tertiary"
|
|
52
50
|
})
|
|
53
51
|
}), /* @__PURE__ */ e(n.Content, {
|
|
54
52
|
align: "start",
|
|
55
|
-
className:
|
|
56
|
-
children: c.map((
|
|
53
|
+
className: l.content,
|
|
54
|
+
children: c.map((k) => {
|
|
57
55
|
const {
|
|
58
|
-
description:
|
|
59
|
-
disabledReason:
|
|
56
|
+
description: r,
|
|
57
|
+
disabledReason: x,
|
|
60
58
|
id: t,
|
|
61
|
-
label:
|
|
62
|
-
} =
|
|
63
|
-
o ||
|
|
59
|
+
label: a
|
|
60
|
+
} = k, o = S === t, M = () => {
|
|
61
|
+
o || C(t);
|
|
64
62
|
};
|
|
65
|
-
return
|
|
63
|
+
return x ? /* @__PURE__ */ e(T, {
|
|
66
64
|
content: d(O.disabledAccessLevelTooltip),
|
|
67
65
|
children: /* @__PURE__ */ e(w, {
|
|
68
66
|
children: /* @__PURE__ */ e(n.CheckboxItem, {
|
|
69
67
|
checked: o,
|
|
70
68
|
disabled: !0,
|
|
71
69
|
children: /* @__PURE__ */ e(n.Item.MainContent, {
|
|
72
|
-
caption:
|
|
73
|
-
label:
|
|
70
|
+
caption: r,
|
|
71
|
+
label: a
|
|
74
72
|
})
|
|
75
73
|
}, t)
|
|
76
74
|
})
|
|
77
75
|
}, t) : /* @__PURE__ */ e(n.CheckboxItem, {
|
|
78
76
|
checked: o,
|
|
79
|
-
onSelect:
|
|
77
|
+
onSelect: M,
|
|
80
78
|
children: /* @__PURE__ */ e(n.Item.MainContent, {
|
|
81
|
-
caption:
|
|
82
|
-
label:
|
|
79
|
+
caption: r,
|
|
80
|
+
label: a
|
|
83
81
|
})
|
|
84
82
|
}, t);
|
|
85
83
|
})
|
|
@@ -87,5 +85,5 @@ function V() {
|
|
|
87
85
|
});
|
|
88
86
|
}
|
|
89
87
|
export {
|
|
90
|
-
|
|
88
|
+
K as SharedLinkAccess
|
|
91
89
|
};
|
|
@@ -1,96 +1,94 @@
|
|
|
1
|
-
import p from "clsx";
|
|
2
1
|
import { useState as I } from "react";
|
|
3
2
|
import { useIntl as O } from "react-intl";
|
|
4
|
-
import { Tooltip as
|
|
3
|
+
import { Tooltip as v, Focusable as E, TriggerButton as p, DropdownMenu as t } from "@box/blueprint-web";
|
|
5
4
|
import { FILE_EXTENSION_BOX_NOTE as w } from "../../../constants.js";
|
|
6
5
|
import D from "./messages.js";
|
|
7
6
|
import { jsx as e, jsxs as P } from "react/jsx-runtime";
|
|
8
7
|
import { usePermissionLevels as y } from "../../../hooks/use-permission-levels.js";
|
|
9
8
|
import { useUnifiedShareModalContext as A } from "../../../contexts/unified-share-modal-context.js";
|
|
10
9
|
import { useSharingAction as B } from "../../../hooks/use-sharing-action.js";
|
|
11
|
-
import '../../../../../styles/shared-link-access.css';const
|
|
12
|
-
container:
|
|
13
|
-
|
|
14
|
-
content: X
|
|
10
|
+
import '../../../../../styles/shared-link-access.css';const j = "_container_1um3f_1", z = "_content_1um3f_9", i = {
|
|
11
|
+
container: j,
|
|
12
|
+
content: z
|
|
15
13
|
};
|
|
16
|
-
function
|
|
14
|
+
function Q() {
|
|
17
15
|
const {
|
|
18
|
-
formatMessage:
|
|
19
|
-
} = O(), [
|
|
16
|
+
formatMessage: h
|
|
17
|
+
} = O(), [s, u] = I(!1), {
|
|
20
18
|
isSubmitting: f,
|
|
21
|
-
item:
|
|
22
|
-
sharedLink:
|
|
23
|
-
sharingService:
|
|
19
|
+
item: r,
|
|
20
|
+
sharedLink: g,
|
|
21
|
+
sharingService: S
|
|
24
22
|
} = A(), {
|
|
25
|
-
permissions:
|
|
26
|
-
} =
|
|
27
|
-
access:
|
|
23
|
+
permissions: b = {}
|
|
24
|
+
} = r, {
|
|
25
|
+
access: _,
|
|
28
26
|
permission: a
|
|
29
|
-
} =
|
|
27
|
+
} = g, {
|
|
30
28
|
changeSharedLinkPermission: x
|
|
31
|
-
} =
|
|
29
|
+
} = S, {
|
|
32
30
|
isLoading: L,
|
|
33
31
|
onAction: M
|
|
34
32
|
} = B(x), {
|
|
35
33
|
allowedLevels: c,
|
|
36
34
|
selectedPermission: l
|
|
37
35
|
} = y();
|
|
38
|
-
if (
|
|
36
|
+
if (_ === "collaborators" || !c.length || !l)
|
|
39
37
|
return null;
|
|
40
38
|
const {
|
|
41
|
-
label:
|
|
39
|
+
label: m
|
|
42
40
|
} = l;
|
|
43
|
-
let
|
|
44
|
-
return
|
|
41
|
+
let n = "";
|
|
42
|
+
return r.extension === w && a === "can_edit" && (n = h(D.canEditBoxNoteDisabledTooltip)), n ? /* @__PURE__ */ e(v, {
|
|
45
43
|
align: "start",
|
|
46
|
-
content:
|
|
44
|
+
content: n,
|
|
47
45
|
"data-testid": "shared-link-permission-tooltip",
|
|
48
46
|
side: "bottom",
|
|
49
47
|
children: /* @__PURE__ */ e(E, {
|
|
50
|
-
children: /* @__PURE__ */ e(
|
|
48
|
+
children: /* @__PURE__ */ e(p, {
|
|
51
49
|
caretDirection: "down",
|
|
52
|
-
className:
|
|
50
|
+
className: i.container,
|
|
53
51
|
disabled: !0,
|
|
54
|
-
label:
|
|
52
|
+
label: m,
|
|
55
53
|
size: "extraSmall",
|
|
56
54
|
variant: "tertiary"
|
|
57
55
|
})
|
|
58
56
|
})
|
|
59
57
|
}) : /* @__PURE__ */ P(t.Root, {
|
|
60
58
|
onOpenChange: u,
|
|
61
|
-
open:
|
|
59
|
+
open: s,
|
|
62
60
|
children: [/* @__PURE__ */ e(t.Trigger, {
|
|
63
|
-
children: /* @__PURE__ */ e(
|
|
64
|
-
caretDirection:
|
|
65
|
-
className:
|
|
66
|
-
disabled: !
|
|
67
|
-
label:
|
|
61
|
+
children: /* @__PURE__ */ e(p, {
|
|
62
|
+
caretDirection: s ? "up" : "down",
|
|
63
|
+
className: i.container,
|
|
64
|
+
disabled: !b.canSetShareAccess || (f ?? L),
|
|
65
|
+
label: m,
|
|
68
66
|
size: "extraSmall",
|
|
69
67
|
variant: "tertiary"
|
|
70
68
|
})
|
|
71
69
|
}), /* @__PURE__ */ e(t.Content, {
|
|
72
70
|
align: "start",
|
|
73
|
-
className:
|
|
71
|
+
className: i.content,
|
|
74
72
|
children: c.map((N) => {
|
|
75
73
|
const {
|
|
76
74
|
description: T,
|
|
77
|
-
id:
|
|
75
|
+
id: o,
|
|
78
76
|
label: k
|
|
79
|
-
} = N,
|
|
80
|
-
|
|
77
|
+
} = N, d = a === o, C = () => {
|
|
78
|
+
d || M(o);
|
|
81
79
|
};
|
|
82
80
|
return /* @__PURE__ */ e(t.CheckboxItem, {
|
|
83
|
-
checked:
|
|
81
|
+
checked: d,
|
|
84
82
|
onSelect: C,
|
|
85
83
|
children: /* @__PURE__ */ e(t.Item.MainContent, {
|
|
86
84
|
caption: T,
|
|
87
85
|
label: k
|
|
88
86
|
})
|
|
89
|
-
},
|
|
87
|
+
}, o);
|
|
90
88
|
})
|
|
91
89
|
})]
|
|
92
90
|
});
|
|
93
91
|
}
|
|
94
92
|
export {
|
|
95
|
-
|
|
93
|
+
Q as SharedLinkPermission
|
|
96
94
|
};
|
package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js
CHANGED
|
@@ -1,170 +1,176 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { ClockBadge as
|
|
5
|
-
import { Mail as
|
|
6
|
-
import { SurfaceStatusSurfaceRed as
|
|
7
|
-
import { CopyInput as
|
|
8
|
-
import { SharedLinkAccess as
|
|
1
|
+
import { useRef as v, useState as G, useCallback as x, useEffect as w } from "react";
|
|
2
|
+
import { useIntl as q } from "react-intl";
|
|
3
|
+
import { Text as _, Tooltip as A, Focusable as H, Switch as J, Status as Q, Link as W, Button as X } from "@box/blueprint-web";
|
|
4
|
+
import { ClockBadge as Y } from "@box/blueprint-web-assets/icons/Line";
|
|
5
|
+
import { Mail as Z, Globe as D } from "@box/blueprint-web-assets/icons/Medium";
|
|
6
|
+
import { SurfaceStatusSurfaceRed as $, bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
|
|
7
|
+
import { CopyInput as ee } from "@box/copy-input";
|
|
8
|
+
import { SharedLinkAccess as ie } from "./shared-link-access.js";
|
|
9
9
|
import { SharedLinkPermission as te } from "./shared-link-permission.js";
|
|
10
|
-
import
|
|
11
|
-
import { jsxs as l, jsx as
|
|
12
|
-
import { useUnifiedShareFormContext as
|
|
13
|
-
import { useUnifiedShareModalContext as
|
|
14
|
-
import { useSharingAction as
|
|
15
|
-
import { formatDateFromTimestampToDateString as
|
|
16
|
-
import { callOnKeyboardEvent as
|
|
17
|
-
import '../../../../../styles/shared-link-section.css';const
|
|
18
|
-
container:
|
|
19
|
-
toggle:
|
|
20
|
-
settings:
|
|
21
|
-
copy:
|
|
22
|
-
access:
|
|
23
|
-
|
|
10
|
+
import i from "./messages.js";
|
|
11
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
12
|
+
import { useUnifiedShareFormContext as ae } from "../../../contexts/unified-share-form-context.js";
|
|
13
|
+
import { useUnifiedShareModalContext as ne } from "../../../contexts/unified-share-modal-context.js";
|
|
14
|
+
import { useSharingAction as I } from "../../../hooks/use-sharing-action.js";
|
|
15
|
+
import { formatDateFromTimestampToDateString as oe } from "../../../utils/date.js";
|
|
16
|
+
import { callOnKeyboardEvent as se } from "../../../utils/event.js";
|
|
17
|
+
import '../../../../../styles/shared-link-section.css';const re = "_container_1hae4_1", ce = "_toggle_1hae4_7", le = "_settings_1hae4_13", de = "_copy_1hae4_22", he = "_access_1hae4_30", me = "_icon_1hae4_36", s = {
|
|
18
|
+
container: re,
|
|
19
|
+
toggle: ce,
|
|
20
|
+
settings: le,
|
|
21
|
+
copy: de,
|
|
22
|
+
access: he,
|
|
23
|
+
icon: me
|
|
24
24
|
};
|
|
25
|
-
function
|
|
25
|
+
function Ne() {
|
|
26
26
|
const {
|
|
27
27
|
formatMessage: e
|
|
28
|
-
} =
|
|
29
|
-
onModalViewChange:
|
|
30
|
-
onShareViewChange:
|
|
31
|
-
} =
|
|
28
|
+
} = q(), k = v(!0), L = v(null), p = v(null), {
|
|
29
|
+
onModalViewChange: b,
|
|
30
|
+
onShareViewChange: F
|
|
31
|
+
} = ae(), {
|
|
32
32
|
config: o,
|
|
33
|
-
isFetching:
|
|
34
|
-
isSubmitting:
|
|
35
|
-
item:
|
|
33
|
+
isFetching: T,
|
|
34
|
+
isSubmitting: R,
|
|
35
|
+
item: M,
|
|
36
36
|
sharedLink: n,
|
|
37
|
-
sharingService:
|
|
38
|
-
} =
|
|
39
|
-
permissions:
|
|
40
|
-
} =
|
|
41
|
-
createSharedLink:
|
|
42
|
-
} =
|
|
37
|
+
sharingService: B
|
|
38
|
+
} = ne(), {
|
|
39
|
+
permissions: E = {}
|
|
40
|
+
} = M, {
|
|
41
|
+
createSharedLink: O
|
|
42
|
+
} = B, {
|
|
43
43
|
sharedLinkAutoCopy: d,
|
|
44
|
-
sharedLinkAutoCreate:
|
|
44
|
+
sharedLinkAutoCreate: y
|
|
45
45
|
} = o;
|
|
46
|
-
let
|
|
47
|
-
d && (
|
|
46
|
+
let N = "create-shared-link";
|
|
47
|
+
d && (N = "auto-copy-shared-link");
|
|
48
48
|
const {
|
|
49
|
-
isLoading:
|
|
50
|
-
onAction:
|
|
51
|
-
} =
|
|
52
|
-
a || (await
|
|
53
|
-
}, [a,
|
|
54
|
-
|
|
49
|
+
isLoading: U,
|
|
50
|
+
onAction: C
|
|
51
|
+
} = I(O, N), a = !!n.url, r = R ?? U, [S, j] = G(!1), u = x(async () => {
|
|
52
|
+
a || (await C(), j(!0));
|
|
53
|
+
}, [a, C]), z = x(async () => (u(), new Promise((c) => {
|
|
54
|
+
p.current = {
|
|
55
55
|
resolve: c
|
|
56
56
|
};
|
|
57
|
-
})), [
|
|
58
|
-
onAction:
|
|
59
|
-
} =
|
|
60
|
-
|
|
61
|
-
!
|
|
62
|
-
}, [
|
|
63
|
-
a && d &&
|
|
57
|
+
})), [u]), {
|
|
58
|
+
onAction: P
|
|
59
|
+
} = I(z, "auto-copy-shared-link");
|
|
60
|
+
w(() => {
|
|
61
|
+
!k.current || T || (d ? P() : y && u(), k.current = !1);
|
|
62
|
+
}, [T, k, d, y, u, P]), w(() => {
|
|
63
|
+
a && d && L.current && L.current.click();
|
|
64
64
|
}, [a, d]);
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
65
|
+
const K = x((m) => {
|
|
66
|
+
if (!p.current)
|
|
67
67
|
return;
|
|
68
68
|
let c;
|
|
69
|
-
|
|
69
|
+
m instanceof Error ? c = S ? e(i.autoCreateCopyErrorNoticeText) : null : c = e(S ? i.autoCreateCopySuccessNoticeText : i.autoCopySuccessNoticeText), c && p.current.resolve({
|
|
70
70
|
messages: [{
|
|
71
71
|
text: c,
|
|
72
72
|
type: "success"
|
|
73
73
|
}]
|
|
74
|
-
}),
|
|
75
|
-
}, [e,
|
|
76
|
-
|
|
74
|
+
}), p.current = null;
|
|
75
|
+
}, [e, S]), V = async (m) => {
|
|
76
|
+
m || b("remove-shared-link"), m && await C();
|
|
77
77
|
};
|
|
78
78
|
let h, f = !1;
|
|
79
|
-
return !a && !r && (h = e(
|
|
79
|
+
return !a && !r && (h = e(i.sharedLinkToggleTooltip)), !a && !E.canShare && (h = e(i.createLinkDisabledTooltip), f = !0), a && !E.canSetShareAccess && (h = e(i.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ l("div", {
|
|
80
80
|
className: s.container,
|
|
81
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ t(_, {
|
|
82
82
|
as: "label",
|
|
83
83
|
variant: "bodyDefaultBold",
|
|
84
|
-
children: e(
|
|
84
|
+
children: e(i.shareLinkLabel)
|
|
85
85
|
}), /* @__PURE__ */ l("div", {
|
|
86
86
|
className: s.toggle,
|
|
87
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ t(A, {
|
|
88
88
|
align: "start",
|
|
89
89
|
content: h,
|
|
90
90
|
"data-testid": "shared-link-tooltip",
|
|
91
91
|
open: h ? void 0 : !1,
|
|
92
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ t(H, {
|
|
93
93
|
focusable: f,
|
|
94
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ t(J.Item, {
|
|
95
95
|
checked: a,
|
|
96
96
|
disabled: f || r,
|
|
97
|
-
label: e(
|
|
98
|
-
onCheckedChange:
|
|
97
|
+
label: e(i.sharedLinkToggleLabel),
|
|
98
|
+
onCheckedChange: V,
|
|
99
99
|
value: "shared-link"
|
|
100
100
|
})
|
|
101
101
|
})
|
|
102
|
-
}), a && !!n.expiresAt && /* @__PURE__ */
|
|
103
|
-
content: e(
|
|
104
|
-
expirationDate:
|
|
102
|
+
}), a && !!n.expiresAt && /* @__PURE__ */ t(A, {
|
|
103
|
+
content: e(i.expirationIconTooltip, {
|
|
104
|
+
expirationDate: oe(n.expiresAt)
|
|
105
105
|
}),
|
|
106
106
|
"data-testid": "expiration-date-tooltip",
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
color:
|
|
107
|
+
children: /* @__PURE__ */ t(Q, {
|
|
108
|
+
color: $,
|
|
109
109
|
hideText: !0,
|
|
110
|
-
icon:
|
|
111
|
-
text: e(
|
|
110
|
+
icon: Y,
|
|
111
|
+
text: e(i.expirationIconLabel)
|
|
112
112
|
})
|
|
113
|
-
}), a && o.sharedLinkSettings && /* @__PURE__ */
|
|
113
|
+
}), a && o.sharedLinkSettings && /* @__PURE__ */ t(W, {
|
|
114
114
|
"aria-disabled": r,
|
|
115
115
|
"aria-haspopup": "dialog",
|
|
116
116
|
className: s.settings,
|
|
117
|
-
onClick: () =>
|
|
118
|
-
onKeyDown:
|
|
117
|
+
onClick: () => b("shared-link-settings"),
|
|
118
|
+
onKeyDown: se(() => b("shared-link-settings"), {
|
|
119
119
|
canPreventDefault: !0
|
|
120
120
|
}),
|
|
121
121
|
role: "button",
|
|
122
122
|
tabIndex: r ? -1 : 0,
|
|
123
123
|
variant: "standalone",
|
|
124
|
-
children: e(
|
|
124
|
+
children: e(i.sharedLinkSettingsLabel)
|
|
125
125
|
})]
|
|
126
126
|
}), a && /* @__PURE__ */ l("div", {
|
|
127
127
|
className: s.copy,
|
|
128
|
-
children: [/* @__PURE__ */
|
|
129
|
-
ref:
|
|
130
|
-
autoFocus:
|
|
128
|
+
children: [/* @__PURE__ */ t(ee, {
|
|
129
|
+
ref: L,
|
|
130
|
+
autoFocus: y && a,
|
|
131
131
|
disabled: r,
|
|
132
132
|
hideLabel: !0,
|
|
133
|
-
label: e(
|
|
134
|
-
onCopy:
|
|
133
|
+
label: e(i.sharedLinkUrlLabel),
|
|
134
|
+
onCopy: K,
|
|
135
135
|
value: n.url
|
|
136
|
-
}), o.sharedLinkEmail && /* @__PURE__ */
|
|
136
|
+
}), o.sharedLinkEmail && /* @__PURE__ */ t(A, {
|
|
137
137
|
align: "end",
|
|
138
|
-
content: e(
|
|
139
|
-
children: /* @__PURE__ */
|
|
140
|
-
"aria-label": e(
|
|
138
|
+
content: e(i.sharedLinkEmailLabel),
|
|
139
|
+
children: /* @__PURE__ */ t(X, {
|
|
140
|
+
"aria-label": e(i.sharedLinkEmailLabel),
|
|
141
141
|
disabled: r,
|
|
142
|
-
icon:
|
|
143
|
-
onClick: () =>
|
|
142
|
+
icon: Z,
|
|
143
|
+
onClick: () => F("email"),
|
|
144
144
|
size: "large",
|
|
145
145
|
variant: "secondary"
|
|
146
146
|
})
|
|
147
147
|
})]
|
|
148
148
|
}), a && (o.sharedLinkAccess || o.sharedLinkPermission) && /* @__PURE__ */ l("div", {
|
|
149
149
|
className: s.access,
|
|
150
|
-
children: [o.sharedLinkAccess && /* @__PURE__ */
|
|
150
|
+
children: [o.sharedLinkAccess && /* @__PURE__ */ t(ie, {}), o.sharedLinkPermission && /* @__PURE__ */ t(te, {})]
|
|
151
151
|
}), a && n.access === "open" && /* @__PURE__ */ l("div", {
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
children: [/* @__PURE__ */ t(D, {
|
|
153
|
+
className: s.icon,
|
|
154
|
+
height: g,
|
|
155
|
+
width: g
|
|
156
|
+
}), /* @__PURE__ */ t(_, {
|
|
154
157
|
as: "span",
|
|
155
158
|
color: "textOnLightSecondary",
|
|
156
|
-
children: n.permission === "can_edit" ? e(
|
|
159
|
+
children: n.permission === "can_edit" ? e(i.sharedLinkEditablePubliclyAvailable) : e(i.sharedLinkPubliclyAvailable)
|
|
157
160
|
})]
|
|
158
161
|
}), a && n.access === "company" && n.permission === "can_edit" && /* @__PURE__ */ l("div", {
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
children: [/* @__PURE__ */ t(D, {
|
|
163
|
+
className: s.icon,
|
|
164
|
+
height: g,
|
|
165
|
+
width: g
|
|
166
|
+
}), /* @__PURE__ */ t(_, {
|
|
161
167
|
as: "span",
|
|
162
168
|
color: "textOnLightSecondary",
|
|
163
|
-
children: e(
|
|
169
|
+
children: e(i.sharedLinkElevatedEditableCompanyAvailable)
|
|
164
170
|
})]
|
|
165
171
|
})]
|
|
166
172
|
});
|
|
167
173
|
}
|
|
168
174
|
export {
|
|
169
|
-
|
|
175
|
+
Ne as SharedLinkSection
|
|
170
176
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_h88vi_1{align-self:flex-start;max-width:100%}._container_h88vi_1 span:first-child{overflow:hidden;text-overflow:ellipsis}._focusable_h88vi_10{justify-self:flex-start}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1spii_2{display:flex;flex-direction:column;gap:var(--space-4)}._label_1spii_8{display:block;margin-block-end:var(--space-2);padding:var(--space-1) 0;color:var(--text-text-on-light);overflow-wrap:break-word}._label_1spii_8._modernized_1spii_15{font-weight:var(--bp-font-weight-bold);font-size:var(--bp-font-size-05);font-family:var(--bp-font-font-family),-apple-system,BlinkMacSystemFont,"San Francisco","Segoe UI",Roboto,"Helvetica Neue",sans-serif;font-style:normal;line-height:var(--bp-font-line-height-04);letter-spacing:var(--bp-font-letter-spacing-01)}._label_1spii_8:not(._modernized_1spii_15){font-weight:var(--body-default-bold-font-weight);font-size:var(--body-default-bold-font-size);font-family:var(--body-default-bold-font-family);line-height:var(--body-default-bold-line-height);letter-spacing:var(--body-default-bold-letter-spacing);text-transform:var(--body-default-bold-text-case);text-decoration:var(--body-default-bold-text-decoration)}._security_1spii_33{margin-top:calc(var(--space-1) * -1)}._icon_1spii_37{height:var(--size-5);margin-right:var(--space-1);vertical-align:text-bottom}._access_1spii_43{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-3)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._manage_1ilfq_1{display:flex;flex-direction:row-reverse;padding:var(--space-3) .625rem}._link_1ilfq_7{cursor:pointer}._list_1ilfq_11{position:relative}._list_1ilfq_11:after{position:absolute;inset:0;z-index:1000;border:var(--border-1) solid var(--border-divider-border);border-radius:var(--radius-4);box-shadow:var(--innershadow-1);content:"";pointer-events:none}._scroll_1ilfq_28{height:240px;overflow-y:auto;border-radius:var(--radius-4)}._header_1ilfq_34{visibility:collapse}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1um3f_1{max-width:100%}._container_1um3f_1 span:first-child{overflow:hidden;text-overflow:ellipsis}._content_1um3f_9{z-index:2147483646}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1hae4_1{display:flex;flex-direction:column;gap:var(--space-3)}._toggle_1hae4_7{display:flex;gap:var(--space-2);align-items:center}._settings_1hae4_13{margin-left:auto;cursor:pointer}._settings_1hae4_13[aria-disabled=true]{opacity:.3;pointer-events:none}._copy_1hae4_22{display:flex;gap:var(--space-2)}._copy_1hae4_22>div:first-child{flex-grow:1}._access_1hae4_30{display:flex;flex-wrap:wrap;gap:var(--space-2)}._icon_1hae4_36{height:var(--size-5);margin-right:var(--space-1);vertical-align:text-bottom}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/unified-share-modal",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.7",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^12.
|
|
7
|
-
"@box/blueprint-web-assets": "^4.91.
|
|
8
|
-
"@box/copy-input": "^1.22.
|
|
9
|
-
"@box/user-selector": "^1.55.
|
|
6
|
+
"@box/blueprint-web": "^12.115.0",
|
|
7
|
+
"@box/blueprint-web-assets": "^4.91.6",
|
|
8
|
+
"@box/copy-input": "^1.22.6",
|
|
9
|
+
"@box/user-selector": "^1.55.6",
|
|
10
10
|
"lodash": "^4.17.15",
|
|
11
11
|
"react": "^18.0.0",
|
|
12
12
|
"react-dom": "^18.0.0",
|
|
13
13
|
"react-intl": "^6.4.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@box/blueprint-web": "^12.
|
|
17
|
-
"@box/blueprint-web-assets": "^4.91.
|
|
18
|
-
"@box/copy-input": "^1.22.
|
|
19
|
-
"@box/storybook-utils": "0.15.
|
|
16
|
+
"@box/blueprint-web": "^12.115.0",
|
|
17
|
+
"@box/blueprint-web-assets": "^4.91.6",
|
|
18
|
+
"@box/copy-input": "^1.22.6",
|
|
19
|
+
"@box/storybook-utils": "0.15.6",
|
|
20
20
|
"@box/eslint-plugin-blueprint": "1.0.5",
|
|
21
21
|
"react-intl": "^6.4.2"
|
|
22
22
|
},
|