@box/unified-share-modal 0.49.0 → 0.50.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.
Files changed (55) hide show
  1. package/dist/esm/lib/components/shared-link-settings-modal/messages.js +2 -6
  2. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +79 -79
  3. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +89 -68
  4. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +119 -102
  5. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +8 -0
  6. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +12 -0
  7. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +42 -39
  8. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +46 -43
  9. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +109 -100
  10. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +56 -47
  11. package/dist/esm/lib/hooks/use-access-levels.js +18 -17
  12. package/dist/esm/lib/hooks/use-collaboration-form.js +13 -13
  13. package/dist/esm/lib/messages.js +11 -7
  14. package/dist/i18n/bn-IN.js +8 -2
  15. package/dist/i18n/da-DK.js +8 -2
  16. package/dist/i18n/de-DE.js +8 -2
  17. package/dist/i18n/en-AU.js +8 -2
  18. package/dist/i18n/en-CA.js +8 -2
  19. package/dist/i18n/en-GB.js +8 -2
  20. package/dist/i18n/en-US.js +15 -10
  21. package/dist/i18n/en-US.properties +21 -11
  22. package/dist/i18n/en-x-pseudo.js +122 -116
  23. package/dist/i18n/en-x-pseudo.properties +116 -116
  24. package/dist/i18n/es-419.js +8 -2
  25. package/dist/i18n/es-ES.js +8 -2
  26. package/dist/i18n/fi-FI.js +8 -2
  27. package/dist/i18n/fr-CA.js +8 -2
  28. package/dist/i18n/fr-FR.js +8 -2
  29. package/dist/i18n/hi-IN.js +8 -2
  30. package/dist/i18n/it-IT.js +8 -2
  31. package/dist/i18n/ja-JP.js +8 -2
  32. package/dist/i18n/json/src/lib/components/shared-link-settings-modal/messages.json +1 -1
  33. package/dist/i18n/json/src/lib/components/unified-share-form-modal/collaboration-section/messages.json +1 -1
  34. package/dist/i18n/json/src/lib/components/unified-share-form-modal/shared-link-section/messages.json +1 -1
  35. package/dist/i18n/json/src/lib/messages.json +1 -1
  36. package/dist/i18n/ko-KR.js +8 -2
  37. package/dist/i18n/nb-NO.js +8 -2
  38. package/dist/i18n/nl-NL.js +8 -2
  39. package/dist/i18n/pl-PL.js +8 -2
  40. package/dist/i18n/pt-BR.js +8 -2
  41. package/dist/i18n/ru-RU.js +8 -2
  42. package/dist/i18n/sv-SE.js +8 -2
  43. package/dist/i18n/tr-TR.js +8 -2
  44. package/dist/i18n/zh-CN.js +8 -2
  45. package/dist/i18n/zh-TW.js +8 -2
  46. package/dist/styles/collaboration-role.css +1 -1
  47. package/dist/styles/shared-link-section.css +1 -1
  48. package/dist/styles/unified-share-form-modal.css +1 -1
  49. package/dist/types/lib/components/shared-link-settings-modal/messages.d.ts +0 -5
  50. package/dist/types/lib/components/unified-share-form-modal/collaboration-section/messages.d.ts +10 -0
  51. package/dist/types/lib/components/unified-share-form-modal/shared-link-section/messages.d.ts +15 -0
  52. package/dist/types/lib/messages.d.ts +5 -0
  53. package/dist/types/lib/stories/shared.d.ts +10 -0
  54. package/dist/types/lib/types.d.ts +10 -0
  55. package/package.json +2 -2
