@box/unified-share-modal 1.24.1 → 1.25.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.
@@ -1,85 +1,88 @@
1
- import { createPortal as _ } from "react-dom";
1
+ import { createPortal as C } from "react-dom";
2
2
  import { useIntl as p } from "react-intl";
3
- import { Link as j, Table as v, TableHeader as k, Column as d, TableBody as x, Modal as t } from "@box/blueprint-web";
4
- import { CollaboratorListItem as y } from "./collaborator-list-item.js";
3
+ import { TextButton as B, Link as k, Table as v, TableHeader as x, Column as c, TableBody as A, Modal as l } from "@box/blueprint-web";
4
+ import { CollaboratorListItem as F } from "./collaborator-list-item.js";
5
5
  import r from "./messages.js";
6
- import { jsxs as a, jsx as e, Fragment as F } from "react/jsx-runtime";
7
- import { useUnifiedShareModalContext as L } from "../../../contexts/unified-share-modal-context.js";
6
+ import { jsxs as t, jsx as e, Fragment as L } from "react/jsx-runtime";
7
+ import { useUnifiedShareModalContext as y } from "../../../contexts/unified-share-modal-context.js";
8
8
  import { useUnifiedShareFormContext as M } from "../../../contexts/unified-share-form-context.js";
9
- import '../../../../../styles/collaborators-view.css';const S = "_manage_jjd85_1", B = "_list_jjd85_7", H = "_scroll_jjd85_24", N = "_header_jjd85_30", l = {
10
- manage: S,
11
- list: B,
9
+ import '../../../../../styles/collaborators-view.css';const N = "_manage_8rmie_1", S = "_manageAllButton_8rmie_6", T = "_list_8rmie_13", H = "_scroll_8rmie_30", w = "_header_8rmie_36", a = {
10
+ manage: N,
11
+ manageAllButton: S,
12
+ list: T,
12
13
  scroll: H,
13
- header: N
14
+ header: w
14
15
  };
15
- function R() {
16
+ function z() {
16
17
  const {
17
18
  formatMessage: o
18
19
  } = p(), {
19
- collaborators: m,
20
+ collaborators: d,
20
21
  config: n,
21
22
  eventService: h,
22
23
  isFetching: i,
23
24
  item: u
24
- } = L(), {
25
- id: f,
26
- type: b
25
+ } = y(), {
26
+ id: g,
27
+ type: _
27
28
  } = u, {
28
- onCollaboratorsManageClick: s
29
+ onCollaboratorsManagementClick: s
29
30
  } = h, {
30
- container: c,
31
- onShareViewChange: g
31
+ container: m,
32
+ onShareViewChange: f
32
33
  } = M();
33
- return /* @__PURE__ */ a("div", {
34
+ return /* @__PURE__ */ t("div", {
34
35
  inert: i ? "" : null,
35
36
  children: [n.collaboratorsManagement && /* @__PURE__ */ e("div", {
36
- className: l.manage,
37
- children: /* @__PURE__ */ e(j, {
38
- href: `/${b}/${f}/collaborators`,
37
+ className: a.manage,
38
+ children: s ? /* @__PURE__ */ e(B, {
39
+ className: a.manageAllButton,
40
+ inheritFont: !0,
41
+ onClick: s,
42
+ children: o(r.manageAllLink)
43
+ }) : /* @__PURE__ */ e(k, {
44
+ href: `/${_}/${g}/collaborators`,
39
45
  rel: "noopener",
40
46
  target: "_blank",
41
47
  variant: "standalone",
42
- ...s && {
43
- onClick: s
44
- },
45
48
  children: o(r.manageAllLink)
46
49
  })
47
50
  }), /* @__PURE__ */ e("div", {
48
- className: l.list,
51
+ className: a.list,
49
52
  children: /* @__PURE__ */ e("div", {
50
- className: l.scroll,
51
- children: /* @__PURE__ */ a(v, {
53
+ className: a.scroll,
54
+ children: /* @__PURE__ */ t(v, {
52
55
  "aria-label": o(r.listLabel),
53
- children: [/* @__PURE__ */ a(k, {
54
- className: l.header,
55
- children: [/* @__PURE__ */ e(d, {
56
+ children: [/* @__PURE__ */ t(x, {
57
+ className: a.header,
58
+ children: [/* @__PURE__ */ e(c, {
56
59
  hideHeader: !0,
57
60
  isRowHeader: !0,
58
61
  children: o(r.nameColumn)
59
- }), /* @__PURE__ */ e(d, {
62
+ }), /* @__PURE__ */ e(c, {
60
63
  hideHeader: !0,
61
64
  children: o(r.roleColumn)
62
65
  })]
63
- }), /* @__PURE__ */ e(x, {
64
- items: m.slice(0, n.collaboratorsLimit),
65
- children: (C) => /* @__PURE__ */ e(y, {
66
- collaborator: C
66
+ }), /* @__PURE__ */ e(A, {
67
+ items: d.slice(0, n.collaboratorsLimit),
68
+ children: (b) => /* @__PURE__ */ e(F, {
69
+ collaborator: b
67
70
  })
68
71
  })]
69
72
  })
70
73
  })
71
- }), c && /* @__PURE__ */ _(/* @__PURE__ */ a(F, {
72
- children: [!i && /* @__PURE__ */ e(t.Footer, {
73
- children: /* @__PURE__ */ e(t.Footer.SecondaryButton, {
74
- onClick: () => g("default"),
74
+ }), m && /* @__PURE__ */ C(/* @__PURE__ */ t(L, {
75
+ children: [!i && /* @__PURE__ */ e(l.Footer, {
76
+ children: /* @__PURE__ */ e(l.Footer.SecondaryButton, {
77
+ onClick: () => f("default"),
75
78
  children: o(r.doneButton)
76
79
  })
77
- }), /* @__PURE__ */ e(t.Close, {
80
+ }), /* @__PURE__ */ e(l.Close, {
78
81
  "aria-label": o(r.closeButton)
79
82
  })]
80
- }), c)]
83
+ }), m)]
81
84
  });
82
85
  }
83
86
  export {
84
- R as CollaboratorsView
87
+ z as CollaboratorsView
85
88
  };
@@ -1 +1 @@
1
- ._manage_jjd85_1{display:flex;flex-direction:row-reverse;padding:var(--space-3) .625rem}._list_jjd85_7{position:relative}._list_jjd85_7:after{position:absolute;inset:0;z-index:1000;border:var(--border-1) solid var(--border-divider-border);border-radius:var(--radius-4);box-shadow:var(--innershadow-1);content:"";pointer-events:none}._scroll_jjd85_24{height:240px;overflow-y:auto;border-radius:var(--radius-4)}._header_jjd85_30{visibility:collapse}
1
+ ._manage_8rmie_1{display:flex;flex-direction:row-reverse;padding:var(--space-3) .625rem}._manage_8rmie_1 ._manageAllButton_8rmie_6{font-size:var(--link-default-font-size);font-family:var(--link-default-font-family);line-height:var(--link-default-line-height);letter-spacing:var(--link-default-letter-spacing)}._list_8rmie_13{position:relative}._list_8rmie_13:after{position:absolute;inset:0;z-index:1000;border:var(--border-1) solid var(--border-divider-border);border-radius:var(--radius-4);box-shadow:var(--innershadow-1);content:"";pointer-events:none}._scroll_8rmie_30{height:240px;overflow-y:auto;border-radius:var(--radius-4)}._header_8rmie_36{visibility:collapse}
@@ -24,6 +24,7 @@ export declare const mockItemPermissions: {
24
24
  };
25
25
  export declare const mockBoxFile: Item;
26
26
  export declare const mockBoxFolder: Item;
27
+ export declare const mockWorkflow: Item;
27
28
  export declare const mockSharedLinkSettings: SharedLinkSettings;
28
29
  export declare const mockSharedLink: SharedLink;
29
30
  export declare const useMockSharedLink: (sharedLinkArg: any) => {
@@ -48,7 +48,7 @@ export type PermissionLevelType = 'can_edit' | 'can_download' | 'can_preview';
48
48
  /**
49
49
  * Supported item types in the Unified Share Modal.
50
50
  */
51
- export type ItemType = 'file' | 'folder' | 'hubs' | 'web_link';
51
+ export type ItemType = 'file' | 'folder' | 'hubs' | 'web_link' | 'workflow';
52
52
  export interface Item {
53
53
  /**
54
54
  * The classification of the item.
@@ -336,7 +336,15 @@ export interface CollaborationRole {
336
336
  }
337
337
  export interface EventService {
338
338
  onCollaboratorsClick?: () => void;
339
- onCollaboratorsManageClick?: () => void;
339
+ /**
340
+ * Custom handler to replace the default "Manage All" link behavior.
341
+ *
342
+ * When provided, prevents the default navigation and calls this handler instead.
343
+ * Useful for opening a CollaboratorsModal or custom dialog without leaving the page.
344
+ *
345
+ * Use this when you want to override the default navigation behavior.
346
+ */
347
+ onCollaboratorsManagementClick?: () => void;
340
348
  onSharedLinkSettingsClick?: () => void;
341
349
  onSharedLinkSettingsClose?: () => void;
342
350
  onSharedLinkSettingsLoad?: () => void;
@@ -371,7 +379,7 @@ export interface SharingService {
371
379
  /**
372
380
  * Function to remove an existing collaborator on the item.
373
381
  *
374
- * Called when the user clicks "Remove" on a collaborator in the list of collaborators.
382
+ * Called when the user clicks the "Remove" icon button on a collaborator.
375
383
  */
376
384
  removeCollaborator?: (collaborator: Collaborator) => Promise<SharingResponse | void>;
377
385
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "1.24.1",
3
+ "version": "1.25.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^12.108.1",