@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.cjs.js CHANGED
@@ -15430,7 +15430,7 @@ var useFetchUnsplashImages = function useFetchUnsplashImages(_ref2) {
15430
15430
 
15431
15431
  function cov_1hbj0u25oo() {
15432
15432
  var path = "/home/runner/work/neeto-image-uploader-nano/neeto-image-uploader-nano/app/javascript/src/components/ImageLibrary/utils.js";
15433
- var hash = "870cb6de5c05330de38467ffa73657cf7d079c56";
15433
+ var hash = "fcaa7907ec1589175eea68f7f52ab72a6c89d23c";
15434
15434
  var global = new Function("return this")();
15435
15435
  var gcv = "__coverage__";
15436
15436
  var coverageData = {
@@ -15542,27 +15542,37 @@ function cov_1hbj0u25oo() {
15542
15542
  column: 34
15543
15543
  },
15544
15544
  end: {
15545
- line: 52,
15545
+ line: 57,
15546
15546
  column: 1
15547
15547
  }
15548
15548
  },
15549
15549
  "11": {
15550
15550
  start: {
15551
15551
  line: 41,
15552
- column: 19
15552
+ column: 33
15553
15553
  },
15554
15554
  end: {
15555
15555
  line: 41,
15556
- column: 53
15556
+ column: 102
15557
15557
  }
15558
15558
  },
15559
15559
  "12": {
15560
15560
  start: {
15561
- line: 43,
15561
+ line: 42,
15562
+ column: 19
15563
+ },
15564
+ end: {
15565
+ line: 46,
15566
+ column: 3
15567
+ }
15568
+ },
15569
+ "13": {
15570
+ start: {
15571
+ line: 48,
15562
15572
  column: 2
15563
15573
  },
15564
15574
  end: {
15565
- line: 51,
15575
+ line: 56,
15566
15576
  column: 5
15567
15577
  }
15568
15578
  }
@@ -15658,7 +15668,7 @@ function cov_1hbj0u25oo() {
15658
15668
  column: 48
15659
15669
  },
15660
15670
  end: {
15661
- line: 52,
15671
+ line: 57,
15662
15672
  column: 1
15663
15673
  }
15664
15674
  },
@@ -15702,35 +15712,35 @@ function cov_1hbj0u25oo() {
15702
15712
  "1": {
15703
15713
  loc: {
15704
15714
  start: {
15705
- line: 46,
15715
+ line: 51,
15706
15716
  column: 12
15707
15717
  },
15708
15718
  end: {
15709
- line: 46,
15719
+ line: 51,
15710
15720
  column: 67
15711
15721
  }
15712
15722
  },
15713
15723
  type: "binary-expr",
15714
15724
  locations: [{
15715
15725
  start: {
15716
- line: 46,
15726
+ line: 51,
15717
15727
  column: 12
15718
15728
  },
15719
15729
  end: {
15720
- line: 46,
15730
+ line: 51,
15721
15731
  column: 39
15722
15732
  }
15723
15733
  }, {
15724
15734
  start: {
15725
- line: 46,
15735
+ line: 51,
15726
15736
  column: 43
15727
15737
  },
15728
15738
  end: {
15729
- line: 46,
15739
+ line: 51,
15730
15740
  column: 67
15731
15741
  }
15732
15742
  }],
15733
- line: 46
15743
+ line: 51
15734
15744
  }
15735
15745
  },
15736
15746
  s: {
@@ -15746,7 +15756,8 @@ function cov_1hbj0u25oo() {
15746
15756
  "9": 0,
15747
15757
  "10": 0,
15748
15758
  "11": 0,
15749
- "12": 0
15759
+ "12": 0,
15760
+ "13": 0
15750
15761
  },
15751
15762
  f: {
15752
15763
  "0": 0,
@@ -15759,7 +15770,7 @@ function cov_1hbj0u25oo() {
15759
15770
  "1": [0, 0]
15760
15771
  },
15761
15772
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
15762
- hash: "870cb6de5c05330de38467ffa73657cf7d079c56"
15773
+ hash: "fcaa7907ec1589175eea68f7f52ab72a6c89d23c"
15763
15774
  };
15764
15775
  var coverage = global[gcv] || (global[gcv] = {});
15765
15776
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -15818,13 +15829,16 @@ var uploadWithDirectUpload = function uploadWithDirectUpload(file) {
15818
15829
  cov_1hbj0u25oo().s[10]++;
15819
15830
  var uploadWithImageKit = /*#__PURE__*/function () {
15820
15831
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
15821
- var imagekit;
15832
+ var authenticationEndpoint, imagekit;
15822
15833
  return _regeneratorRuntime.wrap(function _callee$(_context) {
15823
15834
  while (1) switch (_context.prev = _context.next) {
15824
15835
  case 0:
15825
15836
  cov_1hbj0u25oo().f[3]++;
15826
- imagekit = (cov_1hbj0u25oo().s[11]++, new ImageKit(initializers.globalProps.imageKit));
15827
- cov_1hbj0u25oo().s[12]++;
15837
+ authenticationEndpoint = (cov_1hbj0u25oo().s[11]++, "".concat(window.location.origin, "/neeto_image_uploader_engine/imagekit/auth"));
15838
+ imagekit = (cov_1hbj0u25oo().s[12]++, new ImageKit(ramda.mergeRight(initializers.globalProps.imageKit, {
15839
+ authenticationEndpoint: authenticationEndpoint
15840
+ })));
15841
+ cov_1hbj0u25oo().s[13]++;
15828
15842
  return _context.abrupt("return", imagekit.upload({
15829
15843
  file: file,
15830
15844
  fileName: UNSPLASH_DEFAULT_NAME,
@@ -15834,7 +15848,7 @@ var uploadWithImageKit = /*#__PURE__*/function () {
15834
15848
  appName: initializers.globalProps.appName
15835
15849
  }
15836
15850
  }));
15837
- case 4:
15851
+ case 5:
15838
15852
  case "end":
15839
15853
  return _context.stop();
15840
15854
  }
@@ -17964,7 +17978,7 @@ var Modal = function Modal(_ref) {
17964
17978
  cov_2my1w2udyi().f[3]++;
17965
17979
  cov_2my1w2udyi().s[14]++;
17966
17980
  onUploadComplete({
17967
- url: image.metadata.url,
17981
+ url: image.blobUrl,
17968
17982
  signedId: image.signedId
17969
17983
  });
17970
17984
  },
@@ -18437,7 +18451,7 @@ var ProgressBar = function ProgressBar(_ref) {
18437
18451
 
18438
18452
  function cov_1avu3clziw() {
18439
18453
  var path = "/home/runner/work/neeto-image-uploader-nano/neeto-image-uploader-nano/app/javascript/src/components/ImageUploader/index.jsx";
18440
- var hash = "73a1be321949a6ae2a12973342243fe3dde7d66e";
18454
+ var hash = "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3";
18441
18455
  var global = new Function("return this")();
18442
18456
  var gcv = "__coverage__";
18443
18457
  var coverageData = {
@@ -18680,7 +18694,7 @@ function cov_1avu3clziw() {
18680
18694
  },
18681
18695
  end: {
18682
18696
  line: 52,
18683
- column: 32
18697
+ column: 20
18684
18698
  }
18685
18699
  },
18686
18700
  "24": {
@@ -18779,18 +18793,18 @@ function cov_1avu3clziw() {
18779
18793
  column: 4
18780
18794
  },
18781
18795
  end: {
18782
- line: 87,
18796
+ line: 88,
18783
18797
  column: 7
18784
18798
  }
18785
18799
  },
18786
18800
  "34": {
18787
18801
  start: {
18788
- line: 88,
18789
- column: 4
18802
+ line: 86,
18803
+ column: 23
18790
18804
  },
18791
18805
  end: {
18792
- line: 88,
18793
- column: 27
18806
+ line: 86,
18807
+ column: 38
18794
18808
  }
18795
18809
  },
18796
18810
  "35": {
@@ -19045,6 +19059,30 @@ function cov_1avu3clziw() {
19045
19059
  },
19046
19060
  "7": {
19047
19061
  name: "(anonymous_7)",
19062
+ decl: {
19063
+ start: {
19064
+ line: 86,
19065
+ column: 17
19066
+ },
19067
+ end: {
19068
+ line: 86,
19069
+ column: 18
19070
+ }
19071
+ },
19072
+ loc: {
19073
+ start: {
19074
+ line: 86,
19075
+ column: 23
19076
+ },
19077
+ end: {
19078
+ line: 86,
19079
+ column: 38
19080
+ }
19081
+ },
19082
+ line: 86
19083
+ },
19084
+ "8": {
19085
+ name: "(anonymous_8)",
19048
19086
  decl: {
19049
19087
  start: {
19050
19088
  line: 129,
@@ -19067,8 +19105,8 @@ function cov_1avu3clziw() {
19067
19105
  },
19068
19106
  line: 129
19069
19107
  },
19070
- "8": {
19071
- name: "(anonymous_8)",
19108
+ "9": {
19109
+ name: "(anonymous_9)",
19072
19110
  decl: {
19073
19111
  start: {
19074
19112
  line: 160,
@@ -19091,8 +19129,8 @@ function cov_1avu3clziw() {
19091
19129
  },
19092
19130
  line: 160
19093
19131
  },
19094
- "9": {
19095
- name: "(anonymous_9)",
19132
+ "10": {
19133
+ name: "(anonymous_10)",
19096
19134
  decl: {
19097
19135
  start: {
19098
19136
  line: 163,
@@ -19115,8 +19153,8 @@ function cov_1avu3clziw() {
19115
19153
  },
19116
19154
  line: 163
19117
19155
  },
19118
- "10": {
19119
- name: "(anonymous_10)",
19156
+ "11": {
19157
+ name: "(anonymous_11)",
19120
19158
  decl: {
19121
19159
  start: {
19122
19160
  line: 181,
@@ -19477,7 +19515,8 @@ function cov_1avu3clziw() {
19477
19515
  "7": 0,
19478
19516
  "8": 0,
19479
19517
  "9": 0,
19480
- "10": 0
19518
+ "10": 0,
19519
+ "11": 0
19481
19520
  },
19482
19521
  b: {
19483
19522
  "0": [0],
@@ -19491,7 +19530,7 @@ function cov_1avu3clziw() {
19491
19530
  "8": [0, 0]
19492
19531
  },
19493
19532
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
19494
- hash: "73a1be321949a6ae2a12973342243fe3dde7d66e"
19533
+ hash: "5d7f552e0d851142d8649f86544e6c5b0d4b8ae3"
19495
19534
  };
19496
19535
  var coverage = global[gcv] || (global[gcv] = {});
19497
19536
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -19571,7 +19610,7 @@ var ImageUploader = function ImageUploader(_ref) {
19571
19610
  }));
19572
19611
  cov_1avu3clziw().s[17]++;
19573
19612
  onChange({
19574
- url: attachedImage.metadata.url,
19613
+ url: attachedImage.blobUrl,
19575
19614
  signedId: attachedImage.signedId
19576
19615
  });
19577
19616
  cov_1avu3clziw().s[18]++;
@@ -19587,7 +19626,7 @@ var ImageUploader = function ImageUploader(_ref) {
19587
19626
  cov_1avu3clziw().s[22]++;
19588
19627
  onChange(image);
19589
19628
  cov_1avu3clziw().s[23]++;
19590
- setSignedId(image.signedId);
19629
+ setSignedId("");
19591
19630
  cov_1avu3clziw().s[24]++;
19592
19631
  setIsEditorOpen(false);
19593
19632
  };
@@ -19643,11 +19682,14 @@ var ImageUploader = function ImageUploader(_ref) {
19643
19682
  cov_1avu3clziw().s[33]++;
19644
19683
  updateBlob(payload, {
19645
19684
  onSuccess: handleSuccess,
19685
+ onSettled: function onSettled() {
19686
+ cov_1avu3clziw().f[7]++;
19687
+ cov_1avu3clziw().s[34]++;
19688
+ return setSignedId("");
19689
+ },
19646
19690
  onError: neetoui.Toastr.error
19647
19691
  });
19648
- cov_1avu3clziw().s[34]++;
19649
- setIsEditorOpen(false);
19650
- case 7:
19692
+ case 5:
19651
19693
  case "end":
19652
19694
  return _context.stop();
19653
19695
  }
@@ -19701,7 +19743,7 @@ var ImageUploader = function ImageUploader(_ref) {
19701
19743
  style: "link",
19702
19744
  onClick: function onClick() {
19703
19745
  var _inputRef$current;
19704
- cov_1avu3clziw().f[7]++;
19746
+ cov_1avu3clziw().f[8]++;
19705
19747
  cov_1avu3clziw().s[39]++;
19706
19748
  return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
19707
19749
  }
@@ -19729,13 +19771,13 @@ var ImageUploader = function ImageUploader(_ref) {
19729
19771
  isOpen: isEditorOpen,
19730
19772
  size: "large",
19731
19773
  onClose: function onClose() {
19732
- cov_1avu3clziw().f[8]++;
19774
+ cov_1avu3clziw().f[9]++;
19733
19775
  cov_1avu3clziw().s[40]++;
19734
19776
  return setIsEditorOpen(false);
19735
19777
  }
19736
19778
  }, /*#__PURE__*/React__default["default"].createElement(ImageEditor, {
19737
19779
  handleReset: function handleReset() {
19738
- cov_1avu3clziw().f[9]++;
19780
+ cov_1avu3clziw().f[10]++;
19739
19781
  cov_1avu3clziw().s[41]++;
19740
19782
  return setIsEditorOpen(false);
19741
19783
  },
@@ -19749,7 +19791,7 @@ var ImageUploader = function ImageUploader(_ref) {
19749
19791
  })), /*#__PURE__*/React__default["default"].createElement(Modal, {
19750
19792
  isOpen: isAssetLibraryOpen,
19751
19793
  onClose: function onClose() {
19752
- cov_1avu3clziw().f[10]++;
19794
+ cov_1avu3clziw().f[11]++;
19753
19795
  cov_1avu3clziw().s[42]++;
19754
19796
  return setIsAssetLibraryOpen(false);
19755
19797
  },