cobrowse-agent-ui 1.2.0 → 1.3.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/README.md +3 -3
- package/dist/cobrowse-agent-ui.css +1 -0
- package/dist/cobrowse-agent-ui.d.ts +114 -0
- package/dist/cobrowse-agent-ui.js +194 -0
- package/dist/cobrowse-agent-ui.js.map +1 -0
- package/dist/index-CB-5iZZ3.js +639 -0
- package/dist/index-CB-5iZZ3.js.map +1 -0
- package/dist/integrations.d.ts +54 -0
- package/dist/integrations.js +90 -0
- package/dist/integrations.js.map +1 -0
- package/package.json +47 -16
- package/CHANGELOG.md +0 -41
- package/dist/CodeEntry.css +0 -50
- package/dist/CodeEntry.js +0 -226
- package/dist/Device.css +0 -47
- package/dist/Device.js +0 -31
- package/dist/PlatformIcon.css +0 -6
- package/dist/PlatformIcon.js +0 -94
- package/dist/Session.css +0 -60
- package/dist/Session.js +0 -39
- package/dist/SmartConnectButton.css +0 -19
- package/dist/SmartConnectButton.js +0 -11
- package/dist/Stopwatch.js +0 -15
- package/dist/UserIcon.css +0 -16
- package/dist/UserIcon.js +0 -21
- package/dist/deviceType.js +0 -31
- package/dist/i18n.js +0 -120
- package/dist/index.js +0 -7
- package/dist/locales/ar/translation.json +0 -10
- package/dist/locales/cs/translation.json +0 -10
- package/dist/locales/da/translation.json +0 -10
- package/dist/locales/de/translation.json +0 -10
- package/dist/locales/en-us/translation.json +0 -10
- package/dist/locales/es/translation.json +0 -10
- package/dist/locales/et/translation.json +0 -10
- package/dist/locales/fi/translation.json +0 -10
- package/dist/locales/fr/translation.json +0 -10
- package/dist/locales/hi/translation.json +0 -10
- package/dist/locales/it/translation.json +0 -10
- package/dist/locales/ja/translation.json +0 -10
- package/dist/locales/kk/translation.json +0 -10
- package/dist/locales/ko/translation.json +0 -10
- package/dist/locales/lt/translation.json +0 -10
- package/dist/locales/mr/translation.json +0 -10
- package/dist/locales/ms/translation.json +0 -10
- package/dist/locales/nl/translation.json +0 -10
- package/dist/locales/pl/translation.json +0 -10
- package/dist/locales/pt/translation.json +0 -10
- package/dist/locales/ro/translation.json +0 -10
- package/dist/locales/ru/translation.json +0 -10
- package/dist/locales/sk/translation.json +0 -10
- package/dist/locales/sl/translation.json +0 -10
- package/dist/locales/sv/translation.json +0 -10
- package/dist/locales/th/translation.json +0 -10
- package/dist/locales/uk/translation.json +0 -10
- package/dist/locales/vi/translation.json +0 -10
- package/dist/locales/zh/translation.json +0 -10
- package/i18next-parser.config.js +0 -43
- package/icons/android.svg +0 -3
- package/icons/apple.svg +0 -3
- package/icons/default.svg +0 -21
- package/icons/globe.svg +0 -3
- package/icons/windows.svg +0 -5
package/dist/CodeEntry.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
19
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
import React, { Component } from 'react';
|
|
24
|
-
import './CodeEntry.css';
|
|
25
|
-
var CodeEntry = /*#__PURE__*/function (_Component) {
|
|
26
|
-
_inherits(CodeEntry, _Component);
|
|
27
|
-
var _super = _createSuper(CodeEntry);
|
|
28
|
-
function CodeEntry() {
|
|
29
|
-
var _this;
|
|
30
|
-
_classCallCheck(this, CodeEntry);
|
|
31
|
-
_this = _super.call(this);
|
|
32
|
-
_defineProperty(_assertThisInitialized(_this), "getCode", function () {
|
|
33
|
-
return _this.state.code.join('').substr(0, 6);
|
|
34
|
-
});
|
|
35
|
-
_defineProperty(_assertThisInitialized(_this), "setDigit", function (digit, value) {
|
|
36
|
-
if (digit > 5) return;
|
|
37
|
-
var code = _this.state.code;
|
|
38
|
-
code[digit] = value;
|
|
39
|
-
_this.setState({
|
|
40
|
-
code: _toConsumableArray(code)
|
|
41
|
-
});
|
|
42
|
-
_this.tryComplete();
|
|
43
|
-
});
|
|
44
|
-
_defineProperty(_assertThisInitialized(_this), "focus", function () {
|
|
45
|
-
_this.firstDigit.focus();
|
|
46
|
-
});
|
|
47
|
-
_defineProperty(_assertThisInitialized(_this), "isEditable", function () {
|
|
48
|
-
return !_this.state.validating;
|
|
49
|
-
});
|
|
50
|
-
_defineProperty(_assertThisInitialized(_this), "tryComplete", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
51
|
-
var code;
|
|
52
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
|
-
while (1) {
|
|
54
|
-
switch (_context.prev = _context.next) {
|
|
55
|
-
case 0:
|
|
56
|
-
if (_this.isEditable()) {
|
|
57
|
-
_context.next = 2;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
return _context.abrupt("return");
|
|
61
|
-
case 2:
|
|
62
|
-
code = _this.getCode();
|
|
63
|
-
if (!(code.length !== 6)) {
|
|
64
|
-
_context.next = 5;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
return _context.abrupt("return");
|
|
68
|
-
case 5:
|
|
69
|
-
_this.setState({
|
|
70
|
-
validating: true
|
|
71
|
-
});
|
|
72
|
-
_context.prev = 6;
|
|
73
|
-
_context.next = 9;
|
|
74
|
-
return _this.props.onCode(code);
|
|
75
|
-
case 9:
|
|
76
|
-
if (!_context.sent) {
|
|
77
|
-
_context.next = 15;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
_this.setState({
|
|
81
|
-
validating: false
|
|
82
|
-
});
|
|
83
|
-
_this.setState({
|
|
84
|
-
code: ['', '', '', '', '', '']
|
|
85
|
-
});
|
|
86
|
-
if (_this.firstDigit) _this.firstDigit.focus();
|
|
87
|
-
_context.next = 17;
|
|
88
|
-
break;
|
|
89
|
-
case 15:
|
|
90
|
-
_this.setState({
|
|
91
|
-
validating: false
|
|
92
|
-
});
|
|
93
|
-
if (_this.lastDigit) _this.lastDigit.focus();
|
|
94
|
-
case 17:
|
|
95
|
-
_context.next = 24;
|
|
96
|
-
break;
|
|
97
|
-
case 19:
|
|
98
|
-
_context.prev = 19;
|
|
99
|
-
_context.t0 = _context["catch"](6);
|
|
100
|
-
_this.setState({
|
|
101
|
-
validating: false
|
|
102
|
-
});
|
|
103
|
-
if (_this.lastDigit) _this.lastDigit.focus();
|
|
104
|
-
throw _context.t0;
|
|
105
|
-
case 24:
|
|
106
|
-
case "end":
|
|
107
|
-
return _context.stop();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}, _callee, null, [[6, 19]]);
|
|
111
|
-
})));
|
|
112
|
-
_defineProperty(_assertThisInitialized(_this), "handlePaste", function (event) {
|
|
113
|
-
if (!_this.isEditable()) return false;
|
|
114
|
-
var clipboardData = event.clipboardData || window.clipboardData;
|
|
115
|
-
var pastedData = clipboardData.getData('Text').toString();
|
|
116
|
-
if (!parseInt(pastedData, 10)) return event.preventDefault();
|
|
117
|
-
var digits = pastedData.split('');
|
|
118
|
-
var digit = parseInt(event.target.getAttribute('data-digit'), 10);
|
|
119
|
-
var target = event.target;
|
|
120
|
-
digits.forEach(function (value) {
|
|
121
|
-
_this.setDigit(digit, value);
|
|
122
|
-
digit += 1;
|
|
123
|
-
if (target) target = target.nextSibling;
|
|
124
|
-
});
|
|
125
|
-
if (target) target.focus();
|
|
126
|
-
return event.preventDefault();
|
|
127
|
-
});
|
|
128
|
-
_defineProperty(_assertThisInitialized(_this), "handleOnChange", function (event) {
|
|
129
|
-
var value = event.target.value.substr(-1);
|
|
130
|
-
// validate text on any change
|
|
131
|
-
var digit = parseInt(event.target.getAttribute('data-digit'), 10);
|
|
132
|
-
_this.setDigit(digit, value);
|
|
133
|
-
if (!event.repeat && /[0-9]/.test(value)) {
|
|
134
|
-
event.target.value = '';
|
|
135
|
-
var nextSibling = event.target.nextSibling;
|
|
136
|
-
if (nextSibling) nextSibling.focus();
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
|
140
|
-
// on backspace on empty node go back to previous
|
|
141
|
-
if (event.target.value.length === 0 && event.keyCode === 8) {
|
|
142
|
-
if (event.target.previousSibling) event.target.previousSibling.focus();
|
|
143
|
-
// left arrow moves to previous
|
|
144
|
-
} else if (event.keyCode === 37) {
|
|
145
|
-
if (event.target.previousSibling) event.target.previousSibling.focus();
|
|
146
|
-
return event.preventDefault();
|
|
147
|
-
// right arrow moves to next
|
|
148
|
-
} else if (event.keyCode === 39) {
|
|
149
|
-
if (event.target.nextSibling) event.target.nextSibling.focus();
|
|
150
|
-
return event.preventDefault();
|
|
151
|
-
// prevent non-numeric characters that might appear in numbers (e.g 'e')
|
|
152
|
-
// but allow backspaces too
|
|
153
|
-
} else if (!event.metaKey && !event.ctrlKey && event.keyCode !== 8 && event.keyCode !== 9 && !/^[0-9]{1}$/.test(event.key)) {
|
|
154
|
-
return event.preventDefault();
|
|
155
|
-
}
|
|
156
|
-
return null;
|
|
157
|
-
});
|
|
158
|
-
_this.state = {
|
|
159
|
-
validating: false,
|
|
160
|
-
code: ['', '', '', '', '', '']
|
|
161
|
-
};
|
|
162
|
-
return _this;
|
|
163
|
-
}
|
|
164
|
-
_createClass(CodeEntry, [{
|
|
165
|
-
key: "render",
|
|
166
|
-
value: function render() {
|
|
167
|
-
var _this2 = this;
|
|
168
|
-
var keyHandlers = {
|
|
169
|
-
onKeyDown: this.handleKeyDown,
|
|
170
|
-
onChange: this.handleOnChange,
|
|
171
|
-
onPaste: this.handlePaste,
|
|
172
|
-
disabled: !this.isEditable()
|
|
173
|
-
};
|
|
174
|
-
var invalid = !this.state.validating && this.getCode().length === 6;
|
|
175
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
176
|
-
className: "CodeEntry"
|
|
177
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: invalid ? 'invalid' : ''
|
|
179
|
-
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
180
|
-
className: "bordered",
|
|
181
|
-
type: "number"
|
|
182
|
-
}, keyHandlers, {
|
|
183
|
-
value: this.state.code[0],
|
|
184
|
-
"data-digit": 0,
|
|
185
|
-
ref: function ref(c) {
|
|
186
|
-
_this2.firstDigit = c;
|
|
187
|
-
}
|
|
188
|
-
})), /*#__PURE__*/React.createElement("input", _extends({
|
|
189
|
-
className: "bordered",
|
|
190
|
-
type: "number"
|
|
191
|
-
}, keyHandlers, {
|
|
192
|
-
value: this.state.code[1],
|
|
193
|
-
"data-digit": 1
|
|
194
|
-
})), /*#__PURE__*/React.createElement("input", _extends({
|
|
195
|
-
className: "bordered",
|
|
196
|
-
type: "number"
|
|
197
|
-
}, keyHandlers, {
|
|
198
|
-
value: this.state.code[2],
|
|
199
|
-
"data-digit": 2
|
|
200
|
-
})), /*#__PURE__*/React.createElement("input", _extends({
|
|
201
|
-
className: "bordered",
|
|
202
|
-
type: "number"
|
|
203
|
-
}, keyHandlers, {
|
|
204
|
-
value: this.state.code[3],
|
|
205
|
-
"data-digit": 3
|
|
206
|
-
})), /*#__PURE__*/React.createElement("input", _extends({
|
|
207
|
-
className: "bordered",
|
|
208
|
-
type: "number"
|
|
209
|
-
}, keyHandlers, {
|
|
210
|
-
value: this.state.code[4],
|
|
211
|
-
"data-digit": 4
|
|
212
|
-
})), /*#__PURE__*/React.createElement("input", _extends({
|
|
213
|
-
className: "bordered",
|
|
214
|
-
type: "number"
|
|
215
|
-
}, keyHandlers, {
|
|
216
|
-
value: this.state.code[5],
|
|
217
|
-
"data-digit": 5,
|
|
218
|
-
ref: function ref(c) {
|
|
219
|
-
_this2.lastDigit = c;
|
|
220
|
-
}
|
|
221
|
-
}))));
|
|
222
|
-
}
|
|
223
|
-
}]);
|
|
224
|
-
return CodeEntry;
|
|
225
|
-
}(Component);
|
|
226
|
-
export { CodeEntry as default };
|
package/dist/Device.css
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.Device {
|
|
3
|
-
padding: 7px;
|
|
4
|
-
border-left: 5px solid transparent;
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
position: relative;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.Device.online .device-status {
|
|
11
|
-
outline: 2px solid #C7EA30;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.Device .last-seen {
|
|
15
|
-
font-size: 0.8em;
|
|
16
|
-
color: #777;
|
|
17
|
-
margin-top: 3px;
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.Device .device-status {
|
|
22
|
-
height: 36px;
|
|
23
|
-
width: 36px;
|
|
24
|
-
padding: 4px;
|
|
25
|
-
outline: 2px solid rgb(4 13 60 / 0.25);
|
|
26
|
-
border-radius: 100%;
|
|
27
|
-
box-sizing: border-box;
|
|
28
|
-
display: flex;
|
|
29
|
-
align-items: center;
|
|
30
|
-
justify-content: center;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.Device .platform-icon {
|
|
34
|
-
/*font-size: 24px;*/
|
|
35
|
-
/*max-height: 24px;*/
|
|
36
|
-
height: 100%;
|
|
37
|
-
width: auto;
|
|
38
|
-
pointer-events: none;
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.Device .details {
|
|
45
|
-
flex:1;
|
|
46
|
-
margin-left: 7px;
|
|
47
|
-
}
|
package/dist/Device.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import i18n from './i18n';
|
|
3
|
-
import PlatformIcon from './PlatformIcon.js';
|
|
4
|
-
import deviceType from './deviceType.js';
|
|
5
|
-
import './Device.css';
|
|
6
|
-
export default function Device(props) {
|
|
7
|
-
function renderLastSeen() {
|
|
8
|
-
if (props.device.online) {
|
|
9
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
className: "last-seen"
|
|
11
|
-
}, i18n.t('Online'));
|
|
12
|
-
} else {
|
|
13
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
-
className: "last-seen"
|
|
15
|
-
}, i18n.t('Last seen {{date, dateRelative}}', {
|
|
16
|
-
date: new Date(props.device.last_active)
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
style: props.style,
|
|
22
|
-
className: "Device ".concat(props.device.online ? 'online' : '', " ").concat(props.device.connectable ? 'connectable' : '')
|
|
23
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: "device-status"
|
|
25
|
-
}, /*#__PURE__*/React.createElement(PlatformIcon, {
|
|
26
|
-
platform: props.device.device.platform,
|
|
27
|
-
className: "platform-icon"
|
|
28
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className: "details"
|
|
30
|
-
}, deviceType(props.device.device), renderLastSeen()), props.children);
|
|
31
|
-
}
|
package/dist/PlatformIcon.css
DELETED
package/dist/PlatformIcon.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React from 'react';
|
|
3
|
-
var IconGlobe = function IconGlobe(props) {
|
|
4
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
5
|
-
d: "M14.917 14.492a1.672 1.672 0 0 0-1.584-1.159H12.5v-2.5a.833.833 0 0 0-.833-.833h-5V8.333h1.666a.833.833 0 0 0 .834-.833V5.833h1.666A1.667 1.667 0 0 0 12.5 4.167v-.342a6.654 6.654 0 0 1 2.417 10.667Zm-5.75 2.116A6.657 6.657 0 0 1 3.333 10c0-.517.067-1.017.175-1.492L7.5 12.5v.833A1.667 1.667 0 0 0 9.167 15M10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Z",
|
|
6
|
-
fill: "currentColor"
|
|
7
|
-
}));
|
|
8
|
-
};
|
|
9
|
-
IconGlobe.defaultProps = {
|
|
10
|
-
viewBox: "0 0 20 20",
|
|
11
|
-
fill: "none",
|
|
12
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
-
};
|
|
14
|
-
var IconApple = function IconApple(props) {
|
|
15
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
16
|
-
d: "M14.208 16.9c-.816.792-1.708.667-2.566.292-.909-.384-1.742-.4-2.7 0-1.2.516-1.834.366-2.55-.292-4.067-4.192-3.467-10.575 1.15-10.808 1.125.058 1.908.616 2.566.666.984-.2 1.925-.775 2.975-.7 1.259.1 2.209.6 2.834 1.5-2.6 1.559-1.984 4.984.4 5.942-.475 1.25-1.092 2.492-2.117 3.408l.008-.008ZM10.025 6.042C9.9 4.183 11.408 2.65 13.142 2.5c.241 2.15-1.95 3.75-3.117 3.542Z",
|
|
17
|
-
fill: "currentColor"
|
|
18
|
-
}));
|
|
19
|
-
};
|
|
20
|
-
IconApple.defaultProps = {
|
|
21
|
-
viewBox: "0 0 20 20",
|
|
22
|
-
fill: "none",
|
|
23
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
24
|
-
};
|
|
25
|
-
var IconAndroid = function IconAndroid(props) {
|
|
26
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
27
|
-
d: "M.833 15a9.03 9.03 0 0 1 1.365-4.104 8.67 8.67 0 0 1 3.135-2.98L3.792 5.25a.45.45 0 0 1-.063-.396.501.501 0 0 1 .27-.312.439.439 0 0 1 .376-.042c.139.042.25.125.333.25L6.25 7.417a9.616 9.616 0 0 1 3.75-.75c1.306 0 2.556.25 3.75.75l1.542-2.667a.597.597 0 0 1 .333-.25.439.439 0 0 1 .375.042c.139.07.23.173.27.312a.45.45 0 0 1-.062.396l-1.541 2.667a8.661 8.661 0 0 1 3.135 2.979A9.044 9.044 0 0 1 19.167 15H.833Zm5-2.292c.292 0 .539-.1.74-.302.202-.202.302-.448.302-.74 0-.291-.1-.538-.303-.74a1.002 1.002 0 0 0-.739-.301c-.291 0-.538.1-.74.303a1.003 1.003 0 0 0-.301.739c0 .291.1.538.302.74.202.201.448.302.74.301Zm8.334 0c.291 0 .538-.1.74-.302.201-.202.302-.448.301-.74 0-.291-.1-.538-.302-.74a1.003 1.003 0 0 0-.74-.301c-.291 0-.538.1-.74.303a1.003 1.003 0 0 0-.301.739c0 .291.1.538.302.74.202.201.449.302.74.301Z",
|
|
28
|
-
fill: "currentColor"
|
|
29
|
-
}));
|
|
30
|
-
};
|
|
31
|
-
IconAndroid.defaultProps = {
|
|
32
|
-
viewBox: "0 0 20 20",
|
|
33
|
-
fill: "none",
|
|
34
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
35
|
-
};
|
|
36
|
-
var IconWindows = function IconWindows(props) {
|
|
37
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
38
|
-
d: "M5.216 8.219 16.28 6.695v10.69H5.214V8.22l.002-.002Zm0 19.563 11.065 1.525v-10.56H5.214l.002 9.035Zm12.282 1.687L32.216 31.5V18.747H17.498v10.722Zm0-22.938v10.854h14.718V4.5L17.498 6.531Z",
|
|
39
|
-
fill: "currentColor"
|
|
40
|
-
}));
|
|
41
|
-
};
|
|
42
|
-
IconWindows.defaultProps = {
|
|
43
|
-
viewBox: "0 0 37 36",
|
|
44
|
-
fill: "none",
|
|
45
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
46
|
-
};
|
|
47
|
-
var IconDefault = function IconDefault(props) {
|
|
48
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
49
|
-
style: {
|
|
50
|
-
fill: "#020202"
|
|
51
|
-
},
|
|
52
|
-
d: "M206.759 332.99H39.225c-3.894 0-7.065-3.173-7.065-7.067V53.353c0-3.893 3.172-7.065 7.065-7.065h401.631c3.895 0 7.065 3.172 7.065 7.065v59.696c11.763 1.389 22.785 5.244 32.159 11.581V53.353c0-21.63-17.602-39.225-39.225-39.225H39.225C17.602 14.128 0 31.722 0 53.353v272.569c0 21.631 17.602 39.227 39.225 39.227h134.62v52.581h-21.229c-13.316 0-24.12 10.796-24.12 24.12 0 13.324 10.804 24.12 24.12 24.12h67.71c-8.463-11.902-13.566-26.35-13.566-42.037V332.99z"
|
|
53
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
54
|
-
style: {
|
|
55
|
-
fill: "#020202"
|
|
56
|
-
},
|
|
57
|
-
d: "M341.739 441.645v-34.742h-70.662V184.999c0-4.681 3.8-8.489 8.479-8.489h159.887c4.679 0 8.478 3.808 8.478 8.489v68.676h12.046c7.364 0 14.179 2.127 20.113 5.597v-74.273c0-22.417-18.23-40.648-40.638-40.648H279.556c-22.407 0-40.638 18.231-40.638 40.648v238.933c0 22.417 18.23 40.647 40.638 40.647h69.438c-4.428-6.359-7.255-15.22-7.255-22.934z"
|
|
58
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
59
|
-
style: {
|
|
60
|
-
fill: "#020202"
|
|
61
|
-
},
|
|
62
|
-
d: "M459.967 273.775h-77.996c-11.104 0-20.132 9.037-20.132 20.138v147.732c0 11.101 9.028 20.131 20.132 20.131h77.996c11.102 0 20.13-9.03 20.13-20.131V293.912c0-11.101-9.029-20.137-20.13-20.137zm-74.009 24.119h70.019v127.703h-70.019V297.894zm35.019 154.099c-2.215 0-4.193-.896-5.7-2.277-1.713-1.555-2.812-3.739-2.812-6.228 0-4.694 3.801-8.495 8.512-8.495 4.679 0 8.479 3.801 8.479 8.495 0 2.489-1.1 4.672-2.795 6.228-1.509 1.382-3.487 2.277-5.684 2.277z"
|
|
63
|
-
}));
|
|
64
|
-
};
|
|
65
|
-
IconDefault.defaultProps = {
|
|
66
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
67
|
-
viewBox: "0 0 480.097 480.097",
|
|
68
|
-
xmlSpace: "preserve"
|
|
69
|
-
};
|
|
70
|
-
import './PlatformIcon.css';
|
|
71
|
-
function icon(platform) {
|
|
72
|
-
switch (platform) {
|
|
73
|
-
case 'web':
|
|
74
|
-
return IconGlobe;
|
|
75
|
-
case 'ios':
|
|
76
|
-
return IconApple;
|
|
77
|
-
case 'macos':
|
|
78
|
-
return IconApple;
|
|
79
|
-
case 'android':
|
|
80
|
-
return IconAndroid;
|
|
81
|
-
case 'windows':
|
|
82
|
-
return IconWindows;
|
|
83
|
-
default:
|
|
84
|
-
return IconDefault;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
export default function PlatformIcon(props) {
|
|
88
|
-
var Icon = icon(props.platform);
|
|
89
|
-
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
90
|
-
fill: "currentColor"
|
|
91
|
-
}, props, {
|
|
92
|
-
className: "PlatformIcon ".concat(props.className || '')
|
|
93
|
-
}));
|
|
94
|
-
}
|
package/dist/Session.css
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.Session {
|
|
3
|
-
padding: 7px;
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
flex-wrap: wrap;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.Session .agent {
|
|
10
|
-
font-size: 0.8em;
|
|
11
|
-
margin-right: 7px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.Session .details {
|
|
15
|
-
flex:1;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.Session .subdetails {
|
|
19
|
-
display: flex;
|
|
20
|
-
margin-top: 4px;
|
|
21
|
-
align-items: baseline;
|
|
22
|
-
color: #777;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.Session .recorded {
|
|
26
|
-
text-transform: uppercase;
|
|
27
|
-
font-size: 10px;
|
|
28
|
-
margin-left: 15px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.Session .active {
|
|
32
|
-
color: white;
|
|
33
|
-
font-size: 11px;
|
|
34
|
-
font-weight: bold;
|
|
35
|
-
text-transform: uppercase;
|
|
36
|
-
background-color: #3cc56e;
|
|
37
|
-
padding: 1px 3px 1px 3px;
|
|
38
|
-
border-radius: 3px;
|
|
39
|
-
display: inline-block;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.Session .activated {
|
|
43
|
-
font-size: 0.8em;
|
|
44
|
-
white-space: nowrap;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.Session .recorded:before {
|
|
48
|
-
content: '';
|
|
49
|
-
width: 8px;
|
|
50
|
-
height: 8px;
|
|
51
|
-
margin-right: 4px;
|
|
52
|
-
background: red;
|
|
53
|
-
border-radius: 100%;
|
|
54
|
-
display: inline-block;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.Session .duration {
|
|
58
|
-
font-weight: bold;
|
|
59
|
-
font-size: 12px;
|
|
60
|
-
}
|
package/dist/Session.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import deviceType from './deviceType.js';
|
|
3
|
-
import Stopwatch from './Stopwatch.js';
|
|
4
|
-
import i18n from './i18n';
|
|
5
|
-
import { Trans } from 'react-i18next';
|
|
6
|
-
import './Session.css';
|
|
7
|
-
export default function Session(props) {
|
|
8
|
-
function openRecording() {
|
|
9
|
-
if (props.openRecording) props.openRecording(props.session);
|
|
10
|
-
}
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
style: props.style,
|
|
13
|
-
onClick: props.onClick,
|
|
14
|
-
className: "Session ".concat(props.className || '')
|
|
15
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className: "details"
|
|
17
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Trans, {
|
|
18
|
-
i18n: i18n
|
|
19
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
20
|
-
className: "device-prefix"
|
|
21
|
-
}, "Connected to "), {
|
|
22
|
-
deviceType: deviceType(props.session.device)
|
|
23
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: "subdetails"
|
|
25
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: "activated"
|
|
27
|
-
}, i18n.t('{{date, dateRelative}}', {
|
|
28
|
-
date: new Date(props.session.activated)
|
|
29
|
-
})), props.session.state === 'ended' && props.session.recorded ? /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: "recorded",
|
|
31
|
-
onClick: openRecording
|
|
32
|
-
}, i18n.t('Recorded')) : null)), props.session.state === 'ended' ? /*#__PURE__*/React.createElement(Stopwatch, {
|
|
33
|
-
className: "duration",
|
|
34
|
-
start: new Date(props.session.activated),
|
|
35
|
-
end: new Date(props.session.ended || Date.now())
|
|
36
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: "active"
|
|
38
|
-
}, i18n.t('Active')), props.children);
|
|
39
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.SmartConnectButton {
|
|
3
|
-
margin: 3px;
|
|
4
|
-
display: inline-block;
|
|
5
|
-
background: #F6F4F8;
|
|
6
|
-
padding: 12px 16px;
|
|
7
|
-
cursor: not-allowed;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
font-weight: 600;
|
|
10
|
-
font-size: 1rem;
|
|
11
|
-
opacity: 0.6;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.SmartConnectButton.connectable {
|
|
15
|
-
background: #040D3C;
|
|
16
|
-
color: #ffffff;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
opacity: 1;
|
|
19
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './SmartConnectButton.css';
|
|
3
|
-
export default function SmartConnectButton(props) {
|
|
4
|
-
function onClick() {
|
|
5
|
-
if (props.device.connectable && props.onClick) props.onClick(props.device);
|
|
6
|
-
}
|
|
7
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
-
className: "SmartConnectButton ".concat(props.device.online ? 'online' : '', " ").concat(props.device.connectable ? 'connectable' : ''),
|
|
9
|
-
onClick: onClick
|
|
10
|
-
}, props.label || 'Connect');
|
|
11
|
-
}
|
package/dist/Stopwatch.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { differenceInMilliseconds, intervalToDuration, format } from 'date-fns';
|
|
3
|
-
export default function Stopwatch(props) {
|
|
4
|
-
var start = props.start || new Date(0);
|
|
5
|
-
var end = props.end || new Date();
|
|
6
|
-
var ms = differenceInMilliseconds(end, start);
|
|
7
|
-
var duration = intervalToDuration({
|
|
8
|
-
start: start,
|
|
9
|
-
end: end
|
|
10
|
-
});
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
style: props.style,
|
|
13
|
-
className: "Stopwatch ".concat(props.className || '')
|
|
14
|
-
}, duration.hours > 0 ? /*#__PURE__*/React.createElement("span", null, duration.hours, /*#__PURE__*/React.createElement("span", null, ":")) : null, /*#__PURE__*/React.createElement("span", null, format(new Date(ms), 'mm:ss')));
|
|
15
|
-
}
|
package/dist/UserIcon.css
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.UserIcon {
|
|
3
|
-
color: white;
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
text-align: center;
|
|
8
|
-
background-size: cover;
|
|
9
|
-
padding: 6px;
|
|
10
|
-
border-radius: 50%;
|
|
11
|
-
width: 1.5em;
|
|
12
|
-
height: 1.5em;
|
|
13
|
-
border: 2px solid #ddd;
|
|
14
|
-
flex: 0 0 auto;
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
}
|
package/dist/UserIcon.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './UserIcon.css';
|
|
3
|
-
export default function UserIcon(props) {
|
|
4
|
-
function initials() {
|
|
5
|
-
if (!props.user) return '';
|
|
6
|
-
if (!props.user.name) return '';
|
|
7
|
-
if (props.user.picture) return '';
|
|
8
|
-
return props.user.name.split(' ').map(function (i) {
|
|
9
|
-
return i.toUpperCase().charAt(0);
|
|
10
|
-
}).join('').substr(0, 2);
|
|
11
|
-
}
|
|
12
|
-
if (!props.user) return null;
|
|
13
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
-
className: "UserIcon ".concat(props.className || ''),
|
|
15
|
-
title: props.user.name || null,
|
|
16
|
-
style: {
|
|
17
|
-
backgroundImage: props.user.picture ? "url(".concat(props.user.picture || '', ")") : undefined,
|
|
18
|
-
backgroundColor: props.user.colour
|
|
19
|
-
}
|
|
20
|
-
}, /*#__PURE__*/React.createElement("span", null, initials()));
|
|
21
|
-
}
|
package/dist/deviceType.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import parser from 'ua-parser-js';
|
|
2
|
-
import i18n from './i18n';
|
|
3
|
-
export default function deviceType(_ref) {
|
|
4
|
-
var platform = _ref.platform,
|
|
5
|
-
device = _ref.device;
|
|
6
|
-
var translateDevice = function translateDevice(device) {
|
|
7
|
-
return i18n.t('{{device}} Device', {
|
|
8
|
-
device: device
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
switch (platform) {
|
|
12
|
-
case 'web':
|
|
13
|
-
{
|
|
14
|
-
var ua = parser(device);
|
|
15
|
-
return i18n.t('{{browser}} on {{os}}', {
|
|
16
|
-
browser: ua.browser.name,
|
|
17
|
-
os: ua.os.name
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
case 'ios':
|
|
21
|
-
return translateDevice('iOS');
|
|
22
|
-
case 'android':
|
|
23
|
-
return translateDevice('Android');
|
|
24
|
-
case 'windows':
|
|
25
|
-
return translateDevice('Windows');
|
|
26
|
-
case 'macos':
|
|
27
|
-
return translateDevice('macOS');
|
|
28
|
-
default:
|
|
29
|
-
return platform;
|
|
30
|
-
}
|
|
31
|
-
}
|