@xiping/react-components 1.0.22 → 1.0.23
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/cjs/components/confetti-button/index.d.ts +4 -4
- package/dist/cjs/components/confetti-button/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/components/confetti-button/index.d.ts +4 -4
- package/dist/es/components/confetti-button/index.js +3 -2
- package/dist/es/index.js +10 -8
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalOptions as ConfettiGlobalOptions, Options as ConfettiOptions } from 'canvas-confetti';
|
|
1
|
+
import { GlobalOptions as ConfettiGlobalOptions, Options as ConfettiOptions, default as confetti } from 'canvas-confetti';
|
|
2
2
|
import { ReactNode, default as React } from 'react';
|
|
3
3
|
type Api = {
|
|
4
4
|
fire: (options?: ConfettiOptions) => void;
|
|
@@ -10,15 +10,15 @@ type Props = React.ComponentPropsWithRef<"canvas"> & {
|
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
};
|
|
12
12
|
export type ConfettiRef = Api | null;
|
|
13
|
-
|
|
13
|
+
declare const Confetti: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<Api>>;
|
|
14
14
|
interface ConfettiButtonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
15
|
options?: ConfettiOptions & ConfettiGlobalOptions & {
|
|
16
16
|
canvas?: HTMLCanvasElement;
|
|
17
17
|
};
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
declare const ConfettiButton: {
|
|
21
21
|
({ options, children, ...props }: ConfettiButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
displayName: string;
|
|
23
23
|
};
|
|
24
|
-
export {};
|
|
24
|
+
export { confetti, ConfettiButton, Confetti };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),d=require("../../node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js"),r=require("react"),w=r.createContext({}),h=r.forwardRef((a,u)=>{const{options:o,globalOptions:c={resize:!0,useWorker:!0},manualstart:i=!1,children:e,...l}=a,t=r.useRef(null),p=r.useCallback(n=>{if(n!==null){if(t.current)return;t.current=d.default.create(n,{...c,resize:!0})}else t.current&&(t.current.reset(),t.current=null)},[c]),s=r.useCallback(async(n={})=>{var y;try{await((y=t.current)==null?void 0:y.call(t,{...o,...n}))}catch(g){console.error("Confetti error:",g)}},[o]),f=r.useMemo(()=>({fire:s}),[s]);return r.useImperativeHandle(u,()=>f,[f]),r.useEffect(()=>{i||(async()=>{try{await s()}catch(n){console.error("Confetti effect error:",n)}})()},[i,s]),C.jsxs(w.Provider,{value:f,children:[C.jsx("canvas",{ref:p,...l}),e]})});h.displayName="Confetti";const x=h,m=({options:a,children:u,...o})=>{const c=async i=>{try{const e=i.currentTarget.getBoundingClientRect(),l=e.left+e.width/2,t=e.top+e.height/2;await d.default({...a,origin:{x:l/window.innerWidth,y:t/window.innerHeight}})}catch(e){console.error("Confetti button error:",e)}};return C.jsx("div",{onClick:c,...o,children:u})};m.displayName="ConfettiButton";const v=m;exports.confetti=d.default;exports.Confetti=x;exports.ConfettiButton=v;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const r=require("./components/button/Button.js"),o=require("./components/txt-reader/TxtReader.js"),n=require("./components/hyper-text/index.js"),i=require("./components/typing-animation/index.js"),u=require("./components/qr-code/index.js"),t=require("./components/confetti-button/index.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const r=require("./components/button/Button.js"),o=require("./components/txt-reader/TxtReader.js"),n=require("./components/hyper-text/index.js"),i=require("./components/typing-animation/index.js"),u=require("./components/qr-code/index.js"),t=require("./components/confetti-button/index.js"),c=require("./hooks/useStayTimeReport.js"),a=require("./components/pinch-content/PinchContent.js"),s=require("./components/image-viewer/ImageViewer.js"),d=require("./components/shimmer-button/ShimmerButton.js"),m=require("./components/image-compare/ImageCompare.js"),q=require("./components/text-animate/TextAnimate.js"),e=require("./components/dock/Duck.js"),T=require("./components/txt-editor/TxtEditor.js"),x=require("./components/message/Message.js"),f=require("./node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js"),p=require("./node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js");exports.Button=r.Button;exports.TxtReader=o.TxtReader;exports.HyperText=n.HyperText;exports.TypingAnimation=i.TypingAnimation;exports.QRCode=u.QRCode;exports.Confetti=t.Confetti;exports.ConfettiButton=t.ConfettiButton;exports.useStayTimeReport=c.useStayTimeReport;exports.PinchContent=a.default;exports.ImageViewer=s.default;exports.ShimmerButton=d.ShimmerButton;exports.ImageCompare=m.default;exports.TextAnimate=q.TextAnimate;exports.Dock=e.Dock;exports.DockIcon=e.DockIcon;exports.dockVariants=e.dockVariants;exports.TxtEditor=T.TxtEditor;exports.Message=x.Message;exports.ForceGraph3D=f.default;exports.confetti=p.default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalOptions as ConfettiGlobalOptions, Options as ConfettiOptions } from 'canvas-confetti';
|
|
1
|
+
import { GlobalOptions as ConfettiGlobalOptions, Options as ConfettiOptions, default as confetti } from 'canvas-confetti';
|
|
2
2
|
import { ReactNode, default as React } from 'react';
|
|
3
3
|
type Api = {
|
|
4
4
|
fire: (options?: ConfettiOptions) => void;
|
|
@@ -10,15 +10,15 @@ type Props = React.ComponentPropsWithRef<"canvas"> & {
|
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
};
|
|
12
12
|
export type ConfettiRef = Api | null;
|
|
13
|
-
|
|
13
|
+
declare const Confetti: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<Api>>;
|
|
14
14
|
interface ConfettiButtonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
15
|
options?: ConfettiOptions & ConfettiGlobalOptions & {
|
|
16
16
|
canvas?: HTMLCanvasElement;
|
|
17
17
|
};
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
declare const ConfettiButton: {
|
|
21
21
|
({ options, children, ...props }: ConfettiButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
displayName: string;
|
|
23
23
|
};
|
|
24
|
-
export {};
|
|
24
|
+
export { confetti, ConfettiButton, Confetti };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as d, jsxs as g } from "react/jsx-runtime";
|
|
3
3
|
import m from "../../node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js";
|
|
4
4
|
import { forwardRef as x, useRef as v, useCallback as C, useMemo as k, useImperativeHandle as B, useEffect as b, createContext as R } from "react";
|
|
5
5
|
const j = R({}), p = x((c, s) => {
|
|
@@ -73,5 +73,6 @@ h.displayName = "ConfettiButton";
|
|
|
73
73
|
const E = h;
|
|
74
74
|
export {
|
|
75
75
|
W as Confetti,
|
|
76
|
-
E as ConfettiButton
|
|
76
|
+
E as ConfettiButton,
|
|
77
|
+
m as confetti
|
|
77
78
|
};
|
package/dist/es/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { Button as
|
|
2
|
+
import { Button as r } from "./components/button/Button.js";
|
|
3
3
|
import { TxtReader as f } from "./components/txt-reader/TxtReader.js";
|
|
4
|
-
import { HyperText as
|
|
4
|
+
import { HyperText as a } from "./components/hyper-text/index.js";
|
|
5
5
|
import { TypingAnimation as n } from "./components/typing-animation/index.js";
|
|
6
6
|
import { QRCode as d } from "./components/qr-code/index.js";
|
|
7
7
|
import { Confetti as u, ConfettiButton as c } from "./components/confetti-button/index.js";
|
|
8
|
-
import { useStayTimeReport as
|
|
9
|
-
import { default as
|
|
8
|
+
import { useStayTimeReport as l } from "./hooks/useStayTimeReport.js";
|
|
9
|
+
import { default as g } from "./components/pinch-content/PinchContent.js";
|
|
10
10
|
import { default as k } from "./components/image-viewer/ImageViewer.js";
|
|
11
11
|
import { ShimmerButton as B } from "./components/shimmer-button/ShimmerButton.js";
|
|
12
12
|
import { default as I } from "./components/image-compare/ImageCompare.js";
|
|
@@ -15,24 +15,26 @@ import { Dock as V, DockIcon as w, dockVariants as E } from "./components/dock/D
|
|
|
15
15
|
import { TxtEditor as G } from "./components/txt-editor/TxtEditor.js";
|
|
16
16
|
import { Message as M } from "./components/message/Message.js";
|
|
17
17
|
import { default as Q } from "./node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js";
|
|
18
|
+
import { default as j } from "./node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js";
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
r as Button,
|
|
20
21
|
u as Confetti,
|
|
21
22
|
c as ConfettiButton,
|
|
22
23
|
V as Dock,
|
|
23
24
|
w as DockIcon,
|
|
24
25
|
Q as ForceGraph3D,
|
|
25
|
-
|
|
26
|
+
a as HyperText,
|
|
26
27
|
I as ImageCompare,
|
|
27
28
|
k as ImageViewer,
|
|
28
29
|
M as Message,
|
|
29
|
-
|
|
30
|
+
g as PinchContent,
|
|
30
31
|
d as QRCode,
|
|
31
32
|
B as ShimmerButton,
|
|
32
33
|
A as TextAnimate,
|
|
33
34
|
G as TxtEditor,
|
|
34
35
|
f as TxtReader,
|
|
35
36
|
n as TypingAnimation,
|
|
37
|
+
j as confetti,
|
|
36
38
|
E as dockVariants,
|
|
37
|
-
|
|
39
|
+
l as useStayTimeReport
|
|
38
40
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiping/react-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.23",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
7
7
|
"module": "./dist/es/index.js",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"engines": {
|
|
108
108
|
"node": ">=20"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "999ecadaa7584954d1920ca2b0e95b2233cd8eb4"
|
|
111
111
|
}
|