@box/unified-share-modal 2.12.14 → 2.12.16

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 (95) hide show
  1. package/dist/chunks/classification-status.js +62 -0
  2. package/dist/chunks/collaboration-role.js +89 -0
  3. package/dist/chunks/collaboration-section.js +156 -0
  4. package/dist/chunks/collaborator-list-item.js +61 -0
  5. package/dist/chunks/collaborator-list.js +74 -0
  6. package/dist/chunks/remove-collaborator-modal.js +61 -0
  7. package/dist/chunks/remove-shared-link-modal.js +56 -0
  8. package/dist/chunks/shared-link-access.js +65 -0
  9. package/dist/chunks/shared-link-permission.js +67 -0
  10. package/dist/chunks/shared-link-section.js +176 -0
  11. package/dist/chunks/shared-link-settings-modal.js +86 -0
  12. package/dist/chunks/shared-with-avatars.js +48 -0
  13. package/dist/chunks/shield-restriction-notice.js +97 -0
  14. package/dist/chunks/text-area-container.js +36 -0
  15. package/dist/chunks/unified-share-form-modal.js +66 -0
  16. package/dist/chunks/unified-share-form.js +23 -0
  17. package/dist/esm/index.js +2 -4
  18. package/dist/esm/lib/components/classification-status/classification-status.js +2 -80
  19. package/dist/esm/lib/components/classification-status/index.js +2 -4
  20. package/dist/esm/lib/components/classification-status/messages.js +10 -12
  21. package/dist/esm/lib/components/index.js +5 -10
  22. package/dist/esm/lib/components/remove-collaborator-modal/index.js +2 -4
  23. package/dist/esm/lib/components/remove-collaborator-modal/messages.js +26 -28
  24. package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +2 -84
  25. package/dist/esm/lib/components/remove-shared-link-modal/index.js +2 -4
  26. package/dist/esm/lib/components/remove-shared-link-modal/messages.js +26 -28
  27. package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +2 -72
  28. package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +35 -61
  29. package/dist/esm/lib/components/shared-link-settings-modal/expiration-section.js +33 -50
  30. package/dist/esm/lib/components/shared-link-settings-modal/index.js +2 -4
  31. package/dist/esm/lib/components/shared-link-settings-modal/messages.js +138 -144
  32. package/dist/esm/lib/components/shared-link-settings-modal/password-section.js +32 -52
  33. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +2 -98
  34. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +97 -126
  35. package/dist/esm/lib/components/shared-link-settings-modal/vanity-section.js +33 -47
  36. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +2 -128
  37. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +2 -202
  38. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/index.js +2 -4
  39. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +134 -136
  40. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +2 -67
  41. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +2 -134
  42. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +2 -53
  43. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +48 -60
  44. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +2 -86
  45. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +2 -101
  46. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/index.js +2 -4
  47. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/messages.js +38 -40
  48. package/dist/esm/lib/components/unified-share-form-modal/index.js +2 -4
  49. package/dist/esm/lib/components/unified-share-form-modal/messages.js +46 -48
  50. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/index.js +2 -4
  51. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +142 -144
  52. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +2 -102
  53. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +2 -105
  54. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +2 -191
  55. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +2 -85
  56. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +2 -29
  57. package/dist/esm/lib/constants.js +44 -28
  58. package/dist/esm/lib/contexts/index.js +4 -14
  59. package/dist/esm/lib/contexts/shared-link-settings-context.js +50 -59
  60. package/dist/esm/lib/contexts/unified-share-form-context.js +60 -57
  61. package/dist/esm/lib/contexts/unified-share-modal-context.js +65 -68
  62. package/dist/esm/lib/hooks/index.js +7 -14
  63. package/dist/esm/lib/hooks/use-access-levels.js +69 -93
  64. package/dist/esm/lib/hooks/use-collaboration-form.js +75 -95
  65. package/dist/esm/lib/hooks/use-form-validation.js +32 -43
  66. package/dist/esm/lib/hooks/use-link-settings-form.js +49 -64
  67. package/dist/esm/lib/hooks/use-permission-levels.js +33 -50
  68. package/dist/esm/lib/hooks/use-sharing-action.js +44 -59
  69. package/dist/esm/lib/messages.js +106 -108
  70. package/dist/esm/lib/unified-share-base.js +30 -40
  71. package/dist/esm/lib/unified-share-modal.js +41 -59
  72. package/dist/esm/lib/utils/collaborator.js +12 -27
  73. package/dist/esm/lib/utils/date.js +10 -14
  74. package/dist/esm/lib/utils/email.js +5 -7
  75. package/dist/esm/lib/utils/event.js +6 -13
  76. package/dist/esm/lib/utils/form.js +4 -14
  77. package/dist/esm/lib/utils/index.js +9 -34
  78. package/dist/esm/lib/utils/notification.js +19 -28
  79. package/dist/esm/lib/utils/permission.js +15 -22
  80. package/dist/esm/lib/utils/validation.js +2 -11
  81. package/dist/styles/classification-status.css +1 -1
  82. package/dist/styles/collaboration-role.css +1 -1
  83. package/dist/styles/collaboration-section.css +1 -1
  84. package/dist/styles/collaborator-list-item.css +1 -1
  85. package/dist/styles/collaborator-list.css +1 -1
  86. package/dist/styles/remove-collaborator-modal.css +1 -1
  87. package/dist/styles/shared-link-access.css +1 -1
  88. package/dist/styles/shared-link-section.css +1 -1
  89. package/dist/styles/shared-link-settings-modal.css +1 -1
  90. package/dist/styles/shared-with-avatars.css +1 -1
  91. package/dist/styles/shield-restriction-notice.css +1 -1
  92. package/dist/styles/text-area-container.css +1 -1
  93. package/dist/styles/unified-share-form-modal.css +1 -1
  94. package/dist/styles/unified-share-form.css +1 -1
  95. package/package.json +10 -10
