@box/unified-share-modal 3.2.12 → 3.3.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.
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +1 -1
- package/dist/esm/lib/hooks/use-access-levels.js +1 -1
- package/dist/types/lib/components/unified-share-form-modal/shared-link-section/messages.d.ts +5 -0
- package/dist/types/lib/stories/shared.d.ts +1 -0
- package/dist/types/lib/types.d.ts +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineMessages}from"react-intl";var messages=defineMessages({closeButton:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.closeButton`,defaultMessage:`Close`},shareLinkLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.shareLinkLabel`,defaultMessage:`Share Link`},sharedLinkToggleLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkToggleLabel`,defaultMessage:`Shared link`},sharedLinkToggleTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkToggleTooltip`,defaultMessage:`Create and copy link`},createLinkDisabledTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.createLinkDisabledTooltip`,defaultMessage:`You do not have permission to create the link`},removeLinkDisabledTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.removeLinkDisabledTooltip`,defaultMessage:`You do not have permission to remove the link`},sharedLinkSettingsLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkSettingsLabel`,defaultMessage:`Link Settings`},sharedLinkUrlLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkUrlLabel`,defaultMessage:`Shared link URL`},sharedLinkEmailLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkEmailLabel`,defaultMessage:`Send Shared Link`},sharedLinkPubliclyAvailable:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkPubliclyAvailable`,defaultMessage:`This content is publicly available to anyone with the link.`},sharedLinkEditablePubliclyAvailable:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkEditablePubliclyAvailable`,defaultMessage:`Publicly available for anyone to view and download. Any logged in users with the link can edit.`},sharedLinkElevatedEditableCompanyAvailable:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkElevatedEditableCompanyAvailable`,defaultMessage:`People who have access to this link can edit.`},expirationIconLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.expirationIconLabel`,defaultMessage:`Expires`},expirationIconTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.expirationIconTooltip`,defaultMessage:`This link will expire and be inaccessible on {expirationDate}`},openAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.openAccessLevelLabel`,defaultMessage:`People with the link`},openAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.openAccessLevelDescription`,defaultMessage:`Publicly accessible and no sign-in required`},companyAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.companyAccessLevelLabel`,defaultMessage:`People in your company`},companyAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.companyAccessLevelDescription`,defaultMessage:`Anyone in your company with the link or people invited to this {item} can access`},enterpriseAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.enterpriseAccessLevelLabel`,defaultMessage:`People in {enterprise}`},enterpriseAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.enterpriseAccessLevelDescription`,defaultMessage:`Anyone at {enterprise} with the link or people invited to this {item} can access`},collaboratorsAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.collaboratorsAccessLevelLabel`,defaultMessage:`Invited people only`},collaboratorsAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.collaboratorsAccessLevelDescription`,defaultMessage:`Only invited people can access this {item}`},fileAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.fileAccessLevelItem`,defaultMessage:`file`},folderAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.folderAccessLevelItem`,defaultMessage:`folder`},hubsAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.hubsAccessLevelItem`,defaultMessage:`hub`},webLinkAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.webLinkAccessLevelItem`,defaultMessage:`bookmark`},workflowAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.workflowAccessLevelItem`,defaultMessage:`workflow`},disabledAccessLevelTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.disabledAccessLevelTooltip`,defaultMessage:`This option is not available due to a security policy`},canEditPermissionLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canEditPermissionLevelLabel`,defaultMessage:`Can edit`},canDownloadPermissionLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canDownloadPermissionLevelLabel`,defaultMessage:`Can view and download`},canPreviewPermissionLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canPreviewPermissionLevelLabel`,defaultMessage:`Can view only`},canEditBoxNoteDisabledTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canEditBoxNoteDisabledTooltip`,defaultMessage:`This permission can only be changed in Box Notes`},autoCreateCopyErrorNoticeText:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.autoCreateCopyErrorNoticeText`,defaultMessage:`Shared link created. Click Copy to share.`},autoCreateCopySuccessNoticeText:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.autoCreateCopySuccessNoticeText`,defaultMessage:`Shared link created and copied to clipboard.`},autoCopySuccessNoticeText:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.autoCopySuccessNoticeText`,defaultMessage:`Shared link copied to clipboard.`}});export{messages as default};
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({closeButton:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.closeButton`,defaultMessage:`Close`},shareLinkLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.shareLinkLabel`,defaultMessage:`Share Link`},sharedLinkToggleLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkToggleLabel`,defaultMessage:`Shared link`},sharedLinkToggleTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkToggleTooltip`,defaultMessage:`Create and copy link`},createLinkDisabledTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.createLinkDisabledTooltip`,defaultMessage:`You do not have permission to create the link`},removeLinkDisabledTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.removeLinkDisabledTooltip`,defaultMessage:`You do not have permission to remove the link`},sharedLinkSettingsLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkSettingsLabel`,defaultMessage:`Link Settings`},sharedLinkUrlLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkUrlLabel`,defaultMessage:`Shared link URL`},sharedLinkEmailLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkEmailLabel`,defaultMessage:`Send Shared Link`},sharedLinkPubliclyAvailable:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkPubliclyAvailable`,defaultMessage:`This content is publicly available to anyone with the link.`},sharedLinkEditablePubliclyAvailable:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkEditablePubliclyAvailable`,defaultMessage:`Publicly available for anyone to view and download. Any logged in users with the link can edit.`},sharedLinkElevatedEditableCompanyAvailable:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkElevatedEditableCompanyAvailable`,defaultMessage:`People who have access to this link can edit.`},expirationIconLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.expirationIconLabel`,defaultMessage:`Expires`},expirationIconTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.expirationIconTooltip`,defaultMessage:`This link will expire and be inaccessible on {expirationDate}`},openAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.openAccessLevelLabel`,defaultMessage:`People with the link`},openAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.openAccessLevelDescription`,defaultMessage:`Publicly accessible and no sign-in required`},companyAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.companyAccessLevelLabel`,defaultMessage:`People in your company`},companyAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.companyAccessLevelDescription`,defaultMessage:`Anyone in your company with the link or people invited to this {item} can access`},enterpriseAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.enterpriseAccessLevelLabel`,defaultMessage:`People in {enterprise}`},enterpriseAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.enterpriseAccessLevelDescription`,defaultMessage:`Anyone at {enterprise} with the link or people invited to this {item} can access`},collaboratorsAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.collaboratorsAccessLevelLabel`,defaultMessage:`Invited people only`},collaboratorsAccessLevelDescription:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.collaboratorsAccessLevelDescription`,defaultMessage:`Only invited people can access this {item}`},fileAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.fileAccessLevelItem`,defaultMessage:`file`},folderAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.folderAccessLevelItem`,defaultMessage:`folder`},hubsAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.hubsAccessLevelItem`,defaultMessage:`hub`},promptAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.promptAccessLevelItem`,defaultMessage:`prompt`},webLinkAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.webLinkAccessLevelItem`,defaultMessage:`bookmark`},workflowAccessLevelItem:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.workflowAccessLevelItem`,defaultMessage:`workflow`},disabledAccessLevelTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.disabledAccessLevelTooltip`,defaultMessage:`This option is not available due to a security policy`},canEditPermissionLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canEditPermissionLevelLabel`,defaultMessage:`Can edit`},canDownloadPermissionLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canDownloadPermissionLevelLabel`,defaultMessage:`Can view and download`},canPreviewPermissionLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canPreviewPermissionLevelLabel`,defaultMessage:`Can view only`},canEditBoxNoteDisabledTooltip:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.canEditBoxNoteDisabledTooltip`,defaultMessage:`This permission can only be changed in Box Notes`},autoCreateCopyErrorNoticeText:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.autoCreateCopyErrorNoticeText`,defaultMessage:`Shared link created. Click Copy to share.`},autoCreateCopySuccessNoticeText:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.autoCreateCopySuccessNoticeText`,defaultMessage:`Shared link created and copied to clipboard.`},autoCopySuccessNoticeText:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.autoCopySuccessNoticeText`,defaultMessage:`Shared link copied to clipboard.`}});export{messages as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useUnifiedShareModalContext}from"../contexts/unified-share-modal-context.js";import{getAllowedAccessLevels}from"../utils/permission.js";import messages from"../components/unified-share-form-modal/shared-link-section/messages.js";import{useMemo}from"react";import{useIntl}from"react-intl";var getAccessLevelLabel=(formatMessage,accessLevel,enterprise)=>{let{id:access,label}=accessLevel,message;switch(access){case`collaborators`:message=messages.collaboratorsAccessLevelLabel;break;case`company`:message=enterprise?messages.enterpriseAccessLevelLabel:messages.companyAccessLevelLabel;break;case`open`:message=messages.openAccessLevelLabel;break}return label??(message?formatMessage(message,{enterprise}):``)},getAccessLevelDescription=(formatMessage,accessLevel,enterprise,type)=>{let{description,id:access}=accessLevel,message,item;switch(access){case`collaborators`:message=messages.collaboratorsAccessLevelDescription;break;case`company`:message=enterprise?messages.enterpriseAccessLevelDescription:messages.companyAccessLevelDescription;break;case`open`:message=messages.openAccessLevelDescription;break}switch(type){case`file`:item=messages.fileAccessLevelItem;break;case`folder`:item=messages.folderAccessLevelItem;break;case`hubs`:item=messages.hubsAccessLevelItem;break;case`web_link`:item=messages.webLinkAccessLevelItem;break;case`workflow`:item=messages.workflowAccessLevelItem;break}return description??(message?formatMessage(message,{enterprise,item:formatMessage(item)}):``)},useAccessLevels=()=>{let{formatMessage}=useIntl(),{currentUser,item,sharedLink}=useUnifiedShareModalContext(),{enterprise={}}=currentUser,{name:enterpriseName}=enterprise,{type:itemType}=item,{access,accessLevels}=sharedLink,allowedLevels=useMemo(()=>getAllowedAccessLevels(accessLevels).map(level=>({...level,description:getAccessLevelDescription(formatMessage,level,enterpriseName,itemType),label:getAccessLevelLabel(formatMessage,level,enterpriseName)})),[accessLevels,enterpriseName,formatMessage,itemType]);return{allowedLevels,selectedAccess:useMemo(()=>allowedLevels.find(({id})=>access===id),[access,allowedLevels])}};export{useAccessLevels};
|
|
1
|
+
import{useUnifiedShareModalContext}from"../contexts/unified-share-modal-context.js";import{getAllowedAccessLevels}from"../utils/permission.js";import messages from"../components/unified-share-form-modal/shared-link-section/messages.js";import{useMemo}from"react";import{useIntl}from"react-intl";var getAccessLevelLabel=(formatMessage,accessLevel,enterprise)=>{let{id:access,label}=accessLevel,message;switch(access){case`collaborators`:message=messages.collaboratorsAccessLevelLabel;break;case`company`:message=enterprise?messages.enterpriseAccessLevelLabel:messages.companyAccessLevelLabel;break;case`open`:message=messages.openAccessLevelLabel;break}return label??(message?formatMessage(message,{enterprise}):``)},getAccessLevelDescription=(formatMessage,accessLevel,enterprise,type)=>{let{description,id:access}=accessLevel,message,item;switch(access){case`collaborators`:message=messages.collaboratorsAccessLevelDescription;break;case`company`:message=enterprise?messages.enterpriseAccessLevelDescription:messages.companyAccessLevelDescription;break;case`open`:message=messages.openAccessLevelDescription;break}switch(type){case`file`:item=messages.fileAccessLevelItem;break;case`folder`:item=messages.folderAccessLevelItem;break;case`hubs`:item=messages.hubsAccessLevelItem;break;case`prompt`:item=messages.promptAccessLevelItem;break;case`web_link`:item=messages.webLinkAccessLevelItem;break;case`workflow`:item=messages.workflowAccessLevelItem;break}return description??(message?formatMessage(message,{enterprise,item:formatMessage(item)}):``)},useAccessLevels=()=>{let{formatMessage}=useIntl(),{currentUser,item,sharedLink}=useUnifiedShareModalContext(),{enterprise={}}=currentUser,{name:enterpriseName}=enterprise,{type:itemType}=item,{access,accessLevels}=sharedLink,allowedLevels=useMemo(()=>getAllowedAccessLevels(accessLevels).map(level=>({...level,description:getAccessLevelDescription(formatMessage,level,enterpriseName,itemType),label:getAccessLevelLabel(formatMessage,level,enterpriseName)})),[accessLevels,enterpriseName,formatMessage,itemType]);return{allowedLevels,selectedAccess:useMemo(()=>allowedLevels.find(({id})=>access===id),[access,allowedLevels])}};export{useAccessLevels};
|
package/dist/types/lib/components/unified-share-form-modal/shared-link-section/messages.d.ts
CHANGED
|
@@ -124,6 +124,11 @@ declare const messages: {
|
|
|
124
124
|
description: string;
|
|
125
125
|
id: string;
|
|
126
126
|
};
|
|
127
|
+
promptAccessLevelItem: {
|
|
128
|
+
defaultMessage: string;
|
|
129
|
+
description: string;
|
|
130
|
+
id: string;
|
|
131
|
+
};
|
|
127
132
|
webLinkAccessLevelItem: {
|
|
128
133
|
defaultMessage: string;
|
|
129
134
|
description: string;
|
|
@@ -27,6 +27,7 @@ export declare const mockItemPermissions: {
|
|
|
27
27
|
export declare const mockBoxFile: Item;
|
|
28
28
|
export declare const mockBoxFolder: Item;
|
|
29
29
|
export declare const mockWorkflow: Item;
|
|
30
|
+
export declare const mockPrompt: Item;
|
|
30
31
|
export declare const mockSharedLinkSettings: SharedLinkSettings;
|
|
31
32
|
export declare const mockSharedLink: SharedLink;
|
|
32
33
|
export declare const useMockSharedLink: (sharedLinkArg: any) => {
|
|
@@ -46,7 +46,7 @@ export type PermissionLevelType = 'can_edit' | 'can_download' | 'can_preview';
|
|
|
46
46
|
/**
|
|
47
47
|
* Supported item types in the Unified Share Modal.
|
|
48
48
|
*/
|
|
49
|
-
export type ItemType = 'file' | 'folder' | 'hubs' | 'web_link' | 'workflow';
|
|
49
|
+
export type ItemType = 'file' | 'folder' | 'hubs' | 'prompt' | 'web_link' | 'workflow';
|
|
50
50
|
export interface Item {
|
|
51
51
|
/**
|
|
52
52
|
* The classification of the item.
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/unified-share-modal",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^16.
|
|
7
|
-
"@box/blueprint-web-assets": "^5.7.
|
|
8
|
-
"@box/copy-input": "^2.2.
|
|
9
|
-
"@box/user-selector": "^2.2.
|
|
6
|
+
"@box/blueprint-web": "^16.19.0",
|
|
7
|
+
"@box/blueprint-web-assets": "^5.7.4",
|
|
8
|
+
"@box/copy-input": "^2.2.13",
|
|
9
|
+
"@box/user-selector": "^2.2.13",
|
|
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.
|
|
17
|
-
"@box/blueprint-web-assets": "^5.7.
|
|
18
|
-
"@box/copy-input": "^2.2.
|
|
19
|
-
"@box/eslint-plugin-blueprint": "2.2.
|
|
20
|
-
"@box/storybook-utils": "1.2.
|
|
16
|
+
"@box/blueprint-web": "^16.19.0",
|
|
17
|
+
"@box/blueprint-web-assets": "^5.7.4",
|
|
18
|
+
"@box/copy-input": "^2.2.13",
|
|
19
|
+
"@box/eslint-plugin-blueprint": "2.2.3",
|
|
20
|
+
"@box/storybook-utils": "1.2.13",
|
|
21
21
|
"react-intl": "^6.4.2"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|