@box/unified-share-modal 3.1.37 → 3.1.38
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.
- package/dist/chunks/classification-status.js +1 -62
- package/dist/chunks/collaboration-role.js +1 -89
- package/dist/chunks/collaboration-section.js +1 -159
- package/dist/chunks/collaborator-list-item.js +1 -61
- package/dist/chunks/collaborator-list.js +1 -74
- package/dist/chunks/remove-collaborator-modal.js +1 -61
- package/dist/chunks/remove-shared-link-modal.js +1 -56
- package/dist/chunks/shared-link-access.js +1 -65
- package/dist/chunks/shared-link-permission.js +1 -67
- package/dist/chunks/shared-link-section.js +1 -184
- package/dist/chunks/shared-link-settings-modal.js +1 -86
- package/dist/chunks/shared-with-avatars.js +1 -48
- package/dist/chunks/shield-restriction-notice.js +1 -97
- package/dist/chunks/text-area-container.js +1 -36
- package/dist/chunks/unified-share-form-modal.js +1 -67
- package/dist/chunks/unified-share-form.js +1 -23
- package/dist/esm/index.js +1 -2
- package/dist/esm/lib/components/classification-status/classification-status.js +1 -2
- package/dist/esm/lib/components/classification-status/index.js +1 -2
- package/dist/esm/lib/components/classification-status/messages.js +1 -12
- package/dist/esm/lib/components/index.js +1 -5
- package/dist/esm/lib/components/remove-collaborator-modal/index.js +1 -2
- package/dist/esm/lib/components/remove-collaborator-modal/messages.js +1 -28
- package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +1 -2
- package/dist/esm/lib/components/remove-shared-link-modal/index.js +1 -2
- package/dist/esm/lib/components/remove-shared-link-modal/messages.js +1 -28
- package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +1 -2
- package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +1 -36
- package/dist/esm/lib/components/shared-link-settings-modal/expiration-section.js +1 -34
- package/dist/esm/lib/components/shared-link-settings-modal/index.js +1 -2
- package/dist/esm/lib/components/shared-link-settings-modal/messages.js +1 -140
- package/dist/esm/lib/components/shared-link-settings-modal/password-section.js +1 -33
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +1 -2
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +1 -98
- package/dist/esm/lib/components/shared-link-settings-modal/vanity-section.js +1 -34
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/index.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +1 -136
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +1 -49
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/index.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/messages.js +1 -40
- package/dist/esm/lib/components/unified-share-form-modal/index.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/messages.js +1 -48
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/index.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +1 -144
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +1 -2
- package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +1 -2
- package/dist/esm/lib/constants.js +1 -47
- package/dist/esm/lib/contexts/index.js +1 -4
- package/dist/esm/lib/contexts/shared-link-settings-context.js +1 -51
- package/dist/esm/lib/contexts/unified-share-form-context.js +1 -61
- package/dist/esm/lib/contexts/unified-share-modal-context.js +1 -70
- package/dist/esm/lib/hooks/index.js +1 -7
- package/dist/esm/lib/hooks/use-access-levels.js +1 -70
- package/dist/esm/lib/hooks/use-collaboration-form.js +1 -76
- package/dist/esm/lib/hooks/use-form-validation.js +1 -33
- package/dist/esm/lib/hooks/use-link-settings-form.js +1 -50
- package/dist/esm/lib/hooks/use-permission-levels.js +1 -34
- package/dist/esm/lib/hooks/use-sharing-action.js +1 -45
- package/dist/esm/lib/messages.js +1 -108
- package/dist/esm/lib/unified-share-base.js +1 -31
- package/dist/esm/lib/unified-share-modal.js +1 -44
- package/dist/esm/lib/utils/collaborator.js +1 -12
- package/dist/esm/lib/utils/date.js +1 -10
- package/dist/esm/lib/utils/email.js +1 -6
- package/dist/esm/lib/utils/event.js +1 -7
- package/dist/esm/lib/utils/form.js +1 -5
- package/dist/esm/lib/utils/index.js +1 -9
- package/dist/esm/lib/utils/notification.js +1 -20
- package/dist/esm/lib/utils/permission.js +1 -16
- package/dist/esm/lib/utils/validation.js +1 -2
- package/package.json +10 -10
package/dist/esm/lib/messages.js
CHANGED
|
@@ -1,108 +1 @@
|
|
|
1
|
-
import
|
|
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
|
-
});
|
|
108
|
-
export { t as default };
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({noticeCloseLabel:{id:`groupSharedFeatures.usm.noticeCloseLabel`,defaultMessage:`Close`},successNoticeIcon:{id:`groupSharedFeatures.usm.successNoticeIcon`,defaultMessage:`Success`},errorNoticeIcon:{id:`groupSharedFeatures.usm.errorNoticeIcon`,defaultMessage:`Error`},warningNoticeIcon:{id:`groupSharedFeatures.usm.warningNoticeIcon`,defaultMessage:`Warning`},defaultErrorNoticeText:{id:`groupSharedFeatures.usm.defaultErrorNoticeText`,defaultMessage:`Something went wrong. Please try again later.`},removeCollaboratorSuccessNoticeText:{id:`groupSharedFeatures.usm.removeCollaboratorSuccessNoticeText`,defaultMessage:`The collaborator has been removed successfully.`},removeCollaboratorErrorNoticeText:{id:`groupSharedFeatures.usm.removeCollaboratorErrorNoticeText`,defaultMessage:`Unable to remove the collaborator. Please try again later.`},deleteSharedLinkSuccessNoticeText:{id:`groupSharedFeatures.usm.deleteSharedLinkSuccessNoticeText`,defaultMessage:`The shared link for “{itemName}” has been removed successfully.`},deleteSharedLinkErrorNoticeText:{id:`groupSharedFeatures.usm.deleteSharedLinkErrorNoticeText`,defaultMessage:`Unable to remove the shared link. Please try again later.`},updateSharedLinkSuccessNoticeText:{id:`groupSharedFeatures.usm.updateSharedLinkSuccessNoticeText`,defaultMessage:`The shared link settings were saved successfully.`},createSharedLinkSuccessNoticeText:{id:`groupSharedFeatures.usm.createSharedLinkSuccessNoticeText`,defaultMessage:`Shared link created.`},createSharedLinkErrorNoticeText:{id:`groupSharedFeatures.usm.createSharedLinkErrorNoticeText`,defaultMessage:`Unable to create a shared link. Please try again later.`},emailSharedLinkSuccessNoticeText:{id:`groupSharedFeatures.usm.emailSharedLinkSuccessNoticeText`,defaultMessage:`The shared link for “{itemName}” was sent successfully.`},vanityNameInvalidErrorMessage:{id:`groupSharedFeatures.usm.vanityNameInvalidErrorMessage`,defaultMessage:`Custom URLs must be between 12-30 characters, and can include letters, numbers, and hyphens`},vanityNameRequiredErrorMessage:{id:`groupSharedFeatures.usm.vanityNameRequiredErrorMessage`,defaultMessage:`Please enter a custom URL`},expirationRequiredErrorMessage:{id:`groupSharedFeatures.usm.expirationRequiredErrorMessage`,defaultMessage:`Please select an expiration date`},expirationFutureDateErrorMessage:{id:`groupSharedFeatures.usm.expirationFutureDateErrorMessage`,defaultMessage:`Expiration date must be in the future`},invalidEmailErrorMessage:{id:`groupSharedFeatures.usm.invalidEmailErrorMessage`,defaultMessage:`Invalid email address`},emailRequiredErrorMessage:{id:`groupSharedFeatures.usm.emailRequiredErrorMessage`,defaultMessage:`Enter at least one valid email`},contactsLimitErrorMessage:{id:`groupSharedFeatures.usm.contactsLimitErrorMessage`,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.`},passwordRequiredErrorMessage:{id:`groupSharedFeatures.usm.passwordRequiredErrorMessage`,defaultMessage:`Please enter a password`},passwordContainMinCharactersErrorMessage:{id:`groupSharedFeatures.usm.passwordContainMinCharactersErrorMessage`,defaultMessage:`Password must contain at least 8 characters`},passwordContainInvalidCharacterErrorMessage:{id:`groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage`,defaultMessage:`Password cannot contain a space, "<" or ">"`},passwordContainLetterNumberOrSymbolErrorMessage:{id:`groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage`,defaultMessage:`Password must contain at least one upper case letter, number, or special character`},justificationRequiredErrorNotice:{id:`groupSharedFeatures.usm.justificationRequiredErrorNotice`,defaultMessage:`Please select a justification or remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.`},restrictedContactsErrorNotice:{id:`groupSharedFeatures.usm.restrictedContactsErrorNotice`,defaultMessage:`Please remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.`}});export{messages as default};
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
import
|
|
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
|
-
] });
|
|
30
|
-
}
|
|
31
|
-
export { u as UnifiedShareBase };
|
|
1
|
+
import{useUnifiedShareModalContext}from"./contexts/unified-share-modal-context.js";import{UnifiedShareFormProvider}from"./contexts/unified-share-form-context.js";import{SharedLinkSettingsProvider}from"./contexts/shared-link-settings-context.js";import{t as RemoveCollaboratorModal}from"../../chunks/remove-collaborator-modal.js";import{t as RemoveSharedLinkModal}from"../../chunks/remove-shared-link-modal.js";import{t as SharedLinkSettingsModal}from"../../chunks/shared-link-settings-modal.js";import{t as UnifiedShareFormModal}from"../../chunks/unified-share-form-modal.js";import{Fragment,jsx,jsxs}from"react/jsx-runtime";function UnifiedShareBase({children}){let{isOpen,onOpenChange,setView,view}=useUnifiedShareModalContext();return jsxs(Fragment,{children:[jsx(UnifiedShareFormProvider,{children:jsx(UnifiedShareFormModal,{isOpen:isOpen&&view===`unified-share-form`,onOpenChange,children})}),jsx(SharedLinkSettingsProvider,{children:jsx(SharedLinkSettingsModal,{isOpen:isOpen&&view===`shared-link-settings`,onOpenChange:()=>setView(`unified-share-form`)})}),jsx(RemoveSharedLinkModal,{isOpen:isOpen&&view===`remove-shared-link`,onOpenChange:()=>setView(`unified-share-form`)}),jsx(RemoveCollaboratorModal,{isOpen:isOpen&&view===`remove-collaborator`,onOpenChange:()=>setView(`unified-share-form`)})]})}export{UnifiedShareBase};
|
|
@@ -1,44 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { UnifiedShareBase as t } from "./unified-share-base.js";
|
|
3
|
-
import { useCallback as n, useEffect as r, useState as i } from "react";
|
|
4
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
-
function o({ children: o, collaborationAccess: s, collaborationNotices: c, collaborationRoles: l, collaborators: u, config: d, contactService: f, currentUser: p, eventService: m, initialContacts: h, invitationFormNotices: g, isFetching: _, isOpen: v, isSubmitting: y, item: b, onLoad: x, onOpenChange: S, sharedLink: C, sharedLinkNotices: w, sharingService: T, variant: E = "modal" }) {
|
|
6
|
-
let [D, O] = i(v ?? (!o || E === "desktop")), [k, A] = i(!!x);
|
|
7
|
-
r(() => {
|
|
8
|
-
v !== void 0 && O(v);
|
|
9
|
-
}, [v]), r(() => {
|
|
10
|
-
(async () => {
|
|
11
|
-
x && (D && await x(), A(!D));
|
|
12
|
-
})();
|
|
13
|
-
}, [D, x]);
|
|
14
|
-
let j = n((e) => {
|
|
15
|
-
v === void 0 && E !== "desktop" && O(e), S && S(e);
|
|
16
|
-
}, [
|
|
17
|
-
v,
|
|
18
|
-
S,
|
|
19
|
-
E
|
|
20
|
-
]);
|
|
21
|
-
return /* @__PURE__ */ a(e, {
|
|
22
|
-
collaborationAccess: s,
|
|
23
|
-
collaborationNotices: c,
|
|
24
|
-
collaborationRoles: l,
|
|
25
|
-
collaborators: u,
|
|
26
|
-
config: d,
|
|
27
|
-
contactService: f,
|
|
28
|
-
currentUser: p,
|
|
29
|
-
eventService: m,
|
|
30
|
-
initialContacts: h,
|
|
31
|
-
invitationFormNotices: g,
|
|
32
|
-
isFetching: _ ?? k,
|
|
33
|
-
isOpen: D,
|
|
34
|
-
isSubmitting: y,
|
|
35
|
-
item: b,
|
|
36
|
-
onOpenChange: j,
|
|
37
|
-
sharedLink: C,
|
|
38
|
-
sharedLinkNotices: w,
|
|
39
|
-
sharingService: T,
|
|
40
|
-
variant: E,
|
|
41
|
-
children: /* @__PURE__ */ a(t, { children: o })
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export { o as UnifiedShareModal };
|
|
1
|
+
import{UnifiedShareModalProvider}from"./contexts/unified-share-modal-context.js";import{UnifiedShareBase}from"./unified-share-base.js";import{useCallback,useEffect,useState}from"react";import{jsx}from"react/jsx-runtime";function UnifiedShareModal({children,collaborationAccess,collaborationNotices,collaborationRoles,collaborators,config,contactService,currentUser,eventService,initialContacts,invitationFormNotices,isFetching,isOpen:isControlledOpen,isSubmitting,item,onLoad,onOpenChange,sharedLink,sharedLinkNotices,sharingService,variant=`modal`}){let[isOpen,setIsOpen]=useState(isControlledOpen??(!children||variant===`desktop`)),[isLoading,setIsLoading]=useState(!!onLoad);useEffect(()=>{isControlledOpen!==void 0&&setIsOpen(isControlledOpen)},[isControlledOpen]),useEffect(()=>{(async()=>{onLoad&&(isOpen&&await onLoad(),setIsLoading(!isOpen))})()},[isOpen,onLoad]);let handleOpenChange=useCallback(open=>{isControlledOpen===void 0&&variant!==`desktop`&&setIsOpen(open),onOpenChange&&onOpenChange(open)},[isControlledOpen,onOpenChange,variant]);return jsx(UnifiedShareModalProvider,{collaborationAccess,collaborationNotices,collaborationRoles,collaborators,config,contactService,currentUser,eventService,initialContacts,invitationFormNotices,isFetching:isFetching??isLoading,isOpen,isSubmitting,item,onOpenChange:handleOpenChange,sharedLink,sharedLinkNotices,sharingService,variant,children:jsx(UnifiedShareBase,{children})})}export{UnifiedShareModal};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var n = (e) => {
|
|
3
|
-
switch (e) {
|
|
4
|
-
case "small": return "small";
|
|
5
|
-
case "medium": return "medium";
|
|
6
|
-
case "large": return "medium";
|
|
7
|
-
case "xlarge": return "large";
|
|
8
|
-
case "xxlarge": return "xlarge";
|
|
9
|
-
default: return "medium";
|
|
10
|
-
}
|
|
11
|
-
}, r = (e = []) => e.find(({ isDefault: e }) => e) || e[0], i = (e) => e.replace(/[[({<]+.*[\])}>]+/g, "").trim().slice(0, 1).toUpperCase(), a = (t) => e.includes(t), o = (e) => t.includes(e), s = (e, t = [], n = []) => e.type === "group" ? n.includes(`${e.id}`) : t.includes(e.email);
|
|
12
|
-
export { n as getAvatarBadgeSize, r as getDefaultCollaborationRole, i as getFirstInitial, s as isCollaboratorRestricted, a as isCollaboratorRoleSupported, o as isInvitationRoleSupported };
|
|
1
|
+
import{SUPPORTED_COLLABORATOR_ROLES,SUPPORTED_INVITATION_ROLES}from"../constants.js";var getAvatarBadgeSize=size=>{switch(size){case`small`:return`small`;case`medium`:return`medium`;case`large`:return`medium`;case`xlarge`:return`large`;case`xxlarge`:return`xlarge`;default:return`medium`}},getDefaultCollaborationRole=(collaborationRoles=[])=>collaborationRoles.find(({isDefault})=>isDefault)||collaborationRoles[0],getFirstInitial=name=>name.replace(/[[({<]+.*[\])}>]+/g,``).trim().slice(0,1).toUpperCase(),isCollaboratorRoleSupported=role=>SUPPORTED_COLLABORATOR_ROLES.includes(role),isInvitationRoleSupported=role=>SUPPORTED_INVITATION_ROLES.includes(role),isCollaboratorRestricted=(contact,restrictedEmails=[],restrictedGroups=[])=>contact.type===`group`?restrictedGroups.includes(`${contact.id}`):restrictedEmails.includes(contact.email);export{getAvatarBadgeSize,getDefaultCollaborationRole,getFirstInitial,isCollaboratorRestricted,isCollaboratorRoleSupported,isInvitationRoleSupported};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var i = 1440 * 60 * 1e3, a = (e) => r(t(e, n())), o = (t) => {
|
|
3
|
-
let r = navigator.language || "en-US", i = a(t).toDate(n());
|
|
4
|
-
return new e(r, {
|
|
5
|
-
day: "numeric",
|
|
6
|
-
month: "long",
|
|
7
|
-
year: "numeric"
|
|
8
|
-
}).format(i);
|
|
9
|
-
}, s = () => r(t(Date.now() + i, n()));
|
|
10
|
-
export { a as formatDateFromTimestampToCalendarDate, o as formatDateFromTimestampToDateString, s as formatTomorrowDateToCalendarDate };
|
|
1
|
+
import{DateFormatter,fromAbsolute,getLocalTimeZone,toCalendarDate}from"@box/blueprint-web";var MILLISECONDS_PER_DAY=1440*60*1e3,formatDateFromTimestampToCalendarDate=timestamp=>toCalendarDate(fromAbsolute(timestamp,getLocalTimeZone())),formatDateFromTimestampToDateString=timestamp=>{let userLocale=navigator.language||`en-US`,date=formatDateFromTimestampToCalendarDate(timestamp).toDate(getLocalTimeZone());return new DateFormatter(userLocale,{day:`numeric`,month:`long`,year:`numeric`}).format(date)},formatTomorrowDateToCalendarDate=()=>toCalendarDate(fromAbsolute(Date.now()+MILLISECONDS_PER_DAY,getLocalTimeZone()));export{formatDateFromTimestampToCalendarDate,formatDateFromTimestampToDateString,formatTomorrowDateToCalendarDate};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var t = /[\s,;<>()[\]/\\"]+/;
|
|
3
|
-
function n(n) {
|
|
4
|
-
return n ? n.split(t).filter(e) : [];
|
|
5
|
-
}
|
|
6
|
-
export { n as parseEmails };
|
|
1
|
+
import{isEmailValid}from"./validation.js";var EMAIL_DELIMITERS=/[\s,;<>()[\]/\\"]+/;function parseEmails(text){return text?text.split(EMAIL_DELIMITERS).filter(isEmailValid):[]}export{parseEmails};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
let { args: n = [], canPreventDefault: r = !1, canStopPropagation: i = !1, keys: a = ["Enter", " "] } = t;
|
|
3
|
-
return (t) => {
|
|
4
|
-
a.includes(t.key) && (r && t.preventDefault(), i && t.stopPropagation(), e(...n));
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export { e as callOnKeyboardEvent };
|
|
1
|
+
var callOnKeyboardEvent=(callback,options={})=>{let{args=[],canPreventDefault=!1,canStopPropagation=!1,keys=[`Enter`,` `]}=options;return event=>{keys.includes(event.key)&&(canPreventDefault&&event.preventDefault(),canStopPropagation&&event.stopPropagation(),callback(...args))}};export{callOnKeyboardEvent};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
let { expiration: n, isDownloadEnabled: r, isExpirationEnabled: i, isPasswordEnabled: a, isVanityNameEnabled: o, password: s, vanityName: c } = e, l = {};
|
|
3
|
-
return r !== t.isDownloadEnabled && (l.isDownloadEnabled = r), (i !== t.isExpirationEnabled || n?.toString() !== t.expiration?.toString()) && (l.isExpirationEnabled = i, l.expiration = i ? n : null), (a !== t.isPasswordEnabled || s !== t.password) && (l.isPasswordEnabled = a, l.password = a ? s : null), (o !== t.isVanityNameEnabled || c !== t.vanityName) && (l.isVanityNameEnabled = o, l.vanityName = o ? c : null), l;
|
|
4
|
-
};
|
|
5
|
-
export { e as getUpdatedLinkSettingsFormData };
|
|
1
|
+
var getUpdatedLinkSettingsFormData=(nextData,prevData)=>{let{expiration,isDownloadEnabled,isExpirationEnabled,isPasswordEnabled,isVanityNameEnabled,password,vanityName}=nextData,updatedData={};return isDownloadEnabled!==prevData.isDownloadEnabled&&(updatedData.isDownloadEnabled=isDownloadEnabled),(isExpirationEnabled!==prevData.isExpirationEnabled||expiration?.toString()!==prevData.expiration?.toString())&&(updatedData.isExpirationEnabled=isExpirationEnabled,updatedData.expiration=isExpirationEnabled?expiration:null),(isPasswordEnabled!==prevData.isPasswordEnabled||password!==prevData.password)&&(updatedData.isPasswordEnabled=isPasswordEnabled,updatedData.password=isPasswordEnabled?password:null),(isVanityNameEnabled!==prevData.isVanityNameEnabled||vanityName!==prevData.vanityName)&&(updatedData.isVanityNameEnabled=isVanityNameEnabled,updatedData.vanityName=isVanityNameEnabled?vanityName:null),updatedData};export{getUpdatedLinkSettingsFormData};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { formatDateFromTimestampToCalendarDate as o, formatDateFromTimestampToDateString as s, formatTomorrowDateToCalendarDate as c } from "./date.js";
|
|
3
|
-
import { doesPasswordContainInvalidCharacter as l, doesPasswordContainLetter as u, doesPasswordContainMinCharacters as d, doesPasswordContainMixedCase as f, doesPasswordContainNumber as p, doesPasswordContainSymbol as m, isEmailValid as h, isVanityNameValid as g } from "./validation.js";
|
|
4
|
-
import { parseEmails as _ } from "./email.js";
|
|
5
|
-
import { callOnKeyboardEvent as v } from "./event.js";
|
|
6
|
-
import { getUpdatedLinkSettingsFormData as y } from "./form.js";
|
|
7
|
-
import { getNotificationArgs as b, getNotificationMessage as x } from "./notification.js";
|
|
8
|
-
import { getAllowedAccessLevels as S, getAllowedPermissionLevels as C } from "./permission.js";
|
|
9
|
-
export { v as callOnKeyboardEvent, l as doesPasswordContainInvalidCharacter, u as doesPasswordContainLetter, d as doesPasswordContainMinCharacters, f as doesPasswordContainMixedCase, p as doesPasswordContainNumber, m as doesPasswordContainSymbol, o as formatDateFromTimestampToCalendarDate, s as formatDateFromTimestampToDateString, c as formatTomorrowDateToCalendarDate, S as getAllowedAccessLevels, C as getAllowedPermissionLevels, e as getAvatarBadgeSize, t as getDefaultCollaborationRole, n as getFirstInitial, b as getNotificationArgs, x as getNotificationMessage, y as getUpdatedLinkSettingsFormData, r as isCollaboratorRestricted, i as isCollaboratorRoleSupported, h as isEmailValid, a as isInvitationRoleSupported, g as isVanityNameValid, _ as parseEmails };
|
|
1
|
+
import{getAvatarBadgeSize,getDefaultCollaborationRole,getFirstInitial,isCollaboratorRestricted,isCollaboratorRoleSupported,isInvitationRoleSupported}from"./collaborator.js";import{formatDateFromTimestampToCalendarDate,formatDateFromTimestampToDateString,formatTomorrowDateToCalendarDate}from"./date.js";import{doesPasswordContainInvalidCharacter,doesPasswordContainLetter,doesPasswordContainMinCharacters,doesPasswordContainMixedCase,doesPasswordContainNumber,doesPasswordContainSymbol,isEmailValid,isVanityNameValid}from"./validation.js";import{parseEmails}from"./email.js";import{callOnKeyboardEvent}from"./event.js";import{getUpdatedLinkSettingsFormData}from"./form.js";import{getNotificationArgs,getNotificationMessage}from"./notification.js";import{getAllowedAccessLevels,getAllowedPermissionLevels}from"./permission.js";export{callOnKeyboardEvent,doesPasswordContainInvalidCharacter,doesPasswordContainLetter,doesPasswordContainMinCharacters,doesPasswordContainMixedCase,doesPasswordContainNumber,doesPasswordContainSymbol,formatDateFromTimestampToCalendarDate,formatDateFromTimestampToDateString,formatTomorrowDateToCalendarDate,getAllowedAccessLevels,getAllowedPermissionLevels,getAvatarBadgeSize,getDefaultCollaborationRole,getFirstInitial,getNotificationArgs,getNotificationMessage,getUpdatedLinkSettingsFormData,isCollaboratorRestricted,isCollaboratorRoleSupported,isEmailValid,isInvitationRoleSupported,isVanityNameValid,parseEmails};
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "lodash/camelCase";
|
|
3
|
-
var n = (t) => {
|
|
4
|
-
switch (t) {
|
|
5
|
-
case "success": return e.successNoticeIcon;
|
|
6
|
-
case "warning": return e.warningNoticeIcon;
|
|
7
|
-
default: return e.errorNoticeIcon;
|
|
8
|
-
}
|
|
9
|
-
}, r = (t, r) => ({
|
|
10
|
-
closeButtonAriaLabel: t(e.noticeCloseLabel),
|
|
11
|
-
sensitivity: "foreground",
|
|
12
|
-
style: { pointerEvents: "auto" },
|
|
13
|
-
typeIconAriaLabel: t(n(r)),
|
|
14
|
-
variant: r
|
|
15
|
-
}), i = (n, r, i, a) => {
|
|
16
|
-
if (!i) return "";
|
|
17
|
-
let o = e[`${t(i)}${r === "success" ? "Success" : "Error"}NoticeText`];
|
|
18
|
-
return o ? n(o, a) : r === "error" ? n(e.defaultErrorNoticeText) : "";
|
|
19
|
-
};
|
|
20
|
-
export { r as getNotificationArgs, i as getNotificationMessage };
|
|
1
|
+
import messages from"../messages.js";import camelCase from"lodash/camelCase";var getTypeIconAriaLabel=type=>{switch(type){case`success`:return messages.successNoticeIcon;case`warning`:return messages.warningNoticeIcon;default:return messages.errorNoticeIcon}},getNotificationArgs=(formatMessage,type)=>({closeButtonAriaLabel:formatMessage(messages.noticeCloseLabel),sensitivity:`foreground`,style:{pointerEvents:`auto`},typeIconAriaLabel:formatMessage(getTypeIconAriaLabel(type)),variant:type}),getNotificationMessage=(formatMessage,type,notification,values)=>{if(!notification)return``;let message=messages[`${camelCase(notification)}${type===`success`?`Success`:`Error`}NoticeText`];return message?formatMessage(message,values):type===`error`?formatMessage(messages.defaultErrorNoticeText):``};export{getNotificationArgs,getNotificationMessage};
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import n from "lodash/keyBy";
|
|
3
|
-
var r = (t = []) => {
|
|
4
|
-
let r = n(t.map((e) => typeof e == "string" ? { id: e } : e), "id");
|
|
5
|
-
return e.reduce((e, t) => {
|
|
6
|
-
let n = r[t];
|
|
7
|
-
return n ? [...e, n] : e;
|
|
8
|
-
}, []);
|
|
9
|
-
}, i = (e = []) => {
|
|
10
|
-
let r = n(e.map((e) => typeof e == "string" ? { id: e } : e), "id");
|
|
11
|
-
return t.reduce((e, t) => {
|
|
12
|
-
let n = r[t];
|
|
13
|
-
return n ? [...e, n] : e;
|
|
14
|
-
}, []);
|
|
15
|
-
};
|
|
16
|
-
export { r as getAllowedAccessLevels, i as getAllowedPermissionLevels };
|
|
1
|
+
import{SUPPORTED_ACCESS_LEVELS,SUPPORTED_PERMISSION_LEVELS}from"../constants.js";import keyBy from"lodash/keyBy";var getAllowedAccessLevels=(accessLevels=[])=>{let accessLevelsById=keyBy(accessLevels.map(level=>typeof level==`string`?{id:level}:level),`id`);return SUPPORTED_ACCESS_LEVELS.reduce((allowedLevels,level)=>{let accessLevel=accessLevelsById[level];return accessLevel?[...allowedLevels,accessLevel]:allowedLevels},[])},getAllowedPermissionLevels=(permissionLevels=[])=>{let permissionLevelsById=keyBy(permissionLevels.map(level=>typeof level==`string`?{id:level}:level),`id`);return SUPPORTED_PERMISSION_LEVELS.reduce((allowedLevels,level)=>{let permissionLevel=permissionLevelsById[level];return permissionLevel?[...allowedLevels,permissionLevel]:allowedLevels},[])};export{getAllowedAccessLevels,getAllowedPermissionLevels};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
export { l as doesPasswordContainInvalidCharacter, s as doesPasswordContainLetter, i as doesPasswordContainMinCharacters, c as doesPasswordContainMixedCase, a as doesPasswordContainNumber, o as doesPasswordContainSymbol, r as isEmailValid, n as isVanityNameValid };
|
|
1
|
+
var VANITY_NAME_REGEX=/^[a-zA-Z0-9-]{12,30}$/,EMAIL_REGEX=/^[A-Z0-9._'%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,isVanityNameValid=vanityName=>VANITY_NAME_REGEX.test(vanityName),isEmailValid=email=>EMAIL_REGEX.test(email),doesPasswordContainMinCharacters=password=>password.length>=8,doesPasswordContainNumber=password=>password.replace(/\D/g,``).length>=1,doesPasswordContainSymbol=password=>password.replace(/\s/g,``).replace(/\w/g,``).length>=1,doesPasswordContainLetter=password=>/[a-zA-Z]/.test(password),doesPasswordContainMixedCase=password=>/[a-z]/.test(password)&&/[A-Z]/.test(password),doesPasswordContainInvalidCharacter=password=>/[\s<>]/.test(password);export{doesPasswordContainInvalidCharacter,doesPasswordContainLetter,doesPasswordContainMinCharacters,doesPasswordContainMixedCase,doesPasswordContainNumber,doesPasswordContainSymbol,isEmailValid,isVanityNameValid};
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/unified-share-modal",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.38",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^16.13.
|
|
7
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
8
|
-
"@box/copy-input": "^2.1.
|
|
9
|
-
"@box/user-selector": "^2.1.
|
|
6
|
+
"@box/blueprint-web": "^16.13.1",
|
|
7
|
+
"@box/blueprint-web-assets": "^5.5.10",
|
|
8
|
+
"@box/copy-input": "^2.1.35",
|
|
9
|
+
"@box/user-selector": "^2.1.38",
|
|
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": "^16.13.
|
|
17
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
18
|
-
"@box/copy-input": "^2.1.
|
|
19
|
-
"@box/eslint-plugin-blueprint": "2.1.
|
|
20
|
-
"@box/storybook-utils": "1.1.
|
|
16
|
+
"@box/blueprint-web": "^16.13.1",
|
|
17
|
+
"@box/blueprint-web-assets": "^5.5.10",
|
|
18
|
+
"@box/copy-input": "^2.1.35",
|
|
19
|
+
"@box/eslint-plugin-blueprint": "2.1.11",
|
|
20
|
+
"@box/storybook-utils": "1.1.34",
|
|
21
21
|
"react-intl": "^6.4.2"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|