@box/unified-share-modal 1.30.0 → 1.31.0

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 (50) hide show
  1. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +151 -109
  2. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +38 -2
  3. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +128 -0
  4. package/dist/esm/lib/contexts/unified-share-form-context.js +36 -29
  5. package/dist/esm/lib/hooks/use-collaboration-form.js +51 -50
  6. package/dist/esm/lib/hooks/use-form-validation.js +38 -27
  7. package/dist/esm/lib/messages.js +8 -0
  8. package/dist/esm/lib/unified-share-modal.js +57 -55
  9. package/dist/esm/lib/utils/collaborator.js +7 -6
  10. package/dist/esm/lib/utils/index.js +24 -23
  11. package/dist/i18n/bn-IN.js +11 -0
  12. package/dist/i18n/da-DK.js +11 -0
  13. package/dist/i18n/de-DE.js +11 -0
  14. package/dist/i18n/en-AU.js +11 -0
  15. package/dist/i18n/en-CA.js +11 -0
  16. package/dist/i18n/en-GB.js +11 -0
  17. package/dist/i18n/en-US.js +11 -0
  18. package/dist/i18n/en-US.properties +22 -0
  19. package/dist/i18n/en-x-pseudo.js +11 -0
  20. package/dist/i18n/es-419.js +11 -0
  21. package/dist/i18n/es-ES.js +11 -0
  22. package/dist/i18n/fi-FI.js +11 -0
  23. package/dist/i18n/fr-CA.js +11 -0
  24. package/dist/i18n/fr-FR.js +11 -0
  25. package/dist/i18n/hi-IN.js +11 -0
  26. package/dist/i18n/it-IT.js +11 -0
  27. package/dist/i18n/ja-JP.js +11 -0
  28. package/dist/i18n/json/src/lib/components/unified-share-form-modal/collaboration-section/messages.json +1 -1
  29. package/dist/i18n/json/src/lib/messages.json +1 -1
  30. package/dist/i18n/ko-KR.js +11 -0
  31. package/dist/i18n/nb-NO.js +11 -0
  32. package/dist/i18n/nl-NL.js +11 -0
  33. package/dist/i18n/pl-PL.js +11 -0
  34. package/dist/i18n/pt-BR.js +11 -0
  35. package/dist/i18n/ru-RU.js +11 -0
  36. package/dist/i18n/sv-SE.js +11 -0
  37. package/dist/i18n/tr-TR.js +11 -0
  38. package/dist/i18n/zh-CN.js +11 -0
  39. package/dist/i18n/zh-TW.js +11 -0
  40. package/dist/styles/shield-restriction-notice.css +1 -0
  41. package/dist/types/lib/components/unified-share-form-modal/collaboration-section/messages.d.ts +45 -0
  42. package/dist/types/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.d.ts +8 -0
  43. package/dist/types/lib/contexts/unified-share-form-context.d.ts +3 -1
  44. package/dist/types/lib/contexts/unified-share-modal-context.d.ts +2 -1
  45. package/dist/types/lib/hooks/use-form-validation.d.ts +1 -0
  46. package/dist/types/lib/messages.d.ts +10 -0
  47. package/dist/types/lib/types.d.ts +83 -7
  48. package/dist/types/lib/unified-share-modal.d.ts +2 -1
  49. package/dist/types/lib/utils/collaborator.d.ts +3 -1
  50. package/package.json +9 -9
