@box/unified-share-modal 2.12.15 → 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 +9 -9
@@ -1,86 +1,2 @@
1
- import D from "lodash/camelCase";
2
- import { useIntl as S } from "react-intl";
3
- import { Row as y, Cell as m, EllipsizableText as r, Tooltip as B, IconButton as L } from "@box/blueprint-web";
4
- import { XMark as I } from "@box/blueprint-web-assets/icons/Fill";
5
- import { CollaboratorAvatar as M } from "./collaborator-avatar.js";
6
- import N from "../messages.js";
7
- import n from "./messages.js";
8
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
9
- import { isCollaboratorRoleSupported as j } from "../../../utils/collaborator.js";
10
- import { useUnifiedShareModalContext as k } from "../../../contexts/unified-share-modal-context.js";
11
- import '../../../../../styles/collaborator-list-item.css';const w = "_nameCell_19s89_1", z = "_nameDetails_19s89_7", O = "_roleCell_19s89_17", s = {
12
- nameCell: w,
13
- nameDetails: z,
14
- roleCell: O
15
- };
16
- function G({
17
- collaborator: a,
18
- isSmall: c
19
- }) {
20
- const {
21
- formatMessage: o
22
- } = S(), {
23
- email: i,
24
- hasCustomRole: d,
25
- id: p,
26
- isPending: C,
27
- isRemovable: f,
28
- name: h,
29
- role: t
30
- } = a, {
31
- item: b,
32
- setCollaborator: u,
33
- setView: v
34
- } = k(), {
35
- permissions: g = {}
36
- } = b, R = j(t) ? o(N[`${D(t)}Role`]) : "", _ = d ? t : R, x = () => {
37
- u(a), v("remove-collaborator");
38
- };
39
- return /* @__PURE__ */ l(y, {
40
- id: p,
41
- children: [/* @__PURE__ */ e(m, {
42
- children: /* @__PURE__ */ l("div", {
43
- className: s.nameCell,
44
- children: [/* @__PURE__ */ e(M, {
45
- collaborator: a,
46
- isBadgeable: !0,
47
- size: "large"
48
- }), /* @__PURE__ */ l("div", {
49
- className: s.nameDetails,
50
- children: [/* @__PURE__ */ e(r, {
51
- as: "span",
52
- lineClamp: 1,
53
- variant: "bodyDefaultSemibold",
54
- children: h
55
- }), i && /* @__PURE__ */ e(r, {
56
- as: "span",
57
- color: "textOnLightSecondary",
58
- lineClamp: 1,
59
- variant: "caption",
60
- children: i
61
- })]
62
- })]
63
- })
64
- }), !c && /* @__PURE__ */ e(m, {
65
- children: /* @__PURE__ */ l("div", {
66
- className: s.roleCell,
67
- children: [/* @__PURE__ */ e(r, {
68
- as: "span",
69
- color: "textOnLightSecondary",
70
- lineClamp: 1,
71
- children: C ? o(n.pendingRole) : _
72
- }), f && g.canRemoveCollaborator && /* @__PURE__ */ e(B, {
73
- content: o(n.removeButton),
74
- children: /* @__PURE__ */ e(L, {
75
- "aria-label": o(n.removeButton),
76
- icon: I,
77
- onClick: x
78
- })
79
- })]
80
- })
81
- })]
82
- });
83
- }
84
- export {
85
- G as CollaboratorListItem
86
- };
1
+ import { t as e } from "../../../../../chunks/collaborator-list-item.js";
2
+ export { e as CollaboratorListItem };
@@ -1,101 +1,2 @@
1
- import { createPortal as L } from "react-dom";
2
- import { useIntl as S } from "react-intl";
3
- import { useBreakpoint as x, Breakpoint as z, Divider as B, Link as h, Table as N, TableHeader as F, Column as b, TableBody as I, Modal as l } from "@box/blueprint-web";
4
- import { CollaboratorListItem as M } from "./collaborator-list-item.js";
5
- import r from "./messages.js";
6
- import { jsxs as t, Fragment as g, jsx as e } from "react/jsx-runtime";
7
- import { useUnifiedShareFormContext as D } from "../../../contexts/unified-share-form-context.js";
8
- import { callOnKeyboardEvent as H } from "../../../utils/event.js";
9
- import { useUnifiedShareModalContext as T } from "../../../contexts/unified-share-modal-context.js";
10
- import '../../../../../styles/collaborator-list.css';const j = "_divider_ozw7g_1", A = "_manage_ozw7g_8", K = "_link_ozw7g_14", O = "_list_ozw7g_18", P = "_scroll_ozw7g_34", R = "_header_ozw7g_40", a = {
11
- divider: j,
12
- manage: A,
13
- link: K,
14
- list: O,
15
- scroll: P,
16
- header: R
17
- };
18
- function Y() {
19
- const {
20
- formatMessage: o
21
- } = S(), i = x() === z.Small, {
22
- collaborators: p,
23
- config: s,
24
- eventService: f,
25
- isFetching: u,
26
- isSubmitting: _,
27
- item: k,
28
- variant: v
29
- } = T(), {
30
- id: C,
31
- type: w
32
- } = k, {
33
- onCollaboratorsManagementClick: n
34
- } = f, c = v === "desktop", {
35
- containerRef: d,
36
- setIsCollaboratorsOpen: y
37
- } = D();
38
- return /* @__PURE__ */ t(g, {
39
- children: [c && /* @__PURE__ */ e(B, {
40
- className: a.divider
41
- }), s.collaboratorsManagement && /* @__PURE__ */ e("div", {
42
- className: a.manage,
43
- children: n ? /* @__PURE__ */ e(h, {
44
- className: a.link,
45
- onClick: n,
46
- onKeyDown: H(n, {
47
- canPreventDefault: !0
48
- }),
49
- role: "button",
50
- tabIndex: 0,
51
- variant: "standalone",
52
- children: o(r.manageAllLink)
53
- }) : /* @__PURE__ */ e(h, {
54
- href: `/${w}/${C}/collaborators`,
55
- rel: "noopener",
56
- target: "_blank",
57
- variant: "standalone",
58
- children: o(r.manageAllLink)
59
- })
60
- }), /* @__PURE__ */ e("div", {
61
- className: a.list,
62
- children: /* @__PURE__ */ e("div", {
63
- className: a.scroll,
64
- children: /* @__PURE__ */ t(N, {
65
- "aria-label": o(r.listLabel),
66
- children: [/* @__PURE__ */ t(F, {
67
- className: a.header,
68
- children: [/* @__PURE__ */ e(b, {
69
- hideHeader: !0,
70
- isRowHeader: !0,
71
- width: "11fr",
72
- children: o(r.nameColumn)
73
- }), !i && /* @__PURE__ */ e(b, {
74
- hideHeader: !0,
75
- width: "10fr",
76
- children: o(r.roleColumn)
77
- })]
78
- }), /* @__PURE__ */ e(I, {
79
- children: p.slice(0, s.collaboratorsLimit).map((m) => /* @__PURE__ */ e(M, {
80
- collaborator: m,
81
- isSmall: i
82
- }, m.id))
83
- })]
84
- })
85
- })
86
- }), d && /* @__PURE__ */ L(/* @__PURE__ */ t(g, {
87
- children: [!u && /* @__PURE__ */ e(l.Footer, {
88
- children: /* @__PURE__ */ e(l.Footer.SecondaryButton, {
89
- onClick: () => y(!1),
90
- children: o(r.doneButton)
91
- })
92
- }), !c && /* @__PURE__ */ e(l.Close, {
93
- "aria-label": o(r.closeButton),
94
- disabled: _
95
- })]
96
- }), d)]
97
- });
98
- }
99
- export {
100
- Y as CollaboratorList
101
- };
1
+ import { t as e } from "../../../../../chunks/collaborator-list.js";
2
+ export { e as CollaboratorList };
@@ -1,4 +1,2 @@
1
- import { CollaboratorList as t } from "./collaborator-list.js";
2
- export {
3
- t as CollaboratorList
4
- };
1
+ import { t as e } from "../../../../../chunks/collaborator-list.js";
2
+ export { e as CollaboratorList };
@@ -1,42 +1,40 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const o = e({
3
- closeButton: {
4
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.closeButton",
5
- defaultMessage: "Close"
6
- },
7
- doneButton: {
8
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.doneButton",
9
- defaultMessage: "Done"
10
- },
11
- manageAllLink: {
12
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.manageAllLink",
13
- defaultMessage: "Manage All"
14
- },
15
- listLabel: {
16
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.listLabel",
17
- defaultMessage: "Collaborators"
18
- },
19
- nameColumn: {
20
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.nameColumn",
21
- defaultMessage: "Name"
22
- },
23
- roleColumn: {
24
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.roleColumn",
25
- defaultMessage: "Role"
26
- },
27
- expiresBadge: {
28
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.expiresBadge",
29
- defaultMessage: "Access expires on {date}"
30
- },
31
- pendingRole: {
32
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.pendingRole",
33
- defaultMessage: "Pending"
34
- },
35
- removeButton: {
36
- id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.removeButton",
37
- defaultMessage: "Remove"
38
- }
2
+ var t = e({
3
+ closeButton: {
4
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.closeButton",
5
+ defaultMessage: "Close"
6
+ },
7
+ doneButton: {
8
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.doneButton",
9
+ defaultMessage: "Done"
10
+ },
11
+ manageAllLink: {
12
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.manageAllLink",
13
+ defaultMessage: "Manage All"
14
+ },
15
+ listLabel: {
16
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.listLabel",
17
+ defaultMessage: "Collaborators"
18
+ },
19
+ nameColumn: {
20
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.nameColumn",
21
+ defaultMessage: "Name"
22
+ },
23
+ roleColumn: {
24
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.roleColumn",
25
+ defaultMessage: "Role"
26
+ },
27
+ expiresBadge: {
28
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.expiresBadge",
29
+ defaultMessage: "Access expires on {date}"
30
+ },
31
+ pendingRole: {
32
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.pendingRole",
33
+ defaultMessage: "Pending"
34
+ },
35
+ removeButton: {
36
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.collaboratorList.removeButton",
37
+ defaultMessage: "Remove"
38
+ }
39
39
  });
40
- export {
41
- o as default
42
- };
40
+ export { t as default };
@@ -1,4 +1,2 @@
1
- import { UnifiedShareFormModal as e } from "./unified-share-form-modal.js";
2
- export {
3
- e as UnifiedShareFormModal
4
- };
1
+ import { t as e } from "../../../../chunks/unified-share-form-modal.js";
2
+ export { e as UnifiedShareFormModal };
@@ -1,50 +1,48 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const a = e({
3
- title: {
4
- id: "groupSharedFeatures.usm.unifiedShareFormModal.title",
5
- defaultMessage: "Share ‘{itemName}’"
6
- },
7
- closeButton: {
8
- id: "groupSharedFeatures.usm.unifiedShareFormModal.closeButton",
9
- defaultMessage: "Close"
10
- },
11
- loadingLabel: {
12
- id: "groupSharedFeatures.usm.unifiedShareFormModal.loadingLabel",
13
- defaultMessage: "Loading"
14
- },
15
- ownerRole: {
16
- id: "groupSharedFeatures.usm.unifiedShareFormModal.ownerRole",
17
- defaultMessage: "Owner"
18
- },
19
- coOwnerRole: {
20
- id: "groupSharedFeatures.usm.unifiedShareFormModal.coOwnerRole",
21
- defaultMessage: "Co-owner"
22
- },
23
- editorRole: {
24
- id: "groupSharedFeatures.usm.unifiedShareFormModal.editorRole",
25
- defaultMessage: "Editor"
26
- },
27
- viewerUploaderRole: {
28
- id: "groupSharedFeatures.usm.unifiedShareFormModal.viewerUploaderRole",
29
- defaultMessage: "Viewer Uploader"
30
- },
31
- previewerUploaderRole: {
32
- id: "groupSharedFeatures.usm.unifiedShareFormModal.previewerUploaderRole",
33
- defaultMessage: "Previewer Uploader"
34
- },
35
- viewerRole: {
36
- id: "groupSharedFeatures.usm.unifiedShareFormModal.viewerRole",
37
- defaultMessage: "Viewer"
38
- },
39
- previewerRole: {
40
- id: "groupSharedFeatures.usm.unifiedShareFormModal.previewerRole",
41
- defaultMessage: "Previewer"
42
- },
43
- uploaderRole: {
44
- id: "groupSharedFeatures.usm.unifiedShareFormModal.uploaderRole",
45
- defaultMessage: "Uploader"
46
- }
2
+ var t = e({
3
+ title: {
4
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.title",
5
+ defaultMessage: "Share ‘{itemName}’"
6
+ },
7
+ closeButton: {
8
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.closeButton",
9
+ defaultMessage: "Close"
10
+ },
11
+ loadingLabel: {
12
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.loadingLabel",
13
+ defaultMessage: "Loading"
14
+ },
15
+ ownerRole: {
16
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.ownerRole",
17
+ defaultMessage: "Owner"
18
+ },
19
+ coOwnerRole: {
20
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.coOwnerRole",
21
+ defaultMessage: "Co-owner"
22
+ },
23
+ editorRole: {
24
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.editorRole",
25
+ defaultMessage: "Editor"
26
+ },
27
+ viewerUploaderRole: {
28
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.viewerUploaderRole",
29
+ defaultMessage: "Viewer Uploader"
30
+ },
31
+ previewerUploaderRole: {
32
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.previewerUploaderRole",
33
+ defaultMessage: "Previewer Uploader"
34
+ },
35
+ viewerRole: {
36
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.viewerRole",
37
+ defaultMessage: "Viewer"
38
+ },
39
+ previewerRole: {
40
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.previewerRole",
41
+ defaultMessage: "Previewer"
42
+ },
43
+ uploaderRole: {
44
+ id: "groupSharedFeatures.usm.unifiedShareFormModal.uploaderRole",
45
+ defaultMessage: "Uploader"
46
+ }
47
47
  });
48
- export {
49
- a as default
50
- };
48
+ export { t as default };
@@ -1,4 +1,2 @@
1
- import { SharedLinkSection as r } from "./shared-link-section.js";
2
- export {
3
- r as SharedLinkSection
4
- };
1
+ import { t as e } from "../../../../../chunks/shared-link-section.js";
2
+ export { e as SharedLinkSection };