@box/unified-share-modal 1.33.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +120 -107
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +39 -39
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +107 -102
- package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +48 -39
- package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +66 -66
- package/dist/esm/lib/unified-share-modal.js +56 -54
- package/dist/styles/collaboration-role.css +1 -1
- package/dist/styles/collaboration-section.css +1 -1
- package/dist/styles/shared-link-section.css +1 -1
- package/dist/styles/shared-link-settings-modal.css +1 -1
- package/dist/types/lib/contexts/unified-share-modal-context.d.ts +1 -0
- package/dist/types/lib/types.d.ts +23 -4
- package/dist/types/lib/unified-share-modal.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,75 +1,77 @@
|
|
|
1
|
-
import { useState as i, useEffect as
|
|
2
|
-
import { DEFAULT_CONFIGURATION as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { UnifiedShareModalContext as
|
|
5
|
-
import { UnifiedShareFormModal as
|
|
6
|
-
import { SharedLinkSettingsModal as
|
|
7
|
-
import { RemoveSharedLinkModal as
|
|
8
|
-
import { RemoveCollaboratorModal as
|
|
9
|
-
function
|
|
1
|
+
import { useState as i, useEffect as V, useMemo as j } from "react";
|
|
2
|
+
import { DEFAULT_CONFIGURATION as E } from "./constants.js";
|
|
3
|
+
import { jsxs as y, jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import { UnifiedShareModalContext as A } from "./contexts/unified-share-modal-context.js";
|
|
5
|
+
import { UnifiedShareFormModal as D } from "./components/unified-share-form-modal/unified-share-form-modal.js";
|
|
6
|
+
import { SharedLinkSettingsModal as G } from "./components/shared-link-settings-modal/shared-link-settings-modal.js";
|
|
7
|
+
import { RemoveSharedLinkModal as N } from "./components/remove-shared-link-modal/remove-shared-link-modal.js";
|
|
8
|
+
import { RemoveCollaboratorModal as P } from "./components/remove-collaborator-modal/remove-collaborator-modal.js";
|
|
9
|
+
function W({
|
|
10
10
|
children: m,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
collaborationAccess: f,
|
|
12
|
+
collaborationNotices: d,
|
|
13
|
+
collaborationRoles: l,
|
|
14
|
+
collaborators: h,
|
|
15
|
+
config: p,
|
|
16
|
+
contactService: u,
|
|
17
|
+
currentUser: g,
|
|
18
|
+
eventService: c,
|
|
19
|
+
initialContacts: C,
|
|
20
|
+
isFetching: M,
|
|
20
21
|
isOpen: e,
|
|
21
|
-
isSubmitting:
|
|
22
|
-
item:
|
|
22
|
+
isSubmitting: O,
|
|
23
|
+
item: U,
|
|
23
24
|
onLoad: t,
|
|
24
|
-
onOpenChange:
|
|
25
|
-
sharedLink:
|
|
26
|
-
sharingService:
|
|
25
|
+
onOpenChange: v,
|
|
26
|
+
sharedLink: S,
|
|
27
|
+
sharingService: x
|
|
27
28
|
}) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
(async () => (t && await t(),
|
|
29
|
+
const F = !!m, [o, k] = i(e ?? !F), [w, L] = i(!!t), [r, a] = i("unified-share-form"), [I, R] = i();
|
|
30
|
+
V(() => k((n) => e ?? n), [e]), V(() => {
|
|
31
|
+
(async () => (t && await t(), L(!1)))();
|
|
31
32
|
}, []);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
const T = (n) => {
|
|
34
|
+
k(e ?? n), v && v(n);
|
|
35
|
+
}, b = j(() => ({
|
|
36
|
+
collaborationAccess: f,
|
|
37
|
+
collaborationNotices: d,
|
|
38
|
+
collaborationRoles: l ?? [],
|
|
39
|
+
collaborator: I ?? {},
|
|
40
|
+
collaborators: h ?? [],
|
|
39
41
|
config: {
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
+
...E,
|
|
43
|
+
...p
|
|
42
44
|
},
|
|
43
|
-
contactService:
|
|
44
|
-
currentUser:
|
|
45
|
-
eventService:
|
|
46
|
-
initialContacts:
|
|
47
|
-
isFetching:
|
|
48
|
-
isSubmitting:
|
|
49
|
-
item:
|
|
50
|
-
setCollaborator:
|
|
51
|
-
sharedLink:
|
|
52
|
-
sharingService:
|
|
53
|
-
}), [f, d,
|
|
54
|
-
return /* @__PURE__ */ A
|
|
55
|
-
value:
|
|
56
|
-
children: [/* @__PURE__ */ s(
|
|
45
|
+
contactService: u ?? {},
|
|
46
|
+
currentUser: g ?? {},
|
|
47
|
+
eventService: c ?? {},
|
|
48
|
+
initialContacts: C ?? [],
|
|
49
|
+
isFetching: M ?? w,
|
|
50
|
+
isSubmitting: O,
|
|
51
|
+
item: U,
|
|
52
|
+
setCollaborator: R,
|
|
53
|
+
sharedLink: S ?? {},
|
|
54
|
+
sharingService: x ?? {}
|
|
55
|
+
}), [f, d, l, I, h, p, u, g, c, C, M, w, O, U, S, x]);
|
|
56
|
+
return /* @__PURE__ */ y(A.Provider, {
|
|
57
|
+
value: b,
|
|
58
|
+
children: [/* @__PURE__ */ s(D, {
|
|
57
59
|
isOpen: o && r === "unified-share-form",
|
|
58
60
|
onModalViewChange: a,
|
|
59
|
-
onOpenChange:
|
|
61
|
+
onOpenChange: T,
|
|
60
62
|
children: m
|
|
61
|
-
}), /* @__PURE__ */ s(
|
|
63
|
+
}), /* @__PURE__ */ s(G, {
|
|
62
64
|
isOpen: o && r === "shared-link-settings",
|
|
63
65
|
onOpenChange: () => a("unified-share-form")
|
|
64
|
-
}), /* @__PURE__ */ s(
|
|
66
|
+
}), /* @__PURE__ */ s(N, {
|
|
65
67
|
isOpen: o && r === "remove-shared-link",
|
|
66
68
|
onOpenChange: () => a("unified-share-form")
|
|
67
|
-
}), /* @__PURE__ */ s(
|
|
69
|
+
}), /* @__PURE__ */ s(P, {
|
|
68
70
|
isOpen: o && r === "remove-collaborator",
|
|
69
71
|
onOpenChange: () => a("unified-share-form")
|
|
70
72
|
})]
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
75
|
export {
|
|
74
|
-
|
|
76
|
+
W as UnifiedShareModal
|
|
75
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1fonq_1{align-self:flex-start}._container_1fonq_1._overrides_1fonq_4{min-height:unset;font-weight:var(--body-default-font-weight)}._focusable_1fonq_9{justify-self:flex-start}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_wmqot_2{display:flex;flex-direction:column;gap:var(--space-4)}._label_wmqot_8{font-weight:var(--body-default-bold-font-weight);font-size:var(--body-default-bold-font-size);font-family:var(--body-default-bold-font-family);line-height:var(--body-default-bold-line-height);letter-spacing:var(--body-default-bold-letter-spacing);text-transform:var(--body-default-bold-text-case);text-decoration:var(--body-default-bold-text-decoration);display:block;margin-block-end:var(--space-2);padding:var(--space-1) 0;color:var(--text-text-on-light);overflow-wrap:break-word}._securityIndicator_wmqot_23>svg{display:inline-block;margin-bottom:-3px;padding-right:var(--space-1)}._collaborationAccessContainer_wmqot_29{display:flex;gap:var(--space-2);margin-top:var(--space-3)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_1b8qy_1{display:flex;flex-direction:column;gap:var(--space-3)}._toggle_1b8qy_7{display:flex;gap:var(--space-2);align-items:center}._settings_1b8qy_13{margin-left:auto;cursor:pointer}._settings_1b8qy_13[aria-disabled=true]{opacity:.3;pointer-events:none}._copy_1b8qy_22{display:flex;gap:var(--space-2)}._copy_1b8qy_22>div:first-child{flex-grow:1}._access_1b8qy_30{display:flex;flex-wrap:wrap;gap:var(--space-2)}._securityIndicator_1b8qy_36>svg{display:inline-block;margin-bottom:-3px;padding-right:var(--space-1)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_1r0kk_1._content_1r0kk_1{max-width:480px}._body_1r0kk_5._body_1r0kk_5{position:relative;display:flex;flex-direction:column;gap:var(--space-4);padding-top:0;padding-bottom:0}._body_1r0kk_5._body_1r0kk_5[inert]{min-height:200px}._loading_1r0kk_17{position:absolute;inset:0;z-index:1;display:flex;align-items:center;padding-bottom:var(--space-8);background-color:var(--gray-white)}
|
|
@@ -2,6 +2,7 @@ import { Dispatch, ReactElement, SetStateAction } from 'react';
|
|
|
2
2
|
import { UserContactType } from '@box/user-selector';
|
|
3
3
|
import { CollaborationRole, Collaborator, Configuration, ContactService, EventService, Item, SharedLink, SharingService, User } from '../types';
|
|
4
4
|
export interface UnifiedShareModalContextValue {
|
|
5
|
+
collaborationAccess?: ReactElement;
|
|
5
6
|
collaborationNotices?: ReactElement | ReactElement[];
|
|
6
7
|
collaborationRoles?: CollaborationRole[];
|
|
7
8
|
collaborator?: Partial<Collaborator>;
|
|
@@ -334,14 +334,20 @@ export interface CollaborationRole {
|
|
|
334
334
|
label?: string;
|
|
335
335
|
}
|
|
336
336
|
export interface EventService {
|
|
337
|
+
/**
|
|
338
|
+
* Function to customize the click behavior of the "Shared with ..." list of avatars.
|
|
339
|
+
*
|
|
340
|
+
* If provided, the default behavior is disabled and the list of collaborators will not be rendered.
|
|
341
|
+
*
|
|
342
|
+
* Used to enhance the experience for managing collaborators such as opening the Collaborators Modal.
|
|
343
|
+
*/
|
|
337
344
|
onCollaboratorsClick?: () => void;
|
|
338
345
|
/**
|
|
339
|
-
*
|
|
346
|
+
* Function to customize the click behavior of the "Manage All" link.
|
|
340
347
|
*
|
|
341
|
-
*
|
|
342
|
-
* Useful for opening a CollaboratorsModal or custom dialog without leaving the page.
|
|
348
|
+
* If provided, the default behavior is disabled and the link will be rendered as a button.
|
|
343
349
|
*
|
|
344
|
-
*
|
|
350
|
+
* Used to enhance the experience for managing collaborators or override the default navigation behavior.
|
|
345
351
|
*/
|
|
346
352
|
onCollaboratorsManagementClick?: () => void;
|
|
347
353
|
/**
|
|
@@ -350,8 +356,21 @@ export interface EventService {
|
|
|
350
356
|
* This is usually used for data tracking purposes.
|
|
351
357
|
*/
|
|
352
358
|
onRestrictedUsersRemoveClick?: (contacts: UserContactType[]) => void;
|
|
359
|
+
/**
|
|
360
|
+
* Function to customize the click behavior of the "Link Settings" link.
|
|
361
|
+
*
|
|
362
|
+
* NOTE: This has not been implemented.
|
|
363
|
+
*/
|
|
353
364
|
onSharedLinkSettingsClick?: () => void;
|
|
365
|
+
/**
|
|
366
|
+
* Function to observe when the user closes the view for the shared link settings.
|
|
367
|
+
*/
|
|
354
368
|
onSharedLinkSettingsClose?: () => void;
|
|
369
|
+
/**
|
|
370
|
+
* Function to allow the consumer to fetch data for the shared link settings.
|
|
371
|
+
*
|
|
372
|
+
* Called when the user opens the view for the shared link settings.
|
|
373
|
+
*/
|
|
355
374
|
onSharedLinkSettingsLoad?: () => void;
|
|
356
375
|
}
|
|
357
376
|
export interface ContactService {
|
|
@@ -3,6 +3,7 @@ import { UserContactType } from '@box/user-selector';
|
|
|
3
3
|
import { CollaborationRole, Collaborator, Configuration, ContactService, EventService, Item, SharedLink, SharingService, User } from './types';
|
|
4
4
|
export interface UnifiedShareModalProps {
|
|
5
5
|
children?: ReactElement;
|
|
6
|
+
collaborationAccess?: ReactElement;
|
|
6
7
|
collaborationNotices?: ReactElement | ReactElement[];
|
|
7
8
|
collaborationRoles?: CollaborationRole[];
|
|
8
9
|
collaborators?: Collaborator[];
|
|
@@ -20,4 +21,4 @@ export interface UnifiedShareModalProps {
|
|
|
20
21
|
sharedLink?: SharedLink;
|
|
21
22
|
sharingService?: SharingService;
|
|
22
23
|
}
|
|
23
|
-
export declare function UnifiedShareModal({ children, collaborationNotices, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, isFetching, isOpen, isSubmitting, item, onLoad, onOpenChange, sharedLink, sharingService, }: UnifiedShareModalProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function UnifiedShareModal({ children, collaborationAccess, collaborationNotices, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, isFetching, isOpen, isSubmitting, item, onLoad, onOpenChange, sharedLink, sharingService, }: UnifiedShareModalProps): import("react/jsx-runtime").JSX.Element;
|