@box/unified-share-modal 1.30.1 → 1.31.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/unified-share-form-modal/collaboration-section/collaboration-section.js +151 -109
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +38 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +128 -0
- package/dist/esm/lib/contexts/unified-share-form-context.js +36 -29
- package/dist/esm/lib/hooks/use-collaboration-form.js +51 -50
- package/dist/esm/lib/hooks/use-form-validation.js +38 -27
- package/dist/esm/lib/messages.js +8 -0
- package/dist/esm/lib/unified-share-modal.js +57 -55
- package/dist/esm/lib/utils/collaborator.js +7 -6
- package/dist/esm/lib/utils/index.js +24 -23
- package/dist/i18n/bn-IN.js +11 -0
- package/dist/i18n/da-DK.js +11 -0
- package/dist/i18n/de-DE.js +11 -0
- package/dist/i18n/en-AU.js +11 -0
- package/dist/i18n/en-CA.js +11 -0
- package/dist/i18n/en-GB.js +11 -0
- package/dist/i18n/en-US.js +11 -0
- package/dist/i18n/en-US.properties +22 -0
- package/dist/i18n/en-x-pseudo.js +11 -0
- package/dist/i18n/es-419.js +11 -0
- package/dist/i18n/es-ES.js +11 -0
- package/dist/i18n/fi-FI.js +11 -0
- package/dist/i18n/fr-CA.js +11 -0
- package/dist/i18n/fr-FR.js +11 -0
- package/dist/i18n/hi-IN.js +11 -0
- package/dist/i18n/it-IT.js +11 -0
- package/dist/i18n/ja-JP.js +11 -0
- package/dist/i18n/json/src/lib/components/unified-share-form-modal/collaboration-section/messages.json +1 -1
- package/dist/i18n/json/src/lib/messages.json +1 -1
- package/dist/i18n/ko-KR.js +11 -0
- package/dist/i18n/nb-NO.js +11 -0
- package/dist/i18n/nl-NL.js +11 -0
- package/dist/i18n/pl-PL.js +11 -0
- package/dist/i18n/pt-BR.js +11 -0
- package/dist/i18n/ru-RU.js +11 -0
- package/dist/i18n/sv-SE.js +11 -0
- package/dist/i18n/tr-TR.js +11 -0
- package/dist/i18n/zh-CN.js +11 -0
- package/dist/i18n/zh-TW.js +11 -0
- package/dist/styles/shield-restriction-notice.css +1 -0
- package/dist/types/lib/components/unified-share-form-modal/collaboration-section/messages.d.ts +45 -0
- package/dist/types/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.d.ts +8 -0
- package/dist/types/lib/contexts/unified-share-form-context.d.ts +3 -1
- package/dist/types/lib/contexts/unified-share-modal-context.d.ts +2 -1
- package/dist/types/lib/hooks/use-form-validation.d.ts +1 -0
- package/dist/types/lib/messages.d.ts +10 -0
- package/dist/types/lib/types.d.ts +83 -7
- package/dist/types/lib/unified-share-modal.d.ts +2 -1
- package/dist/types/lib/utils/collaborator.d.ts +3 -1
- package/package.json +2 -2
|
@@ -1,128 +1,170 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { useUniqueId as
|
|
5
|
-
import { UserSelectorContainer as
|
|
6
|
-
import { CollaborationRole as
|
|
7
|
-
import { SharedWithAvatars as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { useState as se, useRef as le, useEffect as T, useCallback as U } from "react";
|
|
2
|
+
import { createPortal as ce } from "react-dom";
|
|
3
|
+
import { useIntl as de } from "react-intl";
|
|
4
|
+
import { useNotification as ue, useUniqueId as me, useLabelable as fe, Tooltip as he, Focusable as pe, Modal as m } from "@box/blueprint-web";
|
|
5
|
+
import { UserSelectorContainer as be } from "@box/user-selector";
|
|
6
|
+
import { CollaborationRole as Ce } from "./collaboration-role.js";
|
|
7
|
+
import { SharedWithAvatars as ge } from "./shared-with-avatars.js";
|
|
8
|
+
import { ShieldRestrictionNotice as ve } from "./shield-restriction-notice.js";
|
|
9
|
+
import { TextAreaContainer as Se } from "./text-area-container.js";
|
|
10
|
+
import { COLLABORATION_MESSAGE_CHARACTER_LIMIT as Le } from "../../../constants.js";
|
|
11
|
+
import o from "./messages.js";
|
|
12
|
+
import { jsxs as f, jsx as r, Fragment as Fe } from "react/jsx-runtime";
|
|
13
|
+
import { useFormValidation as Ue } from "../../../hooks/use-form-validation.js";
|
|
14
|
+
import { useCollaborationForm as Ae } from "../../../hooks/use-collaboration-form.js";
|
|
15
|
+
import { useUnifiedShareFormContext as Be } from "../../../contexts/unified-share-form-context.js";
|
|
16
|
+
import { useUnifiedShareModalContext as Ve } from "../../../contexts/unified-share-modal-context.js";
|
|
17
|
+
import '../../../../../styles/collaboration-section.css';const ye = "_container_1o05j_2", Ee = "_label_1o05j_8", x = {
|
|
18
|
+
container: ye,
|
|
19
|
+
label: Ee
|
|
18
20
|
};
|
|
19
|
-
function
|
|
21
|
+
function He() {
|
|
20
22
|
const {
|
|
21
|
-
formatMessage:
|
|
22
|
-
} =
|
|
23
|
-
|
|
24
|
-
container: d,
|
|
25
|
-
onModalOpenChange: S,
|
|
26
|
-
onShareViewChange: f,
|
|
27
|
-
shareView: a,
|
|
28
|
-
userContacts: F
|
|
23
|
+
formatMessage: t
|
|
24
|
+
} = de(), [h, A] = se(), {
|
|
25
|
+
addNotification: N
|
|
29
26
|
} = ue(), {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
validateShieldRestriction: _
|
|
28
|
+
} = Ue(), {
|
|
29
|
+
contactValue: P,
|
|
30
|
+
container: p,
|
|
31
|
+
onModalOpenChange: B,
|
|
32
|
+
onShareViewChange: b,
|
|
33
|
+
setUserContacts: k,
|
|
34
|
+
shareView: i,
|
|
35
|
+
userContacts: n
|
|
36
|
+
} = Be(), {
|
|
37
|
+
collaborationNotices: M,
|
|
38
|
+
config: C,
|
|
39
|
+
contactService: O,
|
|
40
|
+
isFetching: w,
|
|
41
|
+
isSubmitting: j,
|
|
42
|
+
item: D,
|
|
43
|
+
sharingService: G
|
|
44
|
+
} = Ve(), {
|
|
45
|
+
permissions: W = {},
|
|
46
|
+
type: q
|
|
47
|
+
} = D, {
|
|
48
|
+
getContacts: g,
|
|
49
|
+
getContactsAvatarUrls: v
|
|
50
|
+
} = O, {
|
|
51
|
+
sendInvitations: H,
|
|
52
|
+
sendSharedLink: K
|
|
53
|
+
} = G;
|
|
54
|
+
let S, L;
|
|
55
|
+
i === "invite" && (S = H, L = "invite-collaborators"), i === "email" && (S = K, L = "email-shared-link");
|
|
48
56
|
const {
|
|
49
|
-
errors:
|
|
50
|
-
handleFormReset:
|
|
51
|
-
handleFormSubmit:
|
|
52
|
-
handleSelectedUsersChange:
|
|
53
|
-
handleUserSelectorBlur:
|
|
54
|
-
isFormSubmitting:
|
|
55
|
-
updateContactValue:
|
|
56
|
-
} =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
57
|
+
errors: $,
|
|
58
|
+
handleFormReset: V,
|
|
59
|
+
handleFormSubmit: z,
|
|
60
|
+
handleSelectedUsersChange: y,
|
|
61
|
+
handleUserSelectorBlur: J,
|
|
62
|
+
isFormSubmitting: Q,
|
|
63
|
+
updateContactValue: X
|
|
64
|
+
} = Ae(S, L), a = i === "default" || i === "invite", s = i === "invite" || i === "email", l = j ?? Q, E = le(i === "email" ? "email" : "invite");
|
|
65
|
+
T(() => {
|
|
66
|
+
E.current = i === "email" ? "email" : "invite";
|
|
67
|
+
}, [i]), T(() => {
|
|
68
|
+
(!n.length || !n.some((e) => e.chipVariant === "error")) && A(null);
|
|
69
|
+
}, [n]);
|
|
70
|
+
const Y = U((e) => (e.stopPropagation(), !0), []), Z = U((e) => g ? g(e, E.current) : Promise.resolve([]), [g]), ee = U((e) => v ? v(e) : Promise.resolve({}), [v]), te = (e) => {
|
|
71
|
+
s || b("invite"), X(e);
|
|
72
|
+
}, oe = () => {
|
|
73
|
+
V(), b("default");
|
|
74
|
+
}, re = async () => {
|
|
75
|
+
try {
|
|
76
|
+
if (h) {
|
|
77
|
+
const e = _(n);
|
|
78
|
+
if (e) {
|
|
79
|
+
N({
|
|
80
|
+
closeButtonAriaLabel: t(o.closeButton),
|
|
81
|
+
sensitivity: "foreground",
|
|
82
|
+
styledText: e,
|
|
83
|
+
typeIconAriaLabel: t(o.errorNoticeIconAriaLabel),
|
|
84
|
+
variant: "error"
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (await z())
|
|
90
|
+
return;
|
|
91
|
+
V(), B && B(!1), b("default");
|
|
92
|
+
} catch (e) {
|
|
93
|
+
if (!e.shieldRestriction)
|
|
94
|
+
return;
|
|
95
|
+
const {
|
|
96
|
+
shieldRestriction: F
|
|
97
|
+
} = e, R = [...F.restrictedEmails ?? [], ...F.restrictedGroups ?? []], ae = n.map((u) => R.includes(u.email) || R.includes(`${u.id}`) ? {
|
|
98
|
+
...u,
|
|
99
|
+
chipVariant: "error"
|
|
100
|
+
} : u);
|
|
101
|
+
A(F), k(ae);
|
|
102
|
+
}
|
|
66
103
|
};
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
className:
|
|
72
|
-
onSubmit: (
|
|
73
|
-
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
104
|
+
let c, d = !1;
|
|
105
|
+
a && !W.canInviteCollaborator && (c = t(o.inviteDisabledTooltip), d = !0), a && q === "web_link" && (c = t(o.inviteWebLinkDisabledTooltip), d = !0);
|
|
106
|
+
const I = me("user-contacts-"), ie = t(a ? o.invitePeopleLabel : o.emailSharedLinkLabel), ne = fe(ie, I);
|
|
107
|
+
return /* @__PURE__ */ f("form", {
|
|
108
|
+
className: x.container,
|
|
109
|
+
onSubmit: (e) => e.preventDefault(),
|
|
110
|
+
children: [h && /* @__PURE__ */ r(ve, {
|
|
111
|
+
error: h,
|
|
112
|
+
isLoading: l,
|
|
113
|
+
onSelectedUsersChange: y
|
|
114
|
+
}), M, /* @__PURE__ */ f("div", {
|
|
115
|
+
children: [a && C.collaborators && /* @__PURE__ */ r(ge, {}), /* @__PURE__ */ r(ne, {
|
|
116
|
+
className: x.label
|
|
117
|
+
}), /* @__PURE__ */ r(he, {
|
|
118
|
+
content: c,
|
|
78
119
|
"data-testid": "user-contacts-tooltip",
|
|
79
|
-
open:
|
|
120
|
+
open: c ? void 0 : !1,
|
|
80
121
|
side: "bottom",
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
focusable:
|
|
83
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ r(pe, {
|
|
123
|
+
focusable: d,
|
|
124
|
+
children: /* @__PURE__ */ r(be, {
|
|
84
125
|
className: "collaboration-user-selector",
|
|
85
|
-
clearButtonAriaLabel:
|
|
126
|
+
clearButtonAriaLabel: t(o.clearButton),
|
|
86
127
|
clearOnBlur: !1,
|
|
87
|
-
disabled:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
128
|
+
disabled: d || l,
|
|
129
|
+
displayChipVariant: (e) => e.chipVariant,
|
|
130
|
+
error: $["user-contact"],
|
|
131
|
+
fetchAvatarUrls: ee,
|
|
132
|
+
fetchUsers: Z,
|
|
133
|
+
hideOnEscape: Y,
|
|
134
|
+
idForLabel: I,
|
|
135
|
+
inputValue: P,
|
|
94
136
|
label: null,
|
|
95
|
-
onBlur:
|
|
96
|
-
onInputValueChange:
|
|
97
|
-
onSelectedUsersChange:
|
|
98
|
-
placeholder:
|
|
99
|
-
portalElement:
|
|
100
|
-
selectedUsers:
|
|
137
|
+
onBlur: J,
|
|
138
|
+
onInputValueChange: te,
|
|
139
|
+
onSelectedUsersChange: y,
|
|
140
|
+
placeholder: n.length ? "" : t(o.invitePeoplePlaceholder),
|
|
141
|
+
portalElement: p,
|
|
142
|
+
selectedUsers: n,
|
|
101
143
|
selectOnEnterOrTab: !0,
|
|
102
|
-
variant:
|
|
144
|
+
variant: s ? "textarea" : "input"
|
|
103
145
|
})
|
|
104
146
|
})
|
|
105
|
-
}),
|
|
106
|
-
}),
|
|
107
|
-
maxCount:
|
|
108
|
-
}),
|
|
109
|
-
children: [!
|
|
110
|
-
children: [/* @__PURE__ */
|
|
111
|
-
disabled:
|
|
112
|
-
onClick:
|
|
113
|
-
children:
|
|
114
|
-
}), /* @__PURE__ */
|
|
115
|
-
loading:
|
|
116
|
-
loadingAriaLabel:
|
|
117
|
-
onClick:
|
|
118
|
-
children:
|
|
147
|
+
}), a && C.collaborationRole && /* @__PURE__ */ r(Ce, {})]
|
|
148
|
+
}), s && C.collaborationMessage && /* @__PURE__ */ r(Se, {
|
|
149
|
+
maxCount: Le
|
|
150
|
+
}), s && p && /* @__PURE__ */ ce(/* @__PURE__ */ f(Fe, {
|
|
151
|
+
children: [!w && /* @__PURE__ */ f(m.Footer, {
|
|
152
|
+
children: [/* @__PURE__ */ r(m.Footer.SecondaryButton, {
|
|
153
|
+
disabled: l,
|
|
154
|
+
onClick: oe,
|
|
155
|
+
children: t(o.cancelButton)
|
|
156
|
+
}), /* @__PURE__ */ r(m.Footer.PrimaryButton, {
|
|
157
|
+
loading: l,
|
|
158
|
+
loadingAriaLabel: t(o.loadingLabel),
|
|
159
|
+
onClick: re,
|
|
160
|
+
children: t(o.sendButton)
|
|
119
161
|
})]
|
|
120
|
-
}), /* @__PURE__ */
|
|
121
|
-
"aria-label":
|
|
162
|
+
}), /* @__PURE__ */ r(m.Close, {
|
|
163
|
+
"aria-label": t(o.closeButton)
|
|
122
164
|
})]
|
|
123
|
-
}),
|
|
165
|
+
}), p)]
|
|
124
166
|
});
|
|
125
167
|
}
|
|
126
168
|
export {
|
|
127
|
-
|
|
169
|
+
He as CollaborationSection
|
|
128
170
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
const
|
|
2
|
+
const a = e({
|
|
3
3
|
cancelButton: {
|
|
4
4
|
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.cancelButton",
|
|
5
5
|
defaultMessage: "Cancel"
|
|
@@ -91,8 +91,44 @@ const o = e({
|
|
|
91
91
|
inviteWebLinkDisabledTooltip: {
|
|
92
92
|
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteWebLinkDisabledTooltip",
|
|
93
93
|
defaultMessage: "Collaborators cannot be added to bookmarks"
|
|
94
|
+
},
|
|
95
|
+
justifiableContactRestrictionNotice: {
|
|
96
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionNotice",
|
|
97
|
+
defaultMessage: "This content requires a business justification for {count, plural, one {{count} invitation} other {{count} invitations}}. Please select a business justification below. {justificationSelect} {removeLink}"
|
|
98
|
+
},
|
|
99
|
+
justifiableContactRestrictionRemoveButtonLabel: {
|
|
100
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionRemoveButtonLabel",
|
|
101
|
+
defaultMessage: "Alternatively, remove to continue"
|
|
102
|
+
},
|
|
103
|
+
contactRestrictionNotice: {
|
|
104
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionNotice",
|
|
105
|
+
defaultMessage: "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent because external collaboration is restricted due to the applied security policy. {removeLink}"
|
|
106
|
+
},
|
|
107
|
+
contactRestrictionInformationBarrierNotice: {
|
|
108
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionInformationBarrierNotice",
|
|
109
|
+
defaultMessage: "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent due to a security policy. {removeLink}"
|
|
110
|
+
},
|
|
111
|
+
contactRestrictionRemoveButtonLabel: {
|
|
112
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionRemoveButtonLabel",
|
|
113
|
+
defaultMessage: "Remove to continue"
|
|
114
|
+
},
|
|
115
|
+
justificationSelectPlaceholder: {
|
|
116
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justificationSelectPlaceholder",
|
|
117
|
+
defaultMessage: "Select Justification"
|
|
118
|
+
},
|
|
119
|
+
loadingJustificationReasonsLabel: {
|
|
120
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingJustificationReasonsLabel",
|
|
121
|
+
defaultMessage: "Loading justification reasons"
|
|
122
|
+
},
|
|
123
|
+
errorNoticeIconAriaLabel: {
|
|
124
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.errorNoticeIconAriaLabel",
|
|
125
|
+
defaultMessage: "Error"
|
|
126
|
+
},
|
|
127
|
+
businessJustification: {
|
|
128
|
+
id: "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.businessJustification",
|
|
129
|
+
defaultMessage: "Business Justification"
|
|
94
130
|
}
|
|
95
131
|
});
|
|
96
132
|
export {
|
|
97
|
-
|
|
133
|
+
a as default
|
|
98
134
|
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import K from "lodash/partition";
|
|
2
|
+
import { useState as C, useEffect as S } from "react";
|
|
3
|
+
import { useIntl as O, FormattedMessage as P } from "react-intl";
|
|
4
|
+
import { LoadingIndicator as z, Select as m, Link as G, InlineNotice as T } from "@box/blueprint-web";
|
|
5
|
+
import t from "./messages.js";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
import { isCollaboratorRestricted as V } from "../../../utils/collaborator.js";
|
|
8
|
+
import { useUnifiedShareFormContext as q } from "../../../contexts/unified-share-form-context.js";
|
|
9
|
+
import { useUnifiedShareModalContext as H } from "../../../contexts/unified-share-modal-context.js";
|
|
10
|
+
import { callOnKeyboardEvent as Q } from "../../../utils/event.js";
|
|
11
|
+
import '../../../../../styles/shield-restriction-notice.css';const W = "_select_27xpi_1", X = "_link_27xpi_5", k = {
|
|
12
|
+
select: W,
|
|
13
|
+
link: X
|
|
14
|
+
};
|
|
15
|
+
function ct({
|
|
16
|
+
error: L,
|
|
17
|
+
isLoading: d,
|
|
18
|
+
onSelectedUsersChange: J
|
|
19
|
+
}) {
|
|
20
|
+
const {
|
|
21
|
+
formatMessage: s
|
|
22
|
+
} = O(), [j, h] = C(!1), [a, I] = C([]), {
|
|
23
|
+
setShieldRestriction: o,
|
|
24
|
+
setUserContacts: N,
|
|
25
|
+
shieldRestriction: x,
|
|
26
|
+
userContacts: y
|
|
27
|
+
} = q(), {
|
|
28
|
+
eventService: _,
|
|
29
|
+
item: R,
|
|
30
|
+
contactService: w
|
|
31
|
+
} = H(), {
|
|
32
|
+
getJustificationReasons: r
|
|
33
|
+
} = w, {
|
|
34
|
+
onRestrictedUsersRemoveClick: g
|
|
35
|
+
} = _, {
|
|
36
|
+
isJustificationAllowed: c,
|
|
37
|
+
restrictionType: A,
|
|
38
|
+
restrictedEmails: v = [],
|
|
39
|
+
restrictedGroups: b = []
|
|
40
|
+
} = L, l = [...v, ...b];
|
|
41
|
+
S(() => (c && o({
|
|
42
|
+
isJustificationAllowed: !0
|
|
43
|
+
}), () => {
|
|
44
|
+
o({
|
|
45
|
+
isJustificationAllowed: !1
|
|
46
|
+
});
|
|
47
|
+
}), [c, o]), S(() => {
|
|
48
|
+
(async () => {
|
|
49
|
+
if (!(!r || a.length))
|
|
50
|
+
try {
|
|
51
|
+
h(!0);
|
|
52
|
+
const {
|
|
53
|
+
classificationId: n,
|
|
54
|
+
options: u
|
|
55
|
+
} = await r(R);
|
|
56
|
+
o({
|
|
57
|
+
classificationId: n
|
|
58
|
+
}), I(u);
|
|
59
|
+
} finally {
|
|
60
|
+
h(!1);
|
|
61
|
+
}
|
|
62
|
+
})();
|
|
63
|
+
}, [R, r, c, a, o]);
|
|
64
|
+
const B = c ? t.justifiableContactRestrictionRemoveButtonLabel : t.contactRestrictionRemoveButtonLabel, p = () => {
|
|
65
|
+
const [e, n] = K(y, (u) => V(u, v, b));
|
|
66
|
+
J(n), N(n), g && g(e);
|
|
67
|
+
}, F = (e) => {
|
|
68
|
+
o({
|
|
69
|
+
justificationReason: a.find((n) => n.id === e)
|
|
70
|
+
});
|
|
71
|
+
}, M = j ? /* @__PURE__ */ i(z, {
|
|
72
|
+
"aria-label": s(t.loadingJustificationReasonsLabel),
|
|
73
|
+
size: "small"
|
|
74
|
+
}) : /* @__PURE__ */ i(m, {
|
|
75
|
+
className: k.select,
|
|
76
|
+
hideLabel: !0,
|
|
77
|
+
label: s(t.businessJustification),
|
|
78
|
+
onValueChange: F,
|
|
79
|
+
placeholder: s(t.justificationSelectPlaceholder),
|
|
80
|
+
value: x.justificationReason?.id,
|
|
81
|
+
children: /* @__PURE__ */ i(m.Content, {
|
|
82
|
+
align: "start",
|
|
83
|
+
children: a.map((e) => /* @__PURE__ */ i(m.Option, {
|
|
84
|
+
text: e.title,
|
|
85
|
+
value: e.id
|
|
86
|
+
}, e.id))
|
|
87
|
+
})
|
|
88
|
+
}), f = /* @__PURE__ */ i(G, {
|
|
89
|
+
"aria-disabled": d,
|
|
90
|
+
className: k.link,
|
|
91
|
+
onClick: p,
|
|
92
|
+
onKeyDown: Q(p, {
|
|
93
|
+
canPreventDefault: !0
|
|
94
|
+
}),
|
|
95
|
+
role: "button",
|
|
96
|
+
tabIndex: d ? -1 : 0,
|
|
97
|
+
children: s(B)
|
|
98
|
+
}), U = () => A === "information_barrier" ? {
|
|
99
|
+
message: t.contactRestrictionInformationBarrierNotice,
|
|
100
|
+
count: l.length,
|
|
101
|
+
removeLink: f
|
|
102
|
+
} : c && a?.length > 0 ? {
|
|
103
|
+
message: t.justifiableContactRestrictionNotice,
|
|
104
|
+
count: l.length,
|
|
105
|
+
justificationSelect: M,
|
|
106
|
+
removeLink: f
|
|
107
|
+
} : {
|
|
108
|
+
message: t.contactRestrictionNotice,
|
|
109
|
+
count: l.length,
|
|
110
|
+
removeLink: f
|
|
111
|
+
}, {
|
|
112
|
+
message: E,
|
|
113
|
+
...D
|
|
114
|
+
} = U();
|
|
115
|
+
return /* @__PURE__ */ i(T, {
|
|
116
|
+
icon: () => null,
|
|
117
|
+
role: "alert",
|
|
118
|
+
variant: "error",
|
|
119
|
+
variantIconAriaLabel: s(t.errorNoticeIconAriaLabel),
|
|
120
|
+
children: /* @__PURE__ */ i(P, {
|
|
121
|
+
...E,
|
|
122
|
+
values: D
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
ct as ShieldRestrictionNotice
|
|
128
|
+
};
|
|
@@ -1,41 +1,48 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
import { jsx as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
1
|
+
import { createContext as P, useContext as p, useState as t, useCallback as V, useMemo as j } from "react";
|
|
2
|
+
import { jsx as k } from "react/jsx-runtime";
|
|
3
|
+
const x = /* @__PURE__ */ P({}), q = () => {
|
|
4
|
+
const e = p(x);
|
|
5
|
+
if (!e)
|
|
6
6
|
throw new Error("useUnifiedShareFormContext must be used with UnifiedShareFormProvider");
|
|
7
|
-
return
|
|
8
|
-
},
|
|
9
|
-
children:
|
|
7
|
+
return e;
|
|
8
|
+
}, w = ({
|
|
9
|
+
children: e,
|
|
10
10
|
container: o,
|
|
11
|
-
initialContacts:
|
|
12
|
-
onModalOpenChange:
|
|
13
|
-
onModalViewChange:
|
|
11
|
+
initialContacts: f,
|
|
12
|
+
onModalOpenChange: s,
|
|
13
|
+
onModalViewChange: r,
|
|
14
14
|
onShareViewChange: n,
|
|
15
|
-
shareView:
|
|
15
|
+
shareView: i
|
|
16
16
|
}) => {
|
|
17
|
-
const [
|
|
18
|
-
|
|
17
|
+
const [c, h] = t(f), [a, C] = t(""), [l, S] = t(""), [u, R] = t(), [d, U] = t({}), m = V((b) => {
|
|
18
|
+
U((v) => ({
|
|
19
|
+
...v,
|
|
20
|
+
...b
|
|
21
|
+
}));
|
|
22
|
+
}, []), F = j(() => ({
|
|
23
|
+
collaborationRole: u,
|
|
19
24
|
contactValue: a,
|
|
20
25
|
container: o,
|
|
21
|
-
messageValue:
|
|
22
|
-
onModalOpenChange:
|
|
23
|
-
onModalViewChange:
|
|
26
|
+
messageValue: l,
|
|
27
|
+
onModalOpenChange: s,
|
|
28
|
+
onModalViewChange: r,
|
|
24
29
|
onShareViewChange: n,
|
|
25
|
-
setCollaborationRole:
|
|
26
|
-
setContactValue:
|
|
27
|
-
setMessageValue:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
setCollaborationRole: R,
|
|
31
|
+
setContactValue: C,
|
|
32
|
+
setMessageValue: S,
|
|
33
|
+
setShieldRestriction: m,
|
|
34
|
+
setUserContacts: h,
|
|
35
|
+
shareView: i,
|
|
36
|
+
shieldRestriction: d,
|
|
37
|
+
userContacts: c
|
|
38
|
+
}), [u, a, o, m, l, s, r, n, i, d, c]);
|
|
39
|
+
return /* @__PURE__ */ k(x.Provider, {
|
|
33
40
|
value: F,
|
|
34
|
-
children:
|
|
41
|
+
children: e
|
|
35
42
|
});
|
|
36
43
|
};
|
|
37
44
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
x as UnifiedShareFormContext,
|
|
46
|
+
w as UnifiedShareFormProvider,
|
|
47
|
+
q as useUnifiedShareFormContext
|
|
41
48
|
};
|