@box/unified-share-modal 2.1.2 → 2.2.1
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/unified-share-form-modal/collaboration-section/collaboration-section.js +62 -61
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +26 -31
- package/dist/esm/lib/hooks/use-collaboration-form.js +74 -75
- package/dist/i18n/en-x-pseudo.js +162 -162
- package/dist/i18n/en-x-pseudo.properties +162 -162
- package/package.json +9 -9
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState as
|
|
1
|
+
import he from "clsx";
|
|
2
|
+
import { useState as pe, useRef as fe, useEffect as R, useCallback as C } from "react";
|
|
3
3
|
import { createPortal as be } from "react-dom";
|
|
4
4
|
import { useIntl as ge } from "react-intl";
|
|
5
|
-
import { useBlueprintModernization as Ce, useNotification as ve, useUniqueId as Se, useLabelable as Ue, Tooltip as _e, Focusable as
|
|
6
|
-
import { Globe as
|
|
5
|
+
import { useBlueprintModernization as Ce, useNotification as ve, useUniqueId as Se, useLabelable as Ue, Tooltip as _e, Focusable as Fe, Text as Le, Modal as v } from "@box/blueprint-web";
|
|
6
|
+
import { Globe as xe } from "@box/blueprint-web-assets/icons/Medium";
|
|
7
7
|
import { bpSize040 as P } from "@box/blueprint-web-assets/tokens/tokens";
|
|
8
|
-
import { UserSelectorContainer as
|
|
9
|
-
import { CollaborationRole as
|
|
10
|
-
import { SharedWithAvatars as
|
|
8
|
+
import { UserSelectorContainer as ye } from "@box/user-selector";
|
|
9
|
+
import { CollaborationRole as Ee } from "./collaboration-role.js";
|
|
10
|
+
import { SharedWithAvatars as Be } from "./shared-with-avatars.js";
|
|
11
11
|
import { ShieldRestrictionNotice as Ae } from "./shield-restriction-notice.js";
|
|
12
12
|
import { TextAreaContainer as Ne } from "./text-area-container.js";
|
|
13
13
|
import o from "./messages.js";
|
|
@@ -16,18 +16,19 @@ import { useFormValidation as Pe } from "../../../hooks/use-form-validation.js";
|
|
|
16
16
|
import { useCollaborationForm as ke } from "../../../hooks/use-collaboration-form.js";
|
|
17
17
|
import { useUnifiedShareFormContext as Ve } from "../../../contexts/unified-share-form-context.js";
|
|
18
18
|
import { useUnifiedShareModalContext as Ie } from "../../../contexts/unified-share-modal-context.js";
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
import { parseEmails as Te } from "../../../utils/email.js";
|
|
20
|
+
import '../../../../../styles/collaboration-section.css';const De = "_container_1e2gg_2", Me = "_label_1e2gg_8", ze = "_modernized_1e2gg_15", Oe = "_security_1e2gg_33", we = "_icon_1e2gg_37", We = "_access_1e2gg_43", c = {
|
|
21
|
+
container: De,
|
|
22
|
+
label: Me,
|
|
23
|
+
modernized: ze,
|
|
24
|
+
security: Oe,
|
|
25
|
+
icon: we,
|
|
26
|
+
access: We
|
|
26
27
|
};
|
|
27
|
-
function
|
|
28
|
+
function lt() {
|
|
28
29
|
const {
|
|
29
30
|
formatMessage: t
|
|
30
|
-
} = ge(), [
|
|
31
|
+
} = ge(), [S, y] = pe(), {
|
|
31
32
|
enableModernizedComponents: k
|
|
32
33
|
} = Ce(), {
|
|
33
34
|
addNotification: V
|
|
@@ -35,7 +36,7 @@ function at() {
|
|
|
35
36
|
validateShieldRestriction: I
|
|
36
37
|
} = Pe(), {
|
|
37
38
|
contactValue: T,
|
|
38
|
-
containerRef:
|
|
39
|
+
containerRef: U,
|
|
39
40
|
form: n,
|
|
40
41
|
setForm: d,
|
|
41
42
|
setUserContacts: D,
|
|
@@ -44,7 +45,7 @@ function at() {
|
|
|
44
45
|
} = Ve(), {
|
|
45
46
|
collaborationAccess: z,
|
|
46
47
|
collaborationNotices: O,
|
|
47
|
-
config:
|
|
48
|
+
config: h,
|
|
48
49
|
contactService: w,
|
|
49
50
|
isFetching: W,
|
|
50
51
|
isSubmitting: m,
|
|
@@ -56,7 +57,7 @@ function at() {
|
|
|
56
57
|
permissions: $ = {},
|
|
57
58
|
type: H
|
|
58
59
|
} = j, {
|
|
59
|
-
getContacts:
|
|
60
|
+
getContacts: _,
|
|
60
61
|
getContactsAvatarUrls: F
|
|
61
62
|
} = w, {
|
|
62
63
|
sendInvitations: J,
|
|
@@ -68,27 +69,27 @@ function at() {
|
|
|
68
69
|
errors: X,
|
|
69
70
|
handleFormReset: E,
|
|
70
71
|
handleFormSubmit: Y,
|
|
71
|
-
handleSelectedUsersChange:
|
|
72
|
+
handleSelectedUsersChange: p,
|
|
72
73
|
handleUserSelectorBlur: Z,
|
|
73
74
|
updateContactValue: ee
|
|
74
|
-
} = ke(L, x), te = K === "desktop", u = n === "default" || n === "invite", a = n === "invite" || n === "email", oe = i.some((e) => e.isExternalUser),
|
|
75
|
+
} = ke(L, x), te = K === "desktop", u = n === "default" || n === "invite", a = n === "invite" || n === "email", oe = i.some((e) => e.isExternalUser), B = fe(n === "email" ? "email" : "invite");
|
|
75
76
|
R(() => {
|
|
76
|
-
|
|
77
|
+
B.current = n === "email" ? "email" : "invite";
|
|
77
78
|
}, [n]), R(() => {
|
|
78
|
-
(!i.length || !i.some((e) => e.chipVariant === "error")) &&
|
|
79
|
+
(!i.length || !i.some((e) => e.chipVariant === "error")) && y(null);
|
|
79
80
|
}, [i]);
|
|
80
|
-
const re =
|
|
81
|
+
const re = C((e) => (e.stopPropagation(), !0), []), ie = C((e) => _ ? _(e, B.current) : Promise.resolve([]), [_]), ne = C((e) => F ? F(e) : Promise.resolve({}), [F]), ae = (e) => {
|
|
81
82
|
a || d("invite"), ee(e);
|
|
82
|
-
}, se =
|
|
83
|
-
const s = e.clipboardData.getData("text")
|
|
84
|
-
s
|
|
83
|
+
}, se = C((e) => {
|
|
84
|
+
const s = e.clipboardData.getData("text");
|
|
85
|
+
Te(s).length !== 0 && (e.preventDefault(), a || d("invite"), p([...i, {
|
|
85
86
|
value: s
|
|
86
|
-
}]))
|
|
87
|
-
}, [
|
|
87
|
+
}]));
|
|
88
|
+
}, [p, a, d, i]), le = () => {
|
|
88
89
|
E(), d("default");
|
|
89
90
|
}, ce = async () => {
|
|
90
91
|
try {
|
|
91
|
-
if (
|
|
92
|
+
if (S) {
|
|
92
93
|
const e = I(i, M);
|
|
93
94
|
if (e) {
|
|
94
95
|
V({
|
|
@@ -109,34 +110,34 @@ function at() {
|
|
|
109
110
|
return;
|
|
110
111
|
const {
|
|
111
112
|
shieldRestriction: s
|
|
112
|
-
} = e,
|
|
113
|
-
...
|
|
113
|
+
} = e, N = [...s.restrictedEmails ?? [], ...s.restrictedGroups ?? []], ue = i.map((g) => N.includes(g.email) || N.includes(`${g.id}`) ? {
|
|
114
|
+
...g,
|
|
114
115
|
chipVariant: "error"
|
|
115
|
-
} :
|
|
116
|
-
|
|
116
|
+
} : g);
|
|
117
|
+
y(s), D(ue);
|
|
117
118
|
}
|
|
118
119
|
};
|
|
119
|
-
let
|
|
120
|
-
u && !$.canInviteCollaborator && (
|
|
121
|
-
const
|
|
120
|
+
let f, b = !1;
|
|
121
|
+
u && !$.canInviteCollaborator && (f = t(o.inviteDisabledTooltip), b = !0), u && H === "web_link" && (f = t(o.inviteWebLinkDisabledTooltip), b = !0);
|
|
122
|
+
const A = Se("user-contacts-"), de = t(u ? o.invitePeopleLabel : o.emailSharedLinkLabel), me = Ue(de, A);
|
|
122
123
|
return /* @__PURE__ */ l("form", {
|
|
123
124
|
className: c.container,
|
|
124
125
|
onSubmit: (e) => e.preventDefault(),
|
|
125
|
-
children: [
|
|
126
|
-
error:
|
|
126
|
+
children: [S && /* @__PURE__ */ r(Ae, {
|
|
127
|
+
error: S,
|
|
127
128
|
isLoading: m,
|
|
128
|
-
onSelectedUsersChange:
|
|
129
|
+
onSelectedUsersChange: p
|
|
129
130
|
}), O, /* @__PURE__ */ l("div", {
|
|
130
|
-
children: [u &&
|
|
131
|
-
className:
|
|
131
|
+
children: [u && h.collaborators && /* @__PURE__ */ r(Be, {}), /* @__PURE__ */ r(me, {
|
|
132
|
+
className: he(c.label, k && c.modernized)
|
|
132
133
|
}), /* @__PURE__ */ r(_e, {
|
|
133
|
-
content:
|
|
134
|
+
content: f,
|
|
134
135
|
"data-testid": "user-contacts-tooltip",
|
|
135
|
-
open:
|
|
136
|
+
open: f ? void 0 : !1,
|
|
136
137
|
side: "bottom",
|
|
137
|
-
children: /* @__PURE__ */ r(
|
|
138
|
+
children: /* @__PURE__ */ r(Fe, {
|
|
138
139
|
focusable: b,
|
|
139
|
-
children: /* @__PURE__ */ r(
|
|
140
|
+
children: /* @__PURE__ */ r(ye, {
|
|
140
141
|
className: "collaboration-user-selector",
|
|
141
142
|
clearButtonAriaLabel: t(o.clearButton),
|
|
142
143
|
clearOnBlur: !1,
|
|
@@ -146,15 +147,15 @@ function at() {
|
|
|
146
147
|
fetchAvatarUrls: ne,
|
|
147
148
|
fetchUsers: ie,
|
|
148
149
|
hideOnEscape: re,
|
|
149
|
-
idForLabel:
|
|
150
|
+
idForLabel: A,
|
|
150
151
|
inputValue: T,
|
|
151
152
|
label: null,
|
|
152
153
|
onBlur: Z,
|
|
153
154
|
onInputValueChange: ae,
|
|
154
155
|
onPaste: se,
|
|
155
|
-
onSelectedUsersChange:
|
|
156
|
+
onSelectedUsersChange: p,
|
|
156
157
|
placeholder: i.length ? "" : t(o.invitePeoplePlaceholder),
|
|
157
|
-
portalElement:
|
|
158
|
+
portalElement: U,
|
|
158
159
|
selectedUsers: i,
|
|
159
160
|
selectOnEnterOrTab: !0,
|
|
160
161
|
variant: a ? "textarea" : "input"
|
|
@@ -162,39 +163,39 @@ function at() {
|
|
|
162
163
|
})
|
|
163
164
|
}), u && /* @__PURE__ */ l("div", {
|
|
164
165
|
className: c.access,
|
|
165
|
-
children: [
|
|
166
|
+
children: [h.collaborationRole && /* @__PURE__ */ r(Ee, {}), z]
|
|
166
167
|
})]
|
|
167
|
-
}), a &&
|
|
168
|
-
maxCount:
|
|
168
|
+
}), a && h.collaborationMessage && /* @__PURE__ */ r(Ne, {
|
|
169
|
+
maxCount: h.collaborationMessageLimit
|
|
169
170
|
}), a && oe && /* @__PURE__ */ l("div", {
|
|
170
171
|
className: c.security,
|
|
171
|
-
children: [/* @__PURE__ */ r(
|
|
172
|
+
children: [/* @__PURE__ */ r(xe, {
|
|
172
173
|
className: c.icon,
|
|
173
174
|
height: P,
|
|
174
175
|
width: P
|
|
175
|
-
}), /* @__PURE__ */ r(
|
|
176
|
+
}), /* @__PURE__ */ r(Le, {
|
|
176
177
|
as: "span",
|
|
177
178
|
color: "textOnLightSecondary",
|
|
178
179
|
children: t(o.contentSharedWithExternalCollaborators)
|
|
179
180
|
})]
|
|
180
|
-
}), a &&
|
|
181
|
-
children: [!W && /* @__PURE__ */ l(
|
|
182
|
-
children: [/* @__PURE__ */ r(
|
|
181
|
+
}), a && U && /* @__PURE__ */ be(/* @__PURE__ */ l(Re, {
|
|
182
|
+
children: [!W && /* @__PURE__ */ l(v.Footer, {
|
|
183
|
+
children: [/* @__PURE__ */ r(v.Footer.SecondaryButton, {
|
|
183
184
|
disabled: m,
|
|
184
185
|
onClick: le,
|
|
185
186
|
children: t(o.cancelButton)
|
|
186
|
-
}), /* @__PURE__ */ r(
|
|
187
|
+
}), /* @__PURE__ */ r(v.Footer.PrimaryButton, {
|
|
187
188
|
loading: m,
|
|
188
189
|
loadingAriaLabel: t(o.loadingLabel),
|
|
189
190
|
onClick: ce,
|
|
190
191
|
children: t(o.sendButton)
|
|
191
192
|
})]
|
|
192
|
-
}), !m && !te && /* @__PURE__ */ r(
|
|
193
|
+
}), !m && !te && /* @__PURE__ */ r(v.Close, {
|
|
193
194
|
"aria-label": t(o.closeButton)
|
|
194
195
|
})]
|
|
195
|
-
}),
|
|
196
|
+
}), U)]
|
|
196
197
|
});
|
|
197
198
|
}
|
|
198
199
|
export {
|
|
199
|
-
|
|
200
|
+
lt as CollaborationSection
|
|
200
201
|
};
|
|
@@ -1,52 +1,47 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { useUniqueId as
|
|
1
|
+
import { useState as g } from "react";
|
|
2
|
+
import { useIntl as f } from "react-intl";
|
|
3
|
+
import { useUniqueId as C, TextArea as p, Text as b } from "@box/blueprint-web";
|
|
4
4
|
import a from "./messages.js";
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import { useUnifiedShareModalContext as
|
|
7
|
-
import { useUnifiedShareFormContext as
|
|
8
|
-
import '../../../../../styles/text-area-container.css';const
|
|
9
|
-
textArea:
|
|
10
|
-
textCount:
|
|
5
|
+
import { jsxs as A, jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { useUnifiedShareModalContext as M } from "../../../contexts/unified-share-modal-context.js";
|
|
7
|
+
import { useUnifiedShareFormContext as _ } from "../../../contexts/unified-share-form-context.js";
|
|
8
|
+
import '../../../../../styles/text-area-container.css';const v = "_textArea_v76md_1", S = "_textCount_v76md_5", i = {
|
|
9
|
+
textArea: v,
|
|
10
|
+
textCount: S
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function N(m) {
|
|
13
13
|
const {
|
|
14
14
|
formatMessage: t
|
|
15
|
-
} =
|
|
15
|
+
} = f(), {
|
|
16
16
|
isSubmitting: l
|
|
17
|
+
} = M(), {
|
|
18
|
+
messageValue: c,
|
|
19
|
+
setMessageValue: u
|
|
17
20
|
} = _(), {
|
|
18
|
-
messageValue: m,
|
|
19
|
-
setMessageValue: x
|
|
20
|
-
} = v(), {
|
|
21
21
|
maxCount: e
|
|
22
|
-
} =
|
|
23
|
-
const n =
|
|
24
|
-
|
|
25
|
-
const r = e - n.length;
|
|
26
|
-
if (r < 0)
|
|
27
|
-
return;
|
|
28
|
-
d(r);
|
|
29
|
-
}
|
|
30
|
-
x(n);
|
|
22
|
+
} = m, [o, x] = g(e), s = C("text-count-"), d = (h) => {
|
|
23
|
+
const n = h.target.value;
|
|
24
|
+
typeof e == "number" && x(e - n.length), u(n);
|
|
31
25
|
};
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
className:
|
|
26
|
+
return /* @__PURE__ */ A("div", {
|
|
27
|
+
children: [/* @__PURE__ */ r(p, {
|
|
28
|
+
className: i.textArea,
|
|
35
29
|
disabled: l,
|
|
36
30
|
label: t(a.shareMessageLabel),
|
|
31
|
+
maxLength: e,
|
|
37
32
|
minRows: 3,
|
|
38
|
-
onChange:
|
|
33
|
+
onChange: d,
|
|
39
34
|
placeholder: t(a.shareMessagePlaceholder),
|
|
40
|
-
value:
|
|
35
|
+
value: c,
|
|
41
36
|
...e && {
|
|
42
37
|
"aria-describedby": s
|
|
43
38
|
}
|
|
44
|
-
}), !!e && /* @__PURE__ */
|
|
39
|
+
}), !!e && /* @__PURE__ */ r(b, {
|
|
45
40
|
"aria-label": t(a.shareMessageCharacterCountAriaLabel, {
|
|
46
41
|
count: o
|
|
47
42
|
}),
|
|
48
43
|
as: "span",
|
|
49
|
-
className:
|
|
44
|
+
className: i.textCount,
|
|
50
45
|
color: "textOnLightSecondary",
|
|
51
46
|
id: s,
|
|
52
47
|
children: o
|
|
@@ -54,5 +49,5 @@ function q(c) {
|
|
|
54
49
|
});
|
|
55
50
|
}
|
|
56
51
|
export {
|
|
57
|
-
|
|
52
|
+
N as TextAreaContainer
|
|
58
53
|
};
|
|
@@ -1,96 +1,95 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import A from "lodash/differenceBy";
|
|
2
|
+
import O from "lodash/uniqBy";
|
|
3
|
+
import { useCallback as l } from "react";
|
|
4
|
+
import { useUnifiedShareFormContext as M } from "../contexts/unified-share-form-context.js";
|
|
5
|
+
import { useUnifiedShareModalContext as P } from "../contexts/unified-share-modal-context.js";
|
|
6
|
+
import { useFormValidation as T } from "./use-form-validation.js";
|
|
7
|
+
import { useSharingAction as D } from "./use-sharing-action.js";
|
|
8
|
+
import { parseEmails as J } from "../utils/email.js";
|
|
9
|
+
const Z = (F, U) => {
|
|
8
10
|
const {
|
|
9
|
-
errors:
|
|
10
|
-
setFieldError:
|
|
11
|
-
validateCollaborationLimit:
|
|
12
|
-
validateUserContact:
|
|
11
|
+
errors: h,
|
|
12
|
+
setFieldError: a,
|
|
13
|
+
validateCollaborationLimit: c,
|
|
14
|
+
validateUserContact: g,
|
|
13
15
|
validateUserSelector: u
|
|
14
|
-
} =
|
|
15
|
-
config:
|
|
16
|
-
contactService:
|
|
17
|
-
} =
|
|
18
|
-
collaborationLimit:
|
|
19
|
-
} =
|
|
20
|
-
collaborationRole:
|
|
21
|
-
form:
|
|
22
|
-
messageValue:
|
|
16
|
+
} = T(), {
|
|
17
|
+
config: y,
|
|
18
|
+
contactService: w
|
|
19
|
+
} = P(), {
|
|
20
|
+
collaborationLimit: i
|
|
21
|
+
} = y, {
|
|
22
|
+
collaborationRole: E,
|
|
23
|
+
form: x,
|
|
24
|
+
messageValue: L,
|
|
23
25
|
setContactValue: m,
|
|
24
|
-
setMessageValue:
|
|
25
|
-
setUserContacts:
|
|
26
|
-
shieldRestriction:
|
|
27
|
-
userContacts:
|
|
28
|
-
} =
|
|
29
|
-
onAction:
|
|
30
|
-
} =
|
|
26
|
+
setMessageValue: R,
|
|
27
|
+
setUserContacts: f,
|
|
28
|
+
shieldRestriction: d,
|
|
29
|
+
userContacts: s
|
|
30
|
+
} = M(), {
|
|
31
|
+
onAction: V
|
|
32
|
+
} = D(F, U), {
|
|
31
33
|
getContactsByEmail: p
|
|
32
|
-
} =
|
|
33
|
-
|
|
34
|
-
}, B =
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
} = w, b = () => {
|
|
35
|
+
f([]), m(""), R(""), a("user-contact", "");
|
|
36
|
+
}, B = l((t) => {
|
|
37
|
+
c(s, i) || a("user-contact", ""), m(t);
|
|
38
|
+
}, [i, m, a, s, c]), S = l(async (t) => {
|
|
39
|
+
const n = {};
|
|
40
|
+
if (p && t.length > 0) {
|
|
41
|
+
const e = await p(t);
|
|
42
|
+
for (const o of Object.keys(e))
|
|
43
|
+
n[o.toLowerCase()] = e[o];
|
|
44
|
+
}
|
|
45
|
+
return t.map((e) => {
|
|
46
|
+
const o = n[e.toLowerCase()];
|
|
47
|
+
return o || {
|
|
48
|
+
email: e,
|
|
49
|
+
id: 0,
|
|
50
|
+
isExternalUser: !0,
|
|
51
|
+
name: e,
|
|
52
|
+
value: e
|
|
53
|
+
};
|
|
45
54
|
});
|
|
46
|
-
}, [p]),
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
if (t.length
|
|
50
|
-
|
|
51
|
-
else if (t[t.length - 1].id !== void 0)
|
|
52
|
-
a = [...o, t[t.length - 1]];
|
|
55
|
+
}, [p]), C = l(async (t) => {
|
|
56
|
+
a("user-contact", ""), u(t);
|
|
57
|
+
let n;
|
|
58
|
+
if (t.length <= s.length || t[t.length - 1].id !== void 0)
|
|
59
|
+
n = t;
|
|
53
60
|
else {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
const b = new Set(o.filter((n) => !!n.email).map((n) => n.email.toLowerCase())), T = e.filter((n) => {
|
|
60
|
-
const F = n.toLowerCase();
|
|
61
|
-
return b.has(F) ? !1 : (b.add(F), !0);
|
|
62
|
-
}), j = await S(T.map((n) => ({
|
|
63
|
-
value: n
|
|
64
|
-
})));
|
|
65
|
-
a = [...o, ...j];
|
|
61
|
+
const e = t.slice(0, -1), o = t[t.length - 1].value, v = J(o);
|
|
62
|
+
v.length === 0 && g(o);
|
|
63
|
+
const j = e.filter((r) => r.email).map((r) => r.email), k = O(A(v, j, (r) => r.toLowerCase()), (r) => r.toLowerCase()), q = await S(k);
|
|
64
|
+
n = [...e, ...q];
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
const
|
|
70
|
-
if (document.querySelector('div[role="listbox"][aria-labelledby^="user-contacts"]')?.contains(t.relatedTarget) ||
|
|
66
|
+
i && c(n, i), f(n);
|
|
67
|
+
}, [i, S, a, f, s, c, g, u]), I = l((t) => {
|
|
68
|
+
const n = t.relatedTarget?.closest(".collaboration-user-selector");
|
|
69
|
+
if (document.querySelector('div[role="listbox"][aria-labelledby^="user-contacts"]')?.contains(t.relatedTarget) || n)
|
|
71
70
|
return;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
value:
|
|
71
|
+
const o = t.target.value.trim();
|
|
72
|
+
o && C([...s, {
|
|
73
|
+
value: o
|
|
75
74
|
}]);
|
|
76
|
-
}, [
|
|
75
|
+
}, [C, s]);
|
|
77
76
|
return {
|
|
78
|
-
errors:
|
|
79
|
-
handleFormReset:
|
|
77
|
+
errors: h,
|
|
78
|
+
handleFormReset: b,
|
|
80
79
|
handleFormSubmit: async () => {
|
|
81
|
-
if (
|
|
80
|
+
if (h["user-contact"] || u(s))
|
|
82
81
|
return !0;
|
|
83
82
|
const t = {
|
|
84
|
-
contacts:
|
|
85
|
-
message:
|
|
83
|
+
contacts: s,
|
|
84
|
+
message: L
|
|
86
85
|
};
|
|
87
|
-
return
|
|
86
|
+
return x === "invite" && (t.role = E.id), d.isJustificationAllowed && (t.justificationReason = d.justificationReason, t.classificationId = d.classificationId), await V(t), b(), !1;
|
|
88
87
|
},
|
|
89
|
-
handleSelectedUsersChange:
|
|
88
|
+
handleSelectedUsersChange: C,
|
|
90
89
|
handleUserSelectorBlur: I,
|
|
91
90
|
updateContactValue: B
|
|
92
91
|
};
|
|
93
92
|
};
|
|
94
93
|
export {
|
|
95
|
-
|
|
94
|
+
Z as useCollaborationForm
|
|
96
95
|
};
|