andoncloud-sdk 1.3.5 → 1.3.6
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/andoncloud-sdk.js +41 -32
- package/dist/andoncloud-sdk.js.map +1 -1
- package/package.json +15 -15
package/dist/andoncloud-sdk.js
CHANGED
|
@@ -28,7 +28,7 @@ var Menu = _interopDefault(require('@mui/material/Menu'));
|
|
|
28
28
|
var AccessTimeIcon = _interopDefault(require('@mui/icons-material/AccessTime'));
|
|
29
29
|
var backdropPattern = _interopDefault(require('./images/backdropPattern.svg'));
|
|
30
30
|
|
|
31
|
-
let e={data:""},t=t=>"object"==typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]
|
|
31
|
+
let e={data:""},t=t=>"object"==typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n=/\n+/g,o=(e,t)=>{let r="",l="",a="";for(let n in e){let c=e[n];"@"==n[0]?"i"==n[1]?r=n+" "+c+";":l+="f"==n[1]?o(c,n):n+"{"+o(c,"k"==n[1]?"":t)+"}":"object"==typeof c?l+=o(c,t?t.replace(/([^,])+/g,e=>n.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):n):null!=c&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=o.p?o.p(n,c):n+":"+c+";");}return r+(t&&a?t+"{"+a+"}":a)+l},c={},s=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+s(e[r]);return t}return e},i=(e,t,r,i,p)=>{let u=s(e),d=c[u]||(c[u]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(u));if(!c[d]){let t=u!==e?e:(e=>{let t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n," ").trim();return o[0]})(e);c[d]=o(p?{["@keyframes "+d]:t}:t,r?"":"."+d);}return ((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(c[d],t,i),d},p=(e,t,r)=>e.reduce((e,l,a)=>{let n=t[a];if(n&&n.call){let e=n(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":o(e,""):!1===e?"":e;}return e+l+(null==n?"":n)},"");function u(e){let r=this||{},l=e.call?e(r.p):e;return i(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):l,t(r.target),r.g,r.o,r.k)}let d,f,g,b=u.bind({g:1}),h=u.bind({k:1});function m(e,t,r,l){o.p=t,d=e,f=r,g=l;}function j(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=u.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=e;return e[0]&&(i=c.as||e,delete c.as),g&&i[0]&&g(c),d(i,c)}return t?t(a):a}}
|
|
32
32
|
|
|
33
33
|
function _extends() {
|
|
34
34
|
_extends = Object.assign || function (target) {
|
|
@@ -467,10 +467,10 @@ function _templateObject() {
|
|
|
467
467
|
|
|
468
468
|
return data;
|
|
469
469
|
}
|
|
470
|
-
var circleAnimation = /*#__PURE__*/
|
|
471
|
-
var firstLineAnimation = /*#__PURE__*/
|
|
472
|
-
var secondLineAnimation = /*#__PURE__*/
|
|
473
|
-
var ErrorIcon = /*#__PURE__*/
|
|
470
|
+
var circleAnimation = /*#__PURE__*/h( /*#__PURE__*/_templateObject());
|
|
471
|
+
var firstLineAnimation = /*#__PURE__*/h( /*#__PURE__*/_templateObject2());
|
|
472
|
+
var secondLineAnimation = /*#__PURE__*/h( /*#__PURE__*/_templateObject3());
|
|
473
|
+
var ErrorIcon = /*#__PURE__*/j('div')( /*#__PURE__*/_templateObject4(), function (p) {
|
|
474
474
|
return p.primary || '#ff4b4b';
|
|
475
475
|
}, circleAnimation, firstLineAnimation, function (p) {
|
|
476
476
|
return p.secondary || '#fff';
|
|
@@ -495,8 +495,8 @@ function _templateObject$1() {
|
|
|
495
495
|
|
|
496
496
|
return data;
|
|
497
497
|
}
|
|
498
|
-
var rotate = /*#__PURE__*/
|
|
499
|
-
var LoaderIcon = /*#__PURE__*/
|
|
498
|
+
var rotate = /*#__PURE__*/h( /*#__PURE__*/_templateObject$1());
|
|
499
|
+
var LoaderIcon = /*#__PURE__*/j('div')( /*#__PURE__*/_templateObject2$1(), function (p) {
|
|
500
500
|
return p.secondary || '#e0e0e0';
|
|
501
501
|
}, function (p) {
|
|
502
502
|
return p.primary || '#616161';
|
|
@@ -531,9 +531,9 @@ function _templateObject$2() {
|
|
|
531
531
|
|
|
532
532
|
return data;
|
|
533
533
|
}
|
|
534
|
-
var circleAnimation$1 = /*#__PURE__*/
|
|
535
|
-
var checkmarkAnimation = /*#__PURE__*/
|
|
536
|
-
var CheckmarkIcon = /*#__PURE__*/
|
|
534
|
+
var circleAnimation$1 = /*#__PURE__*/h( /*#__PURE__*/_templateObject$2());
|
|
535
|
+
var checkmarkAnimation = /*#__PURE__*/h( /*#__PURE__*/_templateObject2$2());
|
|
536
|
+
var CheckmarkIcon = /*#__PURE__*/j('div')( /*#__PURE__*/_templateObject3$1(), function (p) {
|
|
537
537
|
return p.primary || '#61d345';
|
|
538
538
|
}, circleAnimation$1, checkmarkAnimation, function (p) {
|
|
539
539
|
return p.secondary || '#fff';
|
|
@@ -578,10 +578,10 @@ function _templateObject$3() {
|
|
|
578
578
|
|
|
579
579
|
return data;
|
|
580
580
|
}
|
|
581
|
-
var StatusWrapper = /*#__PURE__*/
|
|
582
|
-
var IndicatorWrapper = /*#__PURE__*/
|
|
583
|
-
var enter = /*#__PURE__*/
|
|
584
|
-
var AnimatedIconWrapper = /*#__PURE__*/
|
|
581
|
+
var StatusWrapper = /*#__PURE__*/j('div')( /*#__PURE__*/_templateObject$3());
|
|
582
|
+
var IndicatorWrapper = /*#__PURE__*/j('div')( /*#__PURE__*/_templateObject2$3());
|
|
583
|
+
var enter = /*#__PURE__*/h( /*#__PURE__*/_templateObject3$2());
|
|
584
|
+
var AnimatedIconWrapper = /*#__PURE__*/j('div')( /*#__PURE__*/_templateObject4$1(), enter);
|
|
585
585
|
var ToastIcon = function ToastIcon(_ref) {
|
|
586
586
|
var toast = _ref.toast;
|
|
587
587
|
var icon = toast.icon,
|
|
@@ -633,8 +633,8 @@ var exitAnimation = function exitAnimation(factor) {
|
|
|
633
633
|
|
|
634
634
|
var fadeInAnimation = "0%{opacity:0;} 100%{opacity:1;}";
|
|
635
635
|
var fadeOutAnimation = "0%{opacity:1;} 100%{opacity:0;}";
|
|
636
|
-
var ToastBarBase = /*#__PURE__*/
|
|
637
|
-
var Message = /*#__PURE__*/
|
|
636
|
+
var ToastBarBase = /*#__PURE__*/j('div', React.forwardRef)( /*#__PURE__*/_templateObject$4());
|
|
637
|
+
var Message = /*#__PURE__*/j('div')( /*#__PURE__*/_templateObject2$4());
|
|
638
638
|
|
|
639
639
|
var getAnimationStyle = function getAnimationStyle(position, visible) {
|
|
640
640
|
var top = position.includes('top');
|
|
@@ -645,7 +645,7 @@ var getAnimationStyle = function getAnimationStyle(position, visible) {
|
|
|
645
645
|
exit = _ref[1];
|
|
646
646
|
|
|
647
647
|
return {
|
|
648
|
-
animation: visible ?
|
|
648
|
+
animation: visible ? h(enter) + " 0.35s cubic-bezier(.21,1.02,.73,1) forwards" : h(exit) + " 0.4s forwards cubic-bezier(.06,.71,.55,1)"
|
|
649
649
|
};
|
|
650
650
|
};
|
|
651
651
|
|
|
@@ -679,7 +679,7 @@ function _templateObject$5() {
|
|
|
679
679
|
|
|
680
680
|
return data;
|
|
681
681
|
}
|
|
682
|
-
|
|
682
|
+
m(React.createElement);
|
|
683
683
|
|
|
684
684
|
var getPositionStyle = function getPositionStyle(position, offset) {
|
|
685
685
|
var top = position.includes('top');
|
|
@@ -775,7 +775,7 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
775
775
|
}
|
|
776
776
|
|
|
777
777
|
function _extends$1() {
|
|
778
|
-
_extends$1 = Object.assign
|
|
778
|
+
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
779
779
|
for (var i = 1; i < arguments.length; i++) {
|
|
780
780
|
var source = arguments[i];
|
|
781
781
|
|
|
@@ -788,7 +788,6 @@ function _extends$1() {
|
|
|
788
788
|
|
|
789
789
|
return target;
|
|
790
790
|
};
|
|
791
|
-
|
|
792
791
|
return _extends$1.apply(this, arguments);
|
|
793
792
|
}
|
|
794
793
|
|
|
@@ -1342,13 +1341,20 @@ var SessionStore = /*#__PURE__*/function () {
|
|
|
1342
1341
|
this.networkError = null;
|
|
1343
1342
|
mobx.makeObservable(this, {
|
|
1344
1343
|
loading: mobx.observable,
|
|
1345
|
-
|
|
1344
|
+
setLoading: mobx.action,
|
|
1345
|
+
loginStatus: mobx.observable.deep,
|
|
1346
|
+
setConnectedLoginStatus: mobx.action,
|
|
1347
|
+
setNotAuthorizedLoginStatus: mobx.action
|
|
1346
1348
|
});
|
|
1347
1349
|
}
|
|
1348
1350
|
|
|
1349
1351
|
var _proto2 = SessionStore.prototype;
|
|
1350
1352
|
|
|
1351
|
-
_proto2.
|
|
1353
|
+
_proto2.setLoading = function setLoading(value) {
|
|
1354
|
+
this.loading = value;
|
|
1355
|
+
};
|
|
1356
|
+
|
|
1357
|
+
_proto2.setConnectedLoginStatus = function setConnectedLoginStatus() {
|
|
1352
1358
|
this.loginStatus = {
|
|
1353
1359
|
status: "connected",
|
|
1354
1360
|
authResponse: {
|
|
@@ -1360,6 +1366,12 @@ var SessionStore = /*#__PURE__*/function () {
|
|
|
1360
1366
|
};
|
|
1361
1367
|
};
|
|
1362
1368
|
|
|
1369
|
+
_proto2.setNotAuthorizedLoginStatus = function setNotAuthorizedLoginStatus() {
|
|
1370
|
+
this.loginStatus = {
|
|
1371
|
+
status: "not_authorized"
|
|
1372
|
+
};
|
|
1373
|
+
};
|
|
1374
|
+
|
|
1363
1375
|
_proto2.setAuthConfig = function setAuthConfig(config) {
|
|
1364
1376
|
this.api.setAuthConfig(config);
|
|
1365
1377
|
};
|
|
@@ -1393,9 +1405,10 @@ var SessionStore = /*#__PURE__*/function () {
|
|
|
1393
1405
|
try {
|
|
1394
1406
|
var _this8 = this;
|
|
1395
1407
|
|
|
1396
|
-
_this8.
|
|
1408
|
+
_this8.setLoading(true);
|
|
1409
|
+
|
|
1397
1410
|
return Promise.resolve(_this8.api.authorize(credentials)).then(function (session) {
|
|
1398
|
-
_this8.
|
|
1411
|
+
_this8.setLoading(false);
|
|
1399
1412
|
|
|
1400
1413
|
if (!session) {
|
|
1401
1414
|
return null;
|
|
@@ -1408,7 +1421,7 @@ var SessionStore = /*#__PURE__*/function () {
|
|
|
1408
1421
|
|
|
1409
1422
|
_this8.setCurrentUser(session.user);
|
|
1410
1423
|
|
|
1411
|
-
_this8.
|
|
1424
|
+
_this8.setConnectedLoginStatus();
|
|
1412
1425
|
}
|
|
1413
1426
|
|
|
1414
1427
|
return session;
|
|
@@ -1432,12 +1445,10 @@ var SessionStore = /*#__PURE__*/function () {
|
|
|
1432
1445
|
return Promise.resolve(_this10.api.getUserData()).then(function (user) {
|
|
1433
1446
|
_this10.setCurrentUser(user);
|
|
1434
1447
|
|
|
1435
|
-
_this10.
|
|
1448
|
+
_this10.setConnectedLoginStatus();
|
|
1436
1449
|
});
|
|
1437
1450
|
} else {
|
|
1438
|
-
_this10.
|
|
1439
|
-
status: "not_authorized"
|
|
1440
|
-
};
|
|
1451
|
+
_this10.setNotAuthorizedLoginStatus();
|
|
1441
1452
|
}
|
|
1442
1453
|
}();
|
|
1443
1454
|
|
|
@@ -1459,9 +1470,7 @@ var SessionStore = /*#__PURE__*/function () {
|
|
|
1459
1470
|
|
|
1460
1471
|
_this12.removeCurrentUser();
|
|
1461
1472
|
|
|
1462
|
-
_this12.
|
|
1463
|
-
status: "not_authorized"
|
|
1464
|
-
};
|
|
1473
|
+
_this12.setNotAuthorizedLoginStatus();
|
|
1465
1474
|
});
|
|
1466
1475
|
}
|
|
1467
1476
|
}();
|