@bbki.ng/components 2.1.26 → 2.1.29

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/index.cjs CHANGED
@@ -566,8 +566,6 @@ var import_react17 = require("react");
566
566
 
567
567
  // lib/drop-image/utils.ts
568
568
  var wait = (d) => new Promise((r) => setTimeout(r, d));
569
- var noop = () => {
570
- };
571
569
 
572
570
  // lib/drop-image/useDropImage.ts
573
571
  var import_react15 = require("react");
@@ -575,7 +573,7 @@ var useDropImage = (params) => {
575
573
  const [isDragOver, setIsDragOver] = (0, import_react15.useState)(false);
576
574
  const [imageSrc, setImageSrc] = (0, import_react15.useState)("");
577
575
  const [imageSize, setImageSize] = (0, import_react15.useState)({ width: 0, height: 0 });
578
- const imageFile = (0, import_react15.useRef)(null);
576
+ const imageFile = (0, import_react15.useRef)();
579
577
  const {
580
578
  portraitImageWidth = 384,
581
579
  landscapeImageWidth = 500,
@@ -610,6 +608,9 @@ var useDropImage = (params) => {
610
608
  const handleDragOver = (0, import_react15.useCallback)((ev) => {
611
609
  ev.preventDefault();
612
610
  setIsDragOver(true);
611
+ if (!ev.dataTransfer) {
612
+ return;
613
+ }
613
614
  ev.dataTransfer.dropEffect = "move";
614
615
  }, []);
615
616
  const handleDragLeave = (0, import_react15.useCallback)(() => {
@@ -618,8 +619,8 @@ var useDropImage = (params) => {
618
619
  const handleDrop = (0, import_react15.useCallback)((ev) => {
619
620
  ev.preventDefault();
620
621
  setIsDragOver(false);
621
- const file = ev.dataTransfer.files[0];
622
- if (!file || !file.type.startsWith("image")) {
622
+ const file = ev.dataTransfer ? ev.dataTransfer.files[0] : void 0;
623
+ if (!file || !file.type.startsWith("image") || !imageFile.current) {
623
624
  return;
624
625
  }
625
626
  imageFile.current = file;
@@ -699,8 +700,10 @@ var ImagePreviewer = (props) => {
699
700
  };
700
701
  var GhostDropImage = (props) => {
701
702
  const {
702
- onDrop = noop,
703
- onUploadFinish = noop,
703
+ onDrop = () => {
704
+ },
705
+ onUploadFinish = () => {
706
+ },
704
707
  uploader,
705
708
  waitTimeAfterFinish = 2e3,
706
709
  className = "",
@@ -776,7 +779,8 @@ var DropImage = (props) => {
776
779
  waitTimeAfterFinish = 2e3,
777
780
  placeholder = "",
778
781
  className = "",
779
- onUploadFinish = noop,
782
+ onUploadFinish = () => {
783
+ },
780
784
  ghost,
781
785
  children,
782
786
  dropAreaStyle = {
@@ -1157,10 +1161,10 @@ var VERTEX_SHADER = `
1157
1161
 
1158
1162
  varying vec3 vColor;
1159
1163
 
1160
- vec3 curve(float _percent, float _length) {
1164
+ vec3 curve(float _percent) {
1161
1165
  const float PI2 = 3.141592653589793 * 2.0;
1162
- float radius = 0.028 / 0.15 * _length;
1163
-
1166
+ const float _length = 0.3;
1167
+ const float radius = 0.056;
1164
1168
  float t = mod(_percent, 0.25) / 0.25;
1165
1169
  t = mod(_percent, 0.25) - (2.0 * (1.0 - t) * t * -0.0185 + t * t * 0.25);
1166
1170
  float x = _length * sin(PI2 * _percent);
@@ -1190,7 +1194,7 @@ var VERTEX_SHADER = `
1190
1194
  * uModelMatrix
1191
1195
  * uViewMatrix
1192
1196
  * rotateX(uProgress)
1193
- * vec4(curve(${"aPercent" /* PERCENT */}, 0.8), 1.0);
1197
+ * vec4(curve(${"aPercent" /* PERCENT */}), 1.0);
1194
1198
 
1195
1199
  gl_PointSize = ${"aPointSize" /* POINT_SIZE */};
1196
1200
  }
@@ -1243,7 +1247,8 @@ var LoadingSpiral = (props) => {
1243
1247
  const phenomenon = new import_phenomenon.default({
1244
1248
  settings: createSettings({ canvas: canvasRef.current, step }),
1245
1249
  context: {
1246
- antialias: true
1250
+ antialias: true,
1251
+ alpha: true
1247
1252
  }
1248
1253
  });
1249
1254
  phenomenon.add(
@@ -1252,11 +1257,9 @@ var LoadingSpiral = (props) => {
1252
1257
  );
1253
1258
  }, []);
1254
1259
  return /* @__PURE__ */ import_react22.default.createElement("canvas", {
1255
- width: 200,
1256
- height: 200,
1257
1260
  style: {
1258
- width: 200,
1259
- height: 200,
1261
+ maxWidth: 500,
1262
+ maxHeight: 500,
1260
1263
  imageRendering: "pixelated"
1261
1264
  },
1262
1265
  ref: canvasRef,