@box/unified-share-modal 1.44.6 → 1.45.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/remove-collaborator-modal/remove-collaborator-modal.js +59 -47
- package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +48 -36
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +76 -156
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +114 -0
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +81 -73
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +99 -98
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +21 -25
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +63 -60
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +4 -0
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +73 -65
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +72 -64
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +20 -20
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +64 -57
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +21 -20
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +1 -0
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/json/src/lib/components/unified-share-form-modal/shared-link-section/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/styles/collaboration-section.css +1 -1
- package/dist/styles/collaborator-list.css +1 -1
- package/dist/styles/remove-collaborator-modal.css +1 -0
- package/dist/styles/shared-link-access.css +1 -1
- package/dist/styles/shared-link-section.css +1 -1
- package/dist/styles/shared-link-settings-modal.css +1 -1
- package/dist/styles/unified-share-form-modal.css +1 -1
- package/dist/styles/unified-share-form.css +1 -1
- package/dist/types/lib/components/shared-link-settings-modal/shared-link-settings.d.ts +1 -0
- package/dist/types/lib/components/unified-share-form-modal/shared-link-section/messages.d.ts +5 -0
- package/package.json +1 -1
- package/dist/styles/collaborator-avatar.css +0 -1
|
@@ -1,67 +1,79 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import x from "clsx";
|
|
2
|
+
import { useEffect as B } from "react";
|
|
3
|
+
import { useIntl as C } from "react-intl";
|
|
4
|
+
import { Modal as o, Divider as S, Text as k } from "@box/blueprint-web";
|
|
5
|
+
import i from "./messages.js";
|
|
6
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { useUnifiedShareModalContext as M } from "../../contexts/unified-share-modal-context.js";
|
|
8
|
+
import { useSharingAction as w } from "../../hooks/use-sharing-action.js";
|
|
9
|
+
import '../../../../styles/remove-collaborator-modal.css';const A = "_content_166yb_1", D = "_isFullscreen_166yb_1", L = "_body_166yb_10", N = "_divider_166yb_17", r = {
|
|
10
|
+
content: A,
|
|
11
|
+
isFullscreen: D,
|
|
12
|
+
body: L,
|
|
13
|
+
divider: N
|
|
14
|
+
};
|
|
15
|
+
function U({
|
|
16
|
+
isOpen: n,
|
|
17
|
+
onOpenChange: s
|
|
11
18
|
}) {
|
|
12
19
|
const {
|
|
13
20
|
formatMessage: t
|
|
14
|
-
} = y(), {
|
|
15
|
-
collaborator: l,
|
|
16
|
-
isSubmitting: d,
|
|
17
|
-
sharingService: f,
|
|
18
|
-
setCollaborator: n
|
|
19
21
|
} = C(), {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
collaborator: c,
|
|
23
|
+
isSubmitting: u,
|
|
24
|
+
sharingService: f,
|
|
25
|
+
setCollaborator: d,
|
|
26
|
+
variant: y
|
|
27
|
+
} = M(), {
|
|
28
|
+
email: v,
|
|
29
|
+
name: _
|
|
30
|
+
} = c ?? {}, {
|
|
31
|
+
removeCollaborator: m
|
|
32
|
+
} = f, l = y === "desktop";
|
|
33
|
+
B(() => {
|
|
34
|
+
n || d(null);
|
|
35
|
+
}, [n, d]);
|
|
28
36
|
const h = async () => {
|
|
29
|
-
|
|
37
|
+
m && (await m(c), s(!1), await new Promise((F) => setTimeout(F)));
|
|
30
38
|
}, {
|
|
31
|
-
isLoading:
|
|
32
|
-
onAction:
|
|
33
|
-
} =
|
|
39
|
+
isLoading: p,
|
|
40
|
+
onAction: g
|
|
41
|
+
} = w(h, "remove-collaborator"), b = u ?? p;
|
|
34
42
|
return /* @__PURE__ */ e(o, {
|
|
35
|
-
onOpenChange:
|
|
36
|
-
open:
|
|
37
|
-
children: /* @__PURE__ */
|
|
43
|
+
onOpenChange: s,
|
|
44
|
+
open: n,
|
|
45
|
+
children: /* @__PURE__ */ a(o.Content, {
|
|
46
|
+
className: x(r.content, l && r.isFullscreen),
|
|
38
47
|
size: "small",
|
|
39
48
|
children: [/* @__PURE__ */ e(o.Header, {
|
|
40
|
-
children: t(
|
|
41
|
-
}), /* @__PURE__ */
|
|
42
|
-
|
|
49
|
+
children: t(i.title)
|
|
50
|
+
}), /* @__PURE__ */ a(o.Body, {
|
|
51
|
+
className: r.body,
|
|
52
|
+
children: [l && /* @__PURE__ */ e(S, {
|
|
53
|
+
className: r.divider
|
|
54
|
+
}), /* @__PURE__ */ e(k, {
|
|
43
55
|
as: "p",
|
|
44
|
-
children: t(
|
|
45
|
-
name:
|
|
56
|
+
children: t(i.bodyText, {
|
|
57
|
+
name: v || _
|
|
46
58
|
})
|
|
47
|
-
})
|
|
48
|
-
}), /* @__PURE__ */
|
|
59
|
+
})]
|
|
60
|
+
}), /* @__PURE__ */ a(o.Footer, {
|
|
49
61
|
children: [/* @__PURE__ */ e(o.Footer.SecondaryButton, {
|
|
50
|
-
disabled:
|
|
51
|
-
onClick: () =>
|
|
52
|
-
children: t(
|
|
62
|
+
disabled: b,
|
|
63
|
+
onClick: () => s(!1),
|
|
64
|
+
children: t(i.cancelButton)
|
|
53
65
|
}), /* @__PURE__ */ e(o.Footer.PrimaryButton, {
|
|
54
|
-
loading:
|
|
55
|
-
loadingAriaLabel: t(
|
|
56
|
-
onClick:
|
|
57
|
-
children: t(
|
|
66
|
+
loading: b,
|
|
67
|
+
loadingAriaLabel: t(i.loadingLabel),
|
|
68
|
+
onClick: g,
|
|
69
|
+
children: t(i.okayButton)
|
|
58
70
|
})]
|
|
59
|
-
}), /* @__PURE__ */ e(o.Close, {
|
|
60
|
-
"aria-label": t(
|
|
71
|
+
}), !l && /* @__PURE__ */ e(o.Close, {
|
|
72
|
+
"aria-label": t(i.closeButton)
|
|
61
73
|
})]
|
|
62
74
|
})
|
|
63
75
|
});
|
|
64
76
|
}
|
|
65
77
|
export {
|
|
66
|
-
|
|
78
|
+
U as RemoveCollaboratorModal
|
|
67
79
|
};
|
|
@@ -1,55 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import p from "clsx";
|
|
2
|
+
import { useIntl as g } from "react-intl";
|
|
3
|
+
import { Modal as e, Divider as k, Text as v } from "@box/blueprint-web";
|
|
4
|
+
import i from "./messages.js";
|
|
4
5
|
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
5
|
-
import { useUnifiedShareModalContext as
|
|
6
|
-
import { useSharingAction as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { useUnifiedShareModalContext as F } from "../../contexts/unified-share-modal-context.js";
|
|
7
|
+
import { useSharingAction as S } from "../../hooks/use-sharing-action.js";
|
|
8
|
+
import '../../../../styles/remove-collaborator-modal.css';const x = "_content_166yb_1", B = "_isFullscreen_166yb_1", D = "_body_166yb_10", L = "_divider_166yb_17", n = {
|
|
9
|
+
content: x,
|
|
10
|
+
isFullscreen: B,
|
|
11
|
+
body: D,
|
|
12
|
+
divider: L
|
|
13
|
+
};
|
|
14
|
+
function P({
|
|
15
|
+
isOpen: d,
|
|
16
|
+
onOpenChange: s
|
|
10
17
|
}) {
|
|
11
18
|
const {
|
|
12
|
-
formatMessage:
|
|
13
|
-
} =
|
|
14
|
-
isSubmitting:
|
|
15
|
-
sharingService:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
formatMessage: t
|
|
20
|
+
} = g(), {
|
|
21
|
+
isSubmitting: m,
|
|
22
|
+
sharingService: u,
|
|
23
|
+
variant: b
|
|
24
|
+
} = F(), {
|
|
25
|
+
deleteSharedLink: a
|
|
26
|
+
} = u, r = b === "desktop", y = async () => {
|
|
27
|
+
a && (await a(), s(!1), await new Promise((_) => setTimeout(_)));
|
|
20
28
|
}, {
|
|
21
|
-
isLoading:
|
|
22
|
-
onAction:
|
|
23
|
-
} =
|
|
29
|
+
isLoading: f,
|
|
30
|
+
onAction: h
|
|
31
|
+
} = S(y, "delete-shared-link"), c = m ?? f;
|
|
24
32
|
return /* @__PURE__ */ o(e, {
|
|
25
|
-
onOpenChange:
|
|
26
|
-
open:
|
|
33
|
+
onOpenChange: s,
|
|
34
|
+
open: d,
|
|
27
35
|
children: /* @__PURE__ */ l(e.Content, {
|
|
36
|
+
className: p(n.content, r && n.isFullscreen),
|
|
28
37
|
size: "small",
|
|
29
38
|
children: [/* @__PURE__ */ o(e.Header, {
|
|
30
|
-
children: i
|
|
31
|
-
}), /* @__PURE__ */
|
|
32
|
-
|
|
39
|
+
children: t(i.title)
|
|
40
|
+
}), /* @__PURE__ */ l(e.Body, {
|
|
41
|
+
className: n.body,
|
|
42
|
+
children: [r && /* @__PURE__ */ o(k, {
|
|
43
|
+
className: n.divider
|
|
44
|
+
}), /* @__PURE__ */ o(v, {
|
|
33
45
|
as: "p",
|
|
34
|
-
children: i
|
|
35
|
-
})
|
|
46
|
+
children: t(i.bodyText)
|
|
47
|
+
})]
|
|
36
48
|
}), /* @__PURE__ */ l(e.Footer, {
|
|
37
49
|
children: [/* @__PURE__ */ o(e.Footer.SecondaryButton, {
|
|
38
|
-
disabled:
|
|
39
|
-
onClick: () =>
|
|
40
|
-
children: i
|
|
50
|
+
disabled: c,
|
|
51
|
+
onClick: () => s(!1),
|
|
52
|
+
children: t(i.cancelButton)
|
|
41
53
|
}), /* @__PURE__ */ o(e.Footer.PrimaryButton, {
|
|
42
|
-
loading:
|
|
43
|
-
loadingAriaLabel: i
|
|
44
|
-
onClick:
|
|
45
|
-
children: i
|
|
54
|
+
loading: c,
|
|
55
|
+
loadingAriaLabel: t(i.loadingLabel),
|
|
56
|
+
onClick: h,
|
|
57
|
+
children: t(i.okayButton)
|
|
46
58
|
})]
|
|
47
|
-
}), /* @__PURE__ */ o(e.Close, {
|
|
48
|
-
"aria-label": i
|
|
59
|
+
}), !r && /* @__PURE__ */ o(e.Close, {
|
|
60
|
+
"aria-label": t(i.closeButton)
|
|
49
61
|
})]
|
|
50
62
|
})
|
|
51
63
|
});
|
|
52
64
|
}
|
|
53
65
|
export {
|
|
54
|
-
|
|
66
|
+
P as RemoveSharedLinkModal
|
|
55
67
|
};
|
|
@@ -1,169 +1,89 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
loading:
|
|
1
|
+
import r from "clsx";
|
|
2
|
+
import { useState as k, useEffect as w } from "react";
|
|
3
|
+
import { useIntl as C } from "react-intl";
|
|
4
|
+
import { Modal as i, LoadingIndicator as q, Divider as B } from "@box/blueprint-web";
|
|
5
|
+
import { SharedLinkSettings as N } from "./shared-link-settings.js";
|
|
6
|
+
import t from "./messages.js";
|
|
7
|
+
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { useUnifiedShareModalContext as M } from "../../contexts/unified-share-modal-context.js";
|
|
9
|
+
import { useSharedLinkSettingsContext as D } from "../../contexts/shared-link-settings-context.js";
|
|
10
|
+
import '../../../../styles/shared-link-settings-modal.css';const I = "_content_1xw3q_1", j = "_isFullscreen_1xw3q_4", z = "_body_1xw3q_13", U = "_form_1xw3q_28", A = "_isLoading_1xw3q_35", E = "_loading_1xw3q_39", H = "_divider_1xw3q_50", e = {
|
|
11
|
+
content: I,
|
|
12
|
+
isFullscreen: j,
|
|
13
|
+
body: z,
|
|
14
|
+
form: U,
|
|
15
|
+
isLoading: A,
|
|
16
|
+
loading: E,
|
|
17
|
+
divider: H
|
|
17
18
|
};
|
|
18
|
-
function
|
|
19
|
-
isOpen:
|
|
20
|
-
onOpenChange:
|
|
19
|
+
function X({
|
|
20
|
+
isOpen: s,
|
|
21
|
+
onOpenChange: m
|
|
21
22
|
}) {
|
|
22
23
|
const {
|
|
23
|
-
formatMessage:
|
|
24
|
-
} =
|
|
25
|
-
eventService:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} =
|
|
43
|
-
|
|
44
|
-
} =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
setFieldError: s,
|
|
51
|
-
setFieldValue: r,
|
|
52
|
-
submitForm: _,
|
|
53
|
-
validatePassword: I
|
|
54
|
-
} = se(), [m, V] = W(!!c);
|
|
55
|
-
X(() => {
|
|
56
|
-
(async () => c && (d && await c(), V(!d)))();
|
|
57
|
-
}, [d, c]);
|
|
58
|
-
const k = () => {
|
|
59
|
-
y(), f && f(), p(!1);
|
|
60
|
-
}, M = async () => {
|
|
61
|
-
await _() || (y(), p(!1));
|
|
62
|
-
}, j = (e) => {
|
|
63
|
-
s("expiration", void 0), r("isExpirationEnabled", e);
|
|
64
|
-
}, z = (e) => {
|
|
65
|
-
s("expiration", void 0), r("expiration", e);
|
|
66
|
-
}, U = (e) => {
|
|
67
|
-
s("vanityName", void 0), r("isVanityNameEnabled", e);
|
|
68
|
-
}, H = (e) => {
|
|
69
|
-
s("vanityName", void 0), r("vanityName", e.target.value);
|
|
70
|
-
}, q = (e) => {
|
|
71
|
-
s("password", void 0), r("isPasswordEnabled", e);
|
|
72
|
-
}, G = (e) => {
|
|
73
|
-
s("password", void 0), r("password", e.target.value);
|
|
74
|
-
}, J = (e) => {
|
|
75
|
-
r("isDownloadEnabled", e);
|
|
76
|
-
}, K = (e) => {
|
|
77
|
-
const R = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")?.contains(e.relatedTarget);
|
|
78
|
-
C.isPasswordEnabled && !o.password || R || I(o.password);
|
|
79
|
-
}, l = x || T, Q = u && S && v && w;
|
|
80
|
-
return /* @__PURE__ */ n(t, {
|
|
81
|
-
onOpenChange: k,
|
|
82
|
-
open: d,
|
|
83
|
-
children: /* @__PURE__ */ h(t.Content, {
|
|
84
|
-
className: b.content,
|
|
24
|
+
formatMessage: n
|
|
25
|
+
} = C(), {
|
|
26
|
+
eventService: h,
|
|
27
|
+
isFetching: L,
|
|
28
|
+
isSubmitting: S,
|
|
29
|
+
variant: b
|
|
30
|
+
} = M(), {
|
|
31
|
+
onSharedLinkSettingsClose: g,
|
|
32
|
+
onSharedLinkSettingsLoad: a
|
|
33
|
+
} = h, l = b === "desktop", {
|
|
34
|
+
isUpdating: x,
|
|
35
|
+
resetForm: f,
|
|
36
|
+
submitForm: p
|
|
37
|
+
} = D(), [F, v] = k(!!a);
|
|
38
|
+
w(() => {
|
|
39
|
+
(async () => a && (s && await a(), v(!s)))();
|
|
40
|
+
}, [s, a]);
|
|
41
|
+
const u = () => {
|
|
42
|
+
f(), g && g(), m(!1);
|
|
43
|
+
}, y = async () => {
|
|
44
|
+
await p() || (f(), m(!1));
|
|
45
|
+
}, c = L ?? F, _ = S || x;
|
|
46
|
+
return /* @__PURE__ */ o(i, {
|
|
47
|
+
onOpenChange: u,
|
|
48
|
+
open: s,
|
|
49
|
+
children: /* @__PURE__ */ d(i.Content, {
|
|
50
|
+
className: r(e.content, l && e.isFullscreen),
|
|
85
51
|
size: "medium",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
87
|
-
children:
|
|
88
|
-
}), /* @__PURE__ */
|
|
89
|
-
className:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"aria-label": a(i.loadingLabel),
|
|
52
|
+
children: [/* @__PURE__ */ o(i.Header, {
|
|
53
|
+
children: n(t.title)
|
|
54
|
+
}), /* @__PURE__ */ d("div", {
|
|
55
|
+
className: r(e.form),
|
|
56
|
+
children: [c && /* @__PURE__ */ o("div", {
|
|
57
|
+
className: e.loading,
|
|
58
|
+
children: /* @__PURE__ */ o(q, {
|
|
59
|
+
"aria-label": n(t.loadingLabel),
|
|
95
60
|
size: "large"
|
|
96
61
|
})
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
expiration: o.expiration,
|
|
116
|
-
isChecked: o.isExpirationEnabled,
|
|
117
|
-
isDisabled: l,
|
|
118
|
-
onChange: z,
|
|
119
|
-
onToggle: j
|
|
120
|
-
}), /* @__PURE__ */ n(ie, {
|
|
121
|
-
canChange: !!v,
|
|
122
|
-
error: g.password,
|
|
123
|
-
isAvailable: A && B?.id === "open",
|
|
124
|
-
isChecked: o.isPasswordEnabled,
|
|
125
|
-
isDefaultChecked: C.isPasswordEnabled,
|
|
126
|
-
isDisabled: l,
|
|
127
|
-
onBlur: K,
|
|
128
|
-
onChange: G,
|
|
129
|
-
onFocus: () => s("password", void 0),
|
|
130
|
-
onToggle: q,
|
|
131
|
-
password: o.password
|
|
132
|
-
}), /* @__PURE__ */ n(oe, {
|
|
133
|
-
canChange: !!w,
|
|
134
|
-
error: g.vanityName,
|
|
135
|
-
isAvailable: !!P,
|
|
136
|
-
isChecked: o.isVanityNameEnabled,
|
|
137
|
-
isDisabled: l,
|
|
138
|
-
onChange: H,
|
|
139
|
-
onToggle: U,
|
|
140
|
-
vanityDomain: D,
|
|
141
|
-
vanityName: o.vanityName
|
|
142
|
-
}), /* @__PURE__ */ n(ne, {
|
|
143
|
-
canChange: !!u,
|
|
144
|
-
isAvailable: !!F,
|
|
145
|
-
isChecked: o.isDownloadEnabled,
|
|
146
|
-
isDisabled: l,
|
|
147
|
-
onToggle: J
|
|
148
|
-
})]
|
|
149
|
-
}), !m && /* @__PURE__ */ h(t.Footer, {
|
|
150
|
-
children: [/* @__PURE__ */ n(t.Footer.SecondaryButton, {
|
|
151
|
-
disabled: l,
|
|
152
|
-
onClick: k,
|
|
153
|
-
children: a(i.cancelButton)
|
|
154
|
-
}), /* @__PURE__ */ n(t.Footer.PrimaryButton, {
|
|
155
|
-
id: "usm-SharedLinkSettingsModal-primaryButton",
|
|
156
|
-
loading: l,
|
|
157
|
-
loadingAriaLabel: a(i.loadingLabel),
|
|
158
|
-
onClick: M,
|
|
159
|
-
children: a(i.saveButton)
|
|
62
|
+
}), /* @__PURE__ */ d(i.Body, {
|
|
63
|
+
className: r(e.body, c && e.isLoading),
|
|
64
|
+
children: [l && /* @__PURE__ */ o(B, {
|
|
65
|
+
className: e.divider
|
|
66
|
+
}), /* @__PURE__ */ o(N, {})]
|
|
67
|
+
}), /* @__PURE__ */ d(i.Footer, {
|
|
68
|
+
className: r(c && e.isLoading),
|
|
69
|
+
children: [/* @__PURE__ */ o(i.Footer.SecondaryButton, {
|
|
70
|
+
disabled: _,
|
|
71
|
+
onClick: u,
|
|
72
|
+
children: n(t.cancelButton)
|
|
73
|
+
}), /* @__PURE__ */ o(i.Footer.PrimaryButton, {
|
|
74
|
+
id: "usm-SharedLinkSettingsModal-primaryButton",
|
|
75
|
+
loading: _,
|
|
76
|
+
loadingAriaLabel: n(t.loadingLabel),
|
|
77
|
+
onClick: y,
|
|
78
|
+
children: n(t.saveButton)
|
|
79
|
+
})]
|
|
160
80
|
})]
|
|
161
|
-
}), /* @__PURE__ */
|
|
162
|
-
"aria-label":
|
|
81
|
+
}), !l && /* @__PURE__ */ o(i.Close, {
|
|
82
|
+
"aria-label": n(t.closeButton)
|
|
163
83
|
})]
|
|
164
84
|
})
|
|
165
85
|
});
|
|
166
86
|
}
|
|
167
87
|
export {
|
|
168
|
-
|
|
88
|
+
X as SharedLinkSettingsModal
|
|
169
89
|
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { useIntl as F } from "react-intl";
|
|
2
|
+
import { InlineNotice as I, Text as B, Link as M } from "@box/blueprint-web";
|
|
3
|
+
import { DownloadSection as j } from "./download-section.js";
|
|
4
|
+
import { ExpirationSection as O } from "./expiration-section.js";
|
|
5
|
+
import { PasswordSection as U } from "./password-section.js";
|
|
6
|
+
import { VanitySection as _ } from "./vanity-section.js";
|
|
7
|
+
import r from "./messages.js";
|
|
8
|
+
import { jsxs as q, Fragment as z, jsx as o } from "react/jsx-runtime";
|
|
9
|
+
import { useAccessLevels as G } from "../../hooks/use-access-levels.js";
|
|
10
|
+
import { useSharedLinkSettingsContext as H } from "../../contexts/shared-link-settings-context.js";
|
|
11
|
+
import { useUnifiedShareModalContext as J } from "../../contexts/unified-share-modal-context.js";
|
|
12
|
+
function oa() {
|
|
13
|
+
const {
|
|
14
|
+
formatMessage: s
|
|
15
|
+
} = F(), {
|
|
16
|
+
isSubmitting: p,
|
|
17
|
+
sharedLink: b
|
|
18
|
+
} = J(), {
|
|
19
|
+
settings: w = {},
|
|
20
|
+
vanityDomain: v = ""
|
|
21
|
+
} = b, {
|
|
22
|
+
canChangeDownload: l,
|
|
23
|
+
canChangeExpiration: c,
|
|
24
|
+
canChangePassword: g,
|
|
25
|
+
canChangeVanityName: m,
|
|
26
|
+
isDownloadAvailable: u,
|
|
27
|
+
isPasswordAvailable: C,
|
|
28
|
+
isVanityNameAvailable: S
|
|
29
|
+
} = w, {
|
|
30
|
+
selectedAccess: f
|
|
31
|
+
} = G(), {
|
|
32
|
+
errors: d,
|
|
33
|
+
formData: e,
|
|
34
|
+
initialFormData: h,
|
|
35
|
+
isUpdating: x,
|
|
36
|
+
setFieldError: n,
|
|
37
|
+
setFieldValue: i,
|
|
38
|
+
validatePassword: E
|
|
39
|
+
} = H(), y = (a) => {
|
|
40
|
+
n("expiration", void 0), i("isExpirationEnabled", a);
|
|
41
|
+
}, k = (a) => {
|
|
42
|
+
n("expiration", void 0), i("expiration", a);
|
|
43
|
+
}, D = (a) => {
|
|
44
|
+
n("vanityName", void 0), i("isVanityNameEnabled", a);
|
|
45
|
+
}, L = (a) => {
|
|
46
|
+
n("vanityName", void 0), i("vanityName", a.target.value);
|
|
47
|
+
}, N = (a) => {
|
|
48
|
+
n("password", void 0), i("isPasswordEnabled", a);
|
|
49
|
+
}, A = (a) => {
|
|
50
|
+
n("password", void 0), i("password", a.target.value);
|
|
51
|
+
}, P = (a) => {
|
|
52
|
+
i("isDownloadEnabled", a);
|
|
53
|
+
}, T = (a) => {
|
|
54
|
+
const V = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")?.contains(a.relatedTarget);
|
|
55
|
+
h.isPasswordEnabled && !e.password || V || E(e.password);
|
|
56
|
+
}, t = p || x;
|
|
57
|
+
return /* @__PURE__ */ q(z, {
|
|
58
|
+
children: [!(l && c && g && m) && /* @__PURE__ */ o(I, {
|
|
59
|
+
variant: "warning",
|
|
60
|
+
variantIconAriaLabel: s(r.warningNoticeIconAriaLabel),
|
|
61
|
+
children: s(r.inaccessibleSettingsNotice)
|
|
62
|
+
}), /* @__PURE__ */ o(B, {
|
|
63
|
+
as: "p",
|
|
64
|
+
color: "textOnLightSecondary",
|
|
65
|
+
children: s(r.subtitle, {
|
|
66
|
+
learnSharedLinkSettingsLink: /* @__PURE__ */ o(M, {
|
|
67
|
+
href: "https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings",
|
|
68
|
+
rel: "noreferrer",
|
|
69
|
+
target: "_blank",
|
|
70
|
+
children: s(r.learnSharedLinkSettingsLink)
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}), /* @__PURE__ */ o(O, {
|
|
74
|
+
canChange: !!c,
|
|
75
|
+
error: d.expiration,
|
|
76
|
+
expiration: e.expiration,
|
|
77
|
+
isChecked: e.isExpirationEnabled,
|
|
78
|
+
isDisabled: t,
|
|
79
|
+
onChange: k,
|
|
80
|
+
onToggle: y
|
|
81
|
+
}), /* @__PURE__ */ o(U, {
|
|
82
|
+
canChange: !!g,
|
|
83
|
+
error: d.password,
|
|
84
|
+
isAvailable: C && f?.id === "open",
|
|
85
|
+
isChecked: e.isPasswordEnabled,
|
|
86
|
+
isDefaultChecked: h.isPasswordEnabled,
|
|
87
|
+
isDisabled: t,
|
|
88
|
+
onBlur: T,
|
|
89
|
+
onChange: A,
|
|
90
|
+
onFocus: () => n("password", void 0),
|
|
91
|
+
onToggle: N,
|
|
92
|
+
password: e.password
|
|
93
|
+
}), /* @__PURE__ */ o(_, {
|
|
94
|
+
canChange: !!m,
|
|
95
|
+
error: d.vanityName,
|
|
96
|
+
isAvailable: !!S,
|
|
97
|
+
isChecked: e.isVanityNameEnabled,
|
|
98
|
+
isDisabled: t,
|
|
99
|
+
onChange: L,
|
|
100
|
+
onToggle: D,
|
|
101
|
+
vanityDomain: v,
|
|
102
|
+
vanityName: e.vanityName
|
|
103
|
+
}), /* @__PURE__ */ o(j, {
|
|
104
|
+
canChange: !!l,
|
|
105
|
+
isAvailable: !!u,
|
|
106
|
+
isChecked: e.isDownloadEnabled,
|
|
107
|
+
isDisabled: t,
|
|
108
|
+
onToggle: P
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
oa as SharedLinkSettings
|
|
114
|
+
};
|