@artaio/arta-browser 2.19.0 → 2.19.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.
Files changed (66) hide show
  1. package/dist/ModalStatus.js +3 -4
  2. package/dist/arta.js +26 -39
  3. package/dist/bundle.js +1 -1
  4. package/dist/components/Date/SimpleDate.js +11 -11
  5. package/dist/components/Date/index.js +13 -13
  6. package/dist/components/Destination/countriesWithoutPostalCode.js +5 -4
  7. package/dist/components/Destination/index.js +20 -25
  8. package/dist/components/Disqualified/index.js +15 -14
  9. package/dist/components/DrawerFooter/index.js +7 -6
  10. package/dist/components/DrawerHeader/index.js +8 -8
  11. package/dist/components/DrawerInsurance/index.js +7 -6
  12. package/dist/components/Footer/index.js +7 -7
  13. package/dist/components/Header/index.js +7 -7
  14. package/dist/components/Invalidated/index.js +7 -7
  15. package/dist/components/Loading/index.js +7 -6
  16. package/dist/components/Modal/index.css.js +7 -0
  17. package/dist/components/Modal/index.d.ts +0 -1
  18. package/dist/components/Modal/index.js +67 -132
  19. package/dist/components/Package/index.js +24 -25
  20. package/dist/components/PackageEvents/index.js +43 -88
  21. package/dist/components/Pill/index.js +8 -8
  22. package/dist/components/Quotes/index.js +26 -25
  23. package/dist/components/SelectTrackingShipment/index.js +31 -35
  24. package/dist/components/ShipToFrom/index.js +13 -13
  25. package/dist/components/ShipmentException/icons/ExceptionIcon.js +12 -12
  26. package/dist/components/ShipmentException/icons/HexagonAlertBase.js +7 -7
  27. package/dist/components/ShipmentException/icons/HexagonPauseBase.js +7 -7
  28. package/dist/components/ShipmentException/icons/HexagonStopBase.js +7 -7
  29. package/dist/components/ShipmentException/index.js +25 -27
  30. package/dist/components/Summary/index.js +7 -7
  31. package/dist/components/Timeline/CheckedStep.js +12 -12
  32. package/dist/components/Timeline/CheckedSteps.js +7 -7
  33. package/dist/components/Timeline/EmptyStep.js +7 -7
  34. package/dist/components/Timeline/SecondaryStep.js +7 -7
  35. package/dist/components/Timeline/SecondarySteps.js +7 -7
  36. package/dist/components/Timeline/TimelineDefault.js +22 -22
  37. package/dist/components/Timeline/TimlineMinimal.js +24 -25
  38. package/dist/components/Timeline/defaultIcons/CancelledIcon.js +8 -8
  39. package/dist/components/Timeline/defaultIcons/CollectedIcon.js +9 -9
  40. package/dist/components/Timeline/defaultIcons/CompletedIcon.js +9 -9
  41. package/dist/components/Timeline/defaultIcons/ConfirmedIcon.js +9 -9
  42. package/dist/components/Timeline/defaultIcons/InTransitIcon.js +9 -9
  43. package/dist/components/Timeline/defaultIcons/PendingIcon.js +8 -8
  44. package/dist/components/Timeline/icons/CancelledIconBase.js +7 -7
  45. package/dist/components/Timeline/icons/CollectedIconBase.js +7 -7
  46. package/dist/components/Timeline/icons/CompletedIconBase.js +7 -7
  47. package/dist/components/Timeline/icons/ConfirmedIconBase.js +7 -7
  48. package/dist/components/Timeline/icons/InTransitIconBase.js +7 -7
  49. package/dist/components/Timeline/icons/PendingIconBase.js +7 -7
  50. package/dist/components/Timeline/index.js +9 -9
  51. package/dist/components/TrackingDrawer/index.css.js +7 -0
  52. package/dist/components/TrackingDrawer/index.d.ts +0 -1
  53. package/dist/components/TrackingDrawer/index.js +33 -81
  54. package/dist/components/TrackingShipment/index.js +27 -66
  55. package/dist/components/TrackingTop/index.js +14 -14
  56. package/dist/estimate.js +41 -83
  57. package/dist/estimateConfig.js +16 -14
  58. package/dist/fixtures/countries.js +5 -4
  59. package/dist/helper.js +61 -64
  60. package/dist/index.js +15 -34
  61. package/dist/requests.js +71 -191
  62. package/dist/tracking.js +77 -128
  63. package/dist/trackingConfig.js +11 -9
  64. package/package.json +8 -5
  65. package/dist/MetadataTypes.js +0 -2
  66. package/dist/typing.js +0 -1
