@box/unified-share-modal 1.52.0 → 1.52.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.
- package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +54 -51
- package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +44 -41
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +56 -58
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +70 -71
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +60 -58
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +98 -99
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +39 -40
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +55 -54
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +73 -70
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +57 -56
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +107 -108
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +55 -54
- package/dist/esm/lib/contexts/shared-link-settings-context.js +32 -34
- package/dist/esm/lib/contexts/unified-share-modal-context.js +39 -38
- package/dist/esm/lib/hooks/use-collaboration-form.js +31 -33
- package/dist/esm/lib/hooks/use-link-settings-form.js +30 -32
- package/dist/esm/lib/hooks/use-sharing-action.js +39 -39
- package/dist/styles/collaboration-role.css +1 -1
- package/dist/styles/collaborator-list-item.css +1 -1
- package/dist/styles/shared-link-access.css +1 -1
- package/dist/styles/shared-link-settings-modal.css +1 -1
- package/dist/types/lib/contexts/shared-link-settings-context.d.ts +0 -1
- package/dist/types/lib/contexts/unified-share-modal-context.d.ts +2 -1
- package/dist/types/lib/hooks/use-collaboration-form.d.ts +0 -1
- package/dist/types/lib/hooks/use-link-settings-form.d.ts +0 -1
- package/dist/types/lib/hooks/use-sharing-action.d.ts +0 -1
- package/dist/types/lib/types.d.ts +12 -0
- package/package.json +9 -9
|
@@ -1,79 +1,82 @@
|
|
|
1
1
|
import x from "clsx";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import C from "lodash/noop";
|
|
3
|
+
import { useEffect as F } from "react";
|
|
4
|
+
import { useIntl as B } from "react-intl";
|
|
4
5
|
import { Modal as o, Divider as S, Text as k } from "@box/blueprint-web";
|
|
5
|
-
import
|
|
6
|
-
import { jsx as e, jsxs as
|
|
7
|
-
import { useUnifiedShareModalContext as
|
|
8
|
-
import { useSharingAction as
|
|
9
|
-
import '../../../../styles/remove-collaborator-modal.css';const
|
|
10
|
-
content:
|
|
11
|
-
isFullscreen:
|
|
12
|
-
body:
|
|
6
|
+
import n from "./messages.js";
|
|
7
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { useUnifiedShareModalContext as w } from "../../contexts/unified-share-modal-context.js";
|
|
9
|
+
import { useSharingAction as D } from "../../hooks/use-sharing-action.js";
|
|
10
|
+
import '../../../../styles/remove-collaborator-modal.css';const M = "_content_166yb_1", P = "_isFullscreen_166yb_1", A = "_body_166yb_10", N = "_divider_166yb_17", i = {
|
|
11
|
+
content: M,
|
|
12
|
+
isFullscreen: P,
|
|
13
|
+
body: A,
|
|
13
14
|
divider: N
|
|
14
15
|
};
|
|
15
|
-
function
|
|
16
|
-
isOpen:
|
|
16
|
+
function q({
|
|
17
|
+
isOpen: l,
|
|
17
18
|
onOpenChange: s
|
|
18
19
|
}) {
|
|
19
20
|
const {
|
|
20
21
|
formatMessage: t
|
|
21
|
-
} =
|
|
22
|
-
collaborator:
|
|
23
|
-
isSubmitting:
|
|
22
|
+
} = B(), {
|
|
23
|
+
collaborator: m,
|
|
24
|
+
isSubmitting: r,
|
|
24
25
|
sharingService: f,
|
|
25
|
-
setCollaborator:
|
|
26
|
+
setCollaborator: u,
|
|
26
27
|
variant: y
|
|
27
|
-
} =
|
|
28
|
-
email:
|
|
29
|
-
name:
|
|
30
|
-
} =
|
|
31
|
-
removeCollaborator:
|
|
32
|
-
} = f,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
const
|
|
37
|
-
|
|
28
|
+
} = w(), {
|
|
29
|
+
email: p,
|
|
30
|
+
name: h
|
|
31
|
+
} = m ?? {}, {
|
|
32
|
+
removeCollaborator: b
|
|
33
|
+
} = f, a = y === "desktop";
|
|
34
|
+
F(() => {
|
|
35
|
+
l || u(null);
|
|
36
|
+
}, [l, u]);
|
|
37
|
+
const v = async () => {
|
|
38
|
+
b && (await b(m), s(!1), await new Promise((c) => setTimeout(c)));
|
|
38
39
|
}, {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
onAction: _
|
|
41
|
+
} = D(v, "remove-collaborator"), g = (c) => {
|
|
42
|
+
c.preventDefault();
|
|
43
|
+
};
|
|
42
44
|
return /* @__PURE__ */ e(o, {
|
|
43
|
-
onOpenChange: s,
|
|
44
|
-
open:
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
-
className: x(
|
|
45
|
+
onOpenChange: r ? C : s,
|
|
46
|
+
open: l,
|
|
47
|
+
children: /* @__PURE__ */ d(o.Content, {
|
|
48
|
+
className: x(i.content, a && i.isFullscreen),
|
|
49
|
+
onPointerDownOutside: g,
|
|
47
50
|
size: "small",
|
|
48
51
|
children: [/* @__PURE__ */ e(o.Header, {
|
|
49
|
-
children: t(
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
-
className:
|
|
52
|
-
children: [
|
|
53
|
-
className:
|
|
52
|
+
children: t(n.title)
|
|
53
|
+
}), /* @__PURE__ */ d(o.Body, {
|
|
54
|
+
className: i.body,
|
|
55
|
+
children: [a && /* @__PURE__ */ e(S, {
|
|
56
|
+
className: i.divider
|
|
54
57
|
}), /* @__PURE__ */ e(k, {
|
|
55
58
|
as: "p",
|
|
56
|
-
children: t(
|
|
57
|
-
name:
|
|
59
|
+
children: t(n.bodyText, {
|
|
60
|
+
name: p || h
|
|
58
61
|
})
|
|
59
62
|
})]
|
|
60
|
-
}), /* @__PURE__ */
|
|
63
|
+
}), /* @__PURE__ */ d(o.Footer, {
|
|
61
64
|
children: [/* @__PURE__ */ e(o.Footer.SecondaryButton, {
|
|
62
|
-
disabled:
|
|
65
|
+
disabled: r,
|
|
63
66
|
onClick: () => s(!1),
|
|
64
|
-
children: t(
|
|
67
|
+
children: t(n.cancelButton)
|
|
65
68
|
}), /* @__PURE__ */ e(o.Footer.PrimaryButton, {
|
|
66
|
-
loading:
|
|
67
|
-
loadingAriaLabel: t(
|
|
68
|
-
onClick:
|
|
69
|
-
children: t(
|
|
69
|
+
loading: r,
|
|
70
|
+
loadingAriaLabel: t(n.loadingLabel),
|
|
71
|
+
onClick: _,
|
|
72
|
+
children: t(n.okayButton)
|
|
70
73
|
})]
|
|
71
|
-
}), !
|
|
72
|
-
"aria-label": t(
|
|
74
|
+
}), !r && !a && /* @__PURE__ */ e(o.Close, {
|
|
75
|
+
"aria-label": t(n.closeButton)
|
|
73
76
|
})]
|
|
74
77
|
})
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
export {
|
|
78
|
-
|
|
81
|
+
q as RemoveCollaboratorModal
|
|
79
82
|
};
|
|
@@ -1,67 +1,70 @@
|
|
|
1
1
|
import p from "clsx";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
2
|
+
import _ from "lodash/noop";
|
|
3
|
+
import { useIntl as v } from "react-intl";
|
|
4
|
+
import { Modal as e, Divider as k, Text as S } from "@box/blueprint-web";
|
|
5
|
+
import n from "./messages.js";
|
|
6
|
+
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { useUnifiedShareModalContext as g } from "../../contexts/unified-share-modal-context.js";
|
|
8
|
+
import { useSharingAction as x } from "../../hooks/use-sharing-action.js";
|
|
9
|
+
import '../../../../styles/remove-collaborator-modal.css';const F = "_content_166yb_1", B = "_isFullscreen_166yb_1", D = "_body_166yb_10", w = "_divider_166yb_17", s = {
|
|
10
|
+
content: F,
|
|
10
11
|
isFullscreen: B,
|
|
11
12
|
body: D,
|
|
12
|
-
divider:
|
|
13
|
+
divider: w
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
isOpen:
|
|
16
|
-
onOpenChange:
|
|
15
|
+
function z({
|
|
16
|
+
isOpen: m,
|
|
17
|
+
onOpenChange: r
|
|
17
18
|
}) {
|
|
18
19
|
const {
|
|
19
20
|
formatMessage: t
|
|
20
|
-
} =
|
|
21
|
-
isSubmitting:
|
|
21
|
+
} = v(), {
|
|
22
|
+
isSubmitting: i,
|
|
22
23
|
sharingService: u,
|
|
23
24
|
variant: b
|
|
24
|
-
} =
|
|
25
|
-
deleteSharedLink:
|
|
26
|
-
} = u,
|
|
27
|
-
|
|
25
|
+
} = g(), {
|
|
26
|
+
deleteSharedLink: c
|
|
27
|
+
} = u, l = b === "desktop", f = async () => {
|
|
28
|
+
c && (await c(), r(!1), await new Promise((a) => setTimeout(a)));
|
|
28
29
|
}, {
|
|
29
|
-
isLoading: f,
|
|
30
30
|
onAction: h
|
|
31
|
-
} =
|
|
31
|
+
} = x(f, "delete-shared-link"), y = (a) => {
|
|
32
|
+
a.preventDefault();
|
|
33
|
+
};
|
|
32
34
|
return /* @__PURE__ */ o(e, {
|
|
33
|
-
onOpenChange:
|
|
34
|
-
open:
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
-
className: p(
|
|
35
|
+
onOpenChange: i ? _ : r,
|
|
36
|
+
open: m,
|
|
37
|
+
children: /* @__PURE__ */ d(e.Content, {
|
|
38
|
+
className: p(s.content, l && s.isFullscreen),
|
|
39
|
+
onPointerDownOutside: y,
|
|
37
40
|
size: "small",
|
|
38
41
|
children: [/* @__PURE__ */ o(e.Header, {
|
|
39
|
-
children: t(
|
|
40
|
-
}), /* @__PURE__ */
|
|
41
|
-
className:
|
|
42
|
-
children: [
|
|
43
|
-
className:
|
|
44
|
-
}), /* @__PURE__ */ o(
|
|
42
|
+
children: t(n.title)
|
|
43
|
+
}), /* @__PURE__ */ d(e.Body, {
|
|
44
|
+
className: s.body,
|
|
45
|
+
children: [l && /* @__PURE__ */ o(k, {
|
|
46
|
+
className: s.divider
|
|
47
|
+
}), /* @__PURE__ */ o(S, {
|
|
45
48
|
as: "p",
|
|
46
|
-
children: t(
|
|
49
|
+
children: t(n.bodyText)
|
|
47
50
|
})]
|
|
48
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ d(e.Footer, {
|
|
49
52
|
children: [/* @__PURE__ */ o(e.Footer.SecondaryButton, {
|
|
50
|
-
disabled:
|
|
51
|
-
onClick: () =>
|
|
52
|
-
children: t(
|
|
53
|
+
disabled: i,
|
|
54
|
+
onClick: () => r(!1),
|
|
55
|
+
children: t(n.cancelButton)
|
|
53
56
|
}), /* @__PURE__ */ o(e.Footer.PrimaryButton, {
|
|
54
|
-
loading:
|
|
55
|
-
loadingAriaLabel: t(
|
|
57
|
+
loading: i,
|
|
58
|
+
loadingAriaLabel: t(n.loadingLabel),
|
|
56
59
|
onClick: h,
|
|
57
|
-
children: t(
|
|
60
|
+
children: t(n.okayButton)
|
|
58
61
|
})]
|
|
59
|
-
}), !
|
|
60
|
-
"aria-label": t(
|
|
62
|
+
}), !i && !l && /* @__PURE__ */ o(e.Close, {
|
|
63
|
+
"aria-label": t(n.closeButton)
|
|
61
64
|
})]
|
|
62
65
|
})
|
|
63
66
|
});
|
|
64
67
|
}
|
|
65
68
|
export {
|
|
66
|
-
|
|
69
|
+
z as RemoveSharedLinkModal
|
|
67
70
|
};
|
|
@@ -1,95 +1,93 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { Modal as i, LoadingIndicator as
|
|
5
|
-
import { SharedLinkSettings as
|
|
1
|
+
import l from "clsx";
|
|
2
|
+
import { useState as k, useEffect as C } from "react";
|
|
3
|
+
import { useIntl as F } from "react-intl";
|
|
4
|
+
import { Modal as i, LoadingIndicator as B, Divider as N } from "@box/blueprint-web";
|
|
5
|
+
import { SharedLinkSettings as x } from "./shared-link-settings.js";
|
|
6
6
|
import t from "./messages.js";
|
|
7
7
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
import { ClassificationStatus as
|
|
9
|
-
import { useUnifiedShareModalContext as
|
|
10
|
-
import { useSharedLinkSettingsContext as
|
|
11
|
-
import '../../../../styles/shared-link-settings-modal.css';const
|
|
12
|
-
content:
|
|
13
|
-
isFullscreen:
|
|
14
|
-
body:
|
|
15
|
-
header:
|
|
16
|
-
form:
|
|
17
|
-
isLoading:
|
|
18
|
-
loading:
|
|
19
|
-
divider:
|
|
8
|
+
import { ClassificationStatus as D } from "../classification-status/classification-status.js";
|
|
9
|
+
import { useUnifiedShareModalContext as M } from "../../contexts/unified-share-modal-context.js";
|
|
10
|
+
import { useSharedLinkSettingsContext as w } from "../../contexts/shared-link-settings-context.js";
|
|
11
|
+
import '../../../../styles/shared-link-settings-modal.css';const I = "_content_1dmg4_1", P = "_isFullscreen_1dmg4_4", j = "_body_1dmg4_13", z = "_header_1dmg4_17", A = "_form_1dmg4_35", E = "_isLoading_1dmg4_42", H = "_loading_1dmg4_46", U = "_divider_1dmg4_54", o = {
|
|
12
|
+
content: I,
|
|
13
|
+
isFullscreen: P,
|
|
14
|
+
body: j,
|
|
15
|
+
header: z,
|
|
16
|
+
form: A,
|
|
17
|
+
isLoading: E,
|
|
18
|
+
loading: H,
|
|
19
|
+
divider: U
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function Y({
|
|
22
22
|
isOpen: a,
|
|
23
|
-
onOpenChange:
|
|
23
|
+
onOpenChange: g
|
|
24
24
|
}) {
|
|
25
25
|
const {
|
|
26
26
|
formatMessage: n
|
|
27
|
-
} =
|
|
28
|
-
eventService:
|
|
29
|
-
|
|
30
|
-
isSubmitting: L,
|
|
27
|
+
} = F(), {
|
|
28
|
+
eventService: h,
|
|
29
|
+
isSubmitting: r,
|
|
31
30
|
variant: S
|
|
32
|
-
} =
|
|
33
|
-
onSharedLinkSettingsClose:
|
|
34
|
-
onSharedLinkSettingsLoad:
|
|
35
|
-
} =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, c = b || v, u = L || k;
|
|
31
|
+
} = M(), {
|
|
32
|
+
onSharedLinkSettingsClose: f,
|
|
33
|
+
onSharedLinkSettingsLoad: d
|
|
34
|
+
} = h, c = S === "desktop", {
|
|
35
|
+
resetForm: u,
|
|
36
|
+
submitForm: L
|
|
37
|
+
} = w(), [m, b] = k(!!d);
|
|
38
|
+
C(() => {
|
|
39
|
+
(async () => d && (a && await d(), b(!a)))();
|
|
40
|
+
}, [a, d]);
|
|
41
|
+
const _ = () => {
|
|
42
|
+
r || (u(), f && f(), g(!1));
|
|
43
|
+
}, p = async () => {
|
|
44
|
+
await L() || (u(), g(!1));
|
|
45
|
+
}, v = (y) => {
|
|
46
|
+
y.preventDefault();
|
|
47
|
+
};
|
|
50
48
|
return /* @__PURE__ */ e(i, {
|
|
51
|
-
onOpenChange:
|
|
49
|
+
onOpenChange: _,
|
|
52
50
|
open: a,
|
|
53
51
|
children: /* @__PURE__ */ s(i.Content, {
|
|
54
|
-
className:
|
|
55
|
-
onPointerDownOutside:
|
|
52
|
+
className: l(o.content, c && o.isFullscreen),
|
|
53
|
+
onPointerDownOutside: v,
|
|
56
54
|
size: "medium",
|
|
57
55
|
children: [/* @__PURE__ */ s(i.Header, {
|
|
58
56
|
className: o.header,
|
|
59
|
-
children: [n(t.title), /* @__PURE__ */ e(
|
|
57
|
+
children: [n(t.title), /* @__PURE__ */ e(D, {})]
|
|
60
58
|
}), /* @__PURE__ */ s("div", {
|
|
61
|
-
className:
|
|
62
|
-
children: [
|
|
59
|
+
className: l(o.form),
|
|
60
|
+
children: [m && /* @__PURE__ */ e("div", {
|
|
63
61
|
className: o.loading,
|
|
64
|
-
children: /* @__PURE__ */ e(
|
|
62
|
+
children: /* @__PURE__ */ e(B, {
|
|
65
63
|
"aria-label": n(t.loadingLabel),
|
|
66
64
|
size: "large"
|
|
67
65
|
})
|
|
68
66
|
}), /* @__PURE__ */ s(i.Body, {
|
|
69
|
-
className:
|
|
70
|
-
children: [
|
|
67
|
+
className: l(o.body, m && o.isLoading),
|
|
68
|
+
children: [c && /* @__PURE__ */ e(N, {
|
|
71
69
|
className: o.divider
|
|
72
|
-
}), /* @__PURE__ */ e(
|
|
70
|
+
}), /* @__PURE__ */ e(x, {})]
|
|
73
71
|
}), /* @__PURE__ */ s(i.Footer, {
|
|
74
|
-
className:
|
|
72
|
+
className: l(m && o.isLoading),
|
|
75
73
|
children: [/* @__PURE__ */ e(i.Footer.SecondaryButton, {
|
|
76
|
-
disabled:
|
|
77
|
-
onClick:
|
|
74
|
+
disabled: r,
|
|
75
|
+
onClick: _,
|
|
78
76
|
children: n(t.cancelButton)
|
|
79
77
|
}), /* @__PURE__ */ e(i.Footer.PrimaryButton, {
|
|
80
78
|
id: "usm-SharedLinkSettingsModal-primaryButton",
|
|
81
|
-
loading:
|
|
79
|
+
loading: r,
|
|
82
80
|
loadingAriaLabel: n(t.loadingLabel),
|
|
83
|
-
onClick:
|
|
81
|
+
onClick: p,
|
|
84
82
|
children: n(t.saveButton)
|
|
85
83
|
})]
|
|
86
84
|
})]
|
|
87
|
-
}), !
|
|
85
|
+
}), !r && !c && /* @__PURE__ */ e(i.Close, {
|
|
88
86
|
"aria-label": n(t.closeButton)
|
|
89
87
|
})]
|
|
90
88
|
})
|
|
91
89
|
});
|
|
92
90
|
}
|
|
93
91
|
export {
|
|
94
|
-
|
|
92
|
+
Y as SharedLinkSettingsModal
|
|
95
93
|
};
|
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { InlineNotice as
|
|
4
|
-
import { DownloadSection as
|
|
5
|
-
import { ExpirationSection as
|
|
6
|
-
import { PasswordSection as
|
|
7
|
-
import { VanitySection as
|
|
1
|
+
import { useMemo as V } from "react";
|
|
2
|
+
import { useIntl as F } from "react-intl";
|
|
3
|
+
import { InlineNotice as I, Text as M, Link as B } from "@box/blueprint-web";
|
|
4
|
+
import { DownloadSection as O } from "./download-section.js";
|
|
5
|
+
import { ExpirationSection as j } from "./expiration-section.js";
|
|
6
|
+
import { PasswordSection as U } from "./password-section.js";
|
|
7
|
+
import { VanitySection as _ } from "./vanity-section.js";
|
|
8
8
|
import n from "./messages.js";
|
|
9
|
-
import { jsxs as
|
|
10
|
-
import { useAccessLevels as
|
|
11
|
-
import { useSharedLinkSettingsContext as
|
|
12
|
-
import { useUnifiedShareModalContext as
|
|
13
|
-
function
|
|
9
|
+
import { jsxs as q, Fragment as z, jsx as s } from "react/jsx-runtime";
|
|
10
|
+
import { useAccessLevels as G } from "../../hooks/use-access-levels.js";
|
|
11
|
+
import { useSharedLinkSettingsContext as H } from "../../contexts/shared-link-settings-context.js";
|
|
12
|
+
import { useUnifiedShareModalContext as J } from "../../contexts/unified-share-modal-context.js";
|
|
13
|
+
function se() {
|
|
14
14
|
const {
|
|
15
15
|
formatMessage: t
|
|
16
|
-
} =
|
|
17
|
-
isSubmitting:
|
|
18
|
-
sharedLink:
|
|
19
|
-
} =
|
|
20
|
-
settings:
|
|
21
|
-
vanityDomain:
|
|
22
|
-
} =
|
|
16
|
+
} = F(), {
|
|
17
|
+
isSubmitting: r,
|
|
18
|
+
sharedLink: b
|
|
19
|
+
} = J(), {
|
|
20
|
+
settings: w = {},
|
|
21
|
+
vanityDomain: v = ""
|
|
22
|
+
} = b, {
|
|
23
23
|
canChangeDownload: c,
|
|
24
24
|
canChangeExpiration: g,
|
|
25
25
|
canChangePassword: m,
|
|
26
|
-
canChangeVanityName:
|
|
27
|
-
isDownloadAvailable:
|
|
28
|
-
isPasswordAvailable:
|
|
29
|
-
isVanityNameAvailable:
|
|
30
|
-
} =
|
|
31
|
-
selectedAccess:
|
|
32
|
-
} =
|
|
26
|
+
canChangeVanityName: h,
|
|
27
|
+
isDownloadAvailable: C,
|
|
28
|
+
isPasswordAvailable: f,
|
|
29
|
+
isVanityNameAvailable: S
|
|
30
|
+
} = w, {
|
|
31
|
+
selectedAccess: l
|
|
32
|
+
} = G(), {
|
|
33
33
|
errors: d,
|
|
34
34
|
formData: a,
|
|
35
|
-
initialFormData:
|
|
36
|
-
isUpdating: x,
|
|
35
|
+
initialFormData: p,
|
|
37
36
|
setFieldError: i,
|
|
38
37
|
setFieldValue: o,
|
|
39
|
-
validatePassword:
|
|
40
|
-
} =
|
|
41
|
-
if (!
|
|
38
|
+
validatePassword: E
|
|
39
|
+
} = H(), u = V(() => {
|
|
40
|
+
if (!l)
|
|
42
41
|
return null;
|
|
43
|
-
switch (
|
|
42
|
+
switch (l.id) {
|
|
44
43
|
case "collaborators":
|
|
45
44
|
return n.subtitleCollaborators;
|
|
46
45
|
case "open":
|
|
@@ -50,79 +49,79 @@ function re() {
|
|
|
50
49
|
default:
|
|
51
50
|
return null;
|
|
52
51
|
}
|
|
53
|
-
}, [a.isDownloadEnabled,
|
|
52
|
+
}, [a.isDownloadEnabled, l]), x = (e) => {
|
|
54
53
|
i("expiration", void 0), o("isExpirationEnabled", e);
|
|
55
|
-
},
|
|
54
|
+
}, y = (e) => {
|
|
56
55
|
i("expiration", void 0), o("expiration", e);
|
|
57
|
-
},
|
|
56
|
+
}, D = (e) => {
|
|
58
57
|
i("vanityName", void 0), o("isVanityNameEnabled", e);
|
|
59
|
-
},
|
|
58
|
+
}, k = (e) => {
|
|
60
59
|
i("vanityName", void 0), o("vanityName", e.target.value);
|
|
61
|
-
},
|
|
60
|
+
}, N = (e) => {
|
|
62
61
|
i("password", void 0), o("isPasswordEnabled", e);
|
|
63
|
-
},
|
|
62
|
+
}, L = (e) => {
|
|
64
63
|
i("password", void 0), o("password", e.target.value);
|
|
65
|
-
},
|
|
64
|
+
}, A = (e) => {
|
|
66
65
|
o("isDownloadEnabled", e);
|
|
67
|
-
},
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
children: [!(c && g && m &&
|
|
66
|
+
}, P = (e) => {
|
|
67
|
+
const T = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")?.contains(e.relatedTarget);
|
|
68
|
+
p.isPasswordEnabled && !a.password || T || E(a.password);
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ q(z, {
|
|
71
|
+
children: [!(c && g && m && h) && /* @__PURE__ */ s(I, {
|
|
73
72
|
variant: "warning",
|
|
74
73
|
variantIconAriaLabel: t(n.warningNoticeIconAriaLabel),
|
|
75
74
|
children: t(n.inaccessibleSettingsNotice)
|
|
76
|
-
}),
|
|
75
|
+
}), u && /* @__PURE__ */ s(M, {
|
|
77
76
|
as: "p",
|
|
78
77
|
color: "textOnLightSecondary",
|
|
79
|
-
children: t(
|
|
80
|
-
learnSharedLinkSettingsLink: /* @__PURE__ */ s(
|
|
78
|
+
children: t(u, {
|
|
79
|
+
learnSharedLinkSettingsLink: /* @__PURE__ */ s(B, {
|
|
81
80
|
href: "https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings",
|
|
82
81
|
rel: "noreferrer",
|
|
83
82
|
target: "_blank",
|
|
84
83
|
children: t(n.learnSharedLinkSettingsLink)
|
|
85
84
|
})
|
|
86
85
|
})
|
|
87
|
-
}), /* @__PURE__ */ s(
|
|
86
|
+
}), /* @__PURE__ */ s(j, {
|
|
88
87
|
canChange: !!g,
|
|
89
88
|
error: d.expiration,
|
|
90
89
|
expiration: a.expiration,
|
|
91
90
|
isChecked: a.isExpirationEnabled,
|
|
92
|
-
isDisabled:
|
|
93
|
-
onChange:
|
|
94
|
-
onToggle:
|
|
95
|
-
}), /* @__PURE__ */ s(
|
|
91
|
+
isDisabled: r,
|
|
92
|
+
onChange: y,
|
|
93
|
+
onToggle: x
|
|
94
|
+
}), /* @__PURE__ */ s(U, {
|
|
96
95
|
canChange: !!m,
|
|
97
96
|
error: d.password,
|
|
98
|
-
isAvailable:
|
|
97
|
+
isAvailable: f && l?.id === "open",
|
|
99
98
|
isChecked: a.isPasswordEnabled,
|
|
100
|
-
isDefaultChecked:
|
|
101
|
-
isDisabled:
|
|
102
|
-
onBlur:
|
|
103
|
-
onChange:
|
|
99
|
+
isDefaultChecked: p.isPasswordEnabled,
|
|
100
|
+
isDisabled: r,
|
|
101
|
+
onBlur: P,
|
|
102
|
+
onChange: L,
|
|
104
103
|
onFocus: () => i("password", void 0),
|
|
105
|
-
onToggle:
|
|
104
|
+
onToggle: N,
|
|
106
105
|
password: a.password
|
|
107
|
-
}), /* @__PURE__ */ s(
|
|
108
|
-
canChange: !!
|
|
106
|
+
}), /* @__PURE__ */ s(_, {
|
|
107
|
+
canChange: !!h,
|
|
109
108
|
error: d.vanityName,
|
|
110
|
-
isAvailable: !!
|
|
109
|
+
isAvailable: !!S,
|
|
111
110
|
isChecked: a.isVanityNameEnabled,
|
|
112
|
-
isDisabled:
|
|
113
|
-
onChange:
|
|
114
|
-
onToggle:
|
|
115
|
-
vanityDomain:
|
|
111
|
+
isDisabled: r,
|
|
112
|
+
onChange: k,
|
|
113
|
+
onToggle: D,
|
|
114
|
+
vanityDomain: v,
|
|
116
115
|
vanityName: a.vanityName
|
|
117
|
-
}), /* @__PURE__ */ s(
|
|
116
|
+
}), /* @__PURE__ */ s(O, {
|
|
118
117
|
canChange: !!c,
|
|
119
|
-
isAvailable: !!
|
|
118
|
+
isAvailable: !!C,
|
|
120
119
|
isChecked: a.isDownloadEnabled,
|
|
121
|
-
isDisabled:
|
|
122
|
-
onToggle:
|
|
120
|
+
isDisabled: r,
|
|
121
|
+
onToggle: A
|
|
123
122
|
})]
|
|
124
123
|
});
|
|
125
124
|
}
|
|
126
125
|
export {
|
|
127
|
-
|
|
126
|
+
se as SharedLinkSettings
|
|
128
127
|
};
|