@artaio/arta-browser 2.5.0 → 2.9.3-fixes-ci-and-pending038bddcebe8a6d451f2c916a417b98c4e79cb8b1
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/arta.d.ts +5 -1
- package/dist/arta.js +14 -1
- package/dist/bundle.js +1 -1
- package/dist/components/Date/SimpleDate.d.ts +6 -0
- package/dist/components/Date/SimpleDate.js +25 -0
- package/dist/components/Date/index.d.ts +6 -0
- package/dist/components/Date/index.js +39 -0
- package/dist/components/DrawerFooter/index.d.ts +1 -0
- package/dist/components/DrawerFooter/index.js +19 -0
- package/dist/components/DrawerHeader/index.d.ts +6 -0
- package/dist/components/DrawerHeader/index.js +20 -0
- package/dist/components/DrawerInsurance/index.d.ts +1 -0
- package/dist/components/DrawerInsurance/index.js +19 -0
- package/dist/components/Footer/index.d.ts +3 -1
- package/dist/components/Footer/index.js +3 -2
- package/dist/components/Loading/index.js +1 -1
- package/dist/components/Modal/index.css +8 -2
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Package/index.d.ts +10 -0
- package/dist/components/Package/index.js +57 -0
- package/dist/components/PackageEvents/index.d.ts +15 -0
- package/dist/components/PackageEvents/index.js +131 -0
- package/dist/components/Pill/index.d.ts +8 -0
- package/dist/components/Pill/index.js +20 -0
- package/dist/components/ShipToFrom/index.d.ts +7 -0
- package/dist/components/ShipToFrom/index.js +29 -0
- package/dist/components/ShipmentException/icons/ExceptionIcon.d.ts +7 -0
- package/dist/components/ShipmentException/icons/ExceptionIcon.js +18 -0
- package/dist/components/ShipmentException/icons/HexagonAlertBase.d.ts +4 -0
- package/dist/components/ShipmentException/icons/HexagonAlertBase.js +20 -0
- package/dist/components/ShipmentException/icons/HexagonPauseBase.d.ts +4 -0
- package/dist/components/ShipmentException/icons/HexagonPauseBase.js +20 -0
- package/dist/components/ShipmentException/icons/HexagonStopBase.d.ts +4 -0
- package/dist/components/ShipmentException/icons/HexagonStopBase.js +20 -0
- package/dist/components/ShipmentException/index.d.ts +8 -0
- package/dist/components/ShipmentException/index.js +97 -0
- package/dist/components/Summary/index.d.ts +7 -0
- package/dist/components/Summary/index.js +20 -0
- package/dist/components/Timeline/CheckedStep.d.ts +8 -0
- package/dist/components/Timeline/CheckedStep.js +26 -0
- package/dist/components/Timeline/CheckedSteps.d.ts +4 -0
- package/dist/components/Timeline/CheckedSteps.js +20 -0
- package/dist/components/Timeline/EmptyStep.d.ts +3 -0
- package/dist/components/Timeline/EmptyStep.js +20 -0
- package/dist/components/Timeline/SecondaryStep.d.ts +4 -0
- package/dist/components/Timeline/SecondaryStep.js +20 -0
- package/dist/components/Timeline/SecondarySteps.d.ts +4 -0
- package/dist/components/Timeline/SecondarySteps.js +20 -0
- package/dist/components/Timeline/TimelineDefault.d.ts +2 -0
- package/dist/components/Timeline/TimelineDefault.js +44 -0
- package/dist/components/Timeline/TimlineMinimal.d.ts +2 -0
- package/dist/components/Timeline/TimlineMinimal.js +45 -0
- package/dist/components/Timeline/defaultIcons/CancelledIcon.d.ts +4 -0
- package/dist/components/Timeline/defaultIcons/CancelledIcon.js +21 -0
- package/dist/components/Timeline/defaultIcons/CollectedIcon.d.ts +2 -0
- package/dist/components/Timeline/defaultIcons/CollectedIcon.js +22 -0
- package/dist/components/Timeline/defaultIcons/CompletedIcon.d.ts +2 -0
- package/dist/components/Timeline/defaultIcons/CompletedIcon.js +22 -0
- package/dist/components/Timeline/defaultIcons/ConfirmedIcon.d.ts +2 -0
- package/dist/components/Timeline/defaultIcons/ConfirmedIcon.js +22 -0
- package/dist/components/Timeline/defaultIcons/InTransitIcon.d.ts +2 -0
- package/dist/components/Timeline/defaultIcons/InTransitIcon.js +22 -0
- package/dist/components/Timeline/defaultIcons/PendingIcon.d.ts +4 -0
- package/dist/components/Timeline/defaultIcons/PendingIcon.js +21 -0
- package/dist/components/Timeline/icons/CancelledIconBase.d.ts +4 -0
- package/dist/components/Timeline/icons/CancelledIconBase.js +20 -0
- package/dist/components/Timeline/icons/CollectedIconBase.d.ts +4 -0
- package/dist/components/Timeline/icons/CollectedIconBase.js +20 -0
- package/dist/components/Timeline/icons/CompletedIconBase.d.ts +4 -0
- package/dist/components/Timeline/icons/CompletedIconBase.js +20 -0
- package/dist/components/Timeline/icons/ConfirmedIconBase.d.ts +4 -0
- package/dist/components/Timeline/icons/ConfirmedIconBase.js +20 -0
- package/dist/components/Timeline/icons/InTransitIconBase.d.ts +4 -0
- package/dist/components/Timeline/icons/InTransitIconBase.js +20 -0
- package/dist/components/Timeline/icons/PendingIconBase.d.ts +4 -0
- package/dist/components/Timeline/icons/PendingIconBase.js +20 -0
- package/dist/components/Timeline/index.d.ts +7 -0
- package/dist/components/Timeline/index.js +22 -0
- package/dist/components/TrackingDrawer/index.css +1079 -0
- package/dist/components/TrackingDrawer/index.d.ts +114 -0
- package/dist/components/TrackingDrawer/index.js +98 -0
- package/dist/components/TrackingTop/index.d.ts +7 -0
- package/dist/components/TrackingTop/index.js +76 -0
- package/dist/estimate.js +0 -3
- package/dist/estimateConfig.d.ts +5 -8
- package/dist/estimateConfig.js +4 -27
- package/dist/helper.d.ts +22 -1
- package/dist/helper.js +49 -6
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2 -0
- package/dist/requests.d.ts +5 -0
- package/dist/requests.js +75 -27
- package/dist/tracking.d.ts +14 -0
- package/dist/tracking.js +86 -0
- package/dist/trackingConfig.d.ts +106 -0
- package/dist/trackingConfig.js +136 -0
- package/package.json +2 -2
package/dist/requests.js
CHANGED
|
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.validateEstimateBody = exports.loadQuoteRequests = exports.loadHostedSessions = void 0;
|
|
50
|
+
exports.loadPackageEvents = exports.validateShipment = exports.loadShipment = exports.validateEstimateBody = exports.loadQuoteRequests = exports.loadHostedSessions = void 0;
|
|
51
51
|
var AUTH_KEY = 'ARTA_APIKey';
|
|
52
52
|
var logError = function (_a) {
|
|
53
53
|
var status = _a.status, errors = _a.errors;
|
|
@@ -73,33 +73,38 @@ var logError = function (_a) {
|
|
|
73
73
|
console.error('Unkonwn error', status, errors);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
var artaRequest = function (path, config, body, headers
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
76
|
+
var artaRequest = function (path, config, body, headers, method) {
|
|
77
|
+
if (method === void 0) { method = 'POST'; }
|
|
78
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
+
var schema, res, resBody, err;
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
switch (_a.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
schema = config.httpSchema ? config.httpSchema : 'https';
|
|
84
|
+
return [4 /*yield*/, fetch("".concat(schema, "://").concat(config.host).concat(path), {
|
|
85
|
+
method: method,
|
|
86
|
+
body: body,
|
|
87
|
+
headers: __assign(__assign({}, headers), { Authorization: "".concat(AUTH_KEY, " ").concat(config.apiKey), 'Content-Type': 'application/json' }),
|
|
88
|
+
})];
|
|
89
|
+
case 1:
|
|
90
|
+
res = _a.sent();
|
|
91
|
+
return [4 /*yield*/, res.json()];
|
|
92
|
+
case 2:
|
|
93
|
+
resBody = _a.sent();
|
|
94
|
+
if (!res.ok) {
|
|
95
|
+
err = Object.assign({}, {
|
|
96
|
+
errors: resBody['errors'],
|
|
97
|
+
status: res.status,
|
|
98
|
+
statusText: res.statusText,
|
|
99
|
+
});
|
|
100
|
+
logError(err);
|
|
101
|
+
return [2 /*return*/, { err: err }];
|
|
102
|
+
}
|
|
103
|
+
return [2 /*return*/, resBody];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
101
106
|
});
|
|
102
|
-
}
|
|
107
|
+
};
|
|
103
108
|
var loadHostedSessions = function (config, estimateBody) { return __awaiter(void 0, void 0, void 0, function () {
|
|
104
109
|
var path, body, res;
|
|
105
110
|
return __generator(this, function (_a) {
|
|
@@ -151,3 +156,46 @@ var validateEstimateBody = function (config, estimateBody) { return __awaiter(vo
|
|
|
151
156
|
});
|
|
152
157
|
}); };
|
|
153
158
|
exports.validateEstimateBody = validateEstimateBody;
|
|
159
|
+
var loadShipment = function (config, shipmentId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
|
+
var path, res;
|
|
161
|
+
return __generator(this, function (_a) {
|
|
162
|
+
switch (_a.label) {
|
|
163
|
+
case 0:
|
|
164
|
+
path = "/embedded_tracking/shipments/".concat(shipmentId);
|
|
165
|
+
return [4 /*yield*/, artaRequest(path, config, undefined, undefined, 'GET')];
|
|
166
|
+
case 1:
|
|
167
|
+
res = _a.sent();
|
|
168
|
+
return [2 /*return*/, res];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}); };
|
|
172
|
+
exports.loadShipment = loadShipment;
|
|
173
|
+
var validateShipment = function (config, shipmentId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
174
|
+
var path, res;
|
|
175
|
+
var _a;
|
|
176
|
+
return __generator(this, function (_b) {
|
|
177
|
+
switch (_b.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
path = "/embedded_tracking/shipments/".concat(shipmentId, "/validate");
|
|
180
|
+
return [4 /*yield*/, artaRequest(path, config, undefined, undefined, 'GET')];
|
|
181
|
+
case 1:
|
|
182
|
+
res = _b.sent();
|
|
183
|
+
return [2 /*return*/, (_a = res.err) === null || _a === void 0 ? void 0 : _a.errors];
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}); };
|
|
187
|
+
exports.validateShipment = validateShipment;
|
|
188
|
+
var loadPackageEvents = function (config, shipmentId, packageId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
189
|
+
var path, res;
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
path = "/embedded_tracking/package_events/".concat(shipmentId, "/").concat(packageId);
|
|
194
|
+
return [4 /*yield*/, artaRequest(path, config, undefined, undefined, 'GET')];
|
|
195
|
+
case 1:
|
|
196
|
+
res = _a.sent();
|
|
197
|
+
return [2 /*return*/, res];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}); };
|
|
201
|
+
exports.loadPackageEvents = loadPackageEvents;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TrackingFullConfig } from './trackingConfig';
|
|
2
|
+
export default class Tracking {
|
|
3
|
+
private readonly shipmentId;
|
|
4
|
+
private readonly config;
|
|
5
|
+
private readonly el;
|
|
6
|
+
isReady: boolean;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
constructor(shipmentId: string, config: TrackingFullConfig, el: HTMLDivElement);
|
|
9
|
+
open(): void;
|
|
10
|
+
private render;
|
|
11
|
+
close(): void;
|
|
12
|
+
onClose(e: any): void;
|
|
13
|
+
validate(): Promise<undefined>;
|
|
14
|
+
}
|
package/dist/tracking.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
40
|
+
var preact_1 = require("preact");
|
|
41
|
+
var TrackingDrawer_1 = require("./components/TrackingDrawer");
|
|
42
|
+
var requests_1 = require("./requests");
|
|
43
|
+
var Tracking = /** @class */ (function () {
|
|
44
|
+
function Tracking(shipmentId, config, el) {
|
|
45
|
+
this.shipmentId = shipmentId;
|
|
46
|
+
this.config = config;
|
|
47
|
+
this.el = el;
|
|
48
|
+
this.isReady = false;
|
|
49
|
+
this.isOpen = false;
|
|
50
|
+
}
|
|
51
|
+
Tracking.prototype.open = function () {
|
|
52
|
+
this.render();
|
|
53
|
+
this.isOpen = true;
|
|
54
|
+
};
|
|
55
|
+
Tracking.prototype.render = function () {
|
|
56
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)(TrackingDrawer_1.TrackingDrawer, { shipmentId: this.shipmentId, config: this.config, onClose: this.onClose.bind(this) }), this.el);
|
|
57
|
+
};
|
|
58
|
+
Tracking.prototype.close = function () {
|
|
59
|
+
(0, preact_1.render)((0, jsx_runtime_1.jsx)("div", {}), this.el);
|
|
60
|
+
this.isOpen = false;
|
|
61
|
+
};
|
|
62
|
+
Tracking.prototype.onClose = function (e) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
this.close();
|
|
65
|
+
this.isOpen = false;
|
|
66
|
+
};
|
|
67
|
+
Tracking.prototype.validate = function () {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
var errors;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
switch (_a.label) {
|
|
72
|
+
case 0: return [4 /*yield*/, (0, requests_1.validateShipment)(this.config, this.shipmentId)];
|
|
73
|
+
case 1:
|
|
74
|
+
errors = _a.sent();
|
|
75
|
+
if (errors && Object.keys(errors).length > 0) {
|
|
76
|
+
return [2 /*return*/, Promise.reject(errors)];
|
|
77
|
+
}
|
|
78
|
+
this.isReady = true;
|
|
79
|
+
return [2 /*return*/];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
return Tracking;
|
|
85
|
+
}());
|
|
86
|
+
exports.default = Tracking;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ArtaJsFullConfig } from './arta';
|
|
2
|
+
import { DeepPartial } from './helper';
|
|
3
|
+
export interface DateConfig {
|
|
4
|
+
weekdays: {
|
|
5
|
+
sunday: string;
|
|
6
|
+
monday: string;
|
|
7
|
+
tuesday: string;
|
|
8
|
+
wednesday: string;
|
|
9
|
+
thursday: string;
|
|
10
|
+
friday: string;
|
|
11
|
+
saturday: string;
|
|
12
|
+
};
|
|
13
|
+
months: {
|
|
14
|
+
january: string;
|
|
15
|
+
february: string;
|
|
16
|
+
march: string;
|
|
17
|
+
april: string;
|
|
18
|
+
may: string;
|
|
19
|
+
june: string;
|
|
20
|
+
july: string;
|
|
21
|
+
august: string;
|
|
22
|
+
september: string;
|
|
23
|
+
october: string;
|
|
24
|
+
november: string;
|
|
25
|
+
december: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
interface PillConfig {
|
|
29
|
+
textColor: string;
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
text: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TrackingConfig {
|
|
34
|
+
navigation: {
|
|
35
|
+
shipmentExceptionMailTo: string;
|
|
36
|
+
};
|
|
37
|
+
style: {
|
|
38
|
+
color: {
|
|
39
|
+
background: string;
|
|
40
|
+
textPrimary: string;
|
|
41
|
+
textSecondary: string;
|
|
42
|
+
border: string;
|
|
43
|
+
iconPrimary: string;
|
|
44
|
+
iconSecondary: string;
|
|
45
|
+
iconTertiary: string;
|
|
46
|
+
exceptionIcon: string;
|
|
47
|
+
};
|
|
48
|
+
variant: 'default' | 'minimal';
|
|
49
|
+
position: 'left' | 'right';
|
|
50
|
+
fontFamily: string;
|
|
51
|
+
fontSize: number;
|
|
52
|
+
};
|
|
53
|
+
text: {
|
|
54
|
+
header: {
|
|
55
|
+
title: string;
|
|
56
|
+
};
|
|
57
|
+
pendingLabel: string;
|
|
58
|
+
completedLabel: string;
|
|
59
|
+
inTransitLabel: string;
|
|
60
|
+
confirmedLabel: string;
|
|
61
|
+
collectedLabel: string;
|
|
62
|
+
cancelledLabel: string;
|
|
63
|
+
checkBackLater: string;
|
|
64
|
+
cancelledMessage: string;
|
|
65
|
+
noObjectDetailsTitle: string;
|
|
66
|
+
inTransitCTAOnLabel: string;
|
|
67
|
+
inTransitCTABetweenLabel: string;
|
|
68
|
+
inTransitCTABeforeLabel: string;
|
|
69
|
+
inTransitCTAAfterLabel: string;
|
|
70
|
+
inTransitCTAAndLabel: string;
|
|
71
|
+
completedCTA: string;
|
|
72
|
+
dates: DateConfig;
|
|
73
|
+
shipsFromLabel: string;
|
|
74
|
+
shipsToLabel: string;
|
|
75
|
+
packageHistoryLabel: string;
|
|
76
|
+
bookedLabel: string;
|
|
77
|
+
shipmentExceptionCTA: string;
|
|
78
|
+
packageIdReturnLabel: string;
|
|
79
|
+
packageLabel: string;
|
|
80
|
+
historyLabel: string;
|
|
81
|
+
unknownLocation: string;
|
|
82
|
+
paymentRequiredLabel: string;
|
|
83
|
+
holdRequestedLabel: string;
|
|
84
|
+
multipleShipmentsHeldAtCustomsLabel: string;
|
|
85
|
+
singleShipmentHeldAtCustomsLabel: string;
|
|
86
|
+
changeOfAddressRequestLabel: string;
|
|
87
|
+
shipmentExceptionDefaultLabel: string;
|
|
88
|
+
};
|
|
89
|
+
pill: {
|
|
90
|
+
unknown: PillConfig;
|
|
91
|
+
pending: PillConfig;
|
|
92
|
+
notfound: PillConfig;
|
|
93
|
+
transit: PillConfig;
|
|
94
|
+
out_for_delivery: PillConfig;
|
|
95
|
+
delivered: PillConfig;
|
|
96
|
+
undelivered: PillConfig;
|
|
97
|
+
exception: PillConfig;
|
|
98
|
+
expired: PillConfig;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export type PartialTrackingConfig = DeepPartial<TrackingConfig>;
|
|
102
|
+
export interface TrackingFullConfig extends TrackingConfig, ArtaJsFullConfig {
|
|
103
|
+
}
|
|
104
|
+
export declare const defaultTrackingConfig: TrackingConfig;
|
|
105
|
+
export declare const getFullTrackingConfig: (artaConfig: ArtaJsFullConfig, trackingConfig?: PartialTrackingConfig) => TrackingFullConfig;
|
|
106
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFullTrackingConfig = exports.defaultTrackingConfig = void 0;
|
|
4
|
+
var helper_1 = require("./helper");
|
|
5
|
+
exports.defaultTrackingConfig = {
|
|
6
|
+
navigation: {
|
|
7
|
+
shipmentExceptionMailTo: 'hello@arta.io',
|
|
8
|
+
},
|
|
9
|
+
style: {
|
|
10
|
+
color: {
|
|
11
|
+
background: '#FFFFFF',
|
|
12
|
+
textPrimary: '#110F10',
|
|
13
|
+
textSecondary: '#6F6C65',
|
|
14
|
+
border: '#D7D6D0',
|
|
15
|
+
iconPrimary: 'black',
|
|
16
|
+
iconSecondary: 'white',
|
|
17
|
+
iconTertiary: '#8C8984',
|
|
18
|
+
exceptionIcon: '#F59E0B',
|
|
19
|
+
},
|
|
20
|
+
variant: 'default',
|
|
21
|
+
position: 'right',
|
|
22
|
+
fontFamily: 'Neue Haas Grotesk Text Pro, Arial, Helvetica, sans-serif',
|
|
23
|
+
fontSize: 14,
|
|
24
|
+
},
|
|
25
|
+
text: {
|
|
26
|
+
header: {
|
|
27
|
+
title: 'Track Shipment',
|
|
28
|
+
},
|
|
29
|
+
pendingLabel: 'Pending',
|
|
30
|
+
completedLabel: 'Completed',
|
|
31
|
+
inTransitLabel: 'In Transit',
|
|
32
|
+
confirmedLabel: 'Confirmed',
|
|
33
|
+
collectedLabel: 'Collected',
|
|
34
|
+
cancelledLabel: 'Cancelled',
|
|
35
|
+
cancelledMessage: 'This shipment was cancelled.',
|
|
36
|
+
checkBackLater: 'Please check back later for delivery estimate.',
|
|
37
|
+
noObjectDetailsTitle: 'Title Not Provided',
|
|
38
|
+
inTransitCTAOnLabel: 'Delivery is currently estimated on',
|
|
39
|
+
inTransitCTABetweenLabel: 'Delivery is currently estimated between',
|
|
40
|
+
inTransitCTABeforeLabel: 'Delivery is currently estimated before',
|
|
41
|
+
inTransitCTAAfterLabel: 'Delivery is currently estimated after',
|
|
42
|
+
inTransitCTAAndLabel: 'and',
|
|
43
|
+
completedCTA: 'Shipment delivered on',
|
|
44
|
+
shipsFromLabel: 'Ships from',
|
|
45
|
+
shipsToLabel: 'Ships to',
|
|
46
|
+
packageHistoryLabel: 'Package history',
|
|
47
|
+
bookedLabel: 'Booked: ',
|
|
48
|
+
shipmentExceptionCTA: 'Contact Arta for more information',
|
|
49
|
+
packageIdReturnLabel: '< Back',
|
|
50
|
+
packageLabel: 'Package',
|
|
51
|
+
historyLabel: 'History',
|
|
52
|
+
unknownLocation: '-',
|
|
53
|
+
paymentRequiredLabel: 'Payment required.',
|
|
54
|
+
holdRequestedLabel: 'This shipment is on hold by request.',
|
|
55
|
+
singleShipmentHeldAtCustomsLabel: 'This shipment is being held by Customs',
|
|
56
|
+
multipleShipmentsHeldAtCustomsLabel: 'One or more packages are being held by Customs',
|
|
57
|
+
changeOfAddressRequestLabel: 'A change of address was requested which may impact delivery timelines.',
|
|
58
|
+
shipmentExceptionDefaultLabel: 'There is an exception with this shipment.',
|
|
59
|
+
dates: {
|
|
60
|
+
weekdays: {
|
|
61
|
+
sunday: 'Sun',
|
|
62
|
+
monday: 'Mon',
|
|
63
|
+
tuesday: 'Tue',
|
|
64
|
+
wednesday: 'Wed',
|
|
65
|
+
thursday: 'Thu',
|
|
66
|
+
friday: 'Fri',
|
|
67
|
+
saturday: 'Sat',
|
|
68
|
+
},
|
|
69
|
+
months: {
|
|
70
|
+
january: 'Jan',
|
|
71
|
+
february: 'Feb',
|
|
72
|
+
march: 'Mar',
|
|
73
|
+
april: 'Apr',
|
|
74
|
+
may: 'May',
|
|
75
|
+
june: 'Jun',
|
|
76
|
+
july: 'Jul',
|
|
77
|
+
august: 'Aug',
|
|
78
|
+
september: 'Sep',
|
|
79
|
+
october: 'Oct',
|
|
80
|
+
november: 'Nov',
|
|
81
|
+
december: 'Dec',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
pill: {
|
|
86
|
+
unknown: {
|
|
87
|
+
textColor: '#202020',
|
|
88
|
+
backgroundColor: '#D2D2D2',
|
|
89
|
+
text: 'Unknown',
|
|
90
|
+
},
|
|
91
|
+
pending: {
|
|
92
|
+
textColor: '#202020',
|
|
93
|
+
backgroundColor: '#D2D2D2',
|
|
94
|
+
text: 'Pending',
|
|
95
|
+
},
|
|
96
|
+
notfound: {
|
|
97
|
+
textColor: '#202020',
|
|
98
|
+
backgroundColor: '#D2D2D2',
|
|
99
|
+
text: 'Not Found',
|
|
100
|
+
},
|
|
101
|
+
transit: {
|
|
102
|
+
textColor: '#379464',
|
|
103
|
+
backgroundColor: '#EFF8F3',
|
|
104
|
+
text: 'In Transit',
|
|
105
|
+
},
|
|
106
|
+
out_for_delivery: {
|
|
107
|
+
textColor: '#379464',
|
|
108
|
+
backgroundColor: '#EFF8F3',
|
|
109
|
+
text: 'Out for Delivery',
|
|
110
|
+
},
|
|
111
|
+
delivered: {
|
|
112
|
+
textColor: '#173E2A',
|
|
113
|
+
backgroundColor: '#D6EDE1',
|
|
114
|
+
text: 'Delivered',
|
|
115
|
+
},
|
|
116
|
+
undelivered: {
|
|
117
|
+
textColor: '#772424',
|
|
118
|
+
backgroundColor: '#FEF9F9',
|
|
119
|
+
text: 'Undelivered',
|
|
120
|
+
},
|
|
121
|
+
exception: {
|
|
122
|
+
textColor: '#976315',
|
|
123
|
+
backgroundColor: '#FEF6E9',
|
|
124
|
+
text: 'Exception',
|
|
125
|
+
},
|
|
126
|
+
expired: {
|
|
127
|
+
textColor: '#772424',
|
|
128
|
+
backgroundColor: '#FEF9F9',
|
|
129
|
+
text: 'Expired',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
var getFullTrackingConfig = function (artaConfig, trackingConfig) {
|
|
134
|
+
return (0, helper_1.nestedObjectAssign)((0, helper_1.deepClone)(exports.defaultTrackingConfig), artaConfig, trackingConfig);
|
|
135
|
+
};
|
|
136
|
+
exports.getFullTrackingConfig = getFullTrackingConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artaio/arta-browser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.3-fixes-ci-and-pending038bddcebe8a6d451f2c916a417b98c4e79cb8b1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "lib/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"preact": "^10.11.3"
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
}
|