@@ -1,144 +1,153 @@
1
- import { useRef as y, useState as R, useCallback as b, useEffect as _ } from "react";
2
- import { useIntl as F } from "react-intl";
3
- import { Text as B, Tooltip as S, Switch as M, Status as U, Link as j, Button as K } from "@box/blueprint-web";
4
- import { ClockBadge as V, Envelope as z } from "@box/blueprint-web-assets/icons/Line";
5
- import { SurfaceStatusSurfaceRed as O } from "@box/blueprint-web-assets/tokens/tokens";
6
- import { CopyInput as G } from "@box/copy-input";
7
- import { SharedLinkAccess as H } from "./shared-link-access.js";
8
- import { SharedLinkPermission as J } from "./shared-link-permission.js";
1
+ import { useRef as b, useState as U, useCallback as x, useEffect as D } from "react";
2
+ import { useIntl as j } from "react-intl";
3
+ import { Text as K, Tooltip as T, Focusable as V, Switch as O, Status as G, Link as H, Button as J } from "@box/blueprint-web";
4
+ import { ClockBadge as Q, Envelope as W } from "@box/blueprint-web-assets/icons/Line";
5
+ import { SurfaceStatusSurfaceRed as X } from "@box/blueprint-web-assets/tokens/tokens";
6
+ import { CopyInput as Y } from "@box/copy-input";
7
+ import { SharedLinkAccess as Z } from "./shared-link-access.js";
8
+ import { SharedLinkPermission as $ } from "./shared-link-permission.js";
9
9
  import t from "./messages.js";
