@box/unified-share-modal 1.37.0 → 1.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import y from "lodash/camelCase";
|
|
2
2
|
import { useIntl as D } from "react-intl";
|
|
3
|
-
import { Row as
|
|
4
|
-
import { XMark as
|
|
5
|
-
import { CollaboratorAvatar as
|
|
6
|
-
import
|
|
3
|
+
import { Row as N, Cell as m, Text as n, Tooltip as S, IconButton as z } from "@box/blueprint-web";
|
|
4
|
+
import { XMark as B } from "@box/blueprint-web-assets/icons/Fill";
|
|
5
|
+
import { CollaboratorAvatar as L } from "./collaborator-avatar.js";
|
|
6
|
+
import M from "../messages.js";
|
|
7
7
|
import s from "./messages.js";
|
|
8
|
-
import { jsxs as
|
|
8
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
9
9
|
import { isCollaboratorRoleSupported as I } from "../../../utils/collaborator.js";
|
|
10
10
|
import { useUnifiedShareModalContext as j } from "../../../contexts/unified-share-modal-context.js";
|
|
11
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",
|
|
12
|
+
import '../../../../../styles/collaborator-list-item.css';const w = "_nameCell_y1zd0_1", O = "_nameDetails_y1zd0_7", T = "_roleCell_y1zd0_15", U = "_text_y1zd0_22", o = {
|
|
13
13
|
nameCell: w,
|
|
14
14
|
nameDetails: O,
|
|
15
15
|
roleCell: T,
|
|
@@ -20,7 +20,7 @@ function K({
|
|
|
20
20
|
isSmall: c
|
|
21
21
|
}) {
|
|
22
22
|
const {
|
|
23
|
-
formatMessage:
|
|
23
|
+
formatMessage: t
|
|
24
24
|
} = D(), {
|
|
25
25
|
email: i,
|
|
26
26
|
hasCustomRole: d,
|
|
@@ -30,32 +30,34 @@ function K({
|
|
|
30
30
|
name: h,
|
|
31
31
|
role: r
|
|
32
32
|
} = a, {
|
|
33
|
-
item:
|
|
34
|
-
setCollaborator:
|
|
33
|
+
item: x,
|
|
34
|
+
setCollaborator: u
|
|
35
35
|
} = j(), {
|
|
36
|
-
permissions:
|
|
37
|
-
} =
|
|
36
|
+
permissions: v = {}
|
|
37
|
+
} = x, {
|
|
38
38
|
onModalViewChange: _
|
|
39
|
-
} = k(), b = I(r) ?
|
|
40
|
-
|
|
39
|
+
} = k(), b = I(r) ? t(M[`${y(r)}Role`]) : "", g = d ? r : b, R = () => {
|
|
40
|
+
u(a), _("remove-collaborator");
|
|
41
41
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ l(N, {
|
|
43
43
|
id: p,
|
|
44
44
|
children: [/* @__PURE__ */ e(m, {
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
-
className:
|
|
47
|
-
children: [/* @__PURE__ */ e(
|
|
45
|
+
children: /* @__PURE__ */ l("div", {
|
|
46
|
+
className: o.nameCell,
|
|
47
|
+
children: [/* @__PURE__ */ e(L, {
|
|
48
48
|
collaborator: a,
|
|
49
49
|
isBadgeable: !0,
|
|
50
50
|
size: "large"
|
|
51
|
-
}), /* @__PURE__ */
|
|
52
|
-
className:
|
|
51
|
+
}), /* @__PURE__ */ l("div", {
|
|
52
|
+
className: o.nameDetails,
|
|
53
53
|
children: [/* @__PURE__ */ e(n, {
|
|
54
54
|
as: "span",
|
|
55
|
+
className: o.text,
|
|
55
56
|
variant: "bodyDefaultSemibold",
|
|
56
57
|
children: h
|
|
57
58
|
}), i && /* @__PURE__ */ e(n, {
|
|
58
59
|
as: "span",
|
|
60
|
+
className: o.text,
|
|
59
61
|
color: "textOnLightSecondary",
|
|
60
62
|
variant: "caption",
|
|
61
63
|
children: i
|
|
@@ -63,18 +65,18 @@ function K({
|
|
|
63
65
|
})]
|
|
64
66
|
})
|
|
65
67
|
}), !c && /* @__PURE__ */ e(m, {
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
className:
|
|
68
|
+
children: /* @__PURE__ */ l("div", {
|
|
69
|
+
className: o.roleCell,
|
|
68
70
|
children: [/* @__PURE__ */ e(n, {
|
|
69
71
|
as: "span",
|
|
70
|
-
className:
|
|
72
|
+
className: o.text,
|
|
71
73
|
color: "textOnLightSecondary",
|
|
72
|
-
children: C ?
|
|
73
|
-
}), f &&
|
|
74
|
-
content:
|
|
75
|
-
children: /* @__PURE__ */ e(
|
|
76
|
-
"aria-label":
|
|
77
|
-
icon:
|
|
74
|
+
children: C ? t(s.pendingRole) : g
|
|
75
|
+
}), f && v.canRemoveCollaborator && /* @__PURE__ */ e(S, {
|
|
76
|
+
content: t(s.removeButton),
|
|
77
|
+
children: /* @__PURE__ */ e(z, {
|
|
78
|
+
"aria-label": t(s.removeButton),
|
|
79
|
+
icon: B,
|
|
78
80
|
onClick: R
|
|
79
81
|
})
|
|
80
82
|
})]
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import w from "clsx";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as u, useCallback as N } from "react";
|
|
3
3
|
import { useIntl as U } from "react-intl";
|
|
4
4
|
import { Modal as o, Status as I, LoadingIndicator as P } from "@box/blueprint-web";
|
|
5
5
|
import { Shield as v } from "@box/blueprint-web-assets/icons/Line";
|
|
6
6
|
import { UnifiedShareForm as D } from "./unified-share-form.js";
|
|
7
|
-
import
|
|
7
|
+
import c from "./messages.js";
|
|
8
8
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
9
9
|
import { UnifiedShareFormProvider as O } from "../../contexts/unified-share-form-context.js";
|
|
10
10
|
import { useUnifiedShareModalContext as V } from "../../contexts/unified-share-modal-context.js";
|
|
11
|
-
import '../../../../styles/unified-share-form-modal.css';const j = "
|
|
11
|
+
import '../../../../styles/unified-share-form-modal.css';const j = "_content_c2luc_1", z = "_header_c2luc_5", B = "_body_c2luc_12", L = "_hasFooter_c2luc_24", R = "_loading_c2luc_28", t = {
|
|
12
12
|
content: j,
|
|
13
13
|
header: z,
|
|
14
14
|
body: B,
|
|
@@ -16,39 +16,39 @@ import '../../../../styles/unified-share-form-modal.css';const j = "_content_1xt
|
|
|
16
16
|
loading: R
|
|
17
17
|
};
|
|
18
18
|
function W({
|
|
19
|
-
children:
|
|
20
|
-
isOpen:
|
|
21
|
-
onOpenChange:
|
|
22
|
-
onModalViewChange:
|
|
19
|
+
children: l,
|
|
20
|
+
isOpen: g,
|
|
21
|
+
onOpenChange: a,
|
|
22
|
+
onModalViewChange: p
|
|
23
23
|
}) {
|
|
24
24
|
const {
|
|
25
|
-
formatMessage:
|
|
25
|
+
formatMessage: r
|
|
26
26
|
} = U(), {
|
|
27
27
|
initialContacts: _,
|
|
28
|
-
isFetching:
|
|
29
|
-
item:
|
|
28
|
+
isFetching: C,
|
|
29
|
+
item: F
|
|
30
30
|
} = V(), {
|
|
31
31
|
classification: i,
|
|
32
|
-
name:
|
|
33
|
-
} =
|
|
34
|
-
m("default"),
|
|
35
|
-
}, [
|
|
32
|
+
name: S
|
|
33
|
+
} = F, [b, x] = u(null), [d, m] = u("default"), M = !!l, h = d !== "default", f = N((s) => {
|
|
34
|
+
m("default"), a && a(s);
|
|
35
|
+
}, [a]), y = (s) => {
|
|
36
36
|
s.preventDefault();
|
|
37
37
|
};
|
|
38
38
|
return /* @__PURE__ */ n(o, {
|
|
39
39
|
onOpenChange: f,
|
|
40
|
-
open:
|
|
40
|
+
open: g,
|
|
41
41
|
children: [M && /* @__PURE__ */ e(o.Trigger, {
|
|
42
|
-
children:
|
|
42
|
+
children: l
|
|
43
43
|
}), /* @__PURE__ */ n(o.Content, {
|
|
44
|
-
ref:
|
|
44
|
+
ref: x,
|
|
45
45
|
className: t.content,
|
|
46
46
|
onPointerDownOutside: y,
|
|
47
47
|
size: "medium",
|
|
48
48
|
children: [/* @__PURE__ */ n(o.Header, {
|
|
49
49
|
className: t.header,
|
|
50
|
-
children: [
|
|
51
|
-
itemName:
|
|
50
|
+
children: [r(c.title, {
|
|
51
|
+
itemName: S
|
|
52
52
|
}), i && /* @__PURE__ */ e(I, {
|
|
53
53
|
colorIndex: i.colorId + 1,
|
|
54
54
|
icon: v,
|
|
@@ -58,22 +58,22 @@ function W({
|
|
|
58
58
|
}), /* @__PURE__ */ e(o.Body, {
|
|
59
59
|
className: w(t.body, h && t.hasFooter),
|
|
60
60
|
children: /* @__PURE__ */ n(O, {
|
|
61
|
-
container:
|
|
61
|
+
container: b,
|
|
62
62
|
initialContacts: _,
|
|
63
63
|
onModalOpenChange: f,
|
|
64
|
-
onModalViewChange:
|
|
64
|
+
onModalViewChange: p,
|
|
65
65
|
onShareViewChange: m,
|
|
66
|
-
shareView:
|
|
67
|
-
children: [
|
|
66
|
+
shareView: d,
|
|
67
|
+
children: [C && /* @__PURE__ */ e("div", {
|
|
68
68
|
className: t.loading,
|
|
69
69
|
children: /* @__PURE__ */ e(P, {
|
|
70
|
-
"aria-label":
|
|
70
|
+
"aria-label": r(c.loadingLabel),
|
|
71
71
|
size: "large"
|
|
72
72
|
})
|
|
73
73
|
}), /* @__PURE__ */ e(D, {})]
|
|
74
74
|
})
|
|
75
75
|
}), !h && /* @__PURE__ */ e(o.Close, {
|
|
76
|
-
"aria-label":
|
|
76
|
+
"aria-label": r(c.closeButton)
|
|
77
77
|
})]
|
|
78
78
|
})]
|
|
79
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_c2luc_1._content_c2luc_1{max-width:480px}._header_c2luc_5{display:flex;flex-wrap:wrap;gap:var(--space-2);align-items:center}._body_c2luc_12._body_c2luc_12{position:relative;box-sizing:content-box!important;max-width:432px;padding-top:0;padding-bottom:var(--space-8)}._body_c2luc_12._body_c2luc_12:before{display:block;width:100vw;content:""}._body_c2luc_12._body_c2luc_12._hasFooter_c2luc_24{padding-bottom:0}._loading_c2luc_28{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;padding-bottom:var(--space-8);background-color:var(--gray-white)}@media not (max-width:374px){._content_c2luc_1{overflow:auto}}@media not (max-width:459px){div:has(>._content_c2luc_1){display:flex;padding:var(--space-8);overflow:auto}._content_c2luc_1{max-height:none;margin:auto;overflow:visible}}
|