@box/unified-share-modal 1.43.0 → 1.44.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/shared-link-section/shared-link-section.js +41 -41
- package/dist/i18n/bn-IN.properties +2 -0
- package/dist/i18n/da-DK.properties +2 -0
- package/dist/i18n/de-DE.properties +2 -0
- package/dist/i18n/en-AU.properties +2 -0
- package/dist/i18n/en-CA.properties +2 -0
- package/dist/i18n/en-GB.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +154 -154
- package/dist/i18n/en-x-pseudo.properties +155 -153
- package/dist/i18n/es-419.properties +2 -0
- package/dist/i18n/es-ES.properties +2 -0
- package/dist/i18n/fi-FI.properties +2 -0
- package/dist/i18n/fr-CA.properties +2 -0
- package/dist/i18n/fr-FR.properties +2 -0
- package/dist/i18n/hi-IN.properties +2 -0
- package/dist/i18n/it-IT.properties +2 -0
- package/dist/i18n/ja-JP.properties +2 -0
- package/dist/i18n/ko-KR.properties +2 -0
- package/dist/i18n/nb-NO.properties +2 -0
- package/dist/i18n/nl-NL.properties +2 -0
- package/dist/i18n/pl-PL.properties +2 -0
- package/dist/i18n/pt-BR.properties +2 -0
- package/dist/i18n/ru-RU.properties +2 -0
- package/dist/i18n/sv-SE.properties +2 -0
- package/dist/i18n/tr-TR.properties +2 -0
- package/dist/i18n/zh-CN.properties +2 -0
- package/dist/i18n/zh-TW.properties +2 -0
- package/package.json +9 -9
package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useRef as
|
|
1
|
+
import { useRef as v, useState as V, useCallback as _, useEffect as D } from "react";
|
|
2
2
|
import { useIntl as G } from "react-intl";
|
|
3
|
-
import { Text as
|
|
3
|
+
import { Text as A, Tooltip as T, Focusable as H, Switch as J, Status as Q, Link as W, Button as X } from "@box/blueprint-web";
|
|
4
4
|
import { ClockBadge as Y } from "@box/blueprint-web-assets/icons/Line";
|
|
5
|
-
import { Mail as Z, Globe as
|
|
5
|
+
import { Mail as Z, Globe as I } from "@box/blueprint-web-assets/icons/Medium";
|
|
6
6
|
import { SurfaceStatusSurfaceRed as $, bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
|
|
7
7
|
import { CopyInput as ee } from "@box/copy-input";
|
|
8
8
|
import { SharedLinkAccess as ie } from "./shared-link-access.js";
|
|
@@ -11,7 +11,7 @@ import i from "./messages.js";
|
|
|
11
11
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
12
12
|
import { useUnifiedShareFormContext as ne } from "../../../contexts/unified-share-form-context.js";
|
|
13
13
|
import { useUnifiedShareModalContext as ae } from "../../../contexts/unified-share-modal-context.js";
|
|
14
|
-
import { useSharingAction as
|
|
14
|
+
import { useSharingAction as F } from "../../../hooks/use-sharing-action.js";
|
|
15
15
|
import { formatDateFromTimestampToDateString as oe } from "../../../utils/date.js";
|
|
16
16
|
import { callOnKeyboardEvent as se } from "../../../utils/event.js";
|
|
17
17
|
import '../../../../../styles/shared-link-section.css';const re = "_container_qn1ax_1", ce = "_toggle_qn1ax_7", le = "_settings_qn1ax_13", de = "_copy_qn1ax_22", he = "_access_qn1ax_30", me = "_icon_qn1ax_36", s = {
|
|
@@ -25,66 +25,66 @@ import '../../../../../styles/shared-link-section.css';const re = "_container_qn
|
|
|
25
25
|
function Ne() {
|
|
26
26
|
const {
|
|
27
27
|
formatMessage: e
|
|
28
|
-
} = G(), k =
|
|
28
|
+
} = G(), k = v(!0), L = v(null), p = v(null), {
|
|
29
29
|
onModalViewChange: b,
|
|
30
|
-
onShareViewChange:
|
|
30
|
+
onShareViewChange: q
|
|
31
31
|
} = ne(), {
|
|
32
32
|
config: o,
|
|
33
|
-
isFetching:
|
|
34
|
-
isSubmitting:
|
|
35
|
-
item:
|
|
33
|
+
isFetching: E,
|
|
34
|
+
isSubmitting: R,
|
|
35
|
+
item: M,
|
|
36
36
|
sharedLink: a,
|
|
37
|
-
sharingService:
|
|
37
|
+
sharingService: B
|
|
38
38
|
} = ae(), {
|
|
39
|
-
permissions:
|
|
40
|
-
} = R, {
|
|
41
|
-
createSharedLink: B
|
|
39
|
+
permissions: N = {}
|
|
42
40
|
} = M, {
|
|
41
|
+
createSharedLink: O
|
|
42
|
+
} = B, {
|
|
43
43
|
sharedLinkAutoCopy: d,
|
|
44
44
|
sharedLinkAutoCreate: y
|
|
45
45
|
} = o;
|
|
46
|
-
let
|
|
47
|
-
d && (
|
|
46
|
+
let P = "create-shared-link";
|
|
47
|
+
d && (P = "auto-copy-shared-link");
|
|
48
48
|
const {
|
|
49
|
-
isLoading:
|
|
50
|
-
onAction:
|
|
51
|
-
} =
|
|
52
|
-
n || (await
|
|
53
|
-
}, [n,
|
|
49
|
+
isLoading: C,
|
|
50
|
+
onAction: S
|
|
51
|
+
} = F(O, P), n = !!a.url, r = R ?? C, [x, U] = V(!1), u = _(async () => {
|
|
52
|
+
n || (await S(), U(!0));
|
|
53
|
+
}, [n, S]), j = _(async () => (u(), new Promise((c) => {
|
|
54
54
|
p.current = {
|
|
55
55
|
resolve: c
|
|
56
56
|
};
|
|
57
57
|
})), [u]), {
|
|
58
|
-
onAction:
|
|
59
|
-
} =
|
|
60
|
-
|
|
61
|
-
!k.current ||
|
|
62
|
-
}, [
|
|
63
|
-
n && d && L.current && L.current.click();
|
|
64
|
-
}, [n, d]);
|
|
65
|
-
const z =
|
|
58
|
+
onAction: w
|
|
59
|
+
} = F(j, "auto-copy-shared-link");
|
|
60
|
+
D(() => {
|
|
61
|
+
!k.current || E || (d ? w() : y && u(), k.current = !1);
|
|
62
|
+
}, [E, k, d, y, u, w]), D(() => {
|
|
63
|
+
n && d && !C && L.current && L.current.click();
|
|
64
|
+
}, [n, d, C]);
|
|
65
|
+
const z = _((m) => {
|
|
66
66
|
if (!p.current)
|
|
67
67
|
return;
|
|
68
68
|
let c;
|
|
69
|
-
m instanceof Error ? c =
|
|
69
|
+
m instanceof Error ? c = x ? e(i.autoCreateCopyErrorNoticeText) : null : c = e(x ? i.autoCreateCopySuccessNoticeText : i.autoCopySuccessNoticeText), c && p.current.resolve({
|
|
70
70
|
messages: [{
|
|
71
71
|
text: c,
|
|
72
72
|
type: "success"
|
|
73
73
|
}]
|
|
74
74
|
}), p.current = null;
|
|
75
|
-
}, [e,
|
|
76
|
-
m || b("remove-shared-link"), m && await
|
|
75
|
+
}, [e, x]), K = async (m) => {
|
|
76
|
+
m || b("remove-shared-link"), m && await S();
|
|
77
77
|
};
|
|
78
78
|
let h, f = !1;
|
|
79
|
-
return !n && !r && (h = e(i.sharedLinkToggleTooltip)), !n && !
|
|
79
|
+
return !n && !r && (h = e(i.sharedLinkToggleTooltip)), !n && !N.canShare && (h = e(i.createLinkDisabledTooltip), f = !0), n && !N.canSetShareAccess && (h = e(i.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ l("div", {
|
|
80
80
|
className: s.container,
|
|
81
|
-
children: [/* @__PURE__ */ t(
|
|
81
|
+
children: [/* @__PURE__ */ t(A, {
|
|
82
82
|
as: "label",
|
|
83
83
|
variant: "bodyDefaultBold",
|
|
84
84
|
children: e(i.shareLinkLabel)
|
|
85
85
|
}), /* @__PURE__ */ l("div", {
|
|
86
86
|
className: s.toggle,
|
|
87
|
-
children: [/* @__PURE__ */ t(
|
|
87
|
+
children: [/* @__PURE__ */ t(T, {
|
|
88
88
|
align: "start",
|
|
89
89
|
content: h,
|
|
90
90
|
"data-testid": "shared-link-tooltip",
|
|
@@ -99,7 +99,7 @@ function Ne() {
|
|
|
99
99
|
value: "shared-link"
|
|
100
100
|
})
|
|
101
101
|
})
|
|
102
|
-
}), n && !!a.expiresAt && /* @__PURE__ */ t(
|
|
102
|
+
}), n && !!a.expiresAt && /* @__PURE__ */ t(T, {
|
|
103
103
|
content: e(i.expirationIconTooltip, {
|
|
104
104
|
expirationDate: oe(a.expiresAt)
|
|
105
105
|
}),
|
|
@@ -133,14 +133,14 @@ function Ne() {
|
|
|
133
133
|
label: e(i.sharedLinkUrlLabel),
|
|
134
134
|
onCopy: z,
|
|
135
135
|
value: a.url
|
|
136
|
-
}), o.sharedLinkEmail && /* @__PURE__ */ t(
|
|
136
|
+
}), o.sharedLinkEmail && /* @__PURE__ */ t(T, {
|
|
137
137
|
align: "end",
|
|
138
138
|
content: e(i.sharedLinkEmailLabel),
|
|
139
139
|
children: /* @__PURE__ */ t(X, {
|
|
140
140
|
"aria-label": e(i.sharedLinkEmailLabel),
|
|
141
141
|
disabled: r,
|
|
142
142
|
icon: Z,
|
|
143
|
-
onClick: () =>
|
|
143
|
+
onClick: () => q("email"),
|
|
144
144
|
size: "large",
|
|
145
145
|
variant: "secondary"
|
|
146
146
|
})
|
|
@@ -149,21 +149,21 @@ function Ne() {
|
|
|
149
149
|
className: s.access,
|
|
150
150
|
children: [o.sharedLinkAccess && /* @__PURE__ */ t(ie, {}), o.sharedLinkPermission && /* @__PURE__ */ t(te, {})]
|
|
151
151
|
}), n && a.access === "open" && /* @__PURE__ */ l("div", {
|
|
152
|
-
children: [/* @__PURE__ */ t(
|
|
152
|
+
children: [/* @__PURE__ */ t(I, {
|
|
153
153
|
className: s.icon,
|
|
154
154
|
height: g,
|
|
155
155
|
width: g
|
|
156
|
-
}), /* @__PURE__ */ t(
|
|
156
|
+
}), /* @__PURE__ */ t(A, {
|
|
157
157
|
as: "span",
|
|
158
158
|
color: "textOnLightSecondary",
|
|
159
159
|
children: a.permission === "can_edit" ? e(i.sharedLinkEditablePubliclyAvailable) : e(i.sharedLinkPubliclyAvailable)
|
|
160
160
|
})]
|
|
161
161
|
}), n && a.access === "company" && a.permission === "can_edit" && /* @__PURE__ */ l("div", {
|
|
162
|
-
children: [/* @__PURE__ */ t(
|
|
162
|
+
children: [/* @__PURE__ */ t(I, {
|
|
163
163
|
className: s.icon,
|
|
164
164
|
height: g,
|
|
165
165
|
width: g
|
|
166
|
-
}), /* @__PURE__ */ t(
|
|
166
|
+
}), /* @__PURE__ */ t(A, {
|
|
167
167
|
as: "span",
|
|
168
168
|
color: "textOnLightSecondary",
|
|
169
169
|
children: e(i.sharedLinkElevatedEditableCompanyAvailable)
|
|
@@ -82,6 +82,8 @@ groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel = সরাস
|
|
|
82
82
|
groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText = শেয়ার করা লিঙ্ক সহ ব্যবহারকারীদের এই আইটেমটি ডাউনলোড করার অনুমতি দিন
|
|
83
83
|
# Aria label for button to hide password
|
|
84
84
|
groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel = পাসওয়ার্ড লুকান
|
|
85
|
+
# Notice shown at top of modal when one or more settings are unavailable due to permission settings
|
|
86
|
+
groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice = Certain settings may not be available for this item due to permissions.
|
|
85
87
|
# Link to learn more about shared link settings
|
|
86
88
|
groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink = শেয়ার করা লিঙ্ক সেটিংস সম্পর্কে আরও জানুন।
|
|
87
89
|
# Aria label for the calendar in the link expiration settings
|
|
@@ -82,6 +82,8 @@ groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel = Direkte link
|
|
|
82
82
|
groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText = Tillad brugere med det delt link at downloade dette element
|
|
83
83
|
# Aria label for button to hide password
|
|
84
84
|
groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel = Skjul adgangskode
|
|
85
|
+
# Notice shown at top of modal when one or more settings are unavailable due to permission settings
|
|
86
|
+
groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice = Certain settings may not be available for this item due to permissions.
|
|
85
87
|
# Link to learn more about shared link settings
|
|
86
88
|
groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink = Få mere at vide om delt link-indstillinger.
|
|
87
89
|
# Aria label for the calendar in the link expiration settings
|
|
@@ -82,6 +82,8 @@ groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel = Direktverknüp
|
|
|
82
82
|
groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText = Benutzern mit dem Freigabe-Link das Herunterladen dieses Elements gestatten
|
|
83
83
|
# Aria label for button to hide password
|
|
84
84
|
groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel = Kennwort verbergen
|
|
85
|
+
# Notice shown at top of modal when one or more settings are unavailable due to permission settings
|
|
86
|
+
groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice = Certain settings may not be available for this item due to permissions.
|
|
85
87
|
# Link to learn more about shared link settings
|
|
86
88
|
groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink = Erfahren Sie mehr über die Einstellungen für Freigabe-Links.
|
|
87
89
|
# Aria label for the calendar in the link expiration settings
|
|
@@ -82,6 +82,8 @@ groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel = Direct link
|
|
|
82
82
|
groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText = Allow users with the shared link to download this item
|
|
83
83
|
# Aria label for button to hide password
|
|
84
84
|
groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel = Hide password
|
|
85
|
+
# Notice shown at top of modal when one or more settings are unavailable due to permission settings
|
|
86
|
+
groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice = Certain settings may not be available for this item due to permissions.
|
|
85
87
|
# Link to learn more about shared link settings
|
|
86
88
|
groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink = Learn more about shared link settings.
|
|
87
89
|
# Aria label for the calendar in the link expiration settings
|
|
@@ -82,6 +82,8 @@ groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel = Direct link
|
|
|
82
82
|
groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText = Allow users with the shared link to download this item
|
|
83
83
|
# Aria label for button to hide password
|
|
84
84
|
groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel = Hide password
|
|
85
|
+
# Notice shown at top of modal when one or more settings are unavailable due to permission settings
|
|
86
|
+
groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice = Certain settings may not be available for this item due to permissions.
|
|
85
87
|
# Link to learn more about shared link settings
|
|
86
88
|
groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink = Learn more about shared link settings.
|
|
87
89
|
# Aria label for the calendar in the link expiration settings
|
|
@@ -82,6 +82,8 @@ groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel = Direct link
|
|
|
82
82
|
groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText = Allow users with the shared link to download this item
|
|
83
83
|
# Aria label for button to hide password
|
|
84
84
|
groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel = Hide password
|
|
85
|
+
# Notice shown at top of modal when one or more settings are unavailable due to permission settings
|
|
86
|
+
groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice = Certain settings may not be available for this item due to permissions.
|
|
85
87
|
# Link to learn more about shared link settings
|
|
86
88
|
groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink = Learn more about shared link settings.
|
|
87
89
|
# Aria label for the calendar in the link expiration settings
|