@box/unified-share-modal 1.22.2 → 1.23.0
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/index.js +8 -6
- package/dist/esm/lib/components/remove-collaborator-modal/index.js +4 -0
- package/dist/esm/lib/components/remove-collaborator-modal/messages.js +30 -0
- package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +64 -0
- package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +27 -31
- package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +5 -5
- package/dist/esm/lib/components/unified-share-form-modal/collaborators-view/collaborator-list-item.js +65 -43
- package/dist/esm/lib/components/unified-share-form-modal/collaborators-view/messages.js +4 -0
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +24 -24
- package/dist/esm/lib/constants.js +3 -3
- package/dist/esm/lib/messages.js +10 -2
- package/dist/esm/lib/unified-share-modal.js +48 -42
- package/dist/i18n/bn-IN.js +10 -1
- package/dist/i18n/bn-IN.properties +1 -1
- package/dist/i18n/da-DK.js +10 -1
- package/dist/i18n/da-DK.properties +1 -1
- package/dist/i18n/de-DE.js +10 -1
- package/dist/i18n/de-DE.properties +1 -1
- package/dist/i18n/en-AU.js +10 -1
- package/dist/i18n/en-AU.properties +1 -1
- package/dist/i18n/en-CA.js +9 -0
- package/dist/i18n/en-GB.js +10 -1
- package/dist/i18n/en-GB.properties +1 -1
- package/dist/i18n/en-US.js +9 -0
- package/dist/i18n/en-US.properties +18 -0
- package/dist/i18n/en-x-pseudo.js +9 -0
- package/dist/i18n/es-419.js +10 -1
- package/dist/i18n/es-419.properties +1 -1
- package/dist/i18n/es-ES.js +10 -1
- package/dist/i18n/es-ES.properties +1 -1
- package/dist/i18n/fi-FI.js +10 -1
- package/dist/i18n/fi-FI.properties +1 -1
- package/dist/i18n/fr-CA.js +10 -1
- package/dist/i18n/fr-CA.properties +1 -1
- package/dist/i18n/fr-FR.js +10 -1
- package/dist/i18n/fr-FR.properties +1 -1
- package/dist/i18n/hi-IN.js +10 -1
- package/dist/i18n/hi-IN.properties +1 -1
- package/dist/i18n/it-IT.js +10 -1
- package/dist/i18n/it-IT.properties +1 -1
- package/dist/i18n/ja-JP.js +10 -1
- package/dist/i18n/ja-JP.properties +1 -1
- package/dist/i18n/json/src/lib/components/remove-collaborator-modal/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/unified-share-form-modal/collaborators-view/messages.json +1 -1
- package/dist/i18n/json/src/lib/messages.json +1 -1
- package/dist/i18n/ko-KR.js +14 -5
- package/dist/i18n/ko-KR.properties +5 -5
- package/dist/i18n/nb-NO.js +14 -5
- package/dist/i18n/nb-NO.properties +5 -5
- package/dist/i18n/nl-NL.js +10 -1
- package/dist/i18n/nl-NL.properties +1 -1
- package/dist/i18n/pl-PL.js +10 -1
- package/dist/i18n/pl-PL.properties +1 -1
- package/dist/i18n/pt-BR.js +10 -1
- package/dist/i18n/pt-BR.properties +1 -1
- package/dist/i18n/ru-RU.js +10 -1
- package/dist/i18n/ru-RU.properties +1 -1
- package/dist/i18n/sv-SE.js +10 -1
- package/dist/i18n/sv-SE.properties +1 -1
- package/dist/i18n/tr-TR.js +10 -1
- package/dist/i18n/tr-TR.properties +1 -1
- package/dist/i18n/zh-CN.js +10 -1
- package/dist/i18n/zh-CN.properties +1 -1
- package/dist/i18n/zh-TW.js +10 -1
- package/dist/i18n/zh-TW.properties +1 -1
- package/dist/styles/collaborator-list-item.css +1 -1
- package/dist/types/lib/components/index.d.ts +1 -0
- package/dist/types/lib/components/remove-collaborator-modal/index.d.ts +1 -0
- package/dist/types/lib/components/remove-collaborator-modal/messages.d.ts +33 -0
- package/dist/types/lib/components/remove-collaborator-modal/remove-collaborator-modal.d.ts +5 -0
- package/dist/types/lib/components/remove-collaborator-modal/stories/shared.d.ts +2 -0
- package/dist/types/lib/components/unified-share-form-modal/collaborators-view/messages.d.ts +5 -0
- package/dist/types/lib/contexts/unified-share-modal-context.d.ts +3 -0
- package/dist/types/lib/messages.d.ts +10 -0
- package/dist/types/lib/stories/shared.d.ts +2 -0
- package/dist/types/lib/types.d.ts +17 -2
- package/package.json +9 -9
- package/dist/styles/remove-shared-link-modal.css +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { RemoveCollaboratorModal as e } from "./remove-collaborator-modal/remove-collaborator-modal.js";
|
|
2
|
+
import { RemoveSharedLinkModal as d } from "./remove-shared-link-modal/remove-shared-link-modal.js";
|
|
3
|
+
import { SharedLinkSettingsModal as t } from "./shared-link-settings-modal/shared-link-settings-modal.js";
|
|
4
|
+
import { UnifiedShareFormModal as f } from "./unified-share-form-modal/unified-share-form-modal.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
d as
|
|
7
|
-
|
|
6
|
+
e as RemoveCollaboratorModal,
|
|
7
|
+
d as RemoveSharedLinkModal,
|
|
8
|
+
t as SharedLinkSettingsModal,
|
|
9
|
+
f as UnifiedShareFormModal
|
|
8
10
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const a = e({
|
|
3
|
+
title: {
|
|
4
|
+
id: "groupSharedFeatures.usm.removeCollaborator.title",
|
|
5
|
+
defaultMessage: "Remove Collaborator"
|
|
6
|
+
},
|
|
7
|
+
bodyText: {
|
|
8
|
+
id: "groupSharedFeatures.usm.removeCollaborator.bodyText",
|
|
9
|
+
defaultMessage: "Are you sure you want to remove {name} as a collaborator?"
|
|
10
|
+
},
|
|
11
|
+
cancelButton: {
|
|
12
|
+
id: "groupSharedFeatures.usm.removeCollaborator.cancelButton",
|
|
13
|
+
defaultMessage: "Cancel"
|
|
14
|
+
},
|
|
15
|
+
closeButton: {
|
|
16
|
+
id: "groupSharedFeatures.usm.removeCollaborator.closeButton",
|
|
17
|
+
defaultMessage: "Close"
|
|
18
|
+
},
|
|
19
|
+
loadingLabel: {
|
|
20
|
+
id: "groupSharedFeatures.usm.removeCollaborator.loadingLabel",
|
|
21
|
+
defaultMessage: "Loading"
|
|
22
|
+
},
|
|
23
|
+
okayButton: {
|
|
24
|
+
id: "groupSharedFeatures.usm.removeCollaborator.okayButton",
|
|
25
|
+
defaultMessage: "Okay"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
a as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useIntl as x } from "react-intl";
|
|
2
|
+
import { Modal as o, Text as y } from "@box/blueprint-web";
|
|
3
|
+
import t from "./messages.js";
|
|
4
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { useSharingAction as B } from "../../hooks/use-sharing-action.js";
|
|
6
|
+
import { useUnifiedShareModalContext as S } from "../../contexts/unified-share-modal-context.js";
|
|
7
|
+
function R({
|
|
8
|
+
isOpen: m,
|
|
9
|
+
onOpenChange: d
|
|
10
|
+
}) {
|
|
11
|
+
const {
|
|
12
|
+
formatMessage: n
|
|
13
|
+
} = x(), {
|
|
14
|
+
collaborator: i,
|
|
15
|
+
isSubmitting: h,
|
|
16
|
+
sharingService: b,
|
|
17
|
+
setCollaborator: u
|
|
18
|
+
} = S(), {
|
|
19
|
+
email: f,
|
|
20
|
+
name: g
|
|
21
|
+
} = i, {
|
|
22
|
+
removeCollaborator: l
|
|
23
|
+
} = b, a = (r) => {
|
|
24
|
+
d(r), u(void 0);
|
|
25
|
+
}, p = async () => {
|
|
26
|
+
l && (await l(i), a(!1), await new Promise((r) => setTimeout(r)));
|
|
27
|
+
}, {
|
|
28
|
+
isLoading: C,
|
|
29
|
+
onAction: v
|
|
30
|
+
} = B(p, "remove-collaborator"), s = h ?? C;
|
|
31
|
+
return /* @__PURE__ */ e(o, {
|
|
32
|
+
onOpenChange: a,
|
|
33
|
+
open: m,
|
|
34
|
+
children: /* @__PURE__ */ c(o.Content, {
|
|
35
|
+
size: "small",
|
|
36
|
+
children: [/* @__PURE__ */ e(o.Header, {
|
|
37
|
+
children: n(t.title)
|
|
38
|
+
}), /* @__PURE__ */ e(o.Body, {
|
|
39
|
+
children: /* @__PURE__ */ e(y, {
|
|
40
|
+
as: "p",
|
|
41
|
+
children: n(t.bodyText, {
|
|
42
|
+
name: f || g
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}), /* @__PURE__ */ c(o.Footer, {
|
|
46
|
+
children: [/* @__PURE__ */ e(o.Footer.SecondaryButton, {
|
|
47
|
+
disabled: s,
|
|
48
|
+
onClick: () => a(!1),
|
|
49
|
+
children: n(t.cancelButton)
|
|
50
|
+
}), /* @__PURE__ */ e(o.Footer.PrimaryButton, {
|
|
51
|
+
loading: s,
|
|
52
|
+
loadingAriaLabel: n(t.loadingLabel),
|
|
53
|
+
onClick: v,
|
|
54
|
+
children: n(t.okayButton)
|
|
55
|
+
})]
|
|
56
|
+
}), /* @__PURE__ */ e(o.Close, {
|
|
57
|
+
"aria-label": n(t.closeButton)
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
R as RemoveCollaboratorModal
|
|
64
|
+
};
|
|
@@ -1,59 +1,55 @@
|
|
|
1
|
-
import { useIntl as
|
|
2
|
-
import { Modal as e, Text as
|
|
3
|
-
import
|
|
4
|
-
import { jsx as o, jsxs as
|
|
5
|
-
import { useSharingAction as g } from "../../hooks/use-sharing-action.js";
|
|
1
|
+
import { useIntl as b } from "react-intl";
|
|
2
|
+
import { Modal as e, Text as g } from "@box/blueprint-web";
|
|
3
|
+
import t from "./messages.js";
|
|
4
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
6
5
|
import { useUnifiedShareModalContext as S } from "../../contexts/unified-share-modal-context.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function A({
|
|
11
|
-
isOpen: l,
|
|
6
|
+
import { useSharingAction as p } from "../../hooks/use-sharing-action.js";
|
|
7
|
+
function M({
|
|
8
|
+
isOpen: s,
|
|
12
9
|
onOpenChange: n
|
|
13
10
|
}) {
|
|
14
11
|
const {
|
|
15
|
-
formatMessage:
|
|
16
|
-
} =
|
|
12
|
+
formatMessage: i
|
|
13
|
+
} = b(), {
|
|
17
14
|
isSubmitting: d,
|
|
18
15
|
sharingService: c
|
|
19
16
|
} = S(), {
|
|
20
17
|
deleteSharedLink: r
|
|
21
18
|
} = c, m = async () => {
|
|
22
|
-
r && (await r(), n(!1), await new Promise((
|
|
19
|
+
r && (await r(), n(!1), await new Promise((f) => setTimeout(f)));
|
|
23
20
|
}, {
|
|
24
|
-
isLoading:
|
|
25
|
-
onAction:
|
|
26
|
-
} =
|
|
21
|
+
isLoading: h,
|
|
22
|
+
onAction: u
|
|
23
|
+
} = p(m, "delete-shared-link"), a = d ?? h;
|
|
27
24
|
return /* @__PURE__ */ o(e, {
|
|
28
25
|
onOpenChange: n,
|
|
29
|
-
open:
|
|
30
|
-
children: /* @__PURE__ */
|
|
26
|
+
open: s,
|
|
27
|
+
children: /* @__PURE__ */ l(e.Content, {
|
|
31
28
|
size: "small",
|
|
32
29
|
children: [/* @__PURE__ */ o(e.Header, {
|
|
33
|
-
children: t
|
|
30
|
+
children: i(t.title)
|
|
34
31
|
}), /* @__PURE__ */ o(e.Body, {
|
|
35
|
-
|
|
36
|
-
children: /* @__PURE__ */ o(y, {
|
|
32
|
+
children: /* @__PURE__ */ o(g, {
|
|
37
33
|
as: "p",
|
|
38
|
-
children: t
|
|
34
|
+
children: i(t.bodyText)
|
|
39
35
|
})
|
|
40
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ l(e.Footer, {
|
|
41
37
|
children: [/* @__PURE__ */ o(e.Footer.SecondaryButton, {
|
|
42
|
-
disabled:
|
|
38
|
+
disabled: a,
|
|
43
39
|
onClick: () => n(!1),
|
|
44
|
-
children: t
|
|
40
|
+
children: i(t.cancelButton)
|
|
45
41
|
}), /* @__PURE__ */ o(e.Footer.PrimaryButton, {
|
|
46
|
-
loading:
|
|
47
|
-
loadingAriaLabel: t
|
|
48
|
-
onClick:
|
|
49
|
-
children: t
|
|
42
|
+
loading: a,
|
|
43
|
+
loadingAriaLabel: i(t.loadingLabel),
|
|
44
|
+
onClick: u,
|
|
45
|
+
children: i(t.okayButton)
|
|
50
46
|
})]
|
|
51
47
|
}), /* @__PURE__ */ o(e.Close, {
|
|
52
|
-
"aria-label": t
|
|
48
|
+
"aria-label": i(t.closeButton)
|
|
53
49
|
})]
|
|
54
50
|
})
|
|
55
51
|
});
|
|
56
52
|
}
|
|
57
53
|
export {
|
|
58
|
-
|
|
54
|
+
M as RemoveSharedLinkModal
|
|
59
55
|
};
|
|
@@ -17,14 +17,14 @@ function D({
|
|
|
17
17
|
item: u,
|
|
18
18
|
sharedLink: g
|
|
19
19
|
} = S(), {
|
|
20
|
+
classification: p
|
|
21
|
+
} = u, {
|
|
20
22
|
downloadUrl: l,
|
|
21
23
|
directLinkBlockedReason: a,
|
|
22
|
-
settings:
|
|
24
|
+
settings: h = {}
|
|
23
25
|
} = g, {
|
|
24
26
|
isDirectLinkAvailable: d
|
|
25
|
-
} =
|
|
26
|
-
classification: h
|
|
27
|
-
} = u, r = /* @__PURE__ */ o(B, {
|
|
27
|
+
} = h, r = /* @__PURE__ */ o(B, {
|
|
28
28
|
disabled: s,
|
|
29
29
|
label: t(e.directLinkLabel),
|
|
30
30
|
value: l
|
|
@@ -32,7 +32,7 @@ function D({
|
|
|
32
32
|
if (!f)
|
|
33
33
|
return l && d ? r : null;
|
|
34
34
|
let i;
|
|
35
|
-
a === "malicious_content" ? i = t(e.directLinkBlockedByMaliciousContent) : a === "access_policy" && (i = t(
|
|
35
|
+
a === "malicious_content" ? i = t(e.directLinkBlockedByMaliciousContent) : a === "access_policy" && (i = t(p ? e.directLinkBlockedByAccessPolicyWithClassification : e.directLinkBlockedByAccessPolicyWithoutClassification));
|
|
36
36
|
const L = n && !!l && d && !i;
|
|
37
37
|
return /* @__PURE__ */ C(x, {
|
|
38
38
|
children: [i ? /* @__PURE__ */ o(w, {
|
|
@@ -1,64 +1,86 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { Row as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import R from "lodash/camelCase";
|
|
2
|
+
import { useIntl as D } from "react-intl";
|
|
3
|
+
import { Row as S, Cell as m, Text as n, Tooltip as q, IconButton as y } 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
|
+
import s from "./messages.js";
|
|
8
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
9
|
+
import { isCollaboratorRoleSupported as N } from "../../../utils/collaborator.js";
|
|
10
|
+
import { useUnifiedShareModalContext as I } from "../../../contexts/unified-share-modal-context.js";
|
|
11
|
+
import { useUnifiedShareFormContext as j } from "../../../contexts/unified-share-form-context.js";
|
|
12
|
+
import '../../../../../styles/collaborator-list-item.css';const k = "_nameCell_empqg_1", w = "_nameDetails_empqg_7", O = "_roleCell_empqg_14", T = "_text_empqg_21", l = {
|
|
13
|
+
nameCell: k,
|
|
14
|
+
nameDetails: w,
|
|
15
|
+
roleCell: O,
|
|
16
|
+
text: T
|
|
13
17
|
};
|
|
14
|
-
function
|
|
15
|
-
collaborator:
|
|
18
|
+
function J({
|
|
19
|
+
collaborator: a
|
|
16
20
|
}) {
|
|
17
21
|
const {
|
|
18
|
-
formatMessage:
|
|
19
|
-
} =
|
|
20
|
-
email:
|
|
21
|
-
hasCustomRole:
|
|
22
|
-
id:
|
|
23
|
-
isPending:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
formatMessage: o
|
|
23
|
+
} = D(), {
|
|
24
|
+
email: i,
|
|
25
|
+
hasCustomRole: c,
|
|
26
|
+
id: d,
|
|
27
|
+
isPending: p,
|
|
28
|
+
isRemovable: C,
|
|
29
|
+
name: f,
|
|
30
|
+
role: r
|
|
31
|
+
} = a, {
|
|
32
|
+
item: h,
|
|
33
|
+
setCollaborator: g
|
|
34
|
+
} = I(), {
|
|
35
|
+
permissions: u = {}
|
|
36
|
+
} = h, {
|
|
37
|
+
onModalViewChange: v
|
|
38
|
+
} = j(), x = N(r) ? o(M[`${R(r)}Role`]) : "", _ = c ? r : x, b = () => {
|
|
39
|
+
g(a), v("remove-collaborator");
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ t(S, {
|
|
42
|
+
id: d,
|
|
43
|
+
children: [/* @__PURE__ */ e(m, {
|
|
44
|
+
children: /* @__PURE__ */ t("div", {
|
|
45
|
+
className: l.nameCell,
|
|
46
|
+
children: [/* @__PURE__ */ e(L, {
|
|
47
|
+
collaborator: a,
|
|
34
48
|
isBadgeable: !0,
|
|
35
49
|
size: "large"
|
|
36
|
-
}), /* @__PURE__ */
|
|
37
|
-
className:
|
|
38
|
-
children: [/* @__PURE__ */ e(
|
|
50
|
+
}), /* @__PURE__ */ t("div", {
|
|
51
|
+
className: l.nameDetails,
|
|
52
|
+
children: [/* @__PURE__ */ e(n, {
|
|
39
53
|
as: "span",
|
|
40
54
|
variant: "bodyDefaultSemibold",
|
|
41
|
-
children:
|
|
42
|
-
}),
|
|
55
|
+
children: f
|
|
56
|
+
}), i && /* @__PURE__ */ e(n, {
|
|
43
57
|
as: "span",
|
|
44
58
|
color: "textOnLightSecondary",
|
|
45
59
|
variant: "caption",
|
|
46
|
-
children:
|
|
60
|
+
children: i
|
|
47
61
|
})]
|
|
48
62
|
})]
|
|
49
63
|
})
|
|
50
|
-
}), /* @__PURE__ */ e(
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
className:
|
|
53
|
-
children: /* @__PURE__ */ e(
|
|
64
|
+
}), /* @__PURE__ */ e(m, {
|
|
65
|
+
children: /* @__PURE__ */ t("div", {
|
|
66
|
+
className: l.roleCell,
|
|
67
|
+
children: [/* @__PURE__ */ e(n, {
|
|
54
68
|
as: "span",
|
|
69
|
+
className: l.text,
|
|
55
70
|
color: "textOnLightSecondary",
|
|
56
|
-
children:
|
|
57
|
-
})
|
|
71
|
+
children: p ? o(s.pendingRole) : _
|
|
72
|
+
}), C && u.canRemoveCollaborator && /* @__PURE__ */ e(q, {
|
|
73
|
+
content: o(s.removeButton),
|
|
74
|
+
children: /* @__PURE__ */ e(y, {
|
|
75
|
+
"aria-label": o(s.removeButton),
|
|
76
|
+
icon: B,
|
|
77
|
+
onClick: b
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
58
80
|
})
|
|
59
81
|
})]
|
|
60
82
|
});
|
|
61
83
|
}
|
|
62
84
|
export {
|
|
63
|
-
|
|
85
|
+
J as CollaboratorListItem
|
|
64
86
|
};
|
|
@@ -31,6 +31,10 @@ const o = e({
|
|
|
31
31
|
pendingRole: {
|
|
32
32
|
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorsView.pendingRole",
|
|
33
33
|
defaultMessage: "Pending"
|
|
34
|
+
},
|
|
35
|
+
removeButton: {
|
|
36
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorsView.removeButton",
|
|
37
|
+
defaultMessage: "Remove"
|
|
34
38
|
}
|
|
35
39
|
});
|
|
36
40
|
export {
|
package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js
CHANGED
|
@@ -8,7 +8,7 @@ import { CopyInput as Z } from "@box/copy-input";
|
|
|
8
8
|
import { SharedLinkAccess as $ } from "./shared-link-access.js";
|
|
9
9
|
import { SharedLinkPermission as ee } from "./shared-link-permission.js";
|
|
10
10
|
import t from "./messages.js";
|
|
11
|
-
import { jsxs as
|
|
11
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
12
12
|
import { useUnifiedShareFormContext as te } from "../../../contexts/unified-share-form-context.js";
|
|
13
13
|
import { useUnifiedShareModalContext as ie } from "../../../contexts/unified-share-modal-context.js";
|
|
14
14
|
import { useSharingAction as N } from "../../../hooks/use-sharing-action.js";
|
|
@@ -24,15 +24,15 @@ import '../../../../../styles/shared-link-section.css';const ae = "_container_q9
|
|
|
24
24
|
function Ae() {
|
|
25
25
|
const {
|
|
26
26
|
formatMessage: e
|
|
27
|
-
} = K(),
|
|
28
|
-
onModalViewChange:
|
|
27
|
+
} = K(), g = b(!0), k = b(null), u = b(null), {
|
|
28
|
+
onModalViewChange: L,
|
|
29
29
|
onShareViewChange: P
|
|
30
30
|
} = te(), {
|
|
31
31
|
config: n,
|
|
32
32
|
isFetching: v,
|
|
33
33
|
isSubmitting: w,
|
|
34
34
|
item: E,
|
|
35
|
-
sharedLink:
|
|
35
|
+
sharedLink: h,
|
|
36
36
|
sharingService: F
|
|
37
37
|
} = ie(), {
|
|
38
38
|
permissions: A = {}
|
|
@@ -47,19 +47,19 @@ function Ae() {
|
|
|
47
47
|
const {
|
|
48
48
|
isLoading: q,
|
|
49
49
|
onAction: y
|
|
50
|
-
} = N(z, _), i = !!
|
|
50
|
+
} = N(z, _), i = !!h.url, a = w ?? q, [S, R] = j(!1), m = x(async () => {
|
|
51
51
|
i || (await y(), R(!0));
|
|
52
|
-
}, [i, y]), M = x(async () => (
|
|
52
|
+
}, [i, y]), M = x(async () => (m(), new Promise((s) => {
|
|
53
53
|
u.current = {
|
|
54
54
|
resolve: s
|
|
55
55
|
};
|
|
56
|
-
})), [
|
|
56
|
+
})), [m]), {
|
|
57
57
|
onAction: D
|
|
58
58
|
} = N(M, "auto-copy-shared-link");
|
|
59
59
|
I(() => {
|
|
60
|
-
!
|
|
61
|
-
}, [v,
|
|
62
|
-
i && r &&
|
|
60
|
+
!g.current || v || (r ? D() : C && m(), g.current = !1);
|
|
61
|
+
}, [v, g, r, C, m, D]), I(() => {
|
|
62
|
+
i && r && k.current && k.current.click();
|
|
63
63
|
}, [i, r]);
|
|
64
64
|
const B = x((l) => {
|
|
65
65
|
if (!u.current)
|
|
@@ -72,16 +72,16 @@ function Ae() {
|
|
|
72
72
|
}]
|
|
73
73
|
}), u.current = null;
|
|
74
74
|
}, [e, S]), U = async (l) => {
|
|
75
|
-
|
|
75
|
+
l || L("remove-shared-link"), l && await y();
|
|
76
76
|
};
|
|
77
|
-
let c,
|
|
78
|
-
return !i && !a && (c = e(t.sharedLinkToggleTooltip)), !i && !A.canShare && (c = e(t.createLinkDisabledTooltip),
|
|
77
|
+
let c, p = !1;
|
|
78
|
+
return !i && !a && (c = e(t.sharedLinkToggleTooltip)), !i && !A.canShare && (c = e(t.createLinkDisabledTooltip), p = !0), i && !A.canSetShareAccess && (c = e(t.removeLinkDisabledTooltip), p = !0), /* @__PURE__ */ f("div", {
|
|
79
79
|
className: d.container,
|
|
80
80
|
children: [/* @__PURE__ */ o(V, {
|
|
81
81
|
as: "label",
|
|
82
82
|
variant: "bodyDefaultBold",
|
|
83
83
|
children: e(t.shareLinkLabel)
|
|
84
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ f("div", {
|
|
85
85
|
className: d.toggle,
|
|
86
86
|
children: [/* @__PURE__ */ o(T, {
|
|
87
87
|
align: "start",
|
|
@@ -89,18 +89,18 @@ function Ae() {
|
|
|
89
89
|
"data-testid": "shared-link-tooltip",
|
|
90
90
|
open: c ? void 0 : !1,
|
|
91
91
|
children: /* @__PURE__ */ o(O, {
|
|
92
|
-
focusable:
|
|
92
|
+
focusable: p,
|
|
93
93
|
children: /* @__PURE__ */ o(G.Item, {
|
|
94
94
|
checked: i,
|
|
95
|
-
disabled:
|
|
95
|
+
disabled: p || a,
|
|
96
96
|
label: e(t.sharedLinkToggleLabel),
|
|
97
97
|
onCheckedChange: U,
|
|
98
98
|
value: "shared-link"
|
|
99
99
|
})
|
|
100
100
|
})
|
|
101
|
-
}), i && !!
|
|
101
|
+
}), i && !!h.expiresAt && /* @__PURE__ */ o(T, {
|
|
102
102
|
content: e(t.expirationIconTooltip, {
|
|
103
|
-
expirationDate: oe(
|
|
103
|
+
expirationDate: oe(h.expiresAt)
|
|
104
104
|
}),
|
|
105
105
|
"data-testid": "expiration-date-tooltip",
|
|
106
106
|
children: /* @__PURE__ */ o(H, {
|
|
@@ -113,8 +113,8 @@ function Ae() {
|
|
|
113
113
|
"aria-disabled": a,
|
|
114
114
|
"aria-haspopup": "dialog",
|
|
115
115
|
className: d.settings,
|
|
116
|
-
onClick: () =>
|
|
117
|
-
onKeyDown: ne(() =>
|
|
116
|
+
onClick: () => L("shared-link-settings"),
|
|
117
|
+
onKeyDown: ne(() => L("shared-link-settings"), {
|
|
118
118
|
canPreventDefault: !0
|
|
119
119
|
}),
|
|
120
120
|
role: "button",
|
|
@@ -122,16 +122,16 @@ function Ae() {
|
|
|
122
122
|
variant: "standalone",
|
|
123
123
|
children: e(t.sharedLinkSettingsLabel)
|
|
124
124
|
})]
|
|
125
|
-
}), i && /* @__PURE__ */
|
|
125
|
+
}), i && /* @__PURE__ */ f("div", {
|
|
126
126
|
className: d.copy,
|
|
127
127
|
children: [/* @__PURE__ */ o(Z, {
|
|
128
|
-
ref:
|
|
128
|
+
ref: k,
|
|
129
129
|
autoFocus: C && i,
|
|
130
130
|
disabled: a,
|
|
131
131
|
hideLabel: !0,
|
|
132
132
|
label: e(t.sharedLinkUrlLabel),
|
|
133
133
|
onCopy: B,
|
|
134
|
-
value:
|
|
134
|
+
value: h.url
|
|
135
135
|
}), n.sharedLinkEmail && /* @__PURE__ */ o(T, {
|
|
136
136
|
align: "end",
|
|
137
137
|
content: e(t.sharedLinkEmailLabel),
|
|
@@ -144,7 +144,7 @@ function Ae() {
|
|
|
144
144
|
variant: "secondary"
|
|
145
145
|
})
|
|
146
146
|
})]
|
|
147
|
-
}), i && (n.sharedLinkAccess || n.sharedLinkPermission) && /* @__PURE__ */
|
|
147
|
+
}), i && (n.sharedLinkAccess || n.sharedLinkPermission) && /* @__PURE__ */ f("div", {
|
|
148
148
|
className: d.access,
|
|
149
149
|
children: [n.sharedLinkAccess && /* @__PURE__ */ o($, {}), n.sharedLinkPermission && /* @__PURE__ */ o(ee, {})]
|
|
150
150
|
})]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = ["invite-collaborators", "create-shared-link", "delete-shared-link", "update-shared-link", "email-shared-link", "auto-copy-shared-link"], r = {
|
|
1
|
+
const e = ["invite-collaborators", "remove-collaborator", "create-shared-link", "delete-shared-link", "update-shared-link", "email-shared-link", "auto-copy-shared-link"], r = {
|
|
2
2
|
collaboration: !0,
|
|
3
3
|
collaborationLimit: 100,
|
|
4
4
|
collaborationMessage: !0,
|
|
@@ -14,12 +14,12 @@ const e = ["invite-collaborators", "create-shared-link", "delete-shared-link", "
|
|
|
14
14
|
sharedLinkEmail: !0,
|
|
15
15
|
sharedLinkPermission: !0,
|
|
16
16
|
sharedLinkSettings: !0
|
|
17
|
-
}, o = ["co_owner", "editor", "previewer", "previewer_uploader", "uploader", "viewer", "viewer_uploader"], a = ["owner", ...o], t = ["open", "company", "collaborators"], n = ["can_edit", "can_download", "can_preview"], i = 256,
|
|
17
|
+
}, o = ["co_owner", "editor", "previewer", "previewer_uploader", "uploader", "viewer", "viewer_uploader"], a = ["owner", ...o], t = ["open", "company", "collaborators"], n = ["can_edit", "can_download", "can_preview"], i = 256, l = "boxnote";
|
|
18
18
|
export {
|
|
19
19
|
i as COLLABORATION_MESSAGE_CHARACTER_LIMIT,
|
|
20
20
|
r as DEFAULT_CONFIGURATION,
|
|
21
21
|
e as DEFAULT_NOTIFICATIONS,
|
|
22
|
-
|
|
22
|
+
l as FILE_EXTENSION_BOX_NOTE,
|
|
23
23
|
t as SUPPORTED_ACCESS_LEVELS,
|
|
24
24
|
a as SUPPORTED_COLLABORATOR_ROLES,
|
|
25
25
|
o as SUPPORTED_INVITATION_ROLES,
|
package/dist/esm/lib/messages.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
const
|
|
2
|
+
const a = e({
|
|
3
3
|
contactsExceedLimitError: {
|
|
4
4
|
id: "groupSharedFeatures.usm.contactsExceedLimitError",
|
|
5
5
|
defaultMessage: "Oops! The maximum number of collaborators that can be added at once is {maxContacts} collaborators. Please try again by splitting your invitations into batches."
|
|
@@ -20,6 +20,14 @@ const r = e({
|
|
|
20
20
|
id: "groupSharedFeatures.usm.defaultErrorNoticeText",
|
|
21
21
|
defaultMessage: "Something went wrong. Please try again later."
|
|
22
22
|
},
|
|
23
|
+
removeCollaboratorSuccessNoticeText: {
|
|
24
|
+
id: "groupSharedFeatures.usm.removeCollaboratorSuccessNoticeText",
|
|
25
|
+
defaultMessage: "The collaborator has been removed successfully."
|
|
26
|
+
},
|
|
27
|
+
removeCollaboratorErrorNoticeText: {
|
|
28
|
+
id: "groupSharedFeatures.usm.removeCollaboratorErrorNoticeText",
|
|
29
|
+
defaultMessage: "Unable to remove the collaborator. Please try again later."
|
|
30
|
+
},
|
|
23
31
|
deleteSharedLinkSuccessNoticeText: {
|
|
24
32
|
id: "groupSharedFeatures.usm.deleteSharedLinkSuccessNoticeText",
|
|
25
33
|
defaultMessage: "The shared link for “{itemName}” has been removed successfully."
|
|
@@ -90,5 +98,5 @@ const r = e({
|
|
|
90
98
|
}
|
|
91
99
|
});
|
|
92
100
|
export {
|
|
93
|
-
|
|
101
|
+
a as default
|
|
94
102
|
};
|