@box/unified-share-modal 0.48.5 → 0.48.6

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.
@@ -2,43 +2,43 @@ import { useMemo as G } from "react";
2
2
  import { useIntl as J } from "react-intl";
3
3
  import { Modal as r, Text as C, Link as K, Switch as c, DateI18nProvider as Q, DatePicker as X, InlineNotice as k, TextInput as L } from "@box/blueprint-web";
4
4
  import e from "./messages.js";
5
- import { jsx as n, jsxs as d, Fragment as S } from "react/jsx-runtime";
5
+ import { jsx as n, jsxs as d, Fragment as N } from "react/jsx-runtime";
6
6
  import { useAccessLevels as Z } from "../../hooks/use-access-levels.js";
7
7
  import { formatDateFromTimestampToCalendarDate as aa, formatTomorrowDateToCalendarDate as ea } from "../../utils/date.js";
8
8
  import { useLinkSettingsForm as na } from "../../hooks/use-link-settings-form.js";
9
9
  import { useUnifiedShareModalContext as ia } from "../../contexts/unified-share-modal-context.js";
10
- import '../../../../styles/shared-link-settings-modal.css';const oa = "_content_1wiic_1", ta = "_body_1wiic_5", P = {
10
+ import '../../../../styles/shared-link-settings-modal.css';const oa = "_content_1wiic_1", ta = "_body_1wiic_5", S = {
11
11
  content: oa,
12
12
  body: ta
13
13
  }, ra = "••••••••";
14
14
  function ua({
15
- isOpen: D,
16
- onOpenChange: h
15
+ isOpen: P,
16
+ onOpenChange: m
17
17
  }) {
18
18
  const {
19
19
  formatMessage: a
20
20
  } = J(), {
21
- eventService: N,
21
+ eventService: D,
22
22
  isSubmitting: T,
23
23
  sharedLink: f
24
24
  } = ia(), {
25
- expiresAt: v,
25
+ expiresAt: w,
26
26
  settings: i = {},
27
27
  vanityDomain: A,
28
- vanityName: g
28
+ vanityName: h
29
29
  } = f, {
30
- onSharedLinkSettingsClose: w
31
- } = N, {
32
- selectedAccess: m
33
- } = Z(), b = v ? aa(v) : void 0, p = G(() => ({
30
+ onSharedLinkSettingsClose: v
31
+ } = D, {
32
+ selectedAccess: g
33
+ } = Z(), b = w ? aa(w) : null, p = G(() => ({
34
34
  expiration: b,
35
35
  isDownloadEnabled: !!i.isDownloadEnabled,
36
36
  isExpirationEnabled: !!b,
37
37
  isPasswordEnabled: !!i.isPasswordEnabled,
38
- isVanityEnabled: !!g,
38
+ isVanityNameEnabled: !!h,
39
39
  password: "",
40
- vanityName: g || ""
41
- }), [b, i, g]), {
40
+ vanityName: h || ""
41
+ }), [b, i, h]), {
42
42
  errors: u,
43
43
  formData: t,
44
44
  handleFormReset: y,
@@ -48,15 +48,15 @@ function ua({
48
48
  setFieldValue: s,
49
49
  validatePassword: V
50
50
  } = na(p), B = () => {
51
- y(), w && w(), h(!1);
51
+ y(), v && v(), m(!1);
52
52
  }, M = async () => {
53
- await I() || (y(), h(!1));
53
+ await I() || (y(), m(!1));
54
54
  }, _ = (o) => {
55
55
  l("expiration", void 0), s("isExpirationEnabled", o);
56
56
  }, U = (o) => {
57
57
  l("expiration", void 0), s("expiration", o);
58
58
  }, R = (o) => {
59
- l("vanityName", void 0), s("isVanityEnabled", o);
59
+ l("vanityName", void 0), s("isVanityNameEnabled", o);
60
60
  }, W = (o) => {
61
61
  l("vanityName", void 0), s("vanityName", o.target.value);
62
62
  }, j = (o) => {
@@ -71,15 +71,15 @@ function ua({
71
71
  p.isPasswordEnabled && !t.password || q || V(t.password);
72
72
  }, H = i.canChangeVanityName && !!t.vanityName, Y = `${A || ""}${t.vanityName}`, x = T || F;
73
73
  return /* @__PURE__ */ n(r, {
74
- onOpenChange: h,
75
- open: D,
74
+ onOpenChange: m,
75
+ open: P,
76
76
  children: /* @__PURE__ */ d(r.Content, {
77
- className: P.content,
77
+ className: S.content,
78
78
  size: "medium",
79
79
  children: [/* @__PURE__ */ n(r.Header, {
80
80
  children: a(e.title)
81
81
  }), /* @__PURE__ */ d(r.Body, {
82
- className: P.body,
82
+ className: S.body,
83
83
  children: [/* @__PURE__ */ n(C, {
84
84
  as: "p",
85
85
  color: "textOnLightSecondary",
@@ -114,13 +114,13 @@ function ua({
114
114
  previousMonthAriaLabel: a(e.linkExpirationPreviousMonthAriaLabel),
115
115
  value: t.expiration
116
116
  })
117
- }), i.isPasswordAvailable && (m == null ? void 0 : m.id) === "open" && /* @__PURE__ */ n(c.Item, {
117
+ }), i.isPasswordAvailable && (g == null ? void 0 : g.id) === "open" && /* @__PURE__ */ n(c.Item, {
118
118
  checked: t.isPasswordEnabled,
119
119
  disabled: !i.canChangePassword,
120
120
  label: a(e.passwordToggleText),
121
121
  onCheckedChange: j,
122
122
  value: "password-settings"
123
- }), t.isPasswordEnabled && /* @__PURE__ */ d(S, {
123
+ }), t.isPasswordEnabled && /* @__PURE__ */ d(N, {
124
124
  children: [i.canChangePassword && /* @__PURE__ */ n(k, {
125
125
  variant: "warning",
126
126
  variantIconAriaLabel: a(e.warningNoticeIconAriaLabel),
@@ -138,12 +138,12 @@ function ua({
138
138
  value: t.password
139
139
  })]
140
140
  }), i.isVanityNameAvailable && /* @__PURE__ */ n(c.Item, {
141
- checked: t.isVanityEnabled,
141
+ checked: t.isVanityNameEnabled,
142
142
  disabled: !i.canChangeVanityName,
143
143
  label: a(e.vanityNameToggleText),
144
144
  onCheckedChange: R,
145
145
  value: "vanity-domain-settings"
146
- }), t.isVanityEnabled && /* @__PURE__ */ d(S, {
146
+ }), t.isVanityNameEnabled && /* @__PURE__ */ d(N, {
147
147
  children: [i.canChangeVanityName && /* @__PURE__ */ n(k, {
148
148
  variant: "warning",
149
149
  variantIconAriaLabel: a(e.warningNoticeIconAriaLabel),
@@ -1,108 +1,111 @@
1
- import { useCallback as C } from "react";
2
- import { createPortal as G } from "react-dom";
3
- import { useIntl as H } from "react-intl";
4
- import { useUniqueId as K, useLabelable as W, Modal as i } from "@box/blueprint-web";
5
- import { UserSelectorContainer as z } from "@box/user-selector";
6
- import { CollaborationRole as J } from "./collaboration-role.js";
7
- import { SharedWithAvatars as Q } from "./shared-with-avatars.js";
8
- import { TextAreaContainer as X } from "./text-area-container.js";
9
- import { COLLABORATION_MESSAGE_CHARACTER_LIMIT as Y } from "../../../constants.js";
10
- import o from "./messages.js";
11
- import { jsxs as s, jsx as a, Fragment as Z } from "react/jsx-runtime";
12
- import { useCollaborationForm as $ } from "../../../hooks/use-collaboration-form.js";
13
- import { useUnifiedShareFormContext as ee } from "../../../contexts/unified-share-form-context.js";
14
- import { useUnifiedShareModalContext as te } from "../../../contexts/unified-share-modal-context.js";
15
- import '../../../../../styles/collaboration-section.css';const oe = "_container_19jv3_1", ae = "_label_19jv3_7", U = {
16
- container: oe,
17
- label: ae
1
+ import { useRef as H, useEffect as K, useCallback as C } from "react";
2
+ import { createPortal as W } from "react-dom";
3
+ import { useIntl as z } from "react-intl";
4
+ import { useUniqueId as J, useLabelable as Q, Modal as i } from "@box/blueprint-web";
5
+ import { UserSelectorContainer as X } from "@box/user-selector";
6
+ import { CollaborationRole as Y } from "./collaboration-role.js";
7
+ import { SharedWithAvatars as Z } from "./shared-with-avatars.js";
8
+ import { TextAreaContainer as $ } from "./text-area-container.js";
9
+ import { COLLABORATION_MESSAGE_CHARACTER_LIMIT as ee } from "../../../constants.js";
10
+ import a from "./messages.js";
11
+ import { jsxs as s, jsx as n, Fragment as te } from "react/jsx-runtime";
12
+ import { useCollaborationForm as oe } from "../../../hooks/use-collaboration-form.js";
13
+ import { useUnifiedShareFormContext as ae } from "../../../contexts/unified-share-form-context.js";
14
+ import { useUnifiedShareModalContext as ne } from "../../../contexts/unified-share-modal-context.js";
15
+ import '../../../../../styles/collaboration-section.css';const re = "_container_19jv3_1", le = "_label_19jv3_7", A = {
16
+ container: re,
17
+ label: le
18
18
  };
19
- function ge() {
19
+ function Fe() {
20
20
  const {
21
- formatMessage: t
22
- } = H(), {
23
- contactValue: A,
21
+ formatMessage: o
22
+ } = z(), {
23
+ contactValue: B,
24
24
  container: c,
25
- onModalOpenChange: g,
25
+ onModalOpenChange: v,
26
26
  onShareViewChange: m,
27
- shareView: r,
28
- userContacts: v
29
- } = ee(), {
30
- config: n,
31
- contactService: B,
32
- isFetching: x,
27
+ shareView: e,
28
+ userContacts: g
29
+ } = ae(), {
30
+ config: r,
31
+ contactService: x,
32
+ isFetching: E,
33
33
  isSubmitting: u,
34
34
  sharingService: I
35
- } = te(), {
35
+ } = ne(), {
36
36
  getContacts: d,
37
- getContactsAvatarUrls: h
38
- } = B, {
39
- sendInvites: P,
37
+ getContactsAvatarUrls: f
38
+ } = x, {
39
+ sendInvitations: P,
40
40
  sendSharedLink: _
41
- } = I, f = r === "default" || r === "invite", l = r === "invite" || r === "email";
41
+ } = I, h = e === "default" || e === "invite", l = e === "invite" || e === "email", S = H(e === "email" ? "email" : "invite");
42
+ K(() => {
43
+ S.current = e === "email" ? "email" : "invite";
44
+ }, [e]);
42
45
  let b, p;
43
- r === "invite" && (b = P, p = "invite-collaborators"), r === "email" && (b = _, p = "email-shared-link");
46
+ e === "invite" && (b = P, p = "invite-collaborators"), e === "email" && (b = _, p = "email-shared-link");
44
47
  const {
45
- errors: E,
46
- handleFormReset: S,
47
- handleFormSubmit: O,
48
+ errors: O,
49
+ handleFormReset: F,
50
+ handleFormSubmit: V,
48
51
  handleSelectedUsersChange: M,
49
- handleUserSelectorBlur: V,
50
- isFormSubmitting: F,
52
+ handleUserSelectorBlur: R,
53
+ isFormSubmitting: L,
51
54
  updateContactValue: k
52
- } = $(b, p), N = C((e) => (e.stopPropagation(), !0), []), R = C((e) => d ? d(e) : Promise.resolve([]), [d]), y = C((e) => h ? h(e) : Promise.resolve({}), [h]), T = (e) => {
53
- l || m("invite"), k(e);
54
- }, j = () => {
55
- S(), m("default");
56
- }, w = async () => {
57
- await O() || (S(), g && g(!1), m("default"));
58
- }, L = K("user-contacts-"), q = t(f ? o.invitePeopleLabel : o.emailSharedLinkLabel), D = W(q, L);
55
+ } = oe(b, p), N = C((t) => (t.stopPropagation(), !0), []), y = C((t) => d ? d(t, S.current) : Promise.resolve([]), [d]), T = C((t) => f ? f(t) : Promise.resolve({}), [f]), j = (t) => {
56
+ l || m("invite"), k(t);
57
+ }, w = () => {
58
+ F(), m("default");
59
+ }, q = async () => {
60
+ await V() || (F(), v && v(!1), m("default"));
61
+ }, U = J("user-contacts-"), D = o(h ? a.invitePeopleLabel : a.emailSharedLinkLabel), G = Q(D, U);
59
62
  return /* @__PURE__ */ s("form", {
60
- className: U.container,
61
- onSubmit: (e) => e.preventDefault(),
62
- children: [n.collaborationNotices, /* @__PURE__ */ s("div", {
63
- children: [f && n.collaborators && /* @__PURE__ */ a(Q, {}), /* @__PURE__ */ a(D, {
64
- className: U.label
65
- }), /* @__PURE__ */ a(z, {
63
+ className: A.container,
64
+ onSubmit: (t) => t.preventDefault(),
65
+ children: [r.collaborationNotices, /* @__PURE__ */ s("div", {
66
+ children: [h && r.collaborators && /* @__PURE__ */ n(Z, {}), /* @__PURE__ */ n(G, {
67
+ className: A.label
68
+ }), /* @__PURE__ */ n(X, {
66
69
  className: "collaboration-user-selector",
67
- clearButtonAriaLabel: t(o.clearButton),
70
+ clearButtonAriaLabel: o(a.clearButton),
68
71
  clearOnBlur: !1,
69
72
  disabled: u,
70
- error: E["user-contact"],
71
- fetchAvatarUrls: y,
72
- fetchUsers: R,
73
+ error: O["user-contact"],
74
+ fetchAvatarUrls: T,
75
+ fetchUsers: y,
73
76
  hideOnEscape: N,
74
- idForLabel: L,
75
- inputValue: A,
77
+ idForLabel: U,
78
+ inputValue: B,
76
79
  label: null,
77
- onBlur: V,
78
- onInputValueChange: T,
80
+ onBlur: R,
81
+ onInputValueChange: j,
79
82
  onSelectedUsersChange: M,
80
- placeholder: v.length ? "" : t(o.invitePeoplePlaceholder),
83
+ placeholder: g.length ? "" : o(a.invitePeoplePlaceholder),
81
84
  portalElement: c,
82
- selectedUsers: v,
85
+ selectedUsers: g,
83
86
  selectOnEnterOrTab: !0,
84
87
  variant: l ? "textarea" : "input"
85
- }), f && n.collaborationRole && /* @__PURE__ */ a(J, {})]
86
- }), l && n.collaborationMessage && /* @__PURE__ */ a(X, {
87
- maxCount: Y
88
- }), l && c && /* @__PURE__ */ G(/* @__PURE__ */ s(Z, {
89
- children: [!x && /* @__PURE__ */ s(i.Footer, {
90
- children: [/* @__PURE__ */ a(i.Footer.SecondaryButton, {
91
- disabled: u ?? F,
92
- onClick: j,
93
- children: t(o.cancelButton)
94
- }), /* @__PURE__ */ a(i.Footer.PrimaryButton, {
95
- loading: u ?? F,
96
- loadingAriaLabel: t(o.loadingLabel),
88
+ }), h && r.collaborationRole && /* @__PURE__ */ n(Y, {})]
89
+ }), l && r.collaborationMessage && /* @__PURE__ */ n($, {
90
+ maxCount: ee
91
+ }), l && c && /* @__PURE__ */ W(/* @__PURE__ */ s(te, {
92
+ children: [!E && /* @__PURE__ */ s(i.Footer, {
93
+ children: [/* @__PURE__ */ n(i.Footer.SecondaryButton, {
94
+ disabled: u ?? L,
97
95
  onClick: w,
98
- children: t(o.sendButton)
96
+ children: o(a.cancelButton)
97
+ }), /* @__PURE__ */ n(i.Footer.PrimaryButton, {
98
+ loading: u ?? L,
99
+ loadingAriaLabel: o(a.loadingLabel),
100
+ onClick: q,
101
+ children: o(a.sendButton)
99
102
  })]
100
- }), /* @__PURE__ */ a(i.Close, {
101
- "aria-label": t(o.closeButton)
103
+ }), /* @__PURE__ */ n(i.Close, {
104
+ "aria-label": o(a.closeButton)
102
105
  })]
103
106
  }), c)]
104
107
  });
105
108
  }
106
109
  export {
107
- ge as CollaborationSection
110
+ Fe as CollaborationSection
108
111
  };
@@ -1,67 +1,69 @@
1
- import _ from "clsx";
2
- import { useState as C } from "react";
3
- import { useIntl as L } from "react-intl";
4
- import { DropdownMenu as n, TriggerButton as k, Tooltip as A, Focusable as M } from "@box/blueprint-web";
5
- import I from "./messages.js";
6
- import { jsxs as z, jsx as e } from "react/jsx-runtime";
7
- import { useUnifiedShareModalContext as T } from "../../../contexts/unified-share-modal-context.js";
8
- import { useSharingAction as q } from "../../../hooks/use-sharing-action.js";
9
- import { useAccessLevels as w } from "../../../hooks/use-access-levels.js";
10
- import '../../../../../styles/shared-link-access.css';const O = "_container_xhq4z_1", j = "_overrides_xhq4z_1", y = "_content_xhq4z_6", o = {
11
- container: O,
12
- overrides: j,
13
- content: y
1
+ import L from "clsx";
2
+ import { useState as k } from "react";
3
+ import { useIntl as A } from "react-intl";
4
+ import { DropdownMenu as n, TriggerButton as M, Tooltip as I, Focusable as z } from "@box/blueprint-web";
5
+ import T from "./messages.js";
6
+ import { jsxs as q, jsx as e } from "react/jsx-runtime";
7
+ import { useUnifiedShareModalContext as w } from "../../../contexts/unified-share-modal-context.js";
8
+ import { useSharingAction as O } from "../../../hooks/use-sharing-action.js";
9
+ import { useAccessLevels as j } from "../../../hooks/use-access-levels.js";
10
+ import '../../../../../styles/shared-link-access.css';const y = "_container_xhq4z_1", D = "_overrides_xhq4z_1", N = "_content_xhq4z_6", s = {
11
+ container: y,
12
+ overrides: D,
13
+ content: N
14
14
  };
15
- function J() {
15
+ function P() {
16
16
  const {
17
17
  formatMessage: d
18
- } = L(), [s, m] = C(!1), {
18
+ } = A(), [c, m] = k(!1), {
19
19
  isSubmitting: h,
20
20
  sharedLink: p,
21
21
  sharingService: u
22
- } = T(), {
23
- access: r
22
+ } = w(), {
23
+ access: f
24
24
  } = p, {
25
- changeSharedLinkAccess: f
25
+ changeSharedLinkAccess: g
26
26
  } = u, {
27
- isLoading: g,
28
- onAction: b
29
- } = q(f), {
30
- allowedLevels: c,
27
+ isLoading: b,
28
+ onAction: x
29
+ } = O(g), {
30
+ allowedLevels: r,
31
31
  selectedAccess: i
32
- } = w();
33
- if (!c.length || !i)
32
+ } = j();
33
+ if (!r.length || !i)
34
34
  return null;
35
35
  const {
36
- label: x
36
+ label: S
37
37
  } = i;
38
- return /* @__PURE__ */ z(n.Root, {
38
+ return /* @__PURE__ */ q(n.Root, {
39
39
  onOpenChange: m,
40
- open: s,
40
+ open: c,
41
41
  children: [/* @__PURE__ */ e(n.Trigger, {
42
- children: /* @__PURE__ */ e(k, {
43
- caretDirection: s ? "up" : "down",
44
- className: _(o.container, o.overrides),
45
- disabled: h ?? g,
46
- label: x,
42
+ children: /* @__PURE__ */ e(M, {
43
+ caretDirection: c ? "up" : "down",
44
+ className: L(s.container, s.overrides),
45
+ disabled: h ?? b,
46
+ label: S,
47
47
  size: "extraSmall",
48
48
  variant: "tertiary"
49
49
  })
50
50
  }), /* @__PURE__ */ e(n.Content, {
51
51
  align: "start",
52
- className: o.content,
53
- children: c.map((v) => {
52
+ className: s.content,
53
+ children: r.map((v) => {
54
54
  const {
55
55
  description: a,
56
- disabledReason: S,
56
+ disabledReason: _,
57
57
  id: t,
58
58
  label: l
59
- } = v;
60
- return S ? /* @__PURE__ */ e(A, {
61
- content: d(I.disabledAccessLevelTooltip),
62
- children: /* @__PURE__ */ e(M, {
59
+ } = v, o = f === t, C = () => {
60
+ o || x(t);
61
+ };
62
+ return _ ? /* @__PURE__ */ e(I, {
63
+ content: d(T.disabledAccessLevelTooltip),
64
+ children: /* @__PURE__ */ e(z, {
63
65
  children: /* @__PURE__ */ e(n.CheckboxItem, {
64
- checked: r === t,
66
+ checked: o,
65
67
  disabled: !0,
66
68
  children: /* @__PURE__ */ e(n.Item.MainContent, {
67
69
  caption: a,
@@ -70,8 +72,8 @@ function J() {
70
72
  }, t)
71
73
  })
72
74
  }, t) : /* @__PURE__ */ e(n.CheckboxItem, {
73
- checked: r === t,
74
- onSelect: () => b(t),
75
+ checked: o,
76
+ onSelect: C,
75
77
  children: /* @__PURE__ */ e(n.Item.MainContent, {
76
78
  caption: a,
77
79
  label: l
@@ -82,5 +84,5 @@ function J() {
82
84
  });
83
85
  }
84
86
  export {
85
- J as SharedLinkAccess
87
+ P as SharedLinkAccess
86
88
  };
@@ -1,70 +1,72 @@
1
- import b from "clsx";
2
- import { useState as v } from "react";
3
- import { DropdownMenu as e, TriggerButton as L } from "@box/blueprint-web";
4
- import { jsxs as C, jsx as n } from "react/jsx-runtime";
5
- import { usePermissionLevels as k } from "../../../hooks/use-permission-levels.js";
6
- import { useUnifiedShareModalContext as M } from "../../../contexts/unified-share-modal-context.js";
7
- import { useSharingAction as z } from "../../../hooks/use-sharing-action.js";
8
- import '../../../../../styles/shared-link-access.css';const P = "_container_xhq4z_1", q = "_overrides_xhq4z_1", w = "_content_xhq4z_6", t = {
9
- container: P,
10
- overrides: q,
11
- content: w
1
+ import L from "clsx";
2
+ import { useState as C } from "react";
3
+ import { DropdownMenu as e, TriggerButton as k } from "@box/blueprint-web";
4
+ import { jsxs as M, jsx as n } from "react/jsx-runtime";
5
+ import { usePermissionLevels as z } from "../../../hooks/use-permission-levels.js";
6
+ import { useUnifiedShareModalContext as P } from "../../../contexts/unified-share-modal-context.js";
7
+ import { useSharingAction as q } from "../../../hooks/use-sharing-action.js";
8
+ import '../../../../../styles/shared-link-access.css';const w = "_container_xhq4z_1", I = "_overrides_xhq4z_1", O = "_content_xhq4z_6", o = {
9
+ container: w,
10
+ overrides: I,
11
+ content: O
12
12
  };
13
- function T() {
14
- const [r, c] = v(!1), {
15
- isSubmitting: a,
16
- sharedLink: l,
13
+ function R() {
14
+ const [r, a] = C(!1), {
15
+ isSubmitting: l,
16
+ sharedLink: d,
17
17
  sharingService: m
18
- } = M(), {
19
- access: d,
20
- permission: h
21
- } = l, {
22
- changeSharedLinkPermission: p
18
+ } = P(), {
19
+ access: h,
20
+ permission: p
21
+ } = d, {
22
+ changeSharedLinkPermission: u
23
23
  } = m, {
24
- isLoading: u,
25
- onAction: g
26
- } = z(p), {
24
+ isLoading: g,
25
+ onAction: f
26
+ } = q(u), {
27
27
  allowedLevels: i,
28
28
  selectedPermission: s
29
- } = k();
30
- if (d === "collaborators" || !i.length || !s)
29
+ } = z();
30
+ if (h === "collaborators" || !i.length || !s)
31
31
  return null;
32
32
  const {
33
- label: f
33
+ label: S
34
34
  } = s;
35
- return /* @__PURE__ */ C(e.Root, {
36
- onOpenChange: c,
35
+ return /* @__PURE__ */ M(e.Root, {
36
+ onOpenChange: a,
37
37
  open: r,
38
38
  children: [/* @__PURE__ */ n(e.Trigger, {
39
- children: /* @__PURE__ */ n(L, {
39
+ children: /* @__PURE__ */ n(k, {
40
40
  caretDirection: r ? "up" : "down",
41
- className: b(t.container, t.overrides),
42
- disabled: a ?? u,
43
- label: f,
41
+ className: L(o.container, o.overrides),
42
+ disabled: l ?? g,
43
+ label: S,
44
44
  size: "extraSmall",
45
45
  variant: "tertiary"
46
46
  })
47
47
  }), /* @__PURE__ */ n(e.Content, {
48
48
  align: "start",
49
- className: t.content,
49
+ className: o.content,
50
50
  children: i.map((x) => {
51
51
  const {
52
- description: S,
53
- id: o,
54
- label: _
55
- } = x;
52
+ description: _,
53
+ id: t,
54
+ label: b
55
+ } = x, c = p === t, v = () => {
56
+ c || f(t);
57
+ };
56
58
  return /* @__PURE__ */ n(e.CheckboxItem, {
57
- checked: h === o,
58
- onSelect: () => g(o),
59
+ checked: c,
60
+ onSelect: v,
59
61
  children: /* @__PURE__ */ n(e.Item.MainContent, {
60
- caption: S,
61
- label: _
62
+ caption: _,
63
+ label: b
62
64
  })
63
- }, o);
65
+ }, t);
64
66
  })
65
67
  })]
66
68
  });
67
69
  }
68
70
  export {
69
- T as SharedLinkPermission
71
+ R as SharedLinkPermission
70
72
  };
@@ -1,31 +1,34 @@
1
1
  import { useCallback as s } from "react";
2
- import { useFormValidation as V } from "./use-form-validation.js";
3
- import { useSharingAction as w } from "./use-sharing-action.js";
4
- import { useUnifiedShareFormContext as B } from "../contexts/unified-share-form-context.js";
5
- import { useUnifiedShareModalContext as E } from "../contexts/unified-share-modal-context.js";
6
- const q = (v, F) => {
2
+ import { useFormValidation as E } from "./use-form-validation.js";
3
+ import { useSharingAction as A } from "./use-sharing-action.js";
4
+ import { useUnifiedShareFormContext as M } from "../contexts/unified-share-form-context.js";
5
+ import { useUnifiedShareModalContext as O } from "../contexts/unified-share-modal-context.js";
6
+ const I = (p, v) => {
7
7
  const {
8
8
  errors: f,
9
- setFieldError: o,
9
+ setFieldError: a,
10
10
  validateUserContact: C,
11
11
  validateUserSelector: i
12
- } = V(), {
13
- contactService: g
14
12
  } = E(), {
13
+ contactService: h
14
+ } = O(), {
15
+ collaborationRole: F,
16
+ messageValue: b,
15
17
  setContactValue: l,
16
- setMessageValue: h,
17
- setUserContacts: a,
18
- userContacts: n
19
- } = B(), {
20
- isLoading: b,
21
- onAction: U
22
- } = w(v, F), {
18
+ setMessageValue: U,
19
+ setUserContacts: r,
20
+ shareView: x,
21
+ userContacts: o
22
+ } = M(), {
23
+ isLoading: y,
24
+ onAction: V
25
+ } = A(p, v), {
23
26
  getContactByEmail: u
24
- } = g, S = () => {
25
- a([]), l(""), h(""), o("user-contact", "");
26
- }, x = s((t) => {
27
- o("user-contact", ""), l(t);
28
- }, [l, o]), p = s(async (t) => {
27
+ } = h, S = () => {
28
+ r([]), l(""), U(""), a("user-contact", "");
29
+ }, w = s((t) => {
30
+ a("user-contact", ""), l(t);
31
+ }, [l, a]), g = s(async (t) => {
29
32
  if (t.id)
30
33
  return t;
31
34
  if (u) {
@@ -41,29 +44,37 @@ const q = (v, F) => {
41
44
  value: t.value
42
45
  };
43
46
  }, [u, C]), m = s(async (t) => {
44
- if (o("user-contact", ""), i(t), n.length >= t.length) {
45
- a(t);
47
+ if (a("user-contact", ""), i(t), o.length >= t.length) {
48
+ r(t);
46
49
  return;
47
50
  }
48
- const [e, ...d] = [...t].reverse(), r = await p(e), c = r ? [...d, r] : d;
49
- a(c.filter(Boolean));
50
- }, [p, o, a, i, n]), y = s((t) => {
51
- var r, c;
52
- const e = (r = t.relatedTarget) == null ? void 0 : r.closest(".collaboration-user-selector");
53
- (c = document.querySelector('div[role="listbox"][aria-labelledby^="user-contacts"]')) != null && c.contains(t.relatedTarget) || e || m([...n, {
51
+ const [e, ...d] = [...t].reverse(), n = await g(e), c = n ? [...d, n] : d;
52
+ r(c.filter(Boolean));
53
+ }, [g, a, r, i, o]), B = s((t) => {
54
+ var n, c;
55
+ const e = (n = t.relatedTarget) == null ? void 0 : n.closest(".collaboration-user-selector");
56
+ (c = document.querySelector('div[role="listbox"][aria-labelledby^="user-contacts"]')) != null && c.contains(t.relatedTarget) || e || m([...o, {
54
57
  value: t.target.value
55
58
  }]);
56
- }, [m, n]);
59
+ }, [m, o]);
57
60
  return {
58
61
  errors: f,
59
62
  handleFormReset: S,
60
- handleFormSubmit: async () => f["user-contact"] || i(n) ? !0 : (await U({}), S(), !1),
63
+ handleFormSubmit: async () => {
64
+ if (f["user-contact"] || i(o))
65
+ return !0;
66
+ const t = {
67
+ contacts: o,
68
+ message: b
69
+ };
70
+ return x === "invite" && (t.role = F.id), await V(t), S(), !1;
71
+ },
61
72
  handleSelectedUsersChange: m,
62
- handleUserSelectorBlur: y,
63
- isFormSubmitting: b,
64
- updateContactValue: x
73
+ handleUserSelectorBlur: B,
74
+ isFormSubmitting: y,
75
+ updateContactValue: w
65
76
  };
66
77
  };
67
78
  export {
68
- q as useCollaborationForm
79
+ I as useCollaborationForm
69
80
  };
@@ -1,58 +1,62 @@
1
- import { useState as N, useCallback as d } from "react";
2
- import { useFormValidation as b } from "./use-form-validation.js";
3
- import { useSharingAction as P } from "./use-sharing-action.js";
4
- import { getSharedLinkFormValidation as U } from "../utils/validation.js";
5
- import { useUnifiedShareModalContext as A } from "../contexts/unified-share-modal-context.js";
6
- const q = (t) => {
7
- const [o, a] = N(t), {
8
- errors: l,
1
+ import { useState as P, useCallback as d } from "react";
2
+ import { useFormValidation as A } from "./use-form-validation.js";
3
+ import { useSharingAction as C } from "./use-sharing-action.js";
4
+ import { getUpdatedLinkSettingsFormData as j } from "../utils/form.js";
5
+ import { useUnifiedShareModalContext as M } from "../contexts/unified-share-modal-context.js";
6
+ const G = (r) => {
7
+ const [e, o] = P(r), {
8
+ errors: h,
9
9
  setErrors: c,
10
10
  setFieldError: s,
11
- validateExpiration: u,
12
- validatePassword: n,
13
- validateVanityName: m
14
- } = b(), {
15
- sharedLink: f,
16
- sharingService: E
11
+ validateExpiration: m,
12
+ validatePassword: a,
13
+ validateVanityName: p
17
14
  } = A(), {
18
- settings: p
19
- } = f, {
20
- updateSharedLink: S
21
- } = E, {
22
- isLoading: g,
23
- onAction: h
24
- } = P(S, "update-shared-link"), V = d((r, e) => {
25
- a((i) => ({
15
+ sharingService: l
16
+ } = M(), {
17
+ updateSharedLink: E
18
+ } = l, {
19
+ isLoading: f,
20
+ onAction: u
21
+ } = C(E, "update-shared-link"), S = d((t, n) => {
22
+ o((i) => ({
26
23
  ...i,
27
- [r]: e
24
+ [t]: n
28
25
  }));
29
- }, []), k = d(() => {
30
- a(t), c({});
31
- }, [t, c, a]), x = d(async () => {
32
- const {
33
- updatedFormData: r,
34
- shouldValidate: e
35
- } = U(p, o, t), i = e.expiration && u(r.updatedExpiration), y = e.password && n(r.updatedPassword), v = e.vanityName && m(r.updatedVanityName);
36
- if (i || y || v)
26
+ }, []), g = d(() => {
27
+ o(r), c({});
28
+ }, [r, c, o]), b = d(async () => {
29
+ const t = j(e, r), {
30
+ expiration: n,
31
+ isExpirationEnabled: i,
32
+ isPasswordEnabled: x,
33
+ isVanityNameEnabled: y,
34
+ password: k,
35
+ vanityName: v
36
+ } = t, w = i && m(n), V = x && a(k), F = y && p(v);
37
+ if (w || V || F)
37
38
  return !0;
38
39
  try {
39
- await h(r);
40
- } catch (w) {
41
- return Object.entries(w).forEach(([F, L]) => s(F, L)), !0;
40
+ await u({
41
+ ...r,
42
+ ...t
43
+ });
44
+ } catch (L) {
45
+ return Object.entries(L).forEach(([N, U]) => s(N, U)), !0;
42
46
  }
43
47
  return !1;
44
- }, [o, t, h, s, p, u, n, m]);
48
+ }, [e, r, u, s, m, a, p]);
45
49
  return {
46
- errors: l,
47
- formData: o,
48
- handleFormReset: k,
49
- handleFormSubmit: x,
50
- isUpdating: g,
50
+ errors: h,
51
+ formData: e,
52
+ handleFormReset: g,
53
+ handleFormSubmit: b,
54
+ isUpdating: f,
51
55
  setFieldError: s,
52
- setFieldValue: V,
53
- validatePassword: n
56
+ setFieldValue: S,
57
+ validatePassword: a
54
58
  };
55
59
  };
56
60
  export {
57
- q as useLinkSettingsForm
61
+ G as useLinkSettingsForm
58
62
  };
@@ -1,14 +1,14 @@
1
1
  import { toCalendarDate as e, fromAbsolute as o, getLocalTimeZone as a, DateFormatter as m } from "@box/blueprint-web";
2
- const D = 1e3, c = 24 * 60 * 60 * D, s = (t) => e(o(t, a())), d = (t) => {
2
+ const D = 1e3, c = 24 * 60 * 60 * D, s = (t) => e(o(t, a())), u = (t) => {
3
3
  const r = navigator.language || "en-US", n = s(t).toDate(a());
4
4
  return new m(r, {
5
5
  day: "numeric",
6
6
  month: "long",
7
7
  year: "numeric"
8
8
  }).format(n);
9
- }, u = () => e(o(Date.now() + c, a()));
9
+ }, d = () => e(o(Date.now() + c, a()));
10
10
  export {
11
11
  s as formatDateFromTimestampToCalendarDate,
12
- d as formatDateFromTimestampToDateString,
13
- u as formatTomorrowDateToCalendarDate
12
+ u as formatDateFromTimestampToDateString,
13
+ d as formatTomorrowDateToCalendarDate
14
14
  };
@@ -0,0 +1,16 @@
1
+ const r = (b, i) => {
2
+ var E;
3
+ const {
4
+ expiration: a,
5
+ isDownloadEnabled: l,
6
+ isExpirationEnabled: s,
7
+ isPasswordEnabled: d,
8
+ isVanityNameEnabled: o,
9
+ password: t,
10
+ vanityName: e
11
+ } = b, n = {};
12
+ return l !== i.isDownloadEnabled && (n.isDownloadEnabled = l), (s !== i.isExpirationEnabled || (a == null ? void 0 : a.toString()) !== ((E = i.expiration) == null ? void 0 : E.toString())) && (n.isExpirationEnabled = s, n.expiration = s ? a : null), (d !== i.isPasswordEnabled || t !== i.password) && (n.isPasswordEnabled = d, n.password = d ? t : null), (o !== i.isVanityNameEnabled || e !== i.vanityName) && (n.isVanityNameEnabled = o, n.vanityName = o ? e : null), n;
13
+ };
14
+ export {
15
+ r as getUpdatedLinkSettingsFormData
16
+ };
@@ -1,27 +1,28 @@
1
1
  import { getAvatarBadgeSize as a, getDefaultCollaborationRole as t, getFirstInitial as r, isCollaboratorRoleSupported as s, isInvitationRoleSupported as i } from "./collaborator.js";
2
2
  import { formatDateFromTimestampToCalendarDate as d, formatDateFromTimestampToDateString as l, formatTomorrowDateToCalendarDate as m } from "./date.js";
3
- import { callOnKeyboardEvent as p } from "./event.js";
4
- import { getAllowedAccessLevels as w, getAllowedPermissionLevels as g } from "./permission.js";
5
- import { doesPasswordContainInvalidCharacter as P, doesPasswordContainLetter as v, doesPasswordContainMinCharacters as x, doesPasswordContainMixedCase as S, doesPasswordContainNumber as T, doesPasswordContainSymbol as b, getSharedLinkFormValidation as c, isEmailValid as u, isVanityNameValid as A } from "./validation.js";
3
+ import { callOnKeyboardEvent as C } from "./event.js";
4
+ import { getUpdatedLinkSettingsFormData as g } from "./form.js";
5
+ import { getAllowedAccessLevels as D, getAllowedPermissionLevels as x } from "./permission.js";
6
+ import { doesPasswordContainInvalidCharacter as v, doesPasswordContainLetter as S, doesPasswordContainMinCharacters as T, doesPasswordContainMixedCase as b, doesPasswordContainNumber as c, doesPasswordContainSymbol as u, isEmailValid as A, isVanityNameValid as F } from "./validation.js";
6
7
  export {
7
- p as callOnKeyboardEvent,
8
- P as doesPasswordContainInvalidCharacter,
9
- v as doesPasswordContainLetter,
10
- x as doesPasswordContainMinCharacters,
11
- S as doesPasswordContainMixedCase,
12
- T as doesPasswordContainNumber,
13
- b as doesPasswordContainSymbol,
8
+ C as callOnKeyboardEvent,
9
+ v as doesPasswordContainInvalidCharacter,
10
+ S as doesPasswordContainLetter,
11
+ T as doesPasswordContainMinCharacters,
12
+ b as doesPasswordContainMixedCase,
13
+ c as doesPasswordContainNumber,
14
+ u as doesPasswordContainSymbol,
14
15
  d as formatDateFromTimestampToCalendarDate,
15
16
  l as formatDateFromTimestampToDateString,
16
17
  m as formatTomorrowDateToCalendarDate,
17
- w as getAllowedAccessLevels,
18
- g as getAllowedPermissionLevels,
18
+ D as getAllowedAccessLevels,
19
+ x as getAllowedPermissionLevels,
19
20
  a as getAvatarBadgeSize,
20
21
  t as getDefaultCollaborationRole,
21
22
  r as getFirstInitial,
22
- c as getSharedLinkFormValidation,
23
+ g as getUpdatedLinkSettingsFormData,
23
24
  s as isCollaboratorRoleSupported,
24
- u as isEmailValid,
25
+ A as isEmailValid,
25
26
  i as isInvitationRoleSupported,
26
- A as isVanityNameValid
27
+ F as isVanityNameValid
27
28
  };
@@ -1,43 +1,11 @@
1
- const P = /^[a-zA-Z0-9-]{12,30}$/, g = /^[A-Z0-9._'%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, h = (a) => P.test(a), v = (a) => g.test(a), N = (a) => a.length >= 8, V = (a) => a.replace(/\D/g, "").length >= 1, f = (a) => a.replace(/\s/g, "").replace(/\w/g, "").length >= 1, y = (a) => /[a-zA-Z]/.test(a), x = (a) => /[a-z]/.test(a) && /[A-Z]/.test(a), D = (a) => /[\s<>]/.test(a), Z = (a, d, r) => {
2
- const {
3
- expiration: l,
4
- isDownloadEnabled: c,
5
- isExpirationEnabled: n,
6
- isPasswordEnabled: s,
7
- isVanityEnabled: o,
8
- password: i,
9
- vanityName: u
10
- } = d, {
11
- canChangeDownload: p,
12
- canChangeExpiration: w,
13
- canChangeVanityName: E,
14
- canChangePassword: m,
15
- isDownloadAvailable: C,
16
- isPasswordAvailable: b,
17
- isVanityNameAvailable: A
18
- } = a, e = {
19
- updatedExpiration: n ? l : 0,
20
- updatedPassword: s ? i : "",
21
- updatedVanityName: o ? u : "",
22
- updatedIsDownloadEnabled: c
23
- }, t = {
24
- expiration: !1,
25
- password: !1,
26
- vanityName: !1
27
- };
28
- return w ? n && (t.expiration = !0) : e.updatedExpiration = void 0, !b || !m || r.isPasswordEnabled && !i ? e.updatedPassword = void 0 : s && (t.password = !0), !A || !E ? e.updatedVanityName = void 0 : o && (t.vanityName = !0), (!C || !p) && (e.updatedIsDownloadEnabled = void 0), {
29
- updatedFormData: e,
30
- shouldValidate: t
31
- };
32
- };
1
+ const e = /^[a-zA-Z0-9-]{12,30}$/, s = /^[A-Z0-9._'%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, n = (t) => e.test(t), r = (t) => s.test(t), o = (t) => t.length >= 8, a = (t) => t.replace(/\D/g, "").length >= 1, i = (t) => t.replace(/\s/g, "").replace(/\w/g, "").length >= 1, c = (t) => /[a-zA-Z]/.test(t), d = (t) => /[a-z]/.test(t) && /[A-Z]/.test(t), l = (t) => /[\s<>]/.test(t);
33
2
  export {
34
- D as doesPasswordContainInvalidCharacter,
35
- y as doesPasswordContainLetter,
36
- N as doesPasswordContainMinCharacters,
37
- x as doesPasswordContainMixedCase,
38
- V as doesPasswordContainNumber,
39
- f as doesPasswordContainSymbol,
40
- Z as getSharedLinkFormValidation,
41
- v as isEmailValid,
42
- h as isVanityNameValid
3
+ l as doesPasswordContainInvalidCharacter,
4
+ c as doesPasswordContainLetter,
5
+ o as doesPasswordContainMinCharacters,
6
+ d as doesPasswordContainMixedCase,
7
+ a as doesPasswordContainNumber,
8
+ i as doesPasswordContainSymbol,
9
+ r as isEmailValid,
10
+ n as isVanityNameValid
43
11
  };
@@ -18,9 +18,11 @@ export declare const mockSharedLink: SharedLink;
18
18
  export declare const useMockSharedLink: (sharedLinkArg: any) => {
19
19
  sharedLink: SharedLink;
20
20
  sharingService: {
21
+ sendInvitations: (formData: any) => Promise<void>;
22
+ sendSharedLink: (formData: any) => Promise<void>;
21
23
  createSharedLink: () => Promise<void>;
22
24
  deleteSharedLink: () => Promise<void>;
23
- updateSharedLink: () => Promise<void>;
25
+ updateSharedLink: (formData: any) => Promise<void>;
24
26
  changeSharedLinkAccess: (access: any) => Promise<void>;
25
27
  changeSharedLinkPermission: (permission: any) => Promise<void>;
26
28
  };
@@ -138,14 +138,41 @@ export interface SharedLink {
138
138
  vanityName?: string;
139
139
  }
140
140
  export interface SharedLinkSettings {
141
+ /**
142
+ * When `true`, the user can update the download settings of the shared link.
143
+ */
141
144
  canChangeDownload?: boolean;
145
+ /**
146
+ * When `true`, the user can update the expiration settings of the shared link.
147
+ */
142
148
  canChangeExpiration?: boolean;
149
+ /**
150
+ * When `true`, the user can update the password settings of the shared link.
151
+ */
143
152
  canChangePassword?: boolean;
153
+ /**
154
+ * When `true`, the user can update the custom URL settings of the shared link.
155
+ */
144
156
  canChangeVanityName?: boolean;
157
+ /**
158
+ * When `true`, the download settings of the shared link are visible to the user.
159
+ */
145
160
  isDownloadAvailable?: boolean;
161
+ /**
162
+ * When `true`, users with the shared link can download the item.
163
+ */
146
164
  isDownloadEnabled?: boolean;
165
+ /**
166
+ * When `true`, the password settings of the shared link are visible to the user.
167
+ */
147
168
  isPasswordAvailable?: boolean;
169
+ /**
170
+ * When `true`, users with the shared link must enter a password to access the item.
171
+ */
148
172
  isPasswordEnabled?: boolean;
173
+ /**
174
+ * When `true`, the custom URL settings of the shared link are visible to the user.
175
+ */
149
176
  isVanityNameAvailable?: boolean;
150
177
  }
151
178
  export interface AccessLevel {
@@ -280,17 +307,67 @@ export interface EventService {
280
307
  onSharedLinkSettingsLoad?: () => void;
281
308
  }
282
309
  export interface ContactService {
310
+ /**
311
+ * Function to retrieve a contact by email address.
312
+ *
313
+ * Called when the user enters a value that is not in the suggested contacts.
314
+ */
283
315
  getContactByEmail?: (email: string) => Promise<UserContactType | void>;
284
- getContacts?: (query: string) => Promise<UserContactType[]>;
316
+ /**
317
+ * Function to retrieve a list of suggested contacts.
318
+ *
319
+ * Called when the input value of the contact combobox is changed.
320
+ */
321
+ getContacts?: (query: string, view: 'email' | 'invite') => Promise<UserContactType[]>;
322
+ /**
323
+ * Function to retrieve avatar URLs for a list of contacts.
324
+ *
325
+ * Called when the list of suggested contacts is updated.
326
+ */
285
327
  getContactsAvatarUrls?: (userContacts: UserContactType[]) => Promise<FetchedAvatarUrls>;
286
328
  }
287
329
  export interface SharingService {
288
- sendInvites?: () => Promise<SharingResponse | void>;
289
- sendSharedLink?: () => Promise<SharingResponse | void>;
330
+ /**
331
+ * Function to invite new collaborators to the item.
332
+ *
333
+ * Called when the user clicks "Send" on the invite view of the sharing form.
334
+ */
335
+ sendInvitations?: (formData: CollaborationFormData) => Promise<SharingResponse | void>;
336
+ /**
337
+ * Function to email the shared link to the selected contacts.
338
+ *
339
+ * Called when the user clicks "Send" on the email view of the sharing form.
340
+ */
341
+ sendSharedLink?: (formData: CollaborationFormData) => Promise<SharingResponse | void>;
342
+ /**
343
+ * Function to create a shared link for the item.
344
+ *
345
+ * Called when the user enables the "Share Link" toggle on the sharing form.
346
+ */
290
347
  createSharedLink?: () => Promise<SharingResponse | void>;
348
+ /**
349
+ * Function to delete the shared link for the item.
350
+ *
351
+ * Called when the user disables the "Share Link" toggle on the sharing form.
352
+ */
291
353
  deleteSharedLink?: () => Promise<SharingResponse | void>;
292
- updateSharedLink?: () => Promise<SharingResponse | void>;
354
+ /**
355
+ * Function to update the shared link for the item.
356
+ *
357
+ * Called when the user saves changes to the shared link settings.
358
+ */
359
+ updateSharedLink?: (formData: LinkSettingsFormData) => Promise<SharingResponse | void>;
360
+ /**
361
+ * Function to change the access level of the shared link.
362
+ *
363
+ * Called when the user selects an access level for the shared link.
364
+ */
293
365
  changeSharedLinkAccess?: (access: AccessLevelType) => Promise<void>;
366
+ /**
367
+ * Function to change the permission level of the shared link.
368
+ *
369
+ * Called when the user selects a permission level for the shared link.
370
+ */
294
371
  changeSharedLinkPermission?: (permission: PermissionLevelType) => Promise<void>;
295
372
  }
296
373
  /**
@@ -320,14 +397,57 @@ export interface SharingError {
320
397
  [key: string]: string;
321
398
  };
322
399
  }
400
+ /**
401
+ * Form data structure for the collaboration form in the Unified Share Modal.
402
+ */
403
+ export interface CollaborationFormData {
404
+ /**
405
+ * The selected contacts to invite as collaborators or email the shared link.
406
+ */
407
+ contacts: UserContactType[];
408
+ /**
409
+ * The message to send to collaborators or shared link recipients.
410
+ */
411
+ message: string;
412
+ /**
413
+ * The selected collaboration role when inviting new collaborators.
414
+ *
415
+ * This property is omitted when emailing the shared link.
416
+ */
417
+ role?: InvitationRole | string;
418
+ }
419
+ /**
420
+ * Form data structure for the link settings form in the Unified Share Modal.
421
+ */
323
422
  export interface LinkSettingsFormData {
324
- expiration?: DateValue;
423
+ /**
424
+ * The selected calendar date when the item will be unshared.
425
+ */
426
+ expiration: DateValue;
427
+ /**
428
+ * When `true`, users with the shared link can download the item.
429
+ */
325
430
  isDownloadEnabled: boolean;
431
+ /**
432
+ * When `true`, the shared link will expire on a specific date.
433
+ */
326
434
  isExpirationEnabled: boolean;
435
+ /**
436
+ * When `true`, users with the shared link must enter a password.
437
+ */
327
438
  isPasswordEnabled: boolean;
328
- isVanityEnabled: boolean;
329
- password?: string;
330
- vanityName?: string;
439
+ /**
440
+ * When `true`, users can access the shared link with a custom URL.
441
+ */
442
+ isVanityNameEnabled: boolean;
443
+ /**
444
+ * The password required by users to access the shared link.
445
+ */
446
+ password: string;
447
+ /**
448
+ * The path name for users to access the item through a non-private URL.
449
+ */
450
+ vanityName: string;
331
451
  }
332
452
  /**
333
453
  * Configuration options for configuring features in the Unified Share Modal.
@@ -0,0 +1,3 @@
1
+ import { LinkSettingsFormData } from '../types';
2
+ declare const getUpdatedLinkSettingsFormData: (nextData: LinkSettingsFormData, prevData: LinkSettingsFormData) => Partial<LinkSettingsFormData>;
3
+ export { getUpdatedLinkSettingsFormData };
@@ -1,5 +1,6 @@
1
1
  export * from './collaborator';
2
2
  export * from './date';
3
3
  export * from './event';
4
+ export * from './form';
4
5
  export * from './permission';
5
6
  export * from './validation';
@@ -6,16 +6,3 @@ export declare const doesPasswordContainSymbol: (password: string) => boolean;
6
6
  export declare const doesPasswordContainLetter: (password: string) => boolean;
7
7
  export declare const doesPasswordContainMixedCase: (password: string) => boolean;
8
8
  export declare const doesPasswordContainInvalidCharacter: (password: string) => boolean;
9
- export declare const getSharedLinkFormValidation: (settings: any, formData: any, initialFormData: any) => {
10
- updatedFormData: {
11
- updatedExpiration: any;
12
- updatedPassword: any;
13
- updatedVanityName: any;
14
- updatedIsDownloadEnabled: any;
15
- };
16
- shouldValidate: {
17
- expiration: boolean;
18
- password: boolean;
19
- vanityName: boolean;
20
- };
21
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "0.48.5",
3
+ "version": "0.48.6",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^9.18.13",
@@ -13,9 +13,9 @@
13
13
  "react-intl": "^6.4.2"
14
14
  },
15
15
  "devDependencies": {
16
- "@box/blueprint-web": "^12.75.3",
16
+ "@box/blueprint-web": "^12.75.4",
17
17
  "@box/blueprint-web-assets": "^4.67.0",
18
- "@box/copy-input": "^0.22.9",
18
+ "@box/copy-input": "^0.22.10",
19
19
  "@box/storybook-utils": "0.14.3",
20
20
  "@box/eslint-plugin-blueprint": "1.0.4",
21
21
  "react-intl": "^6.4.2"