@box/unified-share-modal 1.47.0 → 1.48.1
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 +1 -1
- package/dist/esm/lib/contexts/unified-share-form-context.js +37 -32
- package/dist/esm/lib/contexts/unified-share-modal-context.js +44 -40
- package/dist/esm/lib/unified-share-modal.js +48 -48
- package/dist/i18n/en-x-pseudo.js +155 -155
- package/dist/i18n/en-x-pseudo.properties +155 -155
- package/dist/types/lib/unified-share-modal.d.ts +67 -0
- package/package.json +9 -9
|
@@ -1,44 +1,49 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
import { useUnifiedShareModalContext as
|
|
3
|
-
import { jsx as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { createContext as V, useContext as b, useState as e, useCallback as g, useEffect as w, useMemo as M } from "react";
|
|
2
|
+
import { useUnifiedShareModalContext as P } from "./unified-share-modal-context.js";
|
|
3
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
4
|
+
const R = /* @__PURE__ */ V(null), q = () => {
|
|
5
|
+
const t = b(R);
|
|
6
6
|
if (!t)
|
|
7
7
|
throw new Error("useUnifiedShareFormContext must be used with UnifiedShareFormProvider");
|
|
8
8
|
return t;
|
|
9
|
-
},
|
|
9
|
+
}, y = ({
|
|
10
10
|
children: t
|
|
11
11
|
}) => {
|
|
12
12
|
const {
|
|
13
|
-
initialContacts:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...
|
|
13
|
+
initialContacts: o,
|
|
14
|
+
isOpen: n
|
|
15
|
+
} = P(), [s, r] = e("default"), [i, U] = e(null), [a, c] = e(o), [l, u] = e(""), [d, f] = e(""), [m, h] = e(), [C, x] = e({}), S = g((p) => {
|
|
16
|
+
x((v) => ({
|
|
17
|
+
...v,
|
|
18
|
+
...p
|
|
18
19
|
}));
|
|
19
|
-
}, [])
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
}, []);
|
|
21
|
+
w(() => {
|
|
22
|
+
n || (r("default"), c(o), u(""), f(""), h(void 0), x({}));
|
|
23
|
+
}, [o, n]);
|
|
24
|
+
const F = M(() => ({
|
|
25
|
+
collaborationRole: m,
|
|
26
|
+
contactValue: l,
|
|
27
|
+
containerRef: i,
|
|
28
|
+
form: s,
|
|
29
|
+
messageValue: d,
|
|
30
|
+
setCollaborationRole: h,
|
|
31
|
+
setContactValue: u,
|
|
32
|
+
setContainerRef: U,
|
|
33
|
+
setForm: r,
|
|
34
|
+
setMessageValue: f,
|
|
35
|
+
setShieldRestriction: S,
|
|
36
|
+
setUserContacts: c,
|
|
37
|
+
shieldRestriction: C,
|
|
38
|
+
userContacts: a
|
|
39
|
+
}), [m, l, i, s, S, d, C, a]);
|
|
40
|
+
return /* @__PURE__ */ E(R.Provider, {
|
|
41
|
+
value: F,
|
|
37
42
|
children: t
|
|
38
43
|
});
|
|
39
44
|
};
|
|
40
45
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
R as UnifiedShareFormContext,
|
|
47
|
+
y as UnifiedShareFormProvider,
|
|
48
|
+
q as useUnifiedShareFormContext
|
|
44
49
|
};
|
|
@@ -1,64 +1,68 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
import { DEFAULT_CONFIGURATION as
|
|
3
|
-
import { jsx as
|
|
4
|
-
const
|
|
5
|
-
const e =
|
|
1
|
+
import { createContext as T, useContext as V, useState as v, useEffect as j, useMemo as A } from "react";
|
|
2
|
+
import { DEFAULT_CONFIGURATION as D } from "../constants.js";
|
|
3
|
+
import { jsx as F } from "react/jsx-runtime";
|
|
4
|
+
const E = /* @__PURE__ */ T(null), R = () => {
|
|
5
|
+
const e = V(E);
|
|
6
6
|
if (!e)
|
|
7
7
|
throw new Error("useUnifiedShareModalContext must be used with UnifiedShareModalContext.Provider");
|
|
8
8
|
return e;
|
|
9
|
-
},
|
|
9
|
+
}, _ = ({
|
|
10
10
|
children: e,
|
|
11
|
-
collaborationAccess:
|
|
11
|
+
collaborationAccess: r,
|
|
12
12
|
collaborationNotices: t,
|
|
13
|
-
collaborationRoles:
|
|
14
|
-
collaborators:
|
|
15
|
-
config:
|
|
13
|
+
collaborationRoles: d,
|
|
14
|
+
collaborators: f,
|
|
15
|
+
config: n,
|
|
16
16
|
contactService: u,
|
|
17
17
|
currentUser: a,
|
|
18
|
-
eventService:
|
|
19
|
-
initialContacts:
|
|
20
|
-
isFetching:
|
|
21
|
-
isOpen:
|
|
18
|
+
eventService: i,
|
|
19
|
+
initialContacts: s,
|
|
20
|
+
isFetching: l,
|
|
21
|
+
isOpen: o,
|
|
22
22
|
isSubmitting: x,
|
|
23
23
|
item: m,
|
|
24
|
-
onOpenChange:
|
|
25
|
-
sharedLink:
|
|
26
|
-
sharingService:
|
|
27
|
-
variant:
|
|
24
|
+
onOpenChange: h,
|
|
25
|
+
sharedLink: C,
|
|
26
|
+
sharingService: U,
|
|
27
|
+
variant: c
|
|
28
28
|
}) => {
|
|
29
|
-
const [
|
|
30
|
-
|
|
29
|
+
const [M, P] = v(null), [w, S] = v("unified-share-form");
|
|
30
|
+
j(() => {
|
|
31
|
+
o || S("unified-share-form");
|
|
32
|
+
}, [o]);
|
|
33
|
+
const I = A(() => ({
|
|
34
|
+
collaborationAccess: r,
|
|
31
35
|
collaborationNotices: t,
|
|
32
|
-
collaborationRoles:
|
|
33
|
-
collaborator:
|
|
34
|
-
collaborators:
|
|
36
|
+
collaborationRoles: d ?? [],
|
|
37
|
+
collaborator: M,
|
|
38
|
+
collaborators: f ?? [],
|
|
35
39
|
config: {
|
|
36
|
-
...
|
|
37
|
-
...
|
|
40
|
+
...D,
|
|
41
|
+
...n
|
|
38
42
|
},
|
|
39
43
|
contactService: u ?? {},
|
|
40
44
|
currentUser: a ?? {},
|
|
41
|
-
eventService:
|
|
42
|
-
initialContacts:
|
|
43
|
-
isFetching:
|
|
44
|
-
isOpen:
|
|
45
|
+
eventService: i ?? {},
|
|
46
|
+
initialContacts: s ?? [],
|
|
47
|
+
isFetching: l,
|
|
48
|
+
isOpen: o,
|
|
45
49
|
isSubmitting: x,
|
|
46
50
|
item: m,
|
|
47
|
-
onOpenChange:
|
|
51
|
+
onOpenChange: h,
|
|
48
52
|
setCollaborator: P,
|
|
49
|
-
setView:
|
|
50
|
-
sharedLink:
|
|
51
|
-
sharingService:
|
|
52
|
-
variant:
|
|
53
|
+
setView: S,
|
|
54
|
+
sharedLink: C ?? {},
|
|
55
|
+
sharingService: U ?? {},
|
|
56
|
+
variant: c,
|
|
53
57
|
view: w
|
|
54
|
-
}), [
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
value:
|
|
58
|
+
}), [r, t, d, M, f, n, u, a, i, s, l, o, x, m, h, C, U, c, w]);
|
|
59
|
+
return /* @__PURE__ */ F(E.Provider, {
|
|
60
|
+
value: I,
|
|
57
61
|
children: e
|
|
58
62
|
});
|
|
59
63
|
};
|
|
60
64
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
E as UnifiedShareModalContext,
|
|
66
|
+
_ as UnifiedShareModalProvider,
|
|
67
|
+
R as useUnifiedShareModalContext
|
|
64
68
|
};
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as m, useEffect as c, useCallback as D } from "react";
|
|
2
2
|
import { UnifiedShareBase as E } from "./unified-share-base.js";
|
|
3
|
-
import { jsx as
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
4
|
import { UnifiedShareModalProvider as F } from "./contexts/unified-share-modal-context.js";
|
|
5
5
|
function A({
|
|
6
|
-
children:
|
|
7
|
-
collaborationAccess:
|
|
6
|
+
children: o,
|
|
7
|
+
collaborationAccess: l,
|
|
8
8
|
collaborationNotices: n,
|
|
9
|
-
collaborationRoles:
|
|
10
|
-
collaborators:
|
|
11
|
-
config:
|
|
12
|
-
contactService:
|
|
13
|
-
currentUser:
|
|
14
|
-
eventService:
|
|
15
|
-
initialContacts:
|
|
16
|
-
isFetching:
|
|
17
|
-
isOpen:
|
|
18
|
-
isSubmitting:
|
|
19
|
-
item:
|
|
20
|
-
onLoad:
|
|
21
|
-
onOpenChange:
|
|
22
|
-
sharedLink:
|
|
23
|
-
sharingService:
|
|
24
|
-
variant:
|
|
9
|
+
collaborationRoles: u,
|
|
10
|
+
collaborators: h,
|
|
11
|
+
config: p,
|
|
12
|
+
contactService: U,
|
|
13
|
+
currentUser: S,
|
|
14
|
+
eventService: g,
|
|
15
|
+
initialContacts: k,
|
|
16
|
+
isFetching: x,
|
|
17
|
+
isOpen: e,
|
|
18
|
+
isSubmitting: I,
|
|
19
|
+
item: M,
|
|
20
|
+
onLoad: i,
|
|
21
|
+
onOpenChange: f,
|
|
22
|
+
sharedLink: b,
|
|
23
|
+
sharingService: j,
|
|
24
|
+
variant: s = "modal"
|
|
25
25
|
}) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
(async () => (
|
|
31
|
-
}, []);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
collaborationAccess:
|
|
26
|
+
const w = !o || s === "desktop", [t, r] = m(e ?? w), [y, B] = m(!!i);
|
|
27
|
+
c(() => {
|
|
28
|
+
e !== void 0 && r(e);
|
|
29
|
+
}, [e]), c(() => {
|
|
30
|
+
(async () => i && (t && await i(), B(!t)))();
|
|
31
|
+
}, [t, i]);
|
|
32
|
+
const C = D((d) => {
|
|
33
|
+
e === void 0 && s !== "desktop" && r(d), f && f(d);
|
|
34
|
+
}, [e, f, s]);
|
|
35
|
+
return /* @__PURE__ */ a(F, {
|
|
36
|
+
collaborationAccess: l,
|
|
37
37
|
collaborationNotices: n,
|
|
38
|
-
collaborationRoles:
|
|
39
|
-
collaborators:
|
|
40
|
-
config:
|
|
41
|
-
contactService:
|
|
42
|
-
currentUser:
|
|
43
|
-
eventService:
|
|
44
|
-
initialContacts:
|
|
45
|
-
isFetching:
|
|
46
|
-
isOpen:
|
|
47
|
-
isSubmitting:
|
|
48
|
-
item:
|
|
49
|
-
onOpenChange:
|
|
50
|
-
sharedLink:
|
|
51
|
-
sharingService:
|
|
52
|
-
variant:
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
children:
|
|
38
|
+
collaborationRoles: u,
|
|
39
|
+
collaborators: h,
|
|
40
|
+
config: p,
|
|
41
|
+
contactService: U,
|
|
42
|
+
currentUser: S,
|
|
43
|
+
eventService: g,
|
|
44
|
+
initialContacts: k,
|
|
45
|
+
isFetching: x ?? y,
|
|
46
|
+
isOpen: t,
|
|
47
|
+
isSubmitting: I,
|
|
48
|
+
item: M,
|
|
49
|
+
onOpenChange: C,
|
|
50
|
+
sharedLink: b,
|
|
51
|
+
sharingService: j,
|
|
52
|
+
variant: s,
|
|
53
|
+
children: /* @__PURE__ */ a(E, {
|
|
54
|
+
children: o
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
}
|