@box/unified-share-modal 2.6.6 → 2.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +3 -2
  2. package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +3 -2
  3. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +3 -2
  4. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +3 -2
  5. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +7 -6
  6. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +105 -112
  7. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +53 -50
  8. package/dist/esm/lib/constants.js +1 -1
  9. package/dist/esm/lib/contexts/unified-share-form-context.js +27 -25
  10. package/dist/esm/lib/hooks/use-sharing-action.js +45 -56
  11. package/dist/esm/lib/messages.js +0 -4
  12. package/dist/esm/lib/utils/index.js +25 -22
  13. package/dist/esm/lib/utils/notification.js +17 -0
  14. package/dist/i18n/bn-IN.js +2 -2
  15. package/dist/i18n/da-DK.js +2 -2
  16. package/dist/i18n/de-DE.js +2 -2
  17. package/dist/i18n/en-AU.js +2 -2
  18. package/dist/i18n/en-CA.js +2 -2
  19. package/dist/i18n/en-GB.js +2 -2
  20. package/dist/i18n/en-US.js +0 -1
  21. package/dist/i18n/en-US.properties +0 -2
  22. package/dist/i18n/en-x-pseudo.js +2 -2
  23. package/dist/i18n/es-419.js +2 -2
  24. package/dist/i18n/es-ES.js +2 -2
  25. package/dist/i18n/fi-FI.js +2 -2
  26. package/dist/i18n/fr-CA.js +2 -2
  27. package/dist/i18n/fr-FR.js +2 -2
  28. package/dist/i18n/hi-IN.js +2 -2
  29. package/dist/i18n/it-IT.js +2 -2
  30. package/dist/i18n/ja-JP.js +2 -2
  31. package/dist/i18n/json/src/lib/messages.json +1 -1
  32. package/dist/i18n/ko-KR.js +2 -2
  33. package/dist/i18n/nb-NO.js +2 -2
  34. package/dist/i18n/nl-NL.js +2 -2
  35. package/dist/i18n/pl-PL.js +2 -2
  36. package/dist/i18n/pt-BR.js +2 -2
  37. package/dist/i18n/ru-RU.js +2 -2
  38. package/dist/i18n/sv-SE.js +2 -2
  39. package/dist/i18n/tr-TR.js +2 -2
  40. package/dist/i18n/zh-CN.js +2 -2
  41. package/dist/i18n/zh-TW.js +2 -2
  42. package/dist/styles/unified-share-form-modal.css +1 -1
  43. package/dist/types/lib/contexts/unified-share-form-context.d.ts +2 -0
  44. package/dist/types/lib/messages.d.ts +0 -5
  45. package/dist/types/lib/types.d.ts +1 -1
  46. package/dist/types/lib/utils/index.d.ts +1 -0
  47. package/dist/types/lib/utils/notification.d.ts +9 -0
  48. package/package.json +1 -1
@@ -71,8 +71,9 @@ function q({
71
71
  onClick: _,
72
72
  children: t(n.okayButton)
73
73
  })]
74
- }), !r && !a && /* @__PURE__ */ e(o.Close, {
75
- "aria-label": t(n.closeButton)
74
+ }), !a && /* @__PURE__ */ e(o.Close, {
75
+ "aria-label": t(n.closeButton),
76
+ disabled: r
76
77
  })]
77
78
  })
78
79
  });
@@ -59,8 +59,9 @@ function z({
59
59
  onClick: h,
60
60
  children: t(n.okayButton)
61
61
  })]
62
- }), !i && !l && /* @__PURE__ */ o(e.Close, {
63
- "aria-label": t(n.closeButton)
62
+ }), !l && /* @__PURE__ */ o(e.Close, {
63
+ "aria-label": t(n.closeButton),
64
+ disabled: i
64
65
  })]
65
66
  })
66
67
  });
@@ -82,8 +82,9 @@ function Y({
82
82
  children: n(t.saveButton)
83
83
  })]
84
84
  })]
