From 44c6063a032ce252ae40cc0cafa64acd89ad880a Mon Sep 17 00:00:00 2001
From: fan <504498960@qq.com>
Date: Sun, 31 Jan 2021 19:58:27 +0800
Subject: [PATCH] `
---
dist/index.common.js | 494 +++++++++++-------
dist/index.css | 2 +-
dist/index.umd.js | 494 +++++++++++-------
dist/index.umd.min.js | 2 +-
examples/App.vue | 50 +-
examples/dist/css/index.da20b752.css | 1 +
examples/dist/css/index.fed1a091.css | 1 -
examples/dist/index.html | 2 +-
examples/dist/js/index.4318ecd4.js | 1 -
examples/dist/js/index.f43bda32.js | 1 +
package.json | 2 +-
packages/components/avatar.vue | 11 +-
packages/components/button.vue | 31 +-
packages/components/contact.vue | 10 +-
packages/components/editor.vue | 76 ++-
packages/components/index.vue | 89 +++-
packages/components/message/basic.vue | 2 +-
packages/components/message/text.vue | 2 +-
packages/components/messages.vue | 4 +-
packages/components/popover.vue | 9 +-
.../{dropdown.js => contextmenu.js} | 8 +-
packages/directives/index.js | 4 +-
packages/lastContentRender.js | 2 +-
packages/utils/index.js | 3 -
24 files changed, 853 insertions(+), 448 deletions(-)
create mode 100644 examples/dist/css/index.da20b752.css
delete mode 100644 examples/dist/css/index.fed1a091.css
delete mode 100644 examples/dist/js/index.4318ecd4.js
create mode 100644 examples/dist/js/index.f43bda32.js
rename packages/directives/{dropdown.js => contextmenu.js} (83%)
diff --git a/dist/index.common.js b/dist/index.common.js
index 804ed3c..e4eddeb 100644
--- a/dist/index.common.js
+++ b/dist/index.common.js
@@ -5642,6 +5642,136 @@ var es7_array_includes = __webpack_require__("6762");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js
var es6_string_includes = __webpack_require__("2fdb");
+// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
+var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
+var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
+
+// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.constructor.js
+var es6_regexp_constructor = __webpack_require__("3b2b");
+
+// EXTERNAL MODULE: ./node_modules/core-js/modules/es7.object.values.js
+var es7_object_values = __webpack_require__("8615");
+
+// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.to-string.js
+var es6_regexp_to_string = __webpack_require__("6b54");
+
+// CONCATENATED MODULE: ./packages/utils/validate.js
+
+
+
+
+
+function isPlainObject(obj) {
+ return Object.prototype.toString.call(obj) === "[object Object]";
+}
+function isString(str) {
+ return typeof str == "string";
+}
+function isToday(time) {
+ return new Date().getTime() - time < 86400000;
+}
+function isEmpty(obj) {
+ if (!obj) return true;
+ if (Array.isArray(obj) && obj.length == 0) return true;
+ if (isPlainObject(obj) && Object.values(obj).length == 0) return true;
+ return false;
+}
+function isUrl(str) {
+ var reg = "^((https|http|ftp|rtsp|mms)?://)" + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" + //ftp的user@
+ "(([0-9]{1,3}.){3}[0-9]{1,3}" + // IP形式的URL- 199.194.52.184
+ "|" + // 允许IP和DOMAIN(域名)
+ "([0-9a-z_!~*'()-]+.)*" + // 域名- www.
+ "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]." + // 二级域名
+ "[a-z]{2,6})" + // first level domain- .com or .museum
+ "(:[0-9]{1,4})?" + // 端口- :80
+ "((/?)|" + // 如果没有文件名,则不需要斜杠
+ "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
+ return new RegExp(reg).test(str) ? true : false;
+}
+function isFunction(val) {
+ return val && typeof val === "function";
+}
+function isEng(val) {
+ return /^[A-Za-z]+$/.test(val);
+}
+// CONCATENATED MODULE: ./packages/directives/contextmenu.js
+
+
+
+
+var popover;
+
+var hidePopover = function hidePopover() {
+ if (popover) popover.style.display = 'none';
+};
+
+var showPopover = function showPopover() {
+ if (popover) popover.style.display = 'block';
+};
+
+document.addEventListener('click', function (e) {
+ hidePopover();
+});
+/* harmony default export */ var contextmenu = ({
+ hide: hidePopover,
+ bind: function bind(el, binding, vnode) {
+ el.addEventListener('contextmenu', function (e) {
+ if (isEmpty(binding.value) || !Array.isArray(binding.value)) return;
+ e.preventDefault();
+ components_popover.methods.closeAll();
+ var component;
+ var visibleItems = [];
+ if (binding.modifiers.message) component = vnode.context;else if (binding.modifiers.contact) component = vnode.child;
+
+ if (!popover) {
+ popover = document.createElement('div');
+ popover.className = 'lemon-contextmenu';
+ document.body.appendChild(popover);
+ }
+
+ popover.innerHTML = binding.value.map(function (item) {
+ var visible;
+
+ if (isFunction(item.visible)) {
+ visible = item.visible(component);
+ } else {
+ visible = item.visible === undefined ? true : item.visible;
+ }
+
+ if (visible) {
+ visibleItems.push(item);
+ var icon = item.icon ? "") : '';
+ return "
");
+ }
+
+ return '';
+ }).join("");
+ popover.style.top = "".concat(e.pageY, "px");
+ popover.style.left = "".concat(e.pageX, "px");
+ popover.childNodes.forEach(function (node, index) {
+ var _visibleItems$index = visibleItems[index],
+ click = _visibleItems$index.click,
+ _render = _visibleItems$index.render;
+ node.addEventListener('click', function (e) {
+ e.stopPropagation();
+ if (isFunction(click)) click(e, component, hidePopover);
+ });
+
+ if (isFunction(_render)) {
+ var ins = external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({
+ render: function render(h) {
+ return _render(h, component, hidePopover);
+ }
+ });
+ var renderComponent = new ins().$mount();
+ node.querySelector('span').innerHTML = renderComponent.$el.outerHTML;
+ }
+ });
+ showPopover();
+ });
+ },
+ inserted: function inserted(el, binding, vnode) {}
+});
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/popover.vue?vue&type=script&lang=js&
@@ -5652,12 +5782,6 @@ var es6_string_includes = __webpack_require__("2fdb");
var popoverCloseQueue = [];
-var popoverCloseAll = function popoverCloseAll() {
- return popoverCloseQueue.forEach(function (callback) {
- return callback();
- });
-};
-
var triggerEvents = {
hover: function hover(el) {},
focus: function focus(el) {
@@ -5675,6 +5799,7 @@ var triggerEvents = {
el.addEventListener("click", function (e) {
e.stopPropagation();
+ contextmenu.hide();
_this2.changeVisible();
});
@@ -5731,8 +5856,6 @@ var triggerEvents = {
}
}
}, [h("div", {
- "class": "lemon-popover__title"
- }), h("div", {
"class": "lemon-popover__content"
}, [this.$slots.content]), h("div", {
"class": "lemon-popover__arrow"
@@ -5792,9 +5915,14 @@ var triggerEvents = {
this.visible ? this.close() : this.open();
},
open: function open() {
- popoverCloseAll();
+ this.closeAll();
this.visible = true;
},
+ closeAll: function closeAll() {
+ popoverCloseQueue.forEach(function (callback) {
+ return callback();
+ });
+ },
close: function close() {
this.visible = false;
}
@@ -5825,17 +5953,21 @@ var popover_component = normalizeComponent(
)
-/* harmony default export */ var popover = (popover_component.exports);
+/* harmony default export */ var components_popover = (popover_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/button.vue?vue&type=script&lang=js&
/* harmony default export */ var buttonvue_type_script_lang_js_ = ({
name: "LemonButton",
props: {
+ color: {
+ type: String,
+ default: 'default'
+ },
disabled: Boolean
},
render: function render() {
var h = arguments[0];
return h("button", {
- "class": "lemon-button",
+ "class": ['lemon-button', "lemon-button--color-".concat(this.color)],
"attrs": {
"disabled": this.disabled,
"type": "button"
@@ -5940,12 +6072,19 @@ var badge_component = normalizeComponent(
/* harmony default export */ var avatarvue_type_script_lang_js_ = ({
name: "LemonAvatar",
+ inject: ['IMUI'],
props: {
src: String,
icon: {
type: String,
default: "lemon-icon-people"
},
+ circle: {
+ type: Boolean,
+ default: function _default() {
+ return this.IMUI ? this.IMUI.avatarCricle : false;
+ }
+ },
size: {
type: Number,
default: 32
@@ -5962,7 +6101,9 @@ var badge_component = normalizeComponent(
var h = arguments[0];
return h("span", {
"style": this.style,
- "class": "lemon-avatar",
+ "class": ['lemon-avatar', {
+ 'lemon-avatar--circle': this.circle
+ }],
"on": {
"click": function click(e) {
return _this.$emit("click", e);
@@ -6026,54 +6167,6 @@ var avatar_component = normalizeComponent(
var helper = __webpack_require__("2638");
var helper_default = /*#__PURE__*/__webpack_require__.n(helper);
-// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.constructor.js
-var es6_regexp_constructor = __webpack_require__("3b2b");
-
-// EXTERNAL MODULE: ./node_modules/core-js/modules/es7.object.values.js
-var es7_object_values = __webpack_require__("8615");
-
-// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.to-string.js
-var es6_regexp_to_string = __webpack_require__("6b54");
-
-// CONCATENATED MODULE: ./packages/utils/validate.js
-
-
-
-
-
-function isPlainObject(obj) {
- return Object.prototype.toString.call(obj) === "[object Object]";
-}
-function isString(str) {
- return typeof str == "string";
-}
-function isToday(time) {
- return new Date().getTime() - time < 86400000;
-}
-function isEmpty(obj) {
- if (!obj) return true;
- if (Array.isArray(obj) && obj.length == 0) return true;
- if (isPlainObject(obj) && Object.values(obj).length == 0) return true;
- return false;
-}
-function isUrl(str) {
- var reg = "^((https|http|ftp|rtsp|mms)?://)" + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" + //ftp的user@
- "(([0-9]{1,3}.){3}[0-9]{1,3}" + // IP形式的URL- 199.194.52.184
- "|" + // 允许IP和DOMAIN(域名)
- "([0-9a-z_!~*'()-]+.)*" + // 域名- www.
- "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]." + // 二级域名
- "[a-z]{2,6})" + // first level domain- .com or .museum
- "(:[0-9]{1,4})?" + // 端口- :80
- "((/?)|" + // 如果没有文件名,则不需要斜杠
- "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
- return new RegExp(reg).test(str) ? true : false;
-}
-function isFunction(val) {
- return val && typeof val === "function";
-}
-function isEng(val) {
- return /^[A-Za-z]+$/.test(val);
-}
// EXTERNAL MODULE: ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js
var es7_object_get_own_property_descriptors = __webpack_require__("8e6e");
@@ -6223,9 +6316,6 @@ function mergeDeep(o1, o2) {
return o1;
}
-function toEmojiName(str) {
- return str.replace(/
-
Lemon-IMUI 目前内置了file、image、text、event四种消息类型,在实际应用当中肯定是不够的哦,咋办?没事的,我们继续往下see。
要创建自定义消息首先要确定新消息的 Message 结构。
+
Lemon-IMUI 目前内置了file、image、text、event四种消息类型,在实际应用当中肯定是不够的哦,咋办?没事的,我们继续往下see。
要创建消息首先要确定新消息的 Message 结构。
{
//值为 voice,用于解析的组件 name 必须为 lemonMessageVoice
@@ -1092,6 +1116,10 @@ export default {
},
mounted() {
+
+
+
+
const contactData1 = {
id: "contact-1",
displayName: "工作协作群",
diff --git a/examples/dist/css/index.da20b752.css b/examples/dist/css/index.da20b752.css
new file mode 100644
index 0000000..0710f9d
--- /dev/null
+++ b/examples/dist/css/index.da20b752.css
@@ -0,0 +1 @@
+.lemon-message.lemon-message-voice{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message.lemon-message-voice .lemon-message__content{border:2px solid #000;font-size:12px;cursor:pointer}.lemon-message.lemon-message-voice .lemon-message__content:before{display:none}::-moz-selection{background:#000;color:#fff}::selection{background:#000;color:#fff}body{font-family:Microsoft YaHei;background:#f6f6f6!important}#app{width:90%;margin:0 auto;padding-bottom:100px}#app .scroll-top{cursor:pointer;position:fixed;bottom:40px;left:50%;border-radius:50%;background:#fff;font-size:18px;overflow:hidden;width:40px;height:40px;line-height:40px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;-webkit-transform:rotate(-45deg) translateX(-50%);transform:rotate(-45deg) translateX(-50%);-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}#app .scroll-top:hover{font-size:22px}a{color:#0c5ed9;text-decoration:none;font-size:12px}.action{margin-top:20px}.action .lemon-button{margin-right:10px;margin-bottom:10px}.link{font-size:14px;margin-top:15px}.link a{margin:0 5px;text-decoration:none;background:#ffba00;border-radius:4px;padding:5px 10px;color:rgba(0,0,0,.8)}.link a,.logo{display:inline-block}.logo{position:relative;margin:60px auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.logo-text{font-size:38px}.logo-sub{font-size:18px;color:#999;font-weight:300}.logo-badge{position:absolute;top:-10px;left:230px;background:#000;border-radius:16px;color:#f9f9f9;font-size:12px;padding:4px 8px}.title{font-size:24px;line-height:26px;border-left:1px solid #ffba00;padding-left:15px;margin-bottom:15px;margin-top:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.table{width:100%;border-radius:10px;background:#fff;border-collapse:collapse}.table tr{cursor:pointer}.table tr:not(.table-head):hover{background:#ffba00!important}.table tr:nth-of-type(2n){background:#f9f9f9}.table th{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#999}.table td,.table th{text-align:left;padding:10px 15px;font-size:14px;font-weight:400}.imui-center{margin-bottom:60px}.imui-center .lemon-wrapper,.imui-center .lemon-wrapper--drawer-show .lemon-drawer{-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}.drawer-content{padding:15px}.more{font-size:12px;line-height:24px;height:24px;position:absolute;top:14px;right:14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#f1f1f1;display:inline-block;border-radius:4px;background:#111;padding:0 8px}.more:active{background:#999}.bar{line-height:30px;background:#fff;margin:15px;color:#666;font-size:12px}.bar,.cover{text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cover{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cover i{font-size:84px;color:#e6e6e6}.cover p{font-size:18px;color:#ddd;line-height:50px}.article-item{line-height:34px;cursor:pointer}.article-item:hover{text-decoration:underline;color:#318efd}pre{background:#fff;border-radius:8px;padding:15px}.lemon-simple .lemon-container{z-index:5}.lemon-simple .lemon-drawer{z-index:4}input#switch[type=checkbox]{height:0;width:0;display:none}label#switch-label{cursor:pointer;text-indent:-9999px;width:34px;height:20px;background:#aaa;display:block;border-radius:100px;position:relative}label#switch-label:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:20px;-webkit-transition:.3s;transition:.3s}input#switch:checked+label{background:#0fd547}input#switch:checked+label:after{left:calc(100% - 2px);-webkit-transform:translateX(-100%);transform:translateX(-100%)}label#switch-label:active:after{width:20px}.lemon-tabs{background:#f6f6f6}.lemon-tabs-content{padding:15px}.lemon-tabs-content,.lemon-tabs-content__pane{width:100%;height:100%}.lemon-tabs-nav{display:-webkit-box;display:-ms-flexbox;display:flex;background:#eee}.lemon-tabs-nav__item{line-height:38px;padding:0 15px;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.lemon-tabs-nav__item--active{background:#f6f6f6}.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:1}.lemon-popover__arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg);position:absolute;z-index:0;bottom:-4px;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);width:8px;height:8px;background:#fff}.lemon-slide-top-enter-active,.lemon-slide-top-leave-active{-webkit-transition:all .2s cubic-bezier(.645,.045,.355,1);transition:all .2s cubic-bezier(.645,.045,.355,1)}.lemon-slide-top-enter,.lemon-slide-top-leave-to{-webkit-transform:translateY(-10px) scale(.8);transform:translateY(-10px) scale(.8);opacity:0}.lemon-button{outline:none;line-height:1.499;display:inline-block;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid #ddd;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;padding:0 15px;font-size:14px;border-radius:4px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);color:rgba(0,0,0,.65);background-color:#fff;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);text-shadow:0 -1px 0 rgba(0,0,0,.12)}.lemon-button--color-default:hover:not([disabled]){border-color:#666;color:#333}.lemon-button--color-default:active{background-color:#ddd}.lemon-button--color-default[disabled]{cursor:not-allowed;color:#aaa;background:#eee}.lemon-button--color-grey{background:#e1e1e1;border-color:#e1e1e1;color:#666}.lemon-button--color-grey:hover:not([disabled]){border-color:#bbb}.lemon-badge{position:relative;display:inline-block}.lemon-badge__label{border-radius:10px;background:#f5222d;color:#fff;text-align:center;font-size:12px;font-weight:400;white-space:nowrap;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff;z-index:10;position:absolute;-webkit-transform:translateX(50%);transform:translateX(50%);-webkit-transform-origin:100%;transform-origin:100%;display:inline-block;padding:0 4px;height:18px;line-height:17px;min-width:10px;top:-4px;right:6px}.lemon-badge__label--dot{width:10px;height:10px;min-width:auto;padding:0;top:-3px;right:2px}.lemon-avatar{font-variant:tabular-nums;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;display:inline-block;text-align:center;background:#ccc;color:hsla(0,0%,100%,.7);white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;border-radius:4px}.lemon-avatar--circle{border-radius:50%}.lemon-avatar img{width:100%;height:100%;display:block}.lemon-contact{padding:10px 14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#efefef;text-align:left}.lemon-contact p{margin:0}.lemon-contact--active{background:#bebdbd}.lemon-contact:hover:not(.lemon-contact--active){background:#e3e3e3}.lemon-contact:hover:not(.lemon-contact--active) .el-badge__content{border-color:#ddd}.lemon-contact__avatar{float:left;margin-right:10px}.lemon-contact__avatar img{display:block}.lemon-contact__avatar .ant-badge-count{display:inline-block;padding:0 4px;height:18px;line-height:18px;min-width:18px;top:-4px;right:7px}.lemon-contact__label{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-contact__time{font-size:12px;line-height:18px;padding-left:6px;color:#999;white-space:nowrap}.lemon-contact__name{display:block;width:100%}.lemon-contact__content,.lemon-contact__name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.lemon-contact__content{font-size:12px;color:#999;height:18px;line-height:18px;margin-top:1px!important}.lemon-contact__content img{height:14px;display:inline-block;vertical-align:middle;margin:0 1px;position:relative;top:-1px}.lemon-contact--name-center .lemon-contact__label{padding-bottom:0;line-height:38px}.lemon-editor{height:200px;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.lemon-editor,.lemon-editor__tool{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-editor__tool{height:40px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:0 5px}.lemon-editor__tool-left,.lemon-editor__tool-right{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-editor__tool-item{cursor:pointer;padding:4px 10px;height:28px;line-height:24px;color:#999;-webkit-transition:all .3s ease;transition:all .3s ease;font-size:12px}.lemon-editor__tool-item [class^=lemon-icon-]{line-height:26px;font-size:22px}.lemon-editor__tool-item:hover{color:#333}.lemon-editor__tool-item--right{margin-left:auto}.lemon-editor__inner{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-x:hidden;overflow-y:auto}.lemon-editor__inner::-webkit-scrollbar{width:5px;height:5px}.lemon-editor__inner::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-editor__inner::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-editor__inner::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-editor__clipboard-image{position:absolute;top:0;left:0;width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#f4f4f4;z-index:1}.lemon-editor__clipboard-image img{max-height:66%;max-width:80%;background:#e9e9e9;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;border-radius:4px;margin-bottom:10px;border:3px dashed #ddd!important;-webkit-box-sizing:border-box;box-sizing:border-box}.lemon-editor__clipboard-image .clipboard-popover-title{font-size:14px;color:#333}.lemon-editor__input{height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;outline:none;padding:0 10px}.lemon-editor__input::-webkit-scrollbar{width:5px;height:5px}.lemon-editor__input::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-editor__input::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-editor__input::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-editor__input div,.lemon-editor__input p{margin:0}.lemon-editor__input img{height:20px;padding:0 2px;pointer-events:none;vertical-align:middle}.lemon-editor__footer{display:-webkit-box;display:-ms-flexbox;display:flex;height:52px;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:0 10px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.lemon-editor__tip{margin-right:10px;font-size:12px;color:#999}.lemon-editor__emoji,.lemon-editor__tip{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-editor__emoji .lemon-popover{background:#f6f6f6}.lemon-editor__emoji .lemon-popover__content{padding:0}.lemon-editor__emoji .lemon-popover__arrow{background:#f6f6f6}.lemon-editor__emoji .lemon-tabs-content{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px;height:200px;overflow-x:hidden;overflow-y:auto;margin-bottom:8px}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar{width:5px;height:5px}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-editor__emoji-item{cursor:pointer;width:22px;padding:4px;border-radius:4px}.lemon-editor__emoji-item:hover{background:#e9e9e9}.lemon-messages{height:400px;overflow-x:hidden;overflow-y:auto;padding:10px 15px}.lemon-messages::-webkit-scrollbar{width:5px;height:5px}.lemon-messages::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-messages::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-messages::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-messages__load,.lemon-messages__time{text-align:center;font-size:12px}.lemon-messages__load{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#999;line-height:30px}.lemon-messages__load--ing{font-size:22px}.lemon-message{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px 0}.lemon-message__time{color:#b9b9b9;padding:0 5px}.lemon-message__inner{position:relative}.lemon-message__avatar{padding-right:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message__avatar .lemon-avatar{cursor:pointer}.lemon-message__title{font-size:12px;line-height:14px;padding-bottom:6px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#666}.lemon-message__content-flex,.lemon-message__title{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-message__content{font-size:14px;line-height:20px;padding:8px 10px;background:#fff;border-radius:4px;position:relative;margin:0}.lemon-message__content img,.lemon-message__content video{background:#e9e9e9;height:100px}.lemon-message__content:before{content:" ";position:absolute;top:6px;width:0;height:0;border:4px solid transparent;left:-4px;border-left:none;border-right-color:#fff}.lemon-message__content-after{display:block;width:48px;height:36px;padding-left:6px;-webkit-box-flex:0;-ms-flex:none;flex:none;font-size:12px;color:#aaa;overflow:hidden;visibility:hidden}.lemon-message__status{position:absolute;top:23px;right:20px;color:#aaa;font-size:20px}.lemon-message__status .lemon-icon-loading,.lemon-message__status .lemon-icon-prompt{display:none}.lemon-message--status-failed .lemon-icon-prompt,.lemon-message--status-going .lemon-icon-loading{display:inline-block}.lemon-message--status-succeed .lemon-message__content-after{visibility:visible}.lemon-message--reverse,.lemon-message--reverse .lemon-message__content-flex{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.lemon-message--reverse .lemon-message__content-after{padding-right:6px;padding-left:0;text-align:right}.lemon-message--reverse .lemon-message__title{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.lemon-message--reverse .lemon-message__status{left:26px;right:auto}.lemon-message--reverse .lemon-message__content{background:#35d863}.lemon-message--reverse .lemon-message__content:before{content:" ";position:absolute;top:6px;width:0;height:0;border:4px solid transparent;left:auto;right:-4px;border-right:none;border-left-color:#35d863}.lemon-message--reverse .lemon-message__title{text-align:right}.lemon-message--reverse .lemon-message__avatar{padding-right:0;padding-left:10px}.lemon-message--hide-name .lemon-message__status{top:3px}.lemon-message--hide-name .lemon-message__title{display:none}.lemon-message--hide-name .lemon-message__content:before{top:14px}.lemon-message-text .lemon-message__content img{width:18px;height:18px;display:inline-block;background:transparent;padding:0 2px;vertical-align:middle}.lemon-message-image .lemon-message__content{padding:0;cursor:pointer;overflow:hidden}.lemon-message-image .lemon-message__content img{max-width:100%;min-width:100px;display:block}.lemon-message-file .lemon-message__content{display:-webkit-box;display:-ms-flexbox;display:flex;cursor:pointer;width:200px;background:#fff;padding:12px 18px;overflow:hidden}.lemon-message-file .lemon-message__content p{margin:0}.lemon-message-file__tip{display:none}.lemon-message-file__inner{-webkit-box-flex:1;-ms-flex:1;flex:1}.lemon-message-file__name{font-size:14px}.lemon-message-file__byte{font-size:12px;color:#aaa}.lemon-message-file__sfx{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-weight:700;font-size:34px;color:#ccc}.lemon-message-event__content,.lemon-message-file__sfx{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message-event__content{display:inline-block;background:#e9e9e9;color:#aaa;font-size:12px;margin:0 auto;padding:5px 10px;border-radius:4px}.lemon-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;font-family:Microsoft YaHei;background:#efefef;-webkit-transition:all .4s cubic-bezier(.645,.045,.355,1);transition:all .4s cubic-bezier(.645,.045,.355,1);position:relative}.lemon-wrapper p{margin:0}.lemon-wrapper img{vertical-align:middle;border-style:none}.lemon-menu{-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:60px;background:#1d232a;padding:15px 0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-menu,.lemon-menu__bottom{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.lemon-menu__bottom{position:absolute;bottom:0}.lemon-menu__avatar{margin-bottom:20px;cursor:pointer}.lemon-menu__item{color:#999;cursor:pointer;padding:14px 10px;max-width:100%;word-break:break-all;word-wrap:break-word;white-space:pre-wrap}.lemon-menu__item--active{color:#0fd547}.lemon-menu__item:hover:not(.lemon-menu__item--active){color:#eee}.lemon-menu__item>*{font-size:24px}.lemon-menu__item .ant-badge-count{display:inline-block;padding:0 4px;height:18px;line-height:16px;min-width:18px}.lemon-menu__item .ant-badge-count,.lemon-menu__item .ant-badge-dot{-webkit-box-shadow:0 0 0 1px #1d232a;box-shadow:0 0 0 1px #1d232a}.lemon-sidebar{width:250px;background:#efefef;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.lemon-sidebar__scroll{overflow-y:auto}.lemon-sidebar__scroll::-webkit-scrollbar{width:5px;height:5px}.lemon-sidebar__scroll::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-sidebar__scroll::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-sidebar__scroll::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-sidebar__label{padding:6px 14px 6px 14px;color:#666;font-size:12px;margin:0;text-align:left}.lemon-sidebar .lemon-contact--active{background:#d9d9d9}.lemon-container{-webkit-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background:#f4f4f4;word-break:break-all;word-wrap:break-word;white-space:pre-wrap;position:relative;z-index:10}.lemon-container__title{padding:15px 15px}.lemon-container__displayname{font-size:16px}.lemon-messages{-webkit-box-flex:1;-ms-flex:1;flex:1;height:auto}.lemon-drawer{position:absolute;top:0;right:0;overflow:hidden;background:#f4f4f4;-webkit-transition:width .4s cubic-bezier(.645,.045,.355,1);transition:width .4s cubic-bezier(.645,.045,.355,1);z-index:9;width:200px;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.lemon-wrapper--drawer-show .lemon-drawer{right:-200px}.lemon-contact-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%}.lemon-contact-info h4{font-size:16px;font-weight:400;margin:10px 0 20px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-wrapper--theme-blue .lemon-message__content{background:#f3f3f3}.lemon-wrapper--theme-blue .lemon-message__content:before{border-right-color:#f3f3f3}.lemon-wrapper--theme-blue .lemon-message--reverse .lemon-message__content{background:#e6eeff}.lemon-wrapper--theme-blue .lemon-message--reverse .lemon-message__content:before{border-left-color:#e6eeff}.lemon-wrapper--theme-blue .lemon-container{background:#fff}.lemon-wrapper--theme-blue .lemon-sidebar,.lemon-wrapper--theme-blue .lemon-sidebar .lemon-contact{background:#f9f9f9}.lemon-wrapper--theme-blue .lemon-sidebar .lemon-contact:hover:not(.lemon-contact--active){background:#f1f1f1}.lemon-wrapper--theme-blue .lemon-sidebar .lemon-contact--active{background:#e9e9e9}.lemon-wrapper--theme-blue .lemon-menu{background:#096bff}.lemon-wrapper--theme-blue .lemon-menu__item{color:hsla(0,0%,100%,.4)}.lemon-wrapper--theme-blue .lemon-menu__item:hover:not(.lemon-menu__item--active){color:hsla(0,0%,100%,.6)}.lemon-wrapper--theme-blue .lemon-menu__item--active{color:#fff;text-shadow:0 0 10px rgba(2,48,118,.4)}.lemon-wrapper--simple .lemon-menu,.lemon-wrapper--simple .lemon-sidebar{display:none}.lemon-contextmenu{border-radius:4px;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:6px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.06);box-shadow:0 2px 8px rgba(0,0,0,.06);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;min-width:120px}.lemon-contextmenu__item{font-size:14px;line-height:16px;padding:10px 15px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#333}.lemon-contextmenu__item>span{display:inline-block;-webkit-box-flex:0;-ms-flex:none;flex:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.lemon-contextmenu__item:hover{background:#f3f3f3;color:#000}.lemon-contextmenu__item:active{background:#e9e9e9}.lemon-contextmenu__icon{font-size:16px;margin-right:4px}.lemonani-spin{display:inline-block;-webkit-animation:lemonani-spin 1s infinite;animation:lemonani-spin 1s infinite}@-webkit-keyframes lemonani-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes lemonani-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@font-face{font-family:lemon-icons;src:url(data:font/woff;base64,d09GRgABAAAAAAkoAAsAAAAADfwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8qUo8Y21hcAAAAYAAAAClAAACNh3rDoZnbHlmAAACKAAABK8AAAaY5qHpBGhlYWQAAAbYAAAALwAAADYWBoAkaGhlYQAABwgAAAAcAAAAJAfeA4xobXR4AAAHJAAAAA8AAAAsLAAAAGxvY2EAAAc0AAAAGAAAABgH9gmmbWF4cAAAB0wAAAAfAAAAIAEaAF9uYW1lAAAHbAAAAUUAAAJtPlT+fXBvc3QAAAi0AAAAcwAAAKJTcQpreJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeGb/wYm7438AQw9zA0AAUZgTJAQDm+gxieJzlkrERwjAMRb+JYyBHQROarEDHFpmJARiFil2yQO6SQsoEac2XRUeYgO97vtMvJN+3ANQAKnIlEQgvBJiedEPxKzTFj7izvuBMJ8lNZlkla6udDjrqtPQ5A7/8DQX2+j7mJ+xxwJFzd5wV7Y0hbfb4L53K/fhUjaXt2E/J7DA9yOowR0h2mCi0dZgttHOsjw4O84aOjm2FTo5txtI7qN/ZbEV0AAAAeJxlVN+PE1UUvufezsy2nU47s9PpzLCdbaftFLbQQNudsu5uu/iDZrtGVkSpimQNhqSGNagxRvHHmoASjULwhTXRYDDRR142MTFEeSPwQGJissTE8DcYQzRui+dOWSjStOfeO/e70/Pd7zuHACF3brNPWZSUCQFPUiANesqBaag4oCvglmGyVixDCdzBnkMrDVorU0pkmQkjgsxCL6x2Oqtr5zuRUJSxWFgQmt1zF851mziwCMhMpqHYiCAEmM75F2ORkBDGc2xxgOFQQgl+2Fl6lYwSCzPJFj38SzGp6kY1W/En1ZrHsmo1lWXH+6tvMdZXNE2htzD6veOX34ZD9LnjVFN6l/hz+COm9UuUvEGIELz3O3qNxIlBsmSCVPnb///myXpqC0wWvTjwn5oVGlDzXFE36hVDF12v5rOPN/6KqWqMyRgrveZHn/++/qso/vaJKLxHr/RuFCqVdqVSkBMJM5Gg19RY7wcOp52Y2rtU+Op7CN0hL/0jCL0LovglfHYDOLxdeZPDzQThOvTYfsZIg+vgSiDq42DUoYFCUF3ENWZRB7+6CzOKD3ab4Nc83FICWXwORjLR9pV2/1/G8pIIgtV4orHLts3+9cwzs2kYiSpxPbJOaUES153mgUz/b8u2q83HmjZM5vJ5+lOr1d9gI7QgCCCYtr0Lz1v9687ssw6MRPR0ZJ1JDDfXxw82wMHTzb3NimXhabfzcoeQ0F0/RYhDimQnmUI2ZVoCEd0jiUndSCUdSFUDgzWg7tcEfrn8kqsPTdirzvKZRbo4v/eY4xg6GNqpbZ0y3Xdm2cn0rmqmmTPNb3DIm+bXarCiVmt5Fsad5VZ7sfz8tlNqCnRj5lhr/tt3OOrBb5DrBrtAb5EoSZEcaWOuOS465oYXWxyeV3nkjtSN0TIU/bpfn8THXg5pcUY48PLAyuGmanIdVla4Fx8MX9ybjUmv79NiWZS6/Ej7FQr5zEJXNNJUyhl0xs4zGINftDHEaSuDYW4w9FdCE6oyWp7qTrRtlx5Z6JZalrqVhSesk0LSylgfpEpk0/crjATctqMOewkpYOZ46UG6DDPGCS7LMOpxeVwP61zhFNBKvleo+LNBEWDRG9nhBSWn1xhbOz2IF2+GQjcvBtGWLcmYPzhvSJYpiuNH3z06Lkn9HzlbTQNlMM7dO3l6jV7ePIqxPyeKcqFUKshizJJr09O1qL2gKUv8xh4InBr2izt/BtoVyf5NZrOAgysOGpWxqUl1UxMUrOBXfGQ5Cx5SxEkg332obgS4BmBlsdfE5Se9Et6w97hlGFvdA+9LRhpY3qYzRk6i6d7PNaqxaAxkhUIoEdm9AGp8ZyusGpqtAYDtpoq32TbVempHd+EIHU+bM5nujraZKIfCJfNDM2MlhZNm6Wk1Htequ4+y7RIVRqKwMHXAKmnxnBB2Rw8pWkIOKdaeZCRKgh6xwZaQs8erClvVJue7LERJfMiF5VCrns9vydDDrdZh6qaL7vTUsM3SQOhYIiKZe7wTCEDYia2PpsIRzbzvKLNE2JCfdJLB/+dtEZsnVmqS3avYIVPRzMCwmYHsypBPYC7o0oTH/tIARpeGrED+A5fLJqoAeJxjYGRgYADiDSn35sXz23xl4GZhAIGbxfNEEfT/TywMzNxALgcDE0gUADiNCkwAeJxjYGRgYG7438AQw8IAAkCSkQEVcAMARxECdHicY2FgYGAhEgMABEwALQAAAAAAAEQAcADEASgBfgHsAlwC1gMUA0x4nGNgZGBg4GYIZmBlAAEmIOYCQgaG/2A+AwASAQF6AHicZY9NTsMwEIVf+gekEqqoYIfkBWIBKP0Rq25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/wKt9Dx6sI+5l5XuI1HL/bHVi+cXqnlQcWhySKTOb+CmV7vkoWt0uqca1vEJlODoF9JU51pW91T7NdD5yIVWZOqCas6SYzKrdnq0AUb5/JRrxeJHoQm5Vhj/rbGAo5xBYUlDowxQhhkiMro6DtVZvSvsUPCXntWPc3ndFsU1P9zhQEC9M9cU7qy0nk6T4E9XxtSdXQrbsuelDSRXs1JErJCXta2VELqATZlV44RelzRiT8oZ0j/AAlabsgAAAB4nG2IQRbCIBDF5ldpFbrwIp7JhzJFdOjwKN7fWl2aVRLq6Iul/zh02GEPgx4DDjjCwmGkQdSHNMd+UglcTco+svWt+ds989zGzMuyrvOURE4+hLr2VfV5+QzDWR/Jxqqvsg1XWIvwz6vm0jYnegMvzicdAA==) format("woff")}[class*=" lemon-icon-"],[class^=lemon-icon-]{font-family:lemon-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block}.lemon-icon-loading:before{content:"\E633"}.lemon-icon-prompt:before{content:"\E71B"}.lemon-icon-message:before{content:"\E84A"}.lemon-icon-emoji:before{content:"\E6F6"}.lemon-icon-attah:before{content:"\E7E1"}.lemon-icon-image:before{content:"\E7DE"}.lemon-icon-folder:before{content:"\E7D1"}.lemon-icon-people:before{content:"\E715"}.lemon-icon-group:before{content:"\E6FF"}.lemon-icon-addressbook:before{content:"\E6E2"}
\ No newline at end of file
diff --git a/examples/dist/css/index.fed1a091.css b/examples/dist/css/index.fed1a091.css
deleted file mode 100644
index 6f6fa0f..0000000
--- a/examples/dist/css/index.fed1a091.css
+++ /dev/null
@@ -1 +0,0 @@
-.lemon-message.lemon-message-voice{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message.lemon-message-voice .lemon-message__content{border:2px solid #000;font-size:12px;cursor:pointer}.lemon-message.lemon-message-voice .lemon-message__content:before{display:none}::-moz-selection{background:#000;color:#fff}::selection{background:#000;color:#fff}body{font-family:Microsoft YaHei;background:#f6f6f6!important}#app{width:90%;margin:0 auto;padding-bottom:100px}#app .scroll-top{cursor:pointer;position:fixed;bottom:40px;left:50%;border-radius:50%;background:#fff;font-size:18px;overflow:hidden;width:40px;height:40px;line-height:40px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;-webkit-transform:rotate(-45deg) translateX(-50%);transform:rotate(-45deg) translateX(-50%);-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}#app .scroll-top:hover{font-size:22px}a{color:#0c5ed9;text-decoration:none;font-size:12px}.action{margin-top:20px}.action .lemon-button{margin-right:10px;margin-bottom:10px}.link{font-size:14px;margin-top:15px}.link a{margin:0 5px;text-decoration:none;background:#ffba00;border-radius:4px;padding:5px 10px;color:rgba(0,0,0,.8)}.link a,.logo{display:inline-block}.logo{position:relative;margin:60px auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.logo-text{font-size:38px}.logo-sub{font-size:18px;color:#999;font-weight:300}.logo-badge{position:absolute;top:-10px;left:230px;background:#000;border-radius:16px;color:#f9f9f9;font-size:12px;padding:4px 8px}.title{font-size:24px;line-height:26px;border-left:1px solid #ffba00;padding-left:15px;margin-bottom:15px;margin-top:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.table{width:100%;border-radius:10px;background:#fff;border-collapse:collapse}.table tr{cursor:pointer}.table tr:not(.table-head):hover{background:#ffba00!important}.table tr:nth-of-type(2n){background:#f9f9f9}.table th{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#999}.table td,.table th{text-align:left;padding:10px 15px;font-size:14px;font-weight:400}.imui-center{margin-bottom:60px}.imui-center .lemon-wrapper,.imui-center .lemon-wrapper--drawer-show .lemon-drawer{-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}.drawer-content{padding:15px}.more{font-size:12px;line-height:24px;height:24px;position:absolute;top:14px;right:14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#f1f1f1;display:inline-block;border-radius:4px;background:#111;padding:0 8px}.more:active{background:#999}.bar{line-height:30px;background:#fff;margin:15px;color:#666;font-size:12px}.bar,.cover{text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cover{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cover i{font-size:84px;color:#e6e6e6}.cover p{font-size:18px;color:#ddd;line-height:50px}.article-item{line-height:34px;cursor:pointer}.article-item:hover{text-decoration:underline;color:#318efd}pre{background:#fff;border-radius:8px;padding:15px}.lemon-simple .lemon-container{z-index:5}.lemon-simple .lemon-drawer{z-index:4}input#switch[type=checkbox]{height:0;width:0;display:none}label#switch-label{cursor:pointer;text-indent:-9999px;width:34px;height:20px;background:#aaa;display:block;border-radius:100px;position:relative}label#switch-label:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:20px;-webkit-transition:.3s;transition:.3s}input#switch:checked+label{background:#0fd547}input#switch:checked+label:after{left:calc(100% - 2px);-webkit-transform:translateX(-100%);transform:translateX(-100%)}label#switch-label:active:after{width:20px}.lemon-tabs{background:#f6f6f6}.lemon-tabs-content{padding:15px}.lemon-tabs-content,.lemon-tabs-content__pane{width:100%;height:100%}.lemon-tabs-nav{display:-webkit-box;display:-ms-flexbox;display:flex;background:#eee}.lemon-tabs-nav__item{line-height:38px;padding:0 15px;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.lemon-tabs-nav__item--active{background:#f6f6f6}.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:1}.lemon-popover__arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg);position:absolute;z-index:0;bottom:-4px;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);width:8px;height:8px;background:#fff}.lemon-slide-top-enter-active,.lemon-slide-top-leave-active{-webkit-transition:all .2s cubic-bezier(.645,.045,.355,1);transition:all .2s cubic-bezier(.645,.045,.355,1)}.lemon-slide-top-enter,.lemon-slide-top-leave-to{-webkit-transform:translateY(-10px) scale(.8);transform:translateY(-10px) scale(.8);opacity:0}.lemon-button{outline:none;line-height:1.499;display:inline-block;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid #ddd;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;padding:0 15px;font-size:14px;border-radius:4px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);color:rgba(0,0,0,.65);background-color:#fff;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);text-shadow:0 -1px 0 rgba(0,0,0,.12)}.lemon-button:hover:not([disabled]){border-color:#666;color:#333}.lemon-button:active{background-color:#ddd}.lemon-button[disabled]{cursor:not-allowed;color:#aaa;background:#eee}.lemon-badge{position:relative;display:inline-block}.lemon-badge__label{border-radius:10px;background:#f5222d;color:#fff;text-align:center;font-size:12px;font-weight:400;white-space:nowrap;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff;z-index:10;position:absolute;-webkit-transform:translateX(50%);transform:translateX(50%);-webkit-transform-origin:100%;transform-origin:100%;display:inline-block;padding:0 4px;height:18px;line-height:17px;min-width:10px;top:-4px;right:6px}.lemon-badge__label--dot{width:10px;height:10px;min-width:auto;padding:0;top:-3px;right:2px}.lemon-avatar{font-variant:tabular-nums;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;display:inline-block;text-align:center;background:#ccc;color:hsla(0,0%,100%,.7);white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;border-radius:4px}.lemon-avatar img{width:100%;height:100%;display:block}.lemon-contact{padding:10px 14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#efefef;text-align:left}.lemon-contact p{margin:0}.lemon-contact--active{background:#bebdbd}.lemon-contact:hover:not(.lemon-contact--active){background:#e3e3e3}.lemon-contact:hover:not(.lemon-contact--active) .el-badge__content{border-color:#ddd}.lemon-contact__avatar{float:left;margin-right:10px}.lemon-contact__avatar img{display:block}.lemon-contact__avatar .ant-badge-count{display:inline-block;padding:0 4px;height:18px;line-height:18px;min-width:18px;top:-4px;right:7px}.lemon-contact__label{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-contact__time{font-size:12px;line-height:18px;padding-left:6px;color:#999;white-space:nowrap}.lemon-contact__name{display:block;width:100%}.lemon-contact__content,.lemon-contact__name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.lemon-contact__content{font-size:12px;color:#999;padding-top:3px;height:14px;line-height:14px}.lemon-contact__content img{height:14px;display:inline-block;vertical-align:top;margin:0 1px}.lemon-contact--name-center .lemon-contact__label{padding-bottom:0;line-height:38px}.lemon-editor{height:200px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.lemon-editor,.lemon-editor__tool{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-editor__tool{height:40px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:0 5px}.lemon-editor__tool-left,.lemon-editor__tool-right{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-editor__tool-item{cursor:pointer;padding:4px 10px;height:28px;line-height:24px;color:#999;-webkit-transition:all .3s ease;transition:all .3s ease;font-size:12px}.lemon-editor__tool-item [class^=lemon-icon-]{line-height:26px;font-size:22px}.lemon-editor__tool-item:hover{color:#333}.lemon-editor__tool-item--right{margin-left:auto}.lemon-editor__inner{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-x:hidden;overflow-y:auto}.lemon-editor__inner::-webkit-scrollbar{width:5px;height:5px}.lemon-editor__inner::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-editor__inner::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-editor__inner::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-editor__input{height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;outline:none;padding:0 10px}.lemon-editor__input::-webkit-scrollbar{width:5px;height:5px}.lemon-editor__input::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-editor__input::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-editor__input::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-editor__input div,.lemon-editor__input p{margin:0}.lemon-editor__input img{height:20px;padding:0 2px;pointer-events:none;vertical-align:middle}.lemon-editor__footer{display:-webkit-box;display:-ms-flexbox;display:flex;height:52px;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:0 10px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.lemon-editor__tip{margin-right:10px;font-size:12px;color:#999}.lemon-editor__emoji,.lemon-editor__tip{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-editor__emoji .lemon-popover{background:#f6f6f6}.lemon-editor__emoji .lemon-popover__content{padding:0}.lemon-editor__emoji .lemon-popover__arrow{background:#f6f6f6}.lemon-editor__emoji .lemon-tabs-content{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px;height:200px;overflow-x:hidden;overflow-y:auto;margin-bottom:8px}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar{width:5px;height:5px}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-editor__emoji .lemon-tabs-content::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-editor__emoji-item{cursor:pointer;width:22px;padding:4px;border-radius:4px}.lemon-editor__emoji-item:hover{background:#e9e9e9}.lemon-messages{height:400px;overflow-x:hidden;overflow-y:auto;padding:10px 15px}.lemon-messages::-webkit-scrollbar{width:5px;height:5px}.lemon-messages::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-messages::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-messages::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-messages__load,.lemon-messages__time{text-align:center;font-size:12px}.lemon-messages__load{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#999;line-height:30px}.lemon-messages__load--ing{font-size:22px}.lemon-message{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px 0}.lemon-message__time{color:#b9b9b9;padding:0 5px}.lemon-message__inner{position:relative}.lemon-message__avatar{padding-right:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message__avatar .lemon-avatar{cursor:pointer}.lemon-message__title{font-size:12px;line-height:14px;padding-bottom:6px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#666}.lemon-message__content-flex,.lemon-message__title{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-message__content{font-size:14px;line-height:20px;padding:8px 10px;background:#fff;border-radius:4px;position:relative;margin:0}.lemon-message__content img,.lemon-message__content video{background:#e9e9e9;height:100px}.lemon-message__content:before{content:" ";position:absolute;top:6px;width:0;height:0;border:4px solid transparent;left:-4px;border-left:none;border-right-color:#fff}.lemon-message__content-after{display:block;width:48px;height:36px;padding-left:6px;-webkit-box-flex:0;-ms-flex:none;flex:none;font-size:12px;color:#aaa;overflow:hidden;visibility:hidden}.lemon-message__status{position:absolute;top:23px;right:20px;color:#aaa;font-size:20px}.lemon-message__status .lemon-icon-loading,.lemon-message__status .lemon-icon-prompt{display:none}.lemon-message--status-failed .lemon-icon-prompt,.lemon-message--status-going .lemon-icon-loading{display:inline-block}.lemon-message--status-succeed .lemon-message__content-after{visibility:visible}.lemon-message--reverse,.lemon-message--reverse .lemon-message__content-flex{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.lemon-message--reverse .lemon-message__content-after{padding-right:6px;padding-left:0;text-align:right}.lemon-message--reverse .lemon-message__title{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.lemon-message--reverse .lemon-message__status{left:26px;right:auto}.lemon-message--reverse .lemon-message__content{background:#35d863}.lemon-message--reverse .lemon-message__content:before{content:" ";position:absolute;top:6px;width:0;height:0;border:4px solid transparent;left:auto;right:-4px;border-right:none;border-left-color:#35d863}.lemon-message--reverse .lemon-message__title{text-align:right}.lemon-message--reverse .lemon-message__avatar{padding-right:0;padding-left:10px}.lemon-message--hide-name .lemon-message__status{top:3px}.lemon-message--hide-name .lemon-message__title{display:none}.lemon-message--hide-name .lemon-message__content:before{top:14px}.lemon-message-text .lemon-message__content img{width:18px;height:18px;display:inline-block;background:transparent;padding:0 2px;vertical-align:middle}.lemon-message-image .lemon-message__content{padding:0;cursor:pointer;overflow:hidden}.lemon-message-image .lemon-message__content img{max-width:100%;min-width:100px;display:block}.lemon-message-file .lemon-message__content{display:-webkit-box;display:-ms-flexbox;display:flex;cursor:pointer;width:200px;background:#fff;padding:12px 18px;overflow:hidden}.lemon-message-file .lemon-message__content p{margin:0}.lemon-message-file__tip{display:none}.lemon-message-file__inner{-webkit-box-flex:1;-ms-flex:1;flex:1}.lemon-message-file__name{font-size:14px}.lemon-message-file__byte{font-size:12px;color:#aaa}.lemon-message-file__sfx{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-weight:700;font-size:34px;color:#ccc}.lemon-message-event__content,.lemon-message-file__sfx{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message-event__content{display:inline-block;background:#e9e9e9;color:#aaa;font-size:12px;margin:0 auto;padding:5px 10px;border-radius:4px}.lemon-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;font-family:Microsoft YaHei;background:#efefef;-webkit-transition:all .4s cubic-bezier(.645,.045,.355,1);transition:all .4s cubic-bezier(.645,.045,.355,1);position:relative}.lemon-wrapper p{margin:0}.lemon-wrapper img{vertical-align:middle;border-style:none}.lemon-menu{-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:60px;background:#1d232a;padding:15px 0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-menu,.lemon-menu__bottom{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.lemon-menu__bottom{position:absolute;bottom:0}.lemon-menu__avatar{margin-bottom:20px;cursor:pointer}.lemon-menu__item{color:#999;cursor:pointer;padding:14px 10px;max-width:100%;word-break:break-all;word-wrap:break-word;white-space:pre-wrap}.lemon-menu__item--active{color:#0fd547}.lemon-menu__item:hover:not(.lemon-menu__item--active){color:#eee}.lemon-menu__item>*{font-size:24px}.lemon-menu__item .ant-badge-count{display:inline-block;padding:0 4px;height:18px;line-height:16px;min-width:18px}.lemon-menu__item .ant-badge-count,.lemon-menu__item .ant-badge-dot{-webkit-box-shadow:0 0 0 1px #1d232a;box-shadow:0 0 0 1px #1d232a}.lemon-sidebar{width:250px;background:#efefef;overflow-y:auto}.lemon-sidebar::-webkit-scrollbar{width:5px;height:5px}.lemon-sidebar::-webkit-scrollbar-track-piece{background-color:transparent}.lemon-sidebar::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#aaa}.lemon-sidebar::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:transparent}.lemon-sidebar__label{padding:6px 14px 6px 14px;color:#666;font-size:12px;margin:0;text-align:left}.lemon-sidebar .lemon-contact--active{background:#d9d9d9}.lemon-container{-webkit-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background:#f4f4f4;word-break:break-all;word-wrap:break-word;white-space:pre-wrap;position:relative;z-index:10}.lemon-container__title{padding:15px 15px}.lemon-container__displayname{font-size:16px}.lemon-messages{-webkit-box-flex:1;-ms-flex:1;flex:1;height:auto}.lemon-drawer{position:absolute;top:0;right:0;overflow:hidden;background:#f4f4f4;-webkit-transition:width .4s cubic-bezier(.645,.045,.355,1);transition:width .4s cubic-bezier(.645,.045,.355,1);z-index:9;width:200px;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.lemon-wrapper--drawer-show .lemon-drawer{right:-200px}.lemon-contact-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%}.lemon-contact-info h4{font-size:16px;font-weight:400;margin:10px 0 20px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-wrapper--theme-blue .lemon-message__content{background:#f3f3f3}.lemon-wrapper--theme-blue .lemon-message__content:before{border-right-color:#f3f3f3}.lemon-wrapper--theme-blue .lemon-message--reverse .lemon-message__content{background:#e6eeff}.lemon-wrapper--theme-blue .lemon-message--reverse .lemon-message__content:before{border-left-color:#e6eeff}.lemon-wrapper--theme-blue .lemon-container{background:#fff}.lemon-wrapper--theme-blue .lemon-sidebar,.lemon-wrapper--theme-blue .lemon-sidebar .lemon-contact{background:#f9f9f9}.lemon-wrapper--theme-blue .lemon-sidebar .lemon-contact:hover:not(.lemon-contact--active){background:#f1f1f1}.lemon-wrapper--theme-blue .lemon-sidebar .lemon-contact--active{background:#e9e9e9}.lemon-wrapper--theme-blue .lemon-menu{background:#096bff}.lemon-wrapper--theme-blue .lemon-menu__item{color:hsla(0,0%,100%,.4)}.lemon-wrapper--theme-blue .lemon-menu__item:hover:not(.lemon-menu__item--active){color:hsla(0,0%,100%,.6)}.lemon-wrapper--theme-blue .lemon-menu__item--active{color:#fff;text-shadow:0 0 10px rgba(2,48,118,.4)}.lemon-wrapper--simple .lemon-menu,.lemon-wrapper--simple .lemon-sidebar{display:none}.lemon-dropdown{font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.06);box-shadow:0 2px 8px rgba(0,0,0,.06);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden}.lemon-dropdown__item{font-size:12px;line-height:14px;padding:8px 10px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#444}.lemon-dropdown__item>span{display:inline-block;-webkit-box-flex:0;-ms-flex:none;flex:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.lemon-dropdown__item:hover{background:#f3f3f3;color:#000}.lemon-dropdown__item:active{background:#e9e9e9}.lemon-dropdown__icon{font-size:16px;margin-right:4px}.lemonani-spin{display:inline-block;-webkit-animation:lemonani-spin 1s infinite;animation:lemonani-spin 1s infinite}@-webkit-keyframes lemonani-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes lemonani-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@font-face{font-family:lemon-icons;src:url(data:font/woff;base64,d09GRgABAAAAAAkoAAsAAAAADfwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8qUo8Y21hcAAAAYAAAAClAAACNh3rDoZnbHlmAAACKAAABK8AAAaY5qHpBGhlYWQAAAbYAAAALwAAADYWBoAkaGhlYQAABwgAAAAcAAAAJAfeA4xobXR4AAAHJAAAAA8AAAAsLAAAAGxvY2EAAAc0AAAAGAAAABgH9gmmbWF4cAAAB0wAAAAfAAAAIAEaAF9uYW1lAAAHbAAAAUUAAAJtPlT+fXBvc3QAAAi0AAAAcwAAAKJTcQpreJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeGb/wYm7438AQw9zA0AAUZgTJAQDm+gxieJzlkrERwjAMRb+JYyBHQROarEDHFpmJARiFil2yQO6SQsoEac2XRUeYgO97vtMvJN+3ANQAKnIlEQgvBJiedEPxKzTFj7izvuBMJ8lNZlkla6udDjrqtPQ5A7/8DQX2+j7mJ+xxwJFzd5wV7Y0hbfb4L53K/fhUjaXt2E/J7DA9yOowR0h2mCi0dZgttHOsjw4O84aOjm2FTo5txtI7qN/ZbEV0AAAAeJxlVN+PE1UUvufezsy2nU47s9PpzLCdbaftFLbQQNudsu5uu/iDZrtGVkSpimQNhqSGNagxRvHHmoASjULwhTXRYDDRR142MTFEeSPwQGJissTE8DcYQzRui+dOWSjStOfeO/e70/Pd7zuHACF3brNPWZSUCQFPUiANesqBaag4oCvglmGyVixDCdzBnkMrDVorU0pkmQkjgsxCL6x2Oqtr5zuRUJSxWFgQmt1zF851mziwCMhMpqHYiCAEmM75F2ORkBDGc2xxgOFQQgl+2Fl6lYwSCzPJFj38SzGp6kY1W/En1ZrHsmo1lWXH+6tvMdZXNE2htzD6veOX34ZD9LnjVFN6l/hz+COm9UuUvEGIELz3O3qNxIlBsmSCVPnb///myXpqC0wWvTjwn5oVGlDzXFE36hVDF12v5rOPN/6KqWqMyRgrveZHn/++/qso/vaJKLxHr/RuFCqVdqVSkBMJM5Gg19RY7wcOp52Y2rtU+Op7CN0hL/0jCL0LovglfHYDOLxdeZPDzQThOvTYfsZIg+vgSiDq42DUoYFCUF3ENWZRB7+6CzOKD3ab4Nc83FICWXwORjLR9pV2/1/G8pIIgtV4orHLts3+9cwzs2kYiSpxPbJOaUES153mgUz/b8u2q83HmjZM5vJ5+lOr1d9gI7QgCCCYtr0Lz1v9687ssw6MRPR0ZJ1JDDfXxw82wMHTzb3NimXhabfzcoeQ0F0/RYhDimQnmUI2ZVoCEd0jiUndSCUdSFUDgzWg7tcEfrn8kqsPTdirzvKZRbo4v/eY4xg6GNqpbZ0y3Xdm2cn0rmqmmTPNb3DIm+bXarCiVmt5Fsad5VZ7sfz8tlNqCnRj5lhr/tt3OOrBb5DrBrtAb5EoSZEcaWOuOS465oYXWxyeV3nkjtSN0TIU/bpfn8THXg5pcUY48PLAyuGmanIdVla4Fx8MX9ybjUmv79NiWZS6/Ej7FQr5zEJXNNJUyhl0xs4zGINftDHEaSuDYW4w9FdCE6oyWp7qTrRtlx5Z6JZalrqVhSesk0LSylgfpEpk0/crjATctqMOewkpYOZ46UG6DDPGCS7LMOpxeVwP61zhFNBKvleo+LNBEWDRG9nhBSWn1xhbOz2IF2+GQjcvBtGWLcmYPzhvSJYpiuNH3z06Lkn9HzlbTQNlMM7dO3l6jV7ePIqxPyeKcqFUKshizJJr09O1qL2gKUv8xh4InBr2izt/BtoVyf5NZrOAgysOGpWxqUl1UxMUrOBXfGQ5Cx5SxEkg332obgS4BmBlsdfE5Se9Et6w97hlGFvdA+9LRhpY3qYzRk6i6d7PNaqxaAxkhUIoEdm9AGp8ZyusGpqtAYDtpoq32TbVempHd+EIHU+bM5nujraZKIfCJfNDM2MlhZNm6Wk1Htequ4+y7RIVRqKwMHXAKmnxnBB2Rw8pWkIOKdaeZCRKgh6xwZaQs8erClvVJue7LERJfMiF5VCrns9vydDDrdZh6qaL7vTUsM3SQOhYIiKZe7wTCEDYia2PpsIRzbzvKLNE2JCfdJLB/+dtEZsnVmqS3avYIVPRzMCwmYHsypBPYC7o0oTH/tIARpeGrED+A5fLJqoAeJxjYGRgYADiDSn35sXz23xl4GZhAIGbxfNEEfT/TywMzNxALgcDE0gUADiNCkwAeJxjYGRgYG7438AQw8IAAkCSkQEVcAMARxECdHicY2FgYGAhEgMABEwALQAAAAAAAEQAcADEASgBfgHsAlwC1gMUA0x4nGNgZGBg4GYIZmBlAAEmIOYCQgaG/2A+AwASAQF6AHicZY9NTsMwEIVf+gekEqqoYIfkBWIBKP0Rq25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/wKt9Dx6sI+5l5XuI1HL/bHVi+cXqnlQcWhySKTOb+CmV7vkoWt0uqca1vEJlODoF9JU51pW91T7NdD5yIVWZOqCas6SYzKrdnq0AUb5/JRrxeJHoQm5Vhj/rbGAo5xBYUlDowxQhhkiMro6DtVZvSvsUPCXntWPc3ndFsU1P9zhQEC9M9cU7qy0nk6T4E9XxtSdXQrbsuelDSRXs1JErJCXta2VELqATZlV44RelzRiT8oZ0j/AAlabsgAAAB4nG2IQRbCIBDF5ldpFbrwIp7JhzJFdOjwKN7fWl2aVRLq6Iul/zh02GEPgx4DDjjCwmGkQdSHNMd+UglcTco+svWt+ds989zGzMuyrvOURE4+hLr2VfV5+QzDWR/Jxqqvsg1XWIvwz6vm0jYnegMvzicdAA==) format("woff")}[class*=" lemon-icon-"],[class^=lemon-icon-]{font-family:lemon-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block}.lemon-icon-loading:before{content:"\E633"}.lemon-icon-prompt:before{content:"\E71B"}.lemon-icon-message:before{content:"\E84A"}.lemon-icon-emoji:before{content:"\E6F6"}.lemon-icon-attah:before{content:"\E7E1"}.lemon-icon-image:before{content:"\E7DE"}.lemon-icon-folder:before{content:"\E7D1"}.lemon-icon-people:before{content:"\E715"}.lemon-icon-group:before{content:"\E6FF"}.lemon-icon-addressbook:before{content:"\E6E2"}
\ No newline at end of file
diff --git a/examples/dist/index.html b/examples/dist/index.html
index 52ccf11..dfcc526 100644
--- a/examples/dist/index.html
+++ b/examples/dist/index.html
@@ -1 +1 @@
-Lemon IMUI
\ No newline at end of file
+Lemon IMUI
\ No newline at end of file
diff --git a/examples/dist/js/index.4318ecd4.js b/examples/dist/js/index.4318ecd4.js
deleted file mode 100644
index 85c7e7b..0000000
--- a/examples/dist/js/index.4318ecd4.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(t){function e(e){for(var i,r,o=e[0],c=e[1],d=e[2],u=0,m=[];u {\n return [语音]\n})\n")]),n("p",[t._v("最后一步,注册组件,必须使用全局注册的方式。")]),n("pre",[t._v("import Vue from 'vue';\nimport LemonMessageVoice from './lemon-message-voice';\nVue.component(LemonMessageVoice.name,LemonMessageVoice);\n")]),n("p",[t._v("如果还有不明白的,可以到 examples/App.vue 查看示例代码")])]),n("div",{staticClass:"title",attrs:{id:"help2"}},[t._v("如何对接后端接口?")]),n("p",[t._v("1.初始化用户的信息")]),n("pre",{domProps:{textContent:t._s("data(){\n return {\n user:{id:1:displayName:'June',avatar:''}\n }\n}")}}),n("pre",{domProps:{textContent:t._s("")}}),n("p",[t._v("2.初始化联系人数据")]),n("pre",{domProps:{textContent:t._s("mounted(){\n const { IMUI } = this.$refs;\n //初始化表情包。\n IMUI.initEmoji(...);\n //从后端请求联系人数据,包装成下面的样子\n const contacts = [{\n id: 2,\n displayName: '丽安娜',\n avatar:'',\n index: 'L',\n unread: 0,\n //最近一条消息的内容,如果值为空,不会出现在“聊天”列表里面。\n //lastContentRender 函数会将 file 消息转换为 '[文件]', image 消息转换为 '[图片]',对 text 会将文字里的表情标识替换为img标签,\n lastContent: IMUI.lastContentRender({type:'text',content:'你在干嘛呢?'})\n //最近一条消息的发送时间\n lastSendTime: 1566047865417,\n }];\n IMUI.initContacts(contacts);\n}")}}),n("p",[t._v("3.拉取消息列表")]),n("p",[t._v("现在刷新页面应该能够看到联系人了,但是点击联系人的话右边会一直处于加载中,这时需要监听 pull-messages 事件。")]),n("pre",{domProps:{textContent:t._s("")}}),n("pre",{domProps:{textContent:t._s("methods:{\n handlePullMessages(contact, next) {\n //从后端请求消息数据,包装成下面的样子\n const messages = [{\n id: '唯一消息ID',\n status: 'succeed',\n type: 'text',\n sendTime: 1566047865417,\n content: '你什么才能对接完?',\n toContactId: contact.id,\n fromUser:this.user\n }]\n //将第二个参数设为true,表示已到末尾,聊天窗口顶部会显示“暂无更多消息”,不然会一直转圈。\n next(messages,true);\n },\n}")}}),n("p",[t._v("4.发送消息")]),n("p",[t._v("现在在消息框发送新消息会一直转圈,这时需要监听 send 事件。")]),n("pre",{domProps:{textContent:t._s("methods:{\n handleSend(message, next, file) {\n ... 调用你的消息发送业务接口\n\n //执行到next消息会停止转圈,如果接口调用失败,可以修改消息的状态 next({status:'failed'});\n next();\n },\n}")}}),n("p",[t._v("5.接收消息")]),n("pre",{domProps:{textContent:t._s("mounted(){\n\nWebSocket.onmessage = function(event) {\n //将接收到的数据包装成下面的样子\n const data = {\n id: '唯一消息ID',\n status: 'succeed',\n type: 'text',\n sendTime: 1566047865417,\n content: '马上就对接完了!',\n toContactId: 2,\n fromUser:{\n //如果 id == this.user.id消息会显示在右侧,否则在左侧\n id:2,\n displayName:'丽安娜',\n avatar:'',\n }\n };\n IMUI.appendMessage(data);\n};\n \n}")}})])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"link"},[n("span",[t._v("源码下载 ")]),n("a",{attrs:{target:"_blank",href:"https://github.com/fanjyy/lemon-imui"}},[t._v("Github")]),n("a",{attrs:{target:"_blank",href:"https://gitee.com/june000/lemon-im"}},[t._v("Gitee")]),n("a",{attrs:{target:"_blank",href:"https://qm.qq.com/cgi-bin/qm/qr?k=xzUa9CPYQ5KCNQ86h7ep4Z3TtkqJxRZE&jump_from=webapi"}},[t._v("QQ交流群:1081773406")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("a",{staticStyle:{"font-size":"14px"},attrs:{href:"#help1"}},[t._v("1.如何创建自定义消息?")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("a",{staticStyle:{"font-size":"14px"},attrs:{href:"#help2"}},[t._v("2.如何对接后端接口?")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("id")]),n("td",{attrs:{width:"350"}},[t._v("唯一ID")]),n("td",{attrs:{width:"150"}},[t._v("String/Number")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("displayName")]),n("td",[t._v("名称")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr"),n("tr",[n("td",[t._v("avatar")]),n("td",[t._v("头像")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("index")]),n("td",[t._v("通讯录索引,传入字母或数字进行排序,索引可以显示自定义文字“[1]群组”")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("unread")]),n("td",[t._v("未读消息数")]),n("td",[t._v("Number")]),n("td",[t._v("0")]),n("td")]),n("tr",[n("td",[t._v("lastSendTime")]),n("td",[t._v("最近一条消息的时间戳,13位毫秒")]),n("td",[t._v("timestamp")]),n("td",[t._v("0")]),n("td")]),n("tr",[n("td",[t._v("lastContent")]),n("td",[t._v("最近一条消息的内容")]),n("td",[t._v("String | Vnode")]),n("td"),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("id")]),n("td",{attrs:{width:"350"}},[t._v("唯一ID")]),n("td",{attrs:{width:"150"}},[t._v("String/Number")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("status")]),n("td",[t._v("消息发送的状态:going | failed | succeed")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr"),n("tr",[n("td",[t._v("type")]),n("td",[t._v("消息类型:file | image | text | event")]),n("td",[t._v("String | Vnode")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("sendTime")]),n("td",[t._v("消息发送时间,13位毫秒")]),n("td",[t._v("timestamp")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("content")]),n("td",[t._v("消息内容,如果type=file,此属性表示文件的URL地址")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("fileSize")]),n("td",[t._v("文件大小")]),n("td",[t._v("Number")]),n("td",[t._v("0")]),n("td")]),n("tr",[n("td",[t._v("fileName")]),n("td",[t._v("文件名称")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("toContactId")]),n("td",[t._v("接收消息的联系人ID")]),n("td",[t._v("String | Number")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("fromUser")]),n("td",[t._v("消息发送人的信息")]),n("td",[t._v("Object")]),n("td",[t._v("-")]),n("td",[t._v('{id: "1",displayName: "测试",avatar: "url"};')])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("名称")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("text")]),n("td",{attrs:{width:"350"}},[t._v("显示文字")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("color")]),n("td",{attrs:{width:"350"}},[t._v("颜色")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("icon")]),n("td",{attrs:{width:"350"}},[t._v("图标 class")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("click")]),n("td",{attrs:{width:"350"}},[t._v("点击事件,调用hide方法隐藏右键菜单。")]),n("td",{attrs:{width:"150"}},[t._v("Function(e,instance,hide)")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("visible")]),n("td",{attrs:{width:"350"}},[t._v("是否显示的判断函数")]),n("td",{attrs:{width:"150"}},[t._v("Function(instance)")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("render")]),n("td",{attrs:{width:"350"}},[t._v("负责样式的渲染函数,使用render的时候text属性会失去作用,调用hide方法隐藏右键菜单。")]),n("td",{attrs:{width:"150"}},[t._v("Function(e,instance,hide)")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("user")]),n("td",{attrs:{width:"350"}},[t._v("用户信息")]),n("td",{attrs:{width:"150"}},[t._v("Object")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td",[t._v('{id: "1",displayName: "测试",avatar: "url"};')])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("width")]),n("td",{attrs:{width:"350"}},[t._v("宽度")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("850px")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("height")]),n("td",{attrs:{width:"350"}},[t._v("高度")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("580px")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("theme")]),n("td",{attrs:{width:"350"}},[t._v("主题")]),n("td",{attrs:{width:"150"}},[t._v("default | blue")]),n("td",{attrs:{width:"100"}},[t._v("default")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sendText")]),n("td",{attrs:{width:"350"}},[t._v("发送消息按钮的文字")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("发送消息")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sendKey")]),n("td",{attrs:{width:"350"}},[t._v("快捷发送键检查函数")]),n("td",{attrs:{width:"150"}},[t._v("Function(event)=>Boolean")]),n("td",{attrs:{width:"100"}}),n("td",[t._v("(e)=>e.keyCode == 13 && e.ctrlKey")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("simple")]),n("td",{attrs:{width:"350"}},[t._v("精简模式")]),n("td",{attrs:{width:"150"}},[t._v("Boolean")]),n("td",{attrs:{width:"100"}},[t._v("false")]),n("td",[t._v("精简模式下左侧的导航和联系人列表会隐藏,初始化时需要手动调用 changeContact 切换到聊天视图。")])]),n("tr",[n("td",[t._v("messageTimeFormat")]),n("td",[t._v("消息列表时间格式化函数")]),n("td",[t._v("Function(time)=>String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("contactTimeFormat")]),n("td",[t._v("联系人时间格式化规则")]),n("td",[t._v("Function(time)=>String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("hideDrawer")]),n("td",[t._v("是否隐藏抽屉")]),n("td",[t._v("Boolean")]),n("td",[t._v("true")]),n("td")]),n("tr",[n("td",[t._v("hideMenuAvatar")]),n("td",[t._v("是否隐藏导航头像")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("hideMenu")]),n("td",[t._v("是否隐藏左侧导航")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("hideMessageName")]),n("td",[t._v("是否隐藏聊天窗口内的联系人名字")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("hideMessageTime")]),n("td",[t._v("是否隐藏聊天窗口内的消息发送时间")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("contextmenu")]),n("td",[t._v("聊天消息右键菜单配置")]),n("td",[t._v("[ContextmenuItem]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("contactContextmenu")]),n("td",[t._v("联系人右键菜单配置")]),n("td",[t._v("[ContextmenuItem]")]),n("td",[t._v("-")]),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("initMenus")]),n("td",{attrs:{width:"350"}},[t._v("初始化导航")]),n("td",{attrs:{width:"150"}},[t._v("Function([Object])")]),n("td",{attrs:{width:"100"}},[t._v('[ {\n name: "messages"\n },\n {\n name: "contacts"\n }]')]),n("td",[t._v(' {\n name: "custom2",\n title: "自定义按钮2",\n unread: 0,\n click: () => {\n alert("拦截导航点击事件");\n },\n render: menu => {\n return \'...\';\n },\n isBottom: true\n }')])]),n("tr",[n("td",[t._v("initContacts")]),n("td",[t._v("初始化联系人")]),n("td",[t._v("Function([Contact])")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("initEditorTools")]),n("td",[t._v("初始化工具栏")]),n("td",[t._v("Function([Object])")]),n("td",[t._v("[{name:'emoji'},{name:'uploadFile'},{name:'uploadImage'}]")]),n("td",[t._v("[{\n name:\"test2\",\n isRight:true,\n title:'上传 Excel',\n click:()=>{\n alert('点击')\n },\n render:()=>{\n return '...'\n }\n }]")])]),n("tr",[n("td",[t._v("initEmoji")]),n("td",[t._v("初始化表情数据")]),n("td",[t._v("Function([Object])")]),n("td",[t._v("-")]),n("td",[n("div",[t._v("\n 有分类:[{\n label: '默认表情',\n children: [\n {\n name: '1f62c',\n title: '微笑',\n src: 'https://twemoji.maxcdn.com/2/72x72/1f62c.png'\n }\n ]\n }]\n ")]),n("div",[t._v("\n 无分类:[{\n name: '1f62c',\n title: '微笑',\n src: 'https://twemoji.maxcdn.com/2/72x72/1f62c.png'\n }]\n ")])])]),n("tr",[n("td",[t._v("appendMessage")]),n("td",[t._v("新增一条消息, 如果当前焦点在该联系人的聊天窗口,设置 scrollToBottom=true 添加之后自动定位到消息窗口底部")]),n("td",[t._v("Function(Message,scrollToBottom=false)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("removeMessage")]),n("td",[t._v("删除聊天消息")]),n("td",[t._v("Function(Message.id)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("updateMessage")]),n("td",[t._v("修改消息,根据 Message.id 查找聊天消息并覆盖传入的值(toContactId会被忽略)")]),n("td",[t._v("Function(Message)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("appendContact")]),n("td",[t._v("添加联系人")]),n("td",[t._v("Function(Contact)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("removeContact")]),n("td",[t._v("删除联系人")]),n("td",[t._v("Function(Contact.id)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("updateContact")]),n("td",[t._v("修改联系人,根据 Contact.id 查找联系人并覆盖传入的值")]),n("td",[t._v("Function(Contact)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getMessages")]),n("td",[t._v("返回所有本地消息,传入 Contact.id 则只返回与该联系人的消息")]),n("td",[t._v("Function(Contact.id)=>[Message]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getCurrentContact")]),n("td",[t._v("返回当前聊天窗口的联系人信息")]),n("td",[t._v("Function()=>Contact")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getCurrentMessages")]),n("td",[t._v("返回当前聊天窗口的所有消息")]),n("td",[t._v("Function()=>[Message]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getContacts")]),n("td",[t._v("返回所有本地联系人")]),n("td",[t._v("Function()=>[Contact]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("openDrawer")]),n("td",[t._v("打开联系人右侧抽屉,vnode 为抽屉内容")]),n("td",[t._v("Function(vnode)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("changeDrawer")]),n("td",[t._v("切换右侧抽屉显示/隐藏,vnode 为抽屉内容")]),n("td",[t._v("Function(vnode)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("closeDrawer")]),n("td",[t._v("关闭抽屉")]),n("td",[t._v("Function()")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("changeMenu")]),n("td",[t._v("切换左侧导航")]),n("td",[t._v("Function(Menu.name)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("changeContact")]),n("td",[t._v("切换聊天窗口")]),n("td",[t._v("Function(Contact.id,instance)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("messageViewToBottom")]),n("td",[t._v("将当前聊天窗口滚动到底部")]),n("td",[t._v("Function()")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("setLastContentRender")]),n("td",[t._v("设置左侧联系人最新消息的渲染函数")]),n("td",[t._v("Function(Message.type, (Message)=>vnode)")]),n("td",[t._v("-")]),n("td",[t._v("\n setLastContentRender('image', message => {\n return "),n("span",[t._v("[最新图片]")]),t._v("\n })\n ")])]),n("tr",[n("td",[t._v("lastContentRender")]),n("td",[t._v("用来生成 Message.lastContent 需要的vnode结构。")]),n("td",[t._v("Function(Message)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("setEditorValue")]),n("td",[t._v("设置编辑框内容")]),n("td",[t._v("Function(string)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getEditorValue")]),n("td",[t._v("获取编辑框内容")]),n("td",[t._v("Function()=>string")]),n("td",[t._v("-")]),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("插槽名")]),n("th",[t._v("说明")]),n("th",[t._v("参数")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("cover")]),n("td",{attrs:{width:"350"}},[t._v("初始化时的封面")]),n("td",{attrs:{width:"150"}},[t._v("-")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("editor-footer")]),n("td",{attrs:{width:"350"}},[t._v("消息输入框底部")]),n("td",{attrs:{width:"150"}},[t._v("-")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("message-title")]),n("td",{attrs:{width:"350"}},[t._v("消息列表的标题")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("message-after")]),n("td",{attrs:{width:"350"}},[t._v("每条消息的尾部")]),n("td",{attrs:{width:"150"}},[t._v("Message")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-message")]),n("td",{attrs:{width:"350"}},[t._v("左侧最新消息列表插槽")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-contact")]),n("td",{attrs:{width:"350"}},[t._v("左侧联系人列表插槽")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-message-top")]),n("td",{attrs:{width:"350"}},[t._v("左侧最新消息列表的顶部")]),n("td",{attrs:{width:"150"}},[t._v("-")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-contact-top")]),n("td",{attrs:{width:"350"}},[t._v("左侧联系人列表的顶部")]),n("td",{attrs:{width:"150"}},[t._v("-")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("contact-info")]),n("td",{attrs:{width:"350"}},[t._v("左侧联系人详细页")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("事件名")]),n("th",[t._v("说明")]),n("th",[t._v("参数")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("change-menu")]),n("td",{attrs:{width:"350"}},[t._v("当左侧导航选项卡切换的时候会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Menu.name")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("menu-avatar-click")]),n("td",{attrs:{width:"350"}},[t._v("当左侧导航内的头像被点击时回触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("change-contact")]),n("td",{attrs:{width:"350"}},[t._v("当左侧联系人点击时会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("pull-messages")]),n("td",{attrs:{width:"350"}},[t._v("当切换聊天对象或者聊天窗口滚动到顶部时会触发该事件,调用next方法结束loading状态,如果设置了isEnd=true,下次聊天窗口滚动到顶部将不会再触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Contact,next([Message],isEnd),instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("message-click")]),n("td",{attrs:{width:"350"}},[t._v("点击聊天窗口中的消息时会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("event,key,Message,instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("send")]),n("td",{attrs:{width:"350"}},[t._v("当发送新消息时会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Message,Function(Message):调用该函数完成消息发送,可以传入Message来改变消息内容,file:上传时的文件")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",[t._v("Lemon-IMUI 目前内置了file、image、text、event四种消息类型,在实际应用当中肯定是不够的哦,咋办?没事的,我们继续往下see。"),n("br"),t._v("要创建自定义消息首先要确定新消息的 Message 结构。")])}],r=(n("8e6e"),n("ac6a"),n("456d"),n("2638")),o=n.n(r),c=n("bd86");n("6b54"),n("7f7f");function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function l(t){for(var e=1;e {\n //返回HTML结构\n return {props.content} 🔈\n }\n }}\n />\n );\n }\n};\n',E=function(){return(new Date).getTime()},P=function(){return Math.random().toString(36).substr(-8)},D=function(){return Math.random().toString(36).substr(2)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return e||(e={id:"system",displayName:"系统测试",avatar:"http://upload.qqbodys.com/allimg/1710/1035512943-0.jpg"}),{id:P(),status:"succeed",type:"text",sendTime:E(),content:D(),toContactId:t,fromUser:e}},F={name:"app",data:function(){var t=this,e=this.$createElement;return{theme:"default",contactContextmenu:[{text:"删除该聊天",click:function(t,e,n){var i=e.IMUI,s=e.contact;i.updateContact({id:s.id,lastContent:null}),i.currentContactId==s.id&&i.changeContact(null),n()}},{text:"设置备注和标签"},{text:"投诉"},{icon:"lemon-icon-message",render:function(t,e,n){return t("div",{style:"display:flex;justify-content:space-between;align-items:center;width:130px"},[t("span",["加入黑名单"]),t("span",[t("input",{attrs:{type:"checkbox",id:"switch"}}),t("label",{attrs:{id:"switch-label",for:"switch"}},["Toggle"])])])}},{click:function(t,e,n){var i=e.IMUI,s=e.contact;i.removeContact(s.id),i.currentContactId==s.id&&i.changeContact(null),n()},color:"red",text:"删除好友"}],contextmenu:[{click:function(t,n,i){var s=n.IMUI,a=n.message,r={id:P(),type:"event",content:e("span",["你撤回了一条消息 ",e("span",{directives:[{name:"show",value:"text"==a.type}],style:"color:#333;cursor:pointer",attrs:{content:a.content},on:{click:function(t){s.setEditorValue(t.target.getAttribute("content"))}}},["重新编辑"])]),toContactId:a.toContactId,sendTime:E()};s.removeMessage(a.id),s.appendMessage(r,!0),i()},visible:function(e){return e.message.fromUser.id==t.user.id},text:"撤回消息"},{visible:function(e){return e.message.fromUser.id!=t.user.id},text:"举报"},{text:"转发"},{visible:function(t){return"text"==t.message.type},text:"复制文字"},{visible:function(t){return"image"==t.message.type},text:"下载图片"},{visible:function(t){return"file"==t.message.type},text:"下载文件"},{click:function(t,e,n){var i=e.IMUI,s=e.message;i.removeMessage(s.id),n()},icon:"lemon-icon-folder",color:"red",text:"删除"}],tip:$,packageData:_,hideMenuAvatar:!1,hideMenu:!1,hideMessageName:!1,hideMessageTime:!0,user:{id:"1",displayName:"June",avatar:""}}},mounted:function(){var t=this.$createElement,e={id:"contact-1",displayName:"工作协作群",avatar:"http://upload.qqbodys.com/img/weixin/20170804/ji5qxg1am5ztm.jpg",index:"[1]群组",unread:0,lastSendTime:1566047865417,lastContent:"2"},n={id:"contact-2",displayName:"自定义内容",avatar:"http://upload.qqbodys.com/img/weixin/20170807/jibfvfd00npin.jpg",click:function(t){t()},renderContainer:function(){return t("h1",{style:"text-indent:20px"},["自定义页面"])},lastSendTime:1345209465e3,lastContent:"12312",unread:2},i={id:"contact-3",displayName:"铁牛",avatar:"http://upload.qqbodys.com/img/weixin/20170803/jiq4nzrkrnd0e.jpg",index:"T",unread:32,lastSendTime:3,lastContent:"你好123"},s={id:"contact-4",displayName:"如花",avatar:"https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=4275424924,2201401076&fm=111&gp=0.jpg",index:"",unread:1,lastSendTime:3,lastContent:"吃饭了嘛"},a=this.$refs.IMUI;setTimeout(function(){console.log(a.hasContact("cont1act-3"))},2e3),a.setLastContentRender("event",function(t){return"[有人邀请你加入群组]"});var r=[x({},e),x({},n),x({},i)];a.initContacts(r),a.initMenus([{name:"messages"},{name:"contacts"},{name:"custom1",title:"自定义按钮1",unread:0,render:function(e){return t("i",{class:"lemon-icon-attah"})},renderContainer:function(){return t("div",{class:"article"},[t("ul",[t("li",{class:"article-item"},[t("h2",["人民日报谈网红带货:产品真的值得买吗?"])]),t("li",{class:"article-item"},["甘肃夏河县发生5.7级地震 暂未接到人员伤亡报告"]),t("li",{class:"article-item"},["北方多地风力仍强沙尘相伴,东北内蒙古等地迎雨雪"]),t("li",{class:"article-item"},["英货车案:越南警方采集疑死者家属DNA作比对"]),t("li",{class:"article-item"},["知名连锁咖啡店的蛋糕吃出活虫 曝光内幕太震惊"])]),t("lemon-contact",o()([{},{props:{contact:e}},{style:"margin:20px"}])),t("lemon-contact",o()([{},{props:{contact:i}},{style:"margin:20px"}]))])},isBottom:!0},{name:"custom2",title:"自定义按钮2",unread:0,click:function(){alert("拦截导航点击事件")},render:function(e){return t("i",{class:"lemon-icon-group"})},isBottom:!0}]),a.initEditorTools([{name:"emoji"},{name:"uploadFile"},{name:"uploadImage"},{name:"test1",click:function(){a.$refs.editor.selectFile("application/vnd.ms-excel")},render:function(){return t("span",["Excel"])}},{name:"test1",click:function(){a.initEditorTools([{name:"uploadFile"},{name:"emoji"}])},render:function(){return t("span",["重制工具栏"])}},{name:"test2",isRight:!0,title:"上传 Excel",click:function(){alert("点击了 ··· ")},render:function(){return t("b",["···"])}}]);var c=[{label:"表情",children:[{name:"1f600",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f600.png"},{name:"1f62c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f62c.png"},{name:"1f601",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f601.png"},{name:"1f602",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f602.png"},{name:"1f923",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f923.png"},{name:"1f973",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f973.png"},{name:"1f603",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f603.png"},{name:"1f604",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f604.png"},{name:"1f605",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f605.png"},{name:"1f606",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f606.png"},{name:"1f607",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f607.png"},{name:"1f609",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f609.png"},{name:"1f60a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60a.png"},{name:"1f642",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f642.png"},{name:"1f643",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f643.png"},{name:"1263a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/263a.png"},{name:"1f60b",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60b.png"},{name:"1f60c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60c.png"},{name:"1f60d",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60d.png"},{name:"1f970",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f970.png"},{name:"1f618",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f618.png"},{name:"1f617",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f617.png"},{name:"1f619",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f619.png"},{name:"1f61a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61a.png"},{name:"1f61c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61c.png"},{name:"1f92a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92a.png"},{name:"1f928",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f928.png"},{name:"1f9d0",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f9d0.png"},{name:"1f61d",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61d.png"},{name:"1f61b",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61b.png"},{name:"1f911",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f911.png"},{name:"1f913",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f913.png"},{name:"1f60e",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60e.png"},{name:"1f929",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f929.png"},{name:"1f921",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f921.png"},{name:"1f920",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f920.png"},{name:"1f917",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f917.png"},{name:"1f60f",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60f.png"},{name:"1f636",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f636.png"},{name:"1f610",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f610.png"},{name:"1f611",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f611.png"},{name:"1f612",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f612.png"},{name:"1f644",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f644.png"},{name:"1f914",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f914.png"},{name:"1f925",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f925.png"},{name:"1f92d",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92d.png"},{name:"1f92b",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92b.png"},{name:"1f92c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92c.png"},{name:"1f92f",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92f.png"},{name:"1f633",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f633.png"},{name:"1f61e",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61e.png"},{name:"1f61f",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61f.png"},{name:"1f620",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f620.png"},{name:"1f621",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f621.png"}]},{label:"收藏",children:[{name:"1f62c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f62c.png"},{name:"1f621",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f621.png"}]}];a.initEmoji(c),a.setLastContentRender("voice",function(e){return t("span",["[语音]"])});var d=this.$refs.SimpleIMUI;e.id="11",d.initContacts([e]),d.initEmoji(c),d.changeContact(e.id);var l=this.$refs.SlotIMUI;i.id="333",l.initContacts([s,i]),l.initEmoji(c)},methods:{changeTheme:function(){this.theme="default"==this.theme?"blue":"default"},scrollToTop:function(){document.body.scrollIntoView()},handleMenuAvatarClick:function(){console.log("Event:menu-avatar-click")},handleMessageClick:function(t,e,n,i){console.log("点击了消息",t,e,n),"status"==e&&(i.updateMessage({id:n.id,status:"going",content:"正在重新发送消息..."}),setTimeout(function(){i.updateMessage({id:n.id,status:"succeed",content:"发送成功"})},2e3))},changeMenuAvatarVisible:function(){this.hideMenuAvatar=!this.hideMenuAvatar},changeMenuVisible:function(){this.hideMenu=!this.hideMenu},changeMessageNameVisible:function(){this.hideMessageName=!this.hideMessageName},changeMessageTimeVisible:function(){this.hideMessageTime=!this.hideMessageTime},removeMessage:function(){var t=this.$refs.IMUI,e=t.getCurrentMessages(),n=e[e.length-1].id;e.length>0&&t.removeMessage(n)},updateMessage:function(){var t=this.$refs.IMUI,e=t.getCurrentMessages(),n=e[e.length-1];if(e.length>0){var i={id:n.id,status:"succeed",type:"file",fileName:"被修改成文件了.txt",fileSize:"4200000"};"event"==n.type&&(i.fromUser=this.user),t.updateMessage(i),t.messageViewToBottom()}},appendCustomMessage:function(){var t=this.$refs.IMUI,e={id:P(),status:"succeed",type:"voice",sendTime:E(),content:"语音消息",params1:"1",params2:"2",toContactId:"contact-1",fromUser:this.user};t.appendMessage(e,!0)},appendMessage:function(){var t=this.$refs.IMUI,e=(t.currentContact,U("contact-3"));e.fromUser=x({},e.fromUser,{},this.user),t.appendMessage(e,!0)},appendEventMessage:function(){var t=this.$createElement,e=this.$refs.IMUI,n={id:P(),type:"event",content:t("span",["邀请你加入群聊 ",t("span",{style:"color:#333;cursor:pointer",on:{click:function(){return alert("OK")}}},["接受"])]),toContactId:"contact-3",sendTime:E()};e.appendMessage(n,!0)},updateContact:function(){this.$refs.IMUI.updateContact({id:"contact-3",unread:10,displayName:D(),lastSendTime:E(),lastContent:"修改昵称为随机字母"})},changeDrawer:function(t,e){var n=this.$createElement;e.changeDrawer(function(){return n("div",{class:"drawer-content"},[n("p",[n("b",["自定义抽屉"])]),n("p",[t.displayName])])})},handleChangeContact:function(t,e){console.log("Event:change-contact"),e.updateContact({id:t.id,unread:0}),e.closeDrawer()},handleSend:function(t,e,n){console.log(t,e,n),setTimeout(function(){e()},1e3)},handlePullMessages:function(t,e,n){var i=this,s={id:t.id,displayName:t.displayName,avatar:t.avatar};setTimeout(function(){var t=[U(n.currentContactId,i.user),U(n.currentContactId,s),U(n.currentContactId,i.user),U(n.currentContactId,s),U(n.currentContactId,i.user),U(n.currentContactId,i.user),U(n.currentContactId,s),x({},U(n.currentContactId,i.user),{},{status:"failed"})],a=!1;n.getMessages(n.currentContactId).length+t.length>11&&(a=!0),e(t,a)},500)},handleChangeMenu:function(){console.log("Event:change-menu")},openCustomContainer:function(){}}},L=F,N=(n("9c9b"),Object(v["a"])(L,s,a,!1,null,null,null)),R=N.exports,V={name:"LemonTabs",props:{activeIndex:String},data:function(){return{active:this.activeIndex}},mounted:function(){this.active||(this.active=this.$slots["tab-pane"][0].data.attrs.index)},render:function(){var t=this,e=arguments[0],n=[],i=[];return this.$slots["tab-pane"].map(function(s){var a=s.data.attrs,r=a.tab,o=a.index;n.push(e("div",{class:"lemon-tabs-content__pane",directives:[{name:"show",value:t.active==o}]},[s])),i.push(e("div",{class:["lemon-tabs-nav__item",t.active==o&&"lemon-tabs-nav__item--active"],on:{click:function(){return t._handleNavClick(o)}}},[r]))}),e("div",{class:"lemon-tabs"},[e("div",{class:"lemon-tabs-content"},[n]),e("div",{class:"lemon-tabs-nav"},[i])])},methods:{_handleNavClick:function(t){this.active=t}}},B=V,A=(n("3423"),Object(v["a"])(B,w,C,!1,null,null,null)),z=A.exports,H=(n("96cf"),n("3b8d")),q=(n("6762"),n("2fdb"),[]),K=function(){return q.forEach(function(t){return t()})},W={hover:function(t){},focus:function(t){var e=this;t.addEventListener("focus",function(t){e.changeVisible()}),t.addEventListener("blur",function(t){e.changeVisible()})},click:function(t){var e=this;t.addEventListener("click",function(t){t.stopPropagation(),e.changeVisible()})},contextmenu:function(t){var e=this;t.addEventListener("contextmenu",function(t){t.preventDefault(),e.changeVisible()})}},J={name:"LemonPopover",props:{trigger:{type:String,default:"click",validator:function(t){return Object.keys(W).includes(t)}}},data:function(){return{popoverStyle:{},visible:!1}},created:function(){document.addEventListener("click",this._documentClickEvent),q.push(this.close)},mounted:function(){W[this.trigger].call(this,this.$slots.default[0].elm)},render:function(){var t=arguments[0];return t("span",{style:"position:relative"},[t("transition",{attrs:{name:"lemon-slide-top"}},[this.visible&&t("div",{class:"lemon-popover",ref:"popover",style:this.popoverStyle,on:{click:function(t){return t.stopPropagation()}}},[t("div",{class:"lemon-popover__title"}),t("div",{class:"lemon-popover__content"},[this.$slots.content]),t("div",{class:"lemon-popover__arrow"})])]),this.$slots.default])},destroyed:function(){document.removeEventListener("click",this._documentClickEvent)},computed:{},watch:{visible:function(){var t=Object(H["a"])(regeneratorRuntime.mark(function t(e){var n,i;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(!e){t.next=6;break}return t.next=3,this.$nextTick();case 3:n=this.$slots.default[0].elm,i=this.$refs.popover,this.popoverStyle={top:"-".concat(i.offsetHeight+10,"px"),left:"".concat(n.offsetWidth/2-i.offsetWidth/2,"px")};case 6:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}()},methods:{_documentClickEvent:function(t){t.stopPropagation(),this.visible&&this.close()},changeVisible:function(){this.visible?this.close():this.open()},open:function(){K(),this.visible=!0},close:function(){this.visible=!1}}},Y=J,Q=(n("0e15"),Object(v["a"])(Y,y,M,!1,null,null,null)),G=Q.exports,Z={name:"LemonButton",props:{disabled:Boolean},render:function(){var t=arguments[0];return t("button",{class:"lemon-button",attrs:{disabled:this.disabled,type:"button"},on:{click:this._handleClick}},[this.$slots.default])},methods:{_handleClick:function(t){this.$emit("click",t)}}},X=Z,tt=(n("1e45"),Object(v["a"])(X,j,I,!1,null,null,null)),et=tt.exports,nt=(n("c5f6"),{name:"LemonBadge",props:{count:[Number,Boolean],overflowCount:{type:Number,default:99}},render:function(){var t=arguments[0];return t("span",{class:"lemon-badge"},[this.$slots.default,0!==this.count&&void 0!==this.count&&t("span",{class:["lemon-badge__label",this.isDot&&"lemon-badge__label--dot"]},[this.label])])},computed:{isDot:function(){return!0===this.count},label:function(){return this.isDot?"":this.count>this.overflowCount?"".concat(this.overflowCount,"+"):this.count}},methods:{}}),it=nt,st=(n("dbdc"),Object(v["a"])(it,k,O,!1,null,null,null)),at=st.exports,rt={name:"LemonAvatar",props:{src:String,icon:{type:String,default:"lemon-icon-people"},size:{type:Number,default:32}},data:function(){return{imageFinishLoad:!0}},render:function(){var t=this,e=arguments[0];return e("span",{style:this.style,class:"lemon-avatar",on:{click:function(e){return t.$emit("click",e)}}},[this.imageFinishLoad&&e("i",{class:this.icon}),e("img",{attrs:{src:this.src},on:{load:this._handleLoad}})])},computed:{style:function(){var t="".concat(this.size,"px");return{width:t,height:t,lineHeight:t,fontSize:"".concat(this.size/2,"px")}}},methods:{_handleLoad:function(){this.imageFinishLoad=!1}}},ot=rt,ct=(n("04f4"),Object(v["a"])(ot,S,T,!1,null,null,null)),dt=ct.exports;n("3b2b"),n("8615");function lt(t){return"[object Object]"===Object.prototype.toString.call(t)}function ut(t){return"string"==typeof t}function mt(t){return(new Date).getTime()-t<864e5}function ht(t){return!t||(!(!Array.isArray(t)||0!=t.length)||!(!lt(t)||0!=Object.values(t).length))}function ft(t){return t&&"function"===typeof t}n("a481");function vt(t,e,n){return t?t(n):e}function pt(t){return t<10?"0".concat(t):t}function gt(t){var e,n=new Date(t),i=new Date,s=function(t){return t.getFullYear()},a=function(t){return"".concat(t.getMonth()+1,"-").concat(t.getDate())},r=s(n),o=s(i);return e=r!==o?"y年m月d日 h:i":"".concat(r,"-").concat(a(n))==="".concat(o,"-").concat(a(i))?"h:i":"m月d日 h:i",_t(t,e)}function _t(t,e){e||(e="y-m-d h:i:s"),t=t?new Date(t):new Date;for(var n=[t.getFullYear().toString(),pt((t.getMonth()+1).toString()),pt(t.getDate().toString()),pt(t.getHours().toString()),pt(t.getMinutes().toString()),pt(t.getSeconds().toString())],i="ymdhis",s=0;s/gi,"")}function wt(t){return t.replace(/<(?!img).*?>/gi,"")}function Ct(t){return t.replace(/
]*>/gi,"[!$1]")}function yt(t){if(null==t||""==t)return"0 Bytes";var e=["B","K","M","G","T","P","E","Z","Y"],n=0,i=parseFloat(t);n=Math.floor(Math.log(i)/Math.log(1024));var s=i/Math.pow(1024,n);return s=parseFloat(s.toFixed(2)),s+e[n]}function Mt(){var t=(new Date).getTime();window.performance&&"function"===typeof window.performance.now&&(t+=performance.now());var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)});return e}var jt,It,kt={name:"LemonContact",components:{},inject:{IMUI:{from:"IMUI",default:function(){return this}}},data:function(){return{}},props:{contact:Object,simple:Boolean,timeFormat:{type:Function,default:function(t){return _t(t,mt(t)?"h:i":"y/m/d")}}},render:function(){var t=this,e=arguments[0];return e("div",{class:["lemon-contact",{"lemon-contact--name-center":this.simple}],on:{click:function(e){return t._handleClick(e,t.contact)}}},[vt(this.$scopedSlots.default,this._renderInner(),this.contact)])},created:function(){},mounted:function(){},computed:{},watch:{},methods:{_renderInner:function(){var t=this.$createElement,e=this.contact;return[t("lemon-badge",{attrs:{count:this.simple?0:e.unread},class:"lemon-contact__avatar"},[t("lemon-avatar",{attrs:{size:40,src:e.avatar}})]),t("div",{class:"lemon-contact__inner"},[t("p",{class:"lemon-contact__label"},[t("span",{class:"lemon-contact__name"},[e.displayName]),!this.simple&&t("span",{class:"lemon-contact__time"},[this.timeFormat(e.lastSendTime)])]),!this.simple&&t("p",{class:"lemon-contact__content"},[ut(e.lastContent)?t("span",o()([{},{domProps:{innerHTML:e.lastContent}}])):e.lastContent])])]},_handleClick:function(t,e){this.$emit("click",e)}}},Ot=kt,St=(n("909e"),Object(v["a"])(Ot,jt,It,!1,null,null,null)),Tt=St.exports;n("5df3"),n("1c4c");function $t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function Et(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"insertHTML";document.execCommand(e,!1,t)},Nt=window.getSelection(),Rt=[],Vt={name:"LemonEditor",inject:{IMUI:{from:"IMUI",default:function(){return this}}},components:{},props:{tools:{type:Array,default:function(){return[]}},sendText:{type:String,default:"发 送"},sendKey:{type:Function,default:function(t){return 13==t.keyCode&&!0===t.ctrlKey}}},data:function(){return{submitDisabled:!0,proxyTools:[],accept:""}},created:function(){this.tools&&this.tools.length>0?this.initTools(this.tools):this.initTools([{name:"emoji"},{name:"uploadFile"},{name:"uploadImage"}])},render:function(){var t=this,e=arguments[0],n=[],i=[];return this.proxyTools.forEach(function(s){var a=s.name,r=s.title,o=s.render,c=s.click,d=s.isRight;c=c||new Function;var l,u=["lemon-editor__tool-item",{"lemon-editor__tool-item--right":d}];l="emoji"==a?0==Rt.length?"":e("lemon-popover",{class:"lemon-editor__emoji"},[e("template",{slot:"content"},[t._renderEmojiTabs()]),e("div",{class:u,attrs:{title:r}},[o()])]):e("div",{class:u,on:{click:c},attrs:{title:r}},[o()]),d?i.push(l):n.push(l)}),e("div",{class:"lemon-editor"},[e("input",{style:"display:none",attrs:{type:"file",multiple:"multiple",accept:this.accept},ref:"fileInput",on:{change:this._handleChangeFile}}),e("div",{class:"lemon-editor__tool"},[e("div",{class:"lemon-editor__tool-left"},[n]),e("div",{class:"lemon-editor__tool-right"},[i])]),e("div",{class:"lemon-editor__inner"},[e("div",{class:"lemon-editor__input",ref:"textarea",attrs:{contenteditable:"true",spellcheck:"false"},on:{keyup:this._handleKeyup,keydown:this._handleKeydown,paste:this._handlePaste,click:this._handleClick}})]),e("div",{class:"lemon-editor__footer"},[e("div",{class:"lemon-editor__tip"},[vt(this.IMUI.$scopedSlots["editor-footer"],"使用 ctrl + enter 快捷发送消息")]),e("div",{class:"lemon-editor__submit"},[e("lemon-button",{attrs:{disabled:this.submitDisabled},on:{click:this._handleSend}},[this.sendText])])])])},methods:{initTools:function(t){var e=this,n=this.$createElement;if(t){var i=[{name:"emoji",title:"表情",click:null,render:function(t){return n("i",{class:"lemon-icon-emoji"})}},{name:"uploadFile",title:"文件上传",click:function(){return e.selectFile("*")},render:function(t){return n("i",{class:"lemon-icon-folder"})}},{name:"uploadImage",title:"图片上传",click:function(){return e.selectFile("image/*")},render:function(t){return n("i",{class:"lemon-icon-image"})}}],s=[];if(Array.isArray(t)){var a={emoji:0,uploadFile:1,uploadImage:2},r=Object.keys(a);s=t.map(function(t){return r.includes(t.name)?Et({},i[a[t.name]],{},t):t})}else s=i;this.proxyTools=s}},_saveLastRange:function(){Pt=Nt.getRangeAt(0)},_focusLastRange:function(){this.$refs.textarea.focus(),Pt&&(Nt.removeAllRanges(),Nt.addRange(Pt))},_handleClick:function(){this._saveLastRange()},_renderEmojiTabs:function(){var t=this,e=this.$createElement,n=function(n){return n.map(function(n){return e("img",{attrs:{src:n.src,title:n.title},class:"lemon-editor__emoji-item",on:{click:function(){return t._handleSelectEmoji(n)}}})})};if(Rt[0].label){var i=Rt.map(function(t,i){return e("div",{slot:"tab-pane",attrs:{index:i,tab:t.label}},[n(t.children)])});return e("lemon-tabs",{style:"width: 412px"},[i])}return e("div",{class:"lemon-tabs-content",style:"width:406px"},[n(Rt)])},_handleSelectEmoji:function(t){this._focusLastRange(),Lt('
')),this._checkSubmitDisabled(),this._saveLastRange()},selectFile:function(){var t=Object(H["a"])(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.accept=e,t.next=3,this.$nextTick();case 3:this.$refs.fileInput.click();case 4:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),_handlePaste:function(t){t.preventDefault();var e=t.clipboardData||window.clipboardData,n=e.getData("Text");window.clipboardData?this.$refs.textarea.innerHTML=n:Lt(n,"insertText")},_handleKeyup:function(t){this._saveLastRange(),this._checkSubmitDisabled()},_handleKeydown:function(t){0==this.submitDisabled&&this.sendKey(t)&&this._handleSend()},getFormatValue:function(){return Ct(this.$refs.textarea.innerHTML)},_checkSubmitDisabled:function(){this.submitDisabled=!wt(this.$refs.textarea.innerHTML.trim())},_handleSend:function(t){var e=this.getFormatValue();this.$emit("send",e),this.clear(),this._checkSubmitDisabled()},_handleChangeFile:function(t){var e=this,n=this.$refs.fileInput;Array.from(n.files).forEach(function(t){e.$emit("upload",t)}),n.value=""},clear:function(){this.$refs.textarea.innerHTML=""},initEmoji:function(t){Rt=t,this.$forceUpdate()},setValue:function(t){this.$refs.textarea.innerHTML=t,this._checkSubmitDisabled()}}},Bt=Vt,At=(n("49c2"),Object(v["a"])(Bt,Dt,Ut,!1,null,null,null)),zt=At.exports,Ht=function(){Ft&&(Ft.style.display="none")},qt=function(){Ft&&(Ft.style.display="block")};document.addEventListener("click",function(t){Ht()});var Kt,Wt,Jt,Yt,Qt={hide:Ht,bind:function(t,e,n){t.addEventListener("contextmenu",function(t){if(!ht(e.value)&&Array.isArray(e.value)){var s;t.preventDefault();var a=[];e.modifiers.message?s=n.context:e.modifiers.contact&&(s=n.child),Ft||(Ft=document.createElement("div"),Ft.className="lemon-dropdown",document.body.appendChild(Ft)),Ft.innerHTML=e.value.map(function(t){var e;if(e=ft(t.visible)?t.visible(s):void 0===t.visible||t.visible,e){a.push(t);var n=t.icon?''):"";return'').concat(n,"").concat(t.text,"
")}return""}).join(""),Ft.style.top="".concat(t.pageY,"px"),Ft.style.left="".concat(t.pageX,"px"),Ft.childNodes.forEach(function(t,e){var n=a[e],r=n.click,o=n.render;if(t.addEventListener("click",function(t){t.stopPropagation(),ft(r)&&r(t,s,Ht)}),ft(o)){var c=i["a"].extend({render:function(t){return o(t,s,Ht)}}),d=(new c).$mount();t.querySelector("span").innerHTML=d.$el.outerHTML}}),qt()}})},inserted:function(t,e,n){}},Gt={name:"LemonMessages",components:{},props:{hideName:Boolean,hideTime:Boolean,reverseUserId:String,timeRange:{type:Number,default:1},timeFormat:{type:Function,default:function(t){return gt(t)}},messages:{type:Array,default:function(){return[]}}},data:function(){return{_loading:!1,_loadend:!1}},render:function(){var t=this,e=arguments[0];return e("div",{class:"lemon-messages",ref:"wrap",on:{scroll:this._handleScroll}},[e("div",{class:["lemon-messages__load","lemon-messages__load--".concat(this._loadend?"end":"ing")]},[this._loadend?this._renderLoadEnd():this._renderLoading()]),this.messages.map(function(n,i){var s,a=[],r="lemon-message-".concat(n.type),c=t.messages[i-1];return c&&t.msecRange&&n.sendTime-c.sendTime>t.msecRange&&a.push(e("lemon-message-event",o()([{},{attrs:{message:{id:"__time__",type:"event",content:gt(n.sendTime)}}}]))),s="event"==n.type?{message:n}:{timeFormat:t.timeFormat,message:n,reverse:t.reverseUserId==n.fromUser.id,hideTime:t.hideTime,hideName:t.hideName},a.push(e(r,o()([{ref:"message",refInFor:!0},{attrs:s}]))),a})])},computed:{msecRange:function(){return 1e3*this.timeRange*60}},watch:{},methods:{_renderLoading:function(){var t=this.$createElement;return t("i",{class:"lemon-icon-loading lemonani-spin"})},_renderLoadEnd:function(){var t=this.$createElement;return t("span",["暂无更多消息"])},loaded:function(){this._loadend=!0,this.$forceUpdate()},resetLoadState:function(){this._loading=!1,this._loadend=!1},_handleScroll:function(){var t=Object(H["a"])(regeneratorRuntime.mark(function t(e){var n,i,s=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.target,Qt.hide(),0!=n.scrollTop||0!=this._loading||0!=this._loadend){t.next=8;break}return this._loading=!0,t.next=6,this.$nextTick();case 6:i=n.scrollHeight,this.$emit("reach-top",function(){var t=Object(H["a"])(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s.$nextTick();case 2:n.scrollTop=n.scrollHeight-i,s._loading=!1,s._loadend=!!e;case 5:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}());case 8:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),scrollToBottom:function(){var t=Object(H["a"])(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$nextTick();case 2:e=this.$refs.wrap,e&&(e.scrollTop=e.scrollHeight);case 4:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()},created:function(){},mounted:function(){}},Zt=Gt,Xt=(n("436f"),Object(v["a"])(Zt,Kt,Wt,!1,null,null,null)),te=Xt.exports,ee={name:"lemonMessageBasic",inject:{IMUI:{from:"IMUI",default:function(){return this}}},props:{contextmenu:Array,message:{type:Object,default:function(){return{}}},timeFormat:{type:Function,default:function(){return""}},reverse:Boolean,hideName:Boolean,hideTime:Boolean},data:function(){return{}},render:function(){var t=this,e=arguments[0],n=this.message,i=n.fromUser,s=n.status,a=n.sendTime;return e("div",{class:["lemon-message","lemon-message--status-".concat(s),{"lemon-message--reverse":this.reverse,"lemon-message--hide-name":this.hideName}]},[e("div",{class:"lemon-message__avatar"},[e("lemon-avatar",{attrs:{size:36,shape:"square",src:i.avatar},on:{click:function(e){t._emitClick(e,"avatar")}}})]),e("div",{class:"lemon-message__inner"},[e("div",{class:"lemon-message__title"},[e("span",{on:{click:function(e){t._emitClick(e,"displayName")}}},[i.displayName]),1==this.hideTime&&e("span",{class:"lemon-message__time",on:{click:function(e){t._emitClick(e,"sendTime")}}},[this.timeFormat(a)])]),e("div",{class:"lemon-message__content-flex"},[e("div",{directives:[{name:"dropdown",value:this.IMUI.contextmenu,modifiers:{message:!0}}],class:"lemon-message__content",on:{click:function(e){t._emitClick(e,"content")}}},[vt(this.$scopedSlots["content"],null,this.message)]),e("div",{class:"lemon-message__content-after"},[vt(this.IMUI.$scopedSlots["message-after"],null,this.message)]),e("div",{class:"lemon-message__status",on:{click:function(e){t._emitClick(e,"status")}}},[e("i",{class:"lemon-icon-loading lemonani-spin"}),e("i",{class:"lemon-icon-prompt",attrs:{title:"重发消息"},style:{color:"#ff2525",cursor:"pointer"}})])])])])},created:function(){},mounted:function(){},computed:{},watch:{},methods:{_emitClick:function(t,e){this.IMUI.$emit("message-click",t,e,this.message,this.IMUI)}}},ne=ee,ie=(n("fbd1"),Object(v["a"])(ne,Jt,Yt,!1,null,null,null)),se=ie.exports;function ae(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function re(t){for(var e=1;e1&&void 0!==arguments[1]&&arguments[1];if(void 0===We[t.toContactId])this.updateContact({id:t.toContactId,unread:"+1",lastSendTime:t.sendTime,lastContent:this.lastContentRender(t)});else{this._addMessage(t,t.toContactId,1);var n={id:t.toContactId,lastContent:this.lastContentRender(t),lastSendTime:t.sendTime};t.toContactId==this.currentContactId?1==e&&this.messageViewToBottom():n.unread="+1",this.updateContact(n)}},_emitSend:function(t,e,n){var i=this;this.$emit("send",t,function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{status:"succeed"};e(),i.updateMessage(Object.assign(t,n))},n)},_handleSend:function(t){var e=this,n=this._createMessage({content:t});this.appendMessage(n,!0),this._emitSend(n,function(){e.updateContact({id:n.toContactId,lastContent:e.lastContentRender(n),lastSendTime:n.sendTime})})},_handleUpload:function(t){var e,n=this,i=["image/gif","image/jpeg","image/png"];e=i.includes(t.type)?{type:"image",content:URL.createObjectURL(t)}:{type:"file",fileSize:t.size,fileName:t.name,content:""};var s=this._createMessage(e);this.appendMessage(s,!0),this._emitSend(s,function(){n.updateContact({id:s.toContactId,lastContent:n.lastContentRender(s),lastSendTime:s.sendTime})},t)},_emitPullMessages:function(t){var e=this;this._changeContactLock=!0,this.$emit("pull-messages",this.currentContact,function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e._addMessage(n,e.currentContactId,0),e.CacheMessageLoaded.set(e.currentContactId,i),1==i&&e.$refs.messages.loaded(),e.updateCurrentMessages(),e._changeContactLock=!1,t(i)},this)},clearCacheContainer:function(t){this.CacheContactContainer.remove(t),this.CacheMenuContainer.remove(t)},_renderWrapper:function(t){var e=this.$createElement;return e("div",{style:{width:this.width,height:this.height},class:["lemon-wrapper","lemon-wrapper--theme-".concat(this.theme),{"lemon-wrapper--simple":this.simple},this.drawerVisible&&"lemon-wrapper--drawer-show"]},[t])},_renderMenu:function(){var t=this,e=this.$createElement,n=this._renderMenuItem();return e("div",{class:"lemon-menu",directives:[{name:"show",value:!this.hideMenu}]},[e("lemon-avatar",{directives:[{name:"show",value:!this.hideMenuAvatar}],on:{click:function(e){t.$emit("menu-avatar-click",e)}},class:"lemon-menu__avatar",attrs:{src:this.user.avatar}}),n.top,this.$slots.menu,e("div",{class:"lemon-menu__bottom"},[this.$slots["menu-bottom"],n.bottom])])},_renderMenuAvatar:function(){},_renderMenuItem:function(){var t=this,e=this.$createElement,n=[],i=[];return this.menus.forEach(function(s){var a=s.name,r=s.title,o=s.unread,c=s.render,d=s.click,l=e("div",{class:["lemon-menu__item",{"lemon-menu__item--active":t.activeSidebar==a}],on:{click:function(){bt(d,function(){a&&t.changeMenu(a)})}},attrs:{title:r}},[e("lemon-badge",{attrs:{count:o}},[c(s)])]);!0===s.isBottom?i.push(l):n.push(l)}),{top:n,bottom:i}},_renderSidebarMessage:function(){var t=this;return this._renderSidebar([vt(this.$scopedSlots["sidebar-message-top"]),this.lastMessages.map(function(e){return t._renderContact({contact:e,timeFormat:t.contactTimeFormat},function(){return t.changeContact(e.id)},t.$scopedSlots["sidebar-message"])})],Fe)},_renderContact:function(t,e,n){var i=this,s=this.$createElement,a=t.contact,r=a.click,c=a.renderContainer,d=a.id,l=function(){bt(r,function(){e(),i._customContainerReady(c,i.CacheContactContainer,d)})};return s("lemon-contact",o()([{class:{"lemon-contact--active":this.currentContactId==t.contact.id},directives:[{name:"dropdown",value:this.contactContextmenu,modifiers:{contact:!0}}]},{props:t},{on:{click:l},scopedSlots:{default:n}}]))},_renderSidebarContact:function(){var t,e=this,n=this.$createElement;return this._renderSidebar([vt(this.$scopedSlots["sidebar-contact-top"]),this.contacts.map(function(i){if(i.index){i.index=i.index.replace(/\[[0-9]*\]/,"");var s=[i.index!==t&&n("p",{class:"lemon-sidebar__label"},[i.index]),e._renderContact({contact:i,simple:!0},function(){e.changeContact(i.id)},e.$scopedSlots["sidebar-contact"])];return t=i.index,s}})],Le)},_renderSidebar:function(t,e){var n=this.$createElement;return n("div",{class:"lemon-sidebar",directives:[{name:"show",value:this.activeSidebar==e}],on:{scroll:this._handleSidebarScroll}},[t])},_renderDrawer:function(){var t=this.$createElement;return this._menuIsMessages()&&this.currentContactId?t("div",{class:"lemon-drawer"},[Ye(),vt(this.$scopedSlots.drawer,"",this.currentContact)]):""},_isContactContainerCache:function(t){return t.startsWith("contact#")},_renderContainer:function(){var t=this,e=this.$createElement,n=[],i="lemon-container",s=this.currentContact,a=!0;for(var r in this.CacheContactContainer.get()){var o=s.id==r&&this.currentIsDefSidebar;a=!o,n.push(e("div",{class:i,directives:[{name:"show",value:o}]},[this.CacheContactContainer.get(r)]))}for(var c in this.CacheMenuContainer.get())n.push(e("div",{class:i,directives:[{name:"show",value:this.activeSidebar==c&&!this.currentIsDefSidebar}]},[this.CacheMenuContainer.get(c)]));return n.push(e("div",{class:i,directives:[{name:"show",value:this._menuIsMessages()&&a&&s.id}]},[e("div",{class:"lemon-container__title"},[e("div",{class:"lemon-container__displayname"},[vt(this.$scopedSlots["message-title"],s.displayName,s)])]),e("lemon-messages",{ref:"messages",attrs:{"hide-time":this.hideMessageTime,"hide-name":this.hideMessageName,"time-format":this.messageTimeFormat,"reverse-user-id":this.user.id,messages:this.currentMessages},on:{"reach-top":this._emitPullMessages}}),e("lemon-editor",{ref:"editor",attrs:{tools:this.editorTools,sendText:this.sendText,sendKey:this.sendKey},on:{send:this._handleSend,upload:this._handleUpload}})])),n.push(e("div",{class:i,directives:[{name:"show",value:!s.id&&this.currentIsDefSidebar}]},[this.$slots.cover])),n.push(e("div",{class:i,directives:[{name:"show",value:this._menuIsContacts()&&a&&s.id}]},[vt(this.$scopedSlots["contact-info"],e("div",{class:"lemon-contact-info"},[e("lemon-avatar",{attrs:{src:s.avatar,size:90}}),e("h4",[s.displayName]),e("lemon-button",{on:{click:function(){ht(s.lastContent)&&t.updateContact({id:s.id,lastContent:" "}),t.changeContact(s.id,Fe)}}},["发送消息"])]),s)])),n},_handleSidebarScroll:function(){Qt.hide()},_addContact:function(t,e){var n={0:"unshift",1:"push"}[e];this.contacts[n](t)},_addMessage:function(t,e,n){var i,s={0:"unshift",1:"push"}[n];Array.isArray(t)||(t=[t]),We[e]=We[e]||[],(i=We[e])[s].apply(i,Object(Ue["a"])(t))},setLastContentRender:function(t,e){Re[t]=e},lastContentRender:function(t){return ft(Re[t.type])?Re[t.type].call(this,t):(console.error("not found '".concat(t.type,"' of the latest message renderer,try to use ‘setLastContentRender()’")),"")},replaceEmojiName:function(t){return t.replace(/\[!(\w+)\]/gi,function(t,e){var n=e;return Je[n]?'
'):"[!".concat(e,"]")})},updateCurrentMessages:function(){We[this.currentContactId]||(We[this.currentContactId]=[]),this.currentMessages=We[this.currentContactId]},messageViewToBottom:function(){this.$refs.messages.scrollToBottom()},changeContact:function(){var t=Object(H["a"])(regeneratorRuntime.mark(function t(e,n){var i=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=4;break}this.changeMenu(n),t.next=6;break;case 4:if(!this._changeContactLock&&this.currentContactId!=e){t.next=6;break}return t.abrupt("return",!1);case 6:if(this.currentContactId=e,this.currentContactId){t.next=9;break}return t.abrupt("return",!1);case 9:if(this.$emit("change-contact",this.currentContact,this),!ft(this.currentContact.renderContainer)){t.next=12;break}return t.abrupt("return");case 12:this.CacheMessageLoaded.has(e)?this.$refs.messages.loaded():this.$refs.messages.resetLoadState(),We[e]?setTimeout(function(){i.updateCurrentMessages(),i.messageViewToBottom()},0):(this.updateCurrentMessages(),this._emitPullMessages(function(t){return i.messageViewToBottom()}));case 14:case"end":return t.stop()}},t,this)}));function e(e,n){return t.apply(this,arguments)}return e}(),removeMessage:function(t){var e=this.findMessage(t);if(!e)return!1;var n=We[e.toContactId].findIndex(function(e){var n=e.id;return n==t});return We[e.toContactId].splice(n,1),!0},updateMessage:function(t){if(!t.id)return!1;var e=this.findMessage(t.id);return!!e&&(e=Object.assign(e,t,{toContactId:e.toContactId}),!0)},forceUpdateMessage:function(t){if(t){var e=this.$refs.messages.$refs.message;if(e){var n=e.find(function(e){return e.$attrs.message.id==t});n&&n.$forceUpdate()}}else this.$refs.messages.$forceUpdate()},_customContainerReady:function(t,e,n){ft(t)&&!e.has(n)&&e.set(n,t.call(this))},changeMenu:function(t){if(this._changeContactLock)return!1;this.$emit("change-menu",t),this.activeSidebar=t},initEmoji:function(t){var e=[];this.$refs.editor.initEmoji(t),t[0].label?t.forEach(function(t){var n;(n=e).push.apply(n,Object(Ue["a"])(t.children))}):e=t,e.forEach(function(t){var e=t.name,n=t.src;return Je[e]=n})},initEditorTools:function(t){this.editorTools=t,this.$refs.editor.initTools(t)},initMenus:function(t){var e=this,n=this.$createElement,i=[{name:Fe,title:"聊天",unread:0,click:null,render:function(t){return n("i",{class:"lemon-icon-message"})},isBottom:!1},{name:Le,title:"通讯录",unread:0,click:null,render:function(t){return n("i",{class:"lemon-icon-addressbook"})},isBottom:!1}],s=[];if(Array.isArray(t)){var a={messages:0,contacts:1},r=Object.keys(a);s=t.map(function(t){return r.includes(t.name)?He({},i[a[t.name]],{},t,{},{renderContainer:null}):(t.renderContainer&&e._customContainerReady(t.renderContainer,e.CacheMenuContainer,t.name),t)})}else s=i;this.menus=s},initContacts:function(t){this.contacts=t,this.sortContacts()},sortContacts:function(){this.contacts.sort(function(t,e){if(t.index)return t.index.localeCompare(e.index)})},appendContact:function(t){return ht(t.id)||ht(t.displayName)?(console.error("id | displayName cant be empty"),!1):!!this.hasContact(t.id)||(this.contacts.push(Object.assign(Object(c["a"])({id:"",displayName:"",avatar:"",index:"",unread:0,lastSendTime:""},"lastSendTime",""),t)),!0)},removeContact:function(t){var e=this.findContactIndexById(t);return-1!==e&&(this.contacts.splice(e,1),!0)},updateContact:function(t){var e=t.id;delete t.id;var n=this.findContactIndexById(e);if(-1!==n){var i=t.unread;ut(i)&&(0!==i.indexOf("+")&&0!==i.indexOf("-")||(t.unread=parseInt(i)+parseInt(this.contacts[n].unread))),this.$set(this.contacts,n,He({},this.contacts[n],{},t))}},findContactIndexById:function(t){return this.contacts.findIndex(function(e){return e.id==t})},hasContact:function(t){return-1!==this.findContactIndexById(t)},findMessage:function(t){for(var e in We){var n=We[e].find(function(e){var n=e.id;return n==t});if(n)return n}},findContact:function(t){return this.getContacts().find(function(e){var n=e.id;return n==t})},getContacts:function(){return this.contacts},getCurrentContact:function(){return this.currentContact},getCurrentMessages:function(){return this.currentMessages},setEditorValue:function(t){this.$refs.editor.setValue(this.replaceEmojiName(t))},getEditorValue:function(){return this.$refs.editor.getFormatValue()},getMessages:function(t){return(t?We[t]:We)||[]},changeDrawer:function(t){this.drawerVisible=!this.drawerVisible,1==this.drawerVisible&&this.openDrawer(t)},openDrawer:function(t){Ye=t||new Function,this.drawerVisible=!0},closeDrawer:function(){this.drawerVisible=!1}}},Ge=Qe,Ze=(n("9b01"),Object(v["a"])(Ge,qe,Ke,!1,null,null,null)),Xe=Ze.exports;n("6a2b");i["a"].directive("dropdown",Qt);var tn="1.4.2",en=[Xe,Tt,te,zt,dt,at,et,G,z,se,me,xe,Te,De],nn=function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];en.forEach(function(e){t.component(e.name,e)})};"undefined"!==typeof window&&window.Vue&&nn(window.Vue);var sn={version:tn,install:nn};i["a"].use(sn),i["a"].config.productionTip=!1,new i["a"]({render:function(t){return t(R)}}).$mount("#app")},cfab:function(t,e,n){"use strict";var i=n("15cf"),s=n.n(i);s.a},dbdc:function(t,e,n){"use strict";var i=n("7802"),s=n.n(i);s.a},e86c:function(t,e,n){},ed4b:function(t,e,n){"use strict";var i=n("a215"),s=n.n(i);s.a},fbd1:function(t,e,n){"use strict";var i=n("820e"),s=n.n(i);s.a}});
\ No newline at end of file
diff --git a/examples/dist/js/index.f43bda32.js b/examples/dist/js/index.f43bda32.js
new file mode 100644
index 0000000..f4857c1
--- /dev/null
+++ b/examples/dist/js/index.f43bda32.js
@@ -0,0 +1 @@
+(function(t){function e(e){for(var i,r,o=e[0],c=e[1],d=e[2],u=0,m=[];u {\n return [语音]\n})\n")]),n("p",[t._v("最后一步,注册组件,必须使用全局注册的方式。")]),n("pre",[t._v("import Vue from 'vue';\nimport LemonMessageVoice from './lemon-message-voice';\nVue.component(LemonMessageVoice.name,LemonMessageVoice);\n")]),n("p",[t._v("如果还有不明白的,可以到 examples/App.vue 查看示例代码")])]),n("div",{staticClass:"title",attrs:{id:"help2"}},[t._v("如何对接后端接口?")]),n("p",[t._v("1.初始化用户的信息")]),n("pre",{domProps:{textContent:t._s("data(){\n return {\n user:{id:1:displayName:'June',avatar:''}\n }\n}")}}),n("pre",{domProps:{textContent:t._s("")}}),n("p",[t._v("2.初始化联系人数据")]),n("pre",{domProps:{textContent:t._s("mounted(){\n const { IMUI } = this.$refs;\n //初始化表情包。\n IMUI.initEmoji(...);\n //从后端请求联系人数据,包装成下面的样子\n const contacts = [{\n id: 2,\n displayName: '丽安娜',\n avatar:'',\n index: 'L',\n unread: 0,\n //最近一条消息的内容,如果值为空,不会出现在“聊天”列表里面。\n //lastContentRender 函数会将 file 消息转换为 '[文件]', image 消息转换为 '[图片]',对 text 会将文字里的表情标识替换为img标签,\n lastContent: IMUI.lastContentRender({type:'text',content:'你在干嘛呢?'})\n //最近一条消息的发送时间\n lastSendTime: 1566047865417,\n }];\n IMUI.initContacts(contacts);\n}")}}),n("p",[t._v("3.拉取消息列表")]),n("p",[t._v("现在刷新页面应该能够看到联系人了,但是点击联系人的话右边会一直处于加载中,这时需要监听 pull-messages 事件。")]),n("pre",{domProps:{textContent:t._s("")}}),n("pre",{domProps:{textContent:t._s("methods:{\n handlePullMessages(contact, next) {\n //从后端请求消息数据,包装成下面的样子\n const messages = [{\n id: '唯一消息ID',\n status: 'succeed',\n type: 'text',\n sendTime: 1566047865417,\n content: '你什么才能对接完?',\n toContactId: contact.id,\n fromUser:this.user\n }]\n //将第二个参数设为true,表示已到末尾,聊天窗口顶部会显示“暂无更多消息”,不然会一直转圈。\n next(messages,true);\n },\n}")}}),n("p",[t._v("4.发送消息")]),n("p",[t._v("现在在消息框发送新消息会一直转圈,这时需要监听 send 事件。")]),n("pre",{domProps:{textContent:t._s("methods:{\n handleSend(message, next, file) {\n ... 调用你的消息发送业务接口\n\n //执行到next消息会停止转圈,如果接口调用失败,可以修改消息的状态 next({status:'failed'});\n next();\n },\n}")}}),n("p",[t._v("5.接收消息")]),n("pre",{domProps:{textContent:t._s("mounted(){\n\nWebSocket.onmessage = function(event) {\n //将接收到的数据包装成下面的样子\n const data = {\n id: '唯一消息ID',\n status: 'succeed',\n type: 'text',\n sendTime: 1566047865417,\n content: '马上就对接完了!',\n toContactId: 2,\n fromUser:{\n //如果 id == this.user.id消息会显示在右侧,否则在左侧\n id:2,\n displayName:'丽安娜',\n avatar:'',\n }\n };\n IMUI.appendMessage(data);\n};\n \n}")}})])},s=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"link"},[n("span",[t._v("源码下载 ")]),n("a",{attrs:{target:"_blank",href:"https://github.com/fanjyy/lemon-imui"}},[t._v("Github")]),n("a",{attrs:{target:"_blank",href:"https://gitee.com/june000/lemon-im"}},[t._v("Gitee")]),n("a",{attrs:{target:"_blank",href:"https://qm.qq.com/cgi-bin/qm/qr?k=xzUa9CPYQ5KCNQ86h7ep4Z3TtkqJxRZE&jump_from=webapi"}},[t._v("QQ交流群:1081773406")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("a",{staticStyle:{"font-size":"14px"},attrs:{href:"#help1"}},[t._v("1.如何创建消息?")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("a",{staticStyle:{"font-size":"14px"},attrs:{href:"#help2"}},[t._v("2.如何对接后端接口?")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("id")]),n("td",{attrs:{width:"350"}},[t._v("唯一ID")]),n("td",{attrs:{width:"150"}},[t._v("String/Number")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("displayName")]),n("td",[t._v("名称")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr"),n("tr",[n("td",[t._v("avatar")]),n("td",[t._v("头像")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("index")]),n("td",[t._v("通讯录索引,传入字母或数字进行排序,索引可以显示自定义文字“[1]群组”")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("unread")]),n("td",[t._v("未读消息数")]),n("td",[t._v("Number")]),n("td",[t._v("0")]),n("td")]),n("tr",[n("td",[t._v("lastSendTime")]),n("td",[t._v("最近一条消息的时间戳,13位毫秒")]),n("td",[t._v("timestamp")]),n("td",[t._v("0")]),n("td")]),n("tr",[n("td",[t._v("lastContent")]),n("td",[t._v("最近一条消息的内容")]),n("td",[t._v("String | Vnode")]),n("td"),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("id")]),n("td",{attrs:{width:"350"}},[t._v("唯一ID")]),n("td",{attrs:{width:"150"}},[t._v("String/Number")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("status")]),n("td",[t._v("消息发送的状态:going | failed | succeed")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr"),n("tr",[n("td",[t._v("type")]),n("td",[t._v("消息类型:file | image | text | event")]),n("td",[t._v("String | Vnode")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("sendTime")]),n("td",[t._v("消息发送时间,13位毫秒")]),n("td",[t._v("timestamp")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("content")]),n("td",[t._v("消息内容,如果type=file,此属性表示文件的URL地址")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("fileSize")]),n("td",[t._v("文件大小")]),n("td",[t._v("Number")]),n("td",[t._v("0")]),n("td")]),n("tr",[n("td",[t._v("fileName")]),n("td",[t._v("文件名称")]),n("td",[t._v("String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("toContactId")]),n("td",[t._v("接收消息的联系人ID")]),n("td",[t._v("String | Number")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("fromUser")]),n("td",[t._v("消息发送人的信息")]),n("td",[t._v("Object")]),n("td",[t._v("-")]),n("td",[t._v('{id: "1",displayName: "测试",avatar: "url"};')])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("名称")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("text")]),n("td",{attrs:{width:"350"}},[t._v("显示文字")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("color")]),n("td",{attrs:{width:"350"}},[t._v("颜色")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("icon")]),n("td",{attrs:{width:"350"}},[t._v("图标 class")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("click")]),n("td",{attrs:{width:"350"}},[t._v("点击事件,调用hide方法隐藏右键菜单。")]),n("td",{attrs:{width:"150"}},[t._v("Function(e,instance,hide)")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("visible")]),n("td",{attrs:{width:"350"}},[t._v("是否显示的判断函数")]),n("td",{attrs:{width:"150"}},[t._v("Function(instance)")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("render")]),n("td",{attrs:{width:"350"}},[t._v("负责样式的渲染函数,使用render的时候text属性会失去作用,调用hide方法隐藏右键菜单。")]),n("td",{attrs:{width:"150"}},[t._v("Function(e,instance,hide)")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("user")]),n("td",{attrs:{width:"350"}},[t._v("用户信息")]),n("td",{attrs:{width:"150"}},[t._v("Object")]),n("td",{attrs:{width:"100"}},[t._v("-")]),n("td",[t._v('{id: "1",displayName: "测试",avatar: "url"};')])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("width")]),n("td",{attrs:{width:"350"}},[t._v("宽度")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("850px")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("height")]),n("td",{attrs:{width:"350"}},[t._v("高度")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("580px")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("theme")]),n("td",{attrs:{width:"350"}},[t._v("主题")]),n("td",{attrs:{width:"150"}},[t._v("default | blue")]),n("td",{attrs:{width:"100"}},[t._v("default")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("avatarCricle")]),n("td",{attrs:{width:"350"}},[t._v("使用圆形头像")]),n("td",{attrs:{width:"150"}},[t._v("Boolean")]),n("td",{attrs:{width:"100"}},[t._v("false")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sendText")]),n("td",{attrs:{width:"350"}},[t._v("发送消息按钮的文字")]),n("td",{attrs:{width:"150"}},[t._v("String")]),n("td",{attrs:{width:"100"}},[t._v("发送消息")]),n("td")]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sendKey")]),n("td",{attrs:{width:"350"}},[t._v("快捷发送键检查函数")]),n("td",{attrs:{width:"150"}},[t._v("Function(event)=>Boolean")]),n("td",{attrs:{width:"100"}}),n("td",[t._v("(e)=>e.keyCode == 13 && e.ctrlKey")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("simple")]),n("td",{attrs:{width:"350"}},[t._v("精简模式")]),n("td",{attrs:{width:"150"}},[t._v("Boolean")]),n("td",{attrs:{width:"100"}},[t._v("false")]),n("td",[t._v("精简模式下左侧的导航和联系人列表会隐藏,初始化时需要手动调用 changeContact 切换到聊天视图。")])]),n("tr",[n("td",[t._v("messageTimeFormat")]),n("td",[t._v("消息列表时间格式化函数")]),n("td",[t._v("Function(time)=>String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("contactTimeFormat")]),n("td",[t._v("联系人时间格式化规则")]),n("td",[t._v("Function(time)=>String")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("hideDrawer")]),n("td",[t._v("是否隐藏抽屉")]),n("td",[t._v("Boolean")]),n("td",[t._v("true")]),n("td")]),n("tr",[n("td",[t._v("hideMenuAvatar")]),n("td",[t._v("是否隐藏导航头像")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("hideMenu")]),n("td",[t._v("是否隐藏左侧导航")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("hideMessageName")]),n("td",[t._v("是否隐藏聊天窗口内的联系人名字")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("hideMessageTime")]),n("td",[t._v("是否隐藏聊天窗口内的消息发送时间")]),n("td",[t._v("Boolean")]),n("td",[t._v("false")]),n("td")]),n("tr",[n("td",[t._v("contextmenu")]),n("td",[t._v("聊天消息右键菜单配置")]),n("td",[t._v("[ContextmenuItem]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("contactContextmenu")]),n("td",[t._v("联系人右键菜单配置")]),n("td",[t._v("[ContextmenuItem]")]),n("td",[t._v("-")]),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("参数")]),n("th",[t._v("说明")]),n("th",[t._v("类型")]),n("th",[t._v("默认值")]),n("th",[t._v("示例")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("initMenus")]),n("td",{attrs:{width:"350"}},[t._v("初始化导航")]),n("td",{attrs:{width:"150"}},[t._v("Function([Object])")]),n("td",{attrs:{width:"100"}},[t._v('[ {\n name: "messages"\n },\n {\n name: "contacts"\n }]')]),n("td",[t._v(' {\n name: "custom2",\n title: "自定义按钮2",\n unread: 0,\n click: () => {\n alert("拦截导航点击事件");\n },\n render: menu => {\n return \'...\';\n },\n isBottom: true\n }')])]),n("tr",[n("td",[t._v("initContacts")]),n("td",[t._v("初始化联系人")]),n("td",[t._v("Function([Contact])")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("initEditorTools")]),n("td",[t._v("初始化工具栏")]),n("td",[t._v("Function([Object])")]),n("td",[t._v("[{name:'emoji'},{name:'uploadFile'},{name:'uploadImage'}]")]),n("td",[t._v("[{\n name:\"test2\",\n isRight:true,\n title:'上传 Excel',\n click:()=>{\n alert('点击')\n },\n render:()=>{\n return '...'\n }\n }]")])]),n("tr",[n("td",[t._v("initEmoji")]),n("td",[t._v("初始化表情数据")]),n("td",[t._v("Function([Object])")]),n("td",[t._v("-")]),n("td",[n("div",[t._v("\n 有分类:[{\n label: '默认表情',\n children: [\n {\n name: '1f62c',\n title: '微笑',\n src: 'https://twemoji.maxcdn.com/2/72x72/1f62c.png'\n }\n ]\n }]\n ")]),n("div",[t._v("\n 无分类:[{\n name: '1f62c',\n title: '微笑',\n src: 'https://twemoji.maxcdn.com/2/72x72/1f62c.png'\n }]\n ")])])]),n("tr",[n("td",[t._v("appendMessage")]),n("td",[t._v("新增一条消息, 如果当前焦点在该联系人的聊天窗口,设置 scrollToBottom=true 添加之后自动定位到消息窗口底部")]),n("td",[t._v("Function(Message,scrollToBottom=false)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("removeMessage")]),n("td",[t._v("删除聊天消息")]),n("td",[t._v("Function(Message.id)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("updateMessage")]),n("td",[t._v("修改消息,根据 Message.id 查找聊天消息并覆盖传入的值(toContactId会被忽略)")]),n("td",[t._v("Function(Message)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("appendContact")]),n("td",[t._v("添加联系人")]),n("td",[t._v("Function(Contact)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("removeContact")]),n("td",[t._v("删除联系人")]),n("td",[t._v("Function(Contact.id)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("updateContact")]),n("td",[t._v("修改联系人,根据 Contact.id 查找联系人并覆盖传入的值")]),n("td",[t._v("Function(Contact)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getMessages")]),n("td",[t._v("返回所有本地消息,传入 Contact.id 则只返回与该联系人的消息")]),n("td",[t._v("Function(Contact.id)=>[Message]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getCurrentContact")]),n("td",[t._v("返回当前聊天窗口的联系人信息")]),n("td",[t._v("Function()=>Contact")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getCurrentMessages")]),n("td",[t._v("返回当前聊天窗口的所有消息")]),n("td",[t._v("Function()=>[Message]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getContacts")]),n("td",[t._v("返回所有本地联系人")]),n("td",[t._v("Function()=>[Contact]")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("openDrawer")]),n("td",[t._v("打开联系人右侧抽屉,vnode 为抽屉内容")]),n("td",[t._v("Function(vnode)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("changeDrawer")]),n("td",[t._v("切换右侧抽屉显示/隐藏,vnode 为抽屉内容")]),n("td",[t._v("Function(vnode)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("closeDrawer")]),n("td",[t._v("关闭抽屉")]),n("td",[t._v("Function()")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("changeMenu")]),n("td",[t._v("切换左侧导航")]),n("td",[t._v("Function(Menu.name)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("changeContact")]),n("td",[t._v("切换聊天窗口")]),n("td",[t._v("Function(Contact.id,instance)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("messageViewToBottom")]),n("td",[t._v("将当前聊天窗口滚动到底部")]),n("td",[t._v("Function()")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("setLastContentRender")]),n("td",[t._v("设置左侧联系人最新消息的渲染函数")]),n("td",[t._v("Function(Message.type, (Message)=>vnode)")]),n("td",[t._v("-")]),n("td",[t._v("\n setLastContentRender('image', message => {\n return "),n("span",[t._v("[最新图片]")]),t._v("\n })\n ")])]),n("tr",[n("td",[t._v("lastContentRender")]),n("td",[t._v("用来生成 Message.lastContent 需要的vnode结构。")]),n("td",[t._v("Function(Message)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("setEditorValue")]),n("td",[t._v("设置编辑框内容")]),n("td",[t._v("Function(string)")]),n("td",[t._v("-")]),n("td")]),n("tr",[n("td",[t._v("getEditorValue")]),n("td",[t._v("获取编辑框内容")]),n("td",[t._v("Function()=>string")]),n("td",[t._v("-")]),n("td")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("插槽名")]),n("th",[t._v("说明")]),n("th",[t._v("参数")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("cover")]),n("td",{attrs:{width:"350"}},[t._v("初始化时的封面")]),n("td",{attrs:{width:"150"}},[t._v("-")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("editor-footer")]),n("td",{attrs:{width:"350"}},[t._v("消息输入框底部")]),n("td",{attrs:{width:"150"}},[t._v("-")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("message-title")]),n("td",{attrs:{width:"350"}},[t._v("消息列表的标题")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("message-after")]),n("td",{attrs:{width:"350"}},[t._v("每条消息的尾部")]),n("td",{attrs:{width:"150"}},[t._v("Message")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-message")]),n("td",{attrs:{width:"350"}},[t._v("左侧最新消息列表插槽")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-contact")]),n("td",{attrs:{width:"350"}},[t._v("左侧联系人列表插槽")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-message-top")]),n("td",{attrs:{width:"350"}},[t._v("左侧最新消息列表的顶部,会随列表滚动")]),n("td",{attrs:{width:"150"}},[t._v("instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-contact-top")]),n("td",{attrs:{width:"350"}},[t._v("左侧联系人列表的顶部,会随列表滚动")]),n("td",{attrs:{width:"150"}},[t._v("instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-message-fixedtop")]),n("td",{attrs:{width:"350"}},[t._v("固定在左侧最新消息列表的顶部")]),n("td",{attrs:{width:"150"}},[t._v("instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("sidebar-contact-fixedtop")]),n("td",{attrs:{width:"350"}},[t._v("固定在左侧联系人列表的顶部")]),n("td",{attrs:{width:"150"}},[t._v("instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("contact-info")]),n("td",{attrs:{width:"350"}},[t._v("左侧联系人详细页")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table"},[n("tr",{staticClass:"table-head"},[n("th",[t._v("事件名")]),n("th",[t._v("说明")]),n("th",[t._v("参数")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("change-menu")]),n("td",{attrs:{width:"350"}},[t._v("当左侧导航选项卡切换的时候会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Menu.name")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("menu-avatar-click")]),n("td",{attrs:{width:"350"}},[t._v("当左侧导航内的头像被点击时回触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("change-contact")]),n("td",{attrs:{width:"350"}},[t._v("当左侧联系人点击时会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Contact")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("pull-messages")]),n("td",{attrs:{width:"350"}},[t._v("当切换聊天对象或者聊天窗口滚动到顶部时会触发该事件,调用next方法结束loading状态,如果设置了isEnd=true,下次聊天窗口滚动到顶部将不会再触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Contact,next([Message],isEnd),instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("message-click")]),n("td",{attrs:{width:"350"}},[t._v("点击聊天窗口中的消息时会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("event,key,Message,instance")])]),n("tr",[n("td",{attrs:{width:"150"}},[t._v("send")]),n("td",{attrs:{width:"350"}},[t._v("当发送新消息时会触发该事件")]),n("td",{attrs:{width:"150"}},[t._v("Message,Function(Message):调用该函数完成消息发送,可以传入Message来改变消息内容,file:上传时的文件")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",[t._v("Lemon-IMUI 目前内置了file、image、text、event四种消息类型,在实际应用当中肯定是不够的哦,咋办?没事的,我们继续往下see。"),n("br"),t._v("要创建消息首先要确定新消息的 Message 结构。")])}],r=(n("8e6e"),n("ac6a"),n("456d"),n("2638")),o=n.n(r),c=n("bd86");n("6b54"),n("7f7f");function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function l(t){for(var e=1;e {\n //返回HTML结构\n return {props.content} 🔈\n }\n }}\n />\n );\n }\n};\n',j=function(){return(new Date).getTime()},I=function(){return Math.random().toString(36).substr(-8)},k=function(){return Math.random().toString(36).substr(2)},S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return e||(e={id:"system",displayName:"系统测试",avatar:"http://upload.qqbodys.com/allimg/1710/1035512943-0.jpg"}),{id:I(),status:"succeed",type:"text",sendTime:j(),content:k(),toContactId:t,fromUser:e}},O={name:"app",data:function(){var t=this,e=this.$createElement;return{theme:"default",contactContextmenu:[{text:"删除该聊天",click:function(t,e,n){var i=e.IMUI,a=e.contact;i.updateContact({id:a.id,lastContent:null}),i.currentContactId==a.id&&i.changeContact(null),n()}},{text:"设置备注和标签"},{text:"投诉"},{icon:"lemon-icon-message",render:function(t,e,n){return t("div",{style:"display:flex;justify-content:space-between;align-items:center;width:130px"},[t("span",["加入黑名单"]),t("span",[t("input",{attrs:{type:"checkbox",id:"switch"}}),t("label",{attrs:{id:"switch-label",for:"switch"}},["Toggle"])])])}},{click:function(t,e,n){var i=e.IMUI,a=e.contact;i.removeContact(a.id),i.currentContactId==a.id&&i.changeContact(null),n()},color:"red",text:"删除好友"}],contextmenu:[{click:function(t,n,i){var a=n.IMUI,s=n.message,r={id:I(),type:"event",content:e("span",["你撤回了一条消息 ",e("span",{directives:[{name:"show",value:"text"==s.type}],style:"color:#333;cursor:pointer",attrs:{content:s.content},on:{click:function(t){a.setEditorValue(t.target.getAttribute("content"))}}},["重新编辑"])]),toContactId:s.toContactId,sendTime:j()};a.removeMessage(s.id),a.appendMessage(r,!0),i()},visible:function(e){return e.message.fromUser.id==t.user.id},text:"撤回消息"},{visible:function(e){return e.message.fromUser.id!=t.user.id},text:"举报"},{text:"转发"},{visible:function(t){return"text"==t.message.type},text:"复制文字"},{visible:function(t){return"image"==t.message.type},text:"下载图片"},{visible:function(t){return"file"==t.message.type},text:"下载文件"},{click:function(t,e,n){var i=e.IMUI,a=e.message;i.removeMessage(a.id),n()},icon:"lemon-icon-folder",color:"red",text:"删除"}],tip:M,packageData:_,hideMenuAvatar:!1,hideMenu:!1,hideMessageName:!1,hideMessageTime:!0,user:{id:"1",displayName:"June",avatar:""}}},mounted:function(){var t=this.$createElement,e={id:"contact-1",displayName:"工作协作群",avatar:"http://upload.qqbodys.com/img/weixin/20170804/ji5qxg1am5ztm.jpg",index:"[1]群组",unread:0,lastSendTime:1566047865417,lastContent:"2"},n={id:"contact-2",displayName:"自定义内容",avatar:"http://upload.qqbodys.com/img/weixin/20170807/jibfvfd00npin.jpg",click:function(t){t()},renderContainer:function(){return t("h1",{style:"text-indent:20px"},["自定义页面"])},lastSendTime:1345209465e3,lastContent:"12312",unread:2},i={id:"contact-3",displayName:"铁牛",avatar:"http://upload.qqbodys.com/img/weixin/20170803/jiq4nzrkrnd0e.jpg",index:"T",unread:32,lastSendTime:3,lastContent:"你好123"},a={id:"contact-4",displayName:"如花",avatar:"https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=4275424924,2201401076&fm=111&gp=0.jpg",index:"",unread:1,lastSendTime:3,lastContent:"吃饭了嘛"},s=this.$refs.IMUI;setTimeout(function(){console.log(s.hasContact("cont1act-3"))},2e3),s.setLastContentRender("event",function(t){return"[有人邀请你加入群组]"});var r=[x({},e),x({},n),x({},i)];s.initContacts(r),s.initMenus([{name:"messages"},{name:"contacts"},{name:"custom1",title:"自定义按钮1",unread:0,render:function(e){return t("i",{class:"lemon-icon-attah"})},renderContainer:function(){return t("div",{class:"article"},[t("ul",[t("li",{class:"article-item"},[t("h2",["人民日报谈网红带货:产品真的值得买吗?"])]),t("li",{class:"article-item"},["甘肃夏河县发生5.7级地震 暂未接到人员伤亡报告"]),t("li",{class:"article-item"},["北方多地风力仍强沙尘相伴,东北内蒙古等地迎雨雪"]),t("li",{class:"article-item"},["英货车案:越南警方采集疑死者家属DNA作比对"]),t("li",{class:"article-item"},["知名连锁咖啡店的蛋糕吃出活虫 曝光内幕太震惊"])]),t("lemon-contact",o()([{},{props:{contact:e}},{style:"margin:20px"}])),t("lemon-contact",o()([{},{props:{contact:i}},{style:"margin:20px"}]))])},isBottom:!0},{name:"custom2",title:"自定义按钮2",unread:0,click:function(){alert("拦截导航点击事件")},render:function(e){return t("i",{class:"lemon-icon-group"})},isBottom:!0}]),s.initEditorTools([{name:"emoji"},{name:"uploadFile"},{name:"uploadImage"},{name:"test1",click:function(){s.$refs.editor.selectFile("application/vnd.ms-excel")},render:function(){return t("span",["Excel"])}},{name:"test1",click:function(){s.initEditorTools([{name:"uploadFile"},{name:"emoji"}])},render:function(){return t("span",["重制工具栏"])}},{name:"test2",isRight:!0,title:"上传 Excel",click:function(){alert("点击了 ··· ")},render:function(){return t("b",["···"])}}]);var c=[{label:"表情",children:[{name:"1f600",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f600.png"},{name:"1f62c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f62c.png"},{name:"1f601",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f601.png"},{name:"1f602",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f602.png"},{name:"1f923",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f923.png"},{name:"1f973",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f973.png"},{name:"1f603",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f603.png"},{name:"1f604",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f604.png"},{name:"1f605",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f605.png"},{name:"1f606",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f606.png"},{name:"1f607",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f607.png"},{name:"1f609",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f609.png"},{name:"1f60a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60a.png"},{name:"1f642",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f642.png"},{name:"1f643",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f643.png"},{name:"1263a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/263a.png"},{name:"1f60b",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60b.png"},{name:"1f60c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60c.png"},{name:"1f60d",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60d.png"},{name:"1f970",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f970.png"},{name:"1f618",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f618.png"},{name:"1f617",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f617.png"},{name:"1f619",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f619.png"},{name:"1f61a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61a.png"},{name:"1f61c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61c.png"},{name:"1f92a",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92a.png"},{name:"1f928",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f928.png"},{name:"1f9d0",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f9d0.png"},{name:"1f61d",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61d.png"},{name:"1f61b",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61b.png"},{name:"1f911",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f911.png"},{name:"1f913",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f913.png"},{name:"1f60e",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60e.png"},{name:"1f929",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f929.png"},{name:"1f921",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f921.png"},{name:"1f920",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f920.png"},{name:"1f917",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f917.png"},{name:"1f60f",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f60f.png"},{name:"1f636",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f636.png"},{name:"1f610",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f610.png"},{name:"1f611",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f611.png"},{name:"1f612",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f612.png"},{name:"1f644",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f644.png"},{name:"1f914",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f914.png"},{name:"1f925",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f925.png"},{name:"1f92d",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92d.png"},{name:"1f92b",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92b.png"},{name:"1f92c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92c.png"},{name:"1f92f",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f92f.png"},{name:"1f633",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f633.png"},{name:"1f61e",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61e.png"},{name:"1f61f",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f61f.png"},{name:"1f620",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f620.png"},{name:"1f621",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f621.png"}]},{label:"收藏",children:[{name:"1f62c",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f62c.png"},{name:"1f621",title:"微笑",src:"https://twemoji.maxcdn.com/2/72x72/1f621.png"}]}];s.initEmoji(c),s.setLastContentRender("voice",function(e){return t("span",["[语音]"])});var d=this.$refs.SimpleIMUI;e.id="11",d.initContacts([e]),d.initEmoji(c),d.changeContact(e.id);var l=this.$refs.SlotIMUI;i.id="333",l.initContacts([a,i]),l.initEmoji(c)},methods:{changeTheme:function(){this.theme="default"==this.theme?"blue":"default"},scrollToTop:function(){document.body.scrollIntoView()},handleMenuAvatarClick:function(){console.log("Event:menu-avatar-click")},handleMessageClick:function(t,e,n,i){console.log("点击了消息",t,e,n),"status"==e&&(i.updateMessage({id:n.id,status:"going",content:"正在重新发送消息..."}),setTimeout(function(){i.updateMessage({id:n.id,status:"succeed",content:"发送成功"})},2e3))},changeMenuAvatarVisible:function(){this.hideMenuAvatar=!this.hideMenuAvatar},changeMenuVisible:function(){this.hideMenu=!this.hideMenu},changeMessageNameVisible:function(){this.hideMessageName=!this.hideMessageName},changeMessageTimeVisible:function(){this.hideMessageTime=!this.hideMessageTime},removeMessage:function(){var t=this.$refs.IMUI,e=t.getCurrentMessages(),n=e[e.length-1].id;e.length>0&&t.removeMessage(n)},updateMessage:function(){var t=this.$refs.IMUI,e=t.getCurrentMessages(),n=e[e.length-1];if(e.length>0){var i={id:n.id,status:"succeed",type:"file",fileName:"被修改成文件了.txt",fileSize:"4200000"};"event"==n.type&&(i.fromUser=this.user),t.updateMessage(i),t.messageViewToBottom()}},appendCustomMessage:function(){var t=this.$refs.IMUI,e={id:I(),status:"succeed",type:"voice",sendTime:j(),content:"语音消息",params1:"1",params2:"2",toContactId:"contact-1",fromUser:this.user};t.appendMessage(e,!0)},appendMessage:function(){var t=this.$refs.IMUI,e=(t.currentContact,S("contact-3"));e.fromUser=x({},e.fromUser,{},this.user),t.appendMessage(e,!0)},appendEventMessage:function(){var t=this.$createElement,e=this.$refs.IMUI,n={id:I(),type:"event",content:t("span",["邀请你加入群聊 ",t("span",{style:"color:#333;cursor:pointer",on:{click:function(){return alert("OK")}}},["接受"])]),toContactId:"contact-3",sendTime:j()};e.appendMessage(n,!0)},updateContact:function(){this.$refs.IMUI.updateContact({id:"contact-3",unread:10,displayName:k(),lastSendTime:j(),lastContent:"修改昵称为随机字母"})},changeDrawer:function(t,e){var n=this.$createElement;e.changeDrawer(function(){return n("div",{class:"drawer-content"},[n("p",[n("b",["自定义抽屉"])]),n("p",[t.displayName])])})},handleChangeContact:function(t,e){console.log("Event:change-contact"),e.updateContact({id:t.id,unread:0}),e.closeDrawer()},handleSend:function(t,e,n){console.log(t,e,n),setTimeout(function(){e()},1e3)},handlePullMessages:function(t,e,n){var i=this,a={id:t.id,displayName:t.displayName,avatar:t.avatar};setTimeout(function(){var t=[S(n.currentContactId,i.user),S(n.currentContactId,a),S(n.currentContactId,i.user),S(n.currentContactId,a),S(n.currentContactId,i.user),S(n.currentContactId,i.user),S(n.currentContactId,a),x({},S(n.currentContactId,i.user),{},{status:"failed"})],s=!1;n.getMessages(n.currentContactId).length+t.length>11&&(s=!0),e(t,s)},500)},handleChangeMenu:function(){console.log("Event:change-menu")},openCustomContainer:function(){}}},T=O,$=(n("9c9b"),Object(v["a"])(T,a,s,!1,null,null,null)),E=$.exports,U={name:"LemonTabs",props:{activeIndex:String},data:function(){return{active:this.activeIndex}},mounted:function(){this.active||(this.active=this.$slots["tab-pane"][0].data.attrs.index)},render:function(){var t=this,e=arguments[0],n=[],i=[];return this.$slots["tab-pane"].map(function(a){var s=a.data.attrs,r=s.tab,o=s.index;n.push(e("div",{class:"lemon-tabs-content__pane",directives:[{name:"show",value:t.active==o}]},[a])),i.push(e("div",{class:["lemon-tabs-nav__item",t.active==o&&"lemon-tabs-nav__item--active"],on:{click:function(){return t._handleNavClick(o)}}},[r]))}),e("div",{class:"lemon-tabs"},[e("div",{class:"lemon-tabs-content"},[n]),e("div",{class:"lemon-tabs-nav"},[i])])},methods:{_handleNavClick:function(t){this.active=t}}},D=U,P=(n("3423"),Object(v["a"])(D,w,C,!1,null,null,null)),F=P.exports,L=(n("96cf"),n("3b8d"));n("6762"),n("2fdb"),n("3b2b"),n("8615");function N(t){return"[object Object]"===Object.prototype.toString.call(t)}function R(t){return"string"==typeof t}function B(t){return(new Date).getTime()-t<864e5}function V(t){return!t||(!(!Array.isArray(t)||0!=t.length)||!(!N(t)||0!=Object.values(t).length))}function A(t){return t&&"function"===typeof t}var z=function(){y&&(y.style.display="none")},H=function(){y&&(y.style.display="block")};document.addEventListener("click",function(t){z()});var q,K,W,J,Y,Q,G,Z,X={hide:z,bind:function(t,e,n){t.addEventListener("contextmenu",function(t){if(!V(e.value)&&Array.isArray(e.value)){var a;t.preventDefault(),st.methods.closeAll();var s=[];e.modifiers.message?a=n.context:e.modifiers.contact&&(a=n.child),y||(y=document.createElement("div"),y.className="lemon-contextmenu",document.body.appendChild(y)),y.innerHTML=e.value.map(function(t){var e;if(e=A(t.visible)?t.visible(a):void 0===t.visible||t.visible,e){s.push(t);var n=t.icon?''):"";return'")}return""}).join(""),y.style.top="".concat(t.pageY,"px"),y.style.left="".concat(t.pageX,"px"),y.childNodes.forEach(function(t,e){var n=s[e],r=n.click,o=n.render;if(t.addEventListener("click",function(t){t.stopPropagation(),A(r)&&r(t,a,z)}),A(o)){var c=i["a"].extend({render:function(t){return o(t,a,z)}}),d=(new c).$mount();t.querySelector("span").innerHTML=d.$el.outerHTML}}),H()}})},inserted:function(t,e,n){}},tt=[],et={hover:function(t){},focus:function(t){var e=this;t.addEventListener("focus",function(t){e.changeVisible()}),t.addEventListener("blur",function(t){e.changeVisible()})},click:function(t){var e=this;t.addEventListener("click",function(t){t.stopPropagation(),X.hide(),e.changeVisible()})},contextmenu:function(t){var e=this;t.addEventListener("contextmenu",function(t){t.preventDefault(),e.changeVisible()})}},nt={name:"LemonPopover",props:{trigger:{type:String,default:"click",validator:function(t){return Object.keys(et).includes(t)}}},data:function(){return{popoverStyle:{},visible:!1}},created:function(){document.addEventListener("click",this._documentClickEvent),tt.push(this.close)},mounted:function(){et[this.trigger].call(this,this.$slots.default[0].elm)},render:function(){var t=arguments[0];return t("span",{style:"position:relative"},[t("transition",{attrs:{name:"lemon-slide-top"}},[this.visible&&t("div",{class:"lemon-popover",ref:"popover",style:this.popoverStyle,on:{click:function(t){return t.stopPropagation()}}},[t("div",{class:"lemon-popover__content"},[this.$slots.content]),t("div",{class:"lemon-popover__arrow"})])]),this.$slots.default])},destroyed:function(){document.removeEventListener("click",this._documentClickEvent)},computed:{},watch:{visible:function(){var t=Object(L["a"])(regeneratorRuntime.mark(function t(e){var n,i;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(!e){t.next=6;break}return t.next=3,this.$nextTick();case 3:n=this.$slots.default[0].elm,i=this.$refs.popover,this.popoverStyle={top:"-".concat(i.offsetHeight+10,"px"),left:"".concat(n.offsetWidth/2-i.offsetWidth/2,"px")};case 6:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}()},methods:{_documentClickEvent:function(t){t.stopPropagation(),this.visible&&this.close()},changeVisible:function(){this.visible?this.close():this.open()},open:function(){this.closeAll(),this.visible=!0},closeAll:function(){tt.forEach(function(t){return t()})},close:function(){this.visible=!1}}},it=nt,at=(n("0e15"),Object(v["a"])(it,q,K,!1,null,null,null)),st=at.exports,rt={name:"LemonButton",props:{color:{type:String,default:"default"},disabled:Boolean},render:function(){var t=arguments[0];return t("button",{class:["lemon-button","lemon-button--color-".concat(this.color)],attrs:{disabled:this.disabled,type:"button"},on:{click:this._handleClick}},[this.$slots.default])},methods:{_handleClick:function(t){this.$emit("click",t)}}},ot=rt,ct=(n("1e45"),Object(v["a"])(ot,W,J,!1,null,null,null)),dt=ct.exports,lt=(n("c5f6"),{name:"LemonBadge",props:{count:[Number,Boolean],overflowCount:{type:Number,default:99}},render:function(){var t=arguments[0];return t("span",{class:"lemon-badge"},[this.$slots.default,0!==this.count&&void 0!==this.count&&t("span",{class:["lemon-badge__label",this.isDot&&"lemon-badge__label--dot"]},[this.label])])},computed:{isDot:function(){return!0===this.count},label:function(){return this.isDot?"":this.count>this.overflowCount?"".concat(this.overflowCount,"+"):this.count}},methods:{}}),ut=lt,mt=(n("dbdc"),Object(v["a"])(ut,Y,Q,!1,null,null,null)),ht=mt.exports,ft={name:"LemonAvatar",inject:["IMUI"],props:{src:String,icon:{type:String,default:"lemon-icon-people"},circle:{type:Boolean,default:function(){return!!this.IMUI&&this.IMUI.avatarCricle}},size:{type:Number,default:32}},data:function(){return{imageFinishLoad:!0}},render:function(){var t=this,e=arguments[0];return e("span",{style:this.style,class:["lemon-avatar",{"lemon-avatar--circle":this.circle}],on:{click:function(e){return t.$emit("click",e)}}},[this.imageFinishLoad&&e("i",{class:this.icon}),e("img",{attrs:{src:this.src},on:{load:this._handleLoad}})])},computed:{style:function(){var t="".concat(this.size,"px");return{width:t,height:t,lineHeight:t,fontSize:"".concat(this.size/2,"px")}}},methods:{_handleLoad:function(){this.imageFinishLoad=!1}}},vt=ft,pt=(n("04f4"),Object(v["a"])(vt,G,Z,!1,null,null,null)),gt=pt.exports;n("a481");function _t(t,e,n){return t?t(n):e}function bt(t){return t<10?"0".concat(t):t}function xt(t){var e,n=new Date(t),i=new Date,a=function(t){return t.getFullYear()},s=function(t){return"".concat(t.getMonth()+1,"-").concat(t.getDate())},r=a(n),o=a(i);return e=r!==o?"y年m月d日 h:i":"".concat(r,"-").concat(s(n))==="".concat(o,"-").concat(s(i))?"h:i":"m月d日 h:i",wt(t,e)}function wt(t,e){e||(e="y-m-d h:i:s"),t=t?new Date(t):new Date;for(var n=[t.getFullYear().toString(),bt((t.getMonth()+1).toString()),bt(t.getDate().toString()),bt(t.getHours().toString()),bt(t.getMinutes().toString()),bt(t.getSeconds().toString())],i="ymdhis",a=0;a/gi,"")}function Mt(t){return t.replace(/<(?!img).*?>/gi,"")}function jt(t){if(null==t||""==t)return"0 Bytes";var e=["B","K","M","G","T","P","E","Z","Y"],n=0,i=parseFloat(t);n=Math.floor(Math.log(i)/Math.log(1024));var a=i/Math.pow(1024,n);return a=parseFloat(a.toFixed(2)),a+e[n]}function It(){var t=(new Date).getTime();window.performance&&"function"===typeof window.performance.now&&(t+=performance.now());var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)});return e}var kt,St,Ot={name:"LemonContact",components:{},inject:{IMUI:{from:"IMUI",default:function(){return this}}},data:function(){return{}},props:{contact:Object,simple:Boolean,timeFormat:{type:Function,default:function(t){return wt(t,B(t)?"h:i":"y/m/d")}}},render:function(){var t=this,e=arguments[0];return e("div",{class:["lemon-contact",{"lemon-contact--name-center":this.simple}],on:{click:function(e){return t._handleClick(e,t.contact)}}},[_t(this.$scopedSlots.default,this._renderInner(),this.contact)])},created:function(){},mounted:function(){},computed:{},watch:{},methods:{_renderInner:function(){var t=this.$createElement,e=this.contact;return[t("lemon-badge",{attrs:{count:this.simple?0:e.unread},class:"lemon-contact__avatar"},[t("lemon-avatar",{attrs:{size:40,src:e.avatar}})]),t("div",{class:"lemon-contact__inner"},[t("p",{class:"lemon-contact__label"},[t("span",{class:"lemon-contact__name"},[e.displayName]),!this.simple&&t("span",{class:"lemon-contact__time"},[this.timeFormat(e.lastSendTime)])]),!this.simple&&t("p",{class:"lemon-contact__content"},[R(e.lastContent)?t("span",o()([{},{domProps:{innerHTML:e.lastContent}}])):e.lastContent])])]},_handleClick:function(t,e){this.$emit("click",e)}}},Tt=Ot,$t=(n("909e"),Object(v["a"])(Tt,kt,St,!1,null,null,null)),Et=$t.exports;n("5df3"),n("1c4c");function Ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function Dt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"insertHTML";document.execCommand(e,!1,t)},zt=window.getSelection(),Ht=[],qt={name:"LemonEditor",inject:{IMUI:{from:"IMUI",default:function(){return this}}},components:{},props:{tools:{type:Array,default:function(){return[]}},sendText:{type:String,default:"发 送"},sendKey:{type:Function,default:function(t){return 13==t.keyCode&&!0===t.ctrlKey}}},data:function(){return this.clipboardBlob=null,{clipboardUrl:"",submitDisabled:!0,proxyTools:[],accept:""}},created:function(){var t=this;this.tools&&this.tools.length>0?this.initTools(this.tools):this.initTools([{name:"emoji"},{name:"uploadFile"},{name:"uploadImage"}]),this.IMUI.$on("change-contact",function(){t.closeClipboardImage()})},render:function(){var t=this,e=arguments[0],n=[],i=[];return this.proxyTools.forEach(function(a){var s=a.name,r=a.title,o=a.render,c=a.click,d=a.isRight;c=c||new Function;var l,u=["lemon-editor__tool-item",{"lemon-editor__tool-item--right":d}];l="emoji"==s?0==Ht.length?"":e("lemon-popover",{class:"lemon-editor__emoji"},[e("template",{slot:"content"},[t._renderEmojiTabs()]),e("div",{class:u,attrs:{title:r}},[o()])]):e("div",{class:u,on:{click:c},attrs:{title:r}},[o()]),d?i.push(l):n.push(l)}),e("div",{class:"lemon-editor"},[this.clipboardUrl&&e("div",{class:"lemon-editor__clipboard-image"},[e("img",{attrs:{src:this.clipboardUrl}}),e("div",[e("lemon-button",{style:{marginRight:"10px"},on:{click:this.closeClipboardImage},attrs:{color:"grey"}},["取消"]),e("lemon-button",{on:{click:this.sendClipboardImage}},["发送图片"])])]),e("input",{style:"display:none",attrs:{type:"file",multiple:"multiple",accept:this.accept},ref:"fileInput",on:{change:this._handleChangeFile}}),e("div",{class:"lemon-editor__tool"},[e("div",{class:"lemon-editor__tool-left"},[n]),e("div",{class:"lemon-editor__tool-right"},[i])]),e("div",{class:"lemon-editor__inner"},[e("div",{class:"lemon-editor__input",ref:"textarea",attrs:{contenteditable:"true",spellcheck:"false"},on:{keyup:this._handleKeyup,keydown:this._handleKeydown,paste:this._handlePaste,click:this._handleClick}})]),e("div",{class:"lemon-editor__footer"},[e("div",{class:"lemon-editor__tip"},[_t(this.IMUI.$scopedSlots["editor-footer"],"使用 ctrl + enter 快捷发送消息")]),e("div",{class:"lemon-editor__submit"},[e("lemon-button",{attrs:{disabled:this.submitDisabled},on:{click:this._handleSend}},[this.sendText])])])])},methods:{closeClipboardImage:function(){this.clipboardUrl="",this.clipboardBlob=null},sendClipboardImage:function(){this.clipboardBlob&&(this.$emit("upload",this.clipboardBlob),this.closeClipboardImage())},initTools:function(t){var e=this,n=this.$createElement;if(t){var i=[{name:"emoji",title:"表情",click:null,render:function(t){return n("i",{class:"lemon-icon-emoji"})}},{name:"uploadFile",title:"文件上传",click:function(){return e.selectFile("*")},render:function(t){return n("i",{class:"lemon-icon-folder"})}},{name:"uploadImage",title:"图片上传",click:function(){return e.selectFile("image/*")},render:function(t){return n("i",{class:"lemon-icon-image"})}}],a=[];if(Array.isArray(t)){var s={emoji:0,uploadFile:1,uploadImage:2},r=Object.keys(s);a=t.map(function(t){return r.includes(t.name)?Dt({},i[s[t.name]],{},t):t})}else a=i;this.proxyTools=a}},_saveLastRange:function(){Pt=zt.getRangeAt(0)},_focusLastRange:function(){this.$refs.textarea.focus(),Pt&&(zt.removeAllRanges(),zt.addRange(Pt))},_handleClick:function(){this._saveLastRange()},_renderEmojiTabs:function(){var t=this,e=this.$createElement,n=function(n){return n.map(function(n){return e("img",{attrs:{src:n.src,title:n.title},class:"lemon-editor__emoji-item",on:{click:function(){return t._handleSelectEmoji(n)}}})})};if(Ht[0].label){var i=Ht.map(function(t,i){return e("div",{slot:"tab-pane",attrs:{index:i,tab:t.label}},[n(t.children)])});return e("lemon-tabs",{style:"width: 412px"},[i])}return e("div",{class:"lemon-tabs-content",style:"width:406px"},[n(Ht)])},_handleSelectEmoji:function(t){this._focusLastRange(),At('
')),this._checkSubmitDisabled(),this._saveLastRange()},selectFile:function(){var t=Object(L["a"])(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.accept=e,t.next=3,this.$nextTick();case 3:this.$refs.fileInput.click();case 4:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),_handlePaste:function(t){t.preventDefault();var e=t.clipboardData||window.clipboardData,n=e.getData("Text");if(n)window.clipboardData?this.$refs.textarea.innerHTML=n:At(n,"insertText");else{var i=this._getClipboardBlob(e),a=i.blob,s=i.blobUrl;this.clipboardBlob=a,this.clipboardUrl=s}},_getClipboardBlob:function(t){for(var e,n,i=0;it.msecRange&&s.push(e("lemon-message-event",o()([{},{attrs:{message:{id:"__time__",type:"event",content:xt(n.sendTime)}}}]))),a="event"==n.type?{message:n}:{timeFormat:t.timeFormat,message:n,reverse:t.reverseUserId==n.fromUser.id,hideTime:t.hideTime,hideName:t.hideName},s.push(e(r,o()([{ref:"message",refInFor:!0},{attrs:a}]))),s})])},computed:{msecRange:function(){return 1e3*this.timeRange*60}},watch:{},methods:{_renderLoading:function(){var t=this.$createElement;return t("i",{class:"lemon-icon-loading lemonani-spin"})},_renderLoadEnd:function(){var t=this.$createElement;return t("span",["暂无更多消息"])},loaded:function(){this._loadend=!0,this.$forceUpdate()},resetLoadState:function(){this._loading=!1,this._loadend=!1},_handleScroll:function(){var t=Object(L["a"])(regeneratorRuntime.mark(function t(e){var n,i,a=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.target,X.hide(),0!=n.scrollTop||0!=this._loading||0!=this._loadend){t.next=8;break}return this._loading=!0,t.next=6,this.$nextTick();case 6:i=n.scrollHeight,this.$emit("reach-top",function(){var t=Object(L["a"])(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,a.$nextTick();case 2:n.scrollTop=n.scrollHeight-i,a._loading=!1,a._loadend=!!e;case 5:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}());case 8:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),scrollToBottom:function(){var t=Object(L["a"])(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$nextTick();case 2:e=this.$refs.wrap,e&&(e.scrollTop=e.scrollHeight);case 4:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()},created:function(){},mounted:function(){}},Qt=Yt,Gt=(n("436f"),Object(v["a"])(Qt,Nt,Rt,!1,null,null,null)),Zt=Gt.exports,Xt={name:"lemonMessageBasic",inject:{IMUI:{from:"IMUI",default:function(){return this}}},props:{contextmenu:Array,message:{type:Object,default:function(){return{}}},timeFormat:{type:Function,default:function(){return""}},reverse:Boolean,hideName:Boolean,hideTime:Boolean},data:function(){return{}},render:function(){var t=this,e=arguments[0],n=this.message,i=n.fromUser,a=n.status,s=n.sendTime;return e("div",{class:["lemon-message","lemon-message--status-".concat(a),{"lemon-message--reverse":this.reverse,"lemon-message--hide-name":this.hideName}]},[e("div",{class:"lemon-message__avatar"},[e("lemon-avatar",{attrs:{size:36,shape:"square",src:i.avatar},on:{click:function(e){t._emitClick(e,"avatar")}}})]),e("div",{class:"lemon-message__inner"},[e("div",{class:"lemon-message__title"},[e("span",{on:{click:function(e){t._emitClick(e,"displayName")}}},[i.displayName]),1==this.hideTime&&e("span",{class:"lemon-message__time",on:{click:function(e){t._emitClick(e,"sendTime")}}},[this.timeFormat(s)])]),e("div",{class:"lemon-message__content-flex"},[e("div",{directives:[{name:"lemon-contextmenu",value:this.IMUI.contextmenu,modifiers:{message:!0}}],class:"lemon-message__content",on:{click:function(e){t._emitClick(e,"content")}}},[_t(this.$scopedSlots["content"],null,this.message)]),e("div",{class:"lemon-message__content-after"},[_t(this.IMUI.$scopedSlots["message-after"],null,this.message)]),e("div",{class:"lemon-message__status",on:{click:function(e){t._emitClick(e,"status")}}},[e("i",{class:"lemon-icon-loading lemonani-spin"}),e("i",{class:"lemon-icon-prompt",attrs:{title:"重发消息"},style:{color:"#ff2525",cursor:"pointer"}})])])])])},created:function(){},mounted:function(){},computed:{},watch:{},methods:{_emitClick:function(t,e){this.IMUI.$emit("message-click",t,e,this.message,this.IMUI)}}},te=Xt,ee=(n("fbd1"),Object(v["a"])(te,Bt,Vt,!1,null,null,null)),ne=ee.exports;function ie(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function ae(t){for(var e=1;e1&&void 0!==arguments[1]&&arguments[1];if(void 0===qe[t.toContactId])this.updateContact({id:t.toContactId,unread:"+1",lastSendTime:t.sendTime,lastContent:this.lastContentRender(t)});else{this._addMessage(t,t.toContactId,1);var n={id:t.toContactId,lastContent:this.lastContentRender(t),lastSendTime:t.sendTime};t.toContactId==this.currentContactId?(1==e&&this.messageViewToBottom(),this.CacheDraft.remove(t.toContactId)):n.unread="+1",this.updateContact(n)}},_emitSend:function(t,e,n){var i=this;this.$emit("send",t,function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{status:"succeed"};e(),i.updateMessage(Object.assign(t,n))},n)},_handleSend:function(t){var e=this,n=this._createMessage({content:t});this.appendMessage(n,!0),this._emitSend(n,function(){e.updateContact({id:n.toContactId,lastContent:e.lastContentRender(n),lastSendTime:n.sendTime}),e.CacheDraft.remove(n.toContactId)})},_handleUpload:function(t){var e,n=this,i=["image/gif","image/jpeg","image/png"];e=i.includes(t.type)?{type:"image",content:URL.createObjectURL(t)}:{type:"file",fileSize:t.size,fileName:t.name,content:""};var a=this._createMessage(e);this.appendMessage(a,!0),this._emitSend(a,function(){n.updateContact({id:a.toContactId,lastContent:n.lastContentRender(a),lastSendTime:a.sendTime})},t)},_emitPullMessages:function(t){var e=this;this._changeContactLock=!0,this.$emit("pull-messages",this.currentContact,function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e._addMessage(n,e.currentContactId,0),e.CacheMessageLoaded.set(e.currentContactId,i),1==i&&e.$refs.messages.loaded(),e.updateCurrentMessages(),e._changeContactLock=!1,t(i)},this)},clearCacheContainer:function(t){this.CacheContactContainer.remove(t),this.CacheMenuContainer.remove(t)},_renderWrapper:function(t){var e=this.$createElement;return e("div",{style:{width:this.width,height:this.height},class:["lemon-wrapper","lemon-wrapper--theme-".concat(this.theme),{"lemon-wrapper--simple":this.simple},this.drawerVisible&&"lemon-wrapper--drawer-show"]},[t])},_renderMenu:function(){var t=this,e=this.$createElement,n=this._renderMenuItem();return e("div",{class:"lemon-menu",directives:[{name:"show",value:!this.hideMenu}]},[e("lemon-avatar",{directives:[{name:"show",value:!this.hideMenuAvatar}],on:{click:function(e){t.$emit("menu-avatar-click",e)}},class:"lemon-menu__avatar",attrs:{src:this.user.avatar}}),n.top,this.$slots.menu,e("div",{class:"lemon-menu__bottom"},[this.$slots["menu-bottom"],n.bottom])])},_renderMenuAvatar:function(){},_renderMenuItem:function(){var t=this,e=this.$createElement,n=[],i=[];return this.menus.forEach(function(a){var s=a.name,r=a.title,o=a.unread,c=a.render,d=a.click,l=e("div",{class:["lemon-menu__item",{"lemon-menu__item--active":t.activeSidebar==s}],on:{click:function(){Ct(d,function(){s&&t.changeMenu(s)})}},attrs:{title:r}},[e("lemon-badge",{attrs:{count:o}},[c(a)])]);!0===a.isBottom?i.push(l):n.push(l)}),{top:n,bottom:i}},_renderSidebarMessage:function(){var t=this;return this._renderSidebar([_t(this.$scopedSlots["sidebar-message-top"],null,this),this.lastMessages.map(function(e){return t._renderContact({contact:e,timeFormat:t.contactTimeFormat},function(){return t.changeContact(e.id)},t.$scopedSlots["sidebar-message"])})],De,_t(this.$scopedSlots["sidebar-message-fixedtop"],null,this))},_renderContact:function(t,e,n){var i=this,a=this.$createElement,s=t.contact,r=s.click,c=s.renderContainer,d=s.id,l=function(){Ct(r,function(){e(),i._customContainerReady(c,i.CacheContactContainer,d)})};return a("lemon-contact",o()([{class:{"lemon-contact--active":this.currentContactId==t.contact.id},directives:[{name:"lemon-contextmenu",value:this.contactContextmenu,modifiers:{contact:!0}}]},{props:t},{on:{click:l},scopedSlots:{default:n}}]))},_renderSidebarContact:function(){var t,e=this,n=this.$createElement;return this._renderSidebar([_t(this.$scopedSlots["sidebar-contact-top"],null,this),this.contacts.map(function(i){if(i.index){i.index=i.index.replace(/\[[0-9]*\]/,"");var a=[i.index!==t&&n("p",{class:"lemon-sidebar__label"},[i.index]),e._renderContact({contact:i,simple:!0},function(){e.changeContact(i.id)},e.$scopedSlots["sidebar-contact"])];return t=i.index,a}})],Pe,_t(this.$scopedSlots["sidebar-contact-fixedtop"],null,this))},_renderSidebar:function(t,e,n){var i=this.$createElement;return i("div",{class:"lemon-sidebar",directives:[{name:"show",value:this.activeSidebar==e}],on:{scroll:this._handleSidebarScroll}},[i("div",{class:"lemon-sidebar__fixed-top"},[n]),i("div",{class:"lemon-sidebar__scroll"},[t])])},_renderDrawer:function(){var t=this.$createElement;return this._menuIsMessages()&&this.currentContactId?t("div",{class:"lemon-drawer"},[We(),_t(this.$scopedSlots.drawer,"",this.currentContact)]):""},_isContactContainerCache:function(t){return t.startsWith("contact#")},_renderContainer:function(){var t=this,e=this.$createElement,n=[],i="lemon-container",a=this.currentContact,s=!0;for(var r in this.CacheContactContainer.get()){var o=a.id==r&&this.currentIsDefSidebar;s=!o,n.push(e("div",{class:i,directives:[{name:"show",value:o}]},[this.CacheContactContainer.get(r)]))}for(var c in this.CacheMenuContainer.get())n.push(e("div",{class:i,directives:[{name:"show",value:this.activeSidebar==c&&!this.currentIsDefSidebar}]},[this.CacheMenuContainer.get(c)]));return n.push(e("div",{class:i,directives:[{name:"show",value:this._menuIsMessages()&&s&&a.id}]},[e("div",{class:"lemon-container__title"},[e("div",{class:"lemon-container__displayname"},[_t(this.$scopedSlots["message-title"],a.displayName,a)])]),e("lemon-messages",{ref:"messages",attrs:{"hide-time":this.hideMessageTime,"hide-name":this.hideMessageName,"time-format":this.messageTimeFormat,"reverse-user-id":this.user.id,messages:this.currentMessages},on:{"reach-top":this._emitPullMessages}}),e("lemon-editor",{ref:"editor",attrs:{tools:this.editorTools,sendText:this.sendText,sendKey:this.sendKey},on:{send:this._handleSend,upload:this._handleUpload}})])),n.push(e("div",{class:i,directives:[{name:"show",value:!a.id&&this.currentIsDefSidebar}]},[this.$slots.cover])),n.push(e("div",{class:i,directives:[{name:"show",value:this._menuIsContacts()&&s&&a.id}]},[_t(this.$scopedSlots["contact-info"],e("div",{class:"lemon-contact-info"},[e("lemon-avatar",{attrs:{src:a.avatar,size:90}}),e("h4",[a.displayName]),e("lemon-button",{on:{click:function(){V(a.lastContent)&&t.updateContact({id:a.id,lastContent:" "}),t.changeContact(a.id,De)}}},["发送消息"])]),a)])),n},_handleSidebarScroll:function(){X.hide()},_addContact:function(t,e){var n={0:"unshift",1:"push"}[e];this.contacts[n](t)},_addMessage:function(t,e,n){var i,a={0:"unshift",1:"push"}[n];Array.isArray(t)||(t=[t]),qe[e]=qe[e]||[],(i=qe[e])[a].apply(i,Object(Ue["a"])(t))},setLastContentRender:function(t,e){Le[t]=e},lastContentRender:function(t){return A(Le[t.type])?Le[t.type].call(this,t):(console.error("not found '".concat(t.type,"' of the latest message renderer,try to use ‘setLastContentRender()’")),"")},emojiNameToImage:function(t){return t.replace(/\[!(\w+)\]/gi,function(t,e){var n=e;return Ke[n]?'
'):"[!".concat(e,"]")})},emojiImageToName:function(t){return t.replace(/
]*>/gi,"[!$1]")},updateCurrentMessages:function(){qe[this.currentContactId]||(qe[this.currentContactId]=[]),this.currentMessages=qe[this.currentContactId]},messageViewToBottom:function(){this.$refs.messages.scrollToBottom()},changeContact:function(){var t=Object(L["a"])(regeneratorRuntime.mark(function t(e,n){var i,a,s,r,c=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(i=this.$createElement,!n){t.next=5;break}this.changeMenu(n),t.next=7;break;case 5:if(!this._changeContactLock&&this.currentContactId!=e){t.next=7;break}return t.abrupt("return",!1);case 7:if(a=this.currentContactId,a&&(s=this.getEditorValue(),s&&(this.CacheDraft.set(a,s),this.updateContact({id:a,lastContent:[i("span",{style:"color:red;"},["[草稿]"]),i("span",o()([{},{domProps:{innerHTML:this.lastContentRender({type:"text",content:s})}}]))]}),this.setEditorValue(""))),this.currentContactId=e,this.currentContactId){t.next=12;break}return t.abrupt("return",!1);case 12:if(this.$emit("change-contact",this.currentContact,this),!A(this.currentContact.renderContainer)){t.next=15;break}return t.abrupt("return");case 15:r=this.CacheDraft.get(e)||"",r&&this.setEditorValue(r),this.CacheMessageLoaded.has(e)?this.$refs.messages.loaded():this.$refs.messages.resetLoadState(),qe[e]?setTimeout(function(){c.updateCurrentMessages(),c.messageViewToBottom()},0):(this.updateCurrentMessages(),this._emitPullMessages(function(t){return c.messageViewToBottom()}));case 19:case"end":return t.stop()}},t,this)}));function e(e,n){return t.apply(this,arguments)}return e}(),removeMessage:function(t){var e=this.findMessage(t);if(!e)return!1;var n=qe[e.toContactId].findIndex(function(e){var n=e.id;return n==t});return qe[e.toContactId].splice(n,1),!0},updateMessage:function(t){if(!t.id)return!1;var e=this.findMessage(t.id);return!!e&&(e=Object.assign(e,t,{toContactId:e.toContactId}),!0)},forceUpdateMessage:function(t){if(t){var e=this.$refs.messages.$refs.message;if(e){var n=e.find(function(e){return e.$attrs.message.id==t});n&&n.$forceUpdate()}}else this.$refs.messages.$forceUpdate()},_customContainerReady:function(t,e,n){A(t)&&!e.has(n)&&e.set(n,t.call(this))},changeMenu:function(t){if(this._changeContactLock)return!1;this.$emit("change-menu",t),this.activeSidebar=t},initEmoji:function(t){var e=[];this.$refs.editor.initEmoji(t),t[0].label?t.forEach(function(t){var n;(n=e).push.apply(n,Object(Ue["a"])(t.children))}):e=t,e.forEach(function(t){var e=t.name,n=t.src;return Ke[e]=n})},initEditorTools:function(t){this.editorTools=t,this.$refs.editor.initTools(t)},initMenus:function(t){var e=this,n=this.$createElement,i=[{name:De,title:"聊天",unread:0,click:null,render:function(t){return n("i",{class:"lemon-icon-message"})},isBottom:!1},{name:Pe,title:"通讯录",unread:0,click:null,render:function(t){return n("i",{class:"lemon-icon-addressbook"})},isBottom:!1}],a=[];if(Array.isArray(t)){var s={messages:0,contacts:1},r=Object.keys(s);a=t.map(function(t){return r.includes(t.name)?Ae({},i[s[t.name]],{},t,{},{renderContainer:null}):(t.renderContainer&&e._customContainerReady(t.renderContainer,e.CacheMenuContainer,t.name),t)})}else a=i;this.menus=a},initContacts:function(t){this.contacts=t,this.sortContacts()},sortContacts:function(){this.contacts.sort(function(t,e){if(t.index)return t.index.localeCompare(e.index)})},appendContact:function(t){return V(t.id)||V(t.displayName)?(console.error("id | displayName cant be empty"),!1):!!this.hasContact(t.id)||(this.contacts.push(Object.assign(Object(c["a"])({id:"",displayName:"",avatar:"",index:"",unread:0,lastSendTime:""},"lastSendTime",""),t)),!0)},removeContact:function(t){var e=this.findContactIndexById(t);return-1!==e&&(this.contacts.splice(e,1),this.CacheDraft.remove(t),this.CacheMessageLoaded.remove(t),!0)},updateContact:function(t){var e=t.id;delete t.id;var n=this.findContactIndexById(e);if(-1!==n){var i=t.unread;R(i)&&(0!==i.indexOf("+")&&0!==i.indexOf("-")||(t.unread=parseInt(i)+parseInt(this.contacts[n].unread))),this.$set(this.contacts,n,Ae({},this.contacts[n],{},t))}},findContactIndexById:function(t){return this.contacts.findIndex(function(e){return e.id==t})},hasContact:function(t){return-1!==this.findContactIndexById(t)},findMessage:function(t){for(var e in qe){var n=qe[e].find(function(e){var n=e.id;return n==t});if(n)return n}},findContact:function(t){return this.getContacts().find(function(e){var n=e.id;return n==t})},getContacts:function(){return this.contacts},getCurrentContact:function(){return this.currentContact},getCurrentMessages:function(){return this.currentMessages},setEditorValue:function(t){this.$refs.editor.setValue(this.emojiNameToImage(t))},getEditorValue:function(){return this.$refs.editor.getFormatValue()},getMessages:function(t){return(t?qe[t]:qe)||[]},changeDrawer:function(t){this.drawerVisible=!this.drawerVisible,1==this.drawerVisible&&this.openDrawer(t)},openDrawer:function(t){We=t||new Function,this.drawerVisible=!0},closeDrawer:function(){this.drawerVisible=!1}}},Ye=Je,Qe=(n("9b01"),Object(v["a"])(Ye,ze,He,!1,null,null,null)),Ge=Qe.exports;n("6a2b");i["a"].directive("LemonContextmenu",X);var Ze="1.4.2",Xe=[Ge,Et,Zt,Jt,gt,ht,dt,st,F,ne,le,_e,Se,Ee],tn=function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Xe.forEach(function(e){t.component(e.name,e)})};"undefined"!==typeof window&&window.Vue&&tn(window.Vue);var en={version:Ze,install:tn};i["a"].use(en),i["a"].config.productionTip=!1,new i["a"]({render:function(t){return t(E)}}).$mount("#app")},cfab:function(t,e,n){"use strict";var i=n("15cf"),a=n.n(i);a.a},dbdc:function(t,e,n){"use strict";var i=n("7802"),a=n.n(i);a.a},e86c:function(t,e,n){},ed4b:function(t,e,n){"use strict";var i=n("a215"),a=n.n(i);a.a},fbd1:function(t,e,n){"use strict";var i=n("820e"),a=n.n(i);a.a}});
\ No newline at end of file
diff --git a/package.json b/package.json
index e5fce13..6409bc3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "lemon-imui",
- "version": "1.5.0",
+ "version": "1.6.0",
"main": "dist/index.umd.min.js",
"description": "基于 VUE2.0 的 IM 聊天组件",
"homepage": "https://github.com/fanjyy/lemon-imui",
diff --git a/packages/components/avatar.vue b/packages/components/avatar.vue
index cb25f84..aa087a0 100644
--- a/packages/components/avatar.vue
+++ b/packages/components/avatar.vue
@@ -1,12 +1,19 @@