@box/unified-share-modal 1.42.0 → 1.42.2

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.
@@ -1,6 +1,6 @@
1
1
  import ue from "clsx";
2
- import { useState as pe, useRef as he, useEffect as I, useCallback as v } from "react";
3
- import { createPortal as fe } from "react-dom";
2
+ import { useState as he, useRef as fe, useEffect as I, useCallback as v } from "react";
3
+ import { createPortal as pe } from "react-dom";
4
4
  import { useIntl as be } from "react-intl";
5
5
  import { useBlueprintModernization as Ce, useNotification as ve, useUniqueId as ge, useLabelable as Se, Tooltip as _e, Focusable as Le, Text as Ue, Modal as g } from "@box/blueprint-web";
6
6
  import { Globe as ye } from "@box/blueprint-web-assets/icons/Medium";
@@ -17,7 +17,7 @@ import { useFormValidation as Ie } from "../../../hooks/use-form-validation.js";
17
17
  import { useCollaborationForm as Re } from "../../../hooks/use-collaboration-form.js";
18
18
  import { useUnifiedShareFormContext as Te } from "../../../contexts/unified-share-form-context.js";
19
19
  import { useUnifiedShareModalContext as Pe } from "../../../contexts/unified-share-modal-context.js";
20
- import '../../../../../styles/collaboration-section.css';const Me = "_container_1spii_2", Oe = "_label_1spii_8", ke = "_modernized_1spii_15", we = "_security_1spii_33", ze = "_icon_1spii_37", De = "_access_1spii_43", c = {
20
+ import '../../../../../styles/collaboration-section.css';const Me = "_container_1hur8_2", Oe = "_label_1hur8_8", ke = "_modernized_1hur8_15", we = "_security_1hur8_33", ze = "_icon_1hur8_37", De = "_access_1hur8_43", c = {
21
21
  container: Me,
22
22
  label: Oe,
23
23
  modernized: ke,
@@ -28,7 +28,7 @@ import '../../../../../styles/collaboration-section.css';const Me = "_container_
28
28
  function st() {
29
29
  const {
30
30
  formatMessage: t
31
- } = be(), [S, A] = pe(), {
31
+ } = be(), [S, A] = he(), {
32
32
  enableModernizedComponents: T
33
33
  } = Ce(), {
34
34
  addNotification: P
@@ -71,7 +71,7 @@ function st() {
71
71
  handleUserSelectorBlur: Y,
72
72
  isFormSubmitting: Z,
73
73
  updateContactValue: ee
74
- } = Re(F, x), m = n === "default" || n === "invite", a = n === "invite" || n === "email", p = W ?? Z, te = i.some((e) => e.isExternalUser), N = he(n === "email" ? "email" : "invite");
74
+ } = Re(F, x), m = n === "default" || n === "invite", a = n === "invite" || n === "email", h = W ?? Z, te = i.some((e) => e.isExternalUser), N = fe(n === "email" ? "email" : "invite");
75
75
  I(() => {
76
76
  N.current = n === "email" ? "email" : "invite";
77
77
  }, [n]), I(() => {
@@ -116,31 +116,31 @@ function st() {
116
116
  A(s), k(me);
117
117
  }
118
118
  };
119
- let h, f = !1;
120
- m && !H.canInviteCollaborator && (h = t(o.inviteDisabledTooltip), f = !0), m && K === "web_link" && (h = t(o.inviteWebLinkDisabledTooltip), f = !0);
119
+ let f, p = !1;
120
+ m && !H.canInviteCollaborator && (f = t(o.inviteDisabledTooltip), p = !0), m && K === "web_link" && (f = t(o.inviteWebLinkDisabledTooltip), p = !0);
121
121
  const V = ge("user-contacts-"), ce = t(m ? o.invitePeopleLabel : o.emailSharedLinkLabel), de = Se(ce, V);
122
122
  return /* @__PURE__ */ l("form", {
123
123
  className: c.container,
124
124
  onSubmit: (e) => e.preventDefault(),
125
125
  children: [S && /* @__PURE__ */ r(Ee, {
126
126
  error: S,
127
- isLoading: p,
127
+ isLoading: h,
128
128
  onSelectedUsersChange: u
129
129
  }), z, /* @__PURE__ */ l("div", {
130
130
  children: [m && L.collaborators && /* @__PURE__ */ r(Ae, {}), /* @__PURE__ */ r(de, {
131
131
  className: ue(c.label, T && c.modernized)
132
132
  }), /* @__PURE__ */ r(_e, {
133
- content: h,
133
+ content: f,
134
134
  "data-testid": "user-contacts-tooltip",
135
- open: h ? void 0 : !1,
135
+ open: f ? void 0 : !1,
136
136
  side: "bottom",
137
137
  children: /* @__PURE__ */ r(Le, {
138
- focusable: f,
138
+ focusable: p,
139
139
  children: /* @__PURE__ */ r(Fe, {
140
140
  className: "collaboration-user-selector",
141
141
  clearButtonAriaLabel: t(o.clearButton),
142
142
  clearOnBlur: !1,
143
- disabled: f || p,
143
+ disabled: p || h,
144
144
  displayChipVariant: (e) => e.chipVariant,
145
145
  error: Q["user-contact"],
146
146
  fetchAvatarUrls: ie,
@@ -177,14 +177,14 @@ function st() {
177
177
  color: "textOnLightSecondary",
178
178
  children: t(o.contentSharedWithExternalCollaborators)
179
179
  })]
180
- }), a && _ && /* @__PURE__ */ fe(/* @__PURE__ */ l(Ve, {
180
+ }), a && _ && /* @__PURE__ */ pe(/* @__PURE__ */ l(Ve, {
181
181
  children: [!G && /* @__PURE__ */ l(g.Footer, {
182
182
  children: [/* @__PURE__ */ r(g.Footer.SecondaryButton, {
183
- disabled: p,
183
+ disabled: h,
184
184
  onClick: se,
185
185
  children: t(o.cancelButton)
186
186
  }), /* @__PURE__ */ r(g.Footer.PrimaryButton, {
187
- loading: p,
187
+ loading: h,
188
188
  loadingAriaLabel: t(o.loadingLabel),
189
189
  onClick: le,
190
190
  children: t(o.sendButton)
@@ -1,5 +1,5 @@
1
- import { useRef as v, useState as G, useCallback as x, useEffect as w } from "react";
2
- import { useIntl as q } from "react-intl";
1
+ import { useRef as x, useState as V, useCallback as v, useEffect as w } from "react";
2
+ import { useIntl as G } from "react-intl";
3
3
  import { Text as _, Tooltip as A, 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
5
  import { Mail as Z, Globe as D } from "@box/blueprint-web-assets/icons/Medium";
@@ -9,12 +9,12 @@ import { SharedLinkAccess as ie } from "./shared-link-access.js";
9
9
  import { SharedLinkPermission as te } from "./shared-link-permission.js";
10
10
  import i from "./messages.js";
11
11
  import { jsxs as l, jsx as t } from "react/jsx-runtime";
12
- import { useUnifiedShareFormContext as ae } from "../../../contexts/unified-share-form-context.js";
13
- import { useUnifiedShareModalContext as ne } from "../../../contexts/unified-share-modal-context.js";
12
+ import { useUnifiedShareFormContext as ne } from "../../../contexts/unified-share-form-context.js";
13
+ import { useUnifiedShareModalContext as ae } from "../../../contexts/unified-share-modal-context.js";
14
14
  import { useSharingAction as I } 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
- import '../../../../../styles/shared-link-section.css';const re = "_container_1hae4_1", ce = "_toggle_1hae4_7", le = "_settings_1hae4_13", de = "_copy_1hae4_22", he = "_access_1hae4_30", me = "_icon_1hae4_36", s = {
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 = {
18
18
  container: re,
19
19
  toggle: ce,
20
20
  settings: le,
@@ -25,44 +25,44 @@ import '../../../../../styles/shared-link-section.css';const re = "_container_1h
25
25
  function Ne() {
26
26
  const {
27
27
  formatMessage: e
28
- } = q(), k = v(!0), L = v(null), p = v(null), {
28
+ } = G(), k = x(!0), L = x(null), p = x(null), {
29
29
  onModalViewChange: b,
30
30
  onShareViewChange: F
31
- } = ae(), {
31
+ } = ne(), {
32
32
  config: o,
33
33
  isFetching: T,
34
- isSubmitting: R,
35
- item: M,
36
- sharedLink: n,
37
- sharingService: B
38
- } = ne(), {
34
+ isSubmitting: q,
35
+ item: R,
36
+ sharedLink: a,
37
+ sharingService: M
38
+ } = ae(), {
39
39
  permissions: E = {}
40
+ } = R, {
41
+ createSharedLink: B
40
42
  } = M, {
41
- createSharedLink: O
42
- } = B, {
43
43
  sharedLinkAutoCopy: d,
44
44
  sharedLinkAutoCreate: y
45
45
  } = o;
46
46
  let N = "create-shared-link";
47
47
  d && (N = "auto-copy-shared-link");
48
48
  const {
49
- isLoading: U,
49
+ isLoading: O,
50
50
  onAction: C
51
- } = I(O, N), a = !!n.url, r = R ?? U, [S, j] = G(!1), u = x(async () => {
52
- a || (await C(), j(!0));
53
- }, [a, C]), z = x(async () => (u(), new Promise((c) => {
51
+ } = I(B, N), n = !!a.url, r = q ?? O, [S, U] = V(!1), u = v(async () => {
52
+ n || (await C(), U(!0));
53
+ }, [n, C]), j = v(async () => (u(), new Promise((c) => {
54
54
  p.current = {
55
55
  resolve: c
56
56
  };
57
57
  })), [u]), {
58
58
  onAction: P
59
- } = I(z, "auto-copy-shared-link");
59
+ } = I(j, "auto-copy-shared-link");
60
60
  w(() => {
61
61
  !k.current || T || (d ? P() : y && u(), k.current = !1);
62
62
  }, [T, k, d, y, u, P]), w(() => {
63
- a && d && L.current && L.current.click();
64
- }, [a, d]);
65
- const K = x((m) => {
63
+ n && d && L.current && L.current.click();
64
+ }, [n, d]);
65
+ const z = v((m) => {
66
66
  if (!p.current)
67
67
  return;
68
68
  let c;
@@ -72,11 +72,11 @@ function Ne() {
72
72
  type: "success"
73
73
  }]
74
74
  }), p.current = null;
75
- }, [e, S]), V = async (m) => {
75
+ }, [e, S]), K = async (m) => {
76
76
  m || b("remove-shared-link"), m && await C();
77
77
  };
78
78
  let h, f = !1;
79
- return !a && !r && (h = e(i.sharedLinkToggleTooltip)), !a && !E.canShare && (h = e(i.createLinkDisabledTooltip), f = !0), a && !E.canSetShareAccess && (h = e(i.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ l("div", {
79
+ return !n && !r && (h = e(i.sharedLinkToggleTooltip)), !n && !E.canShare && (h = e(i.createLinkDisabledTooltip), f = !0), n && !E.canSetShareAccess && (h = e(i.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ l("div", {
80
80
  className: s.container,
81
81
  children: [/* @__PURE__ */ t(_, {
82
82
  as: "label",
@@ -92,16 +92,16 @@ function Ne() {
92
92
  children: /* @__PURE__ */ t(H, {
93
93
  focusable: f,
94
94
  children: /* @__PURE__ */ t(J.Item, {
95
- checked: a,
95
+ checked: n,
96
96
  disabled: f || r,
97
97
  label: e(i.sharedLinkToggleLabel),
98
- onCheckedChange: V,
98
+ onCheckedChange: K,
99
99
  value: "shared-link"
100
100
  })
101
101
  })
102
- }), a && !!n.expiresAt && /* @__PURE__ */ t(A, {
102
+ }), n && !!a.expiresAt && /* @__PURE__ */ t(A, {
103
103
  content: e(i.expirationIconTooltip, {
104
- expirationDate: oe(n.expiresAt)
104
+ expirationDate: oe(a.expiresAt)
105
105
  }),
106
106
  "data-testid": "expiration-date-tooltip",
107
107
  children: /* @__PURE__ */ t(Q, {
@@ -110,7 +110,7 @@ function Ne() {
110
110
  icon: Y,
111
111
  text: e(i.expirationIconLabel)
112
112
  })
113
- }), a && o.sharedLinkSettings && /* @__PURE__ */ t(W, {
113
+ }), n && o.sharedLinkSettings && /* @__PURE__ */ t(W, {
114
114
  "aria-disabled": r,
115
115
  "aria-haspopup": "dialog",
116
116
  className: s.settings,
@@ -123,16 +123,16 @@ function Ne() {
123
123
  variant: "standalone",
124
124
  children: e(i.sharedLinkSettingsLabel)
125
125
  })]
126
- }), a && /* @__PURE__ */ l("div", {
126
+ }), n && /* @__PURE__ */ l("div", {
127
127
  className: s.copy,
128
128
  children: [/* @__PURE__ */ t(ee, {
129
129
  ref: L,
130
- autoFocus: y && a,
130
+ autoFocus: y && n,
131
131
  disabled: r,
132
132
  hideLabel: !0,
133
133
  label: e(i.sharedLinkUrlLabel),
134
- onCopy: K,
135
- value: n.url
134
+ onCopy: z,
135
+ value: a.url
136
136
  }), o.sharedLinkEmail && /* @__PURE__ */ t(A, {
137
137
  align: "end",
138
138
  content: e(i.sharedLinkEmailLabel),
@@ -145,10 +145,10 @@ function Ne() {
145
145
  variant: "secondary"
146
146
  })
147
147
  })]
148
- }), a && (o.sharedLinkAccess || o.sharedLinkPermission) && /* @__PURE__ */ l("div", {
148
+ }), n && (o.sharedLinkAccess || o.sharedLinkPermission) && /* @__PURE__ */ l("div", {
149
149
  className: s.access,
150
150
  children: [o.sharedLinkAccess && /* @__PURE__ */ t(ie, {}), o.sharedLinkPermission && /* @__PURE__ */ t(te, {})]
151
- }), a && n.access === "open" && /* @__PURE__ */ l("div", {
151
+ }), n && a.access === "open" && /* @__PURE__ */ l("div", {
152
152
  children: [/* @__PURE__ */ t(D, {
153
153
  className: s.icon,
154
154
  height: g,
@@ -156,9 +156,9 @@ function Ne() {
156
156
  }), /* @__PURE__ */ t(_, {
157
157
  as: "span",
158
158
  color: "textOnLightSecondary",
159
- children: n.permission === "can_edit" ? e(i.sharedLinkEditablePubliclyAvailable) : e(i.sharedLinkPubliclyAvailable)
159
+ children: a.permission === "can_edit" ? e(i.sharedLinkEditablePubliclyAvailable) : e(i.sharedLinkPubliclyAvailable)
160
160
  })]
161
- }), a && n.access === "company" && n.permission === "can_edit" && /* @__PURE__ */ l("div", {
161
+ }), n && a.access === "company" && a.permission === "can_edit" && /* @__PURE__ */ l("div", {
162
162
  children: [/* @__PURE__ */ t(D, {
163
163
  className: s.icon,
164
164
  height: g,
@@ -1 +1 @@
1
- ._container_1spii_2{display:flex;flex-direction:column;gap:var(--space-4)}._label_1spii_8{display:block;margin-block-end:var(--space-2);padding:var(--space-1) 0;color:var(--text-text-on-light);overflow-wrap:break-word}._label_1spii_8._modernized_1spii_15{font-weight:var(--bp-font-weight-bold);font-size:var(--bp-font-size-05);font-family:var(--bp-font-font-family),-apple-system,BlinkMacSystemFont,"San Francisco","Segoe UI",Roboto,"Helvetica Neue",sans-serif;font-style:normal;line-height:var(--bp-font-line-height-04);letter-spacing:var(--bp-font-letter-spacing-01)}._label_1spii_8:not(._modernized_1spii_15){font-weight:var(--body-default-bold-font-weight);font-size:var(--body-default-bold-font-size);font-family:var(--body-default-bold-font-family);line-height:var(--body-default-bold-line-height);letter-spacing:var(--body-default-bold-letter-spacing);text-transform:var(--body-default-bold-text-case);text-decoration:var(--body-default-bold-text-decoration)}._security_1spii_33{margin-top:calc(var(--space-1) * -1)}._icon_1spii_37{height:var(--size-5);margin-right:var(--space-1);vertical-align:text-bottom}._access_1spii_43{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-3)}
1
+ ._container_1hur8_2{display:flex;flex-direction:column;gap:var(--bp-space-040)}._label_1hur8_8{display:block;margin-block-end:var(--space-2);padding:var(--bp-space-010) 0;color:var(--text-text-on-light);overflow-wrap:break-word}._label_1hur8_8._modernized_1hur8_15{font-weight:var(--bp-font-weight-bold);font-size:var(--bp-font-size-05);font-family:var(--bp-font-font-family),-apple-system,BlinkMacSystemFont,"San Francisco","Segoe UI",Roboto,"Helvetica Neue",sans-serif;font-style:normal;line-height:var(--bp-font-line-height-04);letter-spacing:var(--bp-font-letter-spacing-01)}._label_1hur8_8:not(._modernized_1hur8_15){font-weight:var(--body-default-bold-font-weight);font-size:var(--body-default-bold-font-size);font-family:var(--body-default-bold-font-family);line-height:var(--body-default-bold-line-height);letter-spacing:var(--body-default-bold-letter-spacing);text-transform:var(--body-default-bold-text-case);text-decoration:var(--body-default-bold-text-decoration)}._security_1hur8_33{margin-top:calc(var(--bp-space-010) * -1)}._icon_1hur8_37{height:var(--bp-size-050);margin-right:var(--bp-space-010);vertical-align:text-bottom}._access_1hur8_43{display:flex;flex-wrap:wrap;gap:var(--bp-space-005);margin-top:var(--bp-space-030)}
@@ -1 +1 @@
1
- ._container_1hae4_1{display:flex;flex-direction:column;gap:var(--space-3)}._toggle_1hae4_7{display:flex;gap:var(--space-2);align-items:center}._settings_1hae4_13{margin-left:auto;cursor:pointer}._settings_1hae4_13[aria-disabled=true]{opacity:.3;pointer-events:none}._copy_1hae4_22{display:flex;gap:var(--space-2)}._copy_1hae4_22>div:first-child{flex-grow:1}._access_1hae4_30{display:flex;flex-wrap:wrap;gap:var(--space-2)}._icon_1hae4_36{height:var(--size-5);margin-right:var(--space-1);vertical-align:text-bottom}
1
+ ._container_qn1ax_1{display:flex;flex-direction:column;gap:var(--bp-space-030)}._toggle_qn1ax_7{display:flex;gap:var(--bp-space-020);align-items:center}._settings_qn1ax_13{margin-left:auto;cursor:pointer}._settings_qn1ax_13[aria-disabled=true]{opacity:.3;pointer-events:none}._copy_qn1ax_22{display:flex;gap:var(--bp-space-020)}._copy_qn1ax_22>div:first-child{flex-grow:1}._access_qn1ax_30{display:flex;flex-wrap:wrap;gap:var(--bp-space-005)}._icon_qn1ax_36{height:var(--bp-size-050);margin-right:var(--bp-space-010);vertical-align:text-bottom}
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "1.42.0",
3
+ "version": "1.42.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^12.130.1",
7
- "@box/blueprint-web-assets": "^4.98.0",
8
- "@box/copy-input": "^1.26.0",
9
- "@box/user-selector": "^1.59.0",
6
+ "@box/blueprint-web": "^12.130.2",
7
+ "@box/blueprint-web-assets": "^4.99.0",
8
+ "@box/copy-input": "^1.26.1",
9
+ "@box/user-selector": "^1.59.1",
10
10
  "lodash": "^4.17.15",
11
11
  "react": "^18.0.0",
12
12
  "react-dom": "^18.0.0",
13
13
  "react-intl": "^6.4.2"
14
14
  },
15
15
  "devDependencies": {
16
- "@box/blueprint-web": "^12.130.1",
17
- "@box/blueprint-web-assets": "^4.98.0",
18
- "@box/copy-input": "^1.26.0",
19
- "@box/storybook-utils": "0.16.25",
16
+ "@box/blueprint-web": "^12.130.2",
17
+ "@box/blueprint-web-assets": "^4.99.0",
18
+ "@box/copy-input": "^1.26.1",
19
+ "@box/storybook-utils": "0.16.26",
20
20
  "@box/eslint-plugin-blueprint": "1.0.5",
21
21
  "react-intl": "^6.4.2"
22
22
  },