85
- }), !r && !c && /* @__PURE__ */ e(i.Close, {
86
- "aria-label": n(t.closeButton)
85
+ }), !c && /* @__PURE__ */ e(i.Close, {
86
+ "aria-label": n(t.closeButton),
87
+ disabled: r
87
88
  })]
88
89
  })
89
90
  });
@@ -191,8 +191,9 @@ function lt() {
191
191
  onClick: ce,
192
192
  children: t(o.sendButton)
193
193
  })]
194
- }), !m && !te && /* @__PURE__ */ r(v.Close, {
195
- "aria-label": t(o.closeButton)
194
+ }), !te && /* @__PURE__ */ r(v.Close, {
195
+ "aria-label": t(o.closeButton),
196
+ disabled: m
196
197
  })]
197
198
  }), U)]
198
199
  });
@@ -19,9 +19,9 @@ function Z() {
19
19
  const {
20
20
  formatMessage: o
21
21
  } = S(), l = x() === z.Small, {
22
- collaborators: f,
22
+ collaborators: b,
23
23
  config: s,
24
- eventService: b,
24
+ eventService: f,
25
25
  isFetching: _,
26
26
  isSubmitting: k,
27
27
  item: v,
@@ -31,7 +31,7 @@ function Z() {
31
31
  type: y
32
32
  } = v, {
33
33
  onCollaboratorsManagementClick: n
34
- } = b, c = C === "desktop", {
34
+ } = f, c = C === "desktop", {
35
35
  containerRef: d,
36
36
  previousForm: m,
37
37
  setForm: F
@@ -77,7 +77,7 @@ function Z() {
77
77
  children: o(r.roleColumn)
78
78
  })]
79
79
  }), /* @__PURE__ */ e(D, {
80
- children: f.slice(0, s.collaboratorsLimit).map((h) => /* @__PURE__ */ e(H, {
80
+ children: b.slice(0, s.collaboratorsLimit).map((h) => /* @__PURE__ */ e(H, {
81
81
  collaborator: h,
82
82
  isSmall: l
83
83
  }, h.id))
@@ -90,8 +90,9 @@ function Z() {
90
90
  onClick: () => F(m === "invite" ? m : "default"),
91
91
  children: o(r.doneButton)
92
92
  })
93
- }), !k && !c && /* @__PURE__ */ e(i.Close, {
94
- "aria-label": o(r.closeButton)
93
+ }), !c && /* @__PURE__ */ e(i.Close, {
94
+ "aria-label": o(r.closeButton),
95
+ disabled: k
95
96
  })]
96
97
  }), d)]
97
98
  });