@@ -12,6 +12,7 @@ export default {
12
12
  "groupSharedFeatures.usm.expirationFutureDateErrorMessage": "Sona erme tarihi gelecekte olmalıdır",
13
13
  "groupSharedFeatures.usm.expirationRequiredErrorMessage": "Lütfen bir sona erme tarihi seçin",
14
14
  "groupSharedFeatures.usm.invalidEmailErrorMessage": "Geçersiz e-posta adresi",
15
+ "groupSharedFeatures.usm.justificationRequiredError": "Please select a justification or remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.",
15
16
  "groupSharedFeatures.usm.noticeCloseLabel": "Kapat",
16
17
  "groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage": "Parola boşluk, \"<\" veya \">\" içeremez",
17
18
  "groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage": "Parola en az bir büyük harf, rakam veya özel karakter içermelidir",
@@ -31,6 +32,7 @@ export default {
31
32
  "groupSharedFeatures.usm.removeSharedLinkModal.loadingLabel": "Yükleniyor",
32
33
  "groupSharedFeatures.usm.removeSharedLinkModal.okayButton": "Tamam",
33
34
  "groupSharedFeatures.usm.removeSharedLinkModal.title": "Paylaşılmış Bağlantıyı Kaldır",
35
+ "groupSharedFeatures.usm.restrictedContactsError": "Please remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.",
34
36
  "groupSharedFeatures.usm.sharedLinkSettingsModal.cancelButton": "İptal Et",
35
37
  "groupSharedFeatures.usm.sharedLinkSettingsModal.closeButton": "Kapat",
36
38
  "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithClassification": "Gizlilik sınıflandırması nedeniyle içerik için indirme devre dışı bırakıldı.",
@@ -63,18 +65,27 @@ export default {
63
65
  "groupSharedFeatures.usm.successNoticeIcon": "Başarılı",
64
66
  "groupSharedFeatures.usm.unifiedShareFormModal.closeButton": "Kapat",
65
67
  "groupSharedFeatures.usm.unifiedShareFormModal.coOwnerRole": "Co-owner",
68
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.businessJustification": "Business Justification",
66
69
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.cancelButton": "İptal Et",
67
70
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.clearButton": "Temizle",
68
71
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.closeButton": "Kapat",
69
72
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.coOwnerDescription": "Güvenliği yönetme, yükleme, indirme, önizleme, paylaşma, düzenleme ve silme",
73
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionInformationBarrierNotice": "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent due to a security policy. {removeLink}",
74
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionNotice": "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent because external collaboration is restricted due to the applied security policy. {removeLink}",
75
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionRemoveButtonLabel": "Remove to continue",
70
76
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorDescription": "Yükleme, indirme, önizleme, paylaşma ve düzenleme",
71
77
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorFolderDescription": "Yükleme, indirme, önizleme, paylaşma, düzenleme ve silme",
72
78
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.emailSharedLinkLabel": "Paylaşılan Bağlantıyı E-posta ile Gönder",
79
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.errorNoticeIconAriaLabel": "Error",
73
80
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteAsRoleLabel": "{role} olarak davet et",
74
81
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteDisabledTooltip": "İşbirlikçiler davet etme izniniz yok",
75
82
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeopleLabel": "Kişileri Davet Et",
76
83
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeoplePlaceholder": "Adlar veya e-posta adresleri ekleyin",
77
84
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteWebLinkDisabledTooltip": "İşbirlikçiler yer işaretlerine eklenemez",
85
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionNotice": "This content requires a business justification for {count, plural, one {{count} invitation} other {{count} invitations}}. Please select a business justification below. {justificationSelect} {removeLink}",
86
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionRemoveButtonLabel": "Alternatively, remove to continue",
87
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justificationSelectPlaceholder": "Select Justification",
88
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingJustificationReasonsLabel": "Loading justification reasons",
78
89
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingLabel": "Yükleniyor",
79
90
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerDescription": "Preview-only",
80
91
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerUploaderDescription": "Karşıya yükle ve önizle",
@@ -12,6 +12,7 @@ export default {
12
12
  "groupSharedFeatures.usm.expirationFutureDateErrorMessage": "过期日期必须为未来日期",
13
13
  "groupSharedFeatures.usm.expirationRequiredErrorMessage": "请选择过期日期",
14
14
  "groupSharedFeatures.usm.invalidEmailErrorMessage": "无效电邮地址",
15
+ "groupSharedFeatures.usm.justificationRequiredError": "Please select a justification or remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.",
15
16
  "groupSharedFeatures.usm.noticeCloseLabel": "关闭",
16
17
  "groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage": "密码不能包含空格、”<”或“>”",
17
18
  "groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage": "密码必须至少包含一个大写字母、数字或特殊字符",
@@ -31,6 +32,7 @@ export default {
31
32
  "groupSharedFeatures.usm.removeSharedLinkModal.loadingLabel": "正在加载",
32
33
  "groupSharedFeatures.usm.removeSharedLinkModal.okayButton": "确定",
33
34
  "groupSharedFeatures.usm.removeSharedLinkModal.title": "移除共享链接",
35
+ "groupSharedFeatures.usm.restrictedContactsError": "Please remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.",
34
36
  "groupSharedFeatures.usm.sharedLinkSettingsModal.cancelButton": "取消",
35
37
  "groupSharedFeatures.usm.sharedLinkSettingsModal.closeButton": "关闭",
36
38
  "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithClassification": "由于应用了屏蔽访问策略,已禁用对此分类的内容的下载。",
@@ -63,18 +65,27 @@ export default {
63
65
  "groupSharedFeatures.usm.successNoticeIcon": "成功",
64
66
  "groupSharedFeatures.usm.unifiedShareFormModal.closeButton": "关闭",
65
67
  "groupSharedFeatures.usm.unifiedShareFormModal.coOwnerRole": "Co-owner",
68
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.businessJustification": "Business Justification",
66
69
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.cancelButton": "取消",
67
70
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.clearButton": "清除",
68
71
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.closeButton": "关闭",
69
72
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.coOwnerDescription": "管理安全性、上传、下载、预览、共享、编辑和删除",
73
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionInformationBarrierNotice": "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent due to a security policy. {removeLink}",
74
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionNotice": "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent because external collaboration is restricted due to the applied security policy. {removeLink}",
75
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionRemoveButtonLabel": "Remove to continue",
70
76
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorDescription": "上传、下载、预览、共享和编辑",
71
77
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorFolderDescription": "上传、下载、预览、共享、编辑和删除",
72
78
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.emailSharedLinkLabel": "以电子邮件形式发送共享链接",
79
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.errorNoticeIconAriaLabel": "Error",
73
80
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteAsRoleLabel": "邀请为{role}",
74
81
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteDisabledTooltip": "您无权邀请协作者",
75
82
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeopleLabel": "邀请人员",
76
83
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeoplePlaceholder": "添加姓名或电子邮件地址",
77
84
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteWebLinkDisabledTooltip": "无法将协作者添加到书签",
85
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionNotice": "This content requires a business justification for {count, plural, one {{count} invitation} other {{count} invitations}}. Please select a business justification below. {justificationSelect} {removeLink}",
86
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionRemoveButtonLabel": "Alternatively, remove to continue",
87
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justificationSelectPlaceholder": "Select Justification",
88
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingJustificationReasonsLabel": "Loading justification reasons",
78
89
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingLabel": "正在加载",
79
90
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerDescription": "Preview-only",
80
91
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerUploaderDescription": "上传并预览",
@@ -12,6 +12,7 @@ export default {
12
12
  "groupSharedFeatures.usm.expirationFutureDateErrorMessage": "到期日期必須為未來日期",
13
13
  "groupSharedFeatures.usm.expirationRequiredErrorMessage": "請選取到期日期",
14
14
  "groupSharedFeatures.usm.invalidEmailErrorMessage": "無效的電子郵件地址",
15
+ "groupSharedFeatures.usm.justificationRequiredError": "Please select a justification or remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.",
15
16
  "groupSharedFeatures.usm.noticeCloseLabel": "關閉",
16
17
  "groupSharedFeatures.usm.passwordContainInvalidCharacterErrorMessage": "密碼不能包含空格、「<」或「>」",
17
18
  "groupSharedFeatures.usm.passwordContainLetterNumberOrSymbolErrorMessage": "密碼必須至少包含一個大寫字母、數字或特殊字元",
@@ -31,6 +32,7 @@ export default {
31
32
  "groupSharedFeatures.usm.removeSharedLinkModal.loadingLabel": "載入中",
32
33
  "groupSharedFeatures.usm.removeSharedLinkModal.okayButton": "好的",
33
34
  "groupSharedFeatures.usm.removeSharedLinkModal.title": "移除共用的連結",
35
+ "groupSharedFeatures.usm.restrictedContactsError": "Please remove the {count, plural, one {{count} restricted user} other {{count} restricted users}} to continue.",
34
36
  "groupSharedFeatures.usm.sharedLinkSettingsModal.cancelButton": "取消",
35
37
  "groupSharedFeatures.usm.sharedLinkSettingsModal.closeButton": "關閉",
36
38
  "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithClassification": "下載內容的功能已因分類停用。",
@@ -63,18 +65,27 @@ export default {
63
65
  "groupSharedFeatures.usm.successNoticeIcon": "成功",
64
66
  "groupSharedFeatures.usm.unifiedShareFormModal.closeButton": "關閉",
65
67
  "groupSharedFeatures.usm.unifiedShareFormModal.coOwnerRole": "Co-owner",
68
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.businessJustification": "Business Justification",
66
69
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.cancelButton": "取消",
67
70
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.clearButton": "清除",
68
71
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.closeButton": "關閉",
69
72
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.coOwnerDescription": "管理安全性、上傳、下載、預覽、共用、編輯和刪除",
73
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionInformationBarrierNotice": "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent due to a security policy. {removeLink}",
74
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionNotice": "{count, plural, one {{count} invitation} other {{count} invitations}} cannot be sent because external collaboration is restricted due to the applied security policy. {removeLink}",
75
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.contactRestrictionRemoveButtonLabel": "Remove to continue",
70
76
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorDescription": "上傳、下載、預覽、共用和編輯",
71
77
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.editorFolderDescription": "上傳、下載、預覽、共用、編輯和刪除",
72
78
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.emailSharedLinkLabel": "透過電子郵件傳送共用的連結",
79
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.errorNoticeIconAriaLabel": "Error",
73
80
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteAsRoleLabel": "受邀身分為 {role}",
74
81
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteDisabledTooltip": "您沒有邀請共同作業者的權限",
75
82
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeopleLabel": "邀請人員",
76
83
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.invitePeoplePlaceholder": "新增名稱或電子郵件地址",
77
84
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.inviteWebLinkDisabledTooltip": "共同作業者無法新增至書籤",
85
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionNotice": "This content requires a business justification for {count, plural, one {{count} invitation} other {{count} invitations}}. Please select a business justification below. {justificationSelect} {removeLink}",
86
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justifiableContactRestrictionRemoveButtonLabel": "Alternatively, remove to continue",
87
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.justificationSelectPlaceholder": "Select Justification",
88
+ "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingJustificationReasonsLabel": "Loading justification reasons",
78
89
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.loadingLabel": "載入中",
79
90
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerDescription": "Preview-only",
80
91
  "groupSharedFeatures.usm.unifiedShareFormModal.collaborationSection.previewerUploaderDescription": "上傳和預覽",
@@ -0,0 +1 @@
1
+ ._select_27xpi_1{margin:var(--bp-space-030) 0}._link_27xpi_5{cursor:pointer}
@@ -114,5 +114,50 @@ declare const messages: {
114
114
  description: string;
115
115
  id: string;
116
116
  };
117
+ justifiableContactRestrictionNotice: {
118
+ defaultMessage: string;
119
+ description: string;
120
+ id: string;
121
+ };
122
+ justifiableContactRestrictionRemoveButtonLabel: {
123
+ defaultMessage: string;
124
+ description: string;
125
+ id: string;
126
+ };
127
+ contactRestrictionNotice: {
128
+ defaultMessage: string;
129
+ description: string;
130
+ id: string;
131
+ };
132
+ contactRestrictionInformationBarrierNotice: {
133
+ defaultMessage: string;
134
+ description: string;
135
+ id: string;
136
+ };
137
+ contactRestrictionRemoveButtonLabel: {
138
+ defaultMessage: string;
139
+ description: string;
140
+ id: string;
141
+ };
142
+ justificationSelectPlaceholder: {
143
+ defaultMessage: string;
144
+ description: string;
145
+ id: string;
146
+ };
147
+ loadingJustificationReasonsLabel: {
148
+ defaultMessage: string;
149
+ description: string;
150
+ id: string;
151
+ };
152
+ errorNoticeIconAriaLabel: {
153
+ defaultMessage: string;
154
+ description: string;
155
+ id: string;
156
+ };
157
+ businessJustification: {
158
+ defaultMessage: string;
159
+ description: string;
160
+ id: string;
161
+ };
117
162
  };
118
163
  export default messages;
@@ -0,0 +1,8 @@
1
+ import { UserContactType } from '@box/user-selector';
2
+ import { CollaborationRestrictionError } from '../../../types';
3
+ export interface ShieldRestrictionNoticeProps {
4
+ error: CollaborationRestrictionError;
5
+ isLoading: boolean;
6
+ onSelectedUsersChange: (users: UserContactType[]) => void;
7
+ }
8
+ export declare function ShieldRestrictionNotice({ error, isLoading, onSelectedUsersChange }: ShieldRestrictionNoticeProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { UserContactType } from '@box/user-selector';
3
- import { CollaborationRole, ModalViewType, ShareViewType } from '../types';
3
+ import { CollaborationRole, ModalViewType, ShareViewType, ShieldRestriction } from '../types';
4
4
  export interface UnifiedShareFormContextValue extends Omit<UnifiedShareFormProviderProps, 'children'> {
5
5
  collaborationRole?: CollaborationRole;
6
6
  contactValue?: string;
@@ -8,7 +8,9 @@ export interface UnifiedShareFormContextValue extends Omit<UnifiedShareFormProvi
8
8
  setCollaborationRole?: (value: CollaborationRole) => void;
9
9
  setContactValue?: (value: string) => void;
10
10
  setMessageValue?: (value: string) => void;
11
+ setShieldRestriction?: (value: ShieldRestriction) => void;
11
12
  setUserContacts?: (value: UserContactType[]) => void;
13
+ shieldRestriction?: ShieldRestriction;
12
14
  userContacts?: UserContactType[];
13
15
  }
14
16
  export declare const UnifiedShareFormContext: import('react').Context<UnifiedShareFormContextValue>;
@@ -1,7 +1,8 @@
1
- import { Dispatch, SetStateAction } from 'react';
1
+ import { Dispatch, ReactElement, SetStateAction } from 'react';
2
2
  import { UserContactType } from '@box/user-selector';
3
3
  import { CollaborationRole, Collaborator, Configuration, ContactService, EventService, Item, SharedLink, SharingService, User } from '../types';
4
4
  export interface UnifiedShareModalContextValue {
5
+ collaborationNotices?: ReactElement | ReactElement[];
5
6
  collaborationRoles?: CollaborationRole[];
6
7
  collaborator?: Partial<Collaborator>;
7
8
  collaborators?: Collaborator[];
@@ -13,6 +13,7 @@ export declare const useFormValidation: () => {
13
13
  validateCollaborationLimit: (users: UserContactType[], maxContacts: number) => boolean;
14
14
  validateExpiration: (expiration: DateValue) => boolean;
15
15
  validatePassword: (password: string) => boolean;
16
+ validateShieldRestriction: (users: UserContactType[]) => string;
16
17
  validateVanityName: (vanityName: string) => boolean;
17
18
  validateUserContact: (user: string) => boolean;
18
19
  validateUserSelector: (users: UserContactType[]) => boolean;
@@ -119,5 +119,15 @@ declare const messages: {
119
119
  description: string;
120
120
  id: string;
121
121
  };
122
+ justificationRequiredError: {
123
+ defaultMessage: string;
124
+ description: string;
125
+ id: string;
126
+ };
127
+ restrictedContactsError: {
128
+ defaultMessage: string;
129
+ description: string;
130
+ id: string;
131
+ };
122
132
  };
123
133
  export default messages;
@@ -1,4 +1,3 @@
1
- import { ReactElement } from 'react';
2
1
  import { DatePickerProps } from '@box/blueprint-web';
3
2
  import { FetchedAvatarUrls, UserContactType } from '@box/user-selector';
4
3
  /**
@@ -345,6 +344,12 @@ export interface EventService {
345
344
  * Use this when you want to override the default navigation behavior.
346
345
  */
347
346
  onCollaboratorsManagementClick?: () => void;
347
+ /**
348
+ * Function to observe when restricted collaborators are removed from the selection.
349
+ *
350
+ * This is usually used for data tracking purposes.
351
+ */
352
+ onRestrictedUsersRemoveClick?: (contacts: UserContactType[]) => void;
348
353
  onSharedLinkSettingsClick?: () => void;
349
354
  onSharedLinkSettingsClose?: () => void;
350
355
  onSharedLinkSettingsLoad?: () => void;
@@ -368,6 +373,15 @@ export interface ContactService {
368
373
  * Called when the list of suggested contacts is updated.
369
374
  */
370
375
  getContactsAvatarUrls?: (userContacts: UserContactType[]) => Promise<FetchedAvatarUrls>;
376
+ /**
377
+ * Function to retrieve justification reasons for restricted collaborations.
378
+ *
379
+ * Called when the user attempts to invite restricted contacts with justification allowed.
380
+ */
381
+ getJustificationReasons?: (item: Item) => Promise<{
382
+ classificationId?: string;
383
+ options: JustificationReason[];
384
+ }>;
371
385
  }
372
386
  export interface SharingService {
373
387
  /**
@@ -450,10 +464,20 @@ export interface SharingError {
450
464
  * Form data structure for the collaboration form in the Unified Share Modal.
451
465
  */
452
466
  export interface CollaborationFormData {
467
+ /**
468
+ * The classification ID of the item for inviting restricted collaborators.
469
+ */
470
+ classificationId?: string;
453
471
  /**
454
472
  * The selected contacts to invite as collaborators or email the shared link.
455
473
  */
456
474
  contacts: UserContactType[];
475
+ /**
476
+ * The business justification reason for inviting restricted collaborators.
477
+ *
478
+ * This property is only included when a justification is required and selected.
479
+ */
480
+ justificationReason?: JustificationReason;
457
481
  /**
458
482
  * The message to send to collaborators or shared link recipients.
459
483
  */
@@ -498,6 +522,64 @@ export interface LinkSettingsFormData {
498
522
  */
499
523
  vanityName: string;
500
524
  }
525
+ export interface ShieldRestriction {
526
+ /**
527
+ * The classification ID of the item.
528
+ */
529
+ classificationId?: string;
530
+ /**
531
+ * When `true`, a business justification can be provided to invite restricted collaborators.
532
+ */
533
+ isJustificationAllowed?: boolean;
534
+ /**
535
+ * The selected business justification reason.
536
+ */
537
+ justificationReason?: JustificationReason;
538
+ }
539
+ /**
540
+ * Justification reason for restricted collaborations.
541
+ */
542
+ export interface JustificationReason {
543
+ /**
544
+ * When `true`, the justification reason requires additional details to be provided.
545
+ *
546
+ * NOTE: This property is not used internally.
547
+ */
548
+ isDetailsRequired?: boolean;
549
+ /**
550
+ * The description of the justification reason.
551
+ */
552
+ description?: string;
553
+ /**
554
+ * The unique identifier for the justification reason.
555
+ */
556
+ id: string;
557
+ /**
558
+ * The display title of the justification reason.
559
+ */
560
+ title: string;
561
+ }
562
+ /**
563
+ * Error structure when collaboration is restricted by shield policies.
564
+ */
565
+ export interface CollaborationRestrictionError {
566
+ /**
567
+ * When `true`, a business justification can be provided to proceed.
568
+ */
569
+ isJustificationAllowed?: boolean;
570
+ /**
571
+ * The list of email addresses that are restricted.
572
+ */
573
+ restrictedEmails?: string[];
574
+ /**
575
+ * The list of group IDs that are restricted.
576
+ */
577
+ restrictedGroups?: string[];
578
+ /**
579
+ * The type of restriction.
580
+ */
581
+ restrictionType: 'access_policy' | 'information_barrier';
582
+ }
501
583
  /**
502
584
  * Configuration options for configuring features in the Unified Share Modal.
503
585
  *
@@ -524,12 +606,6 @@ export interface Configuration {
524
606
  * @default true
525
607
  */
526
608
  collaborationMessage?: boolean;
527
- /**
528
- * Inline notices to display in the collaboration section.
529
- *
530
- * There are no inline notices by default.
531
- */
532
- collaborationNotices?: ReactElement | ReactElement[];
533
609
  /**
534
610
  * Controls whether the collaboration role is visible to the user.
535
611
  *
@@ -3,6 +3,7 @@ import { UserContactType } from '@box/user-selector';
3
3
  import { CollaborationRole, Collaborator, Configuration, ContactService, EventService, Item, SharedLink, SharingService, User } from './types';
4
4
  export interface UnifiedShareModalProps {
5
5
  children?: ReactElement;
6
+ collaborationNotices?: ReactElement | ReactElement[];
6
7
  collaborationRoles?: CollaborationRole[];
7
8
  collaborators?: Collaborator[];
8
9
  config?: Configuration;
@@ -19,4 +20,4 @@ export interface UnifiedShareModalProps {
19
20
  sharedLink?: SharedLink;
20
21
  sharingService?: SharingService;
21
22
  }
22
- export declare function UnifiedShareModal({ children, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, isFetching, isOpen, isSubmitting, item, onLoad, onOpenChange, sharedLink, sharingService, }: UnifiedShareModalProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function UnifiedShareModal({ children, collaborationNotices, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, isFetching, isOpen, isSubmitting, item, onLoad, onOpenChange, sharedLink, sharingService, }: UnifiedShareModalProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,10 @@
1
1
  import { AvatarProps, IconBadgeProps } from '@box/blueprint-web';
2
+ import { UserContactType } from '@box/user-selector';
2
3
  import { CollaborationRole, Collaborator } from '../types';
3
4
  declare const getAvatarBadgeSize: (size: AvatarProps["size"]) => IconBadgeProps["size"];
4
5
  declare const getDefaultCollaborationRole: (collaborationRoles?: CollaborationRole[]) => CollaborationRole;
5
6
  declare const getFirstInitial: (name: string) => string;
6
7
  declare const isCollaboratorRoleSupported: (role: Collaborator["role"]) => boolean;
7
8
  declare const isInvitationRoleSupported: (role: CollaborationRole["id"]) => boolean;
8
- export { getAvatarBadgeSize, getDefaultCollaborationRole, getFirstInitial, isCollaboratorRoleSupported, isInvitationRoleSupported, };
9
+ declare const isCollaboratorRestricted: (contact: UserContactType, restrictedEmails?: string[], restrictedGroups?: string[]) => boolean;
10
+ export { getAvatarBadgeSize, getDefaultCollaborationRole, getFirstInitial, isCollaboratorRestricted, isCollaboratorRoleSupported, isInvitationRoleSupported, };
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^12.110.0",
7
- "@box/blueprint-web-assets": "^4.89.5",
8
- "@box/copy-input": "^1.21.3",
9
- "@box/user-selector": "^1.53.3",
6
+ "@box/blueprint-web": "^12.110.1",
7
+ "@box/blueprint-web-assets": "^4.89.6",
8
+ "@box/copy-input": "^1.21.4",
9
+ "@box/user-selector": "^1.54.0",
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": "^12.110.0",
17
- "@box/blueprint-web-assets": "^4.89.5",
18
- "@box/copy-input": "^1.21.3",
19
- "@box/storybook-utils": "0.14.39",
16
+ "@box/blueprint-web": "^12.110.1",
17
+ "@box/blueprint-web-assets": "^4.89.6",
18
+ "@box/copy-input": "^1.21.4",
19
+ "@box/storybook-utils": "0.14.40",
20
20
  "@box/eslint-plugin-blueprint": "1.0.5",
21
21
  "react-intl": "^6.4.2"
22
22
  },