@box/unified-share-modal 2.11.3 → 2.11.5
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
CHANGED
|
@@ -31,16 +31,16 @@ function Ie() {
|
|
|
31
31
|
} = H(), f = G(null), {
|
|
32
32
|
isInteracted: L,
|
|
33
33
|
isSharedLinkAutoCopied: m,
|
|
34
|
-
isSharedLinkAutoCreated:
|
|
34
|
+
isSharedLinkAutoCreated: n,
|
|
35
35
|
setForm: B
|
|
36
36
|
} = ne(), {
|
|
37
37
|
config: s,
|
|
38
38
|
eventService: F,
|
|
39
39
|
isFetching: x,
|
|
40
|
-
isSubmitting:
|
|
40
|
+
isSubmitting: o,
|
|
41
41
|
item: M,
|
|
42
42
|
setView: T,
|
|
43
|
-
sharedLink:
|
|
43
|
+
sharedLink: r,
|
|
44
44
|
sharingService: O
|
|
45
45
|
} = oe(), {
|
|
46
46
|
permissions: _ = {}
|
|
@@ -53,7 +53,7 @@ function Ie() {
|
|
|
53
53
|
notifications: E,
|
|
54
54
|
sharedLinkAutoCopy: R,
|
|
55
55
|
sharedLinkAutoCreate: D
|
|
56
|
-
} = s, a = !!
|
|
56
|
+
} = s, a = !!r.url, c = R && !m.current && !L, j = D && !n.current && !L, U = I(async () => {
|
|
57
57
|
const d = await N();
|
|
58
58
|
return c ? {
|
|
59
59
|
messages: []
|
|
@@ -62,17 +62,18 @@ function Ie() {
|
|
|
62
62
|
onAction: b
|
|
63
63
|
} = re(U, "create-shared-link");
|
|
64
64
|
V(() => {
|
|
65
|
-
(async () => x ||
|
|
66
|
-
}, [a, c, j, x, m,
|
|
65
|
+
(async () => x || o || ((c || j) && !a && !n.current && (n.current = !0, await b()), c && a && f.current && f.current.click()))();
|
|
66
|
+
}, [a, c, j, x, m, n, o, b]);
|
|
67
67
|
const z = I((d) => {
|
|
68
68
|
if (S && S(d), !c)
|
|
69
69
|
return;
|
|
70
|
+
m.current = !0;
|
|
70
71
|
let g;
|
|
71
|
-
typeof d != "string" ? g =
|
|
72
|
+
typeof d != "string" ? g = n.current ? e(t.autoCreateCopyErrorNoticeText) : null : g = n.current ? e(t.autoCreateCopySuccessNoticeText) : e(t.autoCopySuccessNoticeText), g && E.includes("auto-copy-shared-link") && v({
|
|
72
73
|
...se(e, "success"),
|
|
73
74
|
styledText: g
|
|
74
|
-
})
|
|
75
|
-
}, [v, e, c, m,
|
|
75
|
+
});
|
|
76
|
+
}, [v, e, c, m, n, E, S]), K = async (d) => {
|
|
76
77
|
if (d) {
|
|
77
78
|
await b();
|
|
78
79
|
return;
|
|
@@ -86,7 +87,7 @@ function Ie() {
|
|
|
86
87
|
T("shared-link-settings");
|
|
87
88
|
};
|
|
88
89
|
let u, p = !1;
|
|
89
|
-
return !a && !
|
|
90
|
+
return !a && !o && (u = e(t.sharedLinkToggleTooltip)), !a && !_.canShare && (u = e(t.createLinkDisabledTooltip), p = !0), a && !_.canSetShareAccess && (u = e(t.removeLinkDisabledTooltip), p = !0), /* @__PURE__ */ h("div", {
|
|
90
91
|
className: l.container,
|
|
91
92
|
children: [/* @__PURE__ */ i(y, {
|
|
92
93
|
as: "label",
|
|
@@ -104,15 +105,15 @@ function Ie() {
|
|
|
104
105
|
children: /* @__PURE__ */ i(Q.Item, {
|
|
105
106
|
checked: a,
|
|
106
107
|
"data-target-id": "Toggle-CreateSharedLink",
|
|
107
|
-
disabled: p ||
|
|
108
|
+
disabled: p || o,
|
|
108
109
|
label: e(t.sharedLinkToggleLabel),
|
|
109
110
|
onCheckedChange: K,
|
|
110
111
|
value: "shared-link"
|
|
111
112
|
})
|
|
112
113
|
})
|
|
113
|
-
}), a && !!
|
|
114
|
+
}), a && !!r.expiresAt && /* @__PURE__ */ i(C, {
|
|
114
115
|
content: e(t.expirationIconTooltip, {
|
|
115
|
-
expirationDate: ce(
|
|
116
|
+
expirationDate: ce(r.expiresAt)
|
|
116
117
|
}),
|
|
117
118
|
"data-testid": "expiration-date-tooltip",
|
|
118
119
|
children: /* @__PURE__ */ i(W, {
|
|
@@ -122,7 +123,7 @@ function Ie() {
|
|
|
122
123
|
text: e(t.expirationIconLabel)
|
|
123
124
|
})
|
|
124
125
|
}), a && s.sharedLinkSettings && /* @__PURE__ */ i(X, {
|
|
125
|
-
"aria-disabled":
|
|
126
|
+
"aria-disabled": o,
|
|
126
127
|
"aria-haspopup": "dialog",
|
|
127
128
|
className: l.settings,
|
|
128
129
|
"data-target-id": "PlainButton-SharedLinkSettings",
|
|
@@ -131,7 +132,7 @@ function Ie() {
|
|
|
131
132
|
canPreventDefault: !0
|
|
132
133
|
}),
|
|
133
134
|
role: "button",
|
|
134
|
-
tabIndex:
|
|
135
|
+
tabIndex: o ? -1 : 0,
|
|
135
136
|
variant: "standalone",
|
|
136
137
|
children: e(t.sharedLinkSettingsLabel)
|
|
137
138
|
})]
|
|
@@ -139,20 +140,20 @@ function Ie() {
|
|
|
139
140
|
className: l.copy,
|
|
140
141
|
children: [/* @__PURE__ */ i(te, {
|
|
141
142
|
ref: f,
|
|
142
|
-
autoFocus: D &&
|
|
143
|
+
autoFocus: D && n.current && !L,
|
|
143
144
|
"data-target-id": "Button-CopySharedLink",
|
|
144
|
-
disabled:
|
|
145
|
+
disabled: o,
|
|
145
146
|
hideLabel: !0,
|
|
146
147
|
label: e(t.sharedLinkUrlLabel),
|
|
147
148
|
onCopy: z,
|
|
148
|
-
value:
|
|
149
|
+
value: r.url
|
|
149
150
|
}), s.sharedLinkEmail && /* @__PURE__ */ i(C, {
|
|
150
151
|
align: "end",
|
|
151
152
|
content: e(t.sharedLinkEmailLabel),
|
|
152
153
|
children: /* @__PURE__ */ i(Y, {
|
|
153
154
|
"aria-label": e(t.sharedLinkEmailLabel),
|
|
154
155
|
"data-target-id": "Button-SendSharedLink",
|
|
155
|
-
disabled:
|
|
156
|
+
disabled: o,
|
|
156
157
|
icon: $,
|
|
157
158
|
onClick: () => B("email"),
|
|
158
159
|
size: "large",
|
|
@@ -162,7 +163,7 @@ function Ie() {
|
|
|
162
163
|
}), a && (s.sharedLinkAccess || s.sharedLinkPermission) && /* @__PURE__ */ h("div", {
|
|
163
164
|
className: l.access,
|
|
164
165
|
children: [s.sharedLinkAccess && /* @__PURE__ */ i(ie, {}), s.sharedLinkPermission && /* @__PURE__ */ i(ae, {})]
|
|
165
|
-
}), a &&
|
|
166
|
+
}), a && r.access === "open" && /* @__PURE__ */ h("div", {
|
|
166
167
|
children: [/* @__PURE__ */ i(P, {
|
|
167
168
|
className: l.icon,
|
|
168
169
|
height: k,
|
|
@@ -170,9 +171,9 @@ function Ie() {
|
|
|
170
171
|
}), /* @__PURE__ */ i(y, {
|
|
171
172
|
as: "span",
|
|
172
173
|
color: "textOnLightSecondary",
|
|
173
|
-
children:
|
|
174
|
+
children: r.permission === "can_edit" ? e(t.sharedLinkEditablePubliclyAvailable) : e(t.sharedLinkPubliclyAvailable)
|
|
174
175
|
})]
|
|
175
|
-
}), a &&
|
|
176
|
+
}), a && r.access === "company" && r.permission === "can_edit" && /* @__PURE__ */ h("div", {
|
|
176
177
|
children: [/* @__PURE__ */ i(P, {
|
|
177
178
|
className: l.icon,
|
|
178
179
|
height: k,
|