@box/unified-share-modal 1.37.0 → 1.37.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.
|
@@ -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,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState as g, useCallback as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { Modal as o, Status as
|
|
5
|
-
import { Shield as
|
|
6
|
-
import { UnifiedShareForm as
|
|
1
|
+
import y from "clsx";
|
|
2
|
+
import { useState as g, useCallback as w } from "react";
|
|
3
|
+
import { useIntl as N } from "react-intl";
|
|
4
|
+
import { Modal as o, Status as U, LoadingIndicator as I } from "@box/blueprint-web";
|
|
5
|
+
import { Shield as P } from "@box/blueprint-web-assets/icons/Line";
|
|
6
|
+
import { UnifiedShareForm as v } from "./unified-share-form.js";
|
|
7
7
|
import l from "./messages.js";
|
|
8
8
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
9
|
-
import { UnifiedShareFormProvider as
|
|
10
|
-
import { useUnifiedShareModalContext as
|
|
11
|
-
import '../../../../styles/unified-share-form-modal.css';const
|
|
12
|
-
content:
|
|
13
|
-
header:
|
|
14
|
-
body:
|
|
15
|
-
hasFooter:
|
|
16
|
-
loading:
|
|
9
|
+
import { UnifiedShareFormProvider as D } from "../../contexts/unified-share-form-context.js";
|
|
10
|
+
import { useUnifiedShareModalContext as O } from "../../contexts/unified-share-modal-context.js";
|
|
11
|
+
import '../../../../styles/unified-share-form-modal.css';const V = "_content_6k44r_1", j = "_header_6k44r_5", z = "_body_6k44r_12", B = "_hasFooter_6k44r_23", L = "_loading_6k44r_27", t = {
|
|
12
|
+
content: V,
|
|
13
|
+
header: j,
|
|
14
|
+
body: z,
|
|
15
|
+
hasFooter: B,
|
|
16
|
+
loading: L
|
|
17
17
|
};
|
|
18
18
|
function W({
|
|
19
19
|
children: d,
|
|
@@ -23,16 +23,16 @@ function W({
|
|
|
23
23
|
}) {
|
|
24
24
|
const {
|
|
25
25
|
formatMessage: a
|
|
26
|
-
} =
|
|
26
|
+
} = N(), {
|
|
27
27
|
initialContacts: _,
|
|
28
|
-
isFetching:
|
|
29
|
-
item:
|
|
30
|
-
} =
|
|
28
|
+
isFetching: C,
|
|
29
|
+
item: F
|
|
30
|
+
} = O(), {
|
|
31
31
|
classification: i,
|
|
32
|
-
name:
|
|
33
|
-
} =
|
|
32
|
+
name: S
|
|
33
|
+
} = F, [b, x] = g(null), [c, m] = g("default"), M = !!d, h = c !== "default", f = w((s) => {
|
|
34
34
|
m("default"), r && r(s);
|
|
35
|
-
}, [r]),
|
|
35
|
+
}, [r]), k = (s) => {
|
|
36
36
|
s.preventDefault();
|
|
37
37
|
};
|
|
38
38
|
return /* @__PURE__ */ n(o, {
|
|
@@ -41,36 +41,36 @@ function W({
|
|
|
41
41
|
children: [M && /* @__PURE__ */ e(o.Trigger, {
|
|
42
42
|
children: d
|
|
43
43
|
}), /* @__PURE__ */ n(o.Content, {
|
|
44
|
-
ref:
|
|
44
|
+
ref: x,
|
|
45
45
|
className: t.content,
|
|
46
|
-
onPointerDownOutside:
|
|
46
|
+
onPointerDownOutside: k,
|
|
47
47
|
size: "medium",
|
|
48
48
|
children: [/* @__PURE__ */ n(o.Header, {
|
|
49
49
|
className: t.header,
|
|
50
50
|
children: [a(l.title, {
|
|
51
|
-
itemName:
|
|
52
|
-
}), i && /* @__PURE__ */ e(
|
|
51
|
+
itemName: S
|
|
52
|
+
}), i && /* @__PURE__ */ e(U, {
|
|
53
53
|
colorIndex: i.colorId + 1,
|
|
54
|
-
icon:
|
|
54
|
+
icon: P,
|
|
55
55
|
iconPosition: "left",
|
|
56
56
|
text: i.name.toUpperCase()
|
|
57
57
|
})]
|
|
58
58
|
}), /* @__PURE__ */ e(o.Body, {
|
|
59
|
-
className:
|
|
60
|
-
children: /* @__PURE__ */ n(
|
|
61
|
-
container:
|
|
59
|
+
className: y(t.body, h && t.hasFooter),
|
|
60
|
+
children: /* @__PURE__ */ n(D, {
|
|
61
|
+
container: b,
|
|
62
62
|
initialContacts: _,
|
|
63
63
|
onModalOpenChange: f,
|
|
64
64
|
onModalViewChange: u,
|
|
65
65
|
onShareViewChange: m,
|
|
66
66
|
shareView: c,
|
|
67
|
-
children: [
|
|
67
|
+
children: [C && /* @__PURE__ */ e("div", {
|
|
68
68
|
className: t.loading,
|
|
69
|
-
children: /* @__PURE__ */ e(
|
|
69
|
+
children: /* @__PURE__ */ e(I, {
|
|
70
70
|
"aria-label": a(l.loadingLabel),
|
|
71
71
|
size: "large"
|
|
72
72
|
})
|
|
73
|
-
}), /* @__PURE__ */ e(
|
|
73
|
+
}), /* @__PURE__ */ e(v, {})]
|
|
74
74
|
})
|
|
75
75
|
}), !h && /* @__PURE__ */ e(o.Close, {
|
|
76
76
|
"aria-label": a(l.closeButton)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_6k44r_1._content_6k44r_1{max-width:480px}._header_6k44r_5{display:flex;flex-wrap:wrap;gap:var(--space-2);align-items:center}._body_6k44r_12._body_6k44r_12{position:relative;max-width:432px;padding-top:0;padding-bottom:var(--space-8)}._body_6k44r_12._body_6k44r_12:before{display:block;width:100vw;content:""}._body_6k44r_12._body_6k44r_12._hasFooter_6k44r_23{padding-bottom:0}._loading_6k44r_27{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_6k44r_1{overflow:auto}}@media not (max-width:459px){div:has(>._content_6k44r_1){display:flex;padding:var(--space-8);overflow:auto}._content_6k44r_1{max-height:none;margin:auto;overflow:visible}}
|