@bigbinary/neeto-image-uploader-frontend 1.3.2 → 1.4.1

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.js CHANGED
@@ -15420,7 +15420,7 @@ var useFetchUnsplashImages = function useFetchUnsplashImages(_ref2) {
15420
15420
 
15421
15421
  function cov_1hbj0u25oo() {
15422
15422
  var path = "/home/runner/work/neeto-image-uploader-nano/neeto-image-uploader-nano/app/javascript/src/components/ImageLibrary/utils.js";
15423
- var hash = "870cb6de5c05330de38467ffa73657cf7d079c56";
15423
+ var hash = "fcaa7907ec1589175eea68f7f52ab72a6c89d23c";
15424
15424
  var global = new Function("return this")();
15425
15425
  var gcv = "__coverage__";
15426
15426
  var coverageData = {
@@ -15532,27 +15532,37 @@ function cov_1hbj0u25oo() {
15532
15532
  column: 34
15533
15533
  },
15534
15534
  end: {
15535
- line: 52,
15535
+ line: 57,
15536
15536
  column: 1
15537
15537
  }
15538
15538
  },
15539
15539
  "11": {
15540
15540
  start: {
15541
15541
  line: 41,
15542
- column: 19
15542
+ column: 33
15543
15543
  },
15544
15544
  end: {
15545
15545
  line: 41,
15546
- column: 53
15546
+ column: 102
15547
15547
  }
15548
15548
  },
15549
15549
  "12": {
15550
15550
  start: {
15551
- line: 43,
15551
+ line: 42,
15552
+ column: 19
15553
+ },
15554
+ end: {
15555
+ line: 46,
15556
+ column: 3
15557
+ }
15558
+ },
15559
+ "13": {
15560
+ start: {
15561
+ line: 48,
15552
15562
  column: 2
15553
15563
  },
15554
15564
  end: {
15555
- line: 51,
15565
+ line: 56,
15556
15566
  column: 5
15557
15567
  }
15558
15568
  }
@@ -15648,7 +15658,7 @@ function cov_1hbj0u25oo() {
15648
15658
  column: 48
15649
15659
  },
15650
15660
  end: {
15651
- line: 52,
15661
+ line: 57,
15652
15662
  column: 1
15653
15663
  }
15654
15664
  },
@@ -15692,35 +15702,35 @@ function cov_1hbj0u25oo() {
15692
15702
  "1": {
15693
15703
  loc: {
15694
15704
  start: {
15695
- line: 46,
15705
+ line: 51,
15696
15706
  column: 12
15697
15707
  },
15698
15708
  end: {
15699
- line: 46,
15709
+ line: 51,
15700
15710
  column: 67
15701
15711
  }
15702
15712
  },
15703
15713
  type: "binary-expr",
15704
15714
  locations: [{
15705
15715
  start: {
15706
- line: 46,
15716
+ line: 51,
15707
15717
  column: 12
15708
15718
  },
15709
15719
  end: {
15710
- line: 46,
15720
+ line: 51,
15711
15721
  column: 39
15712
15722
  }
15713
15723
  }, {
15714
15724
  start: {
15715
- line: 46,
15725
+ line: 51,
15716
15726
  column: 43
15717
15727
  },
15718
15728
  end: {
15719
- line: 46,
15729
+ line: 51,
15720
15730
  column: 67
15721
15731
  }
15722
15732
  }],
15723
- line: 46
15733
+ line: 51
15724
15734
  }
15725
15735
  },
15726
15736
  s: {
@@ -15736,7 +15746,8 @@ function cov_1hbj0u25oo() {
15736
15746
  "9": 0,
15737
15747
  "10": 0,
15738
15748
  "11": 0,
15739
- "12": 0
15749
+ "12": 0,
15750
+ "13": 0
15740
15751
  },
15741
15752
  f: {
15742
15753
  "0": 0,
@@ -15749,7 +15760,7 @@ function cov_1hbj0u25oo() {
15749
15760
  "1": [0, 0]
15750
15761
  },
15751
15762
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
15752
- hash: "870cb6de5c05330de38467ffa73657cf7d079c56"
15763
+ hash: "fcaa7907ec1589175eea68f7f52ab72a6c89d23c"
15753
15764
  };
15754
15765
  var coverage = global[gcv] || (global[gcv] = {});
15755
15766
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -15808,13 +15819,16 @@ var uploadWithDirectUpload = function uploadWithDirectUpload(file) {
15808
15819
  cov_1hbj0u25oo().s[10]++;
15809
15820
  var uploadWithImageKit = /*#__PURE__*/function () {
15810
15821
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
15811
- var imagekit;
15822
+ var authenticationEndpoint, imagekit;
15812
15823
  return _regeneratorRuntime.wrap(function _callee$(_context) {
15813
15824
  while (1) switch (_context.prev = _context.next) {
15814
15825
  case 0:
15815
15826
  cov_1hbj0u25oo().f[3]++;
15816
- imagekit = (cov_1hbj0u25oo().s[11]++, new ImageKit(globalProps.imageKit));
15817
- cov_1hbj0u25oo().s[12]++;
15827
+ authenticationEndpoint = (cov_1hbj0u25oo().s[11]++, "".concat(window.location.origin, "/neeto_image_uploader_engine/imagekit/auth"));
15828
+ imagekit = (cov_1hbj0u25oo().s[12]++, new ImageKit(mergeRight(globalProps.imageKit, {
15829
+ authenticationEndpoint: authenticationEndpoint
15830
+ })));
15831
+ cov_1hbj0u25oo().s[13]++;
15818
15832
  return _context.abrupt("return", imagekit.upload({
15819
15833
  file: file,
15820
15834
  fileName: UNSPLASH_DEFAULT_NAME,
@@ -15824,7 +15838,7 @@ var uploadWithImageKit = /*#__PURE__*/function () {
15824
15838
  appName: globalProps.appName
15825
15839
  }
15826
15840
  }));
15827
- case 4:
15841
+ case 5:
15828
15842
  case "end":
15829
15843
  return _context.stop();
15830
15844
  }
@@ -17954,7 +17968,7 @@ var Modal = function Modal(_ref) {
17954
17968
  cov_2my1w2udyi().f[3]++;
17955
17969
  cov_2my1w2udyi().s[14]++;
17956
17970
  onUploadComplete({
17957
- url: image.metadata.url,
17971
+ url: image.blobUrl,
17958
17972
  signedId: image.signedId
17959
17973
  });
17960
17974
  },
@@ -18427,7 +18441,7 @@ var ProgressBar = function ProgressBar(_ref) {
18427
18441
 
18428
18442
  function cov_1avu3clziw() {
18429
18443
  var path = "/home/runner/work/neeto-image-uploader-nano/neeto-image-uploader-nano/app/javascript/src/components/ImageUploader/index.jsx";
18430
- var hash = "73a1be321949a6ae2a12973342243fe3dde7d66e";
18444
+ var hash = "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3";
18431
18445
  var global = new Function("return this")();
18432
18446
  var gcv = "__coverage__";
18433
18447
  var coverageData = {
@@ -18670,7 +18684,7 @@ function cov_1avu3clziw() {
18670
18684
  },
18671
18685
  end: {
18672
18686
  line: 52,
18673
- column: 32
18687
+ column: 20
18674
18688
  }
18675
18689
  },
18676
18690
  "24": {
@@ -18769,18 +18783,18 @@ function cov_1avu3clziw() {
18769
18783
  column: 4
18770
18784
  },
18771
18785
  end: {
18772
- line: 87,
18786
+ line: 88,
18773
18787
  column: 7
18774
18788
  }
18775
18789
  },
18776
18790
  "34": {
18777
18791
  start: {
18778
- line: 88,
18779
- column: 4
18792
+ line: 86,
18793
+ column: 23
18780
18794
  },
18781
18795
  end: {
18782
- line: 88,
18783
- column: 27
18796
+ line: 86,
18797
+ column: 38
18784
18798
  }
18785
18799
  },
18786
18800
  "35": {
@@ -19035,6 +19049,30 @@ function cov_1avu3clziw() {
19035
19049
  },
19036
19050
  "7": {
19037
19051
  name: "(anonymous_7)",
19052
+ decl: {
19053
+ start: {
19054
+ line: 86,
19055
+ column: 17
19056
+ },
19057
+ end: {
19058
+ line: 86,
19059
+ column: 18
19060
+ }
19061
+ },
19062
+ loc: {
19063
+ start: {
19064
+ line: 86,
19065
+ column: 23
19066
+ },
19067
+ end: {
19068
+ line: 86,
19069
+ column: 38
19070
+ }
19071
+ },
19072
+ line: 86
19073
+ },
19074
+ "8": {
19075
+ name: "(anonymous_8)",
19038
19076
  decl: {
19039
19077
  start: {
19040
19078
  line: 129,
@@ -19057,8 +19095,8 @@ function cov_1avu3clziw() {
19057
19095
  },
19058
19096
  line: 129
19059
19097
  },
19060
- "8": {
19061
- name: "(anonymous_8)",
19098
+ "9": {
19099
+ name: "(anonymous_9)",
19062
19100
  decl: {
19063
19101
  start: {
19064
19102
  line: 160,
@@ -19081,8 +19119,8 @@ function cov_1avu3clziw() {
19081
19119
  },
19082
19120
  line: 160
19083
19121
  },
19084
- "9": {
19085
- name: "(anonymous_9)",
19122
+ "10": {
19123
+ name: "(anonymous_10)",
19086
19124
  decl: {
19087
19125
  start: {
19088
19126
  line: 163,
@@ -19105,8 +19143,8 @@ function cov_1avu3clziw() {
19105
19143
  },
19106
19144
  line: 163
19107
19145
  },
19108
- "10": {
19109
- name: "(anonymous_10)",
19146
+ "11": {
19147
+ name: "(anonymous_11)",
19110
19148
  decl: {
19111
19149
  start: {
19112
19150
  line: 181,
@@ -19467,7 +19505,8 @@ function cov_1avu3clziw() {
19467
19505
  "7": 0,
19468
19506
  "8": 0,
19469
19507
  "9": 0,
19470
- "10": 0
19508
+ "10": 0,
19509
+ "11": 0
19471
19510
  },
19472
19511
  b: {
19473
19512
  "0": [0],
@@ -19481,7 +19520,7 @@ function cov_1avu3clziw() {
19481
19520
  "8": [0, 0]
19482
19521
  },
19483
19522
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
19484
- hash: "73a1be321949a6ae2a12973342243fe3dde7d66e"
19523
+ hash: "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3"
19485
19524
  };
19486
19525
  var coverage = global[gcv] || (global[gcv] = {});
19487
19526
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -19561,7 +19600,7 @@ var ImageUploader = function ImageUploader(_ref) {
19561
19600
  }));
19562
19601
  cov_1avu3clziw().s[17]++;
19563
19602
  onChange({
19564
- url: attachedImage.metadata.url,
19603
+ url: attachedImage.blobUrl,
19565
19604
  signedId: attachedImage.signedId
19566
19605
  });
19567
19606
  cov_1avu3clziw().s[18]++;
@@ -19577,7 +19616,7 @@ var ImageUploader = function ImageUploader(_ref) {
19577
19616
  cov_1avu3clziw().s[22]++;
19578
19617
  onChange(image);
19579
19618
  cov_1avu3clziw().s[23]++;
19580
- setSignedId(image.signedId);
19619
+ setSignedId("");
19581
19620
  cov_1avu3clziw().s[24]++;
19582
19621
  setIsEditorOpen(false);
19583
19622
  };
@@ -19633,11 +19672,14 @@ var ImageUploader = function ImageUploader(_ref) {
19633
19672
  cov_1avu3clziw().s[33]++;
19634
19673
  updateBlob(payload, {
19635
19674
  onSuccess: handleSuccess,
19675
+ onSettled: function onSettled() {
19676
+ cov_1avu3clziw().f[7]++;
19677
+ cov_1avu3clziw().s[34]++;
19678
+ return setSignedId("");
19679
+ },
19636
19680
  onError: Toastr.error
19637
19681
  });
19638
- cov_1avu3clziw().s[34]++;
19639
- setIsEditorOpen(false);
19640
- case 7:
19682
+ case 5:
19641
19683
  case "end":
19642
19684
  return _context.stop();
19643
19685
  }
@@ -19691,7 +19733,7 @@ var ImageUploader = function ImageUploader(_ref) {
19691
19733
  style: "link",
19692
19734
  onClick: function onClick() {
19693
19735
  var _inputRef$current;
19694
- cov_1avu3clziw().f[7]++;
19736
+ cov_1avu3clziw().f[8]++;
19695
19737
  cov_1avu3clziw().s[39]++;
19696
19738
  return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
19697
19739
  }
@@ -19719,13 +19761,13 @@ var ImageUploader = function ImageUploader(_ref) {
19719
19761
  isOpen: isEditorOpen,
19720
19762
  size: "large",
19721
19763
  onClose: function onClose() {
19722
- cov_1avu3clziw().f[8]++;
19764
+ cov_1avu3clziw().f[9]++;
19723
19765
  cov_1avu3clziw().s[40]++;
19724
19766
  return setIsEditorOpen(false);
19725
19767
  }
19726
19768
  }, /*#__PURE__*/React.createElement(ImageEditor, {
19727
19769
  handleReset: function handleReset() {
19728
- cov_1avu3clziw().f[9]++;
19770
+ cov_1avu3clziw().f[10]++;
19729
19771
  cov_1avu3clziw().s[41]++;
19730
19772
  return setIsEditorOpen(false);
19731
19773
  },
@@ -19739,7 +19781,7 @@ var ImageUploader = function ImageUploader(_ref) {
19739
19781
  })), /*#__PURE__*/React.createElement(Modal, {
19740
19782
  isOpen: isAssetLibraryOpen,
19741
19783
  onClose: function onClose() {
19742
- cov_1avu3clziw().f[10]++;
19784
+ cov_1avu3clziw().f[11]++;
19743
19785
  cov_1avu3clziw().s[42]++;
19744
19786
  return setIsAssetLibraryOpen(false);
19745
19787
  },