react-luminus-components 1.1.26 → 1.1.28
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/.vite/manifest.json +41 -41
- package/dist/{DataKey-BM6Hi4Og.js → DataKey-C3jtX0q4.js} +1 -1
- package/dist/{DataKey-DN_Gd8yX.cjs → DataKey-CuZpR5t0.cjs} +1 -1
- package/dist/{SimpleTooltip-DnZSi_qT.js → SimpleTooltip-BMSn8Fqk.js} +1 -1
- package/dist/{SimpleTooltip-Bg8N9Up2.cjs → SimpleTooltip-XmxUVlDH.cjs} +1 -1
- package/dist/{Typography-C0E6aQv2.cjs → Typography-CHpY2hUz.cjs} +1 -1
- package/dist/{Typography-CsdF39gW.js → Typography-DUoLZCdX.js} +1 -1
- package/dist/{UserAvatarToggle-0_jNWWSB.cjs → UserAvatarToggle-DP4YFoNZ.cjs} +10 -10
- package/dist/{UserAvatarToggle-xT1i6nSz.js → UserAvatarToggle-I_MgjXhA.js} +1658 -1656
- package/dist/contexts/prompt/PromptContext.d.ts +3 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +266 -251
- package/dist/hooks/usePrompt/usePrompt.d.ts +2 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +3 -3
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +83 -82
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +6 -6
- package/dist/models/index.d.ts +1 -0
- package/dist/models/types/PromptOptions.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/useConfirm-BGatkLkP.js +27 -0
- package/dist/useConfirm-D677YHtT.cjs +1 -0
- package/package.json +1 -1
- package/dist/useConfirm-CQp43K_n.js +0 -27
- package/dist/useConfirm-CdQJyKxQ.cjs +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useContext as l, useCallback as u } from "react";
|
|
2
|
+
import { P as p, C as h } from "./UserAvatarToggle-I_MgjXhA.js";
|
|
3
|
+
const x = () => {
|
|
4
|
+
const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = l(p), a = u((n) => {
|
|
5
|
+
r(), o.current(n);
|
|
6
|
+
}, [r, o]), f = u(async (n, m) => (c((i) => ({ ...i, ...m })), t(n), new Promise((i) => {
|
|
7
|
+
o.current = i;
|
|
8
|
+
})), [o, c, t]);
|
|
9
|
+
return { isShown: e, text: s, prompt: f, onFinish: a };
|
|
10
|
+
};
|
|
11
|
+
let C;
|
|
12
|
+
const b = () => {
|
|
13
|
+
const { show: e, text: s, showConfirm: t, hideConfirm: r } = l(h), o = () => {
|
|
14
|
+
r();
|
|
15
|
+
};
|
|
16
|
+
return { confirm: async (n) => (t(n), new Promise((m) => {
|
|
17
|
+
C = m;
|
|
18
|
+
})), onConfirm: () => {
|
|
19
|
+
o(), C(!0);
|
|
20
|
+
}, onCancel: () => {
|
|
21
|
+
o(), C(!1);
|
|
22
|
+
}, show: e, text: s };
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
x as a,
|
|
26
|
+
b as u
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react"),f=require("./UserAvatarToggle-DP4YFoNZ.cjs"),p=()=>{const{isShown:s,text:c,showPrompt:n,hidePrompt:t,resolveRef:o,setOptions:i}=r.useContext(f.PromptContext),a=r.useCallback(e=>{t(),o.current(e)},[t,o]),l=r.useCallback(async(e,m)=>(i(u=>({...u,...m})),n(e),new Promise(u=>{o.current=u})),[o,i,n]);return{isShown:s,text:c,prompt:l,onFinish:a}};let C;const h=()=>{const{show:s,text:c,showConfirm:n,hideConfirm:t}=r.useContext(f.ConfirmContext),o=()=>{t()};return{confirm:async e=>(n(e),new Promise(m=>{C=m})),onConfirm:()=>{o(),C(!0)},onCancel:()=>{o(),C(!1)},show:s,text:c}};exports.useConfirm=h;exports.usePrompt=p;
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useContext as a, useCallback as C } from "react";
|
|
2
|
-
import { P as u, C as p } from "./UserAvatarToggle-xT1i6nSz.js";
|
|
3
|
-
const w = () => {
|
|
4
|
-
const { isShown: e, text: s, showPrompt: r, hidePrompt: t, resolveRef: o } = a(u), i = C((n) => {
|
|
5
|
-
t(), o.current(n);
|
|
6
|
-
}, [t, o]), l = C(async (n) => (console.log(n), r(n), console.log("t"), new Promise((c) => {
|
|
7
|
-
o.current = c;
|
|
8
|
-
})), [o, r]);
|
|
9
|
-
return { isShown: e, text: s, prompt: l, onFinish: i };
|
|
10
|
-
};
|
|
11
|
-
let m;
|
|
12
|
-
const x = () => {
|
|
13
|
-
const { show: e, text: s, showConfirm: r, hideConfirm: t } = a(p), o = () => {
|
|
14
|
-
t();
|
|
15
|
-
};
|
|
16
|
-
return { confirm: async (c) => (r(c), new Promise((f) => {
|
|
17
|
-
m = f;
|
|
18
|
-
})), onConfirm: () => {
|
|
19
|
-
o(), m(!0);
|
|
20
|
-
}, onCancel: () => {
|
|
21
|
-
o(), m(!1);
|
|
22
|
-
}, show: e, text: s };
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
w as a,
|
|
26
|
-
x as u
|
|
27
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("react"),C=require("./UserAvatarToggle-0_jNWWSB.cjs"),f=()=>{const{isShown:s,text:c,showPrompt:n,hidePrompt:t,resolveRef:o}=r.useContext(C.PromptContext),m=r.useCallback(e=>{t(),o.current(e)},[t,o]),u=r.useCallback(async e=>(console.log(e),n(e),console.log("t"),new Promise(i=>{o.current=i})),[o,n]);return{isShown:s,text:c,prompt:u,onFinish:m}};let l;const h=()=>{const{show:s,text:c,showConfirm:n,hideConfirm:t}=r.useContext(C.ConfirmContext),o=()=>{t()};return{confirm:async i=>(n(i),new Promise(a=>{l=a})),onConfirm:()=>{o(),l(!0)},onCancel:()=>{o(),l(!1)},show:s,text:c}};exports.useConfirm=h;exports.usePrompt=f;
|