@box/unified-share-modal 0.49.0 → 0.50.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/shared-link-settings-modal/messages.js +2 -6
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +79 -79
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +89 -68
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +119 -102
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +8 -0
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +12 -0
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +42 -39
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +46 -43
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +109 -100
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +56 -47
- package/dist/esm/lib/hooks/use-access-levels.js +18 -17
- package/dist/esm/lib/hooks/use-collaboration-form.js +13 -13
- package/dist/esm/lib/messages.js +11 -7
- package/dist/i18n/bn-IN.js +8 -2
- package/dist/i18n/da-DK.js +8 -2
- package/dist/i18n/de-DE.js +8 -2
- package/dist/i18n/en-AU.js +8 -2
- package/dist/i18n/en-CA.js +8 -2
- package/dist/i18n/en-GB.js +8 -2
- package/dist/i18n/en-US.js +15 -10
- package/dist/i18n/en-US.properties +21 -11
- package/dist/i18n/en-x-pseudo.js +122 -116
- package/dist/i18n/en-x-pseudo.properties +116 -116
- package/dist/i18n/es-419.js +8 -2
- package/dist/i18n/es-ES.js +8 -2
- package/dist/i18n/fi-FI.js +8 -2
- package/dist/i18n/fr-CA.js +8 -2
- package/dist/i18n/fr-FR.js +8 -2
- package/dist/i18n/hi-IN.js +8 -2
- package/dist/i18n/it-IT.js +8 -2
- package/dist/i18n/ja-JP.js +8 -2
- package/dist/i18n/json/src/lib/components/shared-link-settings-modal/messages.json +1 -1
- package/dist/i18n/json/src/lib/components/unified-share-form-modal/collaboration-section/messages.json +1 -1
- package/dist/i18n/json/src/lib/components/unified-share-form-modal/shared-link-section/messages.json +1 -1
- package/dist/i18n/json/src/lib/messages.json +1 -1
- package/dist/i18n/ko-KR.js +8 -2
- package/dist/i18n/nb-NO.js +8 -2
- package/dist/i18n/nl-NL.js +8 -2
- package/dist/i18n/pl-PL.js +8 -2
- package/dist/i18n/pt-BR.js +8 -2
- package/dist/i18n/ru-RU.js +8 -2
- package/dist/i18n/sv-SE.js +8 -2
- package/dist/i18n/tr-TR.js +8 -2
- package/dist/i18n/zh-CN.js +8 -2
- package/dist/i18n/zh-TW.js +8 -2
- package/dist/styles/collaboration-role.css +1 -1
- package/dist/styles/shared-link-section.css +1 -1
- package/dist/styles/unified-share-form-modal.css +1 -1
- package/dist/types/lib/components/shared-link-settings-modal/messages.d.ts +0 -5
- package/dist/types/lib/components/unified-share-form-modal/collaboration-section/messages.d.ts +10 -0
- package/dist/types/lib/components/unified-share-form-modal/shared-link-section/messages.d.ts +15 -0
- package/dist/types/lib/messages.d.ts +5 -0
- package/dist/types/lib/stories/shared.d.ts +10 -0
- package/dist/types/lib/types.d.ts +10 -0
- package/package.json +2 -2
package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js
CHANGED
|
@@ -1,144 +1,153 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { ClockBadge as
|
|
5
|
-
import { SurfaceStatusSurfaceRed as
|
|
6
|
-
import { CopyInput as
|
|
7
|
-
import { SharedLinkAccess as
|
|
8
|
-
import { SharedLinkPermission as
|
|
1
|
+
import { useRef as b, useState as U, useCallback as x, useEffect as D } from "react";
|
|
2
|
+
import { useIntl as j } from "react-intl";
|
|
3
|
+
import { Text as K, Tooltip as T, Focusable as V, Switch as O, Status as G, Link as H, Button as J } from "@box/blueprint-web";
|
|
4
|
+
import { ClockBadge as Q, Envelope as W } from "@box/blueprint-web-assets/icons/Line";
|
|
5
|
+
import { SurfaceStatusSurfaceRed as X } from "@box/blueprint-web-assets/tokens/tokens";
|
|
6
|
+
import { CopyInput as Y } from "@box/copy-input";
|
|
7
|
+
import { SharedLinkAccess as Z } from "./shared-link-access.js";
|
|
8
|
+
import { SharedLinkPermission as $ } from "./shared-link-permission.js";
|
|
9
9
|
import t from "./messages.js";
|
|
10
|
-
import { jsxs as
|
|
11
|
-
import { useUnifiedShareFormContext as
|
|
12
|
-
import { useUnifiedShareModalContext as
|
|
13
|
-
import { useSharingAction as
|
|
14
|
-
import { formatDateFromTimestampToDateString as
|
|
15
|
-
import { callOnKeyboardEvent as
|
|
16
|
-
import '../../../../../styles/shared-link-section.css';const
|
|
17
|
-
container:
|
|
18
|
-
toggle:
|
|
19
|
-
settings:
|
|
20
|
-
copy:
|
|
21
|
-
access:
|
|
10
|
+
import { jsxs as g, jsx as n } from "react/jsx-runtime";
|
|
11
|
+
import { useUnifiedShareFormContext as ee } from "../../../contexts/unified-share-form-context.js";
|
|
12
|
+
import { useUnifiedShareModalContext as te } from "../../../contexts/unified-share-modal-context.js";
|
|
13
|
+
import { useSharingAction as E } from "../../../hooks/use-sharing-action.js";
|
|
14
|
+
import { formatDateFromTimestampToDateString as ie } from "../../../utils/date.js";
|
|
15
|
+
import { callOnKeyboardEvent as ne } from "../../../utils/event.js";
|
|
16
|
+
import '../../../../../styles/shared-link-section.css';const oe = "_container_q90iz_1", ae = "_toggle_q90iz_7", se = "_settings_q90iz_13", re = "_copy_q90iz_22", ce = "_access_q90iz_30", d = {
|
|
17
|
+
container: oe,
|
|
18
|
+
toggle: ae,
|
|
19
|
+
settings: se,
|
|
20
|
+
copy: re,
|
|
21
|
+
access: ce
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function Te() {
|
|
24
24
|
const {
|
|
25
25
|
formatMessage: e
|
|
26
|
-
} =
|
|
27
|
-
onModalViewChange:
|
|
28
|
-
onShareViewChange:
|
|
29
|
-
} =
|
|
30
|
-
config:
|
|
31
|
-
isSubmitting:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
} = j(), k = b(!0), L = b(null), u = b(null), {
|
|
27
|
+
onModalViewChange: h,
|
|
28
|
+
onShareViewChange: I
|
|
29
|
+
} = ee(), {
|
|
30
|
+
config: o,
|
|
31
|
+
isSubmitting: N,
|
|
32
|
+
item: P,
|
|
33
|
+
sharedLink: m,
|
|
34
|
+
sharingService: w
|
|
35
|
+
} = te(), {
|
|
36
|
+
permissions: v = {}
|
|
37
|
+
} = P, {
|
|
38
|
+
createSharedLink: z
|
|
39
|
+
} = w, {
|
|
37
40
|
sharedLinkAutoCopy: r,
|
|
38
|
-
sharedLinkAutoCreate:
|
|
39
|
-
} =
|
|
40
|
-
let
|
|
41
|
-
r && (
|
|
41
|
+
sharedLinkAutoCreate: C
|
|
42
|
+
} = o;
|
|
43
|
+
let A = "create-shared-link";
|
|
44
|
+
r && (A = "auto-copy-shared-link");
|
|
42
45
|
const {
|
|
43
|
-
isLoading:
|
|
44
|
-
onAction:
|
|
45
|
-
} =
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
resolve:
|
|
46
|
+
isLoading: F,
|
|
47
|
+
onAction: y
|
|
48
|
+
} = E(z, A), i = !!m.url, a = N ?? F, [S, q] = U(!1), p = x(async () => {
|
|
49
|
+
i || (await y(), q(!0));
|
|
50
|
+
}, [i, y]), R = x(async () => (p(), new Promise((s) => {
|
|
51
|
+
u.current = {
|
|
52
|
+
resolve: s
|
|
50
53
|
};
|
|
51
|
-
})), [
|
|
52
|
-
onAction:
|
|
53
|
-
} =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
54
|
+
})), [p]), {
|
|
55
|
+
onAction: _
|
|
56
|
+
} = E(R, "auto-copy-shared-link");
|
|
57
|
+
D(() => {
|
|
58
|
+
k.current && (r ? _() : C && p(), k.current = !1);
|
|
59
|
+
}, [k, r, C, p, _]), D(() => {
|
|
60
|
+
i && r && L.current && L.current.click();
|
|
61
|
+
}, [i, r]);
|
|
62
|
+
const B = x((l) => {
|
|
63
|
+
if (!u.current)
|
|
61
64
|
return;
|
|
62
|
-
let
|
|
63
|
-
|
|
65
|
+
let s;
|
|
66
|
+
l instanceof Error ? s = S ? e(t.autoCreateCopyErrorNoticeText) : null : s = e(S ? t.autoCreateCopySuccessNoticeText : t.autoCopySuccessNoticeText), s && u.current.resolve({
|
|
64
67
|
messages: [{
|
|
65
|
-
text:
|
|
68
|
+
text: s,
|
|
66
69
|
type: "success"
|
|
67
70
|
}]
|
|
68
|
-
}),
|
|
69
|
-
}, [e,
|
|
70
|
-
!
|
|
71
|
+
}), u.current = null;
|
|
72
|
+
}, [e, S]), M = async (l) => {
|
|
73
|
+
!l && h && h("remove-shared-link"), l && await y();
|
|
71
74
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
let c, f = !1;
|
|
76
|
+
return !i && !a && (c = e(t.sharedLinkToggleTooltip)), !i && !v.canShare && (c = e(t.createLinkDisabledTooltip), f = !0), i && !v.canSetShareAccess && (c = e(t.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ g("div", {
|
|
77
|
+
className: d.container,
|
|
78
|
+
children: [/* @__PURE__ */ n(K, {
|
|
75
79
|
as: "label",
|
|
76
80
|
variant: "bodyDefaultBold",
|
|
77
81
|
children: e(t.shareLinkLabel)
|
|
78
|
-
}), /* @__PURE__ */
|
|
79
|
-
className:
|
|
80
|
-
children: [/* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ g("div", {
|
|
83
|
+
className: d.toggle,
|
|
84
|
+
children: [/* @__PURE__ */ n(T, {
|
|
81
85
|
align: "start",
|
|
82
|
-
content:
|
|
86
|
+
content: c,
|
|
83
87
|
"data-testid": "shared-link-tooltip",
|
|
84
|
-
open:
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
open: c ? void 0 : !1,
|
|
89
|
+
children: /* @__PURE__ */ n(V, {
|
|
90
|
+
focusable: f,
|
|
91
|
+
children: /* @__PURE__ */ n(O.Item, {
|
|
92
|
+
checked: i,
|
|
93
|
+
disabled: f || a,
|
|
94
|
+
label: e(t.sharedLinkToggleLabel),
|
|
95
|
+
onCheckedChange: M,
|
|
96
|
+
value: "shared-link"
|
|
97
|
+
})
|
|
91
98
|
})
|
|
92
|
-
}),
|
|
99
|
+
}), i && !!m.expiresAt && /* @__PURE__ */ n(T, {
|
|
93
100
|
content: e(t.expirationIconTooltip, {
|
|
94
|
-
expirationDate:
|
|
101
|
+
expirationDate: ie(m.expiresAt)
|
|
95
102
|
}),
|
|
96
103
|
"data-testid": "expiration-date-tooltip",
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
-
color:
|
|
104
|
+
children: /* @__PURE__ */ n(G, {
|
|
105
|
+
color: X,
|
|
99
106
|
hideText: !0,
|
|
100
|
-
icon:
|
|
107
|
+
icon: Q,
|
|
101
108
|
text: e(t.expirationIconLabel)
|
|
102
109
|
})
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
}), i && o.sharedLinkSettings && /* @__PURE__ */ n(H, {
|
|
111
|
+
"aria-disabled": a,
|
|
112
|
+
"aria-haspopup": "dialog",
|
|
113
|
+
className: d.settings,
|
|
114
|
+
onClick: () => h("shared-link-settings"),
|
|
115
|
+
onKeyDown: ne(() => h("shared-link-settings"), {
|
|
107
116
|
canPreventDefault: !0
|
|
108
117
|
}),
|
|
109
118
|
role: "button",
|
|
110
|
-
tabIndex: 0,
|
|
119
|
+
tabIndex: a ? -1 : 0,
|
|
111
120
|
variant: "standalone",
|
|
112
121
|
children: e(t.sharedLinkSettingsLabel)
|
|
113
122
|
})]
|
|
114
|
-
}),
|
|
115
|
-
className:
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
-
ref:
|
|
118
|
-
autoFocus:
|
|
119
|
-
disabled:
|
|
123
|
+
}), i && /* @__PURE__ */ g("div", {
|
|
124
|
+
className: d.copy,
|
|
125
|
+
children: [/* @__PURE__ */ n(Y, {
|
|
126
|
+
ref: L,
|
|
127
|
+
autoFocus: C && i,
|
|
128
|
+
disabled: a,
|
|
120
129
|
hideLabel: !0,
|
|
121
130
|
label: e(t.sharedLinkUrlLabel),
|
|
122
|
-
onCopy:
|
|
123
|
-
value:
|
|
124
|
-
}),
|
|
131
|
+
onCopy: B,
|
|
132
|
+
value: m.url
|
|
133
|
+
}), o.sharedLinkEmail && /* @__PURE__ */ n(T, {
|
|
125
134
|
align: "end",
|
|
126
135
|
content: e(t.sharedLinkEmailLabel),
|
|
127
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ n(J, {
|
|
128
137
|
"aria-label": e(t.sharedLinkEmailLabel),
|
|
129
|
-
disabled:
|
|
130
|
-
icon:
|
|
131
|
-
onClick: () =>
|
|
138
|
+
disabled: a,
|
|
139
|
+
icon: W,
|
|
140
|
+
onClick: () => I("email"),
|
|
132
141
|
size: "large",
|
|
133
142
|
variant: "secondary"
|
|
134
143
|
})
|
|
135
144
|
})]
|
|
136
|
-
}),
|
|
137
|
-
className:
|
|
138
|
-
children: [
|
|
145
|
+
}), i && (o.sharedLinkAccess || o.sharedLinkPermission) && /* @__PURE__ */ g("div", {
|
|
146
|
+
className: d.access,
|
|
147
|
+
children: [o.sharedLinkAccess && /* @__PURE__ */ n(Z, {}), o.sharedLinkPermission && /* @__PURE__ */ n($, {})]
|
|
139
148
|
})]
|
|
140
149
|
});
|
|
141
150
|
}
|
|
142
151
|
export {
|
|
143
|
-
|
|
152
|
+
Te as SharedLinkSection
|
|
144
153
|
};
|
|
@@ -1,72 +1,81 @@
|
|
|
1
1
|
import y from "clsx";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { Modal as o, LoadingIndicator as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { useState as g, useCallback as w } from "react";
|
|
3
|
+
import { useIntl as N } from "react-intl";
|
|
4
|
+
import { Modal as o, Status as U, LoadingIndicator as I } from "@box/blueprint-web";
|
|
5
|
+
import { Shield as P } from "@box/blueprint-web-assets/icons/Line";
|
|
6
|
+
import { UnifiedShareForm as v } from "./unified-share-form.js";
|
|
7
|
+
import l from "./messages.js";
|
|
8
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
9
|
+
import { UnifiedShareFormProvider as D } from "../../contexts/unified-share-form-context.js";
|
|
10
|
+
import { useUnifiedShareModalContext as O } from "../../contexts/unified-share-modal-context.js";
|
|
11
|
+
import '../../../../styles/unified-share-form-modal.css';const V = "_content_1tnt5_1", j = "_header_1tnt5_5", z = "_body_1tnt5_12", B = "_hasFooter_1tnt5_23", L = "_loading_1tnt5_27", t = {
|
|
12
|
+
content: V,
|
|
13
|
+
header: j,
|
|
14
|
+
body: z,
|
|
15
|
+
hasFooter: B,
|
|
16
|
+
loading: L
|
|
15
17
|
};
|
|
16
|
-
function
|
|
18
|
+
function Q({
|
|
17
19
|
children: d,
|
|
18
|
-
isOpen:
|
|
19
|
-
onOpenChange:
|
|
20
|
-
onModalViewChange:
|
|
20
|
+
isOpen: p,
|
|
21
|
+
onOpenChange: a,
|
|
22
|
+
onModalViewChange: u
|
|
21
23
|
}) {
|
|
22
24
|
const {
|
|
23
25
|
formatMessage: r
|
|
24
|
-
} =
|
|
25
|
-
isFetching:
|
|
26
|
-
item:
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
} = N(), {
|
|
27
|
+
isFetching: _,
|
|
28
|
+
item: F
|
|
29
|
+
} = O(), {
|
|
30
|
+
classification: i,
|
|
31
|
+
name: S
|
|
32
|
+
} = F, [b, C] = g(null), [c, m] = g("default"), x = !!d, h = c !== "default", f = w((s) => {
|
|
33
|
+
m("default"), a && a(s);
|
|
34
|
+
}, [a]), M = (s) => {
|
|
35
|
+
s.preventDefault();
|
|
33
36
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ n(o, {
|
|
35
38
|
onOpenChange: f,
|
|
36
|
-
open:
|
|
37
|
-
children: [
|
|
39
|
+
open: p,
|
|
40
|
+
children: [x && /* @__PURE__ */ e(o.Trigger, {
|
|
38
41
|
children: d
|
|
39
|
-
}), /* @__PURE__ */
|
|
42
|
+
}), /* @__PURE__ */ n(o.Content, {
|
|
40
43
|
ref: C,
|
|
41
44
|
className: t.content,
|
|
42
|
-
onPointerDownOutside:
|
|
45
|
+
onPointerDownOutside: M,
|
|
43
46
|
size: "medium",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
children: [/* @__PURE__ */ n(o.Header, {
|
|
48
|
+
className: t.header,
|
|
49
|
+
children: [r(l.title, {
|
|
50
|
+
itemName: S
|
|
51
|
+
}), i && /* @__PURE__ */ e(U, {
|
|
52
|
+
colorIndex: i.colorId + 1,
|
|
53
|
+
icon: P,
|
|
54
|
+
iconPosition: "left",
|
|
55
|
+
text: i.name.toUpperCase()
|
|
56
|
+
})]
|
|
48
57
|
}), /* @__PURE__ */ e(o.Body, {
|
|
49
|
-
className: y(t.body,
|
|
50
|
-
children: /* @__PURE__ */
|
|
58
|
+
className: y(t.body, h && t.hasFooter),
|
|
59
|
+
children: /* @__PURE__ */ n(D, {
|
|
51
60
|
container: b,
|
|
52
61
|
onModalOpenChange: f,
|
|
53
|
-
onModalViewChange:
|
|
54
|
-
onShareViewChange:
|
|
55
|
-
shareView:
|
|
56
|
-
children: [
|
|
62
|
+
onModalViewChange: u,
|
|
63
|
+
onShareViewChange: m,
|
|
64
|
+
shareView: c,
|
|
65
|
+
children: [_ && /* @__PURE__ */ e("div", {
|
|
57
66
|
className: t.loading,
|
|
58
|
-
children: /* @__PURE__ */ e(
|
|
59
|
-
"aria-label": r(
|
|
67
|
+
children: /* @__PURE__ */ e(I, {
|
|
68
|
+
"aria-label": r(l.loadingLabel),
|
|
60
69
|
size: "large"
|
|
61
70
|
})
|
|
62
|
-
}), /* @__PURE__ */ e(
|
|
71
|
+
}), /* @__PURE__ */ e(v, {})]
|
|
63
72
|
})
|
|
64
|
-
}), !
|
|
65
|
-
"aria-label": r(
|
|
73
|
+
}), !h && /* @__PURE__ */ e(o.Close, {
|
|
74
|
+
"aria-label": r(l.closeButton)
|
|
66
75
|
})]
|
|
67
76
|
})]
|
|
68
77
|
});
|
|
69
78
|
}
|
|
70
79
|
export {
|
|
71
|
-
|
|
80
|
+
Q as UnifiedShareFormModal
|
|
72
81
|
};
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import x from "lodash/camelCase";
|
|
2
|
+
import { useMemo as l } from "react";
|
|
3
|
+
import { useIntl as y } from "react-intl";
|
|
3
4
|
import o from "../components/unified-share-form-modal/shared-link-section/messages.js";
|
|
4
|
-
import { useUnifiedShareModalContext as
|
|
5
|
-
import { getAllowedAccessLevels as
|
|
6
|
-
const
|
|
5
|
+
import { useUnifiedShareModalContext as M } from "../contexts/unified-share-modal-context.js";
|
|
6
|
+
import { getAllowedAccessLevels as $ } from "../utils/permission.js";
|
|
7
|
+
const k = () => {
|
|
7
8
|
const {
|
|
8
9
|
formatMessage: e
|
|
9
|
-
} = x(), {
|
|
10
|
-
currentUser: p,
|
|
11
|
-
item: d,
|
|
12
|
-
sharedLink: f
|
|
13
10
|
} = y(), {
|
|
11
|
+
currentUser: p,
|
|
12
|
+
item: f,
|
|
13
|
+
sharedLink: d
|
|
14
|
+
} = M(), {
|
|
14
15
|
enterprise: u = {}
|
|
15
16
|
} = p, {
|
|
16
17
|
name: s
|
|
17
18
|
} = u, {
|
|
18
19
|
type: n
|
|
19
|
-
} =
|
|
20
|
+
} = f, {
|
|
20
21
|
access: i,
|
|
21
22
|
accessLevels: m
|
|
22
|
-
} =
|
|
23
|
+
} = d, r = l(() => $(m).map((t) => {
|
|
23
24
|
const {
|
|
24
25
|
description: A,
|
|
25
|
-
id:
|
|
26
|
+
id: a,
|
|
26
27
|
label: v
|
|
27
28
|
} = t;
|
|
28
|
-
let c =
|
|
29
|
-
|
|
29
|
+
let c = a;
|
|
30
|
+
a === "company" && s && (c = "enterprise");
|
|
30
31
|
const b = e(o[`${c}AccessLevelLabel`], {
|
|
31
32
|
enterprise: s
|
|
32
33
|
}), g = e(o[`${c}AccessLevelDescription`], {
|
|
33
34
|
enterprise: s,
|
|
34
|
-
item: e(o[`${n}AccessLevelItem`])
|
|
35
|
+
item: e(o[`${x(n)}AccessLevelItem`])
|
|
35
36
|
});
|
|
36
37
|
return {
|
|
37
38
|
...t,
|
|
38
39
|
description: A ?? g,
|
|
39
40
|
label: v ?? b
|
|
40
41
|
};
|
|
41
|
-
}), [m, s, e, n]), L =
|
|
42
|
+
}), [m, s, e, n]), L = l(() => r.find(({
|
|
42
43
|
id: t
|
|
43
44
|
}) => i === t), [i, r]);
|
|
44
45
|
return {
|
|
@@ -47,5 +48,5 @@ const U = () => {
|
|
|
47
48
|
};
|
|
48
49
|
};
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
k as useAccessLevels
|
|
51
52
|
};
|
|
@@ -3,14 +3,14 @@ import { useFormValidation as E } from "./use-form-validation.js";
|
|
|
3
3
|
import { useSharingAction as A } from "./use-sharing-action.js";
|
|
4
4
|
import { useUnifiedShareFormContext as M } from "../contexts/unified-share-form-context.js";
|
|
5
5
|
import { useUnifiedShareModalContext as O } from "../contexts/unified-share-modal-context.js";
|
|
6
|
-
const I = (
|
|
6
|
+
const I = (h, p) => {
|
|
7
7
|
const {
|
|
8
|
-
errors:
|
|
8
|
+
errors: d,
|
|
9
9
|
setFieldError: a,
|
|
10
|
-
validateUserContact:
|
|
10
|
+
validateUserContact: f,
|
|
11
11
|
validateUserSelector: i
|
|
12
12
|
} = E(), {
|
|
13
|
-
contactService:
|
|
13
|
+
contactService: v
|
|
14
14
|
} = O(), {
|
|
15
15
|
collaborationRole: F,
|
|
16
16
|
messageValue: b,
|
|
@@ -22,9 +22,9 @@ const I = (p, v) => {
|
|
|
22
22
|
} = M(), {
|
|
23
23
|
isLoading: y,
|
|
24
24
|
onAction: V
|
|
25
|
-
} = A(
|
|
25
|
+
} = A(h, p), {
|
|
26
26
|
getContactByEmail: u
|
|
27
|
-
} =
|
|
27
|
+
} = v, C = () => {
|
|
28
28
|
r([]), l(""), U(""), a("user-contact", "");
|
|
29
29
|
}, w = s((t) => {
|
|
30
30
|
a("user-contact", ""), l(t);
|
|
@@ -36,19 +36,19 @@ const I = (p, v) => {
|
|
|
36
36
|
if (e && e.id)
|
|
37
37
|
return e;
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return f(t.value) ? null : {
|
|
40
40
|
email: t.value,
|
|
41
41
|
id: 0,
|
|
42
42
|
isExternalUser: !0,
|
|
43
43
|
name: t.value,
|
|
44
44
|
value: t.value
|
|
45
45
|
};
|
|
46
|
-
}, [u,
|
|
46
|
+
}, [u, f]), m = s(async (t) => {
|
|
47
47
|
if (a("user-contact", ""), i(t), o.length >= t.length) {
|
|
48
48
|
r(t);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const [e,
|
|
51
|
+
const [e, S] = [t.slice(0, -1), t[t.length - 1]], n = await g(S), c = n ? [...e, n] : e;
|
|
52
52
|
r(c.filter(Boolean));
|
|
53
53
|
}, [g, a, r, i, o]), B = s((t) => {
|
|
54
54
|
var n, c;
|
|
@@ -58,16 +58,16 @@ const I = (p, v) => {
|
|
|
58
58
|
}]);
|
|
59
59
|
}, [m, o]);
|
|
60
60
|
return {
|
|
61
|
-
errors:
|
|
62
|
-
handleFormReset:
|
|
61
|
+
errors: d,
|
|
62
|
+
handleFormReset: C,
|
|
63
63
|
handleFormSubmit: async () => {
|
|
64
|
-
if (
|
|
64
|
+
if (d["user-contact"] || i(o))
|
|
65
65
|
return !0;
|
|
66
66
|
const t = {
|
|
67
67
|
contacts: o,
|
|
68
68
|
message: b
|
|
69
69
|
};
|
|
70
|
-
return x === "invite" && (t.role = F.id), await V(t),
|
|
70
|
+
return x === "invite" && (t.role = F.id), await V(t), C(), !1;
|
|
71
71
|
},
|
|
72
72
|
handleSelectedUsersChange: m,
|
|
73
73
|
handleUserSelectorBlur: B,
|
package/dist/esm/lib/messages.js
CHANGED
|
@@ -26,7 +26,7 @@ const a = e({
|
|
|
26
26
|
},
|
|
27
27
|
updateSharedLinkSuccessNoticeText: {
|
|
28
28
|
id: "groupSharedFeatures.usm.updateSharedLinkSuccessNoticeText",
|
|
29
|
-
defaultMessage: "
|
|
29
|
+
defaultMessage: "The shared link settings were saved successfully."
|
|
30
30
|
},
|
|
31
31
|
createSharedLinkSuccessNoticeText: {
|
|
32
32
|
id: "groupSharedFeatures.usm.createSharedLinkSuccessNoticeText",
|
|
@@ -36,13 +36,17 @@ const a = e({
|
|
|
36
36
|
id: "groupSharedFeatures.usm.createSharedLinkErrorNoticeText",
|
|
37
37
|
defaultMessage: "Unable to create a shared link. Please try again later."
|
|
38
38
|
},
|
|
39
|
+
emailSharedLinkSuccessNoticeText: {
|
|
40
|
+
id: "groupSharedFeatures.usm.emailSharedLinkSuccessNoticeText",
|
|
41
|
+
defaultMessage: "The shared link for “{itemName}” was sent successfully."
|
|
42
|
+
},
|
|
39
43
|
autoCopySharedLinkErrorNoticeText: {
|
|
40
44
|
id: "groupSharedFeatures.usm.autoCopySharedLinkErrorNoticeText",
|
|
41
45
|
defaultMessage: "Unable to create a shared link. Please try again later."
|
|
42
46
|
},
|
|
43
47
|
vanityNameInvalidErrorMessage: {
|
|
44
48
|
id: "groupSharedFeatures.usm.vanityNameInvalidErrorMessage",
|
|
45
|
-
defaultMessage: "Custom URLs
|
|
49
|
+
defaultMessage: "Custom URLs must be between 12-30 characters, and can include letters, numbers, and hyphens"
|
|
46
50
|
},
|
|
47
51
|
vanityNameRequiredErrorMessage: {
|
|
48
52
|
id: "groupSharedFeatures.usm.vanityNameRequiredErrorMessage",
|
|
@@ -50,11 +54,11 @@ const a = e({
|
|
|
50
54
|
},
|
|
51
55
|
expirationRequiredErrorMessage: {
|
|
52
56
|
id: "groupSharedFeatures.usm.expirationRequiredErrorMessage",
|
|
53
|
-
defaultMessage: "Please select
|
|
57
|
+
defaultMessage: "Please select an expiration date"
|
|
54
58
|
},
|
|
55
59
|
expirationFutureDateRequiredErrorMessage: {
|
|
56
60
|
id: "groupSharedFeatures.usm.expirationFutureDateRequiredErrorMessage",
|
|
57
|
-
defaultMessage: "
|
|
61
|
+
defaultMessage: "Expiration date must be in the future"
|
|
58
62
|
},
|
|
59
63
|
invalidEmailErrorMessage: {
|
|
60
64
|
id: "groupSharedFeatures.usm.invalidEmailErrorMessage",
|
|
@@ -70,15 +74,15 @@ const a = e({
|
|
|
70
74
|
},
|
|
71
75
|
passwordContainMinCharactersErrorMessage: {
|
|
72
76
|
id: "groupSharedFeatures.usm.passwordContainMinCharactersErrorMessage",
|
|
73
|
-
defaultMessage: "Password
|
|
77
|
+
defaultMessage: "Password must contain at least 8 characters"
|
|
74
78
|
},
|
|
75
79
|
passwordContainInvalidCharacterErrorMessage: {
|
|
76
80
|
id: "groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage",
|
|
77
|
-
defaultMessage: '
|
|
81
|
+
defaultMessage: 'Password cannot contain a space, "<" or ">"'
|
|
78
82
|
},
|
|
79
83
|
passwordContainLetterNumberOrSymbolErrorMessage: {
|
|
80
84
|
id: "groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage",
|
|
81
|
-
defaultMessage: "
|
|
85
|
+
defaultMessage: "Password must contain at least one upper case letter, number, or special character"
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
88
|
export {
|