@box/unified-share-modal 2.12.14 → 2.12.16
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/chunks/classification-status.js +62 -0
- package/dist/chunks/collaboration-role.js +89 -0
- package/dist/chunks/collaboration-section.js +156 -0
- package/dist/chunks/collaborator-list-item.js +61 -0
- package/dist/chunks/collaborator-list.js +74 -0
- package/dist/chunks/remove-collaborator-modal.js +61 -0
- package/dist/chunks/remove-shared-link-modal.js +56 -0
- package/dist/chunks/shared-link-access.js +65 -0
- package/dist/chunks/shared-link-permission.js +67 -0
- package/dist/chunks/shared-link-section.js +176 -0
- package/dist/chunks/shared-link-settings-modal.js +86 -0
- package/dist/chunks/shared-with-avatars.js +48 -0
- package/dist/chunks/shield-restriction-notice.js +97 -0
- package/dist/chunks/text-area-container.js +36 -0
- package/dist/chunks/unified-share-form-modal.js +66 -0
- package/dist/chunks/unified-share-form.js +23 -0
- package/dist/esm/index.js +2 -4
- package/dist/esm/lib/components/classification-status/classification-status.js +2 -80
- package/dist/esm/lib/components/classification-status/index.js +2 -4
- package/dist/esm/lib/components/classification-status/messages.js +10 -12
- package/dist/esm/lib/components/index.js +5 -10
- package/dist/esm/lib/components/remove-collaborator-modal/index.js +2 -4
- package/dist/esm/lib/components/remove-collaborator-modal/messages.js +26 -28
- package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +2 -84
- package/dist/esm/lib/components/remove-shared-link-modal/index.js +2 -4
- package/dist/esm/lib/components/remove-shared-link-modal/messages.js +26 -28
- package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +2 -72
- package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +35 -61
- package/dist/esm/lib/components/shared-link-settings-modal/expiration-section.js +33 -50
- package/dist/esm/lib/components/shared-link-settings-modal/index.js +2 -4
- package/dist/esm/lib/components/shared-link-settings-modal/messages.js +138 -144
- package/dist/esm/lib/components/shared-link-settings-modal/password-section.js +32 -52
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +2 -98
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +97 -126
- package/dist/esm/lib/components/shared-link-settings-modal/vanity-section.js +33 -47
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +2 -128
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +2 -202
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +134 -136
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +2 -67
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +2 -134
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +2 -53
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +48 -60
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +2 -86
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +2 -101
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/messages.js +38 -40
- package/dist/esm/lib/components/unified-share-form-modal/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/messages.js +46 -48
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/index.js +2 -4
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +142 -144
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +2 -102
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +2 -105
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +2 -191
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +2 -85
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +2 -29
- package/dist/esm/lib/constants.js +44 -28
- package/dist/esm/lib/contexts/index.js +4 -14
- package/dist/esm/lib/contexts/shared-link-settings-context.js +50 -59
- package/dist/esm/lib/contexts/unified-share-form-context.js +60 -57
- package/dist/esm/lib/contexts/unified-share-modal-context.js +65 -68
- package/dist/esm/lib/hooks/index.js +7 -14
- package/dist/esm/lib/hooks/use-access-levels.js +69 -93
- package/dist/esm/lib/hooks/use-collaboration-form.js +75 -95
- package/dist/esm/lib/hooks/use-form-validation.js +32 -43
- package/dist/esm/lib/hooks/use-link-settings-form.js +49 -64
- package/dist/esm/lib/hooks/use-permission-levels.js +33 -50
- package/dist/esm/lib/hooks/use-sharing-action.js +44 -59
- package/dist/esm/lib/messages.js +106 -108
- package/dist/esm/lib/unified-share-base.js +30 -40
- package/dist/esm/lib/unified-share-modal.js +41 -59
- package/dist/esm/lib/utils/collaborator.js +12 -27
- package/dist/esm/lib/utils/date.js +10 -14
- package/dist/esm/lib/utils/email.js +5 -7
- package/dist/esm/lib/utils/event.js +6 -13
- package/dist/esm/lib/utils/form.js +4 -14
- package/dist/esm/lib/utils/index.js +9 -34
- package/dist/esm/lib/utils/notification.js +19 -28
- package/dist/esm/lib/utils/permission.js +15 -22
- package/dist/esm/lib/utils/validation.js +2 -11
- package/dist/styles/classification-status.css +1 -1
- package/dist/styles/collaboration-role.css +1 -1
- package/dist/styles/collaboration-section.css +1 -1
- package/dist/styles/collaborator-list-item.css +1 -1
- package/dist/styles/collaborator-list.css +1 -1
- package/dist/styles/remove-collaborator-modal.css +1 -1
- 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/shared-with-avatars.css +1 -1
- package/dist/styles/shield-restriction-notice.css +1 -1
- package/dist/styles/text-area-container.css +1 -1
- package/dist/styles/unified-share-form-modal.css +1 -1
- package/dist/styles/unified-share-form.css +1 -1
- package/package.json +10 -10
package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js
CHANGED
|
@@ -1,191 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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 k } 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
|
-
import t from "./messages.js";
|
|
11
|
-
import { jsxs as h, jsx as i } from "react/jsx-runtime";
|
|
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", l = {
|
|
19
|
-
container: de,
|
|
20
|
-
toggle: he,
|
|
21
|
-
settings: ue,
|
|
22
|
-
copy: me,
|
|
23
|
-
access: pe,
|
|
24
|
-
icon: ge
|
|
25
|
-
};
|
|
26
|
-
function we() {
|
|
27
|
-
const {
|
|
28
|
-
formatMessage: e
|
|
29
|
-
} = q(), {
|
|
30
|
-
addNotification: v
|
|
31
|
-
} = H(), f = G(null), {
|
|
32
|
-
isInteracted: L,
|
|
33
|
-
isSharedLinkAutoCopied: m,
|
|
34
|
-
isSharedLinkAutoCreated: n,
|
|
35
|
-
setForm: B
|
|
36
|
-
} = ne(), {
|
|
37
|
-
config: s,
|
|
38
|
-
eventService: F,
|
|
39
|
-
isFetching: x,
|
|
40
|
-
isSubmitting: o,
|
|
41
|
-
item: M,
|
|
42
|
-
setView: T,
|
|
43
|
-
sharedLink: r,
|
|
44
|
-
sharingService: O
|
|
45
|
-
} = oe(), {
|
|
46
|
-
permissions: _ = {}
|
|
47
|
-
} = M, {
|
|
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 = !!r.url, c = R && !m.current && !L, I = D && !n.current && !L, U = w(async () => {
|
|
57
|
-
const d = await N();
|
|
58
|
-
return c ? {
|
|
59
|
-
messages: []
|
|
60
|
-
} : d;
|
|
61
|
-
}, [c, N]), {
|
|
62
|
-
onAction: b
|
|
63
|
-
} = re(U, "create-shared-link");
|
|
64
|
-
V(() => {
|
|
65
|
-
(async () => x || o || ((c || I) && !a && !n.current && (n.current = !0, await b()), c && a && f.current && f.current.click()))();
|
|
66
|
-
}, [a, c, I, x, m, n, o, b]);
|
|
67
|
-
const z = w((d) => {
|
|
68
|
-
if (S && S(d), !c)
|
|
69
|
-
return;
|
|
70
|
-
m.current = !0;
|
|
71
|
-
let g;
|
|
72
|
-
typeof d != "string" ? g = n.current ? e(t.autoCreateCopyErrorNoticeText) : null : g = n.current ? e(t.autoCreateCopySuccessNoticeText) : e(t.autoCopySuccessNoticeText), g && E.includes("auto-copy-shared-link") && v({
|
|
73
|
-
...se(e, "success"),
|
|
74
|
-
styledText: g
|
|
75
|
-
});
|
|
76
|
-
}, [v, e, c, m, n, E, S]), K = async (d) => {
|
|
77
|
-
if (d) {
|
|
78
|
-
await b();
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
T("remove-shared-link");
|
|
82
|
-
}, j = () => {
|
|
83
|
-
if (A) {
|
|
84
|
-
A();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
T("shared-link-settings");
|
|
88
|
-
};
|
|
89
|
-
let u, p = !1;
|
|
90
|
-
return !a && !o && (u = e(t.sharedLinkToggleTooltip)), !a && !_.canShare && (u = e(t.createLinkDisabledTooltip), p = !0), a && !_.canSetShareAccess && (u = e(t.removeLinkDisabledTooltip), p = !0), /* @__PURE__ */ h("div", {
|
|
91
|
-
className: l.container,
|
|
92
|
-
children: [/* @__PURE__ */ i(y, {
|
|
93
|
-
as: "label",
|
|
94
|
-
variant: "bodyDefaultBold",
|
|
95
|
-
children: e(t.shareLinkLabel)
|
|
96
|
-
}), /* @__PURE__ */ h("div", {
|
|
97
|
-
className: l.toggle,
|
|
98
|
-
children: [/* @__PURE__ */ i(C, {
|
|
99
|
-
align: "start",
|
|
100
|
-
content: u,
|
|
101
|
-
"data-testid": "usm-SharedLinkToggle-tooltip",
|
|
102
|
-
open: u ? void 0 : !1,
|
|
103
|
-
children: /* @__PURE__ */ i(J, {
|
|
104
|
-
focusable: p,
|
|
105
|
-
children: /* @__PURE__ */ i(Q.Item, {
|
|
106
|
-
checked: a,
|
|
107
|
-
"data-target-id": "Toggle-CreateSharedLink",
|
|
108
|
-
disabled: p || o,
|
|
109
|
-
label: e(t.sharedLinkToggleLabel),
|
|
110
|
-
onCheckedChange: K,
|
|
111
|
-
value: "shared-link"
|
|
112
|
-
})
|
|
113
|
-
})
|
|
114
|
-
}), a && !!r.expiresAt && /* @__PURE__ */ i(C, {
|
|
115
|
-
content: e(t.expirationIconTooltip, {
|
|
116
|
-
expirationDate: ce(r.expiresAt)
|
|
117
|
-
}),
|
|
118
|
-
"data-testid": "usm-SharedLinkExpiration-tooltip",
|
|
119
|
-
children: /* @__PURE__ */ i(W, {
|
|
120
|
-
color: ee,
|
|
121
|
-
hideText: !0,
|
|
122
|
-
icon: Z,
|
|
123
|
-
text: e(t.expirationIconLabel)
|
|
124
|
-
})
|
|
125
|
-
}), a && s.sharedLinkSettings && /* @__PURE__ */ i(X, {
|
|
126
|
-
"aria-disabled": o,
|
|
127
|
-
"aria-haspopup": "dialog",
|
|
128
|
-
className: l.settings,
|
|
129
|
-
"data-target-id": "PlainButton-SharedLinkSettings",
|
|
130
|
-
onClick: j,
|
|
131
|
-
onKeyDown: le(j, {
|
|
132
|
-
canPreventDefault: !0
|
|
133
|
-
}),
|
|
134
|
-
role: "button",
|
|
135
|
-
tabIndex: o ? -1 : 0,
|
|
136
|
-
variant: "standalone",
|
|
137
|
-
children: e(t.sharedLinkSettingsLabel)
|
|
138
|
-
})]
|
|
139
|
-
}), a && /* @__PURE__ */ h("div", {
|
|
140
|
-
className: l.copy,
|
|
141
|
-
children: [/* @__PURE__ */ i(te, {
|
|
142
|
-
ref: f,
|
|
143
|
-
autoFocus: D && n.current && !L,
|
|
144
|
-
"data-target-id": "Button-CopySharedLink",
|
|
145
|
-
disabled: o,
|
|
146
|
-
hideLabel: !0,
|
|
147
|
-
label: e(t.sharedLinkUrlLabel),
|
|
148
|
-
onCopy: z,
|
|
149
|
-
value: r.url
|
|
150
|
-
}), s.sharedLinkEmail && /* @__PURE__ */ i(C, {
|
|
151
|
-
align: "end",
|
|
152
|
-
content: e(t.sharedLinkEmailLabel),
|
|
153
|
-
children: /* @__PURE__ */ i(Y, {
|
|
154
|
-
"aria-label": e(t.sharedLinkEmailLabel),
|
|
155
|
-
"data-target-id": "Button-SendSharedLink",
|
|
156
|
-
disabled: o,
|
|
157
|
-
endIcon: $,
|
|
158
|
-
onClick: () => B("email"),
|
|
159
|
-
size: "large",
|
|
160
|
-
variant: "secondary"
|
|
161
|
-
})
|
|
162
|
-
})]
|
|
163
|
-
}), a && (s.sharedLinkAccess || s.sharedLinkPermission) && /* @__PURE__ */ h("div", {
|
|
164
|
-
className: l.access,
|
|
165
|
-
children: [s.sharedLinkAccess && /* @__PURE__ */ i(ie, {}), s.sharedLinkPermission && /* @__PURE__ */ i(ae, {})]
|
|
166
|
-
}), a && r.access === "open" && /* @__PURE__ */ h("div", {
|
|
167
|
-
children: [/* @__PURE__ */ i(P, {
|
|
168
|
-
className: l.icon,
|
|
169
|
-
height: k,
|
|
170
|
-
width: k
|
|
171
|
-
}), /* @__PURE__ */ i(y, {
|
|
172
|
-
as: "span",
|
|
173
|
-
color: "textOnLightSecondary",
|
|
174
|
-
children: r.permission === "can_edit" ? e(t.sharedLinkEditablePubliclyAvailable) : e(t.sharedLinkPubliclyAvailable)
|
|
175
|
-
})]
|
|
176
|
-
}), a && r.access === "company" && r.permission === "can_edit" && /* @__PURE__ */ h("div", {
|
|
177
|
-
children: [/* @__PURE__ */ i(P, {
|
|
178
|
-
className: l.icon,
|
|
179
|
-
height: k,
|
|
180
|
-
width: k
|
|
181
|
-
}), /* @__PURE__ */ i(y, {
|
|
182
|
-
as: "span",
|
|
183
|
-
color: "textOnLightSecondary",
|
|
184
|
-
children: e(t.sharedLinkElevatedEditableCompanyAvailable)
|
|
185
|
-
})]
|
|
186
|
-
})]
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
export {
|
|
190
|
-
we as SharedLinkSection
|
|
191
|
-
};
|
|
1
|
+
import { t as e } from "../../../../../chunks/shared-link-section.js";
|
|
2
|
+
export { e as SharedLinkSection };
|
|
@@ -1,85 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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
|
-
import l from "./messages.js";
|
|
7
|
-
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
8
|
-
import { CollaboratorList as M } from "./collaborator-list/collaborator-list.js";
|
|
9
|
-
import { useUnifiedShareFormContext as h } from "../../contexts/unified-share-form-context.js";
|
|
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
|
-
content: j,
|
|
14
|
-
isFullscreen: w,
|
|
15
|
-
body: z,
|
|
16
|
-
title: B,
|
|
17
|
-
hasFooter: I,
|
|
18
|
-
loading: P,
|
|
19
|
-
form: H,
|
|
20
|
-
isLoading: R
|
|
21
|
-
};
|
|
22
|
-
function Y({
|
|
23
|
-
children: m,
|
|
24
|
-
isOpen: p,
|
|
25
|
-
onOpenChange: c
|
|
26
|
-
}) {
|
|
27
|
-
const {
|
|
28
|
-
formatMessage: n
|
|
29
|
-
} = S(), {
|
|
30
|
-
isCollaboratorsOpen: d,
|
|
31
|
-
setContainerRef: F,
|
|
32
|
-
setForm: f
|
|
33
|
-
} = h(), {
|
|
34
|
-
isFetching: u,
|
|
35
|
-
isSubmitting: s,
|
|
36
|
-
item: b,
|
|
37
|
-
variant: k
|
|
38
|
-
} = O(), {
|
|
39
|
-
form: C
|
|
40
|
-
} = h(), {
|
|
41
|
-
name: L
|
|
42
|
-
} = b, _ = k === "desktop", g = C === "default" && !d, x = N((r) => {
|
|
43
|
-
s || (f("default"), c(r));
|
|
44
|
-
}, [s, c, f]), y = (r) => {
|
|
45
|
-
r.preventDefault();
|
|
46
|
-
};
|
|
47
|
-
return /* @__PURE__ */ i(t, {
|
|
48
|
-
onOpenChange: x,
|
|
49
|
-
open: p,
|
|
50
|
-
children: [!!m && /* @__PURE__ */ o(t.Trigger, {
|
|
51
|
-
children: m
|
|
52
|
-
}), /* @__PURE__ */ i(t.Content, {
|
|
53
|
-
ref: F,
|
|
54
|
-
className: a(e.content, _ && e.isFullscreen),
|
|
55
|
-
onPointerDownOutside: y,
|
|
56
|
-
size: "medium",
|
|
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
|
-
children: [u && /* @__PURE__ */ o("div", {
|
|
67
|
-
className: e.loading,
|
|
68
|
-
children: /* @__PURE__ */ o(v, {
|
|
69
|
-
"aria-label": n(l.loadingLabel),
|
|
70
|
-
size: "large"
|
|
71
|
-
})
|
|
72
|
-
}), /* @__PURE__ */ o("div", {
|
|
73
|
-
className: a(e.form, u && e.isLoading),
|
|
74
|
-
children: d ? /* @__PURE__ */ o(M, {}) : /* @__PURE__ */ o(D, {})
|
|
75
|
-
})]
|
|
76
|
-
}), !_ && g && /* @__PURE__ */ o(t.Close, {
|
|
77
|
-
"aria-label": n(l.closeButton),
|
|
78
|
-
disabled: s
|
|
79
|
-
})]
|
|
80
|
-
})]
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
export {
|
|
84
|
-
Y as UnifiedShareFormModal
|
|
85
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/unified-share-form-modal.js";
|
|
2
|
+
export { e as UnifiedShareFormModal };
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { CollaborationSection as f } from "./collaboration-section/collaboration-section.js";
|
|
4
|
-
import { SharedLinkSection as l } from "./shared-link-section/shared-link-section.js";
|
|
5
|
-
import { useUnifiedShareModalContext as p } from "../../contexts/unified-share-modal-context.js";
|
|
6
|
-
import { useUnifiedShareFormContext as h } from "../../contexts/unified-share-form-context.js";
|
|
7
|
-
import '../../../../styles/unified-share-form.css';const S = "_container_rq40p_1", v = "_divider_rq40p_6", i = {
|
|
8
|
-
container: S,
|
|
9
|
-
divider: v
|
|
10
|
-
};
|
|
11
|
-
function D() {
|
|
12
|
-
const {
|
|
13
|
-
config: r,
|
|
14
|
-
variant: a
|
|
15
|
-
} = p(), {
|
|
16
|
-
form: s
|
|
17
|
-
} = h(), c = a === "desktop", d = s === "default", t = r.collaboration, e = r.sharedLink && d;
|
|
18
|
-
return /* @__PURE__ */ m("div", {
|
|
19
|
-
className: i.container,
|
|
20
|
-
children: [c && /* @__PURE__ */ o(n, {
|
|
21
|
-
className: i.divider
|
|
22
|
-
}), t && /* @__PURE__ */ o(f, {}), t && e && /* @__PURE__ */ o(n, {
|
|
23
|
-
className: i.divider
|
|
24
|
-
}), e && /* @__PURE__ */ o(l, {})]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
D as UnifiedShareForm
|
|
29
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/unified-share-form.js";
|
|
2
|
+
export { e as UnifiedShareForm };
|
|
@@ -1,28 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
var e = [
|
|
2
|
+
"invite-collaborators",
|
|
3
|
+
"remove-collaborator",
|
|
4
|
+
"create-shared-link",
|
|
5
|
+
"delete-shared-link",
|
|
6
|
+
"update-shared-link",
|
|
7
|
+
"email-shared-link",
|
|
8
|
+
"auto-copy-shared-link"
|
|
9
|
+
], t = {
|
|
10
|
+
collaboration: !0,
|
|
11
|
+
collaborationLimit: 100,
|
|
12
|
+
collaborationMessage: !0,
|
|
13
|
+
collaborationMessageLimit: 750,
|
|
14
|
+
collaborationRole: !0,
|
|
15
|
+
collaborators: !0,
|
|
16
|
+
collaboratorsLimit: 100,
|
|
17
|
+
collaboratorsManagement: !0,
|
|
18
|
+
notifications: e,
|
|
19
|
+
sharedLink: !0,
|
|
20
|
+
sharedLinkAccess: !0,
|
|
21
|
+
sharedLinkAutoCopy: !1,
|
|
22
|
+
sharedLinkAutoCreate: !1,
|
|
23
|
+
sharedLinkEmail: !0,
|
|
24
|
+
sharedLinkEmailMessage: !0,
|
|
25
|
+
sharedLinkPermission: !0,
|
|
26
|
+
sharedLinkSettings: !0
|
|
27
|
+
}, n = [
|
|
28
|
+
"co_owner",
|
|
29
|
+
"editor",
|
|
30
|
+
"previewer",
|
|
31
|
+
"previewer_uploader",
|
|
32
|
+
"uploader",
|
|
33
|
+
"viewer",
|
|
34
|
+
"viewer_uploader"
|
|
35
|
+
], r = ["owner", ...n], i = [
|
|
36
|
+
"open",
|
|
37
|
+
"company",
|
|
38
|
+
"collaborators"
|
|
39
|
+
], a = [
|
|
40
|
+
"can_edit",
|
|
41
|
+
"can_download",
|
|
42
|
+
"can_preview"
|
|
43
|
+
], o = "boxnote";
|
|
44
|
+
export { t as DEFAULT_CONFIGURATION, e as DEFAULT_NOTIFICATIONS, o as FILE_EXTENSION_BOX_NOTE, i as SUPPORTED_ACCESS_LEVELS, r as SUPPORTED_COLLABORATOR_ROLES, n as SUPPORTED_INVITATION_ROLES, a as SUPPORTED_PERMISSION_LEVELS };
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UnifiedShareFormContext as
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
i as SharedLinkSettingsContext,
|
|
6
|
-
o as SharedLinkSettingsProvider,
|
|
7
|
-
d as UnifiedShareFormContext,
|
|
8
|
-
a as UnifiedShareFormProvider,
|
|
9
|
-
h as UnifiedShareModalContext,
|
|
10
|
-
x as UnifiedShareModalProvider,
|
|
11
|
-
t as useSharedLinkSettingsContext,
|
|
12
|
-
S as useUnifiedShareFormContext,
|
|
13
|
-
m as useUnifiedShareModalContext
|
|
14
|
-
};
|
|
1
|
+
import { UnifiedShareModalContext as e, UnifiedShareModalProvider as t, useUnifiedShareModalContext as n } from "./unified-share-modal-context.js";
|
|
2
|
+
import { UnifiedShareFormContext as r, UnifiedShareFormProvider as i, useUnifiedShareFormContext as a } from "./unified-share-form-context.js";
|
|
3
|
+
import { SharedLinkSettingsContext as o, SharedLinkSettingsProvider as s, useSharedLinkSettingsContext as c } from "./shared-link-settings-context.js";
|
|
4
|
+
export { o as SharedLinkSettingsContext, s as SharedLinkSettingsProvider, r as UnifiedShareFormContext, i as UnifiedShareFormProvider, e as UnifiedShareModalContext, t as UnifiedShareModalProvider, c as useSharedLinkSettingsContext, a as useUnifiedShareFormContext, n as useUnifiedShareModalContext };
|
|
@@ -1,60 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}), [i, a, d, m, l, o, u, c, S]);
|
|
51
|
-
return /* @__PURE__ */ k(f.Provider, {
|
|
52
|
-
value: w,
|
|
53
|
-
children: e
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
f as SharedLinkSettingsContext,
|
|
58
|
-
N as SharedLinkSettingsProvider,
|
|
59
|
-
M as useSharedLinkSettingsContext
|
|
1
|
+
import { useUnifiedShareModalContext as e } from "./unified-share-modal-context.js";
|
|
2
|
+
import { formatDateFromTimestampToCalendarDate as t } from "../utils/date.js";
|
|
3
|
+
import { useLinkSettingsForm as n } from "../hooks/use-link-settings-form.js";
|
|
4
|
+
import { createContext as r, useContext as i, useMemo as a, useState as o } from "react";
|
|
5
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
6
|
+
var c = /* @__PURE__ */ r(null), l = () => {
|
|
7
|
+
let e = i(c);
|
|
8
|
+
if (!e) throw Error("useSharedLinkSettingsContext must be used with SharedLinkSettingsProvider");
|
|
9
|
+
return e;
|
|
10
|
+
}, u = ({ children: r }) => {
|
|
11
|
+
let { sharedLink: i } = e(), { expiresAt: l = 0, settings: u = {}, vanityName: d = "" } = i, { isDownloadEnabled: f, isPasswordEnabled: p } = u, [m, h] = o(null), g = a(() => ({
|
|
12
|
+
expiration: l ? t(l) : null,
|
|
13
|
+
isDownloadEnabled: !!f,
|
|
14
|
+
isExpirationEnabled: !!l,
|
|
15
|
+
isPasswordEnabled: !!p,
|
|
16
|
+
isVanityNameEnabled: !!d,
|
|
17
|
+
password: "",
|
|
18
|
+
vanityName: d
|
|
19
|
+
}), [
|
|
20
|
+
l,
|
|
21
|
+
f,
|
|
22
|
+
p,
|
|
23
|
+
d
|
|
24
|
+
]), { errors: _, formData: v, handleFormReset: y, handleFormSubmit: b, setFieldError: x, setFieldValue: S, validatePassword: C } = n(g), w = a(() => ({
|
|
25
|
+
containerRef: m,
|
|
26
|
+
errors: _,
|
|
27
|
+
formData: v,
|
|
28
|
+
initialFormData: g,
|
|
29
|
+
resetForm: y,
|
|
30
|
+
setContainerRef: h,
|
|
31
|
+
setFieldError: x,
|
|
32
|
+
setFieldValue: S,
|
|
33
|
+
submitForm: b,
|
|
34
|
+
validatePassword: C
|
|
35
|
+
}), [
|
|
36
|
+
m,
|
|
37
|
+
_,
|
|
38
|
+
v,
|
|
39
|
+
y,
|
|
40
|
+
b,
|
|
41
|
+
g,
|
|
42
|
+
x,
|
|
43
|
+
S,
|
|
44
|
+
C
|
|
45
|
+
]);
|
|
46
|
+
return /* @__PURE__ */ s(c.Provider, {
|
|
47
|
+
value: w,
|
|
48
|
+
children: r
|
|
49
|
+
});
|
|
60
50
|
};
|
|
51
|
+
export { c as SharedLinkSettingsContext, u as SharedLinkSettingsProvider, l as useSharedLinkSettingsContext };
|
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
import { useUnifiedShareModalContext as e } from "./unified-share-modal-context.js";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
3
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
4
|
+
var l = /* @__PURE__ */ t(null), u = () => {
|
|
5
|
+
let e = r(l);
|
|
6
|
+
if (!e) throw Error("useUnifiedShareFormContext must be used with UnifiedShareFormProvider");
|
|
7
|
+
return e;
|
|
8
|
+
}, d = ({ children: t }) => {
|
|
9
|
+
let { initialContacts: r, isOpen: u, view: d } = e(), [f, p] = s("default"), [m, h] = s(!1), [g, _] = s(!1), [v, y] = s(null), [b, x] = s(r), [S, C] = s(""), [w, T] = s(""), [E, D] = s(), [O, k] = s({}), A = o(!1), j = o(!1), M = n((e) => {
|
|
10
|
+
k((t) => ({
|
|
11
|
+
...t,
|
|
12
|
+
...e
|
|
13
|
+
}));
|
|
14
|
+
}, []);
|
|
15
|
+
i(() => {
|
|
16
|
+
u || (p("default"), h(!1), _(!1), x(r), C(""), T(""), D(void 0), k({}), A.current = !1, j.current = !1);
|
|
17
|
+
}, [r, u]), i(() => {
|
|
18
|
+
g || (d !== "unified-share-form" || f !== "default") && _(!0);
|
|
19
|
+
}, [
|
|
20
|
+
g,
|
|
21
|
+
d,
|
|
22
|
+
f
|
|
23
|
+
]);
|
|
24
|
+
let N = a(() => ({
|
|
25
|
+
collaborationRole: E,
|
|
26
|
+
contactValue: S,
|
|
27
|
+
containerRef: v,
|
|
28
|
+
form: f,
|
|
29
|
+
isCollaboratorsOpen: m,
|
|
30
|
+
isInteracted: g,
|
|
31
|
+
isSharedLinkAutoCopied: A,
|
|
32
|
+
isSharedLinkAutoCreated: j,
|
|
33
|
+
messageValue: w,
|
|
34
|
+
setCollaborationRole: D,
|
|
35
|
+
setContactValue: C,
|
|
36
|
+
setContainerRef: y,
|
|
37
|
+
setForm: p,
|
|
38
|
+
setIsCollaboratorsOpen: h,
|
|
39
|
+
setMessageValue: T,
|
|
40
|
+
setShieldRestriction: M,
|
|
41
|
+
setUserContacts: x,
|
|
42
|
+
shieldRestriction: O,
|
|
43
|
+
userContacts: b
|
|
44
|
+
}), [
|
|
45
|
+
E,
|
|
46
|
+
S,
|
|
47
|
+
v,
|
|
48
|
+
f,
|
|
49
|
+
M,
|
|
50
|
+
m,
|
|
51
|
+
g,
|
|
52
|
+
w,
|
|
53
|
+
O,
|
|
54
|
+
b
|
|
55
|
+
]);
|
|
56
|
+
return /* @__PURE__ */ c(l.Provider, {
|
|
57
|
+
value: N,
|
|
58
|
+
children: t
|
|
59
|
+
});
|
|
58
60
|
};
|
|
61
|
+
export { l as UnifiedShareFormContext, d as UnifiedShareFormProvider, u as useUnifiedShareFormContext };
|