@@ -1,65 +1,50 @@
1
- import U from "lodash/isEqual";
2
- import { useState as A, useRef as C, useEffect as j, useCallback as u } from "react";
3
- import { useUnifiedShareModalContext as q } from "../contexts/unified-share-modal-context.js";
4
- import { useFormValidation as I } from "./use-form-validation.js";
5
- import { useSharingAction as M } from "./use-sharing-action.js";
6
- import { getUpdatedLinkSettingsFormData as O } from "../utils/form.js";
7
- const K = (e) => {
8
- const [s, o] = A(e), i = C(e), {
9
- errors: E,
10
- setErrors: r,
11
- setFieldError: n,
12
- validateExpiration: p,
13
- validatePassword: a,
14
- validateVanityName: f
15
- } = I(), {
16
- sharingService: h
17
- } = q(), {
18
- updateSharedLink: l
19
- } = h, {
20
- onAction: m
21
- } = M(l, "update-shared-link");
22
- j(() => {
23
- U(i.current, e) || (o(e), r({}), i.current = e);
24
- }, [e, r]);
25
- const S = u((t, c) => {
26
- o((d) => ({
27
- ...d,
28
- [t]: c
29
- }));
30
- }, []), b = u(() => {
31
- o(e), r({});
32
- }, [e, r]), v = u(async () => {
33
- const t = O(s, e), {
34
- expiration: c,
35
- isExpirationEnabled: d,
36
- isPasswordEnabled: x,
37
- isVanityNameEnabled: y,
38
- password: g,
39
- vanityName: k
40
- } = t, w = d && p(c), V = x && a(g), N = y && f(k);
41
- if (w || V || N)
42
- return !0;
43
- try {
44
- await m({
45
- ...e,
46
- ...t
47
- });
48
- } catch (L) {
49
- return Object.entries(L).forEach(([P, R]) => n(P, R)), !0;
50
- }
51
- return !1;
52
- }, [s, e, m, n, p, a, f]);
53
- return {
54
- errors: E,
55
- formData: s,
56
- handleFormReset: b,
57
- handleFormSubmit: v,
58
- setFieldError: n,
59
- setFieldValue: S,
60
- validatePassword: a
61
- };
62
- };
63
- export {
64
- K as useLinkSettingsForm
1
+ import { useUnifiedShareModalContext as e } from "../contexts/unified-share-modal-context.js";
2
+ import { getUpdatedLinkSettingsFormData as t } from "../utils/form.js";
3
+ import { useFormValidation as n } from "./use-form-validation.js";
4
+ import { useSharingAction as r } from "./use-sharing-action.js";
5
+ import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
6
+ import c from "lodash/isEqual";
7
+ var l = (l) => {
8
+ let [u, d] = s(l), f = o(l), { errors: p, setErrors: m, setFieldError: h, validateExpiration: g, validatePassword: _, validateVanityName: v } = n(), { sharingService: y } = e(), { updateSharedLink: b } = y, { onAction: x } = r(b, "update-shared-link");
9
+ a(() => {
10
+ c(f.current, l) || (d(l), m({}), f.current = l);
11
+ }, [l, m]);
12
+ let S = i((e, t) => {
13
+ d((n) => ({
14
+ ...n,
15
+ [e]: t
16
+ }));
17
+ }, []);
18
+ return {
19
+ errors: p,
20
+ formData: u,
21
+ handleFormReset: i(() => {
22
+ d(l), m({});
23
+ }, [l, m]),
24
+ handleFormSubmit: i(async () => {
25
+ let e = t(u, l), { expiration: n, isExpirationEnabled: r, isPasswordEnabled: i, isVanityNameEnabled: a, password: o, vanityName: s } = e, c = r && g(n), d = i && _(o), f = a && v(s);
26
+ if (c || d || f) return !0;
27
+ try {
28
+ await x({
29
+ ...l,
30
+ ...e
31
+ });
32
+ } catch (e) {
33
+ return Object.entries(e).forEach(([e, t]) => h(e, t)), !0;
34
+ }
35
+ return !1;
36
+ }, [
37
+ u,
38
+ l,
39
+ x,
40
+ h,
41
+ g,
42
+ _,
43
+ v
44
+ ]),
45
+ setFieldError: h,
46
+ setFieldValue: S,
47
+ validatePassword: _
48
+ };
65
49
  };
50
+ export { l as useLinkSettingsForm };
@@ -1,51 +1,34 @@
1
- import { useMemo as a } from "react";
2
- import { useIntl as l } from "react-intl";
3
- import { useUnifiedShareModalContext as d } from "../contexts/unified-share-modal-context.js";
4
- import t from "../components/unified-share-form-modal/shared-link-section/messages.js";
5
- import { getAllowedPermissionLevels as p } from "../utils/permission.js";
6
- const L = (o, n) => {
7
- const {
8
- id: r,
9
- label: i
10
- } = n;
11
- let e;
12
- switch (r) {
13
- case "can_download":
14
- e = t.canDownloadPermissionLevelLabel;
15
- break;
16
- case "can_edit":
17
- e = t.canEditPermissionLevelLabel;
18
- break;
19
- case "can_preview":
20
- e = t.canPreviewPermissionLevelLabel;
21
- break;
22
- }
23
- return i ?? (e ? o(e) : "");
24
- }, w = () => {
25
- const {
26
- formatMessage: o
27
- } = l(), {
28
- sharedLink: n
29
- } = d(), {
30
- permission: r,
31
- permissionLevels: i
32
- } = n, e = a(() => p(i).map((s) => {
33
- const {
34
- description: c
35
- } = s;
36
- return {
37
- ...s,
38
- description: c ?? "",
39
- label: L(o, s)
40
- };
41
- }), [i, o]), m = a(() => e.find(({
42
- id: s
43
- }) => r === s), [r, e]);
44
- return {
45
- allowedLevels: e,
46
- selectedPermission: m
47
- };
48
- };
49
- export {
50
- w as usePermissionLevels
1
+ import { useUnifiedShareModalContext as e } from "../contexts/unified-share-modal-context.js";
2
+ import { getAllowedPermissionLevels as t } from "../utils/permission.js";
3
+ import n from "../components/unified-share-form-modal/shared-link-section/messages.js";
4
+ import { useMemo as r } from "react";
5
+ import { useIntl as i } from "react-intl";
6
+ var a = (e, t) => {
7
+ let { id: r, label: i } = t, a;
8
+ switch (r) {
9
+ case "can_download":
10
+ a = n.canDownloadPermissionLevelLabel;
11
+ break;
12
+ case "can_edit":
13
+ a = n.canEditPermissionLevelLabel;
14
+ break;
15
+ case "can_preview":
16
+ a = n.canPreviewPermissionLevelLabel;
17
+ break;
18
+ }
19
+ return i ?? (a ? e(a) : "");
20
+ }, o = () => {
21
+ let { formatMessage: n } = i(), { sharedLink: o } = e(), { permission: s, permissionLevels: c } = o, l = r(() => t(c).map((e) => {
22
+ let { description: t } = e;
23
+ return {
24
+ ...e,
25
+ description: t ?? "",
26
+ label: a(n, e)
27
+ };
28
+ }), [c, n]);
29
+ return {
30
+ allowedLevels: l,
31
+ selectedPermission: r(() => l.find(({ id: e }) => s === e), [s, l])
32
+ };
51
33
  };
34
+ export { o as usePermissionLevels };
@@ -1,60 +1,45 @@
1
- import { useMemo as x, useCallback as A } from "react";
2
- import { useIntl as b } from "react-intl";
3
- import { useNotification as C } from "@box/blueprint-web";
4
- import { useUnifiedShareModalContext as T } from "../contexts/unified-share-modal-context.js";
5
- import { getNotificationArgs as a, getNotificationMessage as d } from "../utils/notification.js";
6
- const v = (r, t) => {
7
- const {
8
- formatMessage: e
9
- } = b(), {
10
- addNotification: i
11
- } = C(), {
12
- config: u,
13
- item: g,
14
- setIsLoading: c
15
- } = T(), {
16
- notifications: f
17
- } = u, {
18
- name: l
19
- } = g, n = x(() => f.includes(t), [t, f]);
20
- return {
21
- onAction: A(async (...h) => {
22
- c(!0);
23
- try {
24
- if (r) {
25
- const s = await r(...h), o = !!s && !!s.messages, N = n && !o;
26
- o && s.messages.forEach(({
27
- text: p,
28
- type: y,
29
- ...M
30
- }) => {
31
- i({
32
- ...a(e, y),
33
- styledText: p,
34
- ...M
35
- });
36
- });
37
- const m = d(e, "success", t, {
38
- itemName: l
39
- });
40
- N && m && i({
41
- ...a(e, "success"),
42
- styledText: m
43
- });
44
- }
45
- } catch (s) {
46
- const o = d(e, "error", t);
47
- if (n && o && i({
48
- ...a(e, "error"),
49
- styledText: o
50
- }), s?.fields && Object.values(s.fields).length)
51
- throw s.fields;
52
- } finally {
53
- c(!1);
54
- }
55
- }, [r, i, e, n, l, t, c])
56
- };
57
- };
58
- export {
59
- v as useSharingAction
1
+ import { useUnifiedShareModalContext as e } from "../contexts/unified-share-modal-context.js";
2
+ import { getNotificationArgs as t, getNotificationMessage as n } from "../utils/notification.js";
3
+ import { useCallback as r, useMemo as i } from "react";
4
+ import { useIntl as a } from "react-intl";
5
+ import { useNotification as o } from "@box/blueprint-web";
6
+ var s = (s, c) => {
7
+ let { formatMessage: l } = a(), { addNotification: u } = o(), { config: d, item: f, setIsLoading: p } = e(), { notifications: m } = d, { name: h } = f, g = i(() => m.includes(c), [c, m]);
8
+ return { onAction: r(async (...e) => {
9
+ p(!0);
10
+ try {
11
+ if (s) {
12
+ let r = await s(...e), i = !!r && !!r.messages, a = g && !i;
13
+ i && r.messages.forEach(({ text: e, type: n, ...r }) => {
14
+ u({
15
+ ...t(l, n),
16
+ styledText: e,
17
+ ...r
18
+ });
19
+ });
20
+ let o = n(l, "success", c, { itemName: h });
21
+ a && o && u({
22
+ ...t(l, "success"),
23
+ styledText: o
24
+ });
25
+ }
26
+ } catch (e) {
27
+ let r = n(l, "error", c);
28
+ if (g && r && u({
29
+ ...t(l, "error"),
30
+ styledText: r
31
+ }), e?.fields && Object.values(e.fields).length) throw e.fields;
32
+ } finally {
33
+ p(!1);
34
+ }
35
+ }, [
36
+ s,
37
+ u,
38
+ l,
39
+ g,
40
+ h,
41
+ c,
42
+ p
43
+ ]) };
60
44
  };
45
+ export { s as useSharingAction };
@@ -1,110 +1,108 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const a = e({
3
- noticeCloseLabel: {
4
- id: "groupSharedFeatures.usm.noticeCloseLabel",
5
- defaultMessage: "Close"
6
- },
7
- successNoticeIcon: {
8
- id: "groupSharedFeatures.usm.successNoticeIcon",
9
- defaultMessage: "Success"
10
- },
11
- errorNoticeIcon: {
12
- id: "groupSharedFeatures.usm.errorNoticeIcon",
13
- defaultMessage: "Error"
14
- },
15
- warningNoticeIcon: {
16
- id: "groupSharedFeatures.usm.warningNoticeIcon",
17
- defaultMessage: "Warning"
18
- },
19
- defaultErrorNoticeText: {
20
- id: "groupSharedFeatures.usm.defaultErrorNoticeText",
21
- defaultMessage: "Something went wrong. Please try again later."
22
- },
23
- removeCollaboratorSuccessNoticeText: {
24
- id: "groupSharedFeatures.usm.removeCollaboratorSuccessNoticeText",
25
- defaultMessage: "The collaborator has been removed successfully."
26
- },
27
- removeCollaboratorErrorNoticeText: {
28
- id: "groupSharedFeatures.usm.removeCollaboratorErrorNoticeText",
29
- defaultMessage: "Unable to remove the collaborator. Please try again later."
30
- },
31
- deleteSharedLinkSuccessNoticeText: {
32
- id: "groupSharedFeatures.usm.deleteSharedLinkSuccessNoticeText",
33
- defaultMessage: "The shared link for “{itemName}” has been removed successfully."
34
- },
35
- deleteSharedLinkErrorNoticeText: {
36
- id: "groupSharedFeatures.usm.deleteSharedLinkErrorNoticeText",
37
- defaultMessage: "Unable to remove the shared link. Please try again later."
38
- },
39
- updateSharedLinkSuccessNoticeText: {
40
- id: "groupSharedFeatures.usm.updateSharedLinkSuccessNoticeText",
41
- defaultMessage: "The shared link settings were saved successfully."
42
- },
43
- createSharedLinkSuccessNoticeText: {
44
- id: "groupSharedFeatures.usm.createSharedLinkSuccessNoticeText",
45
- defaultMessage: "Shared link created."
46
- },
47
- createSharedLinkErrorNoticeText: {
48
- id: "groupSharedFeatures.usm.createSharedLinkErrorNoticeText",
49
- defaultMessage: "Unable to create a shared link. Please try again later."
50
- },
51
- emailSharedLinkSuccessNoticeText: {
52
- id: "groupSharedFeatures.usm.emailSharedLinkSuccessNoticeText",
53
- defaultMessage: "The shared link for “{itemName}” was sent successfully."
54
- },
55
- vanityNameInvalidErrorMessage: {
56
- id: "groupSharedFeatures.usm.vanityNameInvalidErrorMessage",
57
- defaultMessage: "Custom URLs must be between 12-30 characters, and can include letters, numbers, and hyphens"
58
- },
59
- vanityNameRequiredErrorMessage: {
60
- id: "groupSharedFeatures.usm.vanityNameRequiredErrorMessage",
61
- defaultMessage: "Please enter a custom URL"
62
- },
63
- expirationRequiredErrorMessage: {
64
- id: "groupSharedFeatures.usm.expirationRequiredErrorMessage",
65
- defaultMessage: "Please select an expiration date"
66
- },
67
- expirationFutureDateErrorMessage: {
68
- id: "groupSharedFeatures.usm.expirationFutureDateErrorMessage",
69
- defaultMessage: "Expiration date must be in the future"
70
- },
71
- invalidEmailErrorMessage: {
72
- id: "groupSharedFeatures.usm.invalidEmailErrorMessage",
73
- defaultMessage: "Invalid email address"
74
- },
75
- emailRequiredErrorMessage: {
76
- id: "groupSharedFeatures.usm.emailRequiredErrorMessage",
77
- defaultMessage: "Enter at least one valid email"
78
- },
79
- contactsLimitErrorMessage: {
80
- id: "groupSharedFeatures.usm.contactsLimitErrorMessage",
81
- defaultMessage: "Oops! The maximum number of collaborators that can be added at once is {maxContacts} collaborators. Please try again by splitting your invitations into batches."
82
- },
83
- passwordRequiredErrorMessage: {
84
- id: "groupSharedFeatures.usm.passwordRequiredErrorMessage",
85
- defaultMessage: "Please enter a password"
86
- },
87
- passwordContainMinCharactersErrorMessage: {
88
- id: "groupSharedFeatures.usm.passwordContainMinCharactersErrorMessage",
89
- defaultMessage: "Password must contain at least 8 characters"
90
- },
91
- passwordContainInvalidCharacterErrorMessage: {
92
- id: "groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage",
93
- defaultMessage: 'Password cannot contain a space, "<" or ">"'
94
- },
95
- passwordContainLetterNumberOrSymbolErrorMessage: {
96
- id: "groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage",
97
- defaultMessage: "Password must contain at least one upper case letter, number, or special character"
98
- },
99
- justificationRequiredErrorNotice: {
100
- id: "groupSharedFeatures.usm.justificationRequiredErrorNotice",
101
- defaultMessage: "Please select a justification or remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue."
102
- },
103
- restrictedContactsErrorNotice: {
104
- id: "groupSharedFeatures.usm.restrictedContactsErrorNotice",
105
- defaultMessage: "Please remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue."
106
- }
2
+ var t = e({
3
+ noticeCloseLabel: {
4
+ id: "groupSharedFeatures.usm.noticeCloseLabel",
5
+ defaultMessage: "Close"
6
+ },
7
+ successNoticeIcon: {
8
+ id: "groupSharedFeatures.usm.successNoticeIcon",
9
+ defaultMessage: "Success"
10
+ },
11
+ errorNoticeIcon: {
12
+ id: "groupSharedFeatures.usm.errorNoticeIcon",
13
+ defaultMessage: "Error"
14
+ },
15
+ warningNoticeIcon: {
16
+ id: "groupSharedFeatures.usm.warningNoticeIcon",
17
+ defaultMessage: "Warning"
18
+ },
19
+ defaultErrorNoticeText: {
20
+ id: "groupSharedFeatures.usm.defaultErrorNoticeText",
21
+ defaultMessage: "Something went wrong. Please try again later."
22
+ },
23
+ removeCollaboratorSuccessNoticeText: {
24
+ id: "groupSharedFeatures.usm.removeCollaboratorSuccessNoticeText",
25
+ defaultMessage: "The collaborator has been removed successfully."
26
+ },
27
+ removeCollaboratorErrorNoticeText: {
28
+ id: "groupSharedFeatures.usm.removeCollaboratorErrorNoticeText",
29
+ defaultMessage: "Unable to remove the collaborator. Please try again later."
30
+ },
31
+ deleteSharedLinkSuccessNoticeText: {
32
+ id: "groupSharedFeatures.usm.deleteSharedLinkSuccessNoticeText",
33
+ defaultMessage: "The shared link for “{itemName}” has been removed successfully."
34
+ },
35
+ deleteSharedLinkErrorNoticeText: {
36
+ id: "groupSharedFeatures.usm.deleteSharedLinkErrorNoticeText",
37
+ defaultMessage: "Unable to remove the shared link. Please try again later."
38
+ },
39
+ updateSharedLinkSuccessNoticeText: {
40
+ id: "groupSharedFeatures.usm.updateSharedLinkSuccessNoticeText",
41
+ defaultMessage: "The shared link settings were saved successfully."
42
+ },
43
+ createSharedLinkSuccessNoticeText: {
44
+ id: "groupSharedFeatures.usm.createSharedLinkSuccessNoticeText",
45
+ defaultMessage: "Shared link created."
46
+ },
47
+ createSharedLinkErrorNoticeText: {
48
+ id: "groupSharedFeatures.usm.createSharedLinkErrorNoticeText",
49
+ defaultMessage: "Unable to create a shared link. Please try again later."
50
+ },
51
+ emailSharedLinkSuccessNoticeText: {
52
+ id: "groupSharedFeatures.usm.emailSharedLinkSuccessNoticeText",
53
+ defaultMessage: "The shared link for “{itemName}” was sent successfully."
54
+ },
55
+ vanityNameInvalidErrorMessage: {
56
+ id: "groupSharedFeatures.usm.vanityNameInvalidErrorMessage",
57
+ defaultMessage: "Custom URLs must be between 12-30 characters, and can include letters, numbers, and hyphens"
58
+ },
59
+ vanityNameRequiredErrorMessage: {
60
+ id: "groupSharedFeatures.usm.vanityNameRequiredErrorMessage",
61
+ defaultMessage: "Please enter a custom URL"
62
+ },
63
+ expirationRequiredErrorMessage: {
64
+ id: "groupSharedFeatures.usm.expirationRequiredErrorMessage",
65
+ defaultMessage: "Please select an expiration date"
66
+ },
67
+ expirationFutureDateErrorMessage: {
68
+ id: "groupSharedFeatures.usm.expirationFutureDateErrorMessage",
69
+ defaultMessage: "Expiration date must be in the future"
70
+ },
71
+ invalidEmailErrorMessage: {
72
+ id: "groupSharedFeatures.usm.invalidEmailErrorMessage",
73
+ defaultMessage: "Invalid email address"
74
+ },
75
+ emailRequiredErrorMessage: {
76
+ id: "groupSharedFeatures.usm.emailRequiredErrorMessage",
77
+ defaultMessage: "Enter at least one valid email"
78
+ },
79
+ contactsLimitErrorMessage: {
80
+ id: "groupSharedFeatures.usm.contactsLimitErrorMessage",
81
+ defaultMessage: "Oops! The maximum number of collaborators that can be added at once is {maxContacts} collaborators. Please try again by splitting your invitations into batches."
82
+ },
83
+ passwordRequiredErrorMessage: {
84
+ id: "groupSharedFeatures.usm.passwordRequiredErrorMessage",
85
+ defaultMessage: "Please enter a password"
86
+ },
87
+ passwordContainMinCharactersErrorMessage: {
88
+ id: "groupSharedFeatures.usm.passwordContainMinCharactersErrorMessage",
89
+ defaultMessage: "Password must contain at least 8 characters"
90
+ },
91
+ passwordContainInvalidCharacterErrorMessage: {
92
+ id: "groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage",
93
+ defaultMessage: "Password cannot contain a space, \"<\" or \">\""
94
+ },
95
+ passwordContainLetterNumberOrSymbolErrorMessage: {
96
+ id: "groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage",
97
+ defaultMessage: "Password must contain at least one upper case letter, number, or special character"
98
+ },
99
+ justificationRequiredErrorNotice: {
100
+ id: "groupSharedFeatures.usm.justificationRequiredErrorNotice",
101
+ defaultMessage: "Please select a justification or remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue."
102
+ },
103
+ restrictedContactsErrorNotice: {
104
+ id: "groupSharedFeatures.usm.restrictedContactsErrorNotice",
105
+ defaultMessage: "Please remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue."
106
+ }
107
107
  });
108
- export {
109
- a as default
110
- };
108
+ export { t as default };
@@ -1,41 +1,31 @@
1
- import { jsxs as m, Fragment as t, jsx as e } from "react/jsx-runtime";
2
- import { UnifiedShareFormProvider as d } from "./contexts/unified-share-form-context.js";
3
- import { UnifiedShareFormModal as s } from "./components/unified-share-form-modal/unified-share-form-modal.js";
4
- import { SharedLinkSettingsProvider as f } from "./contexts/shared-link-settings-context.js";
5
- import { SharedLinkSettingsModal as h } from "./components/shared-link-settings-modal/shared-link-settings-modal.js";
6
- import { RemoveSharedLinkModal as p } from "./components/remove-shared-link-modal/remove-shared-link-modal.js";
7
- import { RemoveCollaboratorModal as l } from "./components/remove-collaborator-modal/remove-collaborator-modal.js";
8
- import { useUnifiedShareModalContext as O } from "./contexts/unified-share-modal-context.js";
9
- function x({
10
- children: n
11
- }) {
12
- const {
13
- isOpen: r,
14
- onOpenChange: a,
15
- setView: i,
16
- view: o
17
- } = O();
18
- return /* @__PURE__ */ m(t, {
19
- children: [/* @__PURE__ */ e(d, {
20
- children: /* @__PURE__ */ e(s, {
21
- isOpen: r && o === "unified-share-form",
22
- onOpenChange: a,
23
- children: n
24
- })
25
- }), /* @__PURE__ */ e(f, {
26
- children: /* @__PURE__ */ e(h, {
27
- isOpen: r && o === "shared-link-settings",
28
- onOpenChange: () => i("unified-share-form")
29
- })
30
- }), /* @__PURE__ */ e(p, {
31
- isOpen: r && o === "remove-shared-link",
32
- onOpenChange: () => i("unified-share-form")
33
- }), /* @__PURE__ */ e(l, {
34
- isOpen: r && o === "remove-collaborator",
35
- onOpenChange: () => i("unified-share-form")
36
- })]
37
- });
1
+ import { useUnifiedShareModalContext as e } from "./contexts/unified-share-modal-context.js";
2
+ import { UnifiedShareFormProvider as t } from "./contexts/unified-share-form-context.js";
3
+ import { SharedLinkSettingsProvider as n } from "./contexts/shared-link-settings-context.js";
4
+ import { t as r } from "../../chunks/remove-collaborator-modal.js";
5
+ import { t as i } from "../../chunks/remove-shared-link-modal.js";
6
+ import { t as a } from "../../chunks/shared-link-settings-modal.js";
7
+ import { t as o } from "../../chunks/unified-share-form-modal.js";
8
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ function u({ children: u }) {
10
+ let { isOpen: d, onOpenChange: f, setView: p, view: m } = e();
11
+ return /* @__PURE__ */ l(s, { children: [
12
+ /* @__PURE__ */ c(t, { children: /* @__PURE__ */ c(o, {
13
+ isOpen: d && m === "unified-share-form",
14
+ onOpenChange: f,
15
+ children: u
16
+ }) }),
17
+ /* @__PURE__ */ c(n, { children: /* @__PURE__ */ c(a, {
18
+ isOpen: d && m === "shared-link-settings",
19
+ onOpenChange: () => p("unified-share-form")
20
+ }) }),
21
+ /* @__PURE__ */ c(i, {
22
+ isOpen: d && m === "remove-shared-link",
23
+ onOpenChange: () => p("unified-share-form")
24
+ }),
25
+ /* @__PURE__ */ c(r, {
26
+ isOpen: d && m === "remove-collaborator",
27
+ onOpenChange: () => p("unified-share-form")
28
+ })
29
+ ] });
38
30
  }
39
- export {
40
- x as UnifiedShareBase
41
- };
31
+ export { u as UnifiedShareBase };