@bbki.ng/components 2.1.27 → 2.1.30

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,7 +619,7 @@ 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
+ const file = ev.dataTransfer ? ev.dataTransfer.files[0] : void 0;
622
623
  if (!file || !file.type.startsWith("image")) {
623
624
  return;
624
625
  }
@@ -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 = {