@box/unified-share-modal 3.1.37 → 3.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/chunks/classification-status.js +1 -62
  2. package/dist/chunks/collaboration-role.js +1 -89
  3. package/dist/chunks/collaboration-section.js +1 -159
  4. package/dist/chunks/collaborator-list-item.js +1 -61
  5. package/dist/chunks/collaborator-list.js +1 -74
  6. package/dist/chunks/remove-collaborator-modal.js +1 -61
  7. package/dist/chunks/remove-shared-link-modal.js +1 -56
  8. package/dist/chunks/shared-link-access.js +1 -65
  9. package/dist/chunks/shared-link-permission.js +1 -67
  10. package/dist/chunks/shared-link-section.js +1 -184
  11. package/dist/chunks/shared-link-settings-modal.js +1 -86
  12. package/dist/chunks/shared-with-avatars.js +1 -48
  13. package/dist/chunks/shield-restriction-notice.js +1 -97
  14. package/dist/chunks/text-area-container.js +1 -36
  15. package/dist/chunks/unified-share-form-modal.js +1 -67
  16. package/dist/chunks/unified-share-form.js +1 -23
  17. package/dist/esm/index.js +1 -2
  18. package/dist/esm/lib/components/classification-status/classification-status.js +1 -2
  19. package/dist/esm/lib/components/classification-status/index.js +1 -2
  20. package/dist/esm/lib/components/classification-status/messages.js +1 -12
  21. package/dist/esm/lib/components/index.js +1 -5
  22. package/dist/esm/lib/components/remove-collaborator-modal/index.js +1 -2
  23. package/dist/esm/lib/components/remove-collaborator-modal/messages.js +1 -28
  24. package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +1 -2
  25. package/dist/esm/lib/components/remove-shared-link-modal/index.js +1 -2
  26. package/dist/esm/lib/components/remove-shared-link-modal/messages.js +1 -28
  27. package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +1 -2
  28. package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +1 -36
  29. package/dist/esm/lib/components/shared-link-settings-modal/expiration-section.js +1 -34
  30. package/dist/esm/lib/components/shared-link-settings-modal/index.js +1 -2
  31. package/dist/esm/lib/components/shared-link-settings-modal/messages.js +1 -140
  32. package/dist/esm/lib/components/shared-link-settings-modal/password-section.js +1 -33
  33. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +1 -2
  34. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +1 -98
  35. package/dist/esm/lib/components/shared-link-settings-modal/vanity-section.js +1 -34
  36. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +1 -2
  37. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +1 -2
  38. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/index.js +1 -2
  39. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +1 -136
  40. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +1 -2
  41. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +1 -2
  42. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +1 -2
  43. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +1 -49
  44. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +1 -2
  45. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +1 -2
  46. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/index.js +1 -2
  47. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/messages.js +1 -40
  48. package/dist/esm/lib/components/unified-share-form-modal/index.js +1 -2
  49. package/dist/esm/lib/components/unified-share-form-modal/messages.js +1 -48
  50. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/index.js +1 -2
  51. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +1 -144
  52. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +1 -2
  53. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +1 -2
  54. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +1 -2
  55. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +1 -2
  56. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +1 -2
  57. package/dist/esm/lib/constants.js +1 -47
  58. package/dist/esm/lib/contexts/index.js +1 -4
  59. package/dist/esm/lib/contexts/shared-link-settings-context.js +1 -51
  60. package/dist/esm/lib/contexts/unified-share-form-context.js +1 -61
  61. package/dist/esm/lib/contexts/unified-share-modal-context.js +1 -70
  62. package/dist/esm/lib/hooks/index.js +1 -7
  63. package/dist/esm/lib/hooks/use-access-levels.js +1 -70
  64. package/dist/esm/lib/hooks/use-collaboration-form.js +1 -76
  65. package/dist/esm/lib/hooks/use-form-validation.js +1 -33
  66. package/dist/esm/lib/hooks/use-link-settings-form.js +1 -50
  67. package/dist/esm/lib/hooks/use-permission-levels.js +1 -34
  68. package/dist/esm/lib/hooks/use-sharing-action.js +1 -45
  69. package/dist/esm/lib/messages.js +1 -108
  70. package/dist/esm/lib/unified-share-base.js +1 -31
  71. package/dist/esm/lib/unified-share-modal.js +1 -44
  72. package/dist/esm/lib/utils/collaborator.js +1 -12
  73. package/dist/esm/lib/utils/date.js +1 -10
  74. package/dist/esm/lib/utils/email.js +1 -6
  75. package/dist/esm/lib/utils/event.js +1 -7
  76. package/dist/esm/lib/utils/form.js +1 -5
  77. package/dist/esm/lib/utils/index.js +1 -9
  78. package/dist/esm/lib/utils/notification.js +1 -20
  79. package/dist/esm/lib/utils/permission.js +1 -16
  80. package/dist/esm/lib/utils/validation.js +1 -2
  81. package/package.json +10 -10