@@ -1,7 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+
3
3
  exports.ModalStatus = void 0;
4
- var ModalStatus;
5
4
  (function (ModalStatus) {
6
5
  ModalStatus[ModalStatus["CLOSED"] = 0] = "CLOSED";
7
6
  ModalStatus[ModalStatus["DISQUALIFIED"] = 1] = "DISQUALIFIED";
@@ -9,4 +8,4 @@ var ModalStatus;
9
8
  ModalStatus[ModalStatus["OPEN"] = 3] = "OPEN";
10
9
  ModalStatus[ModalStatus["QUOTED"] = 4] = "QUOTED";
11
10
  ModalStatus[ModalStatus["INVALIDATED"] = 5] = "INVALIDATED";
12
- })(ModalStatus || (exports.ModalStatus = ModalStatus = {}));
11
+ })(exports.ModalStatus || (exports.ModalStatus = {}));
package/dist/arta.js CHANGED
@@ -1,59 +1,46 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var estimateConfig_1 = require("./estimateConfig");
18
- var trackingConfig_1 = require("./trackingConfig");
19
- var estimate_1 = __importDefault(require("./estimate"));
20
- var tracking_1 = __importDefault(require("./tracking"));
21
- var defaultConfig = {
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var estimateConfig = require('./estimateConfig.js');
6
+ var trackingConfig = require('./trackingConfig.js');
7
+ var estimate = require('./estimate.js');
8
+ var tracking = require('./tracking.js');
9
+
10
+ const defaultConfig = {
22
11
  host: 'api.arta.io',
23
12
  httpSchema: 'https',
24
13
  };
25
- var Arta = /** @class */ (function () {
26
- function Arta() {
27
- }
28
- Arta.prototype.init = function (apiKey, config) {
29
- this.config = Object.assign(__assign(__assign({}, defaultConfig), { apiKey: apiKey }), config);
14
+ class Arta {
15
+ el;
16
+ config;
17
+ init(apiKey, config) {
18
+ this.config = Object.assign({ ...defaultConfig, apiKey }, config);
30
19
  if (document.querySelectorAll('#arta-widget').length) {
31
20
  return;
32
21
  }
33
22
  this.el = document.createElement('div');
34
23
  this.el.id = 'arta-widget';
35
24
  document.body.appendChild(this.el);
36
- };
37
- Arta.prototype.estimate = function (estimateBody, esimateConfig) {
38
- if (esimateConfig === void 0) { esimateConfig = {}; }
25
+ }
26
+ estimate(estimateBody, esimateConfig = {}) {
39
27
  if (this.config && this.el) {
40
- var fullEstimateConfig = (0, estimateConfig_1.getFullEstimateConfig)(this.config, esimateConfig);
41
- return new estimate_1.default(estimateBody, fullEstimateConfig, this.el);
28
+ const fullEstimateConfig = estimateConfig.getFullEstimateConfig(this.config, esimateConfig);
29
+ return new estimate.default(estimateBody, fullEstimateConfig, this.el);
42
30
  }
43
31
  else {
44
32
  throw new Error('Please initialize the SDK with Arta.init before creating estimates');
45
33
  }
46
- };
47
- Arta.prototype.tracking = function (shipmentId, trackingConfig) {
48
- if (trackingConfig === void 0) { trackingConfig = {}; }
34
+ }
35
+ tracking(shipmentId, trackingConfig$1 = {}) {
49
36
  if (this.config && this.el) {
50
- var fullTrackingConfig = (0, trackingConfig_1.getFullTrackingConfig)(this.config, trackingConfig);
51
- return new tracking_1.default(shipmentId, fullTrackingConfig, this.el);
37
+ const fullTrackingConfig = trackingConfig.getFullTrackingConfig(this.config, trackingConfig$1);
38
+ return new tracking.default(shipmentId, fullTrackingConfig, this.el);
52
39
  }
53
40
  else {
54
41
  throw new Error('Please initialize the SDK with Arta.init before creating tracking');
55
42
  }
56
- };
57
- return Arta;
58
- }());
43
+ }
44
+ }
45
+
59
46
  exports.default = Arta;