@box/unified-share-modal 3.5.4 → 3.5.6
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/otp-section.js +1 -1
- package/dist/chunks/shared-link-section.js +1 -1
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +1 -1
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +1 -1
- package/dist/esm/lib/containers/index.js +0 -0
- package/dist/esm/lib/hooks/use-access-levels.js +1 -1
- package/dist/esm/lib/hooks/use-sharing-action.js +1 -1
- package/dist/types/lib/components/shared-link-settings-modal/otp-section.d.ts +2 -2
- package/dist/types/lib/components/unified-share-form-modal/shared-link-section/messages.d.ts +1 -1
- package/dist/types/lib/containers/index.d.ts +0 -0
- package/dist/types/lib/hooks/use-sharing-action.d.ts +1 -1
- package/dist/types/lib/types.d.ts +12 -9
- package/dist/types/lib/utils/notification.d.ts +5 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OTP_MODE}from"../esm/lib/constants.js";import messages from"../esm/lib/components/shared-link-settings-modal/messages.js";import{useIntl}from"react-intl";import{Button,Radio,Switch,Text}from"@box/blueprint-web";import{Fragment,jsx,jsxs}from"react/jsx-runtime";import '../styles/otp-section.css';var otp_section_module_default={toggle:`_toggle_2m015_1`,recommendedBadge:`_recommendedBadge_2m015_7`,countBadge:`_countBadge_2m015_8`,modeSelector:`_modeSelector_2m015_26`,allowlist:`_allowlist_2m015_33`};function OtpSection({allowlistItemCount,canChange,isAvailable,isChecked,isDisabled,
|
|
1
|
+
import{OTP_MODE}from"../esm/lib/constants.js";import messages from"../esm/lib/components/shared-link-settings-modal/messages.js";import{useIntl}from"react-intl";import{Button,Radio,Switch,Text}from"@box/blueprint-web";import{Fragment,jsx,jsxs}from"react/jsx-runtime";import '../styles/otp-section.css';var otp_section_module_default={toggle:`_toggle_2m015_1`,recommendedBadge:`_recommendedBadge_2m015_7`,countBadge:`_countBadge_2m015_8`,modeSelector:`_modeSelector_2m015_26`,allowlist:`_allowlist_2m015_33`};function OtpSection({allowlistItemCount,canChange,isAvailable,isChecked,isDisabled,onConfigureClick,onModeChange,onToggle,otpMode}){let{formatMessage}=useIntl();if(!isAvailable)return null;let isSectionDisabled=isDisabled||!canChange;return jsxs(Fragment,{children:[jsxs(`div`,{className:otp_section_module_default.toggle,children:[jsx(Switch.Item,{checked:isChecked,disabled:isSectionDisabled,label:formatMessage(messages.otpToggleText),onCheckedChange:onToggle,value:`otp-settings`}),!isSectionDisabled&&jsx(Text,{as:`span`,className:otp_section_module_default.recommendedBadge,color:`textOnLightDefault`,variant:`captionBold`,children:formatMessage(messages.otpRecommendedBadge)})]}),isChecked&&jsxs(`div`,{className:otp_section_module_default.modeSelector,children:[jsx(Radio.Legend,{header:formatMessage(messages.otpModeSelectorLegend),children:jsxs(Radio.Group,{disabled:isSectionDisabled,onValueChange:value=>onModeChange(value),value:otpMode,children:[jsx(Radio.Item,{label:formatMessage(messages.otpModeOpenLabel),value:OTP_MODE.OPEN}),jsx(Radio.Item,{label:formatMessage(messages.otpModeAccessListLabel),value:OTP_MODE.ALLOWLIST})]})}),otpMode===OTP_MODE.ALLOWLIST&&jsxs(`div`,{className:otp_section_module_default.allowlist,children:[jsx(Button,{disabled:isSectionDisabled,onClick:onConfigureClick,size:`small`,variant:`secondary`,children:formatMessage(messages.otpConfigureButton)}),allowlistItemCount>0&&jsxs(Fragment,{children:[jsx(Text,{as:`span`,color:`textOnLightSecondary`,variant:`bodyDefault`,children:formatMessage(messages.otpAccessListLabel)}),jsx(Text,{as:`span`,className:otp_section_module_default.countBadge,color:`textOnLightDefault`,variant:`captionBold`,children:formatMessage(messages.otpAccessListCountBadge,{count:allowlistItemCount})})]})]})]})]})}export{OtpSection as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useUnifiedShareModalContext}from"../esm/lib/contexts/unified-share-modal-context.js";import{formatDateFromTimestampToDateString}from"../esm/lib/utils/date.js";import{callOnKeyboardEvent}from"../esm/lib/utils/event.js";import{getNotificationArgs}from"../esm/lib/utils/notification.js";import messages from"../esm/lib/components/unified-share-form-modal/shared-link-section/messages.js";import{useUnifiedShareFormContext}from"../esm/lib/contexts/unified-share-form-context.js";import{useSharingAction}from"../esm/lib/hooks/use-sharing-action.js";import{t as SharedLinkAccess}from"./shared-link-access.js";import{t as SharedLinkFooter}from"./shared-link-footer.js";import{t as SharedLinkPermission}from"./shared-link-permission.js";import{useCallback,useEffect,useRef}from"react";import{useIntl}from"react-intl";import{Button,Focusable,Link,Status,Switch,Text,Tooltip,useNotification}from"@box/blueprint-web";import{jsx,jsxs}from"react/jsx-runtime";import{ClockBadge}from"@box/blueprint-web-assets/icons/Line";import{CopyInput}from"@box/copy-input";import{Mail}from"@box/blueprint-web-assets/icons/Medium";import{SurfaceStatusSurfaceRed}from"@box/blueprint-web-assets/tokens/tokens";import '../styles/shared-link-section.css';var shared_link_section_module_default={container:`_container_w9erl_1`,toggle:`_toggle_w9erl_7`,settings:`_settings_w9erl_13`,copy:`_copy_w9erl_22`,access:`_access_w9erl_30`};function SharedLinkSection(){let{formatMessage}=useIntl(),{addNotification}=useNotification(),copyInputRef=useRef(null),{isInteracted,isSharedLinkAutoCopied,isSharedLinkAutoCreated,setForm}=useUnifiedShareFormContext(),{config,eventService,isFetching,isSubmitting,item,setView,sharedLink,sharingService}=useUnifiedShareModalContext(),{permissions={}}=item,{onSharedLinkCopy,onSharedLinkSettingsClick}=eventService,{createSharedLink}=sharingService,{notifications,sharedLinkAutoCopy,sharedLinkAutoCreate}=config,hasSharedLink=!!sharedLink.url,isAutoCopyEnabled=sharedLinkAutoCopy&&!isSharedLinkAutoCopied.current&&!isInteracted,isAutoCreateEnabled=sharedLinkAutoCreate&&!isSharedLinkAutoCreated.current&&!isInteracted,{onAction:onCreate}=useSharingAction(useCallback(async()=>{let response=await createSharedLink()
|
|
1
|
+
import{useUnifiedShareModalContext}from"../esm/lib/contexts/unified-share-modal-context.js";import{formatDateFromTimestampToDateString}from"../esm/lib/utils/date.js";import{callOnKeyboardEvent}from"../esm/lib/utils/event.js";import{getNotificationArgs}from"../esm/lib/utils/notification.js";import messages from"../esm/lib/components/unified-share-form-modal/shared-link-section/messages.js";import{useUnifiedShareFormContext}from"../esm/lib/contexts/unified-share-form-context.js";import{useSharingAction}from"../esm/lib/hooks/use-sharing-action.js";import{t as SharedLinkAccess}from"./shared-link-access.js";import{t as SharedLinkFooter}from"./shared-link-footer.js";import{t as SharedLinkPermission}from"./shared-link-permission.js";import{useCallback,useEffect,useRef}from"react";import{useIntl}from"react-intl";import{Button,Focusable,Link,Status,Switch,Text,Tooltip,useNotification}from"@box/blueprint-web";import{jsx,jsxs}from"react/jsx-runtime";import{ClockBadge}from"@box/blueprint-web-assets/icons/Line";import{CopyInput}from"@box/copy-input";import{Mail}from"@box/blueprint-web-assets/icons/Medium";import{SurfaceStatusSurfaceRed}from"@box/blueprint-web-assets/tokens/tokens";import '../styles/shared-link-section.css';var shared_link_section_module_default={container:`_container_w9erl_1`,toggle:`_toggle_w9erl_7`,settings:`_settings_w9erl_13`,copy:`_copy_w9erl_22`,access:`_access_w9erl_30`};function SharedLinkSection(){let{formatMessage}=useIntl(),{addNotification}=useNotification(),copyInputRef=useRef(null),{isInteracted,isSharedLinkAutoCopied,isSharedLinkAutoCreated,setForm}=useUnifiedShareFormContext(),{config,eventService,isFetching,isSubmitting,item,setView,sharedLink,sharingService}=useUnifiedShareModalContext(),{permissions={}}=item,{onSharedLinkCopy,onSharedLinkSettingsClick}=eventService,{createSharedLink}=sharingService,{notifications=[],sharedLinkAutoCopy,sharedLinkAutoCreate}=config,hasSharedLink=!!sharedLink.url,isAutoCopyEnabled=sharedLinkAutoCopy&&!isSharedLinkAutoCopied.current&&!isInteracted,isAutoCreateEnabled=sharedLinkAutoCreate&&!isSharedLinkAutoCreated.current&&!isInteracted,{onAction:onCreate}=useSharingAction(useCallback(async()=>{let response;return createSharedLink&&(response=await createSharedLink()),isAutoCopyEnabled?{messages:[]}:response},[isAutoCopyEnabled,createSharedLink]),`create-shared-link`);useEffect(()=>{(async()=>{isFetching||isSubmitting||((isAutoCopyEnabled||isAutoCreateEnabled)&&!hasSharedLink&&!isSharedLinkAutoCreated.current&&(isSharedLinkAutoCreated.current=!0,await onCreate()),isAutoCopyEnabled&&hasSharedLink&©InputRef.current&©InputRef.current.click())})()},[hasSharedLink,isAutoCopyEnabled,isAutoCreateEnabled,isFetching,isSharedLinkAutoCopied,isSharedLinkAutoCreated,isSubmitting,onCreate]);let handleCopySuccess=useCallback(result=>{if(onSharedLinkCopy&&onSharedLinkCopy(result),!isAutoCopyEnabled)return;isSharedLinkAutoCopied.current=!0;let{settings={}}=sharedLink,{otpAllowlistItemCount,otpMode}=settings,isEmptyAllowlist=otpMode===`allowlist`&&!otpAllowlistItemCount,message,variant=`success`;typeof result==`string`?isEmptyAllowlist?(message=formatMessage(messages.copyWithEmptyAllowlistNotice),variant=`warning`):message=isSharedLinkAutoCreated.current?formatMessage(messages.autoCreateCopySuccessNoticeText):formatMessage(messages.autoCopySuccessNoticeText):message=isSharedLinkAutoCreated.current?formatMessage(messages.autoCreateCopyErrorNoticeText):null,message&¬ifications.includes(`auto-copy-shared-link`)&&addNotification({...getNotificationArgs(formatMessage,variant),styledText:message})},[addNotification,formatMessage,isAutoCopyEnabled,isSharedLinkAutoCopied,isSharedLinkAutoCreated,notifications,onSharedLinkCopy,sharedLink]),handleSharedLinkToggleChange=async checked=>{if(checked){await onCreate();return}setView(`remove-shared-link`)},handleSharedLinkSettingsClick=()=>{if(onSharedLinkSettingsClick){onSharedLinkSettingsClick();return}setView(`shared-link-settings`)},sharedLinkToggleTooltip,isSharedLinkToggleDisabled=!1;return!hasSharedLink&&!isSubmitting&&(sharedLinkToggleTooltip=formatMessage(messages.sharedLinkToggleTooltip)),!hasSharedLink&&!permissions.canShare&&(sharedLinkToggleTooltip=formatMessage(messages.createLinkDisabledTooltip),isSharedLinkToggleDisabled=!0),hasSharedLink&&!permissions.canSetShareAccess&&(sharedLinkToggleTooltip=formatMessage(messages.removeLinkDisabledTooltip),isSharedLinkToggleDisabled=!0),jsxs(`div`,{className:shared_link_section_module_default.container,children:[jsx(Text,{as:`label`,variant:`bodyDefaultBold`,children:formatMessage(messages.shareLinkLabel)}),jsxs(`div`,{className:shared_link_section_module_default.toggle,children:[jsx(Tooltip,{align:`start`,content:sharedLinkToggleTooltip,"data-testid":`usm-SharedLinkToggle-tooltip`,open:sharedLinkToggleTooltip?void 0:!1,children:jsx(Focusable,{focusable:isSharedLinkToggleDisabled,children:jsx(Switch.Item,{autoFocus:!permissions.canInviteCollaborator,checked:hasSharedLink,"data-target-id":`Toggle-CreateSharedLink`,disabled:isSharedLinkToggleDisabled||isSubmitting,label:formatMessage(messages.sharedLinkToggleLabel),onCheckedChange:handleSharedLinkToggleChange,value:`shared-link`})})}),hasSharedLink&&!!sharedLink.expiresAt&&jsx(Tooltip,{content:formatMessage(messages.expirationIconTooltip,{expirationDate:formatDateFromTimestampToDateString(sharedLink.expiresAt)}),"data-testid":`usm-SharedLinkExpiration-tooltip`,children:jsx(Status,{color:SurfaceStatusSurfaceRed,hideText:!0,icon:ClockBadge,text:formatMessage(messages.expirationIconLabel)})}),hasSharedLink&&config.sharedLinkSettings&&jsx(Link,{"aria-disabled":isSubmitting,"aria-haspopup":`dialog`,className:shared_link_section_module_default.settings,"data-target-id":`PlainButton-SharedLinkSettings`,onClick:handleSharedLinkSettingsClick,onKeyDown:callOnKeyboardEvent(handleSharedLinkSettingsClick,{canPreventDefault:!0}),role:`button`,tabIndex:isSubmitting?-1:0,variant:`standalone`,children:formatMessage(messages.sharedLinkSettingsLabel)})]}),hasSharedLink&&jsxs(`div`,{className:shared_link_section_module_default.copy,children:[jsx(CopyInput,{ref:copyInputRef,autoFocus:sharedLinkAutoCreate&&isSharedLinkAutoCreated.current&&!isInteracted,"data-target-id":`Button-CopySharedLink`,disabled:isSubmitting,hideLabel:!0,label:formatMessage(messages.sharedLinkUrlLabel),onCopy:handleCopySuccess,value:sharedLink.url}),config.sharedLinkEmail&&jsx(Tooltip,{align:`end`,content:formatMessage(messages.sharedLinkEmailLabel),children:jsx(Button,{"aria-label":formatMessage(messages.sharedLinkEmailLabel),"data-target-id":`Button-SendSharedLink`,disabled:isSubmitting,endIcon:Mail,onClick:()=>setForm(`email`),size:`large`,variant:`secondary`})})]}),hasSharedLink&&(config.sharedLinkAccess||config.sharedLinkPermission)&&jsxs(`div`,{className:shared_link_section_module_default.access,children:[config.sharedLinkAccess&&jsx(SharedLinkAccess,{}),config.sharedLinkPermission&&jsx(SharedLinkPermission,{})]}),hasSharedLink&&jsx(SharedLinkFooter,{onSharedLinkSettingsClick:handleSharedLinkSettingsClick})]})}export{SharedLinkSection as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OTP_MODE}from"../../constants.js";import{useUnifiedShareModalContext}from"../../contexts/unified-share-modal-context.js";import{useAccessLevels}from"../../hooks/use-access-levels.js";import{useSharedLinkSettingsContext}from"../../contexts/shared-link-settings-context.js";import messages from"./messages.js";import{DownloadSection}from"./download-section.js";import{ExpirationSection}from"./expiration-section.js";import{t as OtpSection}from"../../../../chunks/otp-section.js";import{PasswordSection}from"./password-section.js";import{VanitySection}from"./vanity-section.js";import{useMemo}from"react";import{useIntl}from"react-intl";import{InlineNotice,Link,Text}from"@box/blueprint-web";import{Fragment,jsx,jsxs}from"react/jsx-runtime";function SharedLinkSettings(){let{formatMessage}=useIntl(),{eventService,isSubmitting,sharedLink}=useUnifiedShareModalContext(),{settings={},vanityDomain=``}=sharedLink,{canChangeDownload,canChangeExpiration,canChangeOtp,canChangePassword,canChangeVanityName,isDownloadAvailable,isOtpAvailable,isPasswordAvailable,isVanityNameAvailable,otpAllowlistItemCount=0}=settings,{selectedAccess}=useAccessLevels(),{errors,formData,initialFormData,setFieldError,setFieldValue,validatePassword}=useSharedLinkSettingsContext(),accessNoticeMessage=useMemo(()=>{if(!selectedAccess)return null;switch(selectedAccess.id){case`collaborators`:return messages.subtitleCollaborators;case`open`:return formData.isDownloadEnabled?messages.subtitleOpenDownload:messages.subtitleOpenView;case`company`:return formData.isDownloadEnabled?messages.subtitleCompanyDownload:messages.subtitleCompanyView;default:return null}},[formData.isDownloadEnabled,selectedAccess]),handleExpirationToggle=nextChecked=>{setFieldError(`expiration`,void 0),setFieldValue(`isExpirationEnabled`,nextChecked)},handleExpirationChange=value=>{setFieldError(`expiration`,void 0),setFieldValue(`expiration`,value)},handleVanityToggle=nextChecked=>{setFieldError(`vanityName`,void 0),setFieldValue(`isVanityNameEnabled`,nextChecked)},handleVanityNameChange=event=>{setFieldError(`vanityName`,void 0),setFieldValue(`vanityName`,event.target.value)},isOtpSectionVisible=!!isOtpAvailable&&selectedAccess?.id===`open`,isPasswordSectionVisible=!!isPasswordAvailable&&selectedAccess?.id===`open`,canTogglePassword=!!canChangePassword&&!(formData.isOtpEnabled&&!canChangeOtp),canToggleOtp=!!canChangeOtp&&!(formData.isPasswordEnabled&&!canChangePassword),handlePasswordToggle=nextChecked=>{setFieldError(`password`,void 0),setFieldValue(`isPasswordEnabled`,nextChecked),nextChecked&&isOtpSectionVisible&&canChangeOtp&&setFieldValue(`isOtpEnabled`,!1)},handleOtpToggle=nextChecked=>{setFieldValue(`isOtpEnabled`,nextChecked),nextChecked&&formData.otpMode===OTP_MODE.NONE&&setFieldValue(`otpMode`,OTP_MODE.OPEN),nextChecked&&isPasswordSectionVisible&&canChangePassword&&(setFieldValue(`isPasswordEnabled`,!1),setFieldValue(`password`,``),setFieldError(`password`,void 0))},handleOtpModeChange=mode=>{setFieldValue(`otpMode`,mode)},handlePasswordChange=event=>{setFieldError(`password`,void 0),setFieldValue(`password`,event.target.value)},handleDownloadToggle=nextChecked=>{setFieldValue(`isDownloadEnabled`,nextChecked)},handlePasswordBlur=event=>{let isSubmitFocused=document.getElementById(`usm-SharedLinkSettingsModal-primaryButton`)?.contains(event.relatedTarget);initialFormData.isPasswordEnabled&&!formData.password||isSubmitFocused||validatePassword(formData.password)},canChangeAllSettings=canChangeDownload&&canChangeExpiration&&(!isOtpSectionVisible||canChangeOtp)&&(!isPasswordSectionVisible||canChangePassword)&&canChangeVanityName,passwordSection=jsx(PasswordSection,{canChange:canTogglePassword,error:errors.password,isAvailable:isPasswordSectionVisible,isChecked:formData.isPasswordEnabled,isDefaultChecked:initialFormData.isPasswordEnabled,isDisabled:isSubmitting,onBlur:handlePasswordBlur,onChange:handlePasswordChange,onFocus:()=>setFieldError(`password`,void 0),onToggle:handlePasswordToggle,password:formData.password});return jsxs(Fragment,{children:[!canChangeAllSettings&&jsx(InlineNotice,{variant:`warning`,variantIconAriaLabel:formatMessage(messages.warningNoticeIconAriaLabel),children:formatMessage(messages.inaccessibleSettingsNotice)}),accessNoticeMessage&&jsx(Text,{as:`p`,color:`textOnLightSecondary`,children:formatMessage(accessNoticeMessage,{learnSharedLinkSettingsLink:jsx(Link,{href:`https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings`,rel:`noreferrer`,target:`_blank`,children:formatMessage(messages.learnSharedLinkSettingsLink)})})}),jsx(ExpirationSection,{canChange:!!canChangeExpiration,error:errors.expiration,expiration:formData.expiration,isChecked:formData.isExpirationEnabled,isDisabled:isSubmitting,onChange:handleExpirationChange,onToggle:handleExpirationToggle}),jsx(OtpSection,{allowlistItemCount:otpAllowlistItemCount,canChange:canToggleOtp,isAvailable:isOtpSectionVisible,isChecked:formData.isOtpEnabled,isDisabled:isSubmitting,
|
|
1
|
+
import{OTP_MODE}from"../../constants.js";import{useUnifiedShareModalContext}from"../../contexts/unified-share-modal-context.js";import{useAccessLevels}from"../../hooks/use-access-levels.js";import{useSharedLinkSettingsContext}from"../../contexts/shared-link-settings-context.js";import messages from"./messages.js";import{DownloadSection}from"./download-section.js";import{ExpirationSection}from"./expiration-section.js";import{t as OtpSection}from"../../../../chunks/otp-section.js";import{PasswordSection}from"./password-section.js";import{VanitySection}from"./vanity-section.js";import{useMemo}from"react";import{useIntl}from"react-intl";import{InlineNotice,Link,Text}from"@box/blueprint-web";import{Fragment,jsx,jsxs}from"react/jsx-runtime";function SharedLinkSettings(){let{formatMessage}=useIntl(),{eventService,isSubmitting,sharedLink}=useUnifiedShareModalContext(),{settings={},vanityDomain=``}=sharedLink,{canChangeDownload,canChangeExpiration,canChangeOtp,canChangePassword,canChangeVanityName,isDownloadAvailable,isOtpAvailable,isPasswordAvailable,isVanityNameAvailable,otpAllowlistItemCount=0}=settings,{onOtpAllowlistConfigure}=eventService,{selectedAccess}=useAccessLevels(),{errors,formData,initialFormData,setFieldError,setFieldValue,validatePassword}=useSharedLinkSettingsContext(),accessNoticeMessage=useMemo(()=>{if(!selectedAccess)return null;switch(selectedAccess.id){case`collaborators`:return messages.subtitleCollaborators;case`open`:return formData.isDownloadEnabled?messages.subtitleOpenDownload:messages.subtitleOpenView;case`company`:return formData.isDownloadEnabled?messages.subtitleCompanyDownload:messages.subtitleCompanyView;default:return null}},[formData.isDownloadEnabled,selectedAccess]),handleExpirationToggle=nextChecked=>{setFieldError(`expiration`,void 0),setFieldValue(`isExpirationEnabled`,nextChecked)},handleExpirationChange=value=>{setFieldError(`expiration`,void 0),setFieldValue(`expiration`,value)},handleVanityToggle=nextChecked=>{setFieldError(`vanityName`,void 0),setFieldValue(`isVanityNameEnabled`,nextChecked)},handleVanityNameChange=event=>{setFieldError(`vanityName`,void 0),setFieldValue(`vanityName`,event.target.value)},isOtpSectionVisible=!!isOtpAvailable&&selectedAccess?.id===`open`,isPasswordSectionVisible=!!isPasswordAvailable&&selectedAccess?.id===`open`,canTogglePassword=!!canChangePassword&&!(formData.isOtpEnabled&&!canChangeOtp),canToggleOtp=!!canChangeOtp&&!(formData.isPasswordEnabled&&!canChangePassword),handlePasswordToggle=nextChecked=>{setFieldError(`password`,void 0),setFieldValue(`isPasswordEnabled`,nextChecked),nextChecked&&isOtpSectionVisible&&canChangeOtp&&setFieldValue(`isOtpEnabled`,!1)},handleOtpToggle=nextChecked=>{setFieldValue(`isOtpEnabled`,nextChecked),nextChecked&&formData.otpMode===OTP_MODE.NONE&&setFieldValue(`otpMode`,OTP_MODE.OPEN),nextChecked&&isPasswordSectionVisible&&canChangePassword&&(setFieldValue(`isPasswordEnabled`,!1),setFieldValue(`password`,``),setFieldError(`password`,void 0))},handleOtpModeChange=mode=>{setFieldValue(`otpMode`,mode)},handlePasswordChange=event=>{setFieldError(`password`,void 0),setFieldValue(`password`,event.target.value)},handleDownloadToggle=nextChecked=>{setFieldValue(`isDownloadEnabled`,nextChecked)},handlePasswordBlur=event=>{let isSubmitFocused=document.getElementById(`usm-SharedLinkSettingsModal-primaryButton`)?.contains(event.relatedTarget);initialFormData.isPasswordEnabled&&!formData.password||isSubmitFocused||validatePassword(formData.password)},canChangeAllSettings=canChangeDownload&&canChangeExpiration&&(!isOtpSectionVisible||canChangeOtp)&&(!isPasswordSectionVisible||canChangePassword)&&canChangeVanityName,passwordSection=jsx(PasswordSection,{canChange:canTogglePassword,error:errors.password,isAvailable:isPasswordSectionVisible,isChecked:formData.isPasswordEnabled,isDefaultChecked:initialFormData.isPasswordEnabled,isDisabled:isSubmitting,onBlur:handlePasswordBlur,onChange:handlePasswordChange,onFocus:()=>setFieldError(`password`,void 0),onToggle:handlePasswordToggle,password:formData.password});return jsxs(Fragment,{children:[!canChangeAllSettings&&jsx(InlineNotice,{variant:`warning`,variantIconAriaLabel:formatMessage(messages.warningNoticeIconAriaLabel),children:formatMessage(messages.inaccessibleSettingsNotice)}),accessNoticeMessage&&jsx(Text,{as:`p`,color:`textOnLightSecondary`,children:formatMessage(accessNoticeMessage,{learnSharedLinkSettingsLink:jsx(Link,{href:`https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings`,rel:`noreferrer`,target:`_blank`,children:formatMessage(messages.learnSharedLinkSettingsLink)})})}),jsx(ExpirationSection,{canChange:!!canChangeExpiration,error:errors.expiration,expiration:formData.expiration,isChecked:formData.isExpirationEnabled,isDisabled:isSubmitting,onChange:handleExpirationChange,onToggle:handleExpirationToggle}),jsx(OtpSection,{allowlistItemCount:otpAllowlistItemCount,canChange:canToggleOtp,isAvailable:isOtpSectionVisible,isChecked:formData.isOtpEnabled,isDisabled:isSubmitting,onConfigureClick:onOtpAllowlistConfigure,onModeChange:handleOtpModeChange,onToggle:handleOtpToggle,otpMode:formData.otpMode}),!isOtpAvailable&&passwordSection,jsx(VanitySection,{canChange:!!canChangeVanityName,error:errors.vanityName,isAvailable:!!isVanityNameAvailable,isChecked:formData.isVanityNameEnabled,isDisabled:isSubmitting,onChange:handleVanityNameChange,onToggle:handleVanityToggle,vanityDomain,vanityName:formData.vanityName}),jsx(DownloadSection,{canChange:!!canChangeDownload,isAvailable:!!isDownloadAvailable,isChecked:formData.isDownloadEnabled,isDisabled:isSubmitting,onToggle:handleDownloadToggle}),isOtpAvailable&&passwordSection]})}export{SharedLinkSettings};
|
|
@@ -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.`},sharedLinkOtpOffPrompt:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpOffPrompt`,defaultMessage:`This content is publicly available to anyone with the link. Protect this link with a One-Time Passcode. {enableLink}`},sharedLinkOtpOpen:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpOpen`,defaultMessage:`Access is allowed after verifying the One-Time Passcode.`},sharedLinkOtpAccessListCount:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpAccessListCount`,defaultMessage:`{count, plural, one {# item} other {# items}} on the Access List. {configureLink}`},sharedLinkOtpAccessList:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpAccessList`,defaultMessage:`Access is allowed for people on the Access List after verifying the One-Time Passcode. {configureLink}`},sharedLinkEnableOtp:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkEnableOtp`,defaultMessage:`Enable`},sharedLinkConfigureAccessList:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkConfigureAccessList`,defaultMessage:`Configure`},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`},
|
|
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.`},sharedLinkOtpOffPrompt:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpOffPrompt`,defaultMessage:`This content is publicly available to anyone with the link. Protect this link with a One-Time Passcode. {enableLink}`},sharedLinkOtpOpen:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpOpen`,defaultMessage:`Access is allowed after verifying the One-Time Passcode.`},sharedLinkOtpAccessListCount:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpAccessListCount`,defaultMessage:`{count, plural, one {# item} other {# items}} on the Access List. {configureLink}`},sharedLinkOtpAccessList:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkOtpAccessList`,defaultMessage:`Access is allowed for people on the Access List after verifying the One-Time Passcode. {configureLink}`},sharedLinkEnableOtp:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkEnableOtp`,defaultMessage:`Enable`},sharedLinkConfigureAccessList:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.sharedLinkConfigureAccessList`,defaultMessage:`Configure`},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`},openOtpAccessLevelLabel:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.openOtpAccessLevelLabel`,defaultMessage:`Authorized people`},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.`},copyWithEmptyAllowlistNotice:{id:`groupSharedFeatures.usm.unifiedShareFormModal.sharedLinkSection.copyWithEmptyAllowlistNotice`,defaultMessage:`Link copied. Consider adding recipients to the access list.`}});export{messages as default};
|
|
File without changes
|
|
@@ -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,isOtpOn=!1)=>{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=isOtpOn?messages.
|
|
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,isOtpOn=!1)=>{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=isOtpOn?messages.openOtpAccessLevelLabel: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,settings}=sharedLink,isOtpOn=access===`open`&&!!settings?.otpMode&&settings.otpMode!==`none`,allowedLevels=useMemo(()=>getAllowedAccessLevels(accessLevels).map(level=>({...level,description:getAccessLevelDescription(formatMessage,level,enterpriseName,itemType),label:getAccessLevelLabel(formatMessage,level,enterpriseName,isOtpOn)})),[accessLevels,enterpriseName,formatMessage,itemType,isOtpOn]);return{allowedLevels,selectedAccess:useMemo(()=>allowedLevels.find(({id})=>access===id),[access,allowedLevels])}};export{useAccessLevels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useUnifiedShareModalContext}from"../contexts/unified-share-modal-context.js";import{getNotificationArgs,getNotificationMessage}from"../utils/notification.js";import{useCallback,useMemo}from"react";import{useIntl}from"react-intl";import{useNotification}from"@box/blueprint-web";var useSharingAction=(action,notification)=>{let{formatMessage}=useIntl(),{addNotification}=useNotification(),{config,item,setIsLoading}=useUnifiedShareModalContext(),{notifications}=config,{name:itemName}=item,isNotificationEnabled=useMemo(()=>notifications.includes(notification),[notification,notifications]);return{onAction:useCallback(async(...args)=>{setIsLoading(!0);try{if(action){let
|
|
1
|
+
import{useUnifiedShareModalContext}from"../contexts/unified-share-modal-context.js";import{getNotificationArgs,getNotificationMessage}from"../utils/notification.js";import{useCallback,useMemo}from"react";import{useIntl}from"react-intl";import{useNotification}from"@box/blueprint-web";var useSharingAction=(action,notification)=>{let{formatMessage}=useIntl(),{addNotification}=useNotification(),{config,item,setIsLoading}=useUnifiedShareModalContext(),{notifications=[]}=config,{name:itemName}=item,isNotificationEnabled=useMemo(()=>notifications.includes(notification),[notification,notifications]);return{onAction:useCallback(async(...args)=>{setIsLoading(!0);try{if(action){let{messages:customMessages}=await action(...args)??{},successMessage=getNotificationMessage(formatMessage,`success`,notification,{itemName});customMessages?customMessages.forEach(({text,type,...options})=>{addNotification({...getNotificationArgs(formatMessage,type),styledText:text,...options})}):isNotificationEnabled&&successMessage&&addNotification({...getNotificationArgs(formatMessage,`success`),styledText:successMessage})}}catch(_error){let error=_error,errorMessage=getNotificationMessage(formatMessage,`error`,notification);if(isNotificationEnabled&&errorMessage&&addNotification({...getNotificationArgs(formatMessage,`error`),styledText:errorMessage}),error?.fields&&Object.values(error.fields).length)throw error.fields}finally{setIsLoading(!1)}},[action,addNotification,formatMessage,isNotificationEnabled,itemName,notification,setIsLoading])}};export{useSharingAction};
|
|
@@ -5,9 +5,9 @@ export interface OtpSectionProps {
|
|
|
5
5
|
isAvailable: boolean;
|
|
6
6
|
isChecked: boolean;
|
|
7
7
|
isDisabled: boolean;
|
|
8
|
-
|
|
8
|
+
onConfigureClick: () => void;
|
|
9
9
|
onModeChange: (mode: OtpAccessType) => void;
|
|
10
10
|
onToggle: (checked: boolean) => void;
|
|
11
11
|
otpMode: OtpAccessType;
|
|
12
12
|
}
|
|
13
|
-
export declare function OtpSection({ allowlistItemCount, canChange, isAvailable, isChecked, isDisabled,
|
|
13
|
+
export declare function OtpSection({ allowlistItemCount, canChange, isAvailable, isChecked, isDisabled, onConfigureClick, onModeChange, onToggle, otpMode, }: OtpSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NotificationType, SharingService } from '../types';
|
|
2
|
-
type SharingAction = (...args: unknown[]) => ReturnType<SharingService[keyof SharingService]
|
|
2
|
+
type SharingAction = (...args: unknown[]) => ReturnType<NonNullable<SharingService[keyof SharingService]>>;
|
|
3
3
|
export declare const useSharingAction: (action?: SharingAction, notification?: NotificationType) => {
|
|
4
4
|
onAction: (...args: Parameters<SharingAction>) => Promise<void>;
|
|
5
5
|
};
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl';
|
|
1
2
|
import { DatePickerProps, ModalContentProps } from '@box/blueprint-web';
|
|
2
3
|
import { FetchedAvatarUrls, UserContactType } from '@box/user-selector';
|
|
3
4
|
/**
|
|
4
5
|
* The date value type returned from the DatePicker component.
|
|
5
6
|
*/
|
|
6
|
-
export type DateValue = Parameters<DatePickerProps['onChange']
|
|
7
|
+
export type DateValue = Parameters<NonNullable<DatePickerProps['onChange']>>[0];
|
|
8
|
+
/**
|
|
9
|
+
* The react-intl function used to localize strings.
|
|
10
|
+
*/
|
|
11
|
+
export type FormatMessage = IntlShape['formatMessage'];
|
|
12
|
+
/**
|
|
13
|
+
* Interpolation values passed to {@link FormatMessage}.
|
|
14
|
+
*/
|
|
15
|
+
export type FormatMessageValues = Parameters<FormatMessage>[1];
|
|
7
16
|
/**
|
|
8
17
|
* Variants of the Unified Share Modal.
|
|
9
18
|
*/
|
|
10
19
|
export type VariantType = 'desktop' | 'modal';
|
|
11
20
|
/**
|
|
12
21
|
* View states in the Unified Share Modal.
|
|
13
|
-
*
|
|
14
|
-
* - `unified-share-form` - The sharing form where users can invite collaborators and manage shared links
|
|
15
|
-
* - `shared-link-settings` - A focused view for configuring the shared link settings and permissions
|
|
16
|
-
* - `remove-shared-link` - A confirmation view for removing an existing shared link
|
|
17
|
-
* - `remove-collaborator` - A confirmation view for removing an existing collaborator
|
|
18
22
|
*/
|
|
19
|
-
export type ViewType = 'unified-share-form' | 'shared-link-settings' | 'remove-shared-link' | 'remove-collaborator';
|
|
23
|
+
export type ViewType = 'unified-share-form' | 'shared-link-settings' | 'remove-shared-link' | 'remove-collaborator' | 'manage-access-list';
|
|
20
24
|
/**
|
|
21
25
|
* Form states in the Unified Share Modal.
|
|
22
26
|
*/
|
|
@@ -402,8 +406,7 @@ export interface EventService {
|
|
|
402
406
|
/**
|
|
403
407
|
* Function to open the Manage Access List modal.
|
|
404
408
|
*
|
|
405
|
-
*
|
|
406
|
-
* not rendered.
|
|
409
|
+
* If provided, the default behavior is disabled and the built-in modal will not be opened.
|
|
407
410
|
*/
|
|
408
411
|
onOtpAllowlistConfigure?: () => void;
|
|
409
412
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { NotificationType, NotificationVariant } from '../types';
|
|
2
|
-
declare const getNotificationArgs: (formatMessage:
|
|
3
|
-
closeButtonAriaLabel:
|
|
1
|
+
import { FormatMessage, FormatMessageValues, NotificationType, NotificationVariant } from '../types';
|
|
2
|
+
declare const getNotificationArgs: (formatMessage: FormatMessage, type: NotificationVariant) => {
|
|
3
|
+
closeButtonAriaLabel: string;
|
|
4
4
|
sensitivity: "foreground";
|
|
5
5
|
style: {
|
|
6
6
|
pointerEvents: "auto";
|
|
7
7
|
};
|
|
8
|
-
typeIconAriaLabel:
|
|
8
|
+
typeIconAriaLabel: string;
|
|
9
9
|
variant: NotificationVariant;
|
|
10
10
|
};
|
|
11
|
-
declare const getNotificationMessage: (formatMessage:
|
|
11
|
+
declare const getNotificationMessage: (formatMessage: FormatMessage, type: "success" | "error", notification?: NotificationType, values?: FormatMessageValues) => string | import('react').ReactNode[];
|
|
12
12
|
export { getNotificationArgs, getNotificationMessage };
|