10
- import { jsxs as h, jsx as o } from "react/jsx-runtime";
11
- import { useUnifiedShareFormContext as Q } from "../../../contexts/unified-share-form-context.js";
12
- import { useUnifiedShareModalContext as W } from "../../../contexts/unified-share-modal-context.js";
13
- import { useSharingAction as T } from "../../../hooks/use-sharing-action.js";
14
- import { formatDateFromTimestampToDateString as X } from "../../../utils/date.js";
15
- import { callOnKeyboardEvent as Y } from "../../../utils/event.js";
16
- import '../../../../../styles/shared-link-section.css';const Z = "_container_cabqc_1", $ = "_toggle_cabqc_7", ee = "_settings_cabqc_13", te = "_copy_cabqc_18", ne = "_access_cabqc_26", c = {
17
- container: Z,
18
- toggle: $,
19
- settings: ee,
20
- copy: te,
21
- access: ne
10
+ import { jsxs as g, jsx as n } from "react/jsx-runtime";
11
+ import { useUnifiedShareFormContext as ee } from "../../../contexts/unified-share-form-context.js";
12
+ import { useUnifiedShareModalContext as te } from "../../../contexts/unified-share-modal-context.js";
13
+ import { useSharingAction as E } from "../../../hooks/use-sharing-action.js";
14
+ import { formatDateFromTimestampToDateString as ie } from "../../../utils/date.js";
15
+ import { callOnKeyboardEvent as ne } from "../../../utils/event.js";
16
+ import '../../../../../styles/shared-link-section.css';const oe = "_container_q90iz_1", ae = "_toggle_q90iz_7", se = "_settings_q90iz_13", re = "_copy_q90iz_22", ce = "_access_q90iz_30", d = {
17
+ container: oe,
18
+ toggle: ae,
19
+ settings: se,
20
+ copy: re,
21
+ access: ce
22
22
  };
23
- function Le() {
23
+ function Te() {
24
24
  const {
25
25
  formatMessage: e
26
- } = F(), p = y(!0), f = y(null), l = y(null), {
27
- onModalViewChange: d,
28
- onShareViewChange: E
29
- } = Q(), {
30
- config: a,
31
- isSubmitting: g,
32
- sharedLink: u,
33
- sharingService: I
34
- } = W(), {
35
- createSharedLink: N
36
- } = I, {
26
+ } = j(), k = b(!0), L = b(null), u = b(null), {
27
+ onModalViewChange: h,
28
+ onShareViewChange: I
29
+ } = ee(), {
30
+ config: o,
31
+ isSubmitting: N,
32
+ item: P,
33
+ sharedLink: m,
34
+ sharingService: w
35
+ } = te(), {
36
+ permissions: v = {}
37
+ } = P, {
38
+ createSharedLink: z
39
+ } = w, {
37
40
  sharedLinkAutoCopy: r,
38
- sharedLinkAutoCreate: k
39
- } = a, n = !!u.url, [L, P] = R(!1);
40
- let x = "create-shared-link";
41
- r && (x = "auto-copy-shared-link");
41
+ sharedLinkAutoCreate: C
42
+ } = o;
43
+ let A = "create-shared-link";
44
+ r && (A = "auto-copy-shared-link");
42
45
  const {
43
- isLoading: v,
44
- onAction: C
45
- } = T(N, x), m = b(async () => {
46
- n || (await C(), P(!0));
47
- }, [n, C]), w = b(async () => (m(), new Promise((i) => {
48
- l.current = {
49
- resolve: i
46
+ isLoading: F,
47
+ onAction: y
48
+ } = E(z, A), i = !!m.url, a = N ?? F, [S, q] = U(!1), p = x(async () => {
49
+ i || (await y(), q(!0));
50
+ }, [i, y]), R = x(async () => (p(), new Promise((s) => {
51
+ u.current = {
52
+ resolve: s
50
53
  };
51
- })), [m]), {
52
- onAction: A
53
- } = T(w, "auto-copy-shared-link");
54
- _(() => {
55
- p.current && (r ? A() : k && m(), p.current = !1);
56
- }, [p, r, k, m, A]), _(() => {
57
- n && r && f.current && f.current.click();
58
- }, [n, r]);
59
- const D = b((s) => {
60
- if (!l.current)
54
+ })), [p]), {
55
+ onAction: _
56
+ } = E(R, "auto-copy-shared-link");
57
+ D(() => {
58
+ k.current && (r ? _() : C && p(), k.current = !1);
59
+ }, [k, r, C, p, _]), D(() => {
60
+ i && r && L.current && L.current.click();
61
+ }, [i, r]);
62
+ const B = x((l) => {
63
+ if (!u.current)
61
64
  return;
62
- let i;
63
- s instanceof Error ? i = L ? e(t.autoCreateCopyErrorNoticeText) : null : i = e(L ? t.autoCreateCopySuccessNoticeText : t.autoCopySuccessNoticeText), i && l.current.resolve({
65
+ let s;
66
+ l instanceof Error ? s = S ? e(t.autoCreateCopyErrorNoticeText) : null : s = e(S ? t.autoCreateCopySuccessNoticeText : t.autoCopySuccessNoticeText), s && u.current.resolve({
64
67
  messages: [{
65
- text: i,
68
+ text: s,
66
69
  type: "success"
67
70
  }]
68
- }), l.current = null;
69
- }, [e, L]), q = async (s) => {
70
- !s && d && d("remove-shared-link"), s && await C();
71
+ }), u.current = null;
72
+ }, [e, S]), M = async (l) => {
73
+ !l && h && h("remove-shared-link"), l && await y();
71
74
  };
72
- return /* @__PURE__ */ h("div", {
73
- className: c.container,
74
- children: [/* @__PURE__ */ o(B, {
75
+ let c, f = !1;
76
+ return !i && !a && (c = e(t.sharedLinkToggleTooltip)), !i && !v.canShare && (c = e(t.createLinkDisabledTooltip), f = !0), i && !v.canSetShareAccess && (c = e(t.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ g("div", {
77
+ className: d.container,
78
+ children: [/* @__PURE__ */ n(K, {
75
79
  as: "label",
76
80
  variant: "bodyDefaultBold",
77
81
  children: e(t.shareLinkLabel)
78
- }), /* @__PURE__ */ h("div", {
79
- className: c.toggle,
80
- children: [/* @__PURE__ */ o(S, {
82
+ }), /* @__PURE__ */ g("div", {
83
+ className: d.toggle,
84
+ children: [/* @__PURE__ */ n(T, {
81
85
  align: "start",
82
- content: e(t.sharedLinkToggleTooltip),
86
+ content: c,
83
87
  "data-testid": "shared-link-tooltip",
84
- open: n ? !1 : void 0,
85
- children: /* @__PURE__ */ o(M.Item, {
86
- checked: n,
87
- disabled: g ?? v,
88
- label: e(t.sharedLinkToggleLabel),
89
- onCheckedChange: q,
90
- value: "shared-link"
88
+ open: c ? void 0 : !1,
89
+ children: /* @__PURE__ */ n(V, {
90
+ focusable: f,
91
+ children: /* @__PURE__ */ n(O.Item, {
92
+ checked: i,
93
+ disabled: f || a,
94
+ label: e(t.sharedLinkToggleLabel),
95
+ onCheckedChange: M,
96
+ value: "shared-link"
97
+ })
91
98
  })
92
- }), n && !!u.expiresAt && /* @__PURE__ */ o(S, {
99
+ }), i && !!m.expiresAt && /* @__PURE__ */ n(T, {
93
100
  content: e(t.expirationIconTooltip, {
94
- expirationDate: X(u.expiresAt)
101
+ expirationDate: ie(m.expiresAt)
95
102
  }),
96
103
  "data-testid": "expiration-date-tooltip",
97
- children: /* @__PURE__ */ o(U, {
98
- color: O,
104
+ children: /* @__PURE__ */ n(G, {
105
+ color: X,
99
106
  hideText: !0,
100
- icon: V,
107
+ icon: Q,
101
108
  text: e(t.expirationIconLabel)
102
109
  })
103
- }), n && a.sharedLinkSettings && /* @__PURE__ */ o(j, {
104
- className: c.settings,
105
- onClick: () => d("shared-link-settings"),
106
- onKeyDown: Y(() => d("shared-link-settings"), {
110
+ }), i && o.sharedLinkSettings && /* @__PURE__ */ n(H, {
111
+ "aria-disabled": a,
112
+ "aria-haspopup": "dialog",
113
+ className: d.settings,
114
+ onClick: () => h("shared-link-settings"),
115
+ onKeyDown: ne(() => h("shared-link-settings"), {
107
116
  canPreventDefault: !0
108
117
  }),
109
118
  role: "button",
110
- tabIndex: 0,
119
+ tabIndex: a ? -1 : 0,
111
120
  variant: "standalone",
112
121
  children: e(t.sharedLinkSettingsLabel)
113
122
  })]
114
- }), n && /* @__PURE__ */ h("div", {
115
- className: c.copy,
116
- children: [/* @__PURE__ */ o(G, {
117
- ref: f,
118
- autoFocus: k && n,
119
- disabled: g ?? v,
123
+ }), i && /* @__PURE__ */ g("div", {
124
+ className: d.copy,
125
+ children: [/* @__PURE__ */ n(Y, {
126
+ ref: L,
127
+ autoFocus: C && i,
128
+ disabled: a,
120
129
  hideLabel: !0,
121
130
  label: e(t.sharedLinkUrlLabel),
122
- onCopy: D,
123
- value: u.url
124
- }), a.sharedLinkEmail && /* @__PURE__ */ o(S, {
131
+ onCopy: B,
132
+ value: m.url
133
+ }), o.sharedLinkEmail && /* @__PURE__ */ n(T, {
125
134
  align: "end",
126
135
  content: e(t.sharedLinkEmailLabel),
127
- children: /* @__PURE__ */ o(K, {
136
+ children: /* @__PURE__ */ n(J, {
128
137
  "aria-label": e(t.sharedLinkEmailLabel),
129
- disabled: g,
130
- icon: z,
131
- onClick: () => E("email"),
138
+ disabled: a,
139
+ icon: W,
140
+ onClick: () => I("email"),
132
141
  size: "large",
133
142
  variant: "secondary"
134
143
  })
135
144
  })]
136
- }), n && (a.sharedLinkAccess || a.sharedLinkPermission) && /* @__PURE__ */ h("div", {
137
- className: c.access,
138
- children: [a.sharedLinkAccess && /* @__PURE__ */ o(H, {}), a.sharedLinkPermission && /* @__PURE__ */ o(J, {})]
145
+ }), i && (o.sharedLinkAccess || o.sharedLinkPermission) && /* @__PURE__ */ g("div", {
146
+ className: d.access,
147
+ children: [o.sharedLinkAccess && /* @__PURE__ */ n(Z, {}), o.sharedLinkPermission && /* @__PURE__ */ n($, {})]
139
148
  })]
140
149
  });
141
150
  }
142
151
  export {
143
- Le as SharedLinkSection
152
+ Te as SharedLinkSection
144
153
  };
@@ -1,72 +1,81 @@
1
1
  import y from "clsx";
2
- import { useState as h, useCallback as w } from "react";
3
- import { useIntl as x } from "react-intl";
4
- import { Modal as o, LoadingIndicator as N } from "@box/blueprint-web";
5
- import { UnifiedShareForm as U } from "./unified-share-form.js";
6
- import i from "./messages.js";
7
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
8
- import { UnifiedShareFormProvider as v } from "../../contexts/unified-share-form-context.js";
9
- import { useUnifiedShareModalContext as D } from "../../contexts/unified-share-modal-context.js";
10
- import '../../../../styles/unified-share-form-modal.css';const O = "_body_1udrf_1", P = "_hasFooter_1udrf_12", V = "_loading_1udrf_16", j = "_content_1udrf_38", t = {
11
- body: O,
12
- hasFooter: P,
13
- loading: V,
14
- content: j
2
+ import { useState as g, useCallback as w } from "react";
3
+ import { useIntl as N } from "react-intl";
4
+ import { Modal as o, Status as U, LoadingIndicator as I } from "@box/blueprint-web";
5
+ import { Shield as P } from "@box/blueprint-web-assets/icons/Line";
6
+ import { UnifiedShareForm as v } from "./unified-share-form.js";
7
+ import l from "./messages.js";
8
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
9
+ import { UnifiedShareFormProvider as D } from "../../contexts/unified-share-form-context.js";
10
+ import { useUnifiedShareModalContext as O } from "../../contexts/unified-share-modal-context.js";
11
+ import '../../../../styles/unified-share-form-modal.css';const V = "_content_1tnt5_1", j = "_header_1tnt5_5", z = "_body_1tnt5_12", B = "_hasFooter_1tnt5_23", L = "_loading_1tnt5_27", t = {
12
+ content: V,
13
+ header: j,
14
+ body: z,
15
+ hasFooter: B,
16
+ loading: L
15
17
  };
16
- function A({
18
+ function Q({
17
19
  children: d,
18
- isOpen: u,
19
- onOpenChange: n,
20
- onModalViewChange: g
20
+ isOpen: p,
21
+ onOpenChange: a,
22
+ onModalViewChange: u
21
23
  }) {
22
24
  const {
23
25
  formatMessage: r
24
- } = x(), {
25
- isFetching: p,
26
- item: _
27
- } = D(), {
28
- name: F
29
- } = _, [b, C] = h(null), [l, c] = h("default"), M = !!d, m = l !== "default", f = w((a) => {
30
- c("default"), n && n(a);
31
- }, [n]), S = (a) => {
32
- a.preventDefault();
26
+ } = N(), {
27
+ isFetching: _,
28
+ item: F
29
+ } = O(), {
30
+ classification: i,
31
+ name: S
32
+ } = F, [b, C] = g(null), [c, m] = g("default"), x = !!d, h = c !== "default", f = w((s) => {
33
+ m("default"), a && a(s);
34
+ }, [a]), M = (s) => {
35
+ s.preventDefault();
33
36
  };
34
- return /* @__PURE__ */ s(o, {
37
+ return /* @__PURE__ */ n(o, {
35
38
  onOpenChange: f,
36
- open: u,
37
- children: [M && /* @__PURE__ */ e(o.Trigger, {
39
+ open: p,
40
+ children: [x && /* @__PURE__ */ e(o.Trigger, {
38
41
  children: d
39
- }), /* @__PURE__ */ s(o.Content, {
42
+ }), /* @__PURE__ */ n(o.Content, {
40
43
  ref: C,
41
44
  className: t.content,
42
- onPointerDownOutside: S,
45
+ onPointerDownOutside: M,
43
46
  size: "medium",
44
- children: [/* @__PURE__ */ e(o.Header, {
45
- children: r(i.title, {
46
- itemName: F
47
- })
47
+ children: [/* @__PURE__ */ n(o.Header, {
48
+ className: t.header,
49
+ children: [r(l.title, {
50
+ itemName: S
51
+ }), i && /* @__PURE__ */ e(U, {
52
+ colorIndex: i.colorId + 1,
53
+ icon: P,
54
+ iconPosition: "left",
55
+ text: i.name.toUpperCase()
56
+ })]
48
57
  }), /* @__PURE__ */ e(o.Body, {
49
- className: y(t.body, m && t.hasFooter),
50
- children: /* @__PURE__ */ s(v, {
58
+ className: y(t.body, h && t.hasFooter),
59
+ children: /* @__PURE__ */ n(D, {
51
60
  container: b,
52
61
  onModalOpenChange: f,
53
- onModalViewChange: g,
54
- onShareViewChange: c,
55
- shareView: l,
56
- children: [p && /* @__PURE__ */ e("div", {
62
+ onModalViewChange: u,
63
+ onShareViewChange: m,
64
+ shareView: c,
65
+ children: [_ && /* @__PURE__ */ e("div", {
57
66
  className: t.loading,
58
- children: /* @__PURE__ */ e(N, {
59
- "aria-label": r(i.loadingLabel),
67
+ children: /* @__PURE__ */ e(I, {
68
+ "aria-label": r(l.loadingLabel),
60
69
  size: "large"
61
70
  })
62
- }), /* @__PURE__ */ e(U, {})]
71
+ }), /* @__PURE__ */ e(v, {})]
63
72
  })
64
- }), !m && /* @__PURE__ */ e(o.Close, {
65
- "aria-label": r(i.closeButton)
73
+ }), !h && /* @__PURE__ */ e(o.Close, {
74
+ "aria-label": r(l.closeButton)
66
75
  })]
67
76
  })]
68
77
  });
69
78
  }
70
79
  export {
71
- A as UnifiedShareFormModal
80
+ Q as UnifiedShareFormModal
72
81
  };
@@ -1,44 +1,45 @@
1
- import { useMemo as a } from "react";
2
- import { useIntl as x } from "react-intl";
1
+ import x from "lodash/camelCase";
2
+ import { useMemo as l } from "react";
3
+ import { useIntl as y } from "react-intl";
3
4
  import o from "../components/unified-share-form-modal/shared-link-section/messages.js";
4
- import { useUnifiedShareModalContext as y } from "../contexts/unified-share-modal-context.js";
5
- import { getAllowedAccessLevels as M } from "../utils/permission.js";
6
- const U = () => {
5
+ import { useUnifiedShareModalContext as M } from "../contexts/unified-share-modal-context.js";
6
+ import { getAllowedAccessLevels as $ } from "../utils/permission.js";
7
+ const k = () => {
7
8
  const {
8
9
  formatMessage: e
9
- } = x(), {
10
- currentUser: p,
11
- item: d,
12
- sharedLink: f
13
10
  } = y(), {
11
+ currentUser: p,
12
+ item: f,
13
+ sharedLink: d
14
+ } = M(), {
14
15
  enterprise: u = {}
15
16
  } = p, {
16
17
  name: s
17
18
  } = u, {
18
19
  type: n
19
- } = d, {
20
+ } = f, {
20
21
  access: i,
21
22
  accessLevels: m
22
- } = f, r = a(() => M(m).map((t) => {
23
+ } = d, r = l(() => $(m).map((t) => {
23
24
  const {
24
25
  description: A,
25
- id: l,
26
+ id: a,
26
27
  label: v
27
28
  } = t;
28
- let c = l;
29
- l === "company" && s && (c = "enterprise");
29
+ let c = a;
30
+ a === "company" && s && (c = "enterprise");
30
31
  const b = e(o[`${c}AccessLevelLabel`], {
31
32
  enterprise: s
32
33
  }), g = e(o[`${c}AccessLevelDescription`], {
33
34
  enterprise: s,
34
- item: e(o[`${n}AccessLevelItem`])
35
+ item: e(o[`${x(n)}AccessLevelItem`])
35
36
  });
36
37
  return {
37
38
  ...t,
38
39
  description: A ?? g,
39
40
  label: v ?? b
40
41
  };
41
- }), [m, s, e, n]), L = a(() => r.find(({
42
+ }), [m, s, e, n]), L = l(() => r.find(({
42
43
  id: t
43
44
  }) => i === t), [i, r]);
44
45
  return {
@@ -47,5 +48,5 @@ const U = () => {
47
48
  };
48
49
  };
49
50
  export {
50
- U as useAccessLevels
51
+ k as useAccessLevels
51
52
  };
@@ -3,14 +3,14 @@ import { useFormValidation as E } from "./use-form-validation.js";
3
3
  import { useSharingAction as A } from "./use-sharing-action.js";
4
4
  import { useUnifiedShareFormContext as M } from "../contexts/unified-share-form-context.js";
5
5
  import { useUnifiedShareModalContext as O } from "../contexts/unified-share-modal-context.js";
6
- const I = (p, v) => {
6
+ const I = (h, p) => {
7
7
  const {
8
- errors: f,
8
+ errors: d,
9
9
  setFieldError: a,
10
- validateUserContact: C,
10
+ validateUserContact: f,
11
11
  validateUserSelector: i
12
12
  } = E(), {
13
- contactService: h
13
+ contactService: v
14
14
  } = O(), {
15
15
  collaborationRole: F,
16
16
  messageValue: b,
@@ -22,9 +22,9 @@ const I = (p, v) => {
22
22
  } = M(), {
23
23
  isLoading: y,
24
24
  onAction: V
25
- } = A(p, v), {
25
+ } = A(h, p), {
26
26
  getContactByEmail: u
27
- } = h, S = () => {
27
+ } = v, C = () => {
28
28
  r([]), l(""), U(""), a("user-contact", "");
29
29
  }, w = s((t) => {
30
30
  a("user-contact", ""), l(t);
@@ -36,19 +36,19 @@ const I = (p, v) => {
36
36
  if (e && e.id)
37
37
  return e;
38
38
  }
39
- return C(t.value) ? null : {
39
+ return f(t.value) ? null : {
40
40
  email: t.value,
41
41
  id: 0,
42
42
  isExternalUser: !0,
43
43
  name: t.value,
44
44
  value: t.value
45
45
  };
46
- }, [u, C]), m = s(async (t) => {
46
+ }, [u, f]), m = s(async (t) => {
47
47
  if (a("user-contact", ""), i(t), o.length >= t.length) {
48
48
  r(t);
49
49
  return;
50
50
  }
51
- const [e, ...d] = [...t].reverse(), n = await g(e), c = n ? [...d, n] : d;
51
+ const [e, S] = [t.slice(0, -1), t[t.length - 1]], n = await g(S), c = n ? [...e, n] : e;
52
52
  r(c.filter(Boolean));
53
53
  }, [g, a, r, i, o]), B = s((t) => {
54
54
  var n, c;
@@ -58,16 +58,16 @@ const I = (p, v) => {
58
58
  }]);
59
59
  }, [m, o]);
60
60
  return {
61
- errors: f,
62
- handleFormReset: S,
61
+ errors: d,
62
+ handleFormReset: C,
63
63
  handleFormSubmit: async () => {
64
- if (f["user-contact"] || i(o))
64
+ if (d["user-contact"] || i(o))
65
65
  return !0;
66
66
  const t = {
67
67
  contacts: o,
68
68
  message: b
69
69
  };
70
- return x === "invite" && (t.role = F.id), await V(t), S(), !1;
70
+ return x === "invite" && (t.role = F.id), await V(t), C(), !1;
71
71
  },
72
72
  handleSelectedUsersChange: m,
73
73
  handleUserSelectorBlur: B,
@@ -26,7 +26,7 @@ const a = e({
26
26
  },
27
27
  updateSharedLinkSuccessNoticeText: {
28
28
  id: "groupSharedFeatures.usm.updateSharedLinkSuccessNoticeText",
29
- defaultMessage: "Your settings were saved successfully."
29
+ defaultMessage: "The shared link settings were saved successfully."
30
30
  },
31
31
  createSharedLinkSuccessNoticeText: {
32
32
  id: "groupSharedFeatures.usm.createSharedLinkSuccessNoticeText",
@@ -36,13 +36,17 @@ const a = e({
36
36
  id: "groupSharedFeatures.usm.createSharedLinkErrorNoticeText",
37
37
  defaultMessage: "Unable to create a shared link. Please try again later."
38
38
  },
39
+ emailSharedLinkSuccessNoticeText: {
40
+ id: "groupSharedFeatures.usm.emailSharedLinkSuccessNoticeText",
41
+ defaultMessage: "The shared link for “{itemName}” was sent successfully."
42
+ },
39
43
  autoCopySharedLinkErrorNoticeText: {
40
44
  id: "groupSharedFeatures.usm.autoCopySharedLinkErrorNoticeText",
41
45
  defaultMessage: "Unable to create a shared link. Please try again later."
42
46
  },
43
47
  vanityNameInvalidErrorMessage: {
44
48
  id: "groupSharedFeatures.usm.vanityNameInvalidErrorMessage",
45
- defaultMessage: "Custom URLs should be between 12-30 characters, and can include letters, numbers, and hyphens."
49
+ defaultMessage: "Custom URLs must be between 12-30 characters, and can include letters, numbers, and hyphens"
46
50
  },
47
51
  vanityNameRequiredErrorMessage: {
48
52
  id: "groupSharedFeatures.usm.vanityNameRequiredErrorMessage",
@@ -50,11 +54,11 @@ const a = e({
50
54
  },
51
55
  expirationRequiredErrorMessage: {
52
56
  id: "groupSharedFeatures.usm.expirationRequiredErrorMessage",
53
- defaultMessage: "Please select a date"
57
+ defaultMessage: "Please select an expiration date"
54
58
  },
55
59
  expirationFutureDateRequiredErrorMessage: {
56
60
  id: "groupSharedFeatures.usm.expirationFutureDateRequiredErrorMessage",
57
- defaultMessage: "The expiration date must be in the future"
61
+ defaultMessage: "Expiration date must be in the future"
58
62
  },
59
63
  invalidEmailErrorMessage: {
60
64
  id: "groupSharedFeatures.usm.invalidEmailErrorMessage",
@@ -70,15 +74,15 @@ const a = e({
70
74
  },
71
75
  passwordContainMinCharactersErrorMessage: {
72
76
  id: "groupSharedFeatures.usm.passwordContainMinCharactersErrorMessage",
73
- defaultMessage: "Password should contain at least 8 characters"
77
+ defaultMessage: "Password must contain at least 8 characters"
74
78
  },
75
79
  passwordContainInvalidCharacterErrorMessage: {
76
80
  id: "groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage",
77
- defaultMessage: 'Your password cannot contain a space, "<" or ">"'
81
+ defaultMessage: 'Password cannot contain a space, "<" or ">"'
78
82
  },
79
83
  passwordContainLetterNumberOrSymbolErrorMessage: {
80
84
  id: "groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage",
81
- defaultMessage: "Your password should contain at least one upper case letter, number, or special character."
85
+ defaultMessage: "Password must contain at least one upper case letter, number, or special character"
82
86
  }
83
87
  });
84
88
  export {