UNPKG

ak-omni-card

Version:
864 lines 71.5 kB
!function(root, factory) { "object" == typeof exports && "object" == typeof module ? module.exports = factory(require("babel-runtime/core-js/object/keys"), require("babel-runtime/core-js/object/get-prototype-of"), require("babel-runtime/helpers/classCallCheck"), require("babel-runtime/helpers/createClass"), require("babel-runtime/helpers/possibleConstructorReturn"), require("babel-runtime/helpers/inherits"), require("react"), require("ak-avatar"), require("ak-button"), require("babel-runtime/helpers/defineProperty"), require("classnames"), require("babel-runtime/helpers/extends"), require("babel-runtime/core-js/promise"), require("babel-runtime/core-js/json/stringify"), require("babel-runtime/core-js/object/assign"), require("es6-promise/auto"), require("whatwg-fetch")) : "function" == typeof define && define.amd ? define([ "babel-runtime/core-js/object/keys", "babel-runtime/core-js/object/get-prototype-of", "babel-runtime/helpers/classCallCheck", "babel-runtime/helpers/createClass", "babel-runtime/helpers/possibleConstructorReturn", "babel-runtime/helpers/inherits", "react", "ak-avatar", "ak-button", "babel-runtime/helpers/defineProperty", "classnames", "babel-runtime/helpers/extends", "babel-runtime/core-js/promise", "babel-runtime/core-js/json/stringify", "babel-runtime/core-js/object/assign", "es6-promise/auto", "whatwg-fetch" ], factory) : "object" == typeof exports ? exports["@atlassian/akProfilecardShipit"] = factory(require("babel-runtime/core-js/object/keys"), require("babel-runtime/core-js/object/get-prototype-of"), require("babel-runtime/helpers/classCallCheck"), require("babel-runtime/helpers/createClass"), require("babel-runtime/helpers/possibleConstructorReturn"), require("babel-runtime/helpers/inherits"), require("react"), require("ak-avatar"), require("ak-button"), require("babel-runtime/helpers/defineProperty"), require("classnames"), require("babel-runtime/helpers/extends"), require("babel-runtime/core-js/promise"), require("babel-runtime/core-js/json/stringify"), require("babel-runtime/core-js/object/assign"), require("es6-promise/auto"), require("whatwg-fetch")) : root["@atlassian/akProfilecardShipit"] = factory(root["babel-runtime/core-js/object/keys"], root["babel-runtime/core-js/object/get-prototype-of"], root["babel-runtime/helpers/classCallCheck"], root["babel-runtime/helpers/createClass"], root["babel-runtime/helpers/possibleConstructorReturn"], root["babel-runtime/helpers/inherits"], root.react, root["ak-avatar"], root["ak-button"], root["babel-runtime/helpers/defineProperty"], root.classnames, root["babel-runtime/helpers/extends"], root["babel-runtime/core-js/promise"], root["babel-runtime/core-js/json/stringify"], root["babel-runtime/core-js/object/assign"], root["es6-promise/auto"], root["whatwg-fetch"]); }(this, function(__WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_8__, __WEBPACK_EXTERNAL_MODULE_9__, __WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_11__, __WEBPACK_EXTERNAL_MODULE_12__, __WEBPACK_EXTERNAL_MODULE_13__, __WEBPACK_EXTERNAL_MODULE_14__, __WEBPACK_EXTERNAL_MODULE_15__, __WEBPACK_EXTERNAL_MODULE_21__, __WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_26__, __WEBPACK_EXTERNAL_MODULE_35__, __WEBPACK_EXTERNAL_MODULE_36__, __WEBPACK_EXTERNAL_MODULE_37__, __WEBPACK_EXTERNAL_MODULE_38__, __WEBPACK_EXTERNAL_MODULE_39__) { /******/ return function(modules) { /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if (installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: !1 }; /******/ /******/ // Return the exports of the module /******/ /******/ /******/ // Execute the module function /******/ /******/ /******/ // Flag the module as loaded /******/ return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.loaded = !0, module.exports; } // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // Load entry module and return exports /******/ /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ /******/ /******/ // expose the module cache /******/ /******/ /******/ // __webpack_public_path__ /******/ return __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.p = "", __webpack_require__(0); }([ /* 0 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(5); }, /* 1 */ , /* 2 */ , /* 3 */ , /* 4 */ , /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.AkIconLabel = exports.AkProfilecard = void 0; var _profilecard = __webpack_require__(6), _profilecard2 = _interopRequireDefault(_profilecard), _profilecardResourced = __webpack_require__(25), _profilecardResourced2 = _interopRequireDefault(_profilecardResourced), _IconLabel = __webpack_require__(20), _IconLabel2 = _interopRequireDefault(_IconLabel); exports.AkProfilecard = _profilecard2.default, exports.AkIconLabel = _IconLabel2.default; exports.default = _profilecardResourced2.default; }, /* 6 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _keys = __webpack_require__(7), _keys2 = _interopRequireDefault(_keys), _getPrototypeOf = __webpack_require__(8), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(9), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(10), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(11), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(12), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(13), _react2 = _interopRequireDefault(_react), _akAvatar = __webpack_require__(14), _akAvatar2 = _interopRequireDefault(_akAvatar), _akButton = __webpack_require__(15), _akButton2 = _interopRequireDefault(_akButton), _profilecard = __webpack_require__(16), _profilecard2 = _interopRequireDefault(_profilecard), _IconLabel = __webpack_require__(20), _IconLabel2 = _interopRequireDefault(_IconLabel), _presences = __webpack_require__(24), _presences2 = _interopRequireDefault(_presences), Profilecard = function(_PureComponent) { function Profilecard() { return (0, _classCallCheck3.default)(this, Profilecard), (0, _possibleConstructorReturn3.default)(this, (Profilecard.__proto__ || (0, _getPrototypeOf2.default)(Profilecard)).apply(this, arguments)); } return (0, _inherits3.default)(Profilecard, _PureComponent), (0, _createClass3.default)(Profilecard, [ { key: "render", value: function() { var actions = (this.props.actions || []).map(function(action) { return _react2.default.createElement(_akButton2.default, { key: action.label, appearance: "link", compact: !0, onClick: action.callback }, action.label); }); return _react2.default.createElement("div", { className: _profilecard2.default.profilecard }, _react2.default.createElement("div", { className: _profilecard2.default.avatarWrapper }, _react2.default.createElement(_akAvatar2.default, { size: "xlarge", src: this.props.avatarUrl })), _react2.default.createElement("div", { className: _profilecard2.default.detailsWrapper }, _react2.default.createElement("span", { className: _profilecard2.default.detailsFullname }, this.props.fullName), _react2.default.createElement("span", { className: _profilecard2.default.detailsMeta }, this.props.meta), _react2.default.createElement(_IconLabel2.default, { className: _profilecard2.default.presence, icon: this.props.presence }, _presences2.default[this.props.presence]), _react2.default.createElement(_IconLabel2.default, { icon: "mention" }, this.props.nickname && "@" + this.props.nickname), _react2.default.createElement(_IconLabel2.default, { icon: "location" }, this.props.location), _react2.default.createElement(_IconLabel2.default, { icon: "time" }, this.props.timestring), this.props.children, _react2.default.createElement("div", { className: _profilecard2.default.actionsFlexSpacer }), _react2.default.createElement("div", { className: _profilecard2.default.actionsWrapper }, actions))); } } ]), Profilecard; }(_react.PureComponent); Profilecard.propTypes = { /** * @memberof Profilecard * @instance * @type {string} */ avatarUrl: _react.PropTypes.string, /** * @memberof Profilecard * @instance * @type {string} */ fullName: _react.PropTypes.string, /** * @memberof Profilecard * @instance * @type {string} */ meta: _react.PropTypes.string, /** * @memberof Profilecard * @instance * @type {string} */ nickname: _react.PropTypes.string, /** * @memberof Profilecard * @instance * @type {string} */ location: _react.PropTypes.string, /** * @memberof Profilecard * @instance * @type {string} */ timestring: _react.PropTypes.string, /** * @description Indicates the users online status by showing a small icon * Allowed values: 'available', 'busy', 'unavailable' or 'none' * @memberof Profilecard * @instance * @default none * @type {string} */ presence: _react.PropTypes.oneOf((0, _keys2.default)(_presences2.default)), /** * @description Defining the action buttons on the card. * Array of one or more action objects with `label` and `callback` keys. * `label` defines the button text while `callback` is invoked when * the button is clicked. * @memberof Profilecard * @instance * @type {array} * @example [{label: 'Chat', callback: () => { ... }}, ... ] */ actions: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.shape({ callback: _react2.default.PropTypes.function, label: _react2.default.PropTypes.string })) }, Profilecard.defaultProps = { presence: "none" }, exports.default = Profilecard; }, /* 7 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_7__; }, /* 8 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_8__; }, /* 9 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_9__; }, /* 10 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_10__; }, /* 11 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_11__; }, /* 12 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_12__; }, /* 13 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_13__; }, /* 14 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_14__; }, /* 15 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_15__; }, /* 16 */ /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(17); "string" == typeof content && (content = [ [ module.id, content, "" ] ]); // add the styles to the DOM __webpack_require__(19)(content, {}); content.locals && (module.exports = content.locals); }, /* 17 */ /***/ function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(18)(), // imports // module exports.push([ module.id, "._1fP-yKWxpjXRMV47voJRll{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._3xvomcjurqk0CGCbnh7KNR{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;display:inline-block;min-width:360px;border-radius:3px;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);padding:0;background-color:#fff;overflow:hidden;position:relative;width:360px;min-height:185px;background:-webkit-linear-gradient(top,#0049b0,#0049b0 90px,#fff 0,#fff);background:linear-gradient(180deg,#0049b0 0,#0049b0 90px,#fff 0,#fff)}._3SgDWZwZyrXCfufQa7l7ee{position:absolute;top:24px;left:24px}._34-qTq0-WbzyAoL7MOqu0g{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;min-height:155px;padding-top:30px;position:relative;left:140px;width:220px}._2Pol6WUQVAiY-YPSDENMtb{width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:18px;color:#fff;margin:0;line-height:21px;height:25px}._3Pt4nETcKYBk8P5JK7VTSy{width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;color:#88a8d6;margin:0;line-height:20px;height:35px}._3orCbJMtY6C2eQCLKgjxfe{line-height:20px;font-size:12px;margin:18px 0 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:210px}._3orCbJMtY6C2eQCLKgjxfe ._3R734IPNlsLLSmqWMyVRqH{display:inline-block;color:#dfe1e6;width:20px;height:20px;vertical-align:top}._3orCbJMtY6C2eQCLKgjxfe ._3R734IPNlsLLSmqWMyVRqH svg{width:100%;height:100%}._3orCbJMtY6C2eQCLKgjxfe._1NnhI3L3B13daWRIY1NQ_K ._3R734IPNlsLLSmqWMyVRqH{width:12px;height:12px;line-height:12px;padding:4px}._3orCbJMtY6C2eQCLKgjxfe._1NnhI3L3B13daWRIY1NQ_K svg{border-radius:100%}._3orCbJMtY6C2eQCLKgjxfe span{color:#172b4d;padding-left:5px}._3orCbJMtY6C2eQCLKgjxfe+._3orCbJMtY6C2eQCLKgjxfe{margin-top:3px}._2SJqcy7Pu8tDmTO1yYEKGr{-webkit-box-flex:1;flex:1 0 auto}._2t6ecoJ_wkWadms2f08Z1x{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:19px 25px 25px 0;text-align:right}._2t6ecoJ_wkWadms2f08Z1x ak-button{display:inline-block}[dir=rtl] ._3SgDWZwZyrXCfufQa7l7ee{left:auto;right:24px}[dir=rtl] ._34-qTq0-WbzyAoL7MOqu0g{left:auto;right:140px}[dir=rtl] ._2t6ecoJ_wkWadms2f08Z1x{margin:19px 0 25px 25px;text-align:left}", "" ]), // exports exports.locals = { "font-smoothing": "_1fP-yKWxpjXRMV47voJRll", fontSmoothing: "_1fP-yKWxpjXRMV47voJRll", profilecard: "_3xvomcjurqk0CGCbnh7KNR", profilecard: "_3xvomcjurqk0CGCbnh7KNR", avatarWrapper: "_3SgDWZwZyrXCfufQa7l7ee", avatarWrapper: "_3SgDWZwZyrXCfufQa7l7ee", detailsWrapper: "_34-qTq0-WbzyAoL7MOqu0g", detailsWrapper: "_34-qTq0-WbzyAoL7MOqu0g", detailsFullname: "_2Pol6WUQVAiY-YPSDENMtb", detailsFullname: "_2Pol6WUQVAiY-YPSDENMtb", detailsMeta: "_3Pt4nETcKYBk8P5JK7VTSy", detailsMeta: "_3Pt4nETcKYBk8P5JK7VTSy", detailsLabel: "_3orCbJMtY6C2eQCLKgjxfe", detailsLabel: "_3orCbJMtY6C2eQCLKgjxfe", detailsLabelIcon: "_3R734IPNlsLLSmqWMyVRqH", detailsLabelIcon: "_3R734IPNlsLLSmqWMyVRqH", presence: "_1NnhI3L3B13daWRIY1NQ_K", presence: "_1NnhI3L3B13daWRIY1NQ_K", actionsFlexSpacer: "_2SJqcy7Pu8tDmTO1yYEKGr", actionsFlexSpacer: "_2SJqcy7Pu8tDmTO1yYEKGr", actionsWrapper: "_2t6ecoJ_wkWadms2f08Z1x", actionsWrapper: "_2t6ecoJ_wkWadms2f08Z1x" }; }, /* 18 */ /***/ function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function() { var list = []; // return the list of modules as css string // import a list of modules into the list return list.toString = function() { for (var result = [], i = 0; i < this.length; i++) { var item = this[i]; item[2] ? result.push("@media " + item[2] + "{" + item[1] + "}") : result.push(item[1]); } return result.join(""); }, list.i = function(modules, mediaQuery) { "string" == typeof modules && (modules = [ [ null, modules, "" ] ]); for (var alreadyImportedModules = {}, i = 0; i < this.length; i++) { var id = this[i][0]; "number" == typeof id && (alreadyImportedModules[id] = !0); } for (i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) "number" == typeof item[0] && alreadyImportedModules[item[0]] || (mediaQuery && !item[2] ? item[2] = mediaQuery : mediaQuery && (item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"), list.push(item)); } }, list; }; }, /* 19 */ /***/ function(module, exports, __webpack_require__) { function addStylesToDom(styles, options) { for (var i = 0; i < styles.length; i++) { var item = styles[i], domStyle = stylesInDom[item.id]; if (domStyle) { domStyle.refs++; for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](item.parts[j]); for (;j < item.parts.length; j++) domStyle.parts.push(addStyle(item.parts[j], options)); } else { for (var parts = [], j = 0; j < item.parts.length; j++) parts.push(addStyle(item.parts[j], options)); stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }; } } } function listToStyles(list) { for (var styles = [], newStyles = {}, i = 0; i < list.length; i++) { var item = list[i], id = item[0], css = item[1], media = item[2], sourceMap = item[3], part = { css: css, media: media, sourceMap: sourceMap }; newStyles[id] ? newStyles[id].parts.push(part) : styles.push(newStyles[id] = { id: id, parts: [ part ] }); } return styles; } function insertStyleElement(options, styleElement) { var head = getHeadElement(), lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1]; if ("top" === options.insertAt) lastStyleElementInsertedAtTop ? lastStyleElementInsertedAtTop.nextSibling ? head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling) : head.appendChild(styleElement) : head.insertBefore(styleElement, head.firstChild), styleElementsInsertedAtTop.push(styleElement); else { if ("bottom" !== options.insertAt) throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'."); head.appendChild(styleElement); } } function removeStyleElement(styleElement) { styleElement.parentNode.removeChild(styleElement); var idx = styleElementsInsertedAtTop.indexOf(styleElement); idx >= 0 && styleElementsInsertedAtTop.splice(idx, 1); } function createStyleElement(options) { var styleElement = document.createElement("style"); return styleElement.type = "text/css", insertStyleElement(options, styleElement), styleElement; } function createLinkElement(options) { var linkElement = document.createElement("link"); return linkElement.rel = "stylesheet", insertStyleElement(options, linkElement), linkElement; } function addStyle(obj, options) { var styleElement, update, remove; if (options.singleton) { var styleIndex = singletonCounter++; styleElement = singletonElement || (singletonElement = createStyleElement(options)), update = applyToSingletonTag.bind(null, styleElement, styleIndex, !1), remove = applyToSingletonTag.bind(null, styleElement, styleIndex, !0); } else obj.sourceMap && "function" == typeof URL && "function" == typeof URL.createObjectURL && "function" == typeof URL.revokeObjectURL && "function" == typeof Blob && "function" == typeof btoa ? (styleElement = createLinkElement(options), update = updateLink.bind(null, styleElement), remove = function() { removeStyleElement(styleElement), styleElement.href && URL.revokeObjectURL(styleElement.href); }) : (styleElement = createStyleElement(options), update = applyToTag.bind(null, styleElement), remove = function() { removeStyleElement(styleElement); }); return update(obj), function(newObj) { if (newObj) { if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) return; update(obj = newObj); } else remove(); }; } function applyToSingletonTag(styleElement, index, remove, obj) { var css = remove ? "" : obj.css; if (styleElement.styleSheet) styleElement.styleSheet.cssText = replaceText(index, css); else { var cssNode = document.createTextNode(css), childNodes = styleElement.childNodes; childNodes[index] && styleElement.removeChild(childNodes[index]), childNodes.length ? styleElement.insertBefore(cssNode, childNodes[index]) : styleElement.appendChild(cssNode); } } function applyToTag(styleElement, obj) { var css = obj.css, media = obj.media; if (media && styleElement.setAttribute("media", media), styleElement.styleSheet) styleElement.styleSheet.cssText = css; else { for (;styleElement.firstChild; ) styleElement.removeChild(styleElement.firstChild); styleElement.appendChild(document.createTextNode(css)); } } function updateLink(linkElement, obj) { var css = obj.css, sourceMap = obj.sourceMap; sourceMap && (// http://stackoverflow.com/a/26603875 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"); var blob = new Blob([ css ], { type: "text/css" }), oldSrc = linkElement.href; linkElement.href = URL.createObjectURL(blob), oldSrc && URL.revokeObjectURL(oldSrc); } /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var stylesInDom = {}, memoize = function(fn) { var memo; return function() { return "undefined" == typeof memo && (memo = fn.apply(this, arguments)), memo; }; }, isOldIE = memoize(function() { return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase()); }), getHeadElement = memoize(function() { return document.head || document.getElementsByTagName("head")[0]; }), singletonElement = null, singletonCounter = 0, styleElementsInsertedAtTop = []; module.exports = function(list, options) { options = options || {}, // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> // tags it will allow on a page "undefined" == typeof options.singleton && (options.singleton = isOldIE()), // By default, add <style> tags to the bottom of <head>. "undefined" == typeof options.insertAt && (options.insertAt = "bottom"); var styles = listToStyles(list); return addStylesToDom(styles, options), function(newList) { for (var mayRemove = [], i = 0; i < styles.length; i++) { var item = styles[i], domStyle = stylesInDom[item.id]; domStyle.refs--, mayRemove.push(domStyle); } if (newList) { var newStyles = listToStyles(newList); addStylesToDom(newStyles, options); } for (var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i]; if (0 === domStyle.refs) { for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); delete stylesInDom[domStyle.id]; } } }; }; var replaceText = function() { var textStore = []; return function(index, replacement) { return textStore[index] = replacement, textStore.filter(Boolean).join("\n"); }; }(); }, /* 20 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _defineProperty2 = __webpack_require__(21), _defineProperty3 = _interopRequireDefault(_defineProperty2), _getPrototypeOf = __webpack_require__(8), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(9), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(10), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(11), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(12), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(13), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(22), _classnames2 = _interopRequireDefault(_classnames), _profilecard = __webpack_require__(16), _profilecard2 = _interopRequireDefault(_profilecard), _icons = __webpack_require__(23), _icons2 = _interopRequireDefault(_icons), IconLabel = function(_PureComponent) { function IconLabel() { return (0, _classCallCheck3.default)(this, IconLabel), (0, _possibleConstructorReturn3.default)(this, (IconLabel.__proto__ || (0, _getPrototypeOf2.default)(IconLabel)).apply(this, arguments)); } return (0, _inherits3.default)(IconLabel, _PureComponent), (0, _createClass3.default)(IconLabel, [ { key: "render", value: function() { var _classNames; if (!this.props.children) return null; var IconElement = _icons2.default[this.props.icon], displayIcon = IconElement ? _react2.default.createElement(IconElement, null) : null, classes = (0, _classnames2.default)((_classNames = {}, (0, _defineProperty3.default)(_classNames, _profilecard2.default.detailsLabel, !0), (0, _defineProperty3.default)(_classNames, this.props.className, this.props.className), _classNames)); return _react2.default.createElement("div", { className: classes }, _react2.default.createElement("div", { className: _profilecard2.default.detailsLabelIcon }, displayIcon), _react2.default.createElement("span", null, this.props.children)); } } ]), IconLabel; }(_react.PureComponent); IconLabel.propTypes = { className: _react.PropTypes.string, icon: _react.PropTypes.string, children: _react.PropTypes.oneOfType([ _react.PropTypes.string, _react.PropTypes.node ]) }, exports.default = IconLabel; }, /* 21 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_21__; }, /* 22 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_22__; }, /* 23 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _react = __webpack_require__(13), _react2 = _interopRequireDefault(_react); // TODO add @enum JSDoc here exports.default = { available: function() { return _react2.default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 8 8", xmlns: "http://www.w3.org/2000/svg" }, _react2.default.createElement("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, _react2.default.createElement("g", { fill: "#48CC8C" }, _react2.default.createElement("circle", { cx: "4", cy: "4", r: "4" })))); }, // TODO move this to ak-icon // eslint-disable-next-line max-len, react/style-prop-object busy: function() { return _react2.default.createElement("svg", { width: "100%", height: "100%", xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: "0 0 8 8", style: { enableBackground: "new 0 0 8 8" } }, _react2.default.createElement("g", { id: "User---presence" }, _react2.default.createElement("g", { id: "Busy-light" }, _react2.default.createElement("circle", { fill: "#ED5451", cx: "4", cy: "4", r: "4" }), _react2.default.createElement("path", { fill: "#FFFFFF", d: "M3.3,1.9l2.8,2.8c0.2,0.2,0.2,0.5,0,0.7L5.4,6.1c-0.2,0.2-0.5,0.2-0.7,0L1.9,3.3c-0.2-0.2-0.2-0.5,0-0.7l0.7-0.7C2.8,1.7,3.1,1.7,3.3,1.9z" })))); }, // TODO move this to ak-icon // eslint-disable-next-line max-len unavailable: function() { return _react2.default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 8 8", xmlns: "http://www.w3.org/2000/svg" }, _react2.default.createElement("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, _react2.default.createElement("g", { id: "Unavailable" }, _react2.default.createElement("g", { id: "presence---offline" }, _react2.default.createElement("path", { d: "M4,8 C6.209139,8 8,6.209139 8,4 C8,1.790861 6.209139,0 4,0 C1.790861,0 0,1.790861 0,4 C0,6.209139 1.790861,8 4,8 Z M4,6 C5.1045695,6 6,5.1045695 6,4 C6,2.8954305 5.1045695,2 4,2 C2.8954305,2 2,2.8954305 2,4 C2,5.1045695 2.8954305,6 4,6 Z", fill: "#6C798E" }), _react2.default.createElement("path", { d: "M4,6 C5.1045695,6 6,5.1045695 6,4 C6,2.8954305 5.1045695,2 4,2 C2.8954305,2 2,2.8954305 2,4 C2,5.1045695 2.8954305,6 4,6 Z", fill: "#CFD4DB" }))))); }, // TODO move this into ak-icon // eslint-disable-next-line max-len, react/self-closing-comp location: function() { return _react2.default.createElement("svg", { width: "24px", height: "24px", viewBox: "0 0 24 24", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, _react2.default.createElement("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, _react2.default.createElement("g", { fill: "currentColor" }, _react2.default.createElement("path", { d: "M18,9 C18,5.6862915 15.3137085,3 12,3 C8.6862915,3 6,5.6862915 6,9 C6,9 5.50203689,12.9837024 11.9603214,20.9511073 C11.9721164,21.0004543 11.9854233,21.0182953 12.0003762,21.0004559 C12.0153291,21.0182953 12.028636,21.0004543 12.0404311,20.9511073 C18.4987155,12.9837024 18.0007524,9 18.0007524,9 L18,9 Z M12,12 C13.6568542,12 15,10.6568542 15,9 C15,7.34314575 13.6568542,6 12,6 C10.3431458,6 9,7.34314575 9,9 C9,10.6568542 10.3431458,12 12,12 Z" })))); }, // TODO move this into ak-icon // eslint-disable-next-line max-len, react/self-closing-comp time: function() { return _react2.default.createElement("svg", { width: "24px", height: "24px", viewBox: "0 0 24 24", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, _react2.default.createElement("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, _react2.default.createElement("g", { fill: "currentColor" }, _react2.default.createElement("path", { d: "M11.7460317,12.8888889 L11.5555556,12.8888889 L11.5555556,12.4938272 L11.5555556,6.17283951 L11.5555556,5.77777778 L12.4444444,5.77777778 L12.4444444,6.17283951 L12.4444444,12 L16.5079365,12 L16.8888889,12 L16.8888889,12.8888889 L16.5079365,12.8888889 L11.9365079,12.8888889 L11.7460317,12.8888889 Z M12,20 C16.418278,20 20,16.418278 20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 Z" })))); }, // TODO move this into ak-icon // eslint-disable-next-line max-len, react/self-closing-comp mention: function() { return _react2.default.createElement("svg", { width: "24px", height: "24px", viewBox: "0 0 24 24", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, _react2.default.createElement("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, _react2.default.createElement("g", { fill: "currentColor" }, _react2.default.createElement("path", { d: "M12.0012385,18.8592797 C9.55129441,18.8592797 7.37485517,17.6882661 6.00110342,15.8754216 C6.87387856,14.4584831 8.44104898,13.5135575 10.2254676,13.5135575 L13.7770094,13.5135575 C15.5633917,13.5135575 17.1290208,14.4599135 18.0011034,15.8757782 C16.6273365,17.6884197 14.451022,18.8592797 12.0012385,18.8592797 L12.0012385,18.8592797 Z M11.9397024,5 C13.6894035,5 15.1075378,6.41919024 15.1075378,8.16783536 C15.1075378,9.91753643 13.6894035,11.3356707 11.9397024,11.3356707 C10.1900013,11.3356707 8.77186703,9.91753643 8.77186703,8.16783536 C8.77186703,6.41919024 10.1900013,5 11.9397024,5 L11.9397024,5 Z" })))); }, // TODO move this into ak-icon // eslint-disable-next-line max-len, react/self-closing-comp warning: function() { return _react2.default.createElement("svg", { width: "100px", height: "100px", viewBox: "0 0 100 100" }, _react2.default.createElement("path", { fill: "#6D7A8F", d: "M98.495,81.938l0.006-0.01L60.475,6.58L60.459,6.57c-2.061-3.616-5.938-6.06-10.396-6.07h-0.059 c-4.458,0.011-8.336,2.455-10.396,6.07L1.565,81.928l0.006,0.01c-0.839,1.639-1.321,3.49-1.321,5.457 c0,6.628,5.371,12.001,11.999,12.001h75.568c6.628,0,11.999-5.373,11.999-12.001C99.816,85.428,99.334,83.576,98.495,81.938z" }), _react2.default.createElement("circle", { fill: "#FFFFFF", cx: "50.033", cy: "83.223", r: "5.5" }), _react2.default.createElement("path", { fill: "#FFFFFF", d: "M50.033,28.677c-3.037,0-5.5,2.462-5.5,5.5v33.864c0,3.037,2.463,5.5,5.5,5.5s5.5-2.463,5.5-5.5V34.177 C55.533,31.139,53.07,28.677,50.033,28.677z" })); } }; }, /* 24 */ /***/ function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); var presences = { none: "", available: "Available", busy: "Unavailable", unavailable: "Offline" }; exports.default = presences; }, /* 25 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _extends2 = __webpack_require__(26), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(8), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(9), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(10), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(11), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(12), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(13), _react2 = _interopRequireDefault(_react), _profilecard = __webpack_require__(6), _profilecard2 = _interopRequireDefault(_profilecard), _LoadingMessage = __webpack_require__(27), _LoadingMessage2 = _interopRequireDefault(_LoadingMessage), _ErrorMessage = __webpack_require__(33), _ErrorMessage2 = _interopRequireDefault(_ErrorMessage), _profileClient = __webpack_require__(34), _profileClient2 = _interopRequireDefault(_profileClient), ProfilecardResourced = function(_PureComponent) { function ProfilecardResourced(props) { (0, _classCallCheck3.default)(this, ProfilecardResourced); var _this = (0, _possibleConstructorReturn3.default)(this, (ProfilecardResourced.__proto__ || (0, _getPrototypeOf2.default)(ProfilecardResourced)).call(this, props)); return _this.profileClient = props.resourceClient || new _profileClient2.default({ url: props.apiEndpoint }), _this.state = { isLoading: !1, hasError: !1 }, _this; } return (0, _inherits3.default)(ProfilecardResourced, _PureComponent), (0, _createClass3.default)(ProfilecardResourced, [ { key: "componentDidMount", value: function() { this.clientFetchProfile(); } }, { key: "componentDidUpdate", value: function(prevProps) { this.props.userId === prevProps.userId && this.props.cloudId === prevProps.cloudId || this.clientFetchProfile(); } }, { key: "clientFetchProfile", value: function() { var _this2 = this; this.setState({ isLoading: !0, hasError: !1, data: {} }); var options = { cloudId: this.props.cloudId, userId: this.props.userId }; this.profileClient.fetch(options).then(function(res) { return _this2.handleClientSuccess(res); }, function(err) { return _this2.handleClientError(err); }).catch(function(err) { return _this2.handleClientError(err); }); } }, { key: "handleClientSuccess", value: function(res) { this.setState({ isLoading: !1, hasError: !1, data: res }); } }, { key: "handleClientError", value: function(err) { this.setState({ isLoading: !1, hasError: !0, error: err }); } }, { key: "render", value: function() { return this.state.hasError ? _react2.default.createElement(_ErrorMessage2.default, null) : this.state.isLoading ? _react2.default.createElement(_LoadingMessage2.default, null) : _react2.default.createElement(_profilecard2.default, (0, _extends3.default)({}, this.state.data, { actions: this.props.actions })); } } ]), ProfilecardResourced; }(_react.PureComponent); ProfilecardResourced.propTypes = { /** * @memberof ProfilecardResourced * @instance * @type {string} */ userId: _react.PropTypes.string.isRequired, /** * @memberof ProfilecardResourced * @instance * @type {string} */ cloudId: _react.PropTypes.string.isRequired, /** * @description Defining the action buttons on the card. * Array of one or more action objects with `label` and `callback` keys. * `label` defines the button text while `callback` is invoked when * the button is clicked. * @memberof ProfilecardResourced * @instance * @type {array} * @example [{label: 'Chat', callback: () => { ... }}, ... ] */ actions: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.shape({ callback: _react2.default.PropTypes.func, label: _react2.default.PropTypes.string })), /** * @memberof ProfilecardResourced * @instance * @type {string} */ apiEndpoint: _react2.default.PropTypes.string.isRequired, resourceClient: _react2.default.PropTypes.shape({ fetch: _react2.default.PropTypes.func }) }, ProfilecardResourced.defaultProps = {}, exports.default = ProfilecardResourced; }, /* 26 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_26__; }, /* 27 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: !0 }); var _getPrototypeOf = __webpack_require__(8), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(9), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(10), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(11), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(12), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(13), _react2 = _interopRequireDefault(_react), _profilecardResourced = __webpack_require__(28), _profilecardResourced2 = _interopRequireDefault(_profilecardResourced), _Spinner = __webpack_require__(30), _Spinner2 = _interopRequireDefault(_Spinner), LoadingMessage = function(_PureComponent) { function LoadingMessage() { return (0, _classCallCheck3.default)(this, LoadingMessage), (0, _possibleConstructorReturn3.default)(this, (LoadingMessage.__proto__ || (0, _getPrototypeOf2.default)(LoadingMessage)).apply(this, arguments)); } return (0, _inherits3.default)(LoadingMessage, _PureComponent), (0, _createClass3.default)(LoadingMessage, [ { key: "render", value: function() { return _react2.default.createElement("div", { className: _profilecardResourced2.default.profilecardResourced }, _react2.default.createElement("div", { className: _profilecardResourced2.default.spinnerContainer }, _react2.default.createElement(_Spinner2.default, null))); } } ]), LoadingMessage; }(_react.PureComponent); LoadingMessage.propTypes = {}, LoadingMessage.defaultProps = {}, exports.default = LoadingMessage; }, /* 28 */ /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(29); "string" == typeof content && (content = [ [ module.id, content, "" ] ]); // add the styles to the DOM __webpack_require__(19)(content, {}); content.locals && (module.exports = content.locals); }, /* 29 */ /***/ function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(18)(), // imports // module exports.push([ module.id, "._3lq6Ip7tFGS14KXP0QpLNb{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._3vnM3FlUIarqBQib8qGs4u{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;width:360px;height:185px;background:#ff