@box/unified-share-modal 0.48.9 → 0.49.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/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/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 +15 -9
- package/dist/i18n/bn-IN.properties +14 -0
- package/dist/i18n/da-DK.js +15 -9
- package/dist/i18n/da-DK.properties +14 -0
- package/dist/i18n/de-DE.js +15 -9
- package/dist/i18n/de-DE.properties +14 -0
- package/dist/i18n/en-AU.js +8 -2
- package/dist/i18n/en-AU.properties +14 -0
- package/dist/i18n/en-CA.js +8 -2
- package/dist/i18n/en-CA.properties +14 -0
- package/dist/i18n/en-GB.js +8 -2
- package/dist/i18n/en-GB.properties +14 -0
- 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 +123 -109
- package/dist/i18n/es-419.js +15 -9
- package/dist/i18n/es-419.properties +14 -0
- package/dist/i18n/es-ES.js +15 -9
- package/dist/i18n/es-ES.properties +14 -0
- package/dist/i18n/fi-FI.js +15 -9
- package/dist/i18n/fi-FI.properties +14 -0
- package/dist/i18n/fr-CA.js +15 -9
- package/dist/i18n/fr-CA.properties +14 -0
- package/dist/i18n/fr-FR.js +15 -9
- package/dist/i18n/fr-FR.properties +14 -0
- package/dist/i18n/hi-IN.js +15 -9
- package/dist/i18n/hi-IN.properties +14 -0
- package/dist/i18n/it-IT.js +15 -9
- package/dist/i18n/it-IT.properties +14 -0
- package/dist/i18n/ja-JP.js +15 -9
- package/dist/i18n/ja-JP.properties +14 -0
- 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 +15 -9
- package/dist/i18n/ko-KR.properties +14 -0
- package/dist/i18n/nb-NO.js +15 -9
- package/dist/i18n/nb-NO.properties +14 -0
- package/dist/i18n/nl-NL.js +15 -9
- package/dist/i18n/nl-NL.properties +14 -0
- package/dist/i18n/pl-PL.js +15 -9
- package/dist/i18n/pl-PL.properties +14 -0
- package/dist/i18n/pt-BR.js +15 -9
- package/dist/i18n/pt-BR.properties +14 -0
- package/dist/i18n/ru-RU.js +15 -9
- package/dist/i18n/ru-RU.properties +14 -0
- package/dist/i18n/sv-SE.js +15 -9
- package/dist/i18n/sv-SE.properties +14 -0
- package/dist/i18n/tr-TR.js +15 -9
- package/dist/i18n/tr-TR.properties +14 -0
- package/dist/i18n/zh-CN.js +15 -9
- package/dist/i18n/zh-CN.properties +14 -0
- package/dist/i18n/zh-TW.js +15 -9
- package/dist/i18n/zh-TW.properties +14 -0
- package/dist/styles/collaboration-role.css +1 -1
- package/dist/styles/shared-link-section.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 +5 -0
- package/package.json +2 -2
|
@@ -31,7 +31,7 @@ const t = e({
|
|
|
31
31
|
// Link Expiration settings
|
|
32
32
|
linkExpirationCalendarAriaLabel: {
|
|
33
33
|
id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationCalendarAriaLabel",
|
|
34
|
-
defaultMessage: "Select
|
|
34
|
+
defaultMessage: "Select an expiration date"
|
|
35
35
|
},
|
|
36
36
|
linkExpirationClearDatePickerAriaLabel: {
|
|
37
37
|
id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationClearDatePickerAriaLabel",
|
|
@@ -58,10 +58,6 @@ const t = e({
|
|
|
58
58
|
defaultMessage: "Link expiration"
|
|
59
59
|
},
|
|
60
60
|
// Vanity Domain Settings
|
|
61
|
-
vanityNameInvalidError: {
|
|
62
|
-
id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInvalidError",
|
|
63
|
-
defaultMessage: "Custom URLs should be between 12-30 characters, and can include letters, numbers, and hyphens."
|
|
64
|
-
},
|
|
65
61
|
vanityNameToggleText: {
|
|
66
62
|
id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameToggleText",
|
|
67
63
|
defaultMessage: "Publish content broadly with a custom, non-private URL"
|
|
@@ -98,7 +94,7 @@ const t = e({
|
|
|
98
94
|
},
|
|
99
95
|
passwordWarningText: {
|
|
100
96
|
id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordWarningText",
|
|
101
|
-
defaultMessage: "
|
|
97
|
+
defaultMessage: "Passwords must include at least 8 characters, and must contain at least one upper case letter, number, or special character."
|
|
102
98
|
}
|
|
103
99
|
});
|
|
104
100
|
export {
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { Modal as r, Text as C, Link as
|
|
1
|
+
import { useMemo as H } from "react";
|
|
2
|
+
import { useIntl as q } from "react-intl";
|
|
3
|
+
import { Modal as r, Text as C, Link as G, Switch as h, DateI18nProvider as J, DatePicker as K, InlineNotice as E, TextInput as k } from "@box/blueprint-web";
|
|
4
4
|
import e from "./messages.js";
|
|
5
|
-
import { jsx as n, jsxs as d, Fragment as
|
|
6
|
-
import { useAccessLevels as
|
|
7
|
-
import { formatDateFromTimestampToCalendarDate as
|
|
8
|
-
import { useLinkSettingsForm as
|
|
9
|
-
import { useUnifiedShareModalContext as
|
|
10
|
-
import '../../../../styles/shared-link-settings-modal.css';const
|
|
11
|
-
content:
|
|
12
|
-
body:
|
|
13
|
-
},
|
|
14
|
-
function
|
|
15
|
-
isOpen:
|
|
5
|
+
import { jsx as n, jsxs as d, Fragment as L } from "react/jsx-runtime";
|
|
6
|
+
import { useAccessLevels as Q } from "../../hooks/use-access-levels.js";
|
|
7
|
+
import { formatDateFromTimestampToCalendarDate as X, formatTomorrowDateToCalendarDate as Y } from "../../utils/date.js";
|
|
8
|
+
import { useLinkSettingsForm as Z } from "../../hooks/use-link-settings-form.js";
|
|
9
|
+
import { useUnifiedShareModalContext as aa } from "../../contexts/unified-share-modal-context.js";
|
|
10
|
+
import '../../../../styles/shared-link-settings-modal.css';const ea = "_content_1wiic_1", na = "_body_1wiic_5", S = {
|
|
11
|
+
content: ea,
|
|
12
|
+
body: na
|
|
13
|
+
}, ia = "••••••••";
|
|
14
|
+
function ga({
|
|
15
|
+
isOpen: D,
|
|
16
16
|
onOpenChange: m
|
|
17
17
|
}) {
|
|
18
18
|
const {
|
|
19
19
|
formatMessage: a
|
|
20
|
-
} =
|
|
21
|
-
eventService:
|
|
22
|
-
isSubmitting:
|
|
20
|
+
} = q(), {
|
|
21
|
+
eventService: N,
|
|
22
|
+
isSubmitting: P,
|
|
23
23
|
sharedLink: f
|
|
24
|
-
} =
|
|
25
|
-
expiresAt:
|
|
24
|
+
} = aa(), {
|
|
25
|
+
expiresAt: c = 0,
|
|
26
26
|
settings: i = {},
|
|
27
|
-
vanityDomain:
|
|
28
|
-
vanityName:
|
|
27
|
+
vanityDomain: T = "",
|
|
28
|
+
vanityName: g = ""
|
|
29
29
|
} = f, {
|
|
30
|
-
onSharedLinkSettingsClose:
|
|
31
|
-
} =
|
|
32
|
-
selectedAccess:
|
|
33
|
-
} =
|
|
34
|
-
expiration:
|
|
30
|
+
onSharedLinkSettingsClose: w
|
|
31
|
+
} = N, {
|
|
32
|
+
selectedAccess: b
|
|
33
|
+
} = Q(), p = H(() => ({
|
|
34
|
+
expiration: c ? X(c) : null,
|
|
35
35
|
isDownloadEnabled: !!i.isDownloadEnabled,
|
|
36
|
-
isExpirationEnabled: !!
|
|
36
|
+
isExpirationEnabled: !!c,
|
|
37
37
|
isPasswordEnabled: !!i.isPasswordEnabled,
|
|
38
|
-
isVanityNameEnabled: !!
|
|
38
|
+
isVanityNameEnabled: !!g,
|
|
39
39
|
password: "",
|
|
40
|
-
vanityName:
|
|
41
|
-
}), [
|
|
40
|
+
vanityName: g
|
|
41
|
+
}), [c, i, g]), {
|
|
42
42
|
errors: u,
|
|
43
43
|
formData: t,
|
|
44
|
-
handleFormReset:
|
|
45
|
-
handleFormSubmit:
|
|
46
|
-
isUpdating:
|
|
44
|
+
handleFormReset: v,
|
|
45
|
+
handleFormSubmit: A,
|
|
46
|
+
isUpdating: I,
|
|
47
47
|
setFieldError: l,
|
|
48
48
|
setFieldValue: s,
|
|
49
|
-
validatePassword:
|
|
50
|
-
} =
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
await
|
|
54
|
-
},
|
|
49
|
+
validatePassword: F
|
|
50
|
+
} = Z(p), V = () => {
|
|
51
|
+
v(), w && w(), m(!1);
|
|
52
|
+
}, B = async () => {
|
|
53
|
+
await A() || (v(), m(!1));
|
|
54
|
+
}, M = (o) => {
|
|
55
55
|
l("expiration", void 0), s("isExpirationEnabled", o);
|
|
56
|
-
},
|
|
56
|
+
}, _ = (o) => {
|
|
57
57
|
l("expiration", void 0), s("expiration", o);
|
|
58
|
-
},
|
|
58
|
+
}, U = (o) => {
|
|
59
59
|
l("vanityName", void 0), s("isVanityNameEnabled", o);
|
|
60
|
-
},
|
|
60
|
+
}, O = (o) => {
|
|
61
61
|
l("vanityName", void 0), s("vanityName", o.target.value);
|
|
62
|
-
},
|
|
62
|
+
}, R = (o) => {
|
|
63
63
|
l("password", void 0), s("isPasswordEnabled", o);
|
|
64
|
-
},
|
|
64
|
+
}, W = (o) => {
|
|
65
65
|
l("password", void 0), s("password", o.target.value);
|
|
66
|
-
},
|
|
66
|
+
}, j = (o) => {
|
|
67
67
|
s("isDownloadEnabled", o);
|
|
68
|
-
},
|
|
69
|
-
var
|
|
70
|
-
const
|
|
71
|
-
p.isPasswordEnabled && !t.password ||
|
|
72
|
-
},
|
|
68
|
+
}, $ = (o) => {
|
|
69
|
+
var y;
|
|
70
|
+
const z = (y = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")) == null ? void 0 : y.contains(o.relatedTarget);
|
|
71
|
+
p.isPasswordEnabled && !t.password || z || F(t.password);
|
|
72
|
+
}, x = P || I;
|
|
73
73
|
return /* @__PURE__ */ n(r, {
|
|
74
74
|
onOpenChange: m,
|
|
75
|
-
open:
|
|
75
|
+
open: D,
|
|
76
76
|
children: /* @__PURE__ */ d(r.Content, {
|
|
77
77
|
className: S.content,
|
|
78
78
|
size: "medium",
|
|
@@ -84,99 +84,99 @@ function ua({
|
|
|
84
84
|
as: "p",
|
|
85
85
|
color: "textOnLightSecondary",
|
|
86
86
|
children: a(e.subtitle, {
|
|
87
|
-
learnSharedLinkSettingsLink: /* @__PURE__ */ n(
|
|
87
|
+
learnSharedLinkSettingsLink: /* @__PURE__ */ n(G, {
|
|
88
88
|
href: "https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings",
|
|
89
89
|
rel: "noreferrer",
|
|
90
90
|
target: "_blank",
|
|
91
91
|
children: a(e.learnSharedLinkSettingsLink)
|
|
92
92
|
})
|
|
93
93
|
})
|
|
94
|
-
}), /* @__PURE__ */ n(
|
|
94
|
+
}), /* @__PURE__ */ n(h.Item, {
|
|
95
95
|
checked: t.isExpirationEnabled,
|
|
96
96
|
disabled: !i.canChangeExpiration,
|
|
97
97
|
label: a(e.linkExpirationToggleText),
|
|
98
|
-
onCheckedChange:
|
|
98
|
+
onCheckedChange: M,
|
|
99
99
|
value: "link-expiration-settings"
|
|
100
100
|
}), t.isExpirationEnabled && // Get the locale from the user's operating system settings
|
|
101
|
-
/* @__PURE__ */ n(
|
|
101
|
+
/* @__PURE__ */ n(J, {
|
|
102
102
|
locale: navigator.language || "en-US",
|
|
103
|
-
children: /* @__PURE__ */ n(
|
|
103
|
+
children: /* @__PURE__ */ n(K, {
|
|
104
104
|
calendarAriaLabel: a(e.linkExpirationCalendarAriaLabel),
|
|
105
105
|
clearDatePickerAriaLabel: a(e.linkExpirationClearDatePickerAriaLabel),
|
|
106
106
|
error: u.expiration,
|
|
107
107
|
hideLabel: !0,
|
|
108
108
|
isDisabled: !i.canChangeExpiration,
|
|
109
109
|
label: a(e.linkExpirationDatePickerLabel),
|
|
110
|
-
minValue:
|
|
110
|
+
minValue: Y(),
|
|
111
111
|
nextMonthAriaLabel: a(e.linkExpirationNextMonthAriaLabel),
|
|
112
|
-
onChange:
|
|
112
|
+
onChange: _,
|
|
113
113
|
openCalendarDropdownAriaLabel: a(e.linkExpirationOpenCalendarDropdownAriaLabel),
|
|
114
114
|
previousMonthAriaLabel: a(e.linkExpirationPreviousMonthAriaLabel),
|
|
115
115
|
value: t.expiration
|
|
116
116
|
})
|
|
117
|
-
}), i.isPasswordAvailable && (
|
|
117
|
+
}), i.isPasswordAvailable && (b == null ? void 0 : b.id) === "open" && /* @__PURE__ */ n(h.Item, {
|
|
118
118
|
checked: t.isPasswordEnabled,
|
|
119
119
|
disabled: !i.canChangePassword,
|
|
120
120
|
label: a(e.passwordToggleText),
|
|
121
|
-
onCheckedChange:
|
|
121
|
+
onCheckedChange: R,
|
|
122
122
|
value: "password-settings"
|
|
123
|
-
}), t.isPasswordEnabled && /* @__PURE__ */ d(
|
|
124
|
-
children: [i.canChangePassword && /* @__PURE__ */ n(
|
|
123
|
+
}), t.isPasswordEnabled && /* @__PURE__ */ d(L, {
|
|
124
|
+
children: [i.canChangePassword && /* @__PURE__ */ n(E, {
|
|
125
125
|
variant: "warning",
|
|
126
126
|
variantIconAriaLabel: a(e.warningNoticeIconAriaLabel),
|
|
127
127
|
children: a(e.passwordWarningText)
|
|
128
|
-
}), /* @__PURE__ */ n(
|
|
128
|
+
}), /* @__PURE__ */ n(k, {
|
|
129
129
|
disabled: !i.canChangePassword,
|
|
130
130
|
error: u.password,
|
|
131
131
|
hideLabel: !0,
|
|
132
132
|
label: a(e.passwordToggleText),
|
|
133
|
-
onBlur:
|
|
134
|
-
onChange:
|
|
133
|
+
onBlur: $,
|
|
134
|
+
onChange: W,
|
|
135
135
|
onFocus: () => l("password", void 0),
|
|
136
|
-
placeholder: p.isPasswordEnabled ?
|
|
136
|
+
placeholder: p.isPasswordEnabled ? ia : a(e.passwordInputPlaceholder),
|
|
137
137
|
type: "password",
|
|
138
138
|
value: t.password
|
|
139
139
|
})]
|
|
140
|
-
}), i.isVanityNameAvailable && /* @__PURE__ */ n(
|
|
140
|
+
}), i.isVanityNameAvailable && /* @__PURE__ */ n(h.Item, {
|
|
141
141
|
checked: t.isVanityNameEnabled,
|
|
142
142
|
disabled: !i.canChangeVanityName,
|
|
143
143
|
label: a(e.vanityNameToggleText),
|
|
144
|
-
onCheckedChange:
|
|
144
|
+
onCheckedChange: U,
|
|
145
145
|
value: "vanity-domain-settings"
|
|
146
|
-
}), t.isVanityNameEnabled && /* @__PURE__ */ d(
|
|
147
|
-
children: [i.canChangeVanityName && /* @__PURE__ */ n(
|
|
146
|
+
}), t.isVanityNameEnabled && /* @__PURE__ */ d(L, {
|
|
147
|
+
children: [i.canChangeVanityName && /* @__PURE__ */ n(E, {
|
|
148
148
|
variant: "warning",
|
|
149
149
|
variantIconAriaLabel: a(e.warningNoticeIconAriaLabel),
|
|
150
150
|
children: a(e.vanityDomainSettingsWarningText)
|
|
151
|
-
}), /* @__PURE__ */ n(
|
|
151
|
+
}), /* @__PURE__ */ n(k, {
|
|
152
152
|
disabled: !i.canChangeVanityName,
|
|
153
153
|
error: u.vanityName,
|
|
154
154
|
hideLabel: !0,
|
|
155
155
|
label: a(e.vanityNameInputLabel),
|
|
156
|
-
onChange:
|
|
156
|
+
onChange: O,
|
|
157
157
|
placeholder: a(e.vanityNameInputPlaceholder),
|
|
158
158
|
value: t.vanityName
|
|
159
|
-
}),
|
|
159
|
+
}), i.canChangeVanityName && /* @__PURE__ */ n(C, {
|
|
160
160
|
as: "p",
|
|
161
|
-
children:
|
|
161
|
+
children: `${T}${t.vanityName}`
|
|
162
162
|
})]
|
|
163
|
-
}), i.isDownloadAvailable && /* @__PURE__ */ n(
|
|
163
|
+
}), i.isDownloadAvailable && /* @__PURE__ */ n(h.Item, {
|
|
164
164
|
checked: t.isDownloadEnabled,
|
|
165
165
|
disabled: !i.canChangeDownload,
|
|
166
166
|
label: a(e.downloadSettingsToggleText),
|
|
167
|
-
onCheckedChange:
|
|
167
|
+
onCheckedChange: j,
|
|
168
168
|
value: "download-link-settings"
|
|
169
169
|
})]
|
|
170
170
|
}), /* @__PURE__ */ d(r.Footer, {
|
|
171
171
|
children: [/* @__PURE__ */ n(r.Footer.SecondaryButton, {
|
|
172
172
|
disabled: x,
|
|
173
|
-
onClick:
|
|
173
|
+
onClick: V,
|
|
174
174
|
children: a(e.cancelButton)
|
|
175
175
|
}), /* @__PURE__ */ n(r.Footer.PrimaryButton, {
|
|
176
176
|
id: "usm-SharedLinkSettingsModal-primaryButton",
|
|
177
177
|
loading: x,
|
|
178
178
|
loadingAriaLabel: a(e.loadingLabel),
|
|
179
|
-
onClick:
|
|
179
|
+
onClick: B,
|
|
180
180
|
children: a(e.saveButton)
|
|
181
181
|
})]
|
|
182
182
|
}), /* @__PURE__ */ n(r.Close, {
|
|
@@ -186,5 +186,5 @@ function ua({
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
export {
|
|
189
|
-
|
|
189
|
+
ga as SharedLinkSettingsModal
|
|
190
190
|
};
|
package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js
CHANGED
|
@@ -1,89 +1,110 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import {
|
|
1
|
+
import _ from "clsx";
|
|
2
|
+
import y from "lodash/camelCase";
|
|
3
|
+
import { useState as L, useMemo as k, useEffect as F } from "react";
|
|
4
|
+
import { useIntl as N } from "react-intl";
|
|
5
|
+
import { Tooltip as O, Focusable as $, TriggerButton as D, DropdownMenu as r } from "@box/blueprint-web";
|
|
6
6
|
import j from "../messages.js";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { isInvitationRoleSupported as
|
|
10
|
-
import { useUnifiedShareFormContext as
|
|
11
|
-
import { useUnifiedShareModalContext as
|
|
12
|
-
import '../../../../../styles/collaboration-role.css';const
|
|
13
|
-
container:
|
|
14
|
-
overrides:
|
|
7
|
+
import n from "./messages.js";
|
|
8
|
+
import { jsx as e, jsxs as z } from "react/jsx-runtime";
|
|
9
|
+
import { isInvitationRoleSupported as A, getDefaultCollaborationRole as P } from "../../../utils/collaborator.js";
|
|
10
|
+
import { useUnifiedShareFormContext as U } from "../../../contexts/unified-share-form-context.js";
|
|
11
|
+
import { useUnifiedShareModalContext as B } from "../../../contexts/unified-share-modal-context.js";
|
|
12
|
+
import '../../../../../styles/collaboration-role.css';const E = "_container_xvspw_1", W = "_overrides_xvspw_5", q = "_focusable_xvspw_10", s = {
|
|
13
|
+
container: E,
|
|
14
|
+
overrides: W,
|
|
15
|
+
focusable: q
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
+
function te() {
|
|
17
18
|
const {
|
|
18
|
-
formatMessage:
|
|
19
|
-
} =
|
|
20
|
-
collaborationRole:
|
|
21
|
-
setCollaborationRole:
|
|
22
|
-
} = P(), {
|
|
23
|
-
collaborationRoles: p,
|
|
24
|
-
isSubmitting: M,
|
|
25
|
-
item: S
|
|
19
|
+
formatMessage: o
|
|
20
|
+
} = N(), [f, M] = L(!1), {
|
|
21
|
+
collaborationRole: u,
|
|
22
|
+
setCollaborationRole: d
|
|
26
23
|
} = U(), {
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
collaborationRoles: g,
|
|
25
|
+
isSubmitting: S,
|
|
26
|
+
item: w
|
|
27
|
+
} = B(), {
|
|
28
|
+
permissions: I = {},
|
|
29
|
+
type: m
|
|
30
|
+
} = w, l = k(() => g.map((i) => {
|
|
29
31
|
const {
|
|
30
|
-
description:
|
|
31
|
-
id:
|
|
32
|
-
label:
|
|
33
|
-
} =
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
let
|
|
37
|
-
return
|
|
38
|
-
...
|
|
39
|
-
description:
|
|
40
|
-
label:
|
|
32
|
+
description: p,
|
|
33
|
+
id: t,
|
|
34
|
+
label: c
|
|
35
|
+
} = i, b = A(t), x = y(t);
|
|
36
|
+
let h = x;
|
|
37
|
+
t === "editor" && m === "folder" && (h += "Folder");
|
|
38
|
+
let C = t, R = "";
|
|
39
|
+
return b && (C = o(j[`${x}Role`]), R = o(n[`${h}Description`])), {
|
|
40
|
+
...i,
|
|
41
|
+
description: p ?? R,
|
|
42
|
+
label: c ?? C
|
|
41
43
|
};
|
|
42
|
-
}), [
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
}, [
|
|
44
|
+
}), [g, o, m]);
|
|
45
|
+
if (F(() => {
|
|
46
|
+
d(P(l));
|
|
47
|
+
}, [l, d]), !l.length || !u)
|
|
46
48
|
return null;
|
|
47
49
|
const {
|
|
48
|
-
id:
|
|
49
|
-
label:
|
|
50
|
-
} =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
id: T,
|
|
51
|
+
label: v
|
|
52
|
+
} = u;
|
|
53
|
+
let a;
|
|
54
|
+
return I.canInviteCollaborator || (a = o(n.inviteDisabledTooltip)), m === "web_link" && (a = o(n.inviteWebLinkDisabledTooltip)), a ? /* @__PURE__ */ e(O, {
|
|
55
|
+
align: "start",
|
|
56
|
+
content: a,
|
|
57
|
+
"data-testid": "collaboration-role-tooltip",
|
|
58
|
+
side: "bottom",
|
|
59
|
+
children: /* @__PURE__ */ e($, {
|
|
60
|
+
className: s.focusable,
|
|
61
|
+
children: /* @__PURE__ */ e(D, {
|
|
62
|
+
caretDirection: "down",
|
|
63
|
+
className: _(s.container, s.overrides),
|
|
64
|
+
disabled: !0,
|
|
65
|
+
label: o(n.inviteAsRoleLabel, {
|
|
66
|
+
role: v
|
|
61
67
|
}),
|
|
62
68
|
size: "extraSmall",
|
|
63
69
|
variant: "tertiary"
|
|
64
70
|
})
|
|
65
|
-
})
|
|
71
|
+
})
|
|
72
|
+
}) : /* @__PURE__ */ z(r.Root, {
|
|
73
|
+
onOpenChange: M,
|
|
74
|
+
open: f,
|
|
75
|
+
children: [/* @__PURE__ */ e(r.Trigger, {
|
|
76
|
+
children: /* @__PURE__ */ e(D, {
|
|
77
|
+
caretDirection: f ? "up" : "down",
|
|
78
|
+
className: _(s.container, s.overrides),
|
|
79
|
+
disabled: S,
|
|
80
|
+
label: o(n.inviteAsRoleLabel, {
|
|
81
|
+
role: v
|
|
82
|
+
}),
|
|
83
|
+
size: "extraSmall",
|
|
84
|
+
variant: "tertiary"
|
|
85
|
+
})
|
|
86
|
+
}), /* @__PURE__ */ e(r.Content, {
|
|
66
87
|
align: "start",
|
|
67
|
-
children:
|
|
88
|
+
children: l.map((i) => {
|
|
68
89
|
const {
|
|
69
|
-
description:
|
|
70
|
-
isDisabled:
|
|
71
|
-
id:
|
|
72
|
-
label:
|
|
73
|
-
} =
|
|
74
|
-
return /* @__PURE__ */ r
|
|
75
|
-
checked:
|
|
76
|
-
disabled:
|
|
77
|
-
onSelect: () =>
|
|
78
|
-
children: /* @__PURE__ */ r
|
|
79
|
-
caption:
|
|
80
|
-
label:
|
|
90
|
+
description: p,
|
|
91
|
+
isDisabled: t,
|
|
92
|
+
id: c,
|
|
93
|
+
label: b
|
|
94
|
+
} = i;
|
|
95
|
+
return /* @__PURE__ */ e(r.CheckboxItem, {
|
|
96
|
+
checked: T === c,
|
|
97
|
+
disabled: t,
|
|
98
|
+
onSelect: () => d(i),
|
|
99
|
+
children: /* @__PURE__ */ e(r.Item.MainContent, {
|
|
100
|
+
caption: p,
|
|
101
|
+
label: b
|
|
81
102
|
})
|
|
82
|
-
},
|
|
103
|
+
}, c);
|
|
83
104
|
})
|
|
84
105
|
})]
|
|
85
106
|
});
|
|
86
107
|
}
|
|
87
108
|
export {
|
|
88
|
-
|
|
109
|
+
te as CollaborationRole
|
|
89
110
|
};
|