@chao-component/bag-animation-ui 1.0.9 → 1.0.11

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/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Bag Animation UI
2
+
3
+ 一个用于显示 APNG 动画的 React 组件,支持全屏遮罩和交互式拖拽。
4
+
5
+ ## 开发
6
+
7
+ ### 安装依赖
8
+
9
+ ```bash
10
+ npm install
11
+ ```
12
+
13
+ ### 开发模式(预览组件效果)
14
+
15
+ ```bash
16
+ npm run demo
17
+ ```
18
+
19
+ 这会在 `http://localhost:3000` 启动开发服务器,你可以在浏览器中实时预览组件效果。
20
+
21
+ ### 构建组件
22
+
23
+ ```bash
24
+ npm run build
25
+ ```
26
+
27
+ ### 构建演示页面
28
+
29
+ ```bash
30
+ npm run demo:build
31
+ ```
32
+
33
+ ## 使用
34
+
35
+ 查看 [USAGE.md](./USAGE.md) 了解详细使用说明。
36
+
37
+ ## 快速开始
38
+
39
+ 查看 [QUICK_START.md](./QUICK_START.md) 了解快速开始指南。
40
+
package/dist/index.d.mts CHANGED
@@ -6,11 +6,12 @@ interface BagAnimationProps {
6
6
  defaultImage?: string;
7
7
  defaultImageAlt?: string;
8
8
  swipeHintText?: string;
9
+ boxOpeningText?: string;
9
10
  showMask?: boolean;
10
11
  maskOpacity?: number;
11
12
  maskBlur?: number;
12
13
  }
13
- declare function BagAnimation({ doneFunction, frames, defaultImage, defaultImageAlt, swipeHintText, showMask, maskOpacity, maskBlur }: BagAnimationProps): react_jsx_runtime.JSX.Element;
14
+ declare function BagAnimation({ doneFunction, frames, defaultImage, defaultImageAlt, swipeHintText, boxOpeningText, showMask, maskOpacity, maskBlur }: BagAnimationProps): react_jsx_runtime.JSX.Element;
14
15
 