@@ -1,122 +1,115 @@
1
- import { useRef as v, useState as K, useCallback as x, useEffect as D } from "react";
2
- import { useIntl as G } from "react-intl";
3
- import { Text as _, Tooltip as A, Focusable as V, Switch as q, Status as H, Link as J, Button as Q } from "@box/blueprint-web";
4
- import { ClockBadge as W } from "@box/blueprint-web-assets/icons/Line";
5
- import { Mail as X, Globe as j } from "@box/blueprint-web-assets/icons/Medium";
6
- import { SurfaceStatusSurfaceRed as Y, bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
7
- import { CopyInput as Z } from "@box/copy-input";
8
- import { SharedLinkAccess as $ } from "./shared-link-access.js";
9
- import { SharedLinkPermission as ee } from "./shared-link-permission.js";
1
+ import { useRef as M, useCallback as N, useEffect as O } from "react";
2
+ import { useIntl as R } from "react-intl";
3
+ import { useNotification as U, Text as S, Tooltip as y, Focusable as z, Switch as K, Status as G, Link as V, Button as q } from "@box/blueprint-web";
4
+ import { ClockBadge as H } from "@box/blueprint-web-assets/icons/Line";
5
+ import { Mail as J, Globe as E } from "@box/blueprint-web-assets/icons/Medium";
6
+ import { SurfaceStatusSurfaceRed as Q, bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
7
+ import { CopyInput as W } from "@box/copy-input";
8
+ import { SharedLinkAccess as X } from "./shared-link-access.js";
9
+ import { SharedLinkPermission as Y } from "./shared-link-permission.js";
10
10
  import t from "./messages.js";
11
- import { jsxs as l, jsx as i } from "react/jsx-runtime";
12
- import { useUnifiedShareFormContext as te } from "../../../contexts/unified-share-form-context.js";
13
- import { useUnifiedShareModalContext as ie } from "../../../contexts/unified-share-modal-context.js";
14
- import { useSharingAction as w } from "../../../hooks/use-sharing-action.js";
15
- import { formatDateFromTimestampToDateString as ae } from "../../../utils/date.js";
16
- import { callOnKeyboardEvent as ne } from "../../../utils/event.js";
17
- import '../../../../../styles/shared-link-section.css';const oe = "_container_j966c_1", se = "_toggle_j966c_7", re = "_settings_j966c_13", ce = "_copy_j966c_22", le = "_access_j966c_30", de = "_icon_j966c_36", r = {
18
- container: oe,
19
- toggle: se,
11
+ import { jsxs as d, jsx as i } from "react/jsx-runtime";
12
+ import { useUnifiedShareFormContext as Z } from "../../../contexts/unified-share-form-context.js";
13
+ import { useUnifiedShareModalContext as $ } from "../../../contexts/unified-share-modal-context.js";
14
+ import { useSharingAction as ee } from "../../../hooks/use-sharing-action.js";
15
+ import { getNotificationArgs as te } from "../../../utils/notification.js";
16
+ import { formatDateFromTimestampToDateString as ie } from "../../../utils/date.js";
17
+ import { callOnKeyboardEvent as ae } from "../../../utils/event.js";
18
+ import '../../../../../styles/shared-link-section.css';const ne = "_container_j966c_1", oe = "_toggle_j966c_7", re = "_settings_j966c_13", se = "_copy_j966c_22", ce = "_access_j966c_30", le = "_icon_j966c_36", c = {
19
+ container: ne,
20
+ toggle: oe,
20
21
  settings: re,
21
- copy: ce,
22
- access: le,
23
- icon: de
22
+ copy: se,
23
+ access: ce,
24
+ icon: le
24
25
  };
25
- function Te() {
26
+ function Ae() {
26
27
  const {
27
28
  formatMessage: e
28
- } = G(), k = v(!0), L = v(null), m = v(null), {
29
- setForm: I
30
- } = te(), {
29
+ } = R(), {
30
+ addNotification: C
31
+ } = U(), f = M(null), {
32
+ isSharedLinkAutoCopied: k,
33
+ isSharedLinkAutoCreated: r,
34
+ setForm: D
35
+ } = Z(), {
31
36
  config: s,
32
- isFetching: T,
37
+ isFetching: v,
33
38
  isSubmitting: n,
34
- item: F,
35
- setView: b,
39
+ item: j,
40
+ setView: L,
36
41
  sharedLink: o,
37
- sharingService: B
38
- } = ie(), {
39
- permissions: P = {}
40
- } = F, {
41
- createSharedLink: R
42
- } = B, {
43
- sharedLinkAutoCopy: d,
44
- sharedLinkAutoCreate: y
45
- } = s;
46
- let E = "create-shared-link";
47
- d && (E = "auto-copy-shared-link");
48
- const {
49
- onAction: S
50
- } = w(R, E), a = !!o.url, [C, M] = K(!1), p = x(async () => {
51
- a || (await S(), M(!0));
52
- }, [a, S]), O = x(async () => (p(), new Promise((c) => {
53
- m.current = {
54
- resolve: c
55
- };
56
- })), [p]), {
57
- onAction: N
58
- } = w(O, "auto-copy-shared-link");
59
- D(() => {
60
- !k.current || T || (d ? N() : y && p(), k.current = !1);
61
- }, [T, k, d, y, p, N]), D(() => {
62
- a && d && !n && L.current && L.current.click();
63
- }, [a, n, d]);
64
- const U = x((u) => {
65
- if (!m.current)
66
- return;
67
- let c;
68
- u instanceof Error ? c = C ? e(t.autoCreateCopyErrorNoticeText) : null : c = e(C ? t.autoCreateCopySuccessNoticeText : t.autoCopySuccessNoticeText), c && m.current.resolve({
69
- messages: [{
70
- text: c,
71
- type: "success"
72
- }]
73
- }), m.current = null;
74
- }, [e, C]), z = async (u) => {
75
- u || b("remove-shared-link"), u && await S();
42
+ sharingService: w
43
+ } = $(), {
44
+ permissions: x = {}
45
+ } = j, {
46
+ createSharedLink: _
47
+ } = w, {
48
+ sharedLinkAutoCopy: I,
49
+ sharedLinkAutoCreate: T
50
+ } = s, a = !!o.url, h = I && !k.current, A = T && !r.current, P = N(async () => {
51
+ const l = await _();
52
+ return h ? {
53
+ messages: []
54
+ } : l;
55
+ }, [h, _]), {
56
+ onAction: b
57
+ } = ee(P, "create-shared-link");
58
+ O(() => {
59
+ (async () => v || n || ((h || A) && !a && (await b(), r.current = !0), h && a && f.current && (f.current.click(), k.current = !0)))();
60
+ }, [a, h, A, v, k, r, n, b]);
61
+ const B = N((l) => {
62
+ let p;
63
+ l instanceof Error ? p = r.current ? e(t.autoCreateCopyErrorNoticeText) : null : p = r.current ? e(t.autoCreateCopySuccessNoticeText) : e(t.autoCopySuccessNoticeText), p && C({
64
+ ...te(e, "success"),
65
+ styledText: p
66
+ });
67
+ }, [C, e, r]), F = async (l) => {
68
+ l || L("remove-shared-link"), l && await b();
76
69
  };
77
- let h, f = !1;
78
- return !a && !n && (h = e(t.sharedLinkToggleTooltip)), !a && !P.canShare && (h = e(t.createLinkDisabledTooltip), f = !0), a && !P.canSetShareAccess && (h = e(t.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ l("div", {
79
- className: r.container,
80
- children: [/* @__PURE__ */ i(_, {
70
+ let m, u = !1;
71
+ return !a && !n && (m = e(t.sharedLinkToggleTooltip)), !a && !x.canShare && (m = e(t.createLinkDisabledTooltip), u = !0), a && !x.canSetShareAccess && (m = e(t.removeLinkDisabledTooltip), u = !0), /* @__PURE__ */ d("div", {
72
+ className: c.container,
73
+ children: [/* @__PURE__ */ i(S, {
81
74
  as: "label",
82
75
  variant: "bodyDefaultBold",
83
76
  children: e(t.shareLinkLabel)
84
- }), /* @__PURE__ */ l("div", {
85
- className: r.toggle,
86
- children: [/* @__PURE__ */ i(A, {
77
+ }), /* @__PURE__ */ d("div", {
78
+ className: c.toggle,
79
+ children: [/* @__PURE__ */ i(y, {
87
80
  align: "start",
88
- content: h,
81
+ content: m,
89
82
  "data-testid": "shared-link-tooltip",
90
- open: h ? void 0 : !1,
91
- children: /* @__PURE__ */ i(V, {
92
- focusable: f,
93
- children: /* @__PURE__ */ i(q.Item, {
83
+ open: m ? void 0 : !1,
84
+ children: /* @__PURE__ */ i(z, {
85
+ focusable: u,
86
+ children: /* @__PURE__ */ i(K.Item, {
94
87
  checked: a,
95
88
  "data-target-id": "Toggle-CreateSharedLink",
96
- disabled: f || n,
89
+ disabled: u || n,
97
90
  label: e(t.sharedLinkToggleLabel),
98
- onCheckedChange: z,
91
+ onCheckedChange: F,
99
92
  value: "shared-link"
100
93
  })
101
94
  })
102
- }), a && !!o.expiresAt && /* @__PURE__ */ i(A, {
95
+ }), a && !!o.expiresAt && /* @__PURE__ */ i(y, {
103
96
  content: e(t.expirationIconTooltip, {
104
- expirationDate: ae(o.expiresAt)
97
+ expirationDate: ie(o.expiresAt)
105
98
  }),
106
99
  "data-testid": "expiration-date-tooltip",
107
- children: /* @__PURE__ */ i(H, {
108
- color: Y,
100
+ children: /* @__PURE__ */ i(G, {
101
+ color: Q,
109
102
  hideText: !0,
110
- icon: W,
103
+ icon: H,
111
104
  text: e(t.expirationIconLabel)
112
105
  })
113
- }), a && s.sharedLinkSettings && /* @__PURE__ */ i(J, {
106
+ }), a && s.sharedLinkSettings && /* @__PURE__ */ i(V, {
114
107
  "aria-disabled": n,
115
108
  "aria-haspopup": "dialog",
116
- className: r.settings,
109
+ className: c.settings,
117
110
  "data-target-id": "PlainButton-SharedLinkSettings",
118
- onClick: () => b("shared-link-settings"),
119
- onKeyDown: ne(() => b("shared-link-settings"), {
111
+ onClick: () => L("shared-link-settings"),
112
+ onKeyDown: ae(() => L("shared-link-settings"), {
120
113
  canPreventDefault: !0
121
114
  }),
122
115
  role: "button",
@@ -124,49 +117,49 @@ function Te() {
124
117
  variant: "standalone",
125
118
  children: e(t.sharedLinkSettingsLabel)
126
119
  })]
127
- }), a && /* @__PURE__ */ l("div", {
128
- className: r.copy,
129
- children: [/* @__PURE__ */ i(Z, {
130
- ref: L,
131
- autoFocus: y && a,
120
+ }), a && /* @__PURE__ */ d("div", {
121
+ className: c.copy,
122
+ children: [/* @__PURE__ */ i(W, {
123
+ ref: f,
124
+ autoFocus: T && r.current,
132
125
  "data-target-id": "Button-CopySharedLink",
133
126
  disabled: n,
134
127
  hideLabel: !0,
135
128
  label: e(t.sharedLinkUrlLabel),
136
- onCopy: U,
129
+ onCopy: B,
137
130
  value: o.url
138
- }), s.sharedLinkEmail && /* @__PURE__ */ i(A, {
131
+ }), s.sharedLinkEmail && /* @__PURE__ */ i(y, {
139
132
  align: "end",
140
133
  content: e(t.sharedLinkEmailLabel),
141
- children: /* @__PURE__ */ i(Q, {
134
+ children: /* @__PURE__ */ i(q, {
142
135
  "aria-label": e(t.sharedLinkEmailLabel),
143
136
  "data-target-id": "Button-SendSharedLink",
144
137
  disabled: n,
145
- icon: X,
146
- onClick: () => I("email"),
138
+ icon: J,
139
+ onClick: () => D("email"),
147
140
  size: "large",
148
141
  variant: "secondary"
149
142
  })
150
143
  })]
151
- }), a && (s.sharedLinkAccess || s.sharedLinkPermission) && /* @__PURE__ */ l("div", {
152
- className: r.access,
153
- children: [s.sharedLinkAccess && /* @__PURE__ */ i($, {}), s.sharedLinkPermission && /* @__PURE__ */ i(ee, {})]
154
- }), a && o.access === "open" && /* @__PURE__ */ l("div", {
155
- children: [/* @__PURE__ */ i(j, {
156
- className: r.icon,
144
+ }), a && (s.sharedLinkAccess || s.sharedLinkPermission) && /* @__PURE__ */ d("div", {
145
+ className: c.access,
146
+ children: [s.sharedLinkAccess && /* @__PURE__ */ i(X, {}), s.sharedLinkPermission && /* @__PURE__ */ i(Y, {})]
147
+ }), a && o.access === "open" && /* @__PURE__ */ d("div", {
148
+ children: [/* @__PURE__ */ i(E, {
149
+ className: c.icon,
157
150
  height: g,
158
151
  width: g
159
- }), /* @__PURE__ */ i(_, {
152
+ }), /* @__PURE__ */ i(S, {
160
153
  as: "span",
161
154
  color: "textOnLightSecondary",
162
155
  children: o.permission === "can_edit" ? e(t.sharedLinkEditablePubliclyAvailable) : e(t.sharedLinkPubliclyAvailable)
163
156
  })]
164
- }), a && o.access === "company" && o.permission === "can_edit" && /* @__PURE__ */ l("div", {
165
- children: [/* @__PURE__ */ i(j, {
166
- className: r.icon,
157
+ }), a && o.access === "company" && o.permission === "can_edit" && /* @__PURE__ */ d("div", {
158
+ children: [/* @__PURE__ */ i(E, {
159
+ className: c.icon,
167
160
  height: g,
168
161
  width: g
169
- }), /* @__PURE__ */ i(_, {
162
+ }), /* @__PURE__ */ i(S, {
170
163
  as: "span",
171
164
  color: "textOnLightSecondary",
172
165
  children: e(t.sharedLinkElevatedEditableCompanyAvailable)
@@ -175,5 +168,5 @@ function Te() {
175
168
  });
176
169
  }
177
170
  export {
178
- Te as SharedLinkSection
171
+ Ae as SharedLinkSection
179
172
  };
@@ -1,23 +1,23 @@
1
1
  import a from "clsx";
2
- import { useCallback as x } from "react";
3
- import { useIntl as y } from "react-intl";
4
- import { Modal as n, LoadingIndicator as N } from "@box/blueprint-web";
5
- import { UnifiedShareForm as S } from "./unified-share-form.js";
2
+ import { useCallback as y } from "react";
3
+ import { useIntl as N } from "react-intl";
4
+ import { Modal as e, 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
- import { jsxs as t, jsx as o } from "react/jsx-runtime";
8
- import { CollaboratorList as D } from "./collaborator-list/collaborator-list.js";
9
- import { useUnifiedShareFormContext as g } from "../../contexts/unified-share-form-context.js";
10
- import { useUnifiedShareModalContext as v } from "../../contexts/unified-share-modal-context.js";
11
- import { ClassificationStatus as M } from "../classification-status/classification-status.js";
12
- import '../../../../styles/unified-share-form-modal.css';const U = "_content_uk5qn_1", O = "_isFullscreen_uk5qn_4", j = "_body_uk5qn_13", w = "_header_uk5qn_17", z = "_hasFooter_uk5qn_37", B = "_loading_uk5qn_41", I = "_form_uk5qn_49", P = "_isLoading_uk5qn_54", e = {
13
- content: U,
14
- isFullscreen: O,
15
- body: j,
16
- header: w,
7
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
8
+ import { CollaboratorList as M } from "./collaborator-list/collaborator-list.js";
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 O = "_content_17drm_1", j = "_isFullscreen_17drm_4", w = "_body_17drm_13", z = "_hasFooter_17drm_30", B = "_classificationStatusContainer_17drm_34", I = "_loading_17drm_39", P = "_form_17drm_47", H = "_isLoading_17drm_52", t = {
13
+ content: O,
14
+ isFullscreen: j,
15
+ body: w,
17
16
  hasFooter: z,
18
- loading: B,
19
- form: I,
20
- isLoading: P
17
+ classificationStatusContainer: B,
18
+ loading: I,
19
+ form: P,
20
+ isLoading: H
21
21
  };
22
22
  function X({
23
23
  children: m,
@@ -25,53 +25,56 @@ function X({
25
25
  onOpenChange: c
26
26
  }) {
27
27
  const {
28
- formatMessage: s
29
- } = y(), {
28
+ formatMessage: n
29
+ } = N(), {
30
30
  setContainerRef: F,
31
31
  setForm: d
32
- } = g(), {
32
+ } = h(), {
33
33
  isFetching: f,
34
- isSubmitting: r,
35
- item: b,
36
- variant: k
37
- } = v(), {
34
+ isSubmitting: s,
35
+ item: C,
36
+ variant: b
37
+ } = U(), {
38
38
  form: u
39
- } = g(), {
40
- name: C
41
- } = b, _ = k === "desktop", h = u === "default", q = x((i) => {
42
- r || (d("default"), c(i));
43
- }, [r, c, d]), L = (i) => {
44
- i.preventDefault();
39
+ } = h(), {
40
+ name: S
41
+ } = C, _ = b === "desktop", g = u === "default", L = y((r) => {
42
+ s || (d("default"), c(r));
43
+ }, [s, c, d]), x = (r) => {
44
+ r.preventDefault();
45
45
  };
46
- return /* @__PURE__ */ t(n, {
47
- onOpenChange: q,
46
+ return /* @__PURE__ */ i(e, {
47
+ onOpenChange: L,
48
48
  open: p,
49
- children: [!!m && /* @__PURE__ */ o(n.Trigger, {
49
+ children: [!!m && /* @__PURE__ */ o(e.Trigger, {
50
50
  children: m
51
- }), /* @__PURE__ */ t(n.Content, {
51
+ }), /* @__PURE__ */ i(e.Content, {
52
52
  ref: F,
53
- className: a(e.content, _ && e.isFullscreen),
54
- onPointerDownOutside: L,
53
+ className: a(t.content, _ && t.isFullscreen),
54
+ onPointerDownOutside: x,
55
55
  size: "medium",
56
- children: [/* @__PURE__ */ t(n.Header, {
57
- className: e.header,
58
- children: [s(l.title, {
59
- itemName: C
60
- }), /* @__PURE__ */ o(M, {})]
61
- }), /* @__PURE__ */ t(n.Body, {
62
- className: a(e.body, !h && e.hasFooter),
56
+ children: [/* @__PURE__ */ i(e.Header, {
57
+ children: [n(l.title, {
58
+ itemName: S
59
+ }), /* @__PURE__ */ o("div", {
60
+ className: t.classificationStatusContainer,
61
+ children: /* @__PURE__ */ o(k, {})
62
+ })]
63
+ }), /* @__PURE__ */ i(e.Body, {
64
+ className: a(t.body, !g && t.hasFooter),
63
65
  children: [f && /* @__PURE__ */ o("div", {
64
- className: e.loading,
65
- children: /* @__PURE__ */ o(N, {
66
- "aria-label": s(l.loadingLabel),
66
+ className: t.loading,
67
+ children: /* @__PURE__ */ o(v, {
68
+ "aria-label": n(l.loadingLabel),
67
69
  size: "large"
68
70
  })
69
71
  }), /* @__PURE__ */ o("div", {
70
- className: a(e.form, f && e.isLoading),
71
- children: u === "collaborators" ? /* @__PURE__ */ o(D, {}) : /* @__PURE__ */ o(S, {})
72
+ className: a(t.form, f && t.isLoading),
73
+ children: u === "collaborators" ? /* @__PURE__ */ o(M, {}) : /* @__PURE__ */ o(D, {})
72
74
  })]
73
- }), !r && !_ && h && /* @__PURE__ */ o(n.Close, {
74
- "aria-label": s(l.closeButton)
75
+ }), !_ && g && /* @__PURE__ */ o(e.Close, {
76
+ "aria-label": n(l.closeButton),
77
+ disabled: s
75
78
  })]
76
79
  })]
77
80
  });
@@ -1,4 +1,4 @@
1
- const e = ["invite-collaborators", "remove-collaborator", "create-shared-link", "delete-shared-link", "update-shared-link", "email-shared-link", "auto-copy-shared-link"], r = {
1
+ const e = ["invite-collaborators", "remove-collaborator", "create-shared-link", "delete-shared-link", "update-shared-link", "email-shared-link"], r = {
2
2
  collaboration: !0,
3
3
  collaborationLimit: 100,
4
4
  collaborationMessage: !0,
@@ -1,51 +1,53 @@
1
- import { createContext as P, useContext as g, useState as e, useCallback as w, useEffect as M, useMemo as E } from "react";
1
+ import { createContext as w, useContext as M, useState as e, useRef as U, useCallback as A, useEffect as E, useMemo as L } from "react";
2
2
  import { useUnifiedShareModalContext as j } from "./unified-share-modal-context.js";
3
- import { jsx as k } from "react/jsx-runtime";
4
- const v = /* @__PURE__ */ P(null), z = () => {
5
- const t = g(v);
3
+ import { jsx as O } from "react/jsx-runtime";
4
+ const V = /* @__PURE__ */ w(null), B = () => {
5
+ const t = M(V);
6
6
  if (!t)
7
7
  throw new Error("useUnifiedShareFormContext must be used with UnifiedShareFormProvider");
8
8
  return t;
9
- }, A = ({
9
+ }, D = ({
10
10
  children: t
11
11
  }) => {
12
12
  const {
13
13
  initialContacts: o,
14
- isOpen: n
15
- } = j(), [s, r] = e("default"), [i, a] = e("default"), [c, U] = e(null), [l, u] = e(o), [d, f] = e(""), [m, h] = e(""), [C, x] = e(), [S, F] = e({}), R = w((V) => {
16
- F((b) => ({
17
- ...b,
18
- ...V
14
+ isOpen: s
15
+ } = j(), [n, r] = e("default"), [i, a] = e("default"), [c, b] = e(null), [l, u] = e(o), [d, f] = e(""), [m, h] = e(""), [C, S] = e(), [x, R] = e({}), F = U(!1), p = U(!1), v = A((g) => {
16
+ R((k) => ({
17
+ ...k,
18
+ ...g
19
19
  }));
20
20
  }, []);
21
- M(() => {
22
- n || (r("default"), a("default"), u(o), f(""), h(""), x(void 0), F({}));
23
- }, [o, n]);
24
- const p = E(() => ({
21
+ E(() => {
22
+ s || (r("default"), a("default"), u(o), f(""), h(""), S(void 0), R({}), F.current = !1, p.current = !1);
23
+ }, [o, s]);
24
+ const P = L(() => ({
25
25
  collaborationRole: C,
26
26
  contactValue: d,
27
27
  containerRef: c,
28
- form: s,
28
+ form: n,
29
+ isSharedLinkAutoCopied: F,
30
+ isSharedLinkAutoCreated: p,
29
31
  messageValue: m,
30
32
  previousForm: i,
31
- setCollaborationRole: x,
33
+ setCollaborationRole: S,
32
34
  setContactValue: f,
33
- setContainerRef: U,
35
+ setContainerRef: b,
34
36
  setForm: r,
35
37
  setMessageValue: h,
36
38
  setPreviousForm: a,
37
- setShieldRestriction: R,
39
+ setShieldRestriction: v,
38
40
  setUserContacts: u,
39
- shieldRestriction: S,
41
+ shieldRestriction: x,
40
42
  userContacts: l
41
- }), [C, d, c, s, R, m, i, S, l]);
42
- return /* @__PURE__ */ k(v.Provider, {
43
- value: p,
43
+ }), [C, d, c, n, v, m, i, x, l]);
44
+ return /* @__PURE__ */ O(V.Provider, {
45
+ value: P,
44
46
  children: t
45
47
  });
46
48
  };
47
49
  export {
48
- v as UnifiedShareFormContext,
49
- A as UnifiedShareFormProvider,
50
- z as useUnifiedShareFormContext
50
+ V as UnifiedShareFormContext,
51
+ D as UnifiedShareFormProvider,
52
+ B as useUnifiedShareFormContext
51
53
  };