@box/unified-share-modal 3.1.13 → 3.1.15

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.
@@ -24,7 +24,10 @@ var e = [
24
24
  sharedLinkEmailMessage: !0,
25
25
  sharedLinkPermission: !0,
26
26
  sharedLinkSettings: !0
27
- }, n = [
27
+ }, n = [{
28
+ id: "editor",
29
+ isDefault: !0
30
+ }, { id: "viewer" }], r = [
28
31
  "co_owner",
29
32
  "editor",
30
33
  "previewer",
@@ -32,13 +35,13 @@ var e = [
32
35
  "uploader",
33
36
  "viewer",
34
37
  "viewer_uploader"
35
- ], r = ["owner", ...n], i = [
38
+ ], i = ["owner", ...r], a = [
36
39
  "open",
37
40
  "company",
38
41
  "collaborators"
39
- ], a = [
42
+ ], o = [
40
43
  "can_edit",
41
44
  "can_download",
42
45
  "can_preview"
43
- ], o = "boxnote";
44
- export { t as DEFAULT_CONFIGURATION, e as DEFAULT_NOTIFICATIONS, o as FILE_EXTENSION_BOX_NOTE, i as SUPPORTED_ACCESS_LEVELS, r as SUPPORTED_COLLABORATOR_ROLES, n as SUPPORTED_INVITATION_ROLES, a as SUPPORTED_PERMISSION_LEVELS };
46
+ ], s = "boxnote";
47
+ export { n as DEFAULT_COLLABORATION_ROLES, t as DEFAULT_CONFIGURATION, e as DEFAULT_NOTIFICATIONS, s as FILE_EXTENSION_BOX_NOTE, a as SUPPORTED_ACCESS_LEVELS, i as SUPPORTED_COLLABORATOR_ROLES, r as SUPPORTED_INVITATION_ROLES, o as SUPPORTED_PERMISSION_LEVELS };
@@ -1,49 +1,48 @@
1
- import { DEFAULT_CONFIGURATION as e } from "../constants.js";
2
- import { createContext as t, useContext as n, useEffect as r, useMemo as i, useState as a } from "react";
3
- import { jsx as o } from "react/jsx-runtime";
4
- var s = /*#__PURE__*/ t(null), c = () => {
5
- let e = n(s);
1
+ import { DEFAULT_COLLABORATION_ROLES as e, DEFAULT_CONFIGURATION as t } from "../constants.js";
2
+ import { createContext as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
3
+ import { jsx as s } from "react/jsx-runtime";
4
+ var c = /*#__PURE__*/ n(null), l = () => {
5
+ let e = r(c);
6
6
  if (!e) throw Error("useUnifiedShareModalContext must be used with UnifiedShareModalContext.Provider");
7
7
  return e;
8
- }, l = ({ children: t, collaborationAccess: n, collaborationNotices: c, collaborationRoles: l, collaborators: u, config: d, contactService: f, currentUser: p, eventService: m, initialContacts: h, invitationFormNotices: g, isFetching: _, isOpen: v, isSubmitting: y, item: b, onOpenChange: x, sharedLink: S, sharedLinkNotices: C, sharingService: w, variant: T }) => {
9
- let [E, D] = a(null), [O, k] = a(!1), [A, j] = a("unified-share-form");
10
- r(() => {
11
- v || (k(!1), j("unified-share-form"));
12
- }, [v]);
13
- let M = i(() => ({
14
- collaborationAccess: n,
15
- collaborationNotices: c,
16
- collaborationRoles: l ?? [],
17
- collaborator: E,
18
- collaborators: u ?? [],
8
+ }, u = ({ children: n, collaborationAccess: r, collaborationNotices: l, collaborationRoles: u, collaborators: d, config: f, contactService: p, currentUser: m, eventService: h, initialContacts: g, invitationFormNotices: _, isFetching: v, isOpen: y, isSubmitting: b, item: x, onOpenChange: S, sharedLink: C, sharedLinkNotices: w, sharingService: T, variant: E }) => {
9
+ let [D, O] = o(null), [k, A] = o(!1), [j, M] = o("unified-share-form");
10
+ i(() => {
11
+ y || (A(!1), M("unified-share-form"));
12
+ }, [y]);
13
+ let N = a(() => ({
14
+ collaborationAccess: r,
15
+ collaborationNotices: l,
16
+ collaborationRoles: u ?? e,
17
+ collaborator: D,
18
+ collaborators: d ?? [],
19
19
  config: {
20
- ...e,
21
- ...d
20
+ ...t,
21
+ ...f
22
22
  },
23
- contactService: f ?? {},
24
- currentUser: p ?? {},
25
- eventService: m ?? {},
26
- initialContacts: h ?? [],
27
- invitationFormNotices: g,
28
- isFetching: _,
29
- isOpen: v,
30
- isSubmitting: y ?? O,
31
- item: b,
32
- onOpenChange: x,
33
- setCollaborator: D,
34
- setIsLoading: k,
35
- setView: j,
36
- sharedLink: S ?? {},
37
- sharedLinkNotices: C,
38
- sharingService: w ?? {},
39
- variant: T,
40
- view: A
23
+ contactService: p ?? {},
24
+ currentUser: m ?? {},
25
+ eventService: h ?? {},
26
+ initialContacts: g ?? [],
27
+ invitationFormNotices: _,
28
+ isFetching: v,
29
+ isOpen: y,
30
+ isSubmitting: b ?? k,
31
+ item: x,
32
+ onOpenChange: S,
33
+ setCollaborator: O,
34
+ setIsLoading: A,
35
+ setView: M,
36
+ sharedLink: C ?? {},
37
+ sharedLinkNotices: w,
38
+ sharingService: T ?? {},
39
+ variant: E,
40
+ view: j
41
41
  }), [
42
- n,
43
- c,
42
+ r,
44
43
  l,
45
- E,
46
44
  u,
45
+ D,
47
46
  d,
48
47
  f,
49
48
  p,
@@ -51,8 +50,8 @@ var s = /*#__PURE__*/ t(null), c = () => {
51
50
  h,
52
51
  g,
53
52
  _,
54
- O,
55
53
  v,
54
+ k,
56
55
  y,
57
56
  b,
58
57
  x,
@@ -60,11 +59,12 @@ var s = /*#__PURE__*/ t(null), c = () => {
60
59
  C,
61
60
  w,
62
61
  T,
63
- A
62
+ E,
63
+ j
64
64
  ]);
65
- return /* @__PURE__ */ o(s.Provider, {
66
- value: M,
67
- children: t
65
+ return /* @__PURE__ */ s(c.Provider, {
66
+ value: N,
67
+ children: n
68
68
  });
69
69
  };
70
- export { s as UnifiedShareModalContext, l as UnifiedShareModalProvider, c as useUnifiedShareModalContext };
70
+ export { c as UnifiedShareModalContext, u as UnifiedShareModalProvider, l as useUnifiedShareModalContext };
@@ -1,6 +1,13 @@
1
1
  import { AccessLevelType, Configuration, NotificationType, PermissionLevelType } from './types';
2
2
  export declare const DEFAULT_NOTIFICATIONS: NotificationType[];
3
3
  export declare const DEFAULT_CONFIGURATION: Configuration;
4
+ export declare const DEFAULT_COLLABORATION_ROLES: ({
5
+ id: string;
6
+ isDefault: boolean;
7
+ } | {
8
+ id: string;
9
+ isDefault?: undefined;
10
+ })[];
4
11
  export declare const SUPPORTED_INVITATION_ROLES: string[];
5
12
  export declare const SUPPORTED_COLLABORATOR_ROLES: string[];
6
13
  export declare const SUPPORTED_ACCESS_LEVELS: AccessLevelType[];
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "3.1.13",
3
+ "version": "3.1.15",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^16.4.4",
7
- "@box/blueprint-web-assets": "^5.2.9",
8
- "@box/copy-input": "^2.1.12",
9
- "@box/user-selector": "^2.1.13",
6
+ "@box/blueprint-web": "^16.5.0",
7
+ "@box/blueprint-web-assets": "^5.2.11",
8
+ "@box/copy-input": "^2.1.14",
9
+ "@box/user-selector": "^2.1.15",
10
10
  "lodash": "^4.17.15",
11
11
  "react": "^18.0.0",
12
12
  "react-dom": "^18.0.0",
13
13
  "react-intl": "^6.4.2"
14
14
  },
15
15
  "devDependencies": {
16
- "@box/blueprint-web": "^16.4.4",
17
- "@box/blueprint-web-assets": "^5.2.9",
18
- "@box/copy-input": "^2.1.12",
19
- "@box/eslint-plugin-blueprint": "2.1.7",
20
- "@box/storybook-utils": "1.1.11",
16
+ "@box/blueprint-web": "^16.5.0",
17
+ "@box/blueprint-web-assets": "^5.2.11",
18
+ "@box/copy-input": "^2.1.14",
19
+ "@box/eslint-plugin-blueprint": "2.1.8",
20
+ "@box/storybook-utils": "1.1.13",
21
21
  "react-intl": "^6.4.2"
22
22
  },
23
23
  "publishConfig": {