@box/unified-share-modal 2.8.2 → 2.8.4

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,76 +1,80 @@
1
- import { useIntl as p } from "react-intl";
2
- import { CardTooltipV2 as x, Status as l, Text as t } from "@box/blueprint-web";
1
+ import { useIntl as u } from "react-intl";
2
+ import { CardTooltipV2 as _, Status as l, Text as e } from "@box/blueprint-web";
3
3
  import { Shield as d } from "@box/blueprint-web-assets/icons/Line";
4
4
  import h from "./messages.js";
5
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
6
- import { useUnifiedShareModalContext as u } from "../../contexts/unified-share-modal-context.js";
7
- import '../../../../styles/classification-status.css';const _ = "_container_1lxpo_1", v = "_header_1lxpo_7", b = "_content_1lxpo_13", o = {
8
- container: _,
9
- header: v,
10
- content: b
5
+ import { jsx as t, jsxs as o } from "react/jsx-runtime";
6
+ import { useUnifiedShareModalContext as v } from "../../contexts/unified-share-modal-context.js";
7
+ import '../../../../styles/classification-status.css';const x = "_container_1dpzl_1", b = "_tooltip_1dpzl_5", y = "_header_1dpzl_11", z = "_content_1dpzl_17", n = {
8
+ container: x,
9
+ tooltip: b,
10
+ header: y,
11
+ content: z
11
12
  };
12
- function N() {
13
+ function T() {
13
14
  const {
14
15
  formatMessage: i
15
- } = p(), {
16
- item: m
17
16
  } = u(), {
17
+ item: m
18
+ } = v(), {
18
19
  classification: r
19
20
  } = m;
20
21
  if (!r)
21
22
  return null;
22
23
  const {
23
- colorId: a,
24
+ colorId: p,
24
25
  definition: f,
25
- name: c,
26
- restrictions: s
27
- } = r;
28
- return /* @__PURE__ */ e(x, {
29
- content: /* @__PURE__ */ n("div", {
30
- className: o.container,
31
- children: [/* @__PURE__ */ n("div", {
32
- className: o.header,
33
- children: [/* @__PURE__ */ e(l, {
34
- colorIndex: a + 1,
35
- hideText: !0,
36
- icon: d,
37
- text: ""
38
- }), /* @__PURE__ */ e(t, {
39
- as: "h3",
40
- variant: "bodyDefaultBold",
41
- children: c
42
- })]
43
- }), /* @__PURE__ */ n("div", {
44
- className: o.content,
45
- children: [/* @__PURE__ */ n("div", {
46
- children: [/* @__PURE__ */ e(t, {
47
- as: "h4",
26
+ name: s,
27
+ restrictions: a
28
+ } = r, c = p + 1;
29
+ return /* @__PURE__ */ t("div", {
30
+ className: n.container,
31
+ children: /* @__PURE__ */ t(_, {
32
+ content: /* @__PURE__ */ o("div", {
33
+ className: n.tooltip,
34
+ children: [/* @__PURE__ */ o("div", {
35
+ className: n.header,
36
+ children: [/* @__PURE__ */ t(l, {
37
+ colorIndex: c,
38
+ hideText: !0,
39
+ icon: d,
40
+ text: ""
41
+ }), /* @__PURE__ */ t(e, {
42
+ as: "h3",
48
43
  variant: "bodyDefaultBold",
49
- children: i(h.definitionLabel)
50
- }), /* @__PURE__ */ e(t, {
51
- as: "p",
52
- children: f
53
- })]
54
- }), s && /* @__PURE__ */ n("div", {
55
- children: [/* @__PURE__ */ e(t, {
56
- as: "h4",
57
- variant: "bodyDefaultBold",
58
- children: i(h.restrictionsLabel)
59
- }), /* @__PURE__ */ e(t, {
60
- as: "p",
61
44
  children: s
62
45
  })]
46
+ }), /* @__PURE__ */ o("div", {
47
+ className: n.content,
48
+ children: [/* @__PURE__ */ o("div", {
49
+ children: [/* @__PURE__ */ t(e, {
50
+ as: "h4",
51
+ variant: "bodyDefaultBold",
52
+ children: i(h.definitionLabel)
53
+ }), /* @__PURE__ */ t(e, {
54
+ as: "p",
55
+ children: f
56
+ })]
57
+ }), a && /* @__PURE__ */ o("div", {
58
+ children: [/* @__PURE__ */ t(e, {
59
+ as: "h4",
60
+ variant: "bodyDefaultBold",
61
+ children: i(h.restrictionsLabel)
62
+ }), /* @__PURE__ */ t(e, {
63
+ as: "p",
64
+ children: a
65
+ })]
66
+ })]
63
67
  })]
64
- })]
65
- }),
66
- children: /* @__PURE__ */ e(l, {
67
- colorIndex: a + 1,
68
- icon: d,
69
- iconPosition: "left",
70
- text: c.toUpperCase()
68
+ }),
69
+ children: /* @__PURE__ */ t(l, {
70
+ colorIndex: c,
71
+ icon: d,
72
+ iconPosition: "left",
73
+ text: s.toUpperCase()
74
+ })
71
75
  })
72
76
  });
73
77
  }
74
78
  export {
75
- N as ClassificationStatus
79
+ T as ClassificationStatus
76
80
  };
@@ -1,18 +1,18 @@
1
1
  import l from "clsx";
2
- import { useState as k, useEffect as C } from "react";
3
- import { useIntl as F } from "react-intl";
4
- import { Modal as i, LoadingIndicator as B, Divider as N } from "@box/blueprint-web";
5
- import { SharedLinkSettings as x } from "./shared-link-settings.js";
6
- import t from "./messages.js";
7
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
8
- import { ClassificationStatus as D } from "../classification-status/classification-status.js";
9
- import { useUnifiedShareModalContext as M } from "../../contexts/unified-share-modal-context.js";
10
- import { useSharedLinkSettingsContext as w } from "../../contexts/shared-link-settings-context.js";
11
- import '../../../../styles/shared-link-settings-modal.css';const I = "_content_1dmg4_1", P = "_isFullscreen_1dmg4_4", j = "_body_1dmg4_13", z = "_header_1dmg4_17", A = "_form_1dmg4_35", E = "_isLoading_1dmg4_42", H = "_loading_1dmg4_46", U = "_divider_1dmg4_54", o = {
12
- content: I,
13
- isFullscreen: P,
14
- body: j,
15
- header: z,
2
+ import { useState as j, useEffect as k } from "react";
3
+ import { useIntl as C } from "react-intl";
4
+ import { Modal as t, LoadingIndicator as F, Divider as B } from "@box/blueprint-web";
5
+ import { SharedLinkSettings as N } from "./shared-link-settings.js";
6
+ import n from "./messages.js";
7
+ import { jsx as i, jsxs as s } from "react/jsx-runtime";
8
+ import { ClassificationStatus as x } from "../classification-status/classification-status.js";
9
+ import { useUnifiedShareModalContext as D } from "../../contexts/unified-share-modal-context.js";
10
+ import { useSharedLinkSettingsContext as M } from "../../contexts/shared-link-settings-context.js";
11
+ import '../../../../styles/shared-link-settings-modal.css';const w = "_content_1jgi4_1", I = "_isFullscreen_1jgi4_4", P = "_body_1jgi4_13", z = "_title_1jgi4_17", A = "_form_1jgi4_37", E = "_isLoading_1jgi4_44", H = "_loading_1jgi4_48", U = "_divider_1jgi4_56", e = {
12
+ content: w,
13
+ isFullscreen: I,
14
+ body: P,
15
+ title: z,
16
16
  form: A,
17
17
  isLoading: E,
18
18
  loading: H,
@@ -23,19 +23,19 @@ function Y({
23
23
  onOpenChange: g
24
24
  }) {
25
25
  const {
26
- formatMessage: n
27
- } = F(), {
26
+ formatMessage: o
27
+ } = C(), {
28
28
  eventService: h,
29
29
  isSubmitting: r,
30
30
  variant: S
31
- } = M(), {
31
+ } = D(), {
32
32
  onSharedLinkSettingsClose: f,
33
33
  onSharedLinkSettingsLoad: d
34
34
  } = h, c = S === "desktop", {
35
35
  resetForm: u,
36
36
  submitForm: L
37
- } = w(), [m, b] = k(!!d);
38
- C(() => {
37
+ } = M(), [m, b] = j(!!d);
38
+ k(() => {
39
39
  (async () => d && (a && await d(), b(!a)))();
40
40
  }, [a, d]);
41
41
  const _ = () => {
@@ -45,45 +45,47 @@ function Y({
45
45
  }, v = (y) => {
46
46
  y.preventDefault();
47
47
  };
48
- return /* @__PURE__ */ e(i, {
48
+ return /* @__PURE__ */ i(t, {
49
49
  onOpenChange: _,
50
50
  open: a,
51
- children: /* @__PURE__ */ s(i.Content, {
52
- className: l(o.content, c && o.isFullscreen),
51
+ children: /* @__PURE__ */ s(t.Content, {
52
+ className: l(e.content, c && e.isFullscreen),
53
53
  onPointerDownOutside: v,
54
54
  size: "medium",
55
- children: [/* @__PURE__ */ s(i.Header, {
56
- className: o.header,
57
- children: [n(t.title), /* @__PURE__ */ e(D, {})]
55
+ children: [/* @__PURE__ */ s(t.Header, {
56
+ children: [/* @__PURE__ */ i("div", {
57
+ className: e.title,
58
+ children: o(n.title)
59
+ }), /* @__PURE__ */ i(x, {})]
58
60
  }), /* @__PURE__ */ s("div", {
59
- className: l(o.form),
60
- children: [m && /* @__PURE__ */ e("div", {
61
- className: o.loading,
62
- children: /* @__PURE__ */ e(B, {
63
- "aria-label": n(t.loadingLabel),
61
+ className: l(e.form),
62
+ children: [m && /* @__PURE__ */ i("div", {
63
+ className: e.loading,
64
+ children: /* @__PURE__ */ i(F, {
65
+ "aria-label": o(n.loadingLabel),
64
66
  size: "large"
65
67
  })
66
- }), /* @__PURE__ */ s(i.Body, {
67
- className: l(o.body, m && o.isLoading),
68
- children: [c && /* @__PURE__ */ e(N, {
69
- className: o.divider
70
- }), /* @__PURE__ */ e(x, {})]
71
- }), /* @__PURE__ */ s(i.Footer, {
72
- className: l(m && o.isLoading),
73
- children: [/* @__PURE__ */ e(i.Footer.SecondaryButton, {
68
+ }), /* @__PURE__ */ s(t.Body, {
69
+ className: l(e.body, m && e.isLoading),
70
+ children: [c && /* @__PURE__ */ i(B, {
71
+ className: e.divider
72
+ }), /* @__PURE__ */ i(N, {})]
73
+ }), /* @__PURE__ */ s(t.Footer, {
74
+ className: l(m && e.isLoading),
75
+ children: [/* @__PURE__ */ i(t.Footer.SecondaryButton, {
74
76
  disabled: r,
75
77
  onClick: _,
76
- children: n(t.cancelButton)
77
- }), /* @__PURE__ */ e(i.Footer.PrimaryButton, {
78
+ children: o(n.cancelButton)
79
+ }), /* @__PURE__ */ i(t.Footer.PrimaryButton, {
78
80
  id: "usm-SharedLinkSettingsModal-primaryButton",
79
81
  loading: r,
80
- loadingAriaLabel: n(t.loadingLabel),
82
+ loadingAriaLabel: o(n.loadingLabel),
81
83
  onClick: p,
82
- children: n(t.saveButton)
84
+ children: o(n.saveButton)
83
85
  })]
84
86
  })]
85
- }), !c && /* @__PURE__ */ e(i.Close, {
86
- "aria-label": n(t.closeButton),
87
+ }), !c && /* @__PURE__ */ i(t.Close, {
88
+ "aria-label": o(n.closeButton),
87
89
  disabled: r
88
90
  })]
89
91
  })
@@ -1,130 +1,131 @@
1
- import { useRef as K, useCallback as w, useEffect as G } from "react";
2
- import { useIntl as V } from "react-intl";
3
- import { useNotification as q, Text as b, Tooltip as y, Focusable as H, Switch as J, Status as Q, Link as W, Button as X } from "@box/blueprint-web";
4
- import { ClockBadge as Y } from "@box/blueprint-web-assets/icons/Line";
5
- import { Mail as Z, Globe as I } from "@box/blueprint-web-assets/icons/Medium";
6
- import { SurfaceStatusSurfaceRed as $, bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
7
- import { CopyInput as ee } from "@box/copy-input";
8
- import { SharedLinkAccess as te } from "./shared-link-access.js";
9
- import { SharedLinkPermission as ie } from "./shared-link-permission.js";
1
+ import { useRef as G, useCallback as I, useEffect as V } from "react";
2
+ import { useIntl as q } from "react-intl";
3
+ import { useNotification as H, Text as y, Tooltip as C, Focusable as J, Switch as Q, Status as W, Link as X, Button as Y } from "@box/blueprint-web";
4
+ import { ClockBadge as Z } from "@box/blueprint-web-assets/icons/Line";
5
+ import { Mail as $, Globe as P } from "@box/blueprint-web-assets/icons/Medium";
6
+ import { SurfaceStatusSurfaceRed as ee, bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
7
+ import { CopyInput as te } from "@box/copy-input";
8
+ import { SharedLinkAccess as ie } from "./shared-link-access.js";
9
+ import { SharedLinkPermission as ae } from "./shared-link-permission.js";
10
10
  import t from "./messages.js";
11
11
  import { jsxs as d, jsx as i } 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";
14
- import { useSharingAction as oe } from "../../../hooks/use-sharing-action.js";
15
- import { getNotificationArgs as re } from "../../../utils/notification.js";
16
- import { formatDateFromTimestampToDateString as se } from "../../../utils/date.js";
17
- import { callOnKeyboardEvent as ce } from "../../../utils/event.js";
18
- import '../../../../../styles/shared-link-section.css';const le = "_container_j966c_1", de = "_toggle_j966c_7", he = "_settings_j966c_13", ue = "_copy_j966c_22", me = "_access_j966c_30", pe = "_icon_j966c_36", c = {
19
- container: le,
20
- toggle: de,
21
- settings: he,
22
- copy: ue,
23
- access: me,
24
- icon: pe
12
+ import { useUnifiedShareFormContext as ne } from "../../../contexts/unified-share-form-context.js";
13
+ import { useUnifiedShareModalContext as oe } from "../../../contexts/unified-share-modal-context.js";
14
+ import { useSharingAction as re } from "../../../hooks/use-sharing-action.js";
15
+ import { getNotificationArgs as se } from "../../../utils/notification.js";
16
+ import { formatDateFromTimestampToDateString as ce } from "../../../utils/date.js";
17
+ import { callOnKeyboardEvent as le } from "../../../utils/event.js";
18
+ import '../../../../../styles/shared-link-section.css';const de = "_container_j966c_1", he = "_toggle_j966c_7", ue = "_settings_j966c_13", me = "_copy_j966c_22", pe = "_access_j966c_30", ge = "_icon_j966c_36", c = {
19
+ container: de,
20
+ toggle: he,
21
+ settings: ue,
22
+ copy: me,
23
+ access: pe,
24
+ icon: ge
25
25
  };
26
- function we() {
26
+ function Ie() {
27
27
  const {
28
28
  formatMessage: e
29
- } = V(), {
30
- addNotification: C
31
- } = q(), k = K(null), {
32
- isSharedLinkAutoCopied: f,
29
+ } = q(), {
30
+ addNotification: v
31
+ } = H(), k = G(null), {
32
+ isInteracted: f,
33
+ isSharedLinkAutoCopied: L,
33
34
  isSharedLinkAutoCreated: r,
34
- setForm: P
35
- } = ae(), {
35
+ setForm: B
36
+ } = ne(), {
36
37
  config: s,
37
- eventService: B,
38
- isFetching: v,
38
+ eventService: F,
39
+ isFetching: x,
39
40
  isSubmitting: n,
40
- item: F,
41
- setView: x,
41
+ item: M,
42
+ setView: T,
42
43
  sharedLink: o,
43
- sharingService: M
44
- } = ne(), {
45
- permissions: T = {}
46
- } = F, {
47
- onSharedLinkCopy: L,
48
- onSharedLinkSettingsClick: _
49
- } = B, {
50
- createSharedLink: A
44
+ sharingService: O
45
+ } = oe(), {
46
+ permissions: _ = {}
51
47
  } = M, {
52
- notifications: N,
53
- sharedLinkAutoCopy: O,
54
- sharedLinkAutoCreate: E
55
- } = s, a = !!o.url, h = O && !f.current, D = E && !r.current, R = w(async () => {
56
- const l = await A();
48
+ onSharedLinkCopy: S,
49
+ onSharedLinkSettingsClick: A
50
+ } = F, {
51
+ createSharedLink: N
52
+ } = O, {
53
+ notifications: E,
54
+ sharedLinkAutoCopy: R,
55
+ sharedLinkAutoCreate: D
56
+ } = s, a = !!o.url, h = R && !L.current && !f, j = D && !r.current && !f, U = I(async () => {
57
+ const l = await N();
57
58
  return h ? {
58
59
  messages: []
59
60
  } : l;
60
- }, [h, A]), {
61
- onAction: S
62
- } = oe(R, "create-shared-link");
63
- G(() => {
64
- (async () => v || n || ((h || D) && !a && (await S(), r.current = !0), h && a && k.current && (k.current.click(), f.current = !0)))();
65
- }, [a, h, D, v, f, r, n, S]);
66
- const U = w((l) => {
61
+ }, [h, N]), {
62
+ onAction: b
63
+ } = re(U, "create-shared-link");
64
+ V(() => {
65
+ (async () => x || n || ((h || j) && !a && (await b(), r.current = !0), h && a && k.current && (k.current.click(), L.current = !0)))();
66
+ }, [a, h, j, x, L, r, n, b]);
67
+ const z = I((l) => {
67
68
  let p;
68
- typeof l != "string" ? p = r.current ? e(t.autoCreateCopyErrorNoticeText) : null : p = r.current ? e(t.autoCreateCopySuccessNoticeText) : e(t.autoCopySuccessNoticeText), p && N.includes("auto-copy-shared-link") && C({
69
- ...re(e, "success"),
69
+ typeof l != "string" ? p = r.current ? e(t.autoCreateCopyErrorNoticeText) : null : p = r.current ? e(t.autoCreateCopySuccessNoticeText) : e(t.autoCopySuccessNoticeText), p && E.includes("auto-copy-shared-link") && v({
70
+ ...se(e, "success"),
70
71
  styledText: p
71
- }), L && L(l);
72
- }, [C, e, r, N, L]), z = async (l) => {
72
+ }), S && S(l);
73
+ }, [v, e, r, E, S]), K = async (l) => {
73
74
  if (l) {
74
- await S();
75
+ await b();
75
76
  return;
76
77
  }
77
- x("remove-shared-link");
78
- }, j = () => {
79
- if (_) {
80
- _();
78
+ T("remove-shared-link");
79
+ }, w = () => {
80
+ if (A) {
81
+ A();
81
82
  return;
82
83
  }
83
- x("shared-link-settings");
84
+ T("shared-link-settings");
84
85
  };
85
86
  let u, m = !1;
86
- return !a && !n && (u = e(t.sharedLinkToggleTooltip)), !a && !T.canShare && (u = e(t.createLinkDisabledTooltip), m = !0), a && !T.canSetShareAccess && (u = e(t.removeLinkDisabledTooltip), m = !0), /* @__PURE__ */ d("div", {
87
+ return !a && !n && (u = e(t.sharedLinkToggleTooltip)), !a && !_.canShare && (u = e(t.createLinkDisabledTooltip), m = !0), a && !_.canSetShareAccess && (u = e(t.removeLinkDisabledTooltip), m = !0), /* @__PURE__ */ d("div", {
87
88
  className: c.container,
88
- children: [/* @__PURE__ */ i(b, {
89
+ children: [/* @__PURE__ */ i(y, {
89
90
  as: "label",
90
91
  variant: "bodyDefaultBold",
91
92
  children: e(t.shareLinkLabel)
92
93
  }), /* @__PURE__ */ d("div", {
93
94
  className: c.toggle,
94
- children: [/* @__PURE__ */ i(y, {
95
+ children: [/* @__PURE__ */ i(C, {
95
96
  align: "start",
96
97
  content: u,
97
98
  "data-testid": "shared-link-tooltip",
98
99
  open: u ? void 0 : !1,
99
- children: /* @__PURE__ */ i(H, {
100
+ children: /* @__PURE__ */ i(J, {
100
101
  focusable: m,
101
- children: /* @__PURE__ */ i(J.Item, {
102
+ children: /* @__PURE__ */ i(Q.Item, {
102
103
  checked: a,
103
104
  "data-target-id": "Toggle-CreateSharedLink",
104
105
  disabled: m || n,
105
106
  label: e(t.sharedLinkToggleLabel),
106
- onCheckedChange: z,
107
+ onCheckedChange: K,
107
108
  value: "shared-link"
108
109
  })
109
110
  })
110
- }), a && !!o.expiresAt && /* @__PURE__ */ i(y, {
111
+ }), a && !!o.expiresAt && /* @__PURE__ */ i(C, {
111
112
  content: e(t.expirationIconTooltip, {
112
- expirationDate: se(o.expiresAt)
113
+ expirationDate: ce(o.expiresAt)
113
114
  }),
114
115
  "data-testid": "expiration-date-tooltip",
115
- children: /* @__PURE__ */ i(Q, {
116
- color: $,
116
+ children: /* @__PURE__ */ i(W, {
117
+ color: ee,
117
118
  hideText: !0,
118
- icon: Y,
119
+ icon: Z,
119
120
  text: e(t.expirationIconLabel)
120
121
  })
121
- }), a && s.sharedLinkSettings && /* @__PURE__ */ i(W, {
122
+ }), a && s.sharedLinkSettings && /* @__PURE__ */ i(X, {
122
123
  "aria-disabled": n,
123
124
  "aria-haspopup": "dialog",
124
125
  className: c.settings,
125
126
  "data-target-id": "PlainButton-SharedLinkSettings",
126
- onClick: j,
127
- onKeyDown: ce(j, {
127
+ onClick: w,
128
+ onKeyDown: le(w, {
128
129
  canPreventDefault: !0
129
130
  }),
130
131
  role: "button",
@@ -134,47 +135,47 @@ function we() {
134
135
  })]
135
136
  }), a && /* @__PURE__ */ d("div", {
136
137
  className: c.copy,
137
- children: [/* @__PURE__ */ i(ee, {
138
+ children: [/* @__PURE__ */ i(te, {
138
139
  ref: k,
139
- autoFocus: E && r.current,
140
+ autoFocus: D && r.current && !f,
140
141
  "data-target-id": "Button-CopySharedLink",
141
142
  disabled: n,
142
143
  hideLabel: !0,
143
144
  label: e(t.sharedLinkUrlLabel),
144
- onCopy: U,
145
+ onCopy: z,
145
146
  value: o.url
146
- }), s.sharedLinkEmail && /* @__PURE__ */ i(y, {
147
+ }), s.sharedLinkEmail && /* @__PURE__ */ i(C, {
147
148
  align: "end",
148
149
  content: e(t.sharedLinkEmailLabel),
149
- children: /* @__PURE__ */ i(X, {
150
+ children: /* @__PURE__ */ i(Y, {
150
151
  "aria-label": e(t.sharedLinkEmailLabel),
151
152
  "data-target-id": "Button-SendSharedLink",
152
153
  disabled: n,
153
- icon: Z,
154
- onClick: () => P("email"),
154
+ icon: $,
155
+ onClick: () => B("email"),
155
156
  size: "large",
156
157
  variant: "secondary"
157
158
  })
158
159
  })]
159
160
  }), a && (s.sharedLinkAccess || s.sharedLinkPermission) && /* @__PURE__ */ d("div", {
160
161
  className: c.access,
161
- children: [s.sharedLinkAccess && /* @__PURE__ */ i(te, {}), s.sharedLinkPermission && /* @__PURE__ */ i(ie, {})]
162
+ children: [s.sharedLinkAccess && /* @__PURE__ */ i(ie, {}), s.sharedLinkPermission && /* @__PURE__ */ i(ae, {})]
162
163
  }), a && o.access === "open" && /* @__PURE__ */ d("div", {
163
- children: [/* @__PURE__ */ i(I, {
164
+ children: [/* @__PURE__ */ i(P, {
164
165
  className: c.icon,
165
166
  height: g,
166
167
  width: g
167
- }), /* @__PURE__ */ i(b, {
168
+ }), /* @__PURE__ */ i(y, {
168
169
  as: "span",
169
170
  color: "textOnLightSecondary",
170
171
  children: o.permission === "can_edit" ? e(t.sharedLinkEditablePubliclyAvailable) : e(t.sharedLinkPubliclyAvailable)
171
172
  })]
172
173
  }), a && o.access === "company" && o.permission === "can_edit" && /* @__PURE__ */ d("div", {
173
- children: [/* @__PURE__ */ i(I, {
174
+ children: [/* @__PURE__ */ i(P, {
174
175
  className: c.icon,
175
176
  height: g,
176
177
  width: g
177
- }), /* @__PURE__ */ i(b, {
178
+ }), /* @__PURE__ */ i(y, {
178
179
  as: "span",
179
180
  color: "textOnLightSecondary",
180
181
  children: e(t.sharedLinkElevatedEditableCompanyAvailable)
@@ -183,5 +184,5 @@ function we() {
183
184
  });
184
185
  }
185
186
  export {
186
- we as SharedLinkSection
187
+ Ie as SharedLinkSection
187
188
  };
@@ -1,20 +1,20 @@
1
1
  import a from "clsx";
2
2
  import { useCallback as N } from "react";
3
- import { useIntl as v } from "react-intl";
4
- import { Modal as e, LoadingIndicator as D } from "@box/blueprint-web";
5
- import { UnifiedShareForm as M } from "./unified-share-form.js";
3
+ import { useIntl as S } from "react-intl";
4
+ import { Modal as t, LoadingIndicator as v } from "@box/blueprint-web";
5
+ import { UnifiedShareForm as D } from "./unified-share-form.js";
6
6
  import l from "./messages.js";
7
7
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
8
- import { CollaboratorList as O } from "./collaborator-list/collaborator-list.js";
8
+ import { CollaboratorList as M } from "./collaborator-list/collaborator-list.js";
9
9
  import { useUnifiedShareFormContext as h } from "../../contexts/unified-share-form-context.js";
10
- import { useUnifiedShareModalContext as U } from "../../contexts/unified-share-modal-context.js";
11
- import { ClassificationStatus as k } from "../classification-status/classification-status.js";
12
- import '../../../../styles/unified-share-form-modal.css';const j = "_content_17drm_1", w = "_isFullscreen_17drm_4", z = "_body_17drm_13", B = "_hasFooter_17drm_30", I = "_classificationStatusContainer_17drm_34", P = "_loading_17drm_39", H = "_form_17drm_47", R = "_isLoading_17drm_52", t = {
10
+ import { useUnifiedShareModalContext as O } from "../../contexts/unified-share-modal-context.js";
11
+ import { ClassificationStatus as U } from "../classification-status/classification-status.js";
12
+ import '../../../../styles/unified-share-form-modal.css';const j = "_content_1k0mu_1", w = "_isFullscreen_1k0mu_4", z = "_body_1k0mu_13", B = "_title_1k0mu_17", I = "_hasFooter_1k0mu_39", P = "_loading_1k0mu_43", H = "_form_1k0mu_51", R = "_isLoading_1k0mu_56", e = {
13
13
  content: j,
14
14
  isFullscreen: w,
15
15
  body: z,
16
- hasFooter: B,
17
- classificationStatusContainer: I,
16
+ title: B,
17
+ hasFooter: I,
18
18
  loading: P,
19
19
  form: H,
20
20
  isLoading: R
@@ -26,54 +26,54 @@ function Y({
26
26
  }) {
27
27
  const {
28
28
  formatMessage: n
29
- } = v(), {
29
+ } = S(), {
30
30
  isCollaboratorsOpen: d,
31
- setContainerRef: C,
31
+ setContainerRef: F,
32
32
  setForm: f
33
33
  } = h(), {
34
34
  isFetching: u,
35
35
  isSubmitting: s,
36
- item: F,
37
- variant: b
38
- } = U(), {
39
- form: S
36
+ item: b,
37
+ variant: k
38
+ } = O(), {
39
+ form: C
40
40
  } = h(), {
41
41
  name: L
42
- } = F, _ = b === "desktop", g = S === "default", x = N((r) => {
42
+ } = b, _ = k === "desktop", g = C === "default" && !d, x = N((r) => {
43
43
  s || (f("default"), c(r));
44
44
  }, [s, c, f]), y = (r) => {
45
45
  r.preventDefault();
46
46
  };
47
- return /* @__PURE__ */ i(e, {
47
+ return /* @__PURE__ */ i(t, {
48
48
  onOpenChange: x,
49
49
  open: p,
50
- children: [!!m && /* @__PURE__ */ o(e.Trigger, {
50
+ children: [!!m && /* @__PURE__ */ o(t.Trigger, {
51
51
  children: m
52
- }), /* @__PURE__ */ i(e.Content, {
53
- ref: C,
54
- className: a(t.content, _ && t.isFullscreen),
52
+ }), /* @__PURE__ */ i(t.Content, {
53
+ ref: F,
54
+ className: a(e.content, _ && e.isFullscreen),
55
55
  onPointerDownOutside: y,
56
56
  size: "medium",
57
- children: [/* @__PURE__ */ i(e.Header, {
58
- children: [n(l.title, {
59
- itemName: L
60
- }), /* @__PURE__ */ o("div", {
61
- className: t.classificationStatusContainer,
62
- children: /* @__PURE__ */ o(k, {})
63
- })]
64
- }), /* @__PURE__ */ i(e.Body, {
65
- className: a(t.body, !g && t.hasFooter),
57
+ children: [/* @__PURE__ */ i(t.Header, {
58
+ children: [/* @__PURE__ */ o("div", {
59
+ className: e.title,
60
+ children: n(l.title, {
61
+ itemName: L
62
+ })
63
+ }), /* @__PURE__ */ o(U, {})]
64
+ }), /* @__PURE__ */ i(t.Body, {
65
+ className: a(e.body, !g && e.hasFooter),
66
66
  children: [u && /* @__PURE__ */ o("div", {
67
- className: t.loading,
68
- children: /* @__PURE__ */ o(D, {
67
+ className: e.loading,
68
+ children: /* @__PURE__ */ o(v, {
69
69
  "aria-label": n(l.loadingLabel),
70
70
  size: "large"
71
71
  })
72
72
  }), /* @__PURE__ */ o("div", {
73
- className: a(t.form, u && t.isLoading),
74
- children: d ? /* @__PURE__ */ o(O, {}) : /* @__PURE__ */ o(M, {})
73
+ className: a(e.form, u && e.isLoading),
74
+ children: d ? /* @__PURE__ */ o(M, {}) : /* @__PURE__ */ o(D, {})
75
75
  })]
76
- }), !_ && !d && g && /* @__PURE__ */ o(e.Close, {
76
+ }), !_ && g && /* @__PURE__ */ o(t.Close, {
77
77
  "aria-label": n(l.closeButton),
78
78
  disabled: s
79
79
  })]
@@ -1,53 +1,58 @@
1
- import { createContext as M, useContext as O, useState as e, useRef as F, useCallback as P, useEffect as A, useMemo as E } from "react";
2
- import { useUnifiedShareModalContext as L } from "./unified-share-modal-context.js";
3
- import { jsx as j } from "react/jsx-runtime";
4
- const v = /* @__PURE__ */ M(null), z = () => {
5
- const t = O(v);
1
+ import { createContext as A, useContext as D, useState as e, useRef as g, useCallback as E, useEffect as k, useMemo as L } from "react";
2
+ import { useUnifiedShareModalContext as j } from "./unified-share-modal-context.js";
3
+ import { jsx as q } from "react/jsx-runtime";
4
+ const M = /* @__PURE__ */ A(null), G = () => {
5
+ const t = D(M);
6
6
  if (!t)
7
7
  throw new Error("useUnifiedShareFormContext must be used with UnifiedShareFormProvider");
8
8
  return t;
9
- }, B = ({
9
+ }, H = ({
10
10
  children: t
11
11
  }) => {
12
12
  const {
13
- initialContacts: o,
14
- isOpen: s
15
- } = L(), [n, r] = e("default"), [a, i] = e(!1), [l, V] = e(null), [c, u] = e(o), [f, d] = e(""), [C, h] = e(""), [m, S] = e(), [x, R] = e({}), p = F(!1), U = F(!1), b = P((k) => {
16
- R((w) => ({
17
- ...w,
18
- ...k
13
+ initialContacts: n,
14
+ isOpen: a,
15
+ view: l
16
+ } = j(), [o, c] = e("default"), [f, u] = e(!1), [s, d] = e(!1), [m, O] = e(null), [C, h] = e(n), [S, x] = e(""), [R, p] = e(""), [F, U] = e(), [b, v] = e({}), V = g(!1), w = g(!1), I = E((r) => {
17
+ v((i) => ({
18
+ ...i,
19
+ ...r
19
20
  }));
20
21
  }, []);
21
- A(() => {
22
- s || (r("default"), i(!1), u(o), d(""), h(""), S(void 0), R({}), p.current = !1, U.current = !1);
23
- }, [o, s]);
24
- const g = E(() => ({
25
- collaborationRole: m,
26
- contactValue: f,
27
- containerRef: l,
28
- form: n,
29
- isCollaboratorsOpen: a,
30
- isSharedLinkAutoCopied: p,
31
- isSharedLinkAutoCreated: U,
32
- messageValue: C,
33
- setCollaborationRole: S,
34
- setContactValue: d,
35
- setContainerRef: V,
36
- setForm: r,
37
- setIsCollaboratorsOpen: i,
38
- setMessageValue: h,
39
- setShieldRestriction: b,
40
- setUserContacts: u,
41
- shieldRestriction: x,
42
- userContacts: c
43
- }), [m, f, l, n, b, a, C, x, c]);
44
- return /* @__PURE__ */ j(v.Provider, {
45
- value: g,
22
+ k(() => {
23
+ a || (c("default"), u(!1), d(!1), h(n), x(""), p(""), U(void 0), v({}), V.current = !1, w.current = !1);
24
+ }, [n, a]), k(() => {
25
+ const r = l === "unified-share-form", i = o === "default";
26
+ s || (!r || !i) && d(!0);
27
+ }, [s, l, o]);
28
+ const P = L(() => ({
29
+ collaborationRole: F,
30
+ contactValue: S,
31
+ containerRef: m,
32
+ form: o,
33
+ isCollaboratorsOpen: f,
34
+ isInteracted: s,
35
+ isSharedLinkAutoCopied: V,
36
+ isSharedLinkAutoCreated: w,
37
+ messageValue: R,
38
+ setCollaborationRole: U,
39
+ setContactValue: x,
40
+ setContainerRef: O,
41
+ setForm: c,
42
+ setIsCollaboratorsOpen: u,
43
+ setMessageValue: p,
44
+ setShieldRestriction: I,
45
+ setUserContacts: h,
46
+ shieldRestriction: b,
47
+ userContacts: C
48
+ }), [F, S, m, o, I, f, s, R, b, C]);
49
+ return /* @__PURE__ */ q(M.Provider, {
50
+ value: P,
46
51
  children: t
47
52
  });
48
53
  };
49
54
  export {
50
- v as UnifiedShareFormContext,
51
- B as UnifiedShareFormProvider,
52
- z as useUnifiedShareFormContext
55
+ M as UnifiedShareFormContext,
56
+ H as UnifiedShareFormProvider,
57
+ G as useUnifiedShareFormContext
53
58
  };
@@ -1 +1 @@
1
- ._container_1lxpo_1{display:flex;flex-direction:column;gap:var(--bp-space-040)}._header_1lxpo_7{display:flex;align-items:center;gap:var(--bp-space-020)}._content_1lxpo_13{display:flex;flex-direction:column;gap:var(--bp-space-050)}
1
+ ._container_1dpzl_1{display:inline-flex}._tooltip_1dpzl_5{display:flex;flex-direction:column;gap:var(--bp-space-040)}._header_1dpzl_11{display:flex;align-items:center;gap:var(--bp-space-020)}._content_1dpzl_17{display:flex;flex-direction:column;gap:var(--bp-space-050)}
@@ -1 +1 @@
1
- ._content_1dmg4_1._content_1dmg4_1{max-width:480px}._content_1dmg4_1._content_1dmg4_1._isFullscreen_1dmg4_4{width:100vw;max-width:none;height:100vh;max-height:none;margin:0;border-radius:0;animation:none}._content_1dmg4_1._content_1dmg4_1._isFullscreen_1dmg4_4 ._body_1dmg4_13{overflow:hidden auto}._header_1dmg4_17._header_1dmg4_17{display:flex;flex-wrap:wrap;gap:var(--bp-space-020);align-items:center}._body_1dmg4_13._body_1dmg4_13{display:flex;flex-direction:column;flex-grow:1;gap:var(--bp-space-040);margin-bottom:calc(var(--bp-space-010) * -1);padding-top:0;padding-bottom:var(--bp-space-010);overflow:auto}._form_1dmg4_35{position:relative;display:flex;flex-direction:column;flex-grow:1;overflow:hidden}._form_1dmg4_35 ._isLoading_1dmg4_42{visibility:hidden}._loading_1dmg4_46{position:absolute;inset:0;display:flex;align-items:center;padding-bottom:var(--bp-space-080)}._divider_1dmg4_54._divider_1dmg4_54{position:sticky;top:0;z-index:1;width:100%}
1
+ ._content_1jgi4_1._content_1jgi4_1{max-width:480px}._content_1jgi4_1._content_1jgi4_1._isFullscreen_1jgi4_4{width:100vw;max-width:none;height:100vh;max-height:none;margin:0;border-radius:0;animation:none}._content_1jgi4_1._content_1jgi4_1._isFullscreen_1jgi4_4 ._body_1jgi4_13{overflow:hidden auto}._title_1jgi4_17{display:inline}._title_1jgi4_17:after{display:inline-block;width:var(--bp-space-020);content:""}._body_1jgi4_13._body_1jgi4_13{display:flex;flex-direction:column;flex-grow:1;gap:var(--bp-space-040);margin-bottom:calc(var(--bp-space-010) * -1);padding-top:0;padding-bottom:var(--bp-space-010);overflow:auto}._form_1jgi4_37{position:relative;display:flex;flex-direction:column;flex-grow:1;overflow:hidden}._form_1jgi4_37 ._isLoading_1jgi4_44{visibility:hidden}._loading_1jgi4_48{position:absolute;inset:0;display:flex;align-items:center;padding-bottom:var(--bp-space-080)}._divider_1jgi4_56._divider_1jgi4_56{position:sticky;top:0;z-index:1;width:100%}
@@ -1 +1 @@
1
- ._content_17drm_1._content_17drm_1{max-width:480px}._content_17drm_1._content_17drm_1._isFullscreen_17drm_4{width:100vw;max-width:none;height:100vh;max-height:none;margin:0;border-radius:0;animation:none}._content_17drm_1._content_17drm_1._isFullscreen_17drm_4 ._body_17drm_13{overflow:hidden auto}._body_17drm_13._body_17drm_13{position:relative;display:flex;flex-direction:column;flex-grow:1;padding-top:0;padding-bottom:var(--bp-space-080)}._body_17drm_13._body_17drm_13:before{display:block;width:100vw;content:""}._body_17drm_13._body_17drm_13._hasFooter_17drm_30{padding-bottom:0}._classificationStatusContainer_17drm_34{display:inline-flex;margin-left:var(--bp-space-010)}._loading_17drm_39{position:absolute;inset:0;display:flex;align-items:center;padding-bottom:var(--bp-space-080)}._form_17drm_47{display:flex;flex-direction:column;flex-grow:1}._form_17drm_47._isLoading_17drm_52{visibility:hidden}@media not (max-width:374px){._content_17drm_1._content_17drm_1{overflow:auto}}@media not (max-width:459px){:has(>._content_17drm_1._content_17drm_1:not(._isFullscreen_17drm_4)){display:flex;padding:var(--bp-space-080);overflow:auto}._content_17drm_1._content_17drm_1{max-height:none;margin:auto;overflow:visible}}
1
+ ._content_1k0mu_1._content_1k0mu_1{max-width:480px}._content_1k0mu_1._content_1k0mu_1._isFullscreen_1k0mu_4{width:100vw;max-width:none;height:100vh;max-height:none;margin:0;border-radius:0;animation:none}._content_1k0mu_1._content_1k0mu_1._isFullscreen_1k0mu_4 ._body_1k0mu_13{overflow:hidden auto}._title_1k0mu_17{display:inline}._title_1k0mu_17:after{display:inline-block;width:var(--bp-space-020);content:""}._body_1k0mu_13._body_1k0mu_13{position:relative;display:flex;flex-direction:column;flex-grow:1;padding-top:0;padding-bottom:var(--bp-space-080)}._body_1k0mu_13._body_1k0mu_13:before{display:block;width:100vw;content:""}._body_1k0mu_13._body_1k0mu_13._hasFooter_1k0mu_39{padding-bottom:0}._loading_1k0mu_43{position:absolute;inset:0;display:flex;align-items:center;padding-bottom:var(--bp-space-080)}._form_1k0mu_51{display:flex;flex-direction:column;flex-grow:1}._form_1k0mu_51._isLoading_1k0mu_56{visibility:hidden}@media not (max-width:374px){._content_1k0mu_1._content_1k0mu_1{overflow:auto}}@media not (max-width:459px){:has(>._content_1k0mu_1._content_1k0mu_1:not(._isFullscreen_1k0mu_4)){display:flex;padding:var(--bp-space-080);overflow:auto}._content_1k0mu_1._content_1k0mu_1{max-height:none;margin:auto;overflow:visible}}
@@ -7,6 +7,7 @@ export interface UnifiedShareFormContextValue {
7
7
  containerRef: HTMLDivElement | null;
8
8
  form: FormType;
9
9
  isCollaboratorsOpen: boolean;
10
+ isInteracted: boolean;
10
11
  isSharedLinkAutoCopied: React.MutableRefObject<boolean>;
11
12
  isSharedLinkAutoCreated: React.MutableRefObject<boolean>;
12
13
  messageValue: string;
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "2.8.2",
3
+ "version": "2.8.4",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^13.7.4",
7
- "@box/blueprint-web-assets": "^4.106.1",
8
- "@box/copy-input": "^1.39.26",
9
- "@box/user-selector": "^1.73.27",
6
+ "@box/blueprint-web": "^13.7.6",
7
+ "@box/blueprint-web-assets": "^4.108.0",
8
+ "@box/copy-input": "^1.39.28",
9
+ "@box/user-selector": "^1.73.29",
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": "^13.7.4",
17
- "@box/blueprint-web-assets": "^4.106.1",
18
- "@box/copy-input": "^1.39.26",
19
- "@box/storybook-utils": "0.16.76",
16
+ "@box/blueprint-web": "^13.7.6",
17
+ "@box/blueprint-web-assets": "^4.108.0",
18
+ "@box/copy-input": "^1.39.28",
19
+ "@box/storybook-utils": "0.16.78",
20
20
  "@box/eslint-plugin-blueprint": "1.1.6",
21
21
  "react-intl": "^6.4.2"
22
22
  },