15
16
  /**
16
17
  * 获取打包后的资源路径
package/dist/index.d.ts CHANGED
@@ -6,11 +6,12 @@ interface BagAnimationProps {
6
6
  defaultImage?: string;
7
7
  defaultImageAlt?: string;
8
8
  swipeHintText?: string;
9
+ boxOpeningText?: string;
9
10
  showMask?: boolean;
10
11
  maskOpacity?: number;
11
12
  maskBlur?: number;
12
13
  }
13
- declare function BagAnimation({ doneFunction, frames, defaultImage, defaultImageAlt, swipeHintText, showMask, maskOpacity, maskBlur }: BagAnimationProps): react_jsx_runtime.JSX.Element;
14
+ declare function BagAnimation({ doneFunction, frames, defaultImage, defaultImageAlt, swipeHintText, boxOpeningText, showMask, maskOpacity, maskBlur }: BagAnimationProps): react_jsx_runtime.JSX.Element;
14
15
 
15
16
  /**
16
17
  * 获取打包后的资源路径
package/dist/index.js CHANGED
@@ -807,6 +807,7 @@ function BagAnimation({
807
807
  defaultImage = defaultImagePath,
808
808
  defaultImageAlt = "Weedza Mystery Box",
809
809
  swipeHintText = "Swipe to open",
810
+ boxOpeningText = "Box Opening...",
810
811
  showMask = true,
811
812
  maskOpacity = 0.7,
812
813
  maskBlur = 8
@@ -1029,7 +1030,7 @@ function BagAnimation({
1029
1030
  setShowSwipeHint(true);
1030
1031
  }
1031
1032
  };
1032
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1033
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex w-full relative justify-center items-center", children: [
1033
1034
  isAnimating && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1034
1035
  showMask && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1035
1036
  "div",
@@ -1135,9 +1136,10 @@ function BagAnimation({
1135
1136
  }
1136
1137
  )
1137
1138
  }
1138
- )
1139
+ ),
1140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "fixed z-[101] top-0 left-0 w-full h-[10%] flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-theme_gold animate-pulse text-sm md:text-base text-center z-[101]", children: boxOpeningText }) })
1139
1141
  ] }),
1140
- !isAnimating && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1141
1143
  "img",
1142
1144
  {
1143
1145
  src: mysteryBoxImage,
@@ -1148,7 +1150,7 @@ function BagAnimation({
1148
1150
  className: "w-36 h-36 md:w-96 md:h-96 object-contain relative z-10"
1149
1151
  }
1150
1152
  )
1151
- ] });
1153
+ ] }) });
1152
1154
  }
1153
1155
  // Annotate the CommonJS export names for ESM import in node:
1154
1156
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -791,6 +791,7 @@ function BagAnimation({
791
791
  defaultImage = defaultImagePath,
792
792
  defaultImageAlt = "Weedza Mystery Box",
793
793
  swipeHintText = "Swipe to open",
794
+ boxOpeningText = "Box Opening...",
794
795
  showMask = true,
795
796
  maskOpacity = 0.7,
796
797
  maskBlur = 8
@@ -1013,7 +1014,7 @@ function BagAnimation({
1013
1014
  setShowSwipeHint(true);
1014
1015
  }
1015
1016
  };
1016
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1017
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "flex w-full relative justify-center items-center", children: [
1017
1018
  isAnimating && /* @__PURE__ */ jsxs(Fragment, { children: [
1018
1019
  showMask && /* @__PURE__ */ jsx(
1019
1020
  "div",
@@ -1119,9 +1120,10 @@ function BagAnimation({
1119
1120
  }
1120
1121
  )
1121
1122
  }
1122
- )
1123
+ ),
1124
+ /* @__PURE__ */ jsx("div", { className: "fixed z-[101] top-0 left-0 w-full h-[10%] flex justify-center items-center", children: /* @__PURE__ */ jsx("p", { className: "text-theme_gold animate-pulse text-sm md:text-base text-center z-[101]", children: boxOpeningText }) })
1123
1125
  ] }),
1124
- !isAnimating && /* @__PURE__ */ jsx(
1126
+ /* @__PURE__ */ jsx(
1125
1127
  "img",
1126
1128
  {
1127
1129
  src: mysteryBoxImage,
@@ -1132,7 +1134,7 @@ function BagAnimation({
1132
1134
  className: "w-36 h-36 md:w-96 md:h-96 object-contain relative z-10"
1133
1135
  }
1134
1136
  )
1135
- ] });
1137
+ ] }) });
1136
1138
  }
1137
1139
  export {
1138
1140
  BagAnimation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chao-component/bag-animation-ui",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,9 @@
24
24
  },
25
25
  "scripts": {
26
26
  "build": "tsup",
27
- "dev": "tsup --watch"
27
+ "dev": "tsup --watch",
28
+ "demo": "vite --config vite.config.demo.ts",
29
+ "demo:build": "vite build --config vite.config.demo.ts"
28
30
  },
29
31
  "keywords": [],
30
32
  "author": "",
@@ -39,6 +41,13 @@
39
41
  "@types/react": "^19.2.7",
40
42
  "@types/react-dom": "^19.2.3",
41
43
  "tsup": "^8.5.1",
42
- "typescript": "^5.9.3"
44
+ "typescript": "^5.9.3",
45
+ "vite": "^5.0.0",
46
+ "@vitejs/plugin-react": "^4.2.0",
47
+ "react": "^19.2.3",
48
+ "react-dom": "^19.2.3",
49
+ "tailwindcss": "^3.4.0",
50
+ "postcss": "^8.4.0",
51
+ "autoprefixer": "^10.4.0"
43
52
  }
44
53
  }