@@ -1,67 +1 @@
1
- import { useUnifiedShareModalContext as e } from "../esm/lib/contexts/unified-share-modal-context.js";
2
- import { useUnifiedShareFormContext as t } from "../esm/lib/contexts/unified-share-form-context.js";
3
- import { t as n } from "./classification-status.js";
4
- import r from "../esm/lib/components/unified-share-form-modal/messages.js";
5
- import { t as i } from "./collaborator-list.js";
6
- import { t as a } from "./unified-share-form.js";
7
- import { useCallback as o } from "react";
8
- import s from "clsx";
9
- import { useIntl as c } from "react-intl";
10
- import { LoadingIndicator as l, Modal as u } from "@box/blueprint-web";
11
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
- import '../styles/unified-share-form-modal.css';var p = {
13
- content: "_content_1p1s8_1",
14
- isFullscreen: "_isFullscreen_1p1s8_4",
15
- body: "_body_1p1s8_13",
16
- title: "_title_1p1s8_17",
17
- hasFooter: "_hasFooter_1p1s8_39",
18
- loading: "_loading_1p1s8_43",
19
- form: "_form_1p1s8_51",
20
- isLoading: "_isLoading_1p1s8_56"
21
- };
22
- function m({ children: m, isOpen: h, onOpenChange: g }) {
23
- let { formatMessage: _ } = c(), { form: v, isCollaboratorsOpen: y, setContainerRef: b, setForm: x } = t(), { eventService: S, isFetching: C, isSubmitting: w, item: T, variant: E } = e(), { onCloseAutoFocus: D } = S, { name: O } = T, k = E === "desktop", A = v === "default" && !y;
24
- return /* @__PURE__ */ f(u, {
25
- onOpenChange: o((e) => {
26
- w || (x("default"), g(e));
27
- }, [
28
- w,
29
- g,
30
- x
31
- ]),
32
- open: h,
33
- children: [!!m && /* @__PURE__ */ d(u.Trigger, { children: m }), /* @__PURE__ */ f(u.Content, {
34
- ref: b,
35
- className: s(p.content, k && p.isFullscreen),
36
- onCloseAutoFocus: D,
37
- onPointerDownOutside: (e) => {
38
- e.preventDefault();
39
- },
40
- size: "medium",
41
- children: [
42
- /* @__PURE__ */ f(u.Header, { children: [/* @__PURE__ */ d("div", {
43
- className: p.title,
44
- children: _(r.title, { itemName: O })
45
- }), /* @__PURE__ */ d(n, {})] }),
46
- /* @__PURE__ */ f(u.Body, {
47
- className: s(p.body, !A && p.hasFooter),
48
- children: [C && /* @__PURE__ */ d("div", {
49
- className: p.loading,
50
- children: /* @__PURE__ */ d(l, {
51
- "aria-label": _(r.loadingLabel),
52
- size: "large"
53
- })
54
- }), /* @__PURE__ */ d("div", {
55
- className: s(p.form, C && p.isLoading),
56
- children: d(y ? i : a, {})
57
- })]
58
- }),
59
- !k && A && /* @__PURE__ */ d(u.Close, {
60
- "aria-label": _(r.closeButton),
61
- disabled: w
62
- })
63
- ]
64
- })]
65
- });
66
- }
67
- export { m as t };
1
+ import{useUnifiedShareModalContext}from"../esm/lib/contexts/unified-share-modal-context.js";import{useUnifiedShareFormContext}from"../esm/lib/contexts/unified-share-form-context.js";import{t as ClassificationStatus}from"./classification-status.js";import messages from"../esm/lib/components/unified-share-form-modal/messages.js";import{t as CollaboratorList}from"./collaborator-list.js";import{t as UnifiedShareForm}from"./unified-share-form.js";import{useCallback}from"react";import clsx from"clsx";import{useIntl}from"react-intl";import{LoadingIndicator,Modal}from"@box/blueprint-web";import{jsx,jsxs}from"react/jsx-runtime";import '../styles/unified-share-form-modal.css';var unified_share_form_modal_module_default={content:`_content_1p1s8_1`,isFullscreen:`_isFullscreen_1p1s8_4`,body:`_body_1p1s8_13`,title:`_title_1p1s8_17`,hasFooter:`_hasFooter_1p1s8_39`,loading:`_loading_1p1s8_43`,form:`_form_1p1s8_51`,isLoading:`_isLoading_1p1s8_56`};function UnifiedShareFormModal({children,isOpen,onOpenChange}){let{formatMessage}=useIntl(),{form,isCollaboratorsOpen,setContainerRef,setForm}=useUnifiedShareFormContext(),{eventService,isFetching,isSubmitting,item,variant}=useUnifiedShareModalContext(),{onCloseAutoFocus}=eventService,{name:itemName}=item,isDesktop=variant===`desktop`,isDefaultForm=form==="default"&&!isCollaboratorsOpen;return jsxs(Modal,{onOpenChange:useCallback(open=>{isSubmitting||(setForm(`default`),onOpenChange(open))},[isSubmitting,onOpenChange,setForm]),open:isOpen,children:[!!children&&jsx(Modal.Trigger,{children}),jsxs(Modal.Content,{ref:setContainerRef,className:clsx(unified_share_form_modal_module_default.content,isDesktop&&unified_share_form_modal_module_default.isFullscreen),onCloseAutoFocus,onPointerDownOutside:event=>{event.preventDefault()},size:`medium`,children:[jsxs(Modal.Header,{children:[jsx(`div`,{className:unified_share_form_modal_module_default.title,children:formatMessage(messages.title,{itemName})}),jsx(ClassificationStatus,{})]}),jsxs(Modal.Body,{className:clsx(unified_share_form_modal_module_default.body,!isDefaultForm&&unified_share_form_modal_module_default.hasFooter),children:[isFetching&&jsx(`div`,{className:unified_share_form_modal_module_default.loading,children:jsx(LoadingIndicator,{"aria-label":formatMessage(messages.loadingLabel),size:`large`})}),jsx(`div`,{className:clsx(unified_share_form_modal_module_default.form,isFetching&&unified_share_form_modal_module_default.isLoading),children:jsx(isCollaboratorsOpen?CollaboratorList:UnifiedShareForm,{})})]}),!isDesktop&&isDefaultForm&&jsx(Modal.Close,{"aria-label":formatMessage(messages.closeButton),disabled:isSubmitting})]})]})}export{UnifiedShareFormModal as t};
@@ -1,23 +1 @@
1
- import { useUnifiedShareModalContext as e } from "../esm/lib/contexts/unified-share-modal-context.js";
2
- import { useUnifiedShareFormContext as t } from "../esm/lib/contexts/unified-share-form-context.js";
3
- import { t as n } from "./collaboration-section.js";
4
- import { t as r } from "./shared-link-section.js";
5
- import { Divider as i } from "@box/blueprint-web";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import '../styles/unified-share-form.css';var s = {
8
- container: "_container_rq40p_1",
9
- divider: "_divider_rq40p_6"
10
- };
11
- function c() {
12
- let { config: c, variant: l } = e(), { form: u } = t(), d = l === "desktop", f = u === "default", p = c.collaboration, m = c.sharedLink && f;
13
- return /* @__PURE__ */ o("div", {
14
- className: s.container,
15
- children: [
16
- d && /* @__PURE__ */ a(i, { className: s.divider }),
17
- p && /* @__PURE__ */ a(n, {}),
18
- p && m && /* @__PURE__ */ a(i, { className: s.divider }),
19
- m && /* @__PURE__ */ a(r, {})
20
- ]
21
- });
22
- }
23
- export { c as t };
1
+ import{useUnifiedShareModalContext}from"../esm/lib/contexts/unified-share-modal-context.js";import{useUnifiedShareFormContext}from"../esm/lib/contexts/unified-share-form-context.js";import{t as CollaborationSection}from"./collaboration-section.js";import{t as SharedLinkSection}from"./shared-link-section.js";import{Divider}from"@box/blueprint-web";import{jsx,jsxs}from"react/jsx-runtime";import '../styles/unified-share-form.css';var unified_share_form_module_default={container:`_container_rq40p_1`,divider:`_divider_rq40p_6`};function UnifiedShareForm(){let{config,variant}=useUnifiedShareModalContext(),{form}=useUnifiedShareFormContext(),isDesktop=variant===`desktop`,isDefaultForm=form==="default",hasCollaborationSection=config.collaboration,hasSharedLinkSection=config.sharedLink&&isDefaultForm;return jsxs(`div`,{className:unified_share_form_module_default.container,children:[isDesktop&&jsx(Divider,{className:unified_share_form_module_default.divider}),hasCollaborationSection&&jsx(CollaborationSection,{}),hasCollaborationSection&&hasSharedLinkSection&&jsx(Divider,{className:unified_share_form_module_default.divider}),hasSharedLinkSection&&jsx(SharedLinkSection,{})]})}export{UnifiedShareForm as t};
package/dist/esm/index.js CHANGED
@@ -1,2 +1 @@
1
- import { UnifiedShareModal as e } from "./lib/unified-share-modal.js";
2
- export { e as UnifiedShareModal };
1
+ import{UnifiedShareModal}from"./lib/unified-share-modal.js";export{UnifiedShareModal};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/classification-status.js";
2
- export { e as ClassificationStatus };
1
+ import{t as ClassificationStatus}from"../../../../chunks/classification-status.js";export{ClassificationStatus};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/classification-status.js";
2
- export { e as ClassificationStatus };
1
+ import{t as ClassificationStatus}from"../../../../chunks/classification-status.js";export{ClassificationStatus};
@@ -1,12 +1 @@
1
- import { defineMessages as e } from "react-intl";
2
- var t = e({
3
- definitionLabel: {
4
- id: "groupSharedFeatures.usm.classificationStatus.definitionLabel",
5
- defaultMessage: "Definition"
6
- },
7
- restrictionsLabel: {
8
- id: "groupSharedFeatures.usm.classificationStatus.restrictionsLabel",
9
- defaultMessage: "Restrictions"
10
- }
11
- });
12
- export { t as default };
1
+ import{defineMessages}from"react-intl";var messages=defineMessages({definitionLabel:{id:`groupSharedFeatures.usm.classificationStatus.definitionLabel`,defaultMessage:`Definition`},restrictionsLabel:{id:`groupSharedFeatures.usm.classificationStatus.restrictionsLabel`,defaultMessage:`Restrictions`}});export{messages as default};
@@ -1,5 +1 @@
1
- import { t as e } from "../../../chunks/remove-collaborator-modal.js";
2
- import { t } from "../../../chunks/remove-shared-link-modal.js";
3
- import { t as n } from "../../../chunks/shared-link-settings-modal.js";
4
- import { t as r } from "../../../chunks/unified-share-form-modal.js";
5
- export { e as RemoveCollaboratorModal, t as RemoveSharedLinkModal, n as SharedLinkSettingsModal, r as UnifiedShareFormModal };
1
+ import{t as RemoveCollaboratorModal}from"../../../chunks/remove-collaborator-modal.js";import{t as RemoveSharedLinkModal}from"../../../chunks/remove-shared-link-modal.js";import{t as SharedLinkSettingsModal}from"../../../chunks/shared-link-settings-modal.js";import{t as UnifiedShareFormModal}from"../../../chunks/unified-share-form-modal.js";export{RemoveCollaboratorModal,RemoveSharedLinkModal,SharedLinkSettingsModal,UnifiedShareFormModal};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/remove-collaborator-modal.js";
2
- export { e as RemoveCollaboratorModal };
1
+ import{t as RemoveCollaboratorModal}from"../../../../chunks/remove-collaborator-modal.js";export{RemoveCollaboratorModal};
@@ -1,28 +1 @@
1
- import { defineMessages as e } from "react-intl";
2
- var t = e({
3
- title: {
4
- id: "groupSharedFeatures.usm.removeCollaboratorModal.title",
5
- defaultMessage: "Remove Collaborator"
6
- },
7
- bodyText: {
8
- id: "groupSharedFeatures.usm.removeCollaboratorModal.bodyText",
9
- defaultMessage: "Are you sure you want to remove {name} as a collaborator?"
10
- },
11
- cancelButton: {
12
- id: "groupSharedFeatures.usm.removeCollaboratorModal.cancelButton",
13
- defaultMessage: "Cancel"
14
- },
15
- closeButton: {
16
- id: "groupSharedFeatures.usm.removeCollaboratorModal.closeButton",
17
- defaultMessage: "Close"
18
- },
19
- loadingLabel: {
20
- id: "groupSharedFeatures.usm.removeCollaboratorModal.loadingLabel",
21
- defaultMessage: "Loading"
22
- },
23
- okayButton: {
24
- id: "groupSharedFeatures.usm.removeCollaboratorModal.okayButton",
25
- defaultMessage: "Okay"
26
- }
27
- });
28
- export { t as default };
1
+ import{defineMessages}from"react-intl";var messages=defineMessages({title:{id:`groupSharedFeatures.usm.removeCollaboratorModal.title`,defaultMessage:`Remove Collaborator`},bodyText:{id:`groupSharedFeatures.usm.removeCollaboratorModal.bodyText`,defaultMessage:`Are you sure you want to remove {name} as a collaborator?`},cancelButton:{id:`groupSharedFeatures.usm.removeCollaboratorModal.cancelButton`,defaultMessage:`Cancel`},closeButton:{id:`groupSharedFeatures.usm.removeCollaboratorModal.closeButton`,defaultMessage:`Close`},loadingLabel:{id:`groupSharedFeatures.usm.removeCollaboratorModal.loadingLabel`,defaultMessage:`Loading`},okayButton:{id:`groupSharedFeatures.usm.removeCollaboratorModal.okayButton`,defaultMessage:`Okay`}});export{messages as default};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/remove-collaborator-modal.js";
2
- export { e as RemoveCollaboratorModal };
1
+ import{t as RemoveCollaboratorModal}from"../../../../chunks/remove-collaborator-modal.js";export{RemoveCollaboratorModal};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/remove-shared-link-modal.js";
2
- export { e as RemoveSharedLinkModal };
1
+ import{t as RemoveSharedLinkModal}from"../../../../chunks/remove-shared-link-modal.js";export{RemoveSharedLinkModal};
@@ -1,28 +1 @@
1
- import { defineMessages as e } from "react-intl";
2
- var t = e({
3
- title: {
4
- id: "groupSharedFeatures.usm.removeSharedLinkModal.title",
5
- defaultMessage: "Remove Shared Link"
6
- },
7
- bodyText: {
8
- id: "groupSharedFeatures.usm.removeSharedLinkModal.bodyText",
9
- defaultMessage: "This will permanently remove the shared link. If this item is embedded on other sites it will also become inaccessible. Any custom properties, settings and expirations will be removed as well. Do you want to continue?"
10
- },
11
- cancelButton: {
12
- id: "groupSharedFeatures.usm.removeSharedLinkModal.cancelButton",
13
- defaultMessage: "Cancel"
14
- },
15
- closeButton: {
16
- id: "groupSharedFeatures.usm.removeSharedLinkModal.closeButton",
17
- defaultMessage: "Close"
18
- },
19
- loadingLabel: {
20
- id: "groupSharedFeatures.usm.removeSharedLinkModal.loadingLabel",
21
- defaultMessage: "Loading"
22
- },
23
- okayButton: {
24
- id: "groupSharedFeatures.usm.removeSharedLinkModal.okayButton",
25
- defaultMessage: "Okay"
26
- }
27
- });
28
- export { t as default };
1
+ import{defineMessages}from"react-intl";var messages=defineMessages({title:{id:`groupSharedFeatures.usm.removeSharedLinkModal.title`,defaultMessage:`Remove Shared Link`},bodyText:{id:`groupSharedFeatures.usm.removeSharedLinkModal.bodyText`,defaultMessage:`This will permanently remove the shared link. If this item is embedded on other sites it will also become inaccessible. Any custom properties, settings and expirations will be removed as well. Do you want to continue?`},cancelButton:{id:`groupSharedFeatures.usm.removeSharedLinkModal.cancelButton`,defaultMessage:`Cancel`},closeButton:{id:`groupSharedFeatures.usm.removeSharedLinkModal.closeButton`,defaultMessage:`Close`},loadingLabel:{id:`groupSharedFeatures.usm.removeSharedLinkModal.loadingLabel`,defaultMessage:`Loading`},okayButton:{id:`groupSharedFeatures.usm.removeSharedLinkModal.okayButton`,defaultMessage:`Okay`}});export{messages as default};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/remove-shared-link-modal.js";
2
- export { e as RemoveSharedLinkModal };
1
+ import{t as RemoveSharedLinkModal}from"../../../../chunks/remove-shared-link-modal.js";export{RemoveSharedLinkModal};
@@ -1,36 +1 @@
1
- import { useUnifiedShareModalContext as e } from "../../contexts/unified-share-modal-context.js";
2
- import t from "./messages.js";
3
- import { useIntl as n } from "react-intl";
4
- import { Focusable as r, Switch as i, Tooltip as a } from "@box/blueprint-web";
5
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
6
- import { CopyInput as l } from "@box/copy-input";
7
- function u({ canChange: u, isAvailable: d, isChecked: f, isDisabled: p, onToggle: m }) {
8
- let { formatMessage: h } = n(), { item: g, sharedLink: _ } = e(), { classification: v } = g, { downloadUrl: y, directLinkBlockedReason: b, settings: x = {} } = _, { isDirectLinkAvailable: S } = x, C = /* @__PURE__ */ s(l, {
9
- disabled: p,
10
- label: h(t.directLinkLabel),
11
- value: y
12
- });
13
- if (!d) return y && S ? C : null;
14
- let w;
15
- b === "malicious_content" ? w = h(t.directLinkBlockedByMaliciousContent) : b === "access_policy" && (w = h(v ? t.directLinkBlockedByAccessPolicyWithClassification : t.directLinkBlockedByAccessPolicyWithoutClassification));
16
- let T = f && !!y && S && !w;
17
- return /* @__PURE__ */ c(o, { children: [w ? /* @__PURE__ */ s(a, {
18
- content: w,
19
- "data-testid": "usm-DownloadSettings-tooltip",
20
- side: "left",
21
- children: /* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i.Item, {
22
- checked: f,
23
- disabled: !0,
24
- label: h(t.downloadSettingsToggleText),
25
- onCheckedChange: m,
26
- value: "download-link-settings"
27
- }) })
28
- }) : /* @__PURE__ */ s(i.Item, {
29
- checked: f,
30
- disabled: p || !u,
31
- label: h(t.downloadSettingsToggleText),
32
- onCheckedChange: m,
33
- value: "download-link-settings"
34
- }), T && C] });
35
- }
36
- export { u as DownloadSection };
1
+ import{useUnifiedShareModalContext}from"../../contexts/unified-share-modal-context.js";import messages from"./messages.js";import{useIntl}from"react-intl";import{Focusable,Switch,Tooltip}from"@box/blueprint-web";import{Fragment,jsx,jsxs}from"react/jsx-runtime";import{CopyInput}from"@box/copy-input";function DownloadSection({canChange,isAvailable,isChecked,isDisabled,onToggle}){let{formatMessage}=useIntl(),{item,sharedLink}=useUnifiedShareModalContext(),{classification}=item,{downloadUrl,directLinkBlockedReason,settings={}}=sharedLink,{isDirectLinkAvailable}=settings,directLink=jsx(CopyInput,{disabled:isDisabled,label:formatMessage(messages.directLinkLabel),value:downloadUrl});if(!isAvailable)return downloadUrl&&isDirectLinkAvailable?directLink:null;let tooltipMessage;directLinkBlockedReason===`malicious_content`?tooltipMessage=formatMessage(messages.directLinkBlockedByMaliciousContent):directLinkBlockedReason===`access_policy`&&(tooltipMessage=formatMessage(classification?messages.directLinkBlockedByAccessPolicyWithClassification:messages.directLinkBlockedByAccessPolicyWithoutClassification));let isDirectLinkVisible=isChecked&&!!downloadUrl&&isDirectLinkAvailable&&!tooltipMessage;return jsxs(Fragment,{children:[tooltipMessage?jsx(Tooltip,{content:tooltipMessage,"data-testid":`usm-DownloadSettings-tooltip`,side:`left`,children:jsx(Focusable,{children:jsx(Switch.Item,{checked:isChecked,disabled:!0,label:formatMessage(messages.downloadSettingsToggleText),onCheckedChange:onToggle,value:`download-link-settings`})})}):jsx(Switch.Item,{checked:isChecked,disabled:isDisabled||!canChange,label:formatMessage(messages.downloadSettingsToggleText),onCheckedChange:onToggle,value:`download-link-settings`}),isDirectLinkVisible&&directLink]})}export{DownloadSection};
@@ -1,34 +1 @@
1
- import { formatTomorrowDateToCalendarDate as e } from "../../utils/date.js";
2
- import { useSharedLinkSettingsContext as t } from "../../contexts/shared-link-settings-context.js";
3
- import n from "./messages.js";
4
- import { useIntl as r } from "react-intl";
5
- import { DateI18nProvider as i, DatePicker as a, Switch as o } from "@box/blueprint-web";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
- function u({ canChange: u, error: d, expiration: f, isChecked: p, isDisabled: m, onChange: h, onToggle: g }) {
8
- let { formatMessage: _ } = r(), { containerRef: v } = t();
9
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(o.Item, {
10
- checked: p,
11
- disabled: m || !u,
12
- label: _(n.linkExpirationToggleText),
13
- onCheckedChange: g,
14
- value: "link-expiration-settings"
15
- }), p && /* @__PURE__ */ c(i, {
16
- locale: navigator.language || "en-US",
17
- children: /* @__PURE__ */ c(a, {
18
- calendarAriaLabel: _(n.linkExpirationCalendarAriaLabel),
19
- clearDatePickerAriaLabel: _(n.linkExpirationClearDatePickerAriaLabel),
20
- error: d,
21
- hideLabel: !0,
22
- isDisabled: m || !u,
23
- label: _(n.linkExpirationDatePickerLabel),
24
- minValue: e(),
25
- nextMonthAriaLabel: _(n.linkExpirationNextMonthAriaLabel),
26
- onChange: h,
27
- openCalendarDropdownAriaLabel: _(n.linkExpirationOpenCalendarDropdownAriaLabel),
28
- portalElement: v,
29
- previousMonthAriaLabel: _(n.linkExpirationPreviousMonthAriaLabel),
30
- value: f
31
- })
32
- })] });
33
- }
34
- export { u as ExpirationSection };
1
+ import{formatTomorrowDateToCalendarDate}from"../../utils/date.js";import{useSharedLinkSettingsContext}from"../../contexts/shared-link-settings-context.js";import messages from"./messages.js";import{useIntl}from"react-intl";import{DateI18nProvider,DatePicker,Switch}from"@box/blueprint-web";import{Fragment,jsx,jsxs}from"react/jsx-runtime";function ExpirationSection({canChange,error,expiration,isChecked,isDisabled,onChange,onToggle}){let{formatMessage}=useIntl(),{containerRef}=useSharedLinkSettingsContext();return jsxs(Fragment,{children:[jsx(Switch.Item,{checked:isChecked,disabled:isDisabled||!canChange,label:formatMessage(messages.linkExpirationToggleText),onCheckedChange:onToggle,value:`link-expiration-settings`}),isChecked&&jsx(DateI18nProvider,{locale:navigator.language||`en-US`,children:jsx(DatePicker,{calendarAriaLabel:formatMessage(messages.linkExpirationCalendarAriaLabel),clearDatePickerAriaLabel:formatMessage(messages.linkExpirationClearDatePickerAriaLabel),error,hideLabel:!0,isDisabled:isDisabled||!canChange,label:formatMessage(messages.linkExpirationDatePickerLabel),minValue:formatTomorrowDateToCalendarDate(),nextMonthAriaLabel:formatMessage(messages.linkExpirationNextMonthAriaLabel),onChange,openCalendarDropdownAriaLabel:formatMessage(messages.linkExpirationOpenCalendarDropdownAriaLabel),portalElement:containerRef,previousMonthAriaLabel:formatMessage(messages.linkExpirationPreviousMonthAriaLabel),value:expiration})})]})}export{ExpirationSection};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/shared-link-settings-modal.js";
2
- export { e as SharedLinkSettingsModal };
1
+ import{t as SharedLinkSettingsModal}from"../../../../chunks/shared-link-settings-modal.js";export{SharedLinkSettingsModal};
@@ -1,140 +1 @@
1
- import { defineMessages as e } from "react-intl";
2
- var t = e({
3
- title: {
4
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.title",
5
- defaultMessage: "Shared Link Settings"
6
- },
7
- subtitleCompanyDownload: {
8
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyDownload",
9
- defaultMessage: "This content is available to anyone within your company with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}"
10
- },
11
- subtitleCompanyView: {
12
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyView",
13
- defaultMessage: "This content is available to anyone within your company with the link, and can be viewed. {learnSharedLinkSettingsLink}"
14
- },
15
- subtitleOpenDownload: {
16
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenDownload",
17
- defaultMessage: "This content is publicly available to anyone with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}"
18
- },
19
- subtitleOpenView: {
20
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenView",
21
- defaultMessage: "This content is publicly available to anyone with the link, and can be viewed. {learnSharedLinkSettingsLink}"
22
- },
23
- subtitleCollaborators: {
24
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCollaborators",
25
- defaultMessage: "This content is available to invited collaborators with the link. {learnSharedLinkSettingsLink}"
26
- },
27
- cancelButton: {
28
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.cancelButton",
29
- defaultMessage: "Cancel"
30
- },
31
- closeButton: {
32
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.closeButton",
33
- defaultMessage: "Close"
34
- },
35
- loadingLabel: {
36
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.loadingLabel",
37
- defaultMessage: "Loading"
38
- },
39
- saveButton: {
40
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.saveButton",
41
- defaultMessage: "Save"
42
- },
43
- learnSharedLinkSettingsLink: {
44
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink",
45
- defaultMessage: "Learn more about shared link settings."
46
- },
47
- linkExpirationCalendarAriaLabel: {
48
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationCalendarAriaLabel",
49
- defaultMessage: "Select an expiration date"
50
- },
51
- linkExpirationClearDatePickerAriaLabel: {
52
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationClearDatePickerAriaLabel",
53
- defaultMessage: "Clear date picker"
54
- },
55
- linkExpirationNextMonthAriaLabel: {
56
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationNextMonthAriaLabel",
57
- defaultMessage: "Switch to next month"
58
- },
59
- linkExpirationOpenCalendarDropdownAriaLabel: {
60
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationOpenCalendarDropdownAriaLabel",
61
- defaultMessage: "Open calendar"
62
- },
63
- linkExpirationPreviousMonthAriaLabel: {
64
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationPreviousMonthAriaLabel",
65
- defaultMessage: "Switch to previous month"
66
- },
67
- linkExpirationDatePickerLabel: {
68
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationDatePickerLabel",
69
- defaultMessage: "Expiration date"
70
- },
71
- linkExpirationToggleText: {
72
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationToggleText",
73
- defaultMessage: "Link expiration"
74
- },
75
- vanityNameToggleText: {
76
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameToggleText",
77
- defaultMessage: "Publish content broadly with a custom, non-private URL"
78
- },
79
- warningNoticeIconAriaLabel: {
80
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.warningNoticeIconAriaLabel",
81
- defaultMessage: "Warning"
82
- },
83
- vanityDomainSettingsWarningText: {
84
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityDomainSettingsWarningText",
85
- defaultMessage: "Custom URLs should not be used when sharing sensitive content."
86
- },
87
- vanityNameInputLabel: {
88
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputLabel",
89
- defaultMessage: "Custom path"
90
- },
91
- vanityNameInputPlaceholder: {
92
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputPlaceholder",
93
- defaultMessage: "Enter a custom path (12 or more characters)"
94
- },
95
- downloadSettingsToggleText: {
96
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText",
97
- defaultMessage: "Allow users with the shared link to download this item"
98
- },
99
- directLinkLabel: {
100
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel",
101
- defaultMessage: "Direct link"
102
- },
103
- directLinkBlockedByMaliciousContent: {
104
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByMaliciousContent",
105
- defaultMessage: "Download for this content has been disabled due to a security policy."
106
- },
107
- directLinkBlockedByAccessPolicyWithClassification: {
108
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithClassification",
109
- defaultMessage: "Download has been disabled for content due to the classification."
110
- },
111
- directLinkBlockedByAccessPolicyWithoutClassification: {
112
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithoutClassification",
113
- defaultMessage: "Download has been disabled for content without classification."
114
- },
115
- passwordToggleText: {
116
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordToggleText",
117
- defaultMessage: "Password protection"
118
- },
119
- passwordInputPlaceholder: {
120
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordInputPlaceholder",
121
- defaultMessage: "Enter a password"
122
- },
123
- passwordWarningText: {
124
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordWarningText",
125
- defaultMessage: "Passwords must include at least 8 characters, and must contain at least one upper case letter, number, or special character."
126
- },
127
- showPasswordAriaLabel: {
128
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.showPasswordAriaLabel",
129
- defaultMessage: "Show password"
130
- },
131
- hidePasswordAriaLabel: {
132
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel",
133
- defaultMessage: "Hide password"
134
- },
135
- inaccessibleSettingsNotice: {
136
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice",
137
- defaultMessage: "Certain settings may not be available for this item due to permissions."
138
- }
139
- });
140
- export { t as default };
1
+ import{defineMessages}from"react-intl";var messages=defineMessages({title:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.title`,defaultMessage:`Shared Link Settings`},subtitleCompanyDownload:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyDownload`,defaultMessage:`This content is available to anyone within your company with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}`},subtitleCompanyView:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyView`,defaultMessage:`This content is available to anyone within your company with the link, and can be viewed. {learnSharedLinkSettingsLink}`},subtitleOpenDownload:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenDownload`,defaultMessage:`This content is publicly available to anyone with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}`},subtitleOpenView:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenView`,defaultMessage:`This content is publicly available to anyone with the link, and can be viewed. {learnSharedLinkSettingsLink}`},subtitleCollaborators:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCollaborators`,defaultMessage:`This content is available to invited collaborators with the link. {learnSharedLinkSettingsLink}`},cancelButton:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.cancelButton`,defaultMessage:`Cancel`},closeButton:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.closeButton`,defaultMessage:`Close`},loadingLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.loadingLabel`,defaultMessage:`Loading`},saveButton:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.saveButton`,defaultMessage:`Save`},learnSharedLinkSettingsLink:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink`,defaultMessage:`Learn more about shared link settings.`},linkExpirationCalendarAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationCalendarAriaLabel`,defaultMessage:`Select an expiration date`},linkExpirationClearDatePickerAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationClearDatePickerAriaLabel`,defaultMessage:`Clear date picker`},linkExpirationNextMonthAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationNextMonthAriaLabel`,defaultMessage:`Switch to next month`},linkExpirationOpenCalendarDropdownAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationOpenCalendarDropdownAriaLabel`,defaultMessage:`Open calendar`},linkExpirationPreviousMonthAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationPreviousMonthAriaLabel`,defaultMessage:`Switch to previous month`},linkExpirationDatePickerLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationDatePickerLabel`,defaultMessage:`Expiration date`},linkExpirationToggleText:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationToggleText`,defaultMessage:`Link expiration`},vanityNameToggleText:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameToggleText`,defaultMessage:`Publish content broadly with a custom, non-private URL`},warningNoticeIconAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.warningNoticeIconAriaLabel`,defaultMessage:`Warning`},vanityDomainSettingsWarningText:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.vanityDomainSettingsWarningText`,defaultMessage:`Custom URLs should not be used when sharing sensitive content.`},vanityNameInputLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputLabel`,defaultMessage:`Custom path`},vanityNameInputPlaceholder:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputPlaceholder`,defaultMessage:`Enter a custom path (12 or more characters)`},downloadSettingsToggleText:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText`,defaultMessage:`Allow users with the shared link to download this item`},directLinkLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel`,defaultMessage:`Direct link`},directLinkBlockedByMaliciousContent:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByMaliciousContent`,defaultMessage:`Download for this content has been disabled due to a security policy.`},directLinkBlockedByAccessPolicyWithClassification:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithClassification`,defaultMessage:`Download has been disabled for content due to the classification.`},directLinkBlockedByAccessPolicyWithoutClassification:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithoutClassification`,defaultMessage:`Download has been disabled for content without classification.`},passwordToggleText:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.passwordToggleText`,defaultMessage:`Password protection`},passwordInputPlaceholder:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.passwordInputPlaceholder`,defaultMessage:`Enter a password`},passwordWarningText:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.passwordWarningText`,defaultMessage:`Passwords must include at least 8 characters, and must contain at least one upper case letter, number, or special character.`},showPasswordAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.showPasswordAriaLabel`,defaultMessage:`Show password`},hidePasswordAriaLabel:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel`,defaultMessage:`Hide password`},inaccessibleSettingsNotice:{id:`groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice`,defaultMessage:`Certain settings may not be available for this item due to permissions.`}});export{messages as default};
@@ -1,33 +1 @@
1
- import e from "./messages.js";
2
- import { useIntl as t } from "react-intl";
3
- import { InlineNotice as n, PasswordInput as r, Switch as i } from "@box/blueprint-web";
4
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
- var c = "••••••••";
6
- function l({ canChange: l, error: u, isAvailable: d, isChecked: f, isDefaultChecked: p, isDisabled: m, onBlur: h, onChange: g, onFocus: _, onToggle: v, password: y }) {
7
- let { formatMessage: b } = t();
8
- return d ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(i.Item, {
9
- checked: f,
10
- disabled: m || !l,
11
- label: b(e.passwordToggleText),
12
- onCheckedChange: v,
13
- value: "password-settings"
14
- }), f && /* @__PURE__ */ s(a, { children: [l && /* @__PURE__ */ o(n, {
15
- variant: "warning",
16
- variantIconAriaLabel: b(e.warningNoticeIconAriaLabel),
17
- children: b(e.passwordWarningText)
18
- }), /* @__PURE__ */ o(r, {
19
- autoComplete: "new-password",
20
- disabled: m || !l,
21
- error: u,
22
- hideLabel: !0,
23
- hidePasswordAriaLabel: b(e.hidePasswordAriaLabel),
24
- label: b(e.passwordToggleText),
25
- onBlur: h,
26
- onChange: g,
27
- onFocus: _,
28
- placeholder: p ? c : b(e.passwordInputPlaceholder),
29
- showPasswordAriaLabel: b(e.showPasswordAriaLabel),
30
- value: y
31
- })] })] }) : null;
32
- }
33
- export { l as PasswordSection };
1
+ import messages from"./messages.js";import{useIntl}from"react-intl";import{InlineNotice,PasswordInput,Switch}from"@box/blueprint-web";import{Fragment,jsx,jsxs}from"react/jsx-runtime";var OBSCURED_PASSWORD=`••••••••`;function PasswordSection({canChange,error,isAvailable,isChecked,isDefaultChecked,isDisabled,onBlur,onChange,onFocus,onToggle,password}){let{formatMessage}=useIntl();return isAvailable?jsxs(Fragment,{children:[jsx(Switch.Item,{checked:isChecked,disabled:isDisabled||!canChange,label:formatMessage(messages.passwordToggleText),onCheckedChange:onToggle,value:`password-settings`}),isChecked&&jsxs(Fragment,{children:[canChange&&jsx(InlineNotice,{variant:`warning`,variantIconAriaLabel:formatMessage(messages.warningNoticeIconAriaLabel),children:formatMessage(messages.passwordWarningText)}),jsx(PasswordInput,{autoComplete:`new-password`,disabled:isDisabled||!canChange,error,hideLabel:!0,hidePasswordAriaLabel:formatMessage(messages.hidePasswordAriaLabel),label:formatMessage(messages.passwordToggleText),onBlur,onChange,onFocus,placeholder:isDefaultChecked?OBSCURED_PASSWORD:formatMessage(messages.passwordInputPlaceholder),showPasswordAriaLabel:formatMessage(messages.showPasswordAriaLabel),value:password})]})]}):null}export{PasswordSection};
@@ -1,2 +1 @@
1
- import { t as e } from "../../../../chunks/shared-link-settings-modal.js";
2
- export { e as SharedLinkSettingsModal };
1
+ import{t as SharedLinkSettingsModal}from"../../../../chunks/shared-link-settings-modal.js";export{SharedLinkSettingsModal};
@@ -1,98 +1 @@
1
- import { useUnifiedShareModalContext as e } from "../../contexts/unified-share-modal-context.js";
2
- import { useAccessLevels as t } from "../../hooks/use-access-levels.js";
3
- import { useSharedLinkSettingsContext as n } from "../../contexts/shared-link-settings-context.js";
4
- import r from "./messages.js";
5
- import { DownloadSection as i } from "./download-section.js";
6
- import { ExpirationSection as a } from "./expiration-section.js";
7
- import { PasswordSection as o } from "./password-section.js";
8
- import { VanitySection as s } from "./vanity-section.js";
9
- import { useMemo as c } from "react";
10
- import { useIntl as l } from "react-intl";
11
- import { InlineNotice as u, Link as d, Text as f } from "@box/blueprint-web";
12
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
- function g() {
14
- let { formatMessage: g } = l(), { isSubmitting: _, sharedLink: v } = e(), { settings: y = {}, vanityDomain: b = "" } = v, { canChangeDownload: x, canChangeExpiration: S, canChangePassword: C, canChangeVanityName: w, isDownloadAvailable: T, isPasswordAvailable: E, isVanityNameAvailable: D } = y, { selectedAccess: O } = t(), { errors: k, formData: A, initialFormData: j, setFieldError: M, setFieldValue: N, validatePassword: P } = n(), F = c(() => {
15
- if (!O) return null;
16
- switch (O.id) {
17
- case "collaborators": return r.subtitleCollaborators;
18
- case "open": return A.isDownloadEnabled ? r.subtitleOpenDownload : r.subtitleOpenView;
19
- case "company": return A.isDownloadEnabled ? r.subtitleCompanyDownload : r.subtitleCompanyView;
20
- default: return null;
21
- }
22
- }, [A.isDownloadEnabled, O]);
23
- return /* @__PURE__ */ h(p, { children: [
24
- !(x && S && C && w) && /* @__PURE__ */ m(u, {
25
- variant: "warning",
26
- variantIconAriaLabel: g(r.warningNoticeIconAriaLabel),
27
- children: g(r.inaccessibleSettingsNotice)
28
- }),
29
- F && /* @__PURE__ */ m(f, {
30
- as: "p",
31
- color: "textOnLightSecondary",
32
- children: g(F, { learnSharedLinkSettingsLink: /* @__PURE__ */ m(d, {
33
- href: "https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings",
34
- rel: "noreferrer",
35
- target: "_blank",
36
- children: g(r.learnSharedLinkSettingsLink)
37
- }) })
38
- }),
39
- /* @__PURE__ */ m(a, {
40
- canChange: !!S,
41
- error: k.expiration,
42
- expiration: A.expiration,
43
- isChecked: A.isExpirationEnabled,
44
- isDisabled: _,
45
- onChange: (e) => {
46
- M("expiration", void 0), N("expiration", e);
47
- },
48
- onToggle: (e) => {
49
- M("expiration", void 0), N("isExpirationEnabled", e);
50
- }
51
- }),
52
- /* @__PURE__ */ m(o, {
53
- canChange: !!C,
54
- error: k.password,
55
- isAvailable: E && O?.id === "open",
56
- isChecked: A.isPasswordEnabled,
57
- isDefaultChecked: j.isPasswordEnabled,
58
- isDisabled: _,
59
- onBlur: (e) => {
60
- let t = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")?.contains(e.relatedTarget);
61
- j.isPasswordEnabled && !A.password || t || P(A.password);
62
- },
63
- onChange: (e) => {
64
- M("password", void 0), N("password", e.target.value);
65
- },
66
- onFocus: () => M("password", void 0),
67
- onToggle: (e) => {
68
- M("password", void 0), N("isPasswordEnabled", e);
69
- },
70
- password: A.password
71
- }),
72
- /* @__PURE__ */ m(s, {
73
- canChange: !!w,
74
- error: k.vanityName,
75
- isAvailable: !!D,
76
- isChecked: A.isVanityNameEnabled,
77
- isDisabled: _,
78
- onChange: (e) => {
79
- M("vanityName", void 0), N("vanityName", e.target.value);
80
- },
81
- onToggle: (e) => {
82
- M("vanityName", void 0), N("isVanityNameEnabled", e);
83
- },
84
- vanityDomain: b,
85
- vanityName: A.vanityName
86
- }),
87
- /* @__PURE__ */ m(i, {
88
- canChange: !!x,
89
- isAvailable: !!T,
90
- isChecked: A.isDownloadEnabled,
91
- isDisabled: _,
92
- onToggle: (e) => {
93
- N("isDownloadEnabled", e);
94
- }
95
- })
96
- ] });
97
- }
98
- export { g as SharedLinkSettings };
1
+ 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{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(),{isSubmitting,sharedLink}=useUnifiedShareModalContext(),{settings={},vanityDomain=``}=sharedLink,{canChangeDownload,canChangeExpiration,canChangePassword,canChangeVanityName,isDownloadAvailable,isPasswordAvailable,isVanityNameAvailable}=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]);return jsxs(Fragment,{children:[!(canChangeDownload&&canChangeExpiration&&canChangePassword&&canChangeVanityName)&&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:value=>{setFieldError(`expiration`,void 0),setFieldValue(`expiration`,value)},onToggle:nextChecked=>{setFieldError(`expiration`,void 0),setFieldValue(`isExpirationEnabled`,nextChecked)}}),jsx(PasswordSection,{canChange:!!canChangePassword,error:errors.password,isAvailable:isPasswordAvailable&&selectedAccess?.id===`open`,isChecked:formData.isPasswordEnabled,isDefaultChecked:initialFormData.isPasswordEnabled,isDisabled:isSubmitting,onBlur:event=>{let isSubmitFocused=document.getElementById(`usm-SharedLinkSettingsModal-primaryButton`)?.contains(event.relatedTarget);initialFormData.isPasswordEnabled&&!formData.password||isSubmitFocused||validatePassword(formData.password)},onChange:event=>{setFieldError(`password`,void 0),setFieldValue(`password`,event.target.value)},onFocus:()=>setFieldError(`password`,void 0),onToggle:nextChecked=>{setFieldError(`password`,void 0),setFieldValue(`isPasswordEnabled`,nextChecked)},password:formData.password}),jsx(VanitySection,{canChange:!!canChangeVanityName,error:errors.vanityName,isAvailable:!!isVanityNameAvailable,isChecked:formData.isVanityNameEnabled,isDisabled:isSubmitting,onChange:event=>{setFieldError(`vanityName`,void 0),setFieldValue(`vanityName`,event.target.value)},onToggle:nextChecked=>{setFieldError(`vanityName`,void 0),setFieldValue(`isVanityNameEnabled`,nextChecked)},vanityDomain,vanityName:formData.vanityName}),jsx(DownloadSection,{canChange:!!canChangeDownload,isAvailable:!!isDownloadAvailable,isChecked:formData.isDownloadEnabled,isDisabled:isSubmitting,onToggle:nextChecked=>{setFieldValue(`isDownloadEnabled`,nextChecked)}})]})}export{SharedLinkSettings};