@box/unified-share-modal 2.8.3 → 2.8.5
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/classification-status/classification-status.js +59 -55
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +46 -44
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +91 -90
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +35 -35
- package/dist/esm/lib/contexts/unified-share-form-context.js +45 -40
- package/dist/styles/classification-status.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/types/lib/contexts/unified-share-form-context.d.ts +1 -0
- package/package.json +9 -9
|
@@ -1,76 +1,80 @@
|
|
|
1
|
-
import { useIntl as
|
|
2
|
-
import { CardTooltipV2 as
|
|
1
|
+
import { useIntl as u } from "react-intl";
|
|
2
|
+
import { CardTooltipV2 as _, Status as l, Text as e } from "@box/blueprint-web";
|
|
3
3
|
import { Shield as d } from "@box/blueprint-web-assets/icons/Line";
|
|
4
4
|
import h from "./messages.js";
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useUnifiedShareModalContext as
|
|
7
|
-
import '../../../../styles/classification-status.css';const
|
|
8
|
-
container:
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { useUnifiedShareModalContext as v } from "../../contexts/unified-share-modal-context.js";
|
|
7
|
+
import '../../../../styles/classification-status.css';const x = "_container_1dpzl_1", b = "_tooltip_1dpzl_5", y = "_header_1dpzl_11", z = "_content_1dpzl_17", n = {
|
|
8
|
+
container: x,
|
|
9
|
+
tooltip: b,
|
|
10
|
+
header: y,
|
|
11
|
+
content: z
|
|
11
12
|
};
|
|
12
|
-
function
|
|
13
|
+
function T() {
|
|
13
14
|
const {
|
|
14
15
|
formatMessage: i
|
|
15
|
-
} = p(), {
|
|
16
|
-
item: m
|
|
17
16
|
} = u(), {
|
|
17
|
+
item: m
|
|
18
|
+
} = v(), {
|
|
18
19
|
classification: r
|
|
19
20
|
} = m;
|
|
20
21
|
if (!r)
|
|
21
22
|
return null;
|
|
22
23
|
const {
|
|
23
|
-
colorId:
|
|
24
|
+
colorId: p,
|
|
24
25
|
definition: f,
|
|
25
|
-
name:
|
|
26
|
-
restrictions:
|
|
27
|
-
} = r;
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className:
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})]
|
|
43
|
-
}), /* @__PURE__ */ n("div", {
|
|
44
|
-
className: o.content,
|
|
45
|
-
children: [/* @__PURE__ */ n("div", {
|
|
46
|
-
children: [/* @__PURE__ */ e(t, {
|
|
47
|
-
as: "h4",
|
|
26
|
+
name: s,
|
|
27
|
+
restrictions: a
|
|
28
|
+
} = r, c = p + 1;
|
|
29
|
+
return /* @__PURE__ */ t("div", {
|
|
30
|
+
className: n.container,
|
|
31
|
+
children: /* @__PURE__ */ t(_, {
|
|
32
|
+
content: /* @__PURE__ */ o("div", {
|
|
33
|
+
className: n.tooltip,
|
|
34
|
+
children: [/* @__PURE__ */ o("div", {
|
|
35
|
+
className: n.header,
|
|
36
|
+
children: [/* @__PURE__ */ t(l, {
|
|
37
|
+
colorIndex: c,
|
|
38
|
+
hideText: !0,
|
|
39
|
+
icon: d,
|
|
40
|
+
text: ""
|
|
41
|
+
}), /* @__PURE__ */ t(e, {
|
|
42
|
+
as: "h3",
|
|
48
43
|
variant: "bodyDefaultBold",
|
|
49
|
-
children: i(h.definitionLabel)
|
|
50
|
-
}), /* @__PURE__ */ e(t, {
|
|
51
|
-
as: "p",
|
|
52
|
-
children: f
|
|
53
|
-
})]
|
|
54
|
-
}), s && /* @__PURE__ */ n("div", {
|
|
55
|
-
children: [/* @__PURE__ */ e(t, {
|
|
56
|
-
as: "h4",
|
|
57
|
-
variant: "bodyDefaultBold",
|
|
58
|
-
children: i(h.restrictionsLabel)
|
|
59
|
-
}), /* @__PURE__ */ e(t, {
|
|
60
|
-
as: "p",
|
|
61
44
|
children: s
|
|
62
45
|
})]
|
|
46
|
+
}), /* @__PURE__ */ o("div", {
|
|
47
|
+
className: n.content,
|
|
48
|
+
children: [/* @__PURE__ */ o("div", {
|
|
49
|
+
children: [/* @__PURE__ */ t(e, {
|
|
50
|
+
as: "h4",
|
|
51
|
+
variant: "bodyDefaultBold",
|
|
52
|
+
children: i(h.definitionLabel)
|
|
53
|
+
}), /* @__PURE__ */ t(e, {
|
|
54
|
+
as: "p",
|
|
55
|
+
children: f
|
|
56
|
+
})]
|
|
57
|
+
}), a && /* @__PURE__ */ o("div", {
|
|
58
|
+
children: [/* @__PURE__ */ t(e, {
|
|
59
|
+
as: "h4",
|
|
60
|
+
variant: "bodyDefaultBold",
|
|
61
|
+
children: i(h.restrictionsLabel)
|
|
62
|
+
}), /* @__PURE__ */ t(e, {
|
|
63
|
+
as: "p",
|
|
64
|
+
children: a
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
63
67
|
})]
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
}),
|
|
69
|
+
children: /* @__PURE__ */ t(l, {
|
|
70
|
+
colorIndex: c,
|
|
71
|
+
icon: d,
|
|
72
|
+
iconPosition: "left",
|
|
73
|
+
text: s.toUpperCase()
|
|
74
|
+
})
|
|
71
75
|
})
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
78
|
export {
|
|
75
|
-
|
|
79
|
+
T as ClassificationStatus
|
|
76
80
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import l from "clsx";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { Modal as
|
|
5
|
-
import { SharedLinkSettings as
|
|
6
|
-
import
|
|
7
|
-
import { jsx as
|
|
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
|
-
|
|
2
|
+
import { useState as j, useEffect as k } from "react";
|
|
3
|
+
import { useIntl as C } from "react-intl";
|
|
4
|
+
import { Modal as t, LoadingIndicator as F, Divider as B } from "@box/blueprint-web";
|
|
5
|
+
import { SharedLinkSettings as N } from "./shared-link-settings.js";
|
|
6
|
+
import n from "./messages.js";
|
|
7
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { ClassificationStatus as x } from "../classification-status/classification-status.js";
|
|
9
|
+
import { useUnifiedShareModalContext as D } from "../../contexts/unified-share-modal-context.js";
|
|
10
|
+
import { useSharedLinkSettingsContext as M } from "../../contexts/shared-link-settings-context.js";
|
|
11
|
+
import '../../../../styles/shared-link-settings-modal.css';const w = "_content_1jgi4_1", I = "_isFullscreen_1jgi4_4", P = "_body_1jgi4_13", z = "_title_1jgi4_17", A = "_form_1jgi4_37", E = "_isLoading_1jgi4_44", H = "_loading_1jgi4_48", U = "_divider_1jgi4_56", e = {
|
|
12
|
+
content: w,
|
|
13
|
+
isFullscreen: I,
|
|
14
|
+
body: P,
|
|
15
|
+
title: z,
|
|
16
16
|
form: A,
|
|
17
17
|
isLoading: E,
|
|
18
18
|
loading: H,
|
|
@@ -23,19 +23,19 @@ function Y({
|
|
|
23
23
|
onOpenChange: g
|
|
24
24
|
}) {
|
|
25
25
|
const {
|
|
26
|
-
formatMessage:
|
|
27
|
-
} =
|
|
26
|
+
formatMessage: o
|
|
27
|
+
} = C(), {
|
|
28
28
|
eventService: h,
|
|
29
29
|
isSubmitting: r,
|
|
30
30
|
variant: S
|
|
31
|
-
} =
|
|
31
|
+
} = D(), {
|
|
32
32
|
onSharedLinkSettingsClose: f,
|
|
33
33
|
onSharedLinkSettingsLoad: d
|
|
34
34
|
} = h, c = S === "desktop", {
|
|
35
35
|
resetForm: u,
|
|
36
36
|
submitForm: L
|
|
37
|
-
} =
|
|
38
|
-
|
|
37
|
+
} = M(), [m, b] = j(!!d);
|
|
38
|
+
k(() => {
|
|
39
39
|
(async () => d && (a && await d(), b(!a)))();
|
|
40
40
|
}, [a, d]);
|
|
41
41
|
const _ = () => {
|
|
@@ -45,45 +45,47 @@ function Y({
|
|
|
45
45
|
}, v = (y) => {
|
|
46
46
|
y.preventDefault();
|
|
47
47
|
};
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ i(t, {
|
|
49
49
|
onOpenChange: _,
|
|
50
50
|
open: a,
|
|
51
|
-
children: /* @__PURE__ */ s(
|
|
52
|
-
className: l(
|
|
51
|
+
children: /* @__PURE__ */ s(t.Content, {
|
|
52
|
+
className: l(e.content, c && e.isFullscreen),
|
|
53
53
|
onPointerDownOutside: v,
|
|
54
54
|
size: "medium",
|
|
55
|
-
children: [/* @__PURE__ */ s(
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
children: [/* @__PURE__ */ s(t.Header, {
|
|
56
|
+
children: [/* @__PURE__ */ i("div", {
|
|
57
|
+
className: e.title,
|
|
58
|
+
children: o(n.title)
|
|
59
|
+
}), /* @__PURE__ */ i(x, {})]
|
|
58
60
|
}), /* @__PURE__ */ s("div", {
|
|
59
|
-
className: l(
|
|
60
|
-
children: [m && /* @__PURE__ */
|
|
61
|
-
className:
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
-
"aria-label": n
|
|
61
|
+
className: l(e.form),
|
|
62
|
+
children: [m && /* @__PURE__ */ i("div", {
|
|
63
|
+
className: e.loading,
|
|
64
|
+
children: /* @__PURE__ */ i(F, {
|
|
65
|
+
"aria-label": o(n.loadingLabel),
|
|
64
66
|
size: "large"
|
|
65
67
|
})
|
|
66
|
-
}), /* @__PURE__ */ s(
|
|
67
|
-
className: l(
|
|
68
|
-
children: [c && /* @__PURE__ */
|
|
69
|
-
className:
|
|
70
|
-
}), /* @__PURE__ */
|
|
71
|
-
}), /* @__PURE__ */ s(
|
|
72
|
-
className: l(m &&
|
|
73
|
-
children: [/* @__PURE__ */
|
|
68
|
+
}), /* @__PURE__ */ s(t.Body, {
|
|
69
|
+
className: l(e.body, m && e.isLoading),
|
|
70
|
+
children: [c && /* @__PURE__ */ i(B, {
|
|
71
|
+
className: e.divider
|
|
72
|
+
}), /* @__PURE__ */ i(N, {})]
|
|
73
|
+
}), /* @__PURE__ */ s(t.Footer, {
|
|
74
|
+
className: l(m && e.isLoading),
|
|
75
|
+
children: [/* @__PURE__ */ i(t.Footer.SecondaryButton, {
|
|
74
76
|
disabled: r,
|
|
75
77
|
onClick: _,
|
|
76
|
-
children: n
|
|
77
|
-
}), /* @__PURE__ */
|
|
78
|
+
children: o(n.cancelButton)
|
|
79
|
+
}), /* @__PURE__ */ i(t.Footer.PrimaryButton, {
|
|
78
80
|
id: "usm-SharedLinkSettingsModal-primaryButton",
|
|
79
81
|
loading: r,
|
|
80
|
-
loadingAriaLabel: n
|
|
82
|
+
loadingAriaLabel: o(n.loadingLabel),
|
|
81
83
|
onClick: p,
|
|
82
|
-
children: n
|
|
84
|
+
children: o(n.saveButton)
|
|
83
85
|
})]
|
|
84
86
|
})]
|
|
85
|
-
}), !c && /* @__PURE__ */
|
|
86
|
-
"aria-label": n
|
|
87
|
+
}), !c && /* @__PURE__ */ i(t.Close, {
|
|
88
|
+
"aria-label": o(n.closeButton),
|
|
87
89
|
disabled: r
|
|
88
90
|
})]
|
|
89
91
|
})
|
package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js
CHANGED
|
@@ -1,130 +1,131 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { useNotification as
|
|
4
|
-
import { ClockBadge as
|
|
5
|
-
import { Mail as
|
|
6
|
-
import { SurfaceStatusSurfaceRed as
|
|
7
|
-
import { CopyInput as
|
|
8
|
-
import { SharedLinkAccess as
|
|
9
|
-
import { SharedLinkPermission as
|
|
1
|
+
import { useRef as G, useCallback as I, useEffect as V } from "react";
|
|
2
|
+
import { useIntl as q } from "react-intl";
|
|
3
|
+
import { useNotification as H, Text as y, Tooltip as C, Focusable as J, Switch as Q, Status as W, Link as X, Button as Y } from "@box/blueprint-web";
|
|
4
|
+
import { ClockBadge as Z } from "@box/blueprint-web-assets/icons/Line";
|
|
5
|
+
import { Mail as $, Globe as P } from "@box/blueprint-web-assets/icons/Medium";
|
|
6
|
+
import { SurfaceStatusSurfaceRed as ee, bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
|
|
7
|
+
import { CopyInput as te } from "@box/copy-input";
|
|
8
|
+
import { SharedLinkAccess as ie } from "./shared-link-access.js";
|
|
9
|
+
import { SharedLinkPermission as ae } from "./shared-link-permission.js";
|
|
10
10
|
import t from "./messages.js";
|
|
11
11
|
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
12
|
-
import { useUnifiedShareFormContext as
|
|
13
|
-
import { useUnifiedShareModalContext as
|
|
14
|
-
import { useSharingAction as
|
|
15
|
-
import { getNotificationArgs as
|
|
16
|
-
import { formatDateFromTimestampToDateString as
|
|
17
|
-
import { callOnKeyboardEvent as
|
|
18
|
-
import '../../../../../styles/shared-link-section.css';const
|
|
19
|
-
container:
|
|
20
|
-
toggle:
|
|
21
|
-
settings:
|
|
22
|
-
copy:
|
|
23
|
-
access:
|
|
24
|
-
icon:
|
|
12
|
+
import { useUnifiedShareFormContext as ne } from "../../../contexts/unified-share-form-context.js";
|
|
13
|
+
import { useUnifiedShareModalContext as oe } from "../../../contexts/unified-share-modal-context.js";
|
|
14
|
+
import { useSharingAction as re } from "../../../hooks/use-sharing-action.js";
|
|
15
|
+
import { getNotificationArgs as se } from "../../../utils/notification.js";
|
|
16
|
+
import { formatDateFromTimestampToDateString as ce } from "../../../utils/date.js";
|
|
17
|
+
import { callOnKeyboardEvent as le } from "../../../utils/event.js";
|
|
18
|
+
import '../../../../../styles/shared-link-section.css';const de = "_container_j966c_1", he = "_toggle_j966c_7", ue = "_settings_j966c_13", me = "_copy_j966c_22", pe = "_access_j966c_30", ge = "_icon_j966c_36", c = {
|
|
19
|
+
container: de,
|
|
20
|
+
toggle: he,
|
|
21
|
+
settings: ue,
|
|
22
|
+
copy: me,
|
|
23
|
+
access: pe,
|
|
24
|
+
icon: ge
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function Ie() {
|
|
27
27
|
const {
|
|
28
28
|
formatMessage: e
|
|
29
|
-
} =
|
|
30
|
-
addNotification:
|
|
31
|
-
} =
|
|
32
|
-
|
|
29
|
+
} = q(), {
|
|
30
|
+
addNotification: v
|
|
31
|
+
} = H(), k = G(null), {
|
|
32
|
+
isInteracted: f,
|
|
33
|
+
isSharedLinkAutoCopied: L,
|
|
33
34
|
isSharedLinkAutoCreated: r,
|
|
34
|
-
setForm:
|
|
35
|
-
} =
|
|
35
|
+
setForm: B
|
|
36
|
+
} = ne(), {
|
|
36
37
|
config: s,
|
|
37
|
-
eventService:
|
|
38
|
-
isFetching:
|
|
38
|
+
eventService: F,
|
|
39
|
+
isFetching: x,
|
|
39
40
|
isSubmitting: n,
|
|
40
|
-
item:
|
|
41
|
-
setView:
|
|
41
|
+
item: M,
|
|
42
|
+
setView: T,
|
|
42
43
|
sharedLink: o,
|
|
43
|
-
sharingService:
|
|
44
|
-
} =
|
|
45
|
-
permissions:
|
|
46
|
-
} = F, {
|
|
47
|
-
onSharedLinkCopy: L,
|
|
48
|
-
onSharedLinkSettingsClick: _
|
|
49
|
-
} = B, {
|
|
50
|
-
createSharedLink: A
|
|
44
|
+
sharingService: O
|
|
45
|
+
} = oe(), {
|
|
46
|
+
permissions: _ = {}
|
|
51
47
|
} = M, {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
onSharedLinkCopy: S,
|
|
49
|
+
onSharedLinkSettingsClick: A
|
|
50
|
+
} = F, {
|
|
51
|
+
createSharedLink: N
|
|
52
|
+
} = O, {
|
|
53
|
+
notifications: E,
|
|
54
|
+
sharedLinkAutoCopy: R,
|
|
55
|
+
sharedLinkAutoCreate: D
|
|
56
|
+
} = s, a = !!o.url, h = R && !L.current && !f, j = D && !r.current && !f, U = I(async () => {
|
|
57
|
+
const l = await N();
|
|
57
58
|
return h ? {
|
|
58
59
|
messages: []
|
|
59
60
|
} : l;
|
|
60
|
-
}, [h,
|
|
61
|
-
onAction:
|
|
62
|
-
} =
|
|
63
|
-
|
|
64
|
-
(async () =>
|
|
65
|
-
}, [a, h,
|
|
66
|
-
const
|
|
61
|
+
}, [h, N]), {
|
|
62
|
+
onAction: b
|
|
63
|
+
} = re(U, "create-shared-link");
|
|
64
|
+
V(() => {
|
|
65
|
+
(async () => x || n || ((h || j) && !a && (await b(), r.current = !0), h && a && k.current && (k.current.click(), L.current = !0)))();
|
|
66
|
+
}, [a, h, j, x, L, r, n, b]);
|
|
67
|
+
const z = I((l) => {
|
|
67
68
|
let p;
|
|
68
|
-
typeof l != "string" ? p = r.current ? e(t.autoCreateCopyErrorNoticeText) : null : p = r.current ? e(t.autoCreateCopySuccessNoticeText) : e(t.autoCopySuccessNoticeText), p &&
|
|
69
|
-
...
|
|
69
|
+
typeof l != "string" ? p = r.current ? e(t.autoCreateCopyErrorNoticeText) : null : p = r.current ? e(t.autoCreateCopySuccessNoticeText) : e(t.autoCopySuccessNoticeText), p && E.includes("auto-copy-shared-link") && v({
|
|
70
|
+
...se(e, "success"),
|
|
70
71
|
styledText: p
|
|
71
|
-
}),
|
|
72
|
-
}, [
|
|
72
|
+
}), S && S(l);
|
|
73
|
+
}, [v, e, r, E, S]), K = async (l) => {
|
|
73
74
|
if (l) {
|
|
74
|
-
await
|
|
75
|
+
await b();
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
if (
|
|
80
|
-
|
|
78
|
+
T("remove-shared-link");
|
|
79
|
+
}, w = () => {
|
|
80
|
+
if (A) {
|
|
81
|
+
A();
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
T("shared-link-settings");
|
|
84
85
|
};
|
|
85
86
|
let u, m = !1;
|
|
86
|
-
return !a && !n && (u = e(t.sharedLinkToggleTooltip)), !a && !
|
|
87
|
+
return !a && !n && (u = e(t.sharedLinkToggleTooltip)), !a && !_.canShare && (u = e(t.createLinkDisabledTooltip), m = !0), a && !_.canSetShareAccess && (u = e(t.removeLinkDisabledTooltip), m = !0), /* @__PURE__ */ d("div", {
|
|
87
88
|
className: c.container,
|
|
88
|
-
children: [/* @__PURE__ */ i(
|
|
89
|
+
children: [/* @__PURE__ */ i(y, {
|
|
89
90
|
as: "label",
|
|
90
91
|
variant: "bodyDefaultBold",
|
|
91
92
|
children: e(t.shareLinkLabel)
|
|
92
93
|
}), /* @__PURE__ */ d("div", {
|
|
93
94
|
className: c.toggle,
|
|
94
|
-
children: [/* @__PURE__ */ i(
|
|
95
|
+
children: [/* @__PURE__ */ i(C, {
|
|
95
96
|
align: "start",
|
|
96
97
|
content: u,
|
|
97
98
|
"data-testid": "shared-link-tooltip",
|
|
98
99
|
open: u ? void 0 : !1,
|
|
99
|
-
children: /* @__PURE__ */ i(
|
|
100
|
+
children: /* @__PURE__ */ i(J, {
|
|
100
101
|
focusable: m,
|
|
101
|
-
children: /* @__PURE__ */ i(
|
|
102
|
+
children: /* @__PURE__ */ i(Q.Item, {
|
|
102
103
|
checked: a,
|
|
103
104
|
"data-target-id": "Toggle-CreateSharedLink",
|
|
104
105
|
disabled: m || n,
|
|
105
106
|
label: e(t.sharedLinkToggleLabel),
|
|
106
|
-
onCheckedChange:
|
|
107
|
+
onCheckedChange: K,
|
|
107
108
|
value: "shared-link"
|
|
108
109
|
})
|
|
109
110
|
})
|
|
110
|
-
}), a && !!o.expiresAt && /* @__PURE__ */ i(
|
|
111
|
+
}), a && !!o.expiresAt && /* @__PURE__ */ i(C, {
|
|
111
112
|
content: e(t.expirationIconTooltip, {
|
|
112
|
-
expirationDate:
|
|
113
|
+
expirationDate: ce(o.expiresAt)
|
|
113
114
|
}),
|
|
114
115
|
"data-testid": "expiration-date-tooltip",
|
|
115
|
-
children: /* @__PURE__ */ i(
|
|
116
|
-
color:
|
|
116
|
+
children: /* @__PURE__ */ i(W, {
|
|
117
|
+
color: ee,
|
|
117
118
|
hideText: !0,
|
|
118
|
-
icon:
|
|
119
|
+
icon: Z,
|
|
119
120
|
text: e(t.expirationIconLabel)
|
|
120
121
|
})
|
|
121
|
-
}), a && s.sharedLinkSettings && /* @__PURE__ */ i(
|
|
122
|
+
}), a && s.sharedLinkSettings && /* @__PURE__ */ i(X, {
|
|
122
123
|
"aria-disabled": n,
|
|
123
124
|
"aria-haspopup": "dialog",
|
|
124
125
|
className: c.settings,
|
|
125
126
|
"data-target-id": "PlainButton-SharedLinkSettings",
|
|
126
|
-
onClick:
|
|
127
|
-
onKeyDown:
|
|
127
|
+
onClick: w,
|
|
128
|
+
onKeyDown: le(w, {
|
|
128
129
|
canPreventDefault: !0
|
|
129
130
|
}),
|
|
130
131
|
role: "button",
|
|
@@ -134,47 +135,47 @@ function we() {
|
|
|
134
135
|
})]
|
|
135
136
|
}), a && /* @__PURE__ */ d("div", {
|
|
136
137
|
className: c.copy,
|
|
137
|
-
children: [/* @__PURE__ */ i(
|
|
138
|
+
children: [/* @__PURE__ */ i(te, {
|
|
138
139
|
ref: k,
|
|
139
|
-
autoFocus:
|
|
140
|
+
autoFocus: D && r.current && !f,
|
|
140
141
|
"data-target-id": "Button-CopySharedLink",
|
|
141
142
|
disabled: n,
|
|
142
143
|
hideLabel: !0,
|
|
143
144
|
label: e(t.sharedLinkUrlLabel),
|
|
144
|
-
onCopy:
|
|
145
|
+
onCopy: z,
|
|
145
146
|
value: o.url
|
|
146
|
-
}), s.sharedLinkEmail && /* @__PURE__ */ i(
|
|
147
|
+
}), s.sharedLinkEmail && /* @__PURE__ */ i(C, {
|
|
147
148
|
align: "end",
|
|
148
149
|
content: e(t.sharedLinkEmailLabel),
|
|
149
|
-
children: /* @__PURE__ */ i(
|
|
150
|
+
children: /* @__PURE__ */ i(Y, {
|
|
150
151
|
"aria-label": e(t.sharedLinkEmailLabel),
|
|
151
152
|
"data-target-id": "Button-SendSharedLink",
|
|
152
153
|
disabled: n,
|
|
153
|
-
icon:
|
|
154
|
-
onClick: () =>
|
|
154
|
+
icon: $,
|
|
155
|
+
onClick: () => B("email"),
|
|
155
156
|
size: "large",
|
|
156
157
|
variant: "secondary"
|
|
157
158
|
})
|
|
158
159
|
})]
|
|
159
160
|
}), a && (s.sharedLinkAccess || s.sharedLinkPermission) && /* @__PURE__ */ d("div", {
|
|
160
161
|
className: c.access,
|
|
161
|
-
children: [s.sharedLinkAccess && /* @__PURE__ */ i(
|
|
162
|
+
children: [s.sharedLinkAccess && /* @__PURE__ */ i(ie, {}), s.sharedLinkPermission && /* @__PURE__ */ i(ae, {})]
|
|
162
163
|
}), a && o.access === "open" && /* @__PURE__ */ d("div", {
|
|
163
|
-
children: [/* @__PURE__ */ i(
|
|
164
|
+
children: [/* @__PURE__ */ i(P, {
|
|
164
165
|
className: c.icon,
|
|
165
166
|
height: g,
|
|
166
167
|
width: g
|
|
167
|
-
}), /* @__PURE__ */ i(
|
|
168
|
+
}), /* @__PURE__ */ i(y, {
|
|
168
169
|
as: "span",
|
|
169
170
|
color: "textOnLightSecondary",
|
|
170
171
|
children: o.permission === "can_edit" ? e(t.sharedLinkEditablePubliclyAvailable) : e(t.sharedLinkPubliclyAvailable)
|
|
171
172
|
})]
|
|
172
173
|
}), a && o.access === "company" && o.permission === "can_edit" && /* @__PURE__ */ d("div", {
|
|
173
|
-
children: [/* @__PURE__ */ i(
|
|
174
|
+
children: [/* @__PURE__ */ i(P, {
|
|
174
175
|
className: c.icon,
|
|
175
176
|
height: g,
|
|
176
177
|
width: g
|
|
177
|
-
}), /* @__PURE__ */ i(
|
|
178
|
+
}), /* @__PURE__ */ i(y, {
|
|
178
179
|
as: "span",
|
|
179
180
|
color: "textOnLightSecondary",
|
|
180
181
|
children: e(t.sharedLinkElevatedEditableCompanyAvailable)
|
|
@@ -183,5 +184,5 @@ function we() {
|
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
186
|
export {
|
|
186
|
-
|
|
187
|
+
Ie as SharedLinkSection
|
|
187
188
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import a from "clsx";
|
|
2
2
|
import { useCallback as N } from "react";
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { Modal as
|
|
5
|
-
import { UnifiedShareForm as
|
|
3
|
+
import { useIntl as S } from "react-intl";
|
|
4
|
+
import { Modal as t, LoadingIndicator as v } from "@box/blueprint-web";
|
|
5
|
+
import { UnifiedShareForm as D } from "./unified-share-form.js";
|
|
6
6
|
import l from "./messages.js";
|
|
7
7
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
8
|
-
import { CollaboratorList as
|
|
8
|
+
import { CollaboratorList as M } from "./collaborator-list/collaborator-list.js";
|
|
9
9
|
import { useUnifiedShareFormContext as h } from "../../contexts/unified-share-form-context.js";
|
|
10
|
-
import { useUnifiedShareModalContext as
|
|
11
|
-
import { ClassificationStatus as
|
|
12
|
-
import '../../../../styles/unified-share-form-modal.css';const j = "
|
|
10
|
+
import { useUnifiedShareModalContext as O } from "../../contexts/unified-share-modal-context.js";
|
|
11
|
+
import { ClassificationStatus as U } from "../classification-status/classification-status.js";
|
|
12
|
+
import '../../../../styles/unified-share-form-modal.css';const j = "_content_1k0mu_1", w = "_isFullscreen_1k0mu_4", z = "_body_1k0mu_13", B = "_title_1k0mu_17", I = "_hasFooter_1k0mu_39", P = "_loading_1k0mu_43", H = "_form_1k0mu_51", R = "_isLoading_1k0mu_56", e = {
|
|
13
13
|
content: j,
|
|
14
14
|
isFullscreen: w,
|
|
15
15
|
body: z,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
title: B,
|
|
17
|
+
hasFooter: I,
|
|
18
18
|
loading: P,
|
|
19
19
|
form: H,
|
|
20
20
|
isLoading: R
|
|
@@ -26,54 +26,54 @@ function Y({
|
|
|
26
26
|
}) {
|
|
27
27
|
const {
|
|
28
28
|
formatMessage: n
|
|
29
|
-
} =
|
|
29
|
+
} = S(), {
|
|
30
30
|
isCollaboratorsOpen: d,
|
|
31
|
-
setContainerRef:
|
|
31
|
+
setContainerRef: F,
|
|
32
32
|
setForm: f
|
|
33
33
|
} = h(), {
|
|
34
34
|
isFetching: u,
|
|
35
35
|
isSubmitting: s,
|
|
36
|
-
item:
|
|
37
|
-
variant:
|
|
38
|
-
} =
|
|
39
|
-
form:
|
|
36
|
+
item: b,
|
|
37
|
+
variant: k
|
|
38
|
+
} = O(), {
|
|
39
|
+
form: C
|
|
40
40
|
} = h(), {
|
|
41
41
|
name: L
|
|
42
|
-
} =
|
|
42
|
+
} = b, _ = k === "desktop", g = C === "default" && !d, x = N((r) => {
|
|
43
43
|
s || (f("default"), c(r));
|
|
44
44
|
}, [s, c, f]), y = (r) => {
|
|
45
45
|
r.preventDefault();
|
|
46
46
|
};
|
|
47
|
-
return /* @__PURE__ */ i(
|
|
47
|
+
return /* @__PURE__ */ i(t, {
|
|
48
48
|
onOpenChange: x,
|
|
49
49
|
open: p,
|
|
50
|
-
children: [!!m && /* @__PURE__ */ o(
|
|
50
|
+
children: [!!m && /* @__PURE__ */ o(t.Trigger, {
|
|
51
51
|
children: m
|
|
52
|
-
}), /* @__PURE__ */ i(
|
|
53
|
-
ref:
|
|
54
|
-
className: a(
|
|
52
|
+
}), /* @__PURE__ */ i(t.Content, {
|
|
53
|
+
ref: F,
|
|
54
|
+
className: a(e.content, _ && e.isFullscreen),
|
|
55
55
|
onPointerDownOutside: y,
|
|
56
56
|
size: "medium",
|
|
57
|
-
children: [/* @__PURE__ */ i(
|
|
58
|
-
children: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})]
|
|
64
|
-
}), /* @__PURE__ */ i(
|
|
65
|
-
className: a(
|
|
57
|
+
children: [/* @__PURE__ */ i(t.Header, {
|
|
58
|
+
children: [/* @__PURE__ */ o("div", {
|
|
59
|
+
className: e.title,
|
|
60
|
+
children: n(l.title, {
|
|
61
|
+
itemName: L
|
|
62
|
+
})
|
|
63
|
+
}), /* @__PURE__ */ o(U, {})]
|
|
64
|
+
}), /* @__PURE__ */ i(t.Body, {
|
|
65
|
+
className: a(e.body, !g && e.hasFooter),
|
|
66
66
|
children: [u && /* @__PURE__ */ o("div", {
|
|
67
|
-
className:
|
|
68
|
-
children: /* @__PURE__ */ o(
|
|
67
|
+
className: e.loading,
|
|
68
|
+
children: /* @__PURE__ */ o(v, {
|
|
69
69
|
"aria-label": n(l.loadingLabel),
|
|
70
70
|
size: "large"
|
|
71
71
|
})
|
|
72
72
|
}), /* @__PURE__ */ o("div", {
|
|
73
|
-
className: a(
|
|
74
|
-
children: d ? /* @__PURE__ */ o(
|
|
73
|
+
className: a(e.form, u && e.isLoading),
|
|
74
|
+
children: d ? /* @__PURE__ */ o(M, {}) : /* @__PURE__ */ o(D, {})
|
|
75
75
|
})]
|
|
76
|
-
}), !_ &&
|
|
76
|
+
}), !_ && g && /* @__PURE__ */ o(t.Close, {
|
|
77
77
|
"aria-label": n(l.closeButton),
|
|
78
78
|
disabled: s
|
|
79
79
|
})]
|
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
import { useUnifiedShareModalContext as
|
|
3
|
-
import { jsx as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { createContext as A, useContext as D, useState as e, useRef as g, useCallback as E, useEffect as k, useMemo as L } from "react";
|
|
2
|
+
import { useUnifiedShareModalContext as j } from "./unified-share-modal-context.js";
|
|
3
|
+
import { jsx as q } from "react/jsx-runtime";
|
|
4
|
+
const M = /* @__PURE__ */ A(null), G = () => {
|
|
5
|
+
const t = D(M);
|
|
6
6
|
if (!t)
|
|
7
7
|
throw new Error("useUnifiedShareFormContext must be used with UnifiedShareFormProvider");
|
|
8
8
|
return t;
|
|
9
|
-
},
|
|
9
|
+
}, H = ({
|
|
10
10
|
children: t
|
|
11
11
|
}) => {
|
|
12
12
|
const {
|
|
13
|
-
initialContacts:
|
|
14
|
-
isOpen:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
...
|
|
13
|
+
initialContacts: n,
|
|
14
|
+
isOpen: a,
|
|
15
|
+
view: l
|
|
16
|
+
} = j(), [o, c] = e("default"), [f, u] = e(!1), [s, d] = e(!1), [m, O] = e(null), [C, h] = e(n), [S, x] = e(""), [R, p] = e(""), [F, U] = e(), [b, v] = e({}), V = g(!1), w = g(!1), I = E((r) => {
|
|
17
|
+
v((i) => ({
|
|
18
|
+
...i,
|
|
19
|
+
...r
|
|
19
20
|
}));
|
|
20
21
|
}, []);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
22
|
+
k(() => {
|
|
23
|
+
a || (c("default"), u(!1), d(!1), h(n), x(""), p(""), U(void 0), v({}), V.current = !1, w.current = !1);
|
|
24
|
+
}, [n, a]), k(() => {
|
|
25
|
+
const r = l === "unified-share-form", i = o === "default";
|
|
26
|
+
s || (!r || !i) && d(!0);
|
|
27
|
+
}, [s, l, o]);
|
|
28
|
+
const P = L(() => ({
|
|
29
|
+
collaborationRole: F,
|
|
30
|
+
contactValue: S,
|
|
31
|
+
containerRef: m,
|
|
32
|
+
form: o,
|
|
33
|
+
isCollaboratorsOpen: f,
|
|
34
|
+
isInteracted: s,
|
|
35
|
+
isSharedLinkAutoCopied: V,
|
|
36
|
+
isSharedLinkAutoCreated: w,
|
|
37
|
+
messageValue: R,
|
|
38
|
+
setCollaborationRole: U,
|
|
39
|
+
setContactValue: x,
|
|
40
|
+
setContainerRef: O,
|
|
41
|
+
setForm: c,
|
|
42
|
+
setIsCollaboratorsOpen: u,
|
|
43
|
+
setMessageValue: p,
|
|
44
|
+
setShieldRestriction: I,
|
|
45
|
+
setUserContacts: h,
|
|
46
|
+
shieldRestriction: b,
|
|
47
|
+
userContacts: C
|
|
48
|
+
}), [F, S, m, o, I, f, s, R, b, C]);
|
|
49
|
+
return /* @__PURE__ */ q(M.Provider, {
|
|
50
|
+
value: P,
|
|
46
51
|
children: t
|
|
47
52
|
});
|
|
48
53
|
};
|
|
49
54
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
M as UnifiedShareFormContext,
|
|
56
|
+
H as UnifiedShareFormProvider,
|
|
57
|
+
G as useUnifiedShareFormContext
|
|
53
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1dpzl_1{display:inline-flex}._tooltip_1dpzl_5{display:flex;flex-direction:column;gap:var(--bp-space-040)}._header_1dpzl_11{display:flex;align-items:center;gap:var(--bp-space-020)}._content_1dpzl_17{display:flex;flex-direction:column;gap:var(--bp-space-050)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_1jgi4_1._content_1jgi4_1{max-width:480px}._content_1jgi4_1._content_1jgi4_1._isFullscreen_1jgi4_4{width:100vw;max-width:none;height:100vh;max-height:none;margin:0;border-radius:0;animation:none}._content_1jgi4_1._content_1jgi4_1._isFullscreen_1jgi4_4 ._body_1jgi4_13{overflow:hidden auto}._title_1jgi4_17{display:inline}._title_1jgi4_17:after{display:inline-block;width:var(--bp-space-020);content:""}._body_1jgi4_13._body_1jgi4_13{display:flex;flex-direction:column;flex-grow:1;gap:var(--bp-space-040);margin-bottom:calc(var(--bp-space-010) * -1);padding-top:0;padding-bottom:var(--bp-space-010);overflow:auto}._form_1jgi4_37{position:relative;display:flex;flex-direction:column;flex-grow:1;overflow:hidden}._form_1jgi4_37 ._isLoading_1jgi4_44{visibility:hidden}._loading_1jgi4_48{position:absolute;inset:0;display:flex;align-items:center;padding-bottom:var(--bp-space-080)}._divider_1jgi4_56._divider_1jgi4_56{position:sticky;top:0;z-index:1;width:100%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_1k0mu_1._content_1k0mu_1{max-width:480px}._content_1k0mu_1._content_1k0mu_1._isFullscreen_1k0mu_4{width:100vw;max-width:none;height:100vh;max-height:none;margin:0;border-radius:0;animation:none}._content_1k0mu_1._content_1k0mu_1._isFullscreen_1k0mu_4 ._body_1k0mu_13{overflow:hidden auto}._title_1k0mu_17{display:inline}._title_1k0mu_17:after{display:inline-block;width:var(--bp-space-020);content:""}._body_1k0mu_13._body_1k0mu_13{position:relative;display:flex;flex-direction:column;flex-grow:1;padding-top:0;padding-bottom:var(--bp-space-080)}._body_1k0mu_13._body_1k0mu_13:before{display:block;width:100vw;content:""}._body_1k0mu_13._body_1k0mu_13._hasFooter_1k0mu_39{padding-bottom:0}._loading_1k0mu_43{position:absolute;inset:0;display:flex;align-items:center;padding-bottom:var(--bp-space-080)}._form_1k0mu_51{display:flex;flex-direction:column;flex-grow:1}._form_1k0mu_51._isLoading_1k0mu_56{visibility:hidden}@media not (max-width:374px){._content_1k0mu_1._content_1k0mu_1{overflow:auto}}@media not (max-width:459px){:has(>._content_1k0mu_1._content_1k0mu_1:not(._isFullscreen_1k0mu_4)){display:flex;padding:var(--bp-space-080);overflow:auto}._content_1k0mu_1._content_1k0mu_1{max-height:none;margin:auto;overflow:visible}}
|
|
@@ -7,6 +7,7 @@ export interface UnifiedShareFormContextValue {
|
|
|
7
7
|
containerRef: HTMLDivElement | null;
|
|
8
8
|
form: FormType;
|
|
9
9
|
isCollaboratorsOpen: boolean;
|
|
10
|
+
isInteracted: boolean;
|
|
10
11
|
isSharedLinkAutoCopied: React.MutableRefObject<boolean>;
|
|
11
12
|
isSharedLinkAutoCreated: React.MutableRefObject<boolean>;
|
|
12
13
|
messageValue: string;
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/unified-share-modal",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^13.
|
|
7
|
-
"@box/blueprint-web-assets": "^4.
|
|
8
|
-
"@box/copy-input": "^1.39.
|
|
9
|
-
"@box/user-selector": "^1.73.
|
|
6
|
+
"@box/blueprint-web": "^13.8.0",
|
|
7
|
+
"@box/blueprint-web-assets": "^4.108.1",
|
|
8
|
+
"@box/copy-input": "^1.39.29",
|
|
9
|
+
"@box/user-selector": "^1.73.30",
|
|
10
10
|
"lodash": "^4.17.15",
|
|
11
11
|
"react": "^18.0.0",
|
|
12
12
|
"react-dom": "^18.0.0",
|
|
13
13
|
"react-intl": "^6.4.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@box/blueprint-web": "^13.
|
|
17
|
-
"@box/blueprint-web-assets": "^4.
|
|
18
|
-
"@box/copy-input": "^1.39.
|
|
19
|
-
"@box/storybook-utils": "0.16.
|
|
16
|
+
"@box/blueprint-web": "^13.8.0",
|
|
17
|
+
"@box/blueprint-web-assets": "^4.108.1",
|
|
18
|
+
"@box/copy-input": "^1.39.29",
|
|
19
|
+
"@box/storybook-utils": "0.16.79",
|
|
20
20
|
"@box/eslint-plugin-blueprint": "1.1.6",
|
|
21
21
|
"react-intl": "^6.4.2"
|
|
22
22
|
},
|