react-input-emoji 5.5.1 → 5.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.es.js +653 -1166
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +653 -1166
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13,15 +13,12 @@ var t__default = /*#__PURE__*/_interopDefaultLegacy(t);
|
|
|
13
13
|
function styleInject(css, ref) {
|
|
14
14
|
if (ref === void 0) ref = {};
|
|
15
15
|
var insertAt = ref.insertAt;
|
|
16
|
-
|
|
17
16
|
if (!css || typeof document === 'undefined') {
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
var head = document.head || document.getElementsByTagName('head')[0];
|
|
22
20
|
var style = document.createElement('style');
|
|
23
21
|
style.type = 'text/css';
|
|
24
|
-
|
|
25
22
|
if (insertAt === 'top') {
|
|
26
23
|
if (head.firstChild) {
|
|
27
24
|
head.insertBefore(style, head.firstChild);
|
|
@@ -31,7 +28,6 @@ function styleInject(css, ref) {
|
|
|
31
28
|
} else {
|
|
32
29
|
head.appendChild(style);
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
if (style.styleSheet) {
|
|
36
32
|
style.styleSheet.cssText = css;
|
|
37
33
|
} else {
|
|
@@ -42,377 +38,355 @@ function styleInject(css, ref) {
|
|
|
42
38
|
var css_248z = ".react-input-emoji--container {\n color: #4b4b4b;\n text-rendering: optimizeLegibility;\n background-color: #fff;\n border: 1px solid #fff;\n border-radius: 21px;\n margin: 5px 10px;\n box-sizing: border-box;\n flex: 1 1 auto;\n font-size: 15px;\n font-family: sans-serif;\n font-weight: 400;\n line-height: 20px;\n min-height: 20px;\n min-width: 0;\n outline: none;\n width: inherit;\n will-change: width;\n vertical-align: baseline;\n border: 1px solid #eaeaea;\n margin-right: 0;\n}\n\n.react-input-emoji--wrapper {\n display: flex;\n overflow: hidden;\n flex: 1;\n position: relative;\n padding-right: 0;\n vertical-align: baseline;\n outline: none;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n.react-input-emoji--input {\n font-weight: 400;\n max-height: 100px;\n min-height: 20px;\n outline: none;\n overflow-x: hidden;\n overflow-y: auto;\n position: relative;\n white-space: pre-wrap;\n word-wrap: break-word;\n z-index: 1;\n width: 100%;\n user-select: text;\n padding: 9px 12px 11px;\n text-align: left;\n}\n\n.react-input-emoji--input img {\n vertical-align: middle;\n width: 18px !important;\n height: 18px !important;\n display: inline !important;\n margin-left: 1px;\n margin-right: 1px;\n}\n\n.react-input-emoji--overlay {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 9;\n}\n\n.react-input-emoji--placeholder {\n color: #a0a0a0;\n pointer-events: none;\n position: absolute;\n user-select: none;\n z-index: 2;\n left: 16px;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n width: calc(100% - 22px);\n}\n\n.react-input-emoji--button {\n position: relative;\n display: block;\n text-align: center;\n padding: 0 10px;\n overflow: hidden;\n transition: color 0.1s ease-out;\n margin: 0;\n box-shadow: none;\n background: none;\n border: none;\n outline: none;\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.react-input-emoji--button svg {\n fill: #858585;\n}\n\n.react-input-emoji--button__show svg {\n fill: #128b7e;\n}\n\n.react-emoji {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n}\n\n.react-emoji-picker--container {\n position: absolute;\n top: 0;\n width: 100%;\n}\n\n.react-emoji-picker--wrapper {\n position: absolute;\n bottom: 0;\n right: 0;\n height: 435px;\n width: 352px;\n overflow: hidden;\n z-index: 10;\n}\n\n.react-emoji-picker {\n position: absolute;\n top: 0;\n left: 0;\n animation: slidein 0.1s ease-in-out;\n}\n\n.react-emoji-picker__show {\n top: 0;\n}\n\n.react-input-emoji--mention--container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 10;\n}\n\n.react-input-emoji--mention--list {\n background-color: #fafafa;\n border: 1px solid #eaeaea;\n border-radius: 4px;\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n gap: 5px;\n flex-direction: column;\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n}\n\n.react-input-emoji--mention--item {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 5px 10px;\n background-color: transparent;\n width: 100%;\n margin: 0;\n border: 0;\n}\n\n.react-input-emoji--mention--item__selected {\n background-color: #eeeeee;\n}\n\n.react-input-emoji--mention--item--img {\n width: 34px;\n height: 34px;\n border-radius: 50%;\n}\n\n.react-input-emoji--mention--item--name {\n font-size: 16px;\n color: #333;\n}\n\n.react-input-emoji--mention--item--name__selected {\n color: green;\n}\n\n.react-input-emoji--mention--text {\n color: #039be5;\n}\n\n.react-input-emoji--mention--loading {\n background-color: #fafafa;\n border: 1px solid #eaeaea;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 10px 0;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n}\n\n.react-input-emoji--mention--loading--spinner,\n.react-input-emoji--mention--loading--spinner::after {\n border-radius: 50%;\n width: 10em;\n height: 10em;\n}\n\n.react-input-emoji--mention--loading--spinner {\n margin: 1px auto;\n font-size: 2px;\n position: relative;\n text-indent: -9999em;\n border-top: 1.1em solid rgba(0, 0, 0, 0.1);\n border-right: 1.1em solid rgba(0, 0, 0, 0.1);\n border-bottom: 1.1em solid rgba(0, 0, 0, 0.1);\n border-left: 1.1em solid rgba(0, 0, 0, 0.4);\n transform: translateZ(0);\n animation: load8 1.1s infinite linear;\n}\n\n@keyframes load8 {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes slidein {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n";
|
|
43
39
|
styleInject(css_248z);
|
|
44
40
|
|
|
45
|
-
function
|
|
46
|
-
var
|
|
47
|
-
|
|
41
|
+
function _iterableToArrayLimit(r, l) {
|
|
42
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
43
|
+
if (null != t) {
|
|
44
|
+
var e,
|
|
45
|
+
n,
|
|
46
|
+
i,
|
|
47
|
+
u,
|
|
48
|
+
a = [],
|
|
49
|
+
f = !0,
|
|
50
|
+
o = !1;
|
|
51
|
+
try {
|
|
52
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
53
|
+
if (Object(t) !== t) return;
|
|
54
|
+
f = !1;
|
|
55
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
56
|
+
} catch (r) {
|
|
57
|
+
o = !0, n = r;
|
|
58
|
+
} finally {
|
|
59
|
+
try {
|
|
60
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
61
|
+
} finally {
|
|
62
|
+
if (o) throw n;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return a;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function ownKeys(e, r) {
|
|
69
|
+
var t = Object.keys(e);
|
|
48
70
|
if (Object.getOwnPropertySymbols) {
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
return Object.getOwnPropertyDescriptor(
|
|
52
|
-
})),
|
|
71
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
72
|
+
r && (o = o.filter(function (r) {
|
|
73
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
74
|
+
})), t.push.apply(t, o);
|
|
53
75
|
}
|
|
54
|
-
|
|
55
|
-
return keys;
|
|
76
|
+
return t;
|
|
56
77
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
78
|
+
function _objectSpread2(e) {
|
|
79
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
80
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
81
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
82
|
+
_defineProperty(e, r, t[r]);
|
|
83
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
84
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
65
85
|
});
|
|
66
86
|
}
|
|
67
|
-
|
|
68
|
-
return target;
|
|
87
|
+
return e;
|
|
69
88
|
}
|
|
70
|
-
|
|
71
89
|
function _regeneratorRuntime() {
|
|
72
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
73
|
-
|
|
74
90
|
_regeneratorRuntime = function () {
|
|
75
|
-
return
|
|
91
|
+
return e;
|
|
76
92
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
var t,
|
|
94
|
+
e = {},
|
|
95
|
+
r = Object.prototype,
|
|
96
|
+
n = r.hasOwnProperty,
|
|
97
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
98
|
+
t[e] = r.value;
|
|
99
|
+
},
|
|
100
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
101
|
+
a = i.iterator || "@@iterator",
|
|
102
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
103
|
+
u = i.toStringTag || "@@toStringTag";
|
|
104
|
+
function define(t, e, r) {
|
|
105
|
+
return Object.defineProperty(t, e, {
|
|
106
|
+
value: r,
|
|
89
107
|
enumerable: !0,
|
|
90
108
|
configurable: !0,
|
|
91
109
|
writable: !0
|
|
92
|
-
}),
|
|
110
|
+
}), t[e];
|
|
93
111
|
}
|
|
94
|
-
|
|
95
112
|
try {
|
|
96
113
|
define({}, "");
|
|
97
|
-
} catch (
|
|
98
|
-
define = function (
|
|
99
|
-
return
|
|
114
|
+
} catch (t) {
|
|
115
|
+
define = function (t, e, r) {
|
|
116
|
+
return t[e] = r;
|
|
100
117
|
};
|
|
101
118
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return function (method, arg) {
|
|
110
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
111
|
-
|
|
112
|
-
if ("completed" === state) {
|
|
113
|
-
if ("throw" === method) throw arg;
|
|
114
|
-
return doneResult();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
for (context.method = method, context.arg = arg;;) {
|
|
118
|
-
var delegate = context.delegate;
|
|
119
|
-
|
|
120
|
-
if (delegate) {
|
|
121
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
122
|
-
|
|
123
|
-
if (delegateResult) {
|
|
124
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
125
|
-
return delegateResult;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
130
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
131
|
-
context.dispatchException(context.arg);
|
|
132
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
133
|
-
state = "executing";
|
|
134
|
-
var record = tryCatch(innerFn, self, context);
|
|
135
|
-
|
|
136
|
-
if ("normal" === record.type) {
|
|
137
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
138
|
-
return {
|
|
139
|
-
value: record.arg,
|
|
140
|
-
done: context.done
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
}(innerFn, self, context), generator;
|
|
119
|
+
function wrap(t, e, r, n) {
|
|
120
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
121
|
+
a = Object.create(i.prototype),
|
|
122
|
+
c = new Context(n || []);
|
|
123
|
+
return o(a, "_invoke", {
|
|
124
|
+
value: makeInvokeMethod(t, r, c)
|
|
125
|
+
}), a;
|
|
148
126
|
}
|
|
149
|
-
|
|
150
|
-
function tryCatch(fn, obj, arg) {
|
|
127
|
+
function tryCatch(t, e, r) {
|
|
151
128
|
try {
|
|
152
129
|
return {
|
|
153
130
|
type: "normal",
|
|
154
|
-
arg:
|
|
131
|
+
arg: t.call(e, r)
|
|
155
132
|
};
|
|
156
|
-
} catch (
|
|
133
|
+
} catch (t) {
|
|
157
134
|
return {
|
|
158
135
|
type: "throw",
|
|
159
|
-
arg:
|
|
136
|
+
arg: t
|
|
160
137
|
};
|
|
161
138
|
}
|
|
162
139
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
140
|
+
e.wrap = wrap;
|
|
141
|
+
var h = "suspendedStart",
|
|
142
|
+
l = "suspendedYield",
|
|
143
|
+
f = "executing",
|
|
144
|
+
s = "completed",
|
|
145
|
+
y = {};
|
|
167
146
|
function Generator() {}
|
|
168
|
-
|
|
169
147
|
function GeneratorFunction() {}
|
|
170
|
-
|
|
171
148
|
function GeneratorFunctionPrototype() {}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
149
|
+
var p = {};
|
|
150
|
+
define(p, a, function () {
|
|
175
151
|
return this;
|
|
176
152
|
});
|
|
177
|
-
var
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
var
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return this._invoke(method, arg);
|
|
153
|
+
var d = Object.getPrototypeOf,
|
|
154
|
+
v = d && d(d(values([])));
|
|
155
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
156
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
157
|
+
function defineIteratorMethods(t) {
|
|
158
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
159
|
+
define(t, e, function (t) {
|
|
160
|
+
return this._invoke(e, t);
|
|
186
161
|
});
|
|
187
162
|
});
|
|
188
163
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
invoke("
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
}, function (error) {
|
|
204
|
-
return invoke("throw", error, resolve, reject);
|
|
164
|
+
function AsyncIterator(t, e) {
|
|
165
|
+
function invoke(r, o, i, a) {
|
|
166
|
+
var c = tryCatch(t[r], t, o);
|
|
167
|
+
if ("throw" !== c.type) {
|
|
168
|
+
var u = c.arg,
|
|
169
|
+
h = u.value;
|
|
170
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
171
|
+
invoke("next", t, i, a);
|
|
172
|
+
}, function (t) {
|
|
173
|
+
invoke("throw", t, i, a);
|
|
174
|
+
}) : e.resolve(h).then(function (t) {
|
|
175
|
+
u.value = t, i(u);
|
|
176
|
+
}, function (t) {
|
|
177
|
+
return invoke("throw", t, i, a);
|
|
205
178
|
});
|
|
206
179
|
}
|
|
207
|
-
|
|
208
|
-
reject(record.arg);
|
|
180
|
+
a(c.arg);
|
|
209
181
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
182
|
+
var r;
|
|
183
|
+
o(this, "_invoke", {
|
|
184
|
+
value: function (t, n) {
|
|
185
|
+
function callInvokeWithMethodAndArg() {
|
|
186
|
+
return new e(function (e, r) {
|
|
187
|
+
invoke(t, n, e, r);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
218
191
|
}
|
|
219
|
-
|
|
220
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
221
|
-
};
|
|
192
|
+
});
|
|
222
193
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
194
|
+
function makeInvokeMethod(e, r, n) {
|
|
195
|
+
var o = h;
|
|
196
|
+
return function (i, a) {
|
|
197
|
+
if (o === f) throw new Error("Generator is already running");
|
|
198
|
+
if (o === s) {
|
|
199
|
+
if ("throw" === i) throw a;
|
|
200
|
+
return {
|
|
201
|
+
value: t,
|
|
202
|
+
done: !0
|
|
203
|
+
};
|
|
231
204
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
205
|
+
for (n.method = i, n.arg = a;;) {
|
|
206
|
+
var c = n.delegate;
|
|
207
|
+
if (c) {
|
|
208
|
+
var u = maybeInvokeDelegate(c, n);
|
|
209
|
+
if (u) {
|
|
210
|
+
if (u === y) continue;
|
|
211
|
+
return u;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
215
|
+
if (o === h) throw o = s, n.arg;
|
|
216
|
+
n.dispatchException(n.arg);
|
|
217
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
218
|
+
o = f;
|
|
219
|
+
var p = tryCatch(e, r, n);
|
|
220
|
+
if ("normal" === p.type) {
|
|
221
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
222
|
+
return {
|
|
223
|
+
value: p.arg,
|
|
224
|
+
done: n.done
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
240
230
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
231
|
+
function maybeInvokeDelegate(e, r) {
|
|
232
|
+
var n = r.method,
|
|
233
|
+
o = e.iterator[n];
|
|
234
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
235
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
236
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
237
|
+
var a = i.arg;
|
|
238
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
239
|
+
}
|
|
240
|
+
function pushTryEntry(t) {
|
|
241
|
+
var e = {
|
|
242
|
+
tryLoc: t[0]
|
|
245
243
|
};
|
|
246
|
-
1 in
|
|
244
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
247
245
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
246
|
+
function resetTryEntry(t) {
|
|
247
|
+
var e = t.completion || {};
|
|
248
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
252
249
|
}
|
|
253
|
-
|
|
254
|
-
function Context(tryLocsList) {
|
|
250
|
+
function Context(t) {
|
|
255
251
|
this.tryEntries = [{
|
|
256
252
|
tryLoc: "root"
|
|
257
|
-
}],
|
|
253
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
258
254
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
next =
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return next.value = undefined, next.done = !0, next;
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
return next.next = next;
|
|
255
|
+
function values(e) {
|
|
256
|
+
if (e || "" === e) {
|
|
257
|
+
var r = e[a];
|
|
258
|
+
if (r) return r.call(e);
|
|
259
|
+
if ("function" == typeof e.next) return e;
|
|
260
|
+
if (!isNaN(e.length)) {
|
|
261
|
+
var o = -1,
|
|
262
|
+
i = function next() {
|
|
263
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
264
|
+
return next.value = t, next.done = !0, next;
|
|
265
|
+
};
|
|
266
|
+
return i.next = i;
|
|
275
267
|
}
|
|
276
268
|
}
|
|
277
|
-
|
|
278
|
-
return {
|
|
279
|
-
next: doneResult
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function doneResult() {
|
|
284
|
-
return {
|
|
285
|
-
value: undefined,
|
|
286
|
-
done: !0
|
|
287
|
-
};
|
|
269
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
288
270
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
},
|
|
271
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
272
|
+
value: GeneratorFunctionPrototype,
|
|
273
|
+
configurable: !0
|
|
274
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
275
|
+
value: GeneratorFunction,
|
|
276
|
+
configurable: !0
|
|
277
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
278
|
+
var e = "function" == typeof t && t.constructor;
|
|
279
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
280
|
+
}, e.mark = function (t) {
|
|
281
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
282
|
+
}, e.awrap = function (t) {
|
|
296
283
|
return {
|
|
297
|
-
__await:
|
|
284
|
+
__await: t
|
|
298
285
|
};
|
|
299
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
286
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
300
287
|
return this;
|
|
301
|
-
}),
|
|
302
|
-
void 0 ===
|
|
303
|
-
var
|
|
304
|
-
return
|
|
305
|
-
return
|
|
288
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
289
|
+
void 0 === i && (i = Promise);
|
|
290
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
291
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
292
|
+
return t.done ? t.value : a.next();
|
|
306
293
|
});
|
|
307
|
-
}, defineIteratorMethods(
|
|
294
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
308
295
|
return this;
|
|
309
|
-
}), define(
|
|
296
|
+
}), define(g, "toString", function () {
|
|
310
297
|
return "[object Generator]";
|
|
311
|
-
}),
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
for (var
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
298
|
+
}), e.keys = function (t) {
|
|
299
|
+
var e = Object(t),
|
|
300
|
+
r = [];
|
|
301
|
+
for (var n in e) r.push(n);
|
|
302
|
+
return r.reverse(), function next() {
|
|
303
|
+
for (; r.length;) {
|
|
304
|
+
var t = r.pop();
|
|
305
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
320
306
|
}
|
|
321
|
-
|
|
322
307
|
return next.done = !0, next;
|
|
323
308
|
};
|
|
324
|
-
},
|
|
309
|
+
}, e.values = values, Context.prototype = {
|
|
325
310
|
constructor: Context,
|
|
326
|
-
reset: function (
|
|
327
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
311
|
+
reset: function (e) {
|
|
312
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
328
313
|
},
|
|
329
314
|
stop: function () {
|
|
330
315
|
this.done = !0;
|
|
331
|
-
var
|
|
332
|
-
if ("throw" ===
|
|
316
|
+
var t = this.tryEntries[0].completion;
|
|
317
|
+
if ("throw" === t.type) throw t.arg;
|
|
333
318
|
return this.rval;
|
|
334
319
|
},
|
|
335
|
-
dispatchException: function (
|
|
336
|
-
if (this.done) throw
|
|
337
|
-
var
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
320
|
+
dispatchException: function (e) {
|
|
321
|
+
if (this.done) throw e;
|
|
322
|
+
var r = this;
|
|
323
|
+
function handle(n, o) {
|
|
324
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
341
325
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if (
|
|
353
|
-
if (this.prev <
|
|
354
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
355
|
-
} else if (hasCatch) {
|
|
356
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
326
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
327
|
+
var i = this.tryEntries[o],
|
|
328
|
+
a = i.completion;
|
|
329
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
330
|
+
if (i.tryLoc <= this.prev) {
|
|
331
|
+
var c = n.call(i, "catchLoc"),
|
|
332
|
+
u = n.call(i, "finallyLoc");
|
|
333
|
+
if (c && u) {
|
|
334
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
335
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
336
|
+
} else if (c) {
|
|
337
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
357
338
|
} else {
|
|
358
|
-
if (!
|
|
359
|
-
if (this.prev <
|
|
339
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
340
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
360
341
|
}
|
|
361
342
|
}
|
|
362
343
|
}
|
|
363
344
|
},
|
|
364
|
-
abrupt: function (
|
|
365
|
-
for (var
|
|
366
|
-
var
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
var finallyEntry = entry;
|
|
345
|
+
abrupt: function (t, e) {
|
|
346
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
347
|
+
var o = this.tryEntries[r];
|
|
348
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
349
|
+
var i = o;
|
|
370
350
|
break;
|
|
371
351
|
}
|
|
372
352
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
353
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
354
|
+
var a = i ? i.completion : {};
|
|
355
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
377
356
|
},
|
|
378
|
-
complete: function (
|
|
379
|
-
if ("throw" ===
|
|
380
|
-
return "break" ===
|
|
357
|
+
complete: function (t, e) {
|
|
358
|
+
if ("throw" === t.type) throw t.arg;
|
|
359
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
381
360
|
},
|
|
382
|
-
finish: function (
|
|
383
|
-
for (var
|
|
384
|
-
var
|
|
385
|
-
if (
|
|
361
|
+
finish: function (t) {
|
|
362
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
363
|
+
var r = this.tryEntries[e];
|
|
364
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
386
365
|
}
|
|
387
366
|
},
|
|
388
|
-
catch: function (
|
|
389
|
-
for (var
|
|
390
|
-
var
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
var thrown = record.arg;
|
|
397
|
-
resetTryEntry(entry);
|
|
367
|
+
catch: function (t) {
|
|
368
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
369
|
+
var r = this.tryEntries[e];
|
|
370
|
+
if (r.tryLoc === t) {
|
|
371
|
+
var n = r.completion;
|
|
372
|
+
if ("throw" === n.type) {
|
|
373
|
+
var o = n.arg;
|
|
374
|
+
resetTryEntry(r);
|
|
398
375
|
}
|
|
399
|
-
|
|
400
|
-
return thrown;
|
|
376
|
+
return o;
|
|
401
377
|
}
|
|
402
378
|
}
|
|
403
|
-
|
|
404
379
|
throw new Error("illegal catch attempt");
|
|
405
380
|
},
|
|
406
|
-
delegateYield: function (
|
|
381
|
+
delegateYield: function (e, r, n) {
|
|
407
382
|
return this.delegate = {
|
|
408
|
-
iterator: values(
|
|
409
|
-
resultName:
|
|
410
|
-
nextLoc:
|
|
411
|
-
}, "next" === this.method && (this.arg =
|
|
383
|
+
iterator: values(e),
|
|
384
|
+
resultName: r,
|
|
385
|
+
nextLoc: n
|
|
386
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
412
387
|
}
|
|
413
|
-
},
|
|
388
|
+
}, e;
|
|
414
389
|
}
|
|
415
|
-
|
|
416
390
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
417
391
|
try {
|
|
418
392
|
var info = gen[key](arg);
|
|
@@ -421,35 +395,30 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
421
395
|
reject(error);
|
|
422
396
|
return;
|
|
423
397
|
}
|
|
424
|
-
|
|
425
398
|
if (info.done) {
|
|
426
399
|
resolve(value);
|
|
427
400
|
} else {
|
|
428
401
|
Promise.resolve(value).then(_next, _throw);
|
|
429
402
|
}
|
|
430
403
|
}
|
|
431
|
-
|
|
432
404
|
function _asyncToGenerator(fn) {
|
|
433
405
|
return function () {
|
|
434
406
|
var self = this,
|
|
435
|
-
|
|
407
|
+
args = arguments;
|
|
436
408
|
return new Promise(function (resolve, reject) {
|
|
437
409
|
var gen = fn.apply(self, args);
|
|
438
|
-
|
|
439
410
|
function _next(value) {
|
|
440
411
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
441
412
|
}
|
|
442
|
-
|
|
443
413
|
function _throw(err) {
|
|
444
414
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
445
415
|
}
|
|
446
|
-
|
|
447
416
|
_next(undefined);
|
|
448
417
|
});
|
|
449
418
|
};
|
|
450
419
|
}
|
|
451
|
-
|
|
452
420
|
function _defineProperty(obj, key, value) {
|
|
421
|
+
key = _toPropertyKey(key);
|
|
453
422
|
if (key in obj) {
|
|
454
423
|
Object.defineProperty(obj, key, {
|
|
455
424
|
value: value,
|
|
@@ -460,35 +429,26 @@ function _defineProperty(obj, key, value) {
|
|
|
460
429
|
} else {
|
|
461
430
|
obj[key] = value;
|
|
462
431
|
}
|
|
463
|
-
|
|
464
432
|
return obj;
|
|
465
433
|
}
|
|
466
|
-
|
|
467
434
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
468
435
|
if (source == null) return {};
|
|
469
436
|
var target = {};
|
|
470
437
|
var sourceKeys = Object.keys(source);
|
|
471
438
|
var key, i;
|
|
472
|
-
|
|
473
439
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
474
440
|
key = sourceKeys[i];
|
|
475
441
|
if (excluded.indexOf(key) >= 0) continue;
|
|
476
442
|
target[key] = source[key];
|
|
477
443
|
}
|
|
478
|
-
|
|
479
444
|
return target;
|
|
480
445
|
}
|
|
481
|
-
|
|
482
446
|
function _objectWithoutProperties(source, excluded) {
|
|
483
447
|
if (source == null) return {};
|
|
484
|
-
|
|
485
448
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
486
|
-
|
|
487
449
|
var key, i;
|
|
488
|
-
|
|
489
450
|
if (Object.getOwnPropertySymbols) {
|
|
490
451
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
491
|
-
|
|
492
452
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
493
453
|
key = sourceSymbolKeys[i];
|
|
494
454
|
if (excluded.indexOf(key) >= 0) continue;
|
|
@@ -496,60 +456,23 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
496
456
|
target[key] = source[key];
|
|
497
457
|
}
|
|
498
458
|
}
|
|
499
|
-
|
|
500
459
|
return target;
|
|
501
460
|
}
|
|
502
|
-
|
|
503
461
|
function _slicedToArray(arr, i) {
|
|
504
462
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
505
463
|
}
|
|
506
|
-
|
|
507
464
|
function _toConsumableArray(arr) {
|
|
508
465
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
509
466
|
}
|
|
510
|
-
|
|
511
467
|
function _arrayWithoutHoles(arr) {
|
|
512
468
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
513
469
|
}
|
|
514
|
-
|
|
515
470
|
function _arrayWithHoles(arr) {
|
|
516
471
|
if (Array.isArray(arr)) return arr;
|
|
517
472
|
}
|
|
518
|
-
|
|
519
473
|
function _iterableToArray(iter) {
|
|
520
474
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
521
475
|
}
|
|
522
|
-
|
|
523
|
-
function _iterableToArrayLimit(arr, i) {
|
|
524
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
525
|
-
|
|
526
|
-
if (_i == null) return;
|
|
527
|
-
var _arr = [];
|
|
528
|
-
var _n = true;
|
|
529
|
-
var _d = false;
|
|
530
|
-
|
|
531
|
-
var _s, _e;
|
|
532
|
-
|
|
533
|
-
try {
|
|
534
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
535
|
-
_arr.push(_s.value);
|
|
536
|
-
|
|
537
|
-
if (i && _arr.length === i) break;
|
|
538
|
-
}
|
|
539
|
-
} catch (err) {
|
|
540
|
-
_d = true;
|
|
541
|
-
_e = err;
|
|
542
|
-
} finally {
|
|
543
|
-
try {
|
|
544
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
545
|
-
} finally {
|
|
546
|
-
if (_d) throw _e;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
return _arr;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
476
|
function _unsupportedIterableToArray(o, minLen) {
|
|
554
477
|
if (!o) return;
|
|
555
478
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -558,35 +481,44 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
558
481
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
559
482
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
560
483
|
}
|
|
561
|
-
|
|
562
484
|
function _arrayLikeToArray(arr, len) {
|
|
563
485
|
if (len == null || len > arr.length) len = arr.length;
|
|
564
|
-
|
|
565
486
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
566
|
-
|
|
567
487
|
return arr2;
|
|
568
488
|
}
|
|
569
|
-
|
|
570
489
|
function _nonIterableSpread() {
|
|
571
490
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
572
491
|
}
|
|
573
|
-
|
|
574
492
|
function _nonIterableRest() {
|
|
575
493
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
576
494
|
}
|
|
495
|
+
function _toPrimitive(input, hint) {
|
|
496
|
+
if (typeof input !== "object" || input === null) return input;
|
|
497
|
+
var prim = input[Symbol.toPrimitive];
|
|
498
|
+
if (prim !== undefined) {
|
|
499
|
+
var res = prim.call(input, hint || "default");
|
|
500
|
+
if (typeof res !== "object") return res;
|
|
501
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
502
|
+
}
|
|
503
|
+
return (hint === "string" ? String : Number)(input);
|
|
504
|
+
}
|
|
505
|
+
function _toPropertyKey(arg) {
|
|
506
|
+
var key = _toPrimitive(arg, "string");
|
|
507
|
+
return typeof key === "symbol" ? key : String(key);
|
|
508
|
+
}
|
|
577
509
|
|
|
578
510
|
/* eslint-disable valid-jsdoc */
|
|
579
511
|
// @ts-check
|
|
512
|
+
|
|
580
513
|
var TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
514
|
+
|
|
581
515
|
/**
|
|
582
516
|
* Replace all text with emoji with an image html tag
|
|
583
517
|
* @param {string} text
|
|
584
518
|
* @return {string}
|
|
585
519
|
*/
|
|
586
|
-
|
|
587
520
|
function replaceAllTextEmojis(text) {
|
|
588
521
|
var allEmojis = getAllEmojisFromText(text);
|
|
589
|
-
|
|
590
522
|
if (allEmojis) {
|
|
591
523
|
allEmojis = _toConsumableArray(new Set(allEmojis)); // remove duplicates
|
|
592
524
|
|
|
@@ -594,9 +526,9 @@ function replaceAllTextEmojis(text) {
|
|
|
594
526
|
text = replaceAll(text, emoji, getInputEmojiHTML(emoji));
|
|
595
527
|
});
|
|
596
528
|
}
|
|
597
|
-
|
|
598
529
|
return text;
|
|
599
530
|
}
|
|
531
|
+
|
|
600
532
|
/**
|
|
601
533
|
* Replace all occurrencies in a string
|
|
602
534
|
* @param {string} str
|
|
@@ -604,77 +536,67 @@ function replaceAllTextEmojis(text) {
|
|
|
604
536
|
* @param {string} replace
|
|
605
537
|
* @return {string}
|
|
606
538
|
*/
|
|
607
|
-
|
|
608
539
|
function replaceAll(str, find, replace) {
|
|
609
540
|
return str.replace(new RegExp(find, "g"), replace);
|
|
610
541
|
}
|
|
542
|
+
|
|
611
543
|
/**
|
|
612
544
|
* Get all emojis from the text
|
|
613
545
|
* @param {string} text
|
|
614
546
|
* @return {string[]}
|
|
615
547
|
*/
|
|
616
|
-
|
|
617
|
-
|
|
618
548
|
function getAllEmojisFromText(text) {
|
|
619
549
|
return text.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g);
|
|
620
|
-
}
|
|
550
|
+
}
|
|
621
551
|
|
|
552
|
+
// eslint-disable-next-line valid-jsdoc
|
|
622
553
|
/**
|
|
623
554
|
*
|
|
624
555
|
* @param { import("../types/types").EmojiMartItem } emoji
|
|
625
556
|
* @return {string}
|
|
626
557
|
*/
|
|
627
|
-
|
|
628
|
-
|
|
629
558
|
function getImageEmoji(emoji) {
|
|
630
559
|
var _emojiPickerEl$shadow;
|
|
631
|
-
|
|
632
560
|
/** @type {HTMLElement | null} */
|
|
633
561
|
var emojiPickerEl = document.querySelector('em-emoji-picker');
|
|
634
|
-
|
|
635
562
|
if (!emojiPickerEl) {
|
|
636
563
|
return getInputEmojiNativeHTML(emoji["native"]);
|
|
637
564
|
}
|
|
638
|
-
/** @type {HTMLSpanElement | null=} */
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
var emojiSpanEl = emojiPickerEl === null || emojiPickerEl === void 0 ? void 0 : (_emojiPickerEl$shadow = emojiPickerEl.shadowRoot) === null || _emojiPickerEl$shadow === void 0 ? void 0 : _emojiPickerEl$shadow.querySelector("[title=\"".concat(emoji.name, "\"] > span > span"));
|
|
642
565
|
|
|
566
|
+
/** @type {HTMLSpanElement | null=} */
|
|
567
|
+
var emojiSpanEl = emojiPickerEl === null || emojiPickerEl === void 0 || (_emojiPickerEl$shadow = emojiPickerEl.shadowRoot) === null || _emojiPickerEl$shadow === void 0 ? void 0 : _emojiPickerEl$shadow.querySelector("[title=\"".concat(emoji.name, "\"] > span > span"));
|
|
643
568
|
if (!emojiSpanEl) {
|
|
644
569
|
return getInputEmojiNativeHTML(emoji["native"]);
|
|
645
570
|
}
|
|
646
|
-
|
|
647
571
|
var style = replaceAll(emojiSpanEl.style.cssText, '"', "'");
|
|
648
572
|
return getInputEmojiHTML(style, emoji["native"]);
|
|
649
|
-
}
|
|
573
|
+
}
|
|
650
574
|
|
|
575
|
+
// eslint-disable-next-line valid-jsdoc
|
|
651
576
|
/**
|
|
652
577
|
*
|
|
653
578
|
* @param {string} style
|
|
654
579
|
* @param {string} emoji
|
|
655
580
|
* @returns
|
|
656
581
|
*/
|
|
657
|
-
|
|
658
582
|
function getInputEmojiHTML(style, emoji) {
|
|
659
583
|
return "<img style=\"".concat(style, "; display: inline-block\" data-emoji=\"").concat(emoji, "\" src=\"").concat(TRANSPARENT_GIF, "\" />");
|
|
660
584
|
}
|
|
585
|
+
|
|
661
586
|
/**
|
|
662
587
|
*
|
|
663
588
|
* @param {string} emoji
|
|
664
589
|
* @returns
|
|
665
590
|
*/
|
|
666
|
-
|
|
667
|
-
|
|
668
591
|
function getInputEmojiNativeHTML(emoji) {
|
|
669
592
|
return "<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">".concat(emoji, "</span>");
|
|
670
593
|
}
|
|
594
|
+
|
|
671
595
|
/**
|
|
672
596
|
*
|
|
673
597
|
* @param {string} html
|
|
674
598
|
* @return {string}
|
|
675
599
|
*/
|
|
676
|
-
|
|
677
|
-
|
|
678
600
|
function replaceAllTextEmojiToString(html) {
|
|
679
601
|
var container = document.createElement("div");
|
|
680
602
|
container.innerHTML = html;
|
|
@@ -686,37 +608,35 @@ function replaceAllTextEmojiToString(html) {
|
|
|
686
608
|
}
|
|
687
609
|
|
|
688
610
|
// @ts-check
|
|
611
|
+
|
|
689
612
|
/**
|
|
690
613
|
*
|
|
691
614
|
* @param {string} html
|
|
692
615
|
*/
|
|
693
|
-
|
|
694
616
|
function handlePasteHtmlAtCaret(html) {
|
|
695
617
|
var sel;
|
|
696
618
|
var range;
|
|
697
|
-
|
|
698
619
|
if (window.getSelection) {
|
|
699
620
|
// IE9 and non-IE
|
|
700
621
|
sel = window.getSelection();
|
|
701
622
|
if (sel === null) return;
|
|
702
|
-
|
|
703
623
|
if (sel.getRangeAt && sel.rangeCount) {
|
|
704
624
|
range = sel.getRangeAt(0);
|
|
705
|
-
range.deleteContents();
|
|
706
|
-
// non-standard and not supported in all browsers (IE9, for one)
|
|
625
|
+
range.deleteContents();
|
|
707
626
|
|
|
627
|
+
// Range.createContextualFragment() would be useful here but is
|
|
628
|
+
// non-standard and not supported in all browsers (IE9, for one)
|
|
708
629
|
var el = document.createElement("div");
|
|
709
630
|
el.innerHTML = html;
|
|
710
631
|
var frag = document.createDocumentFragment();
|
|
711
632
|
var node;
|
|
712
633
|
var lastNode;
|
|
713
|
-
|
|
714
634
|
while (node = el.firstChild) {
|
|
715
635
|
lastNode = frag.appendChild(node);
|
|
716
636
|
}
|
|
637
|
+
range.insertNode(frag);
|
|
717
638
|
|
|
718
|
-
|
|
719
|
-
|
|
639
|
+
// Preserve the selection
|
|
720
640
|
if (lastNode) {
|
|
721
641
|
range = range.cloneRange();
|
|
722
642
|
range.setStartAfter(lastNode);
|
|
@@ -727,34 +647,32 @@ function handlePasteHtmlAtCaret(html) {
|
|
|
727
647
|
}
|
|
728
648
|
}
|
|
729
649
|
}
|
|
650
|
+
|
|
730
651
|
/**
|
|
731
652
|
*
|
|
732
653
|
* @param {{text: string, html: string}} props
|
|
733
654
|
* @return {number}
|
|
734
655
|
*/
|
|
735
|
-
|
|
736
656
|
function totalCharacters(_ref2) {
|
|
737
657
|
var text = _ref2.text,
|
|
738
|
-
|
|
658
|
+
html = _ref2.html;
|
|
739
659
|
var textCount = text.length;
|
|
740
660
|
var emojisCount = (html.match(/<img/g) || []).length;
|
|
741
661
|
return textCount + emojisCount;
|
|
742
|
-
}
|
|
662
|
+
}
|
|
663
|
+
|
|
743
664
|
/**
|
|
744
665
|
* Set caret to the end of text value
|
|
745
666
|
* @param {React.MutableRefObject<HTMLDivElement| null>} input
|
|
746
667
|
*/
|
|
747
|
-
|
|
748
668
|
function moveCaretToEnd(input) {
|
|
749
669
|
var range;
|
|
750
670
|
var selection;
|
|
751
|
-
|
|
752
671
|
if (document.createRange && input.current) {
|
|
753
672
|
range = document.createRange();
|
|
754
673
|
range.selectNodeContents(input.current);
|
|
755
674
|
range.collapse(false);
|
|
756
675
|
selection = window.getSelection();
|
|
757
|
-
|
|
758
676
|
if (selection) {
|
|
759
677
|
selection.removeAllRanges();
|
|
760
678
|
selection.addRange(range);
|
|
@@ -766,39 +684,34 @@ function moveCaretToEnd(input) {
|
|
|
766
684
|
* @param {HTMLDivElement} inputDiv
|
|
767
685
|
* @return {string}
|
|
768
686
|
*/
|
|
769
|
-
|
|
770
687
|
function removeHtmlExceptBr(inputDiv) {
|
|
771
688
|
var temp = inputDiv.innerHTML.replace(/<br\s*\/?>/gi, '[BR]'); // temporarily replace <br> with placeholder
|
|
772
|
-
|
|
773
689
|
var stripped = temp.replace(/<[^>]+>/g, ''); // strip all html tags
|
|
774
|
-
|
|
775
690
|
var _final = stripped.replace(/\[BR\]/gi, '</br>'); // replace placeholders with <br>
|
|
776
|
-
|
|
777
|
-
|
|
778
691
|
return _final;
|
|
779
692
|
}
|
|
780
693
|
|
|
781
694
|
// @ts-check
|
|
695
|
+
|
|
782
696
|
/**
|
|
783
697
|
* @typedef {import('../types/types').SanitizeFn} SanitizeFn
|
|
784
698
|
*/
|
|
785
|
-
// eslint-disable-next-line valid-jsdoc
|
|
786
699
|
|
|
700
|
+
// eslint-disable-next-line valid-jsdoc
|
|
787
701
|
/**
|
|
788
702
|
* @param {boolean} shouldReturn
|
|
789
703
|
*/
|
|
790
|
-
|
|
791
704
|
function useSanitize(shouldReturn) {
|
|
792
705
|
/** @type {React.MutableRefObject<SanitizeFn[]>} */
|
|
793
706
|
var sanitizeFnsRef = React.useRef([]);
|
|
794
707
|
var sanitizedTextRef = React.useRef("");
|
|
795
|
-
/** @type {(fn: SanitizeFn) => void} */
|
|
796
708
|
|
|
709
|
+
/** @type {(fn: SanitizeFn) => void} */
|
|
797
710
|
var addSanitizeFn = React.useCallback(function (fn) {
|
|
798
711
|
sanitizeFnsRef.current.push(fn);
|
|
799
712
|
}, []);
|
|
800
|
-
/** @type {(html: string) => string} */
|
|
801
713
|
|
|
714
|
+
/** @type {(html: string) => string} */
|
|
802
715
|
var sanitize = React.useCallback(function (html) {
|
|
803
716
|
var result = sanitizeFnsRef.current.reduce(function (acc, fn) {
|
|
804
717
|
return fn(acc);
|
|
@@ -813,30 +726,30 @@ function useSanitize(shouldReturn) {
|
|
|
813
726
|
sanitizedTextRef: sanitizedTextRef
|
|
814
727
|
};
|
|
815
728
|
}
|
|
729
|
+
|
|
816
730
|
/**
|
|
817
731
|
*
|
|
818
732
|
* @param {string} html
|
|
819
733
|
* @param {boolean} shouldReturn
|
|
820
734
|
* @return {string}
|
|
821
735
|
*/
|
|
822
|
-
|
|
823
736
|
function replaceAllHtmlToString(html, shouldReturn) {
|
|
824
737
|
var container = document.createElement("div");
|
|
825
738
|
container.innerHTML = html;
|
|
826
739
|
var text;
|
|
827
|
-
|
|
828
740
|
if (shouldReturn) {
|
|
829
741
|
text = removeHtmlExceptBr(container);
|
|
830
742
|
} else {
|
|
831
743
|
text = container.innerText || "";
|
|
832
|
-
}
|
|
833
|
-
|
|
744
|
+
}
|
|
834
745
|
|
|
746
|
+
// remove all ↵ for safari
|
|
835
747
|
text = text.replace(/\n/gi, "");
|
|
836
748
|
return text;
|
|
837
749
|
}
|
|
838
750
|
|
|
839
751
|
// @ts-check
|
|
752
|
+
|
|
840
753
|
/**
|
|
841
754
|
* @typedef {Object} Props
|
|
842
755
|
* @property {React.Ref<any>} ref
|
|
@@ -849,27 +762,22 @@ function replaceAllHtmlToString(html, shouldReturn) {
|
|
|
849
762
|
*
|
|
850
763
|
* @param {Props} props
|
|
851
764
|
*/
|
|
852
|
-
|
|
853
765
|
function useExpose(_ref) {
|
|
854
766
|
var ref = _ref.ref,
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
767
|
+
textInputRef = _ref.textInputRef,
|
|
768
|
+
setValue = _ref.setValue,
|
|
769
|
+
emitChange = _ref.emitChange;
|
|
859
770
|
var _useSanitize = useSanitize(),
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
771
|
+
sanitize = _useSanitize.sanitize,
|
|
772
|
+
sanitizedTextRef = _useSanitize.sanitizedTextRef;
|
|
863
773
|
React.useImperativeHandle(ref, function () {
|
|
864
774
|
return {
|
|
865
775
|
get value() {
|
|
866
776
|
return sanitizedTextRef.current;
|
|
867
777
|
},
|
|
868
|
-
|
|
869
778
|
set value(value) {
|
|
870
779
|
setValue(value);
|
|
871
780
|
},
|
|
872
|
-
|
|
873
781
|
focus: function focus() {
|
|
874
782
|
if (textInputRef.current === null) return;
|
|
875
783
|
textInputRef.current.focus();
|
|
@@ -878,7 +786,6 @@ function useExpose(_ref) {
|
|
|
878
786
|
if (textInputRef.current !== null) {
|
|
879
787
|
sanitize(textInputRef.current.html);
|
|
880
788
|
}
|
|
881
|
-
|
|
882
789
|
emitChange();
|
|
883
790
|
}
|
|
884
791
|
};
|
|
@@ -887,13 +794,13 @@ function useExpose(_ref) {
|
|
|
887
794
|
|
|
888
795
|
// @ts-check
|
|
889
796
|
|
|
797
|
+
// eslint-disable-next-line valid-jsdoc
|
|
890
798
|
/**
|
|
891
799
|
* useEmit
|
|
892
800
|
* @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef
|
|
893
801
|
* @param {(size: {width: number, height: number}) => void} onResize
|
|
894
802
|
* @param {(text: string) => void} onChange
|
|
895
803
|
*/
|
|
896
|
-
|
|
897
804
|
function useEmit(textInputRef, onResize, onChange) {
|
|
898
805
|
/** @type {React.MutableRefObject<{width: number; height: number} | null>} */
|
|
899
806
|
var currentSizeRef = React.useRef(null);
|
|
@@ -902,11 +809,9 @@ function useEmit(textInputRef, onResize, onChange) {
|
|
|
902
809
|
if (textInputRef.current !== null) {
|
|
903
810
|
var currentSize = currentSizeRef.current;
|
|
904
811
|
var nextSize = textInputRef.current.size;
|
|
905
|
-
|
|
906
812
|
if ((!currentSize || currentSize.width !== nextSize.width || currentSize.height !== nextSize.height) && typeof onResize === "function") {
|
|
907
813
|
onResize(nextSize);
|
|
908
814
|
}
|
|
909
|
-
|
|
910
815
|
currentSizeRef.current = nextSize;
|
|
911
816
|
}
|
|
912
817
|
}, [onResize, textInputRef]);
|
|
@@ -914,7 +819,6 @@ function useEmit(textInputRef, onResize, onChange) {
|
|
|
914
819
|
if (typeof onChangeFn.current === "function") {
|
|
915
820
|
onChangeFn.current(sanitizedText);
|
|
916
821
|
}
|
|
917
|
-
|
|
918
822
|
if (typeof onResize === "function") {
|
|
919
823
|
checkAndEmitResize();
|
|
920
824
|
}
|
|
@@ -928,6 +832,7 @@ function useEmit(textInputRef, onResize, onChange) {
|
|
|
928
832
|
}
|
|
929
833
|
|
|
930
834
|
var _excluded = ["placeholder", "style", "tabIndex", "className", "onChange"];
|
|
835
|
+
|
|
931
836
|
/**
|
|
932
837
|
* @typedef {Object} Props
|
|
933
838
|
* @property {(event: React.KeyboardEvent) => void} onKeyDown
|
|
@@ -957,70 +862,59 @@ var _excluded = ["placeholder", "style", "tabIndex", "className", "onChange"];
|
|
|
957
862
|
* focus: () => void;
|
|
958
863
|
* }} Ref
|
|
959
864
|
*/
|
|
960
|
-
// eslint-disable-next-line valid-jsdoc
|
|
961
865
|
|
|
866
|
+
// eslint-disable-next-line valid-jsdoc
|
|
962
867
|
/** @type {React.ForwardRefRenderFunction<Ref, Props>} */
|
|
963
|
-
|
|
964
868
|
var TextInput = function TextInput(_ref, ref) {
|
|
965
869
|
var placeholder = _ref.placeholder,
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
870
|
+
style = _ref.style,
|
|
871
|
+
tabIndex = _ref.tabIndex,
|
|
872
|
+
className = _ref.className,
|
|
873
|
+
onChange = _ref.onChange,
|
|
874
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
972
875
|
React.useImperativeHandle(ref, function () {
|
|
973
876
|
return {
|
|
974
877
|
appendContent: function appendContent(html) {
|
|
975
878
|
if (textInputRef.current) {
|
|
976
879
|
textInputRef.current.focus();
|
|
977
880
|
}
|
|
978
|
-
|
|
979
881
|
handlePasteHtmlAtCaret(html);
|
|
980
|
-
|
|
981
882
|
if (textInputRef.current) {
|
|
982
883
|
textInputRef.current.focus();
|
|
983
884
|
}
|
|
984
|
-
|
|
985
|
-
if (textInputRef.current && placeholderRef.current && textInputRef.current.innerHTML.trim() === "") {
|
|
885
|
+
if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === "") {
|
|
986
886
|
placeholderRef.current.style.visibility = "visible";
|
|
987
887
|
} else if (placeholderRef.current) {
|
|
988
888
|
placeholderRef.current.style.visibility = "hidden";
|
|
989
889
|
}
|
|
990
|
-
|
|
991
890
|
if (textInputRef.current && typeof onChange === 'function') {
|
|
992
891
|
onChange(textInputRef.current.innerHTML);
|
|
993
892
|
}
|
|
994
893
|
},
|
|
995
|
-
|
|
996
894
|
set html(value) {
|
|
997
895
|
if (textInputRef.current) {
|
|
998
896
|
textInputRef.current.innerHTML = value;
|
|
999
897
|
}
|
|
1000
|
-
|
|
1001
898
|
if (placeholderRef.current) {
|
|
1002
|
-
|
|
899
|
+
var text = replaceAllTextEmojiToString(value);
|
|
900
|
+
if (text === "") {
|
|
1003
901
|
placeholderRef.current.style.visibility = "visible";
|
|
1004
902
|
} else {
|
|
1005
903
|
placeholderRef.current.style.visibility = "hidden";
|
|
1006
904
|
}
|
|
1007
905
|
}
|
|
1008
|
-
|
|
1009
906
|
if (typeof onChange === 'function' && textInputRef.current) {
|
|
1010
907
|
onChange(textInputRef.current.innerHTML);
|
|
1011
908
|
}
|
|
1012
909
|
},
|
|
1013
|
-
|
|
1014
910
|
get html() {
|
|
1015
911
|
if (!textInputRef.current) return '';
|
|
1016
912
|
return textInputRef.current.innerHTML;
|
|
1017
913
|
},
|
|
1018
|
-
|
|
1019
914
|
get text() {
|
|
1020
915
|
if (!textInputRef.current) return '';
|
|
1021
916
|
return textInputRef.current.innerText;
|
|
1022
917
|
},
|
|
1023
|
-
|
|
1024
918
|
get size() {
|
|
1025
919
|
if (!textInputRef.current) {
|
|
1026
920
|
return {
|
|
@@ -1028,41 +922,36 @@ var TextInput = function TextInput(_ref, ref) {
|
|
|
1028
922
|
height: 0
|
|
1029
923
|
};
|
|
1030
924
|
}
|
|
1031
|
-
|
|
1032
925
|
return {
|
|
1033
926
|
width: textInputRef.current.offsetWidth,
|
|
1034
927
|
height: textInputRef.current.offsetHeight
|
|
1035
928
|
};
|
|
1036
929
|
},
|
|
1037
|
-
|
|
1038
930
|
focus: function focus() {
|
|
1039
931
|
if (!textInputRef.current) return;
|
|
1040
932
|
textInputRef.current.focus();
|
|
1041
933
|
}
|
|
1042
934
|
};
|
|
1043
935
|
});
|
|
1044
|
-
/** @type {React.MutableRefObject<HTMLDivElement | null>} */
|
|
1045
936
|
|
|
937
|
+
/** @type {React.MutableRefObject<HTMLDivElement | null>} */
|
|
1046
938
|
var placeholderRef = React.useRef(null);
|
|
1047
939
|
/** @type {React.MutableRefObject<HTMLDivElement | null>} */
|
|
1048
|
-
|
|
1049
940
|
var textInputRef = React.useRef(null);
|
|
941
|
+
|
|
1050
942
|
/**
|
|
1051
943
|
*
|
|
1052
944
|
* @param {React.KeyboardEvent} event
|
|
1053
945
|
*/
|
|
1054
|
-
|
|
1055
946
|
function handleKeyDown(event) {
|
|
1056
947
|
if (event.key === "Enter" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {
|
|
1057
948
|
event.preventDefault();
|
|
1058
|
-
|
|
1059
949
|
if (textInputRef.current) {
|
|
1060
950
|
textInputRef.current.innerHTML = "".concat(textInputRef.current.innerHTML, "</br></br>");
|
|
1061
951
|
moveCaretToEnd(textInputRef);
|
|
1062
952
|
return;
|
|
1063
953
|
}
|
|
1064
954
|
}
|
|
1065
|
-
|
|
1066
955
|
if (event.key === "Enter") {
|
|
1067
956
|
props.onEnter(event);
|
|
1068
957
|
} else if (event.key === "ArrowUp") {
|
|
@@ -1074,40 +963,33 @@ var TextInput = function TextInput(_ref, ref) {
|
|
|
1074
963
|
placeholderRef.current.style.visibility = "hidden";
|
|
1075
964
|
}
|
|
1076
965
|
}
|
|
1077
|
-
|
|
1078
966
|
props.onKeyDown(event);
|
|
1079
967
|
}
|
|
1080
|
-
/** */
|
|
1081
|
-
|
|
1082
968
|
|
|
969
|
+
/** */
|
|
1083
970
|
function handleClick() {
|
|
1084
971
|
props.onFocus();
|
|
1085
972
|
}
|
|
973
|
+
|
|
1086
974
|
/**
|
|
1087
975
|
*
|
|
1088
976
|
* @param {React.KeyboardEvent} event
|
|
1089
977
|
*/
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
978
|
function handleKeyUp(event) {
|
|
1093
979
|
props.onKeyUp(event);
|
|
1094
980
|
var input = textInputRef.current;
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
if ((input === null || input === void 0 ? void 0 : (_input$innerText = input.innerText) === null || _input$innerText === void 0 ? void 0 : _input$innerText.trim()) === "") {
|
|
981
|
+
if (placeholderRef.current && input) {
|
|
982
|
+
var text = replaceAllTextEmojiToString(input.innerHTML);
|
|
983
|
+
if (text === "") {
|
|
1100
984
|
placeholderRef.current.style.visibility = "visible";
|
|
1101
985
|
} else {
|
|
1102
986
|
placeholderRef.current.style.visibility = "hidden";
|
|
1103
987
|
}
|
|
1104
988
|
}
|
|
1105
|
-
|
|
1106
989
|
if (typeof onChange === 'function' && textInputRef.current) {
|
|
1107
990
|
onChange(textInputRef.current.innerHTML);
|
|
1108
991
|
}
|
|
1109
992
|
}
|
|
1110
|
-
|
|
1111
993
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1112
994
|
className: "react-input-emoji--container",
|
|
1113
995
|
style: style
|
|
@@ -1130,7 +1012,6 @@ var TextInput = function TextInput(_ref, ref) {
|
|
|
1130
1012
|
"data-testid": "react-input-emoji--input"
|
|
1131
1013
|
})));
|
|
1132
1014
|
};
|
|
1133
|
-
|
|
1134
1015
|
var TextInputWithRef = /*#__PURE__*/React.forwardRef(TextInput);
|
|
1135
1016
|
|
|
1136
1017
|
/**
|
|
@@ -1138,6 +1019,7 @@ var TextInputWithRef = /*#__PURE__*/React.forwardRef(TextInput);
|
|
|
1138
1019
|
* @property {boolean} showPicker
|
|
1139
1020
|
* @property {(event: React.MouseEvent) => void} toggleShowPicker
|
|
1140
1021
|
* @property {HTMLDivElement=} buttonElement
|
|
1022
|
+
* @property {React.MutableRefObject=} buttonRef
|
|
1141
1023
|
*/
|
|
1142
1024
|
|
|
1143
1025
|
/**
|
|
@@ -1145,28 +1027,28 @@ var TextInputWithRef = /*#__PURE__*/React.forwardRef(TextInput);
|
|
|
1145
1027
|
* @param {Props} props
|
|
1146
1028
|
* @return {JSX.Element}
|
|
1147
1029
|
*/
|
|
1148
|
-
|
|
1149
1030
|
function EmojiPickerButton(_ref) {
|
|
1150
1031
|
var showPicker = _ref.showPicker,
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1032
|
+
toggleShowPicker = _ref.toggleShowPicker,
|
|
1033
|
+
buttonElement = _ref.buttonElement,
|
|
1034
|
+
buttonRef = _ref.buttonRef;
|
|
1035
|
+
var localButtonRef = React.useRef(null);
|
|
1155
1036
|
var _useState = React.useState(false),
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1037
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1038
|
+
showCustomButtonContent = _useState2[0],
|
|
1039
|
+
setShowCustomButtonContent = _useState2[1];
|
|
1160
1040
|
React.useEffect(function () {
|
|
1161
|
-
var _buttonElement$childN, _buttonElement$childN2;
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1041
|
+
var _buttonRef$current$ch, _buttonRef$current, _buttonElement$childN, _buttonElement$childN2;
|
|
1042
|
+
if (((_buttonRef$current$ch = buttonRef === null || buttonRef === void 0 || (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || (_buttonRef$current = _buttonRef$current.childNodes) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.length) !== null && _buttonRef$current$ch !== void 0 ? _buttonRef$current$ch : 0) > 2) {
|
|
1043
|
+
localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);
|
|
1044
|
+
setShowCustomButtonContent(true);
|
|
1045
|
+
} else if (((_buttonElement$childN = buttonElement === null || buttonElement === void 0 || (_buttonElement$childN2 = buttonElement.childNodes) === null || _buttonElement$childN2 === void 0 ? void 0 : _buttonElement$childN2.length) !== null && _buttonElement$childN !== void 0 ? _buttonElement$childN : 0) > 2) {
|
|
1046
|
+
localButtonRef.current.appendChild(buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes[0]);
|
|
1165
1047
|
setShowCustomButtonContent(true);
|
|
1166
1048
|
}
|
|
1167
1049
|
}, [buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes]);
|
|
1168
1050
|
return /*#__PURE__*/React__default["default"].createElement("button", {
|
|
1169
|
-
ref:
|
|
1051
|
+
ref: localButtonRef,
|
|
1170
1052
|
type: "button",
|
|
1171
1053
|
className: "react-input-emoji--button".concat(showPicker ? " react-input-emoji--button__show" : ""),
|
|
1172
1054
|
onClick: toggleShowPicker
|
|
@@ -1186,7 +1068,6 @@ function EmojiPickerButton(_ref) {
|
|
|
1186
1068
|
function $parcel$interopDefault(a) {
|
|
1187
1069
|
return a && a.__esModule ? a.default : a;
|
|
1188
1070
|
}
|
|
1189
|
-
|
|
1190
1071
|
function $c770c458706daa72$export$2e2bcd8739ae039(obj, key, value) {
|
|
1191
1072
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
1192
1073
|
value: value,
|
|
@@ -1196,40 +1077,32 @@ function $c770c458706daa72$export$2e2bcd8739ae039(obj, key, value) {
|
|
|
1196
1077
|
});else obj[key] = value;
|
|
1197
1078
|
return obj;
|
|
1198
1079
|
}
|
|
1199
|
-
|
|
1200
1080
|
var $fb96b826c0c5f37a$var$n,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1081
|
+
$fb96b826c0c5f37a$export$41c562ebe57d11e2,
|
|
1082
|
+
$fb96b826c0c5f37a$var$u,
|
|
1083
|
+
$fb96b826c0c5f37a$var$t,
|
|
1084
|
+
$fb96b826c0c5f37a$var$r,
|
|
1085
|
+
$fb96b826c0c5f37a$var$o,
|
|
1086
|
+
$fb96b826c0c5f37a$var$e = {},
|
|
1087
|
+
$fb96b826c0c5f37a$var$c = [],
|
|
1088
|
+
$fb96b826c0c5f37a$var$s = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
1210
1089
|
function $fb96b826c0c5f37a$var$a(n1, l1) {
|
|
1211
1090
|
for (var u1 in l1) n1[u1] = l1[u1];
|
|
1212
|
-
|
|
1213
1091
|
return n1;
|
|
1214
1092
|
}
|
|
1215
|
-
|
|
1216
1093
|
function $fb96b826c0c5f37a$var$h(n2) {
|
|
1217
1094
|
var l2 = n2.parentNode;
|
|
1218
1095
|
l2 && l2.removeChild(n2);
|
|
1219
1096
|
}
|
|
1220
|
-
|
|
1221
1097
|
function $fb96b826c0c5f37a$export$c8a8987d4410bf2d(l3, u2, i1) {
|
|
1222
1098
|
var t1,
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1099
|
+
r1,
|
|
1100
|
+
o1,
|
|
1101
|
+
f1 = {};
|
|
1227
1102
|
for (o1 in u2) "key" == o1 ? t1 = u2[o1] : "ref" == o1 ? r1 = u2[o1] : f1[o1] = u2[o1];
|
|
1228
|
-
|
|
1229
1103
|
if (arguments.length > 2 && (f1.children = arguments.length > 3 ? $fb96b826c0c5f37a$var$n.call(arguments, 2) : i1), "function" == typeof l3 && null != l3.defaultProps) for (o1 in l3.defaultProps) void 0 === f1[o1] && (f1[o1] = l3.defaultProps[o1]);
|
|
1230
1104
|
return $fb96b826c0c5f37a$var$y(l3, f1, t1, r1, null);
|
|
1231
1105
|
}
|
|
1232
|
-
|
|
1233
1106
|
function $fb96b826c0c5f37a$var$y(n3, i2, t2, r2, o2) {
|
|
1234
1107
|
var f2 = {
|
|
1235
1108
|
type: n3,
|
|
@@ -1248,46 +1121,35 @@ function $fb96b826c0c5f37a$var$y(n3, i2, t2, r2, o2) {
|
|
|
1248
1121
|
};
|
|
1249
1122
|
return null == o2 && null != $fb96b826c0c5f37a$export$41c562ebe57d11e2.vnode && $fb96b826c0c5f37a$export$41c562ebe57d11e2.vnode(f2), f2;
|
|
1250
1123
|
}
|
|
1251
|
-
|
|
1252
1124
|
function $fb96b826c0c5f37a$export$7d1e3a5e95ceca43() {
|
|
1253
1125
|
return {
|
|
1254
1126
|
current: null
|
|
1255
1127
|
};
|
|
1256
1128
|
}
|
|
1257
|
-
|
|
1258
1129
|
function $fb96b826c0c5f37a$export$ffb0004e005737fa(n4) {
|
|
1259
1130
|
return n4.children;
|
|
1260
1131
|
}
|
|
1261
|
-
|
|
1262
1132
|
function $fb96b826c0c5f37a$export$16fa2f45be04daa8(n5, l4) {
|
|
1263
1133
|
this.props = n5, this.context = l4;
|
|
1264
1134
|
}
|
|
1265
|
-
|
|
1266
1135
|
function $fb96b826c0c5f37a$var$k(n6, l5) {
|
|
1267
1136
|
if (null == l5) return n6.__ ? $fb96b826c0c5f37a$var$k(n6.__, n6.__.__k.indexOf(n6) + 1) : null;
|
|
1268
|
-
|
|
1269
1137
|
for (var u3; l5 < n6.__k.length; l5++) if (null != (u3 = n6.__k[l5]) && null != u3.__e) return u3.__e;
|
|
1270
|
-
|
|
1271
1138
|
return "function" == typeof n6.type ? $fb96b826c0c5f37a$var$k(n6) : null;
|
|
1272
1139
|
}
|
|
1273
|
-
|
|
1274
1140
|
function $fb96b826c0c5f37a$var$b(n7) {
|
|
1275
1141
|
var l6, u4;
|
|
1276
|
-
|
|
1277
1142
|
if (null != (n7 = n7.__) && null != n7.__c) {
|
|
1278
1143
|
for (n7.__e = n7.__c.base = null, l6 = 0; l6 < n7.__k.length; l6++) if (null != (u4 = n7.__k[l6]) && null != u4.__e) {
|
|
1279
1144
|
n7.__e = n7.__c.base = u4.__e;
|
|
1280
1145
|
break;
|
|
1281
1146
|
}
|
|
1282
|
-
|
|
1283
1147
|
return $fb96b826c0c5f37a$var$b(n7);
|
|
1284
1148
|
}
|
|
1285
1149
|
}
|
|
1286
|
-
|
|
1287
1150
|
function $fb96b826c0c5f37a$var$m(n8) {
|
|
1288
1151
|
(!n8.__d && (n8.__d = !0) && $fb96b826c0c5f37a$var$t.push(n8) && !$fb96b826c0c5f37a$var$g.__r++ || $fb96b826c0c5f37a$var$o !== $fb96b826c0c5f37a$export$41c562ebe57d11e2.debounceRendering) && (($fb96b826c0c5f37a$var$o = $fb96b826c0c5f37a$export$41c562ebe57d11e2.debounceRendering) || $fb96b826c0c5f37a$var$r)($fb96b826c0c5f37a$var$g);
|
|
1289
1152
|
}
|
|
1290
|
-
|
|
1291
1153
|
function $fb96b826c0c5f37a$var$g() {
|
|
1292
1154
|
for (var n9; $fb96b826c0c5f37a$var$g.__r = $fb96b826c0c5f37a$var$t.length;) n9 = $fb96b826c0c5f37a$var$t.sort(function (n10, l7) {
|
|
1293
1155
|
return n10.__v.__b - l7.__v.__b;
|
|
@@ -1296,18 +1158,16 @@ function $fb96b826c0c5f37a$var$g() {
|
|
|
1296
1158
|
n11.__d && (r3 = (t3 = (l8 = n11).__v).__e, (o3 = l8.__P) && (u5 = [], (i3 = $fb96b826c0c5f37a$var$a({}, t3)).__v = t3.__v + 1, $fb96b826c0c5f37a$var$j(o3, t3, i3, l8.__n, void 0 !== o3.ownerSVGElement, null != t3.__h ? [r3] : null, u5, null == r3 ? $fb96b826c0c5f37a$var$k(t3) : r3, t3.__h), $fb96b826c0c5f37a$var$z(u5, t3), t3.__e != r3 && $fb96b826c0c5f37a$var$b(t3)));
|
|
1297
1159
|
});
|
|
1298
1160
|
}
|
|
1299
|
-
|
|
1300
1161
|
function $fb96b826c0c5f37a$var$w(n12, l9, u6, i4, t4, r4, o4, f3, s1, a1) {
|
|
1301
1162
|
var h1,
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1163
|
+
v1,
|
|
1164
|
+
p1,
|
|
1165
|
+
_1,
|
|
1166
|
+
b1,
|
|
1167
|
+
m1,
|
|
1168
|
+
g1,
|
|
1169
|
+
w1 = i4 && i4.__k || $fb96b826c0c5f37a$var$c,
|
|
1170
|
+
A1 = w1.length;
|
|
1311
1171
|
for (u6.__k = [], h1 = 0; h1 < l9.length; h1++) if (null != (_1 = u6.__k[h1] = null == (_1 = l9[h1]) || "boolean" == typeof _1 ? null : "string" == typeof _1 || "number" == typeof _1 || "bigint" == typeof _1 ? $fb96b826c0c5f37a$var$y(null, _1, null, null, _1) : Array.isArray(_1) ? $fb96b826c0c5f37a$var$y($fb96b826c0c5f37a$export$ffb0004e005737fa, {
|
|
1312
1172
|
children: _1
|
|
1313
1173
|
}, null, null, null) : _1.__b > 0 ? $fb96b826c0c5f37a$var$y(_1.type, _1.props, _1.key, null, _1.__v) : _1)) {
|
|
@@ -1316,54 +1176,40 @@ function $fb96b826c0c5f37a$var$w(n12, l9, u6, i4, t4, r4, o4, f3, s1, a1) {
|
|
|
1316
1176
|
w1[v1] = void 0;
|
|
1317
1177
|
break;
|
|
1318
1178
|
}
|
|
1319
|
-
|
|
1320
1179
|
p1 = null;
|
|
1321
1180
|
}
|
|
1322
1181
|
$fb96b826c0c5f37a$var$j(n12, _1, p1 = p1 || $fb96b826c0c5f37a$var$e, t4, r4, o4, f3, s1, a1), b1 = _1.__e, (v1 = _1.ref) && p1.ref != v1 && (g1 || (g1 = []), p1.ref && g1.push(p1.ref, null, _1), g1.push(v1, _1.__c || b1, _1)), null != b1 ? (null == m1 && (m1 = b1), "function" == typeof _1.type && _1.__k === p1.__k ? _1.__d = s1 = $fb96b826c0c5f37a$var$x(_1, s1, n12) : s1 = $fb96b826c0c5f37a$var$P(n12, _1, p1, w1, b1, s1), "function" == typeof u6.type && (u6.__d = s1)) : s1 && p1.__e == s1 && s1.parentNode != n12 && (s1 = $fb96b826c0c5f37a$var$k(p1));
|
|
1323
1182
|
}
|
|
1324
|
-
|
|
1325
1183
|
for (u6.__e = m1, h1 = A1; h1--;) null != w1[h1] && ("function" == typeof u6.type && null != w1[h1].__e && w1[h1].__e == u6.__d && (u6.__d = $fb96b826c0c5f37a$var$k(i4, h1 + 1)), $fb96b826c0c5f37a$var$N(w1[h1], w1[h1]));
|
|
1326
|
-
|
|
1327
1184
|
if (g1) for (h1 = 0; h1 < g1.length; h1++) $fb96b826c0c5f37a$var$M(g1[h1], g1[++h1], g1[++h1]);
|
|
1328
1185
|
}
|
|
1329
|
-
|
|
1330
1186
|
function $fb96b826c0c5f37a$var$x(n13, l10, u7) {
|
|
1331
1187
|
for (var i5, t5 = n13.__k, r5 = 0; t5 && r5 < t5.length; r5++) (i5 = t5[r5]) && (i5.__ = n13, l10 = "function" == typeof i5.type ? $fb96b826c0c5f37a$var$x(i5, l10, u7) : $fb96b826c0c5f37a$var$P(u7, i5, i5, t5, i5.__e, l10));
|
|
1332
|
-
|
|
1333
1188
|
return l10;
|
|
1334
1189
|
}
|
|
1335
|
-
|
|
1336
1190
|
function $fb96b826c0c5f37a$export$47e4c5b300681277(n14, l11) {
|
|
1337
1191
|
return l11 = l11 || [], null == n14 || "boolean" == typeof n14 || (Array.isArray(n14) ? n14.some(function (n15) {
|
|
1338
1192
|
$fb96b826c0c5f37a$export$47e4c5b300681277(n15, l11);
|
|
1339
1193
|
}) : l11.push(n14)), l11;
|
|
1340
1194
|
}
|
|
1341
|
-
|
|
1342
1195
|
function $fb96b826c0c5f37a$var$P(n16, l12, u8, i6, t6, r6) {
|
|
1343
1196
|
var o5, f4, e1;
|
|
1344
1197
|
if (void 0 !== l12.__d) o5 = l12.__d, l12.__d = void 0;else if (null == u8 || t6 != r6 || null == t6.parentNode) n: if (null == r6 || r6.parentNode !== n16) n16.appendChild(t6), o5 = null;else {
|
|
1345
1198
|
for (f4 = r6, e1 = 0; (f4 = f4.nextSibling) && e1 < i6.length; e1 += 2) if (f4 == t6) break n;
|
|
1346
|
-
|
|
1347
1199
|
n16.insertBefore(t6, r6), o5 = r6;
|
|
1348
1200
|
}
|
|
1349
1201
|
return void 0 !== o5 ? o5 : t6.nextSibling;
|
|
1350
1202
|
}
|
|
1351
|
-
|
|
1352
1203
|
function $fb96b826c0c5f37a$var$C(n17, l13, u9, i7, t7) {
|
|
1353
1204
|
var r7;
|
|
1354
|
-
|
|
1355
1205
|
for (r7 in u9) "children" === r7 || "key" === r7 || r7 in l13 || $fb96b826c0c5f37a$var$H(n17, r7, null, u9[r7], i7);
|
|
1356
|
-
|
|
1357
1206
|
for (r7 in l13) t7 && "function" != typeof l13[r7] || "children" === r7 || "key" === r7 || "value" === r7 || "checked" === r7 || u9[r7] === l13[r7] || $fb96b826c0c5f37a$var$H(n17, r7, l13[r7], u9[r7], i7);
|
|
1358
1207
|
}
|
|
1359
|
-
|
|
1360
1208
|
function $fb96b826c0c5f37a$var$$(n18, l14, u10) {
|
|
1361
1209
|
"-" === l14[0] ? n18.setProperty(l14, u10) : n18[l14] = null == u10 ? "" : "number" != typeof u10 || $fb96b826c0c5f37a$var$s.test(l14) ? u10 : u10 + "px";
|
|
1362
1210
|
}
|
|
1363
|
-
|
|
1364
1211
|
function $fb96b826c0c5f37a$var$H(n19, l15, u11, i8, t8) {
|
|
1365
1212
|
var r8;
|
|
1366
|
-
|
|
1367
1213
|
n: if ("style" === l15) {
|
|
1368
1214
|
if ("string" == typeof u11) n19.style.cssText = u11;else {
|
|
1369
1215
|
if ("string" == typeof i8 && (n19.style.cssText = i8 = ""), i8) for (l15 in i8) u11 && l15 in u11 || $fb96b826c0c5f37a$var$$(n19.style, l15, "");
|
|
@@ -1377,31 +1223,27 @@ function $fb96b826c0c5f37a$var$H(n19, l15, u11, i8, t8) {
|
|
|
1377
1223
|
"function" == typeof u11 || (null != u11 && (!1 !== u11 || "a" === l15[0] && "r" === l15[1]) ? n19.setAttribute(l15, u11) : n19.removeAttribute(l15));
|
|
1378
1224
|
}
|
|
1379
1225
|
}
|
|
1380
|
-
|
|
1381
1226
|
function $fb96b826c0c5f37a$var$I(n20) {
|
|
1382
1227
|
this.l[n20.type + !1]($fb96b826c0c5f37a$export$41c562ebe57d11e2.event ? $fb96b826c0c5f37a$export$41c562ebe57d11e2.event(n20) : n20);
|
|
1383
1228
|
}
|
|
1384
|
-
|
|
1385
1229
|
function $fb96b826c0c5f37a$var$T(n21) {
|
|
1386
1230
|
this.l[n21.type + !0]($fb96b826c0c5f37a$export$41c562ebe57d11e2.event ? $fb96b826c0c5f37a$export$41c562ebe57d11e2.event(n21) : n21);
|
|
1387
1231
|
}
|
|
1388
|
-
|
|
1389
1232
|
function $fb96b826c0c5f37a$var$j(n22, u12, i9, t9, r9, o6, f5, e2, c1) {
|
|
1390
1233
|
var s2,
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1234
|
+
h2,
|
|
1235
|
+
v2,
|
|
1236
|
+
y1,
|
|
1237
|
+
p2,
|
|
1238
|
+
k1,
|
|
1239
|
+
b2,
|
|
1240
|
+
m2,
|
|
1241
|
+
g2,
|
|
1242
|
+
x1,
|
|
1243
|
+
A2,
|
|
1244
|
+
P1 = u12.type;
|
|
1402
1245
|
if (void 0 !== u12.constructor) return null;
|
|
1403
1246
|
null != i9.__h && (c1 = i9.__h, e2 = u12.__e = i9.__e, u12.__h = null, o6 = [e2]), (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.__b) && s2(u12);
|
|
1404
|
-
|
|
1405
1247
|
try {
|
|
1406
1248
|
n: if ("function" == typeof P1) {
|
|
1407
1249
|
if (m2 = u12.props, g2 = (s2 = P1.contextType) && t9[s2.__c], x1 = s2 ? g2 ? g2.props.value : s2.__ : t9, i9.__c ? b2 = (h2 = u12.__c = i9.__c).__ = h2.__E : ("prototype" in P1 && P1.prototype.render ? u12.__c = h2 = new P1(m2, x1) : (u12.__c = h2 = new $fb96b826c0c5f37a$export$16fa2f45be04daa8(m2, x1), h2.constructor = P1, h2.render = $fb96b826c0c5f37a$var$O), g2 && g2.sub(h2), h2.props = m2, h2.state || (h2.state = {}), h2.context = x1, h2.__n = t9, v2 = h2.__d = !0, h2.__h = []), null == h2.__s && (h2.__s = h2.state), null != P1.getDerivedStateFromProps && (h2.__s == h2.state && (h2.__s = $fb96b826c0c5f37a$var$a({}, h2.__s)), $fb96b826c0c5f37a$var$a(h2.__s, P1.getDerivedStateFromProps(m2, h2.__s))), y1 = h2.props, p2 = h2.state, v2) null == P1.getDerivedStateFromProps && null != h2.componentWillMount && h2.componentWillMount(), null != h2.componentDidMount && h2.__h.push(h2.componentDidMount);else {
|
|
@@ -1411,20 +1253,17 @@ function $fb96b826c0c5f37a$var$j(n22, u12, i9, t9, r9, o6, f5, e2, c1) {
|
|
|
1411
1253
|
}), h2.__h.length && f5.push(h2);
|
|
1412
1254
|
break n;
|
|
1413
1255
|
}
|
|
1414
|
-
|
|
1415
1256
|
null != h2.componentWillUpdate && h2.componentWillUpdate(m2, h2.__s, x1), null != h2.componentDidUpdate && h2.__h.push(function () {
|
|
1416
1257
|
h2.componentDidUpdate(y1, p2, k1);
|
|
1417
1258
|
});
|
|
1418
1259
|
}
|
|
1419
1260
|
h2.context = x1, h2.props = m2, h2.state = h2.__s, (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.__r) && s2(u12), h2.__d = !1, h2.__v = u12, h2.__P = n22, s2 = h2.render(h2.props, h2.state, h2.context), h2.state = h2.__s, null != h2.getChildContext && (t9 = $fb96b826c0c5f37a$var$a($fb96b826c0c5f37a$var$a({}, t9), h2.getChildContext())), v2 || null == h2.getSnapshotBeforeUpdate || (k1 = h2.getSnapshotBeforeUpdate(y1, p2)), A2 = null != s2 && s2.type === $fb96b826c0c5f37a$export$ffb0004e005737fa && null == s2.key ? s2.props.children : s2, $fb96b826c0c5f37a$var$w(n22, Array.isArray(A2) ? A2 : [A2], u12, i9, t9, r9, o6, f5, e2, c1), h2.base = u12.__e, u12.__h = null, h2.__h.length && f5.push(h2), b2 && (h2.__E = h2.__ = null), h2.__e = !1;
|
|
1420
1261
|
} else null == o6 && u12.__v === i9.__v ? (u12.__k = i9.__k, u12.__e = i9.__e) : u12.__e = $fb96b826c0c5f37a$var$L(i9.__e, u12, i9, t9, r9, o6, f5, c1);
|
|
1421
|
-
|
|
1422
1262
|
(s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.diffed) && s2(u12);
|
|
1423
1263
|
} catch (n24) {
|
|
1424
1264
|
u12.__v = null, (c1 || null != o6) && (u12.__e = e2, u12.__h = !!c1, o6[o6.indexOf(e2)] = null), $fb96b826c0c5f37a$export$41c562ebe57d11e2.__e(n24, u12, i9);
|
|
1425
1265
|
}
|
|
1426
1266
|
}
|
|
1427
|
-
|
|
1428
1267
|
function $fb96b826c0c5f37a$var$z(n25, u13) {
|
|
1429
1268
|
$fb96b826c0c5f37a$export$41c562ebe57d11e2.__c && $fb96b826c0c5f37a$export$41c562ebe57d11e2.__c(u13, n25), n25.some(function (u14) {
|
|
1430
1269
|
try {
|
|
@@ -1436,40 +1275,34 @@ function $fb96b826c0c5f37a$var$z(n25, u13) {
|
|
|
1436
1275
|
}
|
|
1437
1276
|
});
|
|
1438
1277
|
}
|
|
1439
|
-
|
|
1440
1278
|
function $fb96b826c0c5f37a$var$L(l16, u15, i10, t10, r10, o7, f6, c2) {
|
|
1441
1279
|
var s3,
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1280
|
+
a2,
|
|
1281
|
+
v3,
|
|
1282
|
+
y2 = i10.props,
|
|
1283
|
+
p3 = u15.props,
|
|
1284
|
+
d1 = u15.type,
|
|
1285
|
+
_2 = 0;
|
|
1449
1286
|
if ("svg" === d1 && (r10 = !0), null != o7) {
|
|
1450
1287
|
for (; _2 < o7.length; _2++) if ((s3 = o7[_2]) && "setAttribute" in s3 == !!d1 && (d1 ? s3.localName === d1 : 3 === s3.nodeType)) {
|
|
1451
1288
|
l16 = s3, o7[_2] = null;
|
|
1452
1289
|
break;
|
|
1453
1290
|
}
|
|
1454
1291
|
}
|
|
1455
|
-
|
|
1456
1292
|
if (null == l16) {
|
|
1457
1293
|
if (null === d1) return document.createTextNode(p3);
|
|
1458
1294
|
l16 = r10 ? document.createElementNS("http://www.w3.org/2000/svg", d1) : document.createElement(d1, p3.is && p3), o7 = null, c2 = !1;
|
|
1459
1295
|
}
|
|
1460
|
-
|
|
1461
1296
|
if (null === d1) y2 === p3 || c2 && l16.data === p3 || (l16.data = p3);else {
|
|
1462
1297
|
if (o7 = o7 && $fb96b826c0c5f37a$var$n.call(l16.childNodes), a2 = (y2 = i10.props || $fb96b826c0c5f37a$var$e).dangerouslySetInnerHTML, v3 = p3.dangerouslySetInnerHTML, !c2) {
|
|
1463
1298
|
if (null != o7) for (y2 = {}, _2 = 0; _2 < l16.attributes.length; _2++) y2[l16.attributes[_2].name] = l16.attributes[_2].value;
|
|
1464
1299
|
(v3 || a2) && (v3 && (a2 && v3.__html == a2.__html || v3.__html === l16.innerHTML) || (l16.innerHTML = v3 && v3.__html || ""));
|
|
1465
1300
|
}
|
|
1466
|
-
|
|
1467
1301
|
if ($fb96b826c0c5f37a$var$C(l16, p3, y2, r10, c2), v3) u15.__k = [];else if (_2 = u15.props.children, $fb96b826c0c5f37a$var$w(l16, Array.isArray(_2) ? _2 : [_2], u15, i10, t10, r10 && "foreignObject" !== d1, o7, f6, o7 ? o7[0] : i10.__k && $fb96b826c0c5f37a$var$k(i10, 0), c2), null != o7) for (_2 = o7.length; _2--;) null != o7[_2] && $fb96b826c0c5f37a$var$h(o7[_2]);
|
|
1468
1302
|
c2 || ("value" in p3 && void 0 !== (_2 = p3.value) && (_2 !== y2.value || _2 !== l16.value || "progress" === d1 && !_2) && $fb96b826c0c5f37a$var$H(l16, "value", _2, y2.value, !1), "checked" in p3 && void 0 !== (_2 = p3.checked) && _2 !== l16.checked && $fb96b826c0c5f37a$var$H(l16, "checked", _2, y2.checked, !1));
|
|
1469
1303
|
}
|
|
1470
1304
|
return l16;
|
|
1471
1305
|
}
|
|
1472
|
-
|
|
1473
1306
|
function $fb96b826c0c5f37a$var$M(n28, u16, i11) {
|
|
1474
1307
|
try {
|
|
1475
1308
|
"function" == typeof n28 ? n28(u16) : n28.current = u16;
|
|
@@ -1477,10 +1310,8 @@ function $fb96b826c0c5f37a$var$M(n28, u16, i11) {
|
|
|
1477
1310
|
$fb96b826c0c5f37a$export$41c562ebe57d11e2.__e(n29, i11);
|
|
1478
1311
|
}
|
|
1479
1312
|
}
|
|
1480
|
-
|
|
1481
1313
|
function $fb96b826c0c5f37a$var$N(n30, u17, i12) {
|
|
1482
1314
|
var t11, r11;
|
|
1483
|
-
|
|
1484
1315
|
if ($fb96b826c0c5f37a$export$41c562ebe57d11e2.unmount && $fb96b826c0c5f37a$export$41c562ebe57d11e2.unmount(n30), (t11 = n30.ref) && (t11.current && t11.current !== n30.__e || $fb96b826c0c5f37a$var$M(t11, null, u17)), null != (t11 = n30.__c)) {
|
|
1485
1316
|
if (t11.componentWillUnmount) try {
|
|
1486
1317
|
t11.componentWillUnmount();
|
|
@@ -1489,20 +1320,16 @@ function $fb96b826c0c5f37a$var$N(n30, u17, i12) {
|
|
|
1489
1320
|
}
|
|
1490
1321
|
t11.base = t11.__P = null;
|
|
1491
1322
|
}
|
|
1492
|
-
|
|
1493
1323
|
if (t11 = n30.__k) for (r11 = 0; r11 < t11.length; r11++) t11[r11] && $fb96b826c0c5f37a$var$N(t11[r11], u17, "function" != typeof n30.type);
|
|
1494
1324
|
i12 || null == n30.__e || $fb96b826c0c5f37a$var$h(n30.__e), n30.__e = n30.__d = void 0;
|
|
1495
1325
|
}
|
|
1496
|
-
|
|
1497
1326
|
function $fb96b826c0c5f37a$var$O(n32, l, u18) {
|
|
1498
1327
|
return this.constructor(n32, u18);
|
|
1499
1328
|
}
|
|
1500
|
-
|
|
1501
1329
|
function $fb96b826c0c5f37a$export$b3890eb0ae9dca99(u19, i13, t12) {
|
|
1502
1330
|
var r12, o8, f7;
|
|
1503
1331
|
$fb96b826c0c5f37a$export$41c562ebe57d11e2.__ && $fb96b826c0c5f37a$export$41c562ebe57d11e2.__(u19, i13), o8 = (r12 = "function" == typeof t12) ? null : t12 && t12.__k || i13.__k, f7 = [], $fb96b826c0c5f37a$var$j(i13, u19 = (!r12 && t12 || i13).__k = $fb96b826c0c5f37a$export$c8a8987d4410bf2d($fb96b826c0c5f37a$export$ffb0004e005737fa, null, [u19]), o8 || $fb96b826c0c5f37a$var$e, $fb96b826c0c5f37a$var$e, void 0 !== i13.ownerSVGElement, !r12 && t12 ? [t12] : o8 ? null : i13.firstChild ? $fb96b826c0c5f37a$var$n.call(i13.childNodes) : null, f7, !r12 && t12 ? t12 : o8 ? o8.__e : i13.firstChild, r12), $fb96b826c0c5f37a$var$z(f7, u19);
|
|
1504
1332
|
}
|
|
1505
|
-
|
|
1506
1333
|
$fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$export$41c562ebe57d11e2 = {
|
|
1507
1334
|
__e: function (n39, l22) {
|
|
1508
1335
|
for (var u23, i16, t14; l22 = l22.__;) if ((u23 = l22.__c) && !u23.__) try {
|
|
@@ -1510,7 +1337,6 @@ $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$expor
|
|
|
1510
1337
|
} catch (l23) {
|
|
1511
1338
|
n39 = l23;
|
|
1512
1339
|
}
|
|
1513
|
-
|
|
1514
1340
|
throw n39;
|
|
1515
1341
|
}
|
|
1516
1342
|
}, $fb96b826c0c5f37a$var$u = 0, $fb96b826c0c5f37a$export$16fa2f45be04daa8.prototype.setState = function (n41, l24) {
|
|
@@ -1520,14 +1346,11 @@ $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$expor
|
|
|
1520
1346
|
this.__v && (this.__e = !0, n42 && this.__h.push(n42), $fb96b826c0c5f37a$var$m(this));
|
|
1521
1347
|
}, $fb96b826c0c5f37a$export$16fa2f45be04daa8.prototype.render = $fb96b826c0c5f37a$export$ffb0004e005737fa, $fb96b826c0c5f37a$var$t = [], $fb96b826c0c5f37a$var$r = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, $fb96b826c0c5f37a$var$g.__r = 0;
|
|
1522
1348
|
var $bd9dd35321b03dd4$var$o = 0;
|
|
1523
|
-
|
|
1524
1349
|
function $bd9dd35321b03dd4$export$34b9dba7ce09269b(_1, e1, n, t, f) {
|
|
1525
1350
|
var l,
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1351
|
+
s,
|
|
1352
|
+
u = {};
|
|
1529
1353
|
for (s in e1) "ref" == s ? l = e1[s] : u[s] = e1[s];
|
|
1530
|
-
|
|
1531
1354
|
var a = {
|
|
1532
1355
|
type: _1,
|
|
1533
1356
|
props: u,
|
|
@@ -1548,20 +1371,17 @@ function $bd9dd35321b03dd4$export$34b9dba7ce09269b(_1, e1, n, t, f) {
|
|
|
1548
1371
|
if ("function" == typeof _1 && (l = _1.defaultProps)) for (s in l) void 0 === u[s] && (u[s] = l[s]);
|
|
1549
1372
|
return ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode && ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode(a), a;
|
|
1550
1373
|
}
|
|
1551
|
-
|
|
1552
1374
|
function $f72b75cf796873c7$var$set(key, value) {
|
|
1553
1375
|
try {
|
|
1554
1376
|
window.localStorage[`emoji-mart.${key}`] = JSON.stringify(value);
|
|
1555
1377
|
} catch (error) {}
|
|
1556
1378
|
}
|
|
1557
|
-
|
|
1558
1379
|
function $f72b75cf796873c7$var$get(key) {
|
|
1559
1380
|
try {
|
|
1560
1381
|
const value = window.localStorage[`emoji-mart.${key}`];
|
|
1561
1382
|
if (value) return JSON.parse(value);
|
|
1562
1383
|
} catch (error) {}
|
|
1563
1384
|
}
|
|
1564
|
-
|
|
1565
1385
|
var $f72b75cf796873c7$export$2e2bcd8739ae039 = {
|
|
1566
1386
|
set: $f72b75cf796873c7$var$set,
|
|
1567
1387
|
get: $f72b75cf796873c7$var$get
|
|
@@ -1601,7 +1421,6 @@ const $c84d045dcc34faf5$var$VERSIONS = [{
|
|
|
1601
1421
|
v: 1,
|
|
1602
1422
|
emoji: "\uD83D\uDE43"
|
|
1603
1423
|
}];
|
|
1604
|
-
|
|
1605
1424
|
function $c84d045dcc34faf5$var$latestVersion() {
|
|
1606
1425
|
for (const {
|
|
1607
1426
|
v: v,
|
|
@@ -1610,76 +1429,68 @@ function $c84d045dcc34faf5$var$latestVersion() {
|
|
|
1610
1429
|
if ($c84d045dcc34faf5$var$isSupported(emoji)) return v;
|
|
1611
1430
|
}
|
|
1612
1431
|
}
|
|
1613
|
-
|
|
1614
1432
|
function $c84d045dcc34faf5$var$noCountryFlags() {
|
|
1615
1433
|
if ($c84d045dcc34faf5$var$isSupported("\uD83C\uDDE8\uD83C\uDDE6")) return false;
|
|
1616
1434
|
return true;
|
|
1617
1435
|
}
|
|
1618
|
-
|
|
1619
1436
|
function $c84d045dcc34faf5$var$isSupported(emoji) {
|
|
1620
1437
|
if ($c84d045dcc34faf5$var$CACHE.has(emoji)) return $c84d045dcc34faf5$var$CACHE.get(emoji);
|
|
1621
1438
|
const supported = $c84d045dcc34faf5$var$isEmojiSupported(emoji);
|
|
1622
1439
|
$c84d045dcc34faf5$var$CACHE.set(emoji, supported);
|
|
1623
1440
|
return supported;
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1441
|
+
}
|
|
1442
|
+
// https://github.com/koala-interactive/is-emoji-supported
|
|
1627
1443
|
const $c84d045dcc34faf5$var$isEmojiSupported = (() => {
|
|
1628
1444
|
let ctx = null;
|
|
1629
|
-
|
|
1630
1445
|
try {
|
|
1631
1446
|
if (!navigator.userAgent.includes("jsdom")) ctx = document.createElement("canvas").getContext("2d", {
|
|
1632
1447
|
willReadFrequently: true
|
|
1633
1448
|
});
|
|
1634
|
-
} catch {}
|
|
1635
|
-
|
|
1636
|
-
|
|
1449
|
+
} catch {}
|
|
1450
|
+
// Not in browser env
|
|
1637
1451
|
if (!ctx) return () => false;
|
|
1638
1452
|
const CANVAS_HEIGHT = 25;
|
|
1639
1453
|
const CANVAS_WIDTH = 20;
|
|
1640
|
-
const textSize = Math.floor(CANVAS_HEIGHT / 2);
|
|
1641
|
-
|
|
1454
|
+
const textSize = Math.floor(CANVAS_HEIGHT / 2);
|
|
1455
|
+
// Initialize convas context
|
|
1642
1456
|
ctx.font = textSize + "px Arial, Sans-Serif";
|
|
1643
1457
|
ctx.textBaseline = "top";
|
|
1644
1458
|
ctx.canvas.width = CANVAS_WIDTH * 2;
|
|
1645
1459
|
ctx.canvas.height = CANVAS_HEIGHT;
|
|
1646
1460
|
return unicode => {
|
|
1647
|
-
ctx.clearRect(0, 0, CANVAS_WIDTH * 2, CANVAS_HEIGHT);
|
|
1648
|
-
|
|
1461
|
+
ctx.clearRect(0, 0, CANVAS_WIDTH * 2, CANVAS_HEIGHT);
|
|
1462
|
+
// Draw in red on the left
|
|
1649
1463
|
ctx.fillStyle = "#FF0000";
|
|
1650
|
-
ctx.fillText(unicode, 0, 22);
|
|
1651
|
-
|
|
1464
|
+
ctx.fillText(unicode, 0, 22);
|
|
1465
|
+
// Draw in blue on right
|
|
1652
1466
|
ctx.fillStyle = "#0000FF";
|
|
1653
1467
|
ctx.fillText(unicode, CANVAS_WIDTH, 22);
|
|
1654
1468
|
const a = ctx.getImageData(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT).data;
|
|
1655
1469
|
const count = a.length;
|
|
1656
|
-
let i = 0;
|
|
1657
|
-
|
|
1658
|
-
for (; i < count && !a[i + 3]; i += 4);
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1470
|
+
let i = 0;
|
|
1471
|
+
// Search the first visible pixel
|
|
1472
|
+
for (; i < count && !a[i + 3]; i += 4);
|
|
1473
|
+
// No visible pixel
|
|
1474
|
+
if (i >= count) return false;
|
|
1475
|
+
// Emoji has immutable color, so we check the color of the emoji in two different colors
|
|
1662
1476
|
// the result show be the same.
|
|
1663
|
-
|
|
1664
1477
|
const x = CANVAS_WIDTH + i / 4 % CANVAS_WIDTH;
|
|
1665
1478
|
const y = Math.floor(i / 4 / CANVAS_WIDTH);
|
|
1666
1479
|
const b = ctx.getImageData(x, y, 1, 1).data;
|
|
1667
|
-
if (a[i] !== b[0] || a[i + 2] !== b[2]) return false;
|
|
1480
|
+
if (a[i] !== b[0] || a[i + 2] !== b[2]) return false;
|
|
1481
|
+
// Some emojis are a contraction of different ones, so if it's not
|
|
1668
1482
|
// supported, it will show multiple characters
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1483
|
+
if (ctx.measureText(unicode).width >= CANVAS_WIDTH) return false;
|
|
1484
|
+
// Supported
|
|
1672
1485
|
return true;
|
|
1673
1486
|
};
|
|
1674
1487
|
})();
|
|
1675
|
-
|
|
1676
1488
|
var $c84d045dcc34faf5$export$2e2bcd8739ae039 = {
|
|
1677
1489
|
latestVersion: $c84d045dcc34faf5$var$latestVersion,
|
|
1678
1490
|
noCountryFlags: $c84d045dcc34faf5$var$noCountryFlags
|
|
1679
1491
|
};
|
|
1680
1492
|
const $b22cfd0a55410b4f$var$DEFAULTS = ["+1", "grinning", "kissing_heart", "heart_eyes", "laughing", "stuck_out_tongue_winking_eye", "sweat_smile", "joy", "scream", "disappointed", "unamused", "weary", "sob", "sunglasses", "heart"];
|
|
1681
1493
|
let $b22cfd0a55410b4f$var$Index = null;
|
|
1682
|
-
|
|
1683
1494
|
function $b22cfd0a55410b4f$var$add(emoji) {
|
|
1684
1495
|
$b22cfd0a55410b4f$var$Index || ($b22cfd0a55410b4f$var$Index = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("frequently") || {});
|
|
1685
1496
|
const emojiId = emoji.id || emoji;
|
|
@@ -1689,7 +1500,6 @@ function $b22cfd0a55410b4f$var$add(emoji) {
|
|
|
1689
1500
|
($f72b75cf796873c7$export$2e2bcd8739ae039).set("last", emojiId);
|
|
1690
1501
|
($f72b75cf796873c7$export$2e2bcd8739ae039).set("frequently", $b22cfd0a55410b4f$var$Index);
|
|
1691
1502
|
}
|
|
1692
|
-
|
|
1693
1503
|
function $b22cfd0a55410b4f$var$get({
|
|
1694
1504
|
maxFrequentRows: maxFrequentRows,
|
|
1695
1505
|
perLine: perLine
|
|
@@ -1697,51 +1507,39 @@ function $b22cfd0a55410b4f$var$get({
|
|
|
1697
1507
|
if (!maxFrequentRows) return [];
|
|
1698
1508
|
$b22cfd0a55410b4f$var$Index || ($b22cfd0a55410b4f$var$Index = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("frequently"));
|
|
1699
1509
|
let emojiIds = [];
|
|
1700
|
-
|
|
1701
1510
|
if (!$b22cfd0a55410b4f$var$Index) {
|
|
1702
1511
|
$b22cfd0a55410b4f$var$Index = {};
|
|
1703
|
-
|
|
1704
1512
|
for (let i in $b22cfd0a55410b4f$var$DEFAULTS.slice(0, perLine)) {
|
|
1705
1513
|
const emojiId = $b22cfd0a55410b4f$var$DEFAULTS[i];
|
|
1706
1514
|
$b22cfd0a55410b4f$var$Index[emojiId] = perLine - i;
|
|
1707
1515
|
emojiIds.push(emojiId);
|
|
1708
1516
|
}
|
|
1709
|
-
|
|
1710
1517
|
return emojiIds;
|
|
1711
1518
|
}
|
|
1712
|
-
|
|
1713
1519
|
const max = maxFrequentRows * perLine;
|
|
1714
1520
|
const last = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("last");
|
|
1715
|
-
|
|
1716
1521
|
for (let emojiId in $b22cfd0a55410b4f$var$Index) emojiIds.push(emojiId);
|
|
1717
|
-
|
|
1718
1522
|
emojiIds.sort((a, b) => {
|
|
1719
1523
|
const aScore = $b22cfd0a55410b4f$var$Index[b];
|
|
1720
1524
|
const bScore = $b22cfd0a55410b4f$var$Index[a];
|
|
1721
1525
|
if (aScore == bScore) return a.localeCompare(b);
|
|
1722
1526
|
return aScore - bScore;
|
|
1723
1527
|
});
|
|
1724
|
-
|
|
1725
1528
|
if (emojiIds.length > max) {
|
|
1726
1529
|
const removedIds = emojiIds.slice(max);
|
|
1727
1530
|
emojiIds = emojiIds.slice(0, max);
|
|
1728
|
-
|
|
1729
1531
|
for (let removedId of removedIds) {
|
|
1730
1532
|
if (removedId == last) continue;
|
|
1731
1533
|
delete $b22cfd0a55410b4f$var$Index[removedId];
|
|
1732
1534
|
}
|
|
1733
|
-
|
|
1734
1535
|
if (last && emojiIds.indexOf(last) == -1) {
|
|
1735
1536
|
delete $b22cfd0a55410b4f$var$Index[emojiIds[emojiIds.length - 1]];
|
|
1736
1537
|
emojiIds.splice(-1, 1, last);
|
|
1737
1538
|
}
|
|
1738
|
-
|
|
1739
1539
|
($f72b75cf796873c7$export$2e2bcd8739ae039).set("frequently", $b22cfd0a55410b4f$var$Index);
|
|
1740
1540
|
}
|
|
1741
|
-
|
|
1742
1541
|
return emojiIds;
|
|
1743
1542
|
}
|
|
1744
|
-
|
|
1745
1543
|
var $b22cfd0a55410b4f$export$2e2bcd8739ae039 = {
|
|
1746
1544
|
add: $b22cfd0a55410b4f$var$add,
|
|
1747
1545
|
get: $b22cfd0a55410b4f$var$get,
|
|
@@ -1847,7 +1645,6 @@ var $b247ea80b67298d5$export$2e2bcd8739ae039 = {
|
|
|
1847
1645
|
let $7adb23b0109cc36a$export$dbe3113d60765c1a = null;
|
|
1848
1646
|
let $7adb23b0109cc36a$export$2d0294657ab35f1b = null;
|
|
1849
1647
|
const $7adb23b0109cc36a$var$fetchCache = {};
|
|
1850
|
-
|
|
1851
1648
|
async function $7adb23b0109cc36a$var$fetchJSON(src) {
|
|
1852
1649
|
if ($7adb23b0109cc36a$var$fetchCache[src]) return $7adb23b0109cc36a$var$fetchCache[src];
|
|
1853
1650
|
const response = await fetch(src);
|
|
@@ -1855,11 +1652,9 @@ async function $7adb23b0109cc36a$var$fetchJSON(src) {
|
|
|
1855
1652
|
$7adb23b0109cc36a$var$fetchCache[src] = json;
|
|
1856
1653
|
return json;
|
|
1857
1654
|
}
|
|
1858
|
-
|
|
1859
1655
|
let $7adb23b0109cc36a$var$promise = null;
|
|
1860
1656
|
let $7adb23b0109cc36a$var$initCallback = null;
|
|
1861
1657
|
let $7adb23b0109cc36a$var$initialized = false;
|
|
1862
|
-
|
|
1863
1658
|
function $7adb23b0109cc36a$export$2cd8252107eb640b(options, {
|
|
1864
1659
|
caller: caller
|
|
1865
1660
|
} = {}) {
|
|
@@ -1869,7 +1664,6 @@ function $7adb23b0109cc36a$export$2cd8252107eb640b(options, {
|
|
|
1869
1664
|
if (options) $7adb23b0109cc36a$var$_init(options);else if (caller && !$7adb23b0109cc36a$var$initialized) console.warn(`\`${caller}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`);
|
|
1870
1665
|
return $7adb23b0109cc36a$var$promise;
|
|
1871
1666
|
}
|
|
1872
|
-
|
|
1873
1667
|
async function $7adb23b0109cc36a$var$_init(props) {
|
|
1874
1668
|
$7adb23b0109cc36a$var$initialized = true;
|
|
1875
1669
|
let {
|
|
@@ -1880,7 +1674,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
|
|
|
1880
1674
|
emojiVersion || (emojiVersion = ($b247ea80b67298d5$export$2e2bcd8739ae039).emojiVersion.value);
|
|
1881
1675
|
set || (set = ($b247ea80b67298d5$export$2e2bcd8739ae039).set.value);
|
|
1882
1676
|
locale || (locale = ($b247ea80b67298d5$export$2e2bcd8739ae039).locale.value);
|
|
1883
|
-
|
|
1884
1677
|
if (!$7adb23b0109cc36a$export$2d0294657ab35f1b) {
|
|
1885
1678
|
$7adb23b0109cc36a$export$2d0294657ab35f1b = (typeof props.data === "function" ? await props.data() : props.data) || (await $7adb23b0109cc36a$var$fetchJSON(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${emojiVersion}/${set}.json`));
|
|
1886
1679
|
$7adb23b0109cc36a$export$2d0294657ab35f1b.emoticons = {};
|
|
@@ -1889,7 +1682,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
|
|
|
1889
1682
|
id: "frequent",
|
|
1890
1683
|
emojis: []
|
|
1891
1684
|
});
|
|
1892
|
-
|
|
1893
1685
|
for (const alias in $7adb23b0109cc36a$export$2d0294657ab35f1b.aliases) {
|
|
1894
1686
|
const emojiId = $7adb23b0109cc36a$export$2d0294657ab35f1b.aliases[alias];
|
|
1895
1687
|
const emoji = $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emojiId];
|
|
@@ -1897,14 +1689,12 @@ async function $7adb23b0109cc36a$var$_init(props) {
|
|
|
1897
1689
|
emoji.aliases || (emoji.aliases = []);
|
|
1898
1690
|
emoji.aliases.push(alias);
|
|
1899
1691
|
}
|
|
1900
|
-
|
|
1901
1692
|
$7adb23b0109cc36a$export$2d0294657ab35f1b.originalCategories = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories;
|
|
1902
1693
|
} else $7adb23b0109cc36a$export$2d0294657ab35f1b.categories = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.filter(c => {
|
|
1903
1694
|
const isCustom = !!c.name;
|
|
1904
1695
|
if (!isCustom) return true;
|
|
1905
1696
|
return false;
|
|
1906
1697
|
});
|
|
1907
|
-
|
|
1908
1698
|
$7adb23b0109cc36a$export$dbe3113d60765c1a = (typeof props.i18n === "function" ? await props.i18n() : props.i18n) || (locale == "en" ? (/*@__PURE__*/$parcel$interopDefault($8d50d93417ef682a$exports)) : await $7adb23b0109cc36a$var$fetchJSON(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${locale}.json`));
|
|
1909
1699
|
if (props.custom) for (let i in props.custom) {
|
|
1910
1700
|
i = parseInt(i);
|
|
@@ -1915,7 +1705,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
|
|
|
1915
1705
|
category.name || (category.name = $7adb23b0109cc36a$export$dbe3113d60765c1a.categories.custom);
|
|
1916
1706
|
if (prevCategory && !category.icon) category.target = prevCategory.target || prevCategory;
|
|
1917
1707
|
$7adb23b0109cc36a$export$2d0294657ab35f1b.categories.push(category);
|
|
1918
|
-
|
|
1919
1708
|
for (const emoji of category.emojis) $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emoji.id] = emoji;
|
|
1920
1709
|
}
|
|
1921
1710
|
if (props.categories) $7adb23b0109cc36a$export$2d0294657ab35f1b.categories = $7adb23b0109cc36a$export$2d0294657ab35f1b.originalCategories.filter(c => {
|
|
@@ -1927,18 +1716,14 @@ async function $7adb23b0109cc36a$var$_init(props) {
|
|
|
1927
1716
|
});
|
|
1928
1717
|
let latestVersionSupport = null;
|
|
1929
1718
|
let noCountryFlags = null;
|
|
1930
|
-
|
|
1931
1719
|
if (set == "native") {
|
|
1932
1720
|
latestVersionSupport = ($c84d045dcc34faf5$export$2e2bcd8739ae039).latestVersion();
|
|
1933
1721
|
noCountryFlags = props.noCountryFlags || ($c84d045dcc34faf5$export$2e2bcd8739ae039).noCountryFlags();
|
|
1934
1722
|
}
|
|
1935
|
-
|
|
1936
1723
|
let categoryIndex = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.length;
|
|
1937
1724
|
let resetSearchIndex = false;
|
|
1938
|
-
|
|
1939
1725
|
while (categoryIndex--) {
|
|
1940
1726
|
const category = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories[categoryIndex];
|
|
1941
|
-
|
|
1942
1727
|
if (category.id == "frequent") {
|
|
1943
1728
|
let {
|
|
1944
1729
|
maxFrequentRows: maxFrequentRows,
|
|
@@ -1951,48 +1736,38 @@ async function $7adb23b0109cc36a$var$_init(props) {
|
|
|
1951
1736
|
perLine: perLine
|
|
1952
1737
|
});
|
|
1953
1738
|
}
|
|
1954
|
-
|
|
1955
1739
|
if (!category.emojis || !category.emojis.length) {
|
|
1956
1740
|
$7adb23b0109cc36a$export$2d0294657ab35f1b.categories.splice(categoryIndex, 1);
|
|
1957
1741
|
continue;
|
|
1958
1742
|
}
|
|
1959
|
-
|
|
1960
1743
|
const {
|
|
1961
1744
|
categoryIcons: categoryIcons
|
|
1962
1745
|
} = props;
|
|
1963
|
-
|
|
1964
1746
|
if (categoryIcons) {
|
|
1965
1747
|
const icon = categoryIcons[category.id];
|
|
1966
1748
|
if (icon && !category.icon) category.icon = icon;
|
|
1967
1749
|
}
|
|
1968
|
-
|
|
1969
1750
|
let emojiIndex = category.emojis.length;
|
|
1970
|
-
|
|
1971
1751
|
while (emojiIndex--) {
|
|
1972
1752
|
const emojiId = category.emojis[emojiIndex];
|
|
1973
1753
|
const emoji = emojiId.id ? emojiId : $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emojiId];
|
|
1974
|
-
|
|
1975
1754
|
const ignore = () => {
|
|
1976
1755
|
category.emojis.splice(emojiIndex, 1);
|
|
1977
1756
|
};
|
|
1978
|
-
|
|
1979
1757
|
if (!emoji || props.exceptEmojis && props.exceptEmojis.includes(emoji.id)) {
|
|
1980
1758
|
ignore();
|
|
1981
1759
|
continue;
|
|
1982
1760
|
}
|
|
1983
|
-
|
|
1984
1761
|
if (latestVersionSupport && emoji.version > latestVersionSupport) {
|
|
1985
1762
|
ignore();
|
|
1986
1763
|
continue;
|
|
1987
1764
|
}
|
|
1988
|
-
|
|
1989
1765
|
if (noCountryFlags && category.id == "flags") {
|
|
1990
1766
|
if (!($e6eae5155b87f591$export$bcb25aa587e9cb13).includes(emoji.id)) {
|
|
1991
1767
|
ignore();
|
|
1992
1768
|
continue;
|
|
1993
1769
|
}
|
|
1994
1770
|
}
|
|
1995
|
-
|
|
1996
1771
|
if (!emoji.search) {
|
|
1997
1772
|
resetSearchIndex = true;
|
|
1998
1773
|
emoji.search = "," + [[emoji.id, false], [emoji.name, true], [emoji.keywords, false], [emoji.emoticons, false]].map(([strings, split]) => {
|
|
@@ -2006,65 +1781,51 @@ async function $7adb23b0109cc36a$var$_init(props) {
|
|
|
2006
1781
|
$7adb23b0109cc36a$export$2d0294657ab35f1b.emoticons[emoticon] = emoji.id;
|
|
2007
1782
|
}
|
|
2008
1783
|
let skinIndex = 0;
|
|
2009
|
-
|
|
2010
1784
|
for (const skin of emoji.skins) {
|
|
2011
1785
|
if (!skin) continue;
|
|
2012
1786
|
skinIndex++;
|
|
2013
1787
|
const {
|
|
2014
1788
|
native: native
|
|
2015
1789
|
} = skin;
|
|
2016
|
-
|
|
2017
1790
|
if (native) {
|
|
2018
1791
|
$7adb23b0109cc36a$export$2d0294657ab35f1b.natives[native] = emoji.id;
|
|
2019
1792
|
emoji.search += `,${native}`;
|
|
2020
1793
|
}
|
|
2021
|
-
|
|
2022
1794
|
const skinShortcodes = skinIndex == 1 ? "" : `:skin-tone-${skinIndex}:`;
|
|
2023
1795
|
skin.shortcodes = `:${emoji.id}:${skinShortcodes}`;
|
|
2024
1796
|
}
|
|
2025
1797
|
}
|
|
2026
1798
|
}
|
|
2027
1799
|
}
|
|
2028
|
-
|
|
2029
1800
|
if (resetSearchIndex) ($c4d155af13ad4d4b$export$2e2bcd8739ae039).reset();
|
|
2030
1801
|
$7adb23b0109cc36a$var$initCallback();
|
|
2031
1802
|
}
|
|
2032
|
-
|
|
2033
1803
|
function $7adb23b0109cc36a$export$75fe5f91d452f94b(props, defaultProps, element) {
|
|
2034
1804
|
props || (props = {});
|
|
2035
1805
|
const _props = {};
|
|
2036
|
-
|
|
2037
1806
|
for (let k in defaultProps) _props[k] = $7adb23b0109cc36a$export$88c9ddb45cea7241(k, props, defaultProps, element);
|
|
2038
|
-
|
|
2039
1807
|
return _props;
|
|
2040
1808
|
}
|
|
2041
|
-
|
|
2042
1809
|
function $7adb23b0109cc36a$export$88c9ddb45cea7241(propName, props, defaultProps, element) {
|
|
2043
1810
|
const defaults = defaultProps[propName];
|
|
2044
1811
|
let value = element && element.getAttribute(propName) || (props[propName] != null && props[propName] != undefined ? props[propName] : null);
|
|
2045
1812
|
if (!defaults) return value;
|
|
2046
|
-
|
|
2047
1813
|
if (value != null && defaults.value && typeof defaults.value != typeof value) {
|
|
2048
1814
|
if (typeof defaults.value == "boolean") value = value == "false" ? false : true;else value = defaults.value.constructor(value);
|
|
2049
1815
|
}
|
|
2050
|
-
|
|
2051
1816
|
if (defaults.transform && value) value = defaults.transform(value);
|
|
2052
1817
|
if (value == null || defaults.choices && defaults.choices.indexOf(value) == -1) value = defaults.value;
|
|
2053
1818
|
return value;
|
|
2054
1819
|
}
|
|
2055
|
-
|
|
2056
1820
|
const $c4d155af13ad4d4b$var$SHORTCODES_REGEX = /^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;
|
|
2057
1821
|
let $c4d155af13ad4d4b$var$Pool = null;
|
|
2058
|
-
|
|
2059
1822
|
function $c4d155af13ad4d4b$var$get(emojiId) {
|
|
2060
1823
|
if (emojiId.id) return emojiId;
|
|
2061
1824
|
return ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[emojiId] || ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[($7adb23b0109cc36a$export$2d0294657ab35f1b).aliases[emojiId]] || ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[($7adb23b0109cc36a$export$2d0294657ab35f1b).natives[emojiId]];
|
|
2062
1825
|
}
|
|
2063
|
-
|
|
2064
1826
|
function $c4d155af13ad4d4b$var$reset() {
|
|
2065
1827
|
$c4d155af13ad4d4b$var$Pool = null;
|
|
2066
1828
|
}
|
|
2067
|
-
|
|
2068
1829
|
async function $c4d155af13ad4d4b$var$search(value, {
|
|
2069
1830
|
maxResults: maxResults,
|
|
2070
1831
|
caller: caller
|
|
@@ -2080,12 +1841,10 @@ async function $c4d155af13ad4d4b$var$search(value, {
|
|
|
2080
1841
|
if (!values.length) return;
|
|
2081
1842
|
let pool = $c4d155af13ad4d4b$var$Pool || ($c4d155af13ad4d4b$var$Pool = Object.values(($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis));
|
|
2082
1843
|
let results, scores;
|
|
2083
|
-
|
|
2084
1844
|
for (const value1 of values) {
|
|
2085
1845
|
if (!pool.length) break;
|
|
2086
1846
|
results = [];
|
|
2087
1847
|
scores = {};
|
|
2088
|
-
|
|
2089
1848
|
for (const emoji of pool) {
|
|
2090
1849
|
if (!emoji.search) continue;
|
|
2091
1850
|
const score = emoji.search.indexOf(`,${value1}`);
|
|
@@ -2094,10 +1853,8 @@ async function $c4d155af13ad4d4b$var$search(value, {
|
|
|
2094
1853
|
scores[emoji.id] || (scores[emoji.id] = 0);
|
|
2095
1854
|
scores[emoji.id] += emoji.id == value1 ? 0 : score + 1;
|
|
2096
1855
|
}
|
|
2097
|
-
|
|
2098
1856
|
pool = results;
|
|
2099
1857
|
}
|
|
2100
|
-
|
|
2101
1858
|
if (results.length < 2) return results;
|
|
2102
1859
|
results.sort((a, b) => {
|
|
2103
1860
|
const aScore = scores[a.id];
|
|
@@ -2108,7 +1865,6 @@ async function $c4d155af13ad4d4b$var$search(value, {
|
|
|
2108
1865
|
if (results.length > maxResults) results = results.slice(0, maxResults);
|
|
2109
1866
|
return results;
|
|
2110
1867
|
}
|
|
2111
|
-
|
|
2112
1868
|
var $c4d155af13ad4d4b$export$2e2bcd8739ae039 = {
|
|
2113
1869
|
search: $c4d155af13ad4d4b$var$search,
|
|
2114
1870
|
get: $c4d155af13ad4d4b$var$get,
|
|
@@ -2116,15 +1872,12 @@ var $c4d155af13ad4d4b$export$2e2bcd8739ae039 = {
|
|
|
2116
1872
|
SHORTCODES_REGEX: $c4d155af13ad4d4b$var$SHORTCODES_REGEX
|
|
2117
1873
|
};
|
|
2118
1874
|
const $e6eae5155b87f591$export$bcb25aa587e9cb13 = ["checkered_flag", "crossed_flags", "pirate_flag", "rainbow-flag", "transgender_flag", "triangular_flag_on_post", "waving_black_flag", "waving_white_flag"];
|
|
2119
|
-
|
|
2120
1875
|
function $693b183b0a78708f$export$9cb4719e2e525b7a(a, b) {
|
|
2121
1876
|
return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((val, index) => val == b[index]);
|
|
2122
1877
|
}
|
|
2123
|
-
|
|
2124
1878
|
async function $693b183b0a78708f$export$e772c8ff12451969(frames = 1) {
|
|
2125
1879
|
for (let _ in [...Array(frames).keys()]) await new Promise(requestAnimationFrame);
|
|
2126
1880
|
}
|
|
2127
|
-
|
|
2128
1881
|
function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
|
|
2129
1882
|
skinIndex = 0
|
|
2130
1883
|
} = {}) {
|
|
@@ -2132,7 +1885,6 @@ function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
|
|
|
2132
1885
|
skinIndex = 0;
|
|
2133
1886
|
return emoji.skins[skinIndex];
|
|
2134
1887
|
})();
|
|
2135
|
-
|
|
2136
1888
|
const emojiData = {
|
|
2137
1889
|
id: emoji.id,
|
|
2138
1890
|
name: emoji.name,
|
|
@@ -2147,7 +1899,6 @@ function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
|
|
|
2147
1899
|
if (emoji.emoticons && emoji.emoticons.length) emojiData.emoticons = emoji.emoticons;
|
|
2148
1900
|
return emojiData;
|
|
2149
1901
|
}
|
|
2150
|
-
|
|
2151
1902
|
const $fcccfb36ed0cde68$var$categories = {
|
|
2152
1903
|
activity: {
|
|
2153
1904
|
outline: /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("svg", {
|
|
@@ -2331,23 +2082,19 @@ var $fcccfb36ed0cde68$export$2e2bcd8739ae039 = {
|
|
|
2331
2082
|
categories: $fcccfb36ed0cde68$var$categories,
|
|
2332
2083
|
search: $fcccfb36ed0cde68$var$search
|
|
2333
2084
|
};
|
|
2334
|
-
|
|
2335
2085
|
function $254755d3f438722f$export$2e2bcd8739ae039(props) {
|
|
2336
2086
|
let {
|
|
2337
2087
|
id: id,
|
|
2338
2088
|
skin: skin,
|
|
2339
2089
|
emoji: emoji
|
|
2340
2090
|
} = props;
|
|
2341
|
-
|
|
2342
2091
|
if (props.shortcodes) {
|
|
2343
2092
|
const matches = props.shortcodes.match(($c4d155af13ad4d4b$export$2e2bcd8739ae039).SHORTCODES_REGEX);
|
|
2344
|
-
|
|
2345
2093
|
if (matches) {
|
|
2346
2094
|
id = matches[1];
|
|
2347
2095
|
if (matches[2]) skin = matches[2];
|
|
2348
2096
|
}
|
|
2349
2097
|
}
|
|
2350
|
-
|
|
2351
2098
|
emoji || (emoji = ($c4d155af13ad4d4b$export$2e2bcd8739ae039).get(id || props.native));
|
|
2352
2099
|
if (!emoji) return props.fallback;
|
|
2353
2100
|
const emojiSkin = emoji.skins[skin - 1] || emoji.skins[0];
|
|
@@ -2382,18 +2129,14 @@ function $254755d3f438722f$export$2e2bcd8739ae039(props) {
|
|
|
2382
2129
|
})
|
|
2383
2130
|
});
|
|
2384
2131
|
}
|
|
2385
|
-
|
|
2386
2132
|
const $6f57cc9cd54c5aaa$var$WindowHTMLElement = typeof window !== "undefined" && window.HTMLElement ? window.HTMLElement : Object;
|
|
2387
|
-
|
|
2388
2133
|
class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$WindowHTMLElement {
|
|
2389
2134
|
static get observedAttributes() {
|
|
2390
2135
|
return Object.keys(this.Props);
|
|
2391
2136
|
}
|
|
2392
|
-
|
|
2393
2137
|
update(props = {}) {
|
|
2394
2138
|
for (let k in props) this.attributeChangedCallback(k, null, props[k]);
|
|
2395
2139
|
}
|
|
2396
|
-
|
|
2397
2140
|
attributeChangedCallback(attr, _, newValue) {
|
|
2398
2141
|
if (!this.component) return;
|
|
2399
2142
|
const value = ($7adb23b0109cc36a$export$88c9ddb45cea7241)(attr, {
|
|
@@ -2406,16 +2149,13 @@ class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$Win
|
|
|
2406
2149
|
this.component.forceUpdate();
|
|
2407
2150
|
}
|
|
2408
2151
|
}
|
|
2409
|
-
|
|
2410
2152
|
disconnectedCallback() {
|
|
2411
2153
|
this.disconnected = true;
|
|
2412
2154
|
if (this.component && this.component.unregister) this.component.unregister();
|
|
2413
2155
|
}
|
|
2414
|
-
|
|
2415
2156
|
constructor(props = {}) {
|
|
2416
2157
|
super();
|
|
2417
2158
|
this.props = props;
|
|
2418
|
-
|
|
2419
2159
|
if (props.parent || props.ref) {
|
|
2420
2160
|
let ref = null;
|
|
2421
2161
|
const parent = props.parent || (ref = props.ref && props.ref.current);
|
|
@@ -2423,23 +2163,19 @@ class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$Win
|
|
|
2423
2163
|
if (parent) parent.appendChild(this);
|
|
2424
2164
|
}
|
|
2425
2165
|
}
|
|
2426
|
-
|
|
2427
2166
|
}
|
|
2428
|
-
|
|
2429
2167
|
class $26f27c338a96b1a6$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export$2e2bcd8739ae039) {
|
|
2430
2168
|
setShadow() {
|
|
2431
2169
|
this.attachShadow({
|
|
2432
2170
|
mode: "open"
|
|
2433
2171
|
});
|
|
2434
2172
|
}
|
|
2435
|
-
|
|
2436
2173
|
injectStyles(styles) {
|
|
2437
2174
|
if (!styles) return;
|
|
2438
2175
|
const style = document.createElement("style");
|
|
2439
2176
|
style.textContent = styles;
|
|
2440
2177
|
this.shadowRoot.insertBefore(style, this.shadowRoot.firstChild);
|
|
2441
2178
|
}
|
|
2442
|
-
|
|
2443
2179
|
constructor(props, {
|
|
2444
2180
|
styles: styles
|
|
2445
2181
|
} = {}) {
|
|
@@ -2447,9 +2183,7 @@ class $26f27c338a96b1a6$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export
|
|
|
2447
2183
|
this.setShadow();
|
|
2448
2184
|
this.injectStyles(styles);
|
|
2449
2185
|
}
|
|
2450
|
-
|
|
2451
2186
|
}
|
|
2452
|
-
|
|
2453
2187
|
var $3d90f6e46fb2dd47$export$2e2bcd8739ae039 = {
|
|
2454
2188
|
fallback: "",
|
|
2455
2189
|
id: "",
|
|
@@ -2467,41 +2201,34 @@ var $3d90f6e46fb2dd47$export$2e2bcd8739ae039 = {
|
|
|
2467
2201
|
set: ($b247ea80b67298d5$export$2e2bcd8739ae039).set,
|
|
2468
2202
|
skin: ($b247ea80b67298d5$export$2e2bcd8739ae039).skin
|
|
2469
2203
|
};
|
|
2470
|
-
|
|
2471
2204
|
class $331b4160623139bf$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export$2e2bcd8739ae039) {
|
|
2472
2205
|
async connectedCallback() {
|
|
2473
2206
|
const props = ($7adb23b0109cc36a$export$75fe5f91d452f94b)(this.props, ($3d90f6e46fb2dd47$export$2e2bcd8739ae039), this);
|
|
2474
2207
|
props.element = this;
|
|
2475
|
-
|
|
2476
2208
|
props.ref = component => {
|
|
2477
2209
|
this.component = component;
|
|
2478
2210
|
};
|
|
2479
|
-
|
|
2480
2211
|
await ($7adb23b0109cc36a$export$2cd8252107eb640b)();
|
|
2481
2212
|
if (this.disconnected) return;
|
|
2482
|
-
($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($254755d3f438722f$export$2e2bcd8739ae039), {
|
|
2213
|
+
($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($254755d3f438722f$export$2e2bcd8739ae039), {
|
|
2214
|
+
...props
|
|
2483
2215
|
}), this);
|
|
2484
2216
|
}
|
|
2485
|
-
|
|
2486
2217
|
constructor(props) {
|
|
2487
2218
|
super(props);
|
|
2488
2219
|
}
|
|
2489
|
-
|
|
2490
2220
|
}
|
|
2491
|
-
|
|
2492
2221
|
($c770c458706daa72$export$2e2bcd8739ae039)($331b4160623139bf$export$2e2bcd8739ae039, "Props", ($3d90f6e46fb2dd47$export$2e2bcd8739ae039));
|
|
2493
2222
|
if (typeof customElements !== "undefined" && !customElements.get("em-emoji")) customElements.define("em-emoji", $331b4160623139bf$export$2e2bcd8739ae039);
|
|
2494
2223
|
var $1a9a8ef576b7773d$var$r,
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2224
|
+
$1a9a8ef576b7773d$var$i = [],
|
|
2225
|
+
$1a9a8ef576b7773d$var$c = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b,
|
|
2226
|
+
$1a9a8ef576b7773d$var$f = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r,
|
|
2227
|
+
$1a9a8ef576b7773d$var$e = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).diffed,
|
|
2228
|
+
$1a9a8ef576b7773d$var$a = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c,
|
|
2229
|
+
$1a9a8ef576b7773d$var$v = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
|
|
2502
2230
|
function $1a9a8ef576b7773d$var$x() {
|
|
2503
2231
|
var t6;
|
|
2504
|
-
|
|
2505
2232
|
for ($1a9a8ef576b7773d$var$i.sort(function (n11, t7) {
|
|
2506
2233
|
return n11.__v.__b - t7.__v.__b;
|
|
2507
2234
|
}); t6 = $1a9a8ef576b7773d$var$i.pop();) if (t6.__P) try {
|
|
@@ -2510,7 +2237,6 @@ function $1a9a8ef576b7773d$var$x() {
|
|
|
2510
2237
|
t6.__H.__h = [], ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e(u4, t6.__v);
|
|
2511
2238
|
}
|
|
2512
2239
|
}
|
|
2513
|
-
|
|
2514
2240
|
($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b = function (n12) {
|
|
2515
2241
|
$1a9a8ef576b7773d$var$c && $1a9a8ef576b7773d$var$c(n12);
|
|
2516
2242
|
}, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r = function (n13) {
|
|
@@ -2522,11 +2248,10 @@ function $1a9a8ef576b7773d$var$x() {
|
|
|
2522
2248
|
var o6 = t8.__c;
|
|
2523
2249
|
o6 && o6.__H && o6.__H.__h.length && (1 !== $1a9a8ef576b7773d$var$i.push(o6) && $1a9a8ef576b7773d$var$r === ($fb96b826c0c5f37a$export$41c562ebe57d11e2).requestAnimationFrame || (($1a9a8ef576b7773d$var$r = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).requestAnimationFrame) || function (n14) {
|
|
2524
2250
|
var t9,
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2251
|
+
u5 = function () {
|
|
2252
|
+
clearTimeout(r9), $1a9a8ef576b7773d$var$b && cancelAnimationFrame(t9), setTimeout(n14);
|
|
2253
|
+
},
|
|
2254
|
+
r9 = setTimeout(u5, 100);
|
|
2530
2255
|
$1a9a8ef576b7773d$var$b && (t9 = requestAnimationFrame(u5));
|
|
2531
2256
|
})($1a9a8ef576b7773d$var$x));
|
|
2532
2257
|
}, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c = function (t10, u6) {
|
|
@@ -2544,7 +2269,7 @@ function $1a9a8ef576b7773d$var$x() {
|
|
|
2544
2269
|
}, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount = function (t12) {
|
|
2545
2270
|
$1a9a8ef576b7773d$var$v && $1a9a8ef576b7773d$var$v(t12);
|
|
2546
2271
|
var u7,
|
|
2547
|
-
|
|
2272
|
+
r11 = t12.__c;
|
|
2548
2273
|
r11 && r11.__H && (r11.__H.__.forEach(function (n17) {
|
|
2549
2274
|
try {
|
|
2550
2275
|
$1a9a8ef576b7773d$var$g(n17);
|
|
@@ -2554,105 +2279,80 @@ function $1a9a8ef576b7773d$var$x() {
|
|
|
2554
2279
|
}), u7 && ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e(u7, r11.__v));
|
|
2555
2280
|
};
|
|
2556
2281
|
var $1a9a8ef576b7773d$var$b = "function" == typeof requestAnimationFrame;
|
|
2557
|
-
|
|
2558
2282
|
function $1a9a8ef576b7773d$var$g(n19) {
|
|
2559
2283
|
var r12 = n19.__c;
|
|
2560
2284
|
"function" == typeof r12 && (n19.__c = void 0, r12());
|
|
2561
2285
|
}
|
|
2562
|
-
|
|
2563
2286
|
function $1a9a8ef576b7773d$var$j(n20) {
|
|
2564
2287
|
n20.__c = n20.__();
|
|
2565
2288
|
}
|
|
2566
|
-
|
|
2567
2289
|
function $dc040a17866866fa$var$S(n1, t1) {
|
|
2568
2290
|
for (var e1 in t1) n1[e1] = t1[e1];
|
|
2569
|
-
|
|
2570
2291
|
return n1;
|
|
2571
2292
|
}
|
|
2572
|
-
|
|
2573
2293
|
function $dc040a17866866fa$var$C(n2, t2) {
|
|
2574
2294
|
for (var e2 in n2) if ("__source" !== e2 && !(e2 in t2)) return !0;
|
|
2575
|
-
|
|
2576
2295
|
for (var r1 in t2) if ("__source" !== r1 && n2[r1] !== t2[r1]) return !0;
|
|
2577
|
-
|
|
2578
2296
|
return !1;
|
|
2579
2297
|
}
|
|
2580
|
-
|
|
2581
2298
|
function $dc040a17866866fa$export$221d75b3f55bb0bd(n3) {
|
|
2582
2299
|
this.props = n3;
|
|
2583
2300
|
}
|
|
2584
|
-
|
|
2585
2301
|
($dc040a17866866fa$export$221d75b3f55bb0bd.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).isPureReactComponent = !0, $dc040a17866866fa$export$221d75b3f55bb0bd.prototype.shouldComponentUpdate = function (n6, t5) {
|
|
2586
2302
|
return $dc040a17866866fa$var$C(this.props, n6) || $dc040a17866866fa$var$C(this.state, t5);
|
|
2587
2303
|
};
|
|
2588
2304
|
var $dc040a17866866fa$var$w = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b;
|
|
2589
|
-
|
|
2590
2305
|
($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b = function (n7) {
|
|
2591
2306
|
n7.type && n7.type.__f && n7.ref && (n7.props.ref = n7.ref, n7.ref = null), $dc040a17866866fa$var$w && $dc040a17866866fa$var$w(n7);
|
|
2592
2307
|
};
|
|
2593
|
-
|
|
2594
2308
|
var $dc040a17866866fa$var$A = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e;
|
|
2595
|
-
|
|
2596
2309
|
($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e = function (n12, t10, e6) {
|
|
2597
2310
|
if (n12.then) {
|
|
2598
2311
|
for (var r5, u1 = t10; u1 = u1.__;) if ((r5 = u1.__c) && r5.__c) return null == t10.__e && (t10.__e = e6.__e, t10.__k = e6.__k), r5.__c(n12, t10);
|
|
2599
2312
|
}
|
|
2600
|
-
|
|
2601
2313
|
$dc040a17866866fa$var$A(n12, t10, e6);
|
|
2602
2314
|
};
|
|
2603
|
-
|
|
2604
2315
|
var $dc040a17866866fa$var$O = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
|
|
2605
|
-
|
|
2606
2316
|
function $dc040a17866866fa$export$74bf444e3cd11ea5() {
|
|
2607
2317
|
this.__u = 0, this.t = null, this.__b = null;
|
|
2608
2318
|
}
|
|
2609
|
-
|
|
2610
2319
|
function $dc040a17866866fa$var$U(n13) {
|
|
2611
2320
|
var t11 = n13.__.__c;
|
|
2612
2321
|
return t11 && t11.__e && t11.__e(n13);
|
|
2613
2322
|
}
|
|
2614
|
-
|
|
2615
2323
|
function $dc040a17866866fa$export$998bcd577473dd93() {
|
|
2616
2324
|
this.u = null, this.o = null;
|
|
2617
2325
|
}
|
|
2618
|
-
|
|
2619
2326
|
($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount = function (n17) {
|
|
2620
2327
|
var t13 = n17.__c;
|
|
2621
2328
|
t13 && t13.__R && t13.__R(), t13 && !0 === n17.__h && (n17.type = null), $dc040a17866866fa$var$O && $dc040a17866866fa$var$O(n17);
|
|
2622
2329
|
}, ($dc040a17866866fa$export$74bf444e3cd11ea5.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).__c = function (n18, t14) {
|
|
2623
2330
|
var e8 = t14.__c,
|
|
2624
|
-
|
|
2331
|
+
r7 = this;
|
|
2625
2332
|
null == r7.t && (r7.t = []), r7.t.push(e8);
|
|
2626
|
-
|
|
2627
2333
|
var u4 = $dc040a17866866fa$var$U(r7.__v),
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2334
|
+
o1 = !1,
|
|
2335
|
+
i1 = function () {
|
|
2336
|
+
o1 || (o1 = !0, e8.__R = null, u4 ? u4(l1) : l1());
|
|
2337
|
+
};
|
|
2633
2338
|
e8.__R = i1;
|
|
2634
|
-
|
|
2635
2339
|
var l1 = function () {
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
}
|
|
2644
|
-
}
|
|
2340
|
+
if (! --r7.__u) {
|
|
2341
|
+
if (r7.state.__e) {
|
|
2342
|
+
var n19 = r7.state.__e;
|
|
2343
|
+
r7.__v.__k[0] = function n22(t17, e9, r8) {
|
|
2344
|
+
return t17 && (t17.__v = null, t17.__k = t17.__k && t17.__k.map(function (t18) {
|
|
2345
|
+
return n22(t18, e9, r8);
|
|
2346
|
+
}), t17.__c && t17.__c.__P === e9 && (t17.__e && r8.insertBefore(t17.__e, t17.__d), t17.__c.__e = !0, t17.__c.__P = r8)), t17;
|
|
2347
|
+
}(n19, n19.__c.__P, n19.__c.__O);
|
|
2348
|
+
}
|
|
2349
|
+
var t15;
|
|
2350
|
+
for (r7.setState({
|
|
2351
|
+
__e: r7.__b = null
|
|
2352
|
+
}); t15 = r7.t.pop();) t15.forceUpdate();
|
|
2645
2353
|
}
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
for (r7.setState({
|
|
2650
|
-
__e: r7.__b = null
|
|
2651
|
-
}); t15 = r7.t.pop();) t15.forceUpdate();
|
|
2652
|
-
}
|
|
2653
|
-
},
|
|
2654
|
-
c1 = !0 === t14.__h;
|
|
2655
|
-
|
|
2354
|
+
},
|
|
2355
|
+
c1 = !0 === t14.__h;
|
|
2656
2356
|
r7.__u++ || c1 || r7.setState({
|
|
2657
2357
|
__e: r7.__b = r7.__v.__k[0]
|
|
2658
2358
|
}), n18.then(i1, i1);
|
|
@@ -2662,8 +2362,7 @@ function $dc040a17866866fa$export$998bcd577473dd93() {
|
|
|
2662
2362
|
if (this.__b) {
|
|
2663
2363
|
if (this.__v.__k) {
|
|
2664
2364
|
var e10 = document.createElement("div"),
|
|
2665
|
-
|
|
2666
|
-
|
|
2365
|
+
r9 = this.__v.__k[0].__c;
|
|
2667
2366
|
this.__v.__k[0] = function n24(t20, e13, r12) {
|
|
2668
2367
|
return t20 && (t20.__c && t20.__c.__H && (t20.__c.__H.__.forEach(function (n25) {
|
|
2669
2368
|
"function" == typeof n25.__c && n25.__c();
|
|
@@ -2672,41 +2371,33 @@ function $dc040a17866866fa$export$998bcd577473dd93() {
|
|
|
2672
2371
|
})), t20;
|
|
2673
2372
|
}(this.__b, e10, r9.__O = r9.__P);
|
|
2674
2373
|
}
|
|
2675
|
-
|
|
2676
2374
|
this.__b = null;
|
|
2677
2375
|
}
|
|
2678
|
-
|
|
2679
2376
|
var u5 = t19.__e && ($fb96b826c0c5f37a$export$c8a8987d4410bf2d)(($fb96b826c0c5f37a$export$ffb0004e005737fa), null, n23.fallback);
|
|
2680
2377
|
return u5 && (u5.__h = null), [($fb96b826c0c5f37a$export$c8a8987d4410bf2d)(($fb96b826c0c5f37a$export$ffb0004e005737fa), null, t19.__e ? null : n23.children), u5];
|
|
2681
2378
|
};
|
|
2682
|
-
|
|
2683
2379
|
var $dc040a17866866fa$var$T = function (n26, t22, e14) {
|
|
2684
2380
|
if (++e14[1] === e14[0] && n26.o.delete(t22), n26.props.revealOrder && ("t" !== n26.props.revealOrder[0] || !n26.o.size)) for (e14 = n26.u; e14;) {
|
|
2685
2381
|
for (; e14.length > 3;) e14.pop()();
|
|
2686
|
-
|
|
2687
2382
|
if (e14[1] < e14[0]) break;
|
|
2688
2383
|
n26.u = e14 = e14[2];
|
|
2689
2384
|
}
|
|
2690
2385
|
};
|
|
2691
|
-
|
|
2692
2386
|
($dc040a17866866fa$export$998bcd577473dd93.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).__e = function (n33) {
|
|
2693
2387
|
var t25 = this,
|
|
2694
|
-
|
|
2695
|
-
|
|
2388
|
+
e16 = $dc040a17866866fa$var$U(t25.__v),
|
|
2389
|
+
r13 = t25.o.get(n33);
|
|
2696
2390
|
return r13[0]++, function (u6) {
|
|
2697
2391
|
var o2 = function () {
|
|
2698
2392
|
t25.props.revealOrder ? (r13.push(u6), $dc040a17866866fa$var$T(t25, n33, r13)) : u6();
|
|
2699
2393
|
};
|
|
2700
|
-
|
|
2701
2394
|
e16 ? e16(o2) : o2();
|
|
2702
2395
|
};
|
|
2703
2396
|
}, $dc040a17866866fa$export$998bcd577473dd93.prototype.render = function (n34) {
|
|
2704
2397
|
this.u = null, this.o = new Map();
|
|
2705
2398
|
var t26 = ($fb96b826c0c5f37a$export$47e4c5b300681277)(n34.children);
|
|
2706
2399
|
n34.revealOrder && "b" === n34.revealOrder[0] && t26.reverse();
|
|
2707
|
-
|
|
2708
2400
|
for (var e17 = t26.length; e17--;) this.o.set(t26[e17], this.u = [1, 0, this.u]);
|
|
2709
|
-
|
|
2710
2401
|
return n34.children;
|
|
2711
2402
|
}, $dc040a17866866fa$export$998bcd577473dd93.prototype.componentDidUpdate = $dc040a17866866fa$export$998bcd577473dd93.prototype.componentDidMount = function () {
|
|
2712
2403
|
var n35 = this;
|
|
@@ -2714,14 +2405,12 @@ var $dc040a17866866fa$var$T = function (n26, t22, e14) {
|
|
|
2714
2405
|
$dc040a17866866fa$var$T(n35, e18, t27);
|
|
2715
2406
|
});
|
|
2716
2407
|
};
|
|
2717
|
-
|
|
2718
2408
|
var $dc040a17866866fa$var$j = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103,
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
};
|
|
2724
|
-
|
|
2409
|
+
$dc040a17866866fa$var$P = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,
|
|
2410
|
+
$dc040a17866866fa$var$V = "undefined" != typeof document,
|
|
2411
|
+
$dc040a17866866fa$var$z = function (n36) {
|
|
2412
|
+
return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i).test(n36);
|
|
2413
|
+
};
|
|
2725
2414
|
($fb96b826c0c5f37a$export$16fa2f45be04daa8).prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function (n39) {
|
|
2726
2415
|
Object.defineProperty(($fb96b826c0c5f37a$export$16fa2f45be04daa8).prototype, n39, {
|
|
2727
2416
|
configurable: !0,
|
|
@@ -2738,54 +2427,42 @@ var $dc040a17866866fa$var$j = "undefined" != typeof Symbol && Symbol.for && Symb
|
|
|
2738
2427
|
});
|
|
2739
2428
|
});
|
|
2740
2429
|
var $dc040a17866866fa$var$H = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).event;
|
|
2741
|
-
|
|
2742
2430
|
function $dc040a17866866fa$var$Z() {}
|
|
2743
|
-
|
|
2744
2431
|
function $dc040a17866866fa$var$Y() {
|
|
2745
2432
|
return this.cancelBubble;
|
|
2746
2433
|
}
|
|
2747
|
-
|
|
2748
2434
|
function $dc040a17866866fa$var$q() {
|
|
2749
2435
|
return this.defaultPrevented;
|
|
2750
2436
|
}
|
|
2751
|
-
|
|
2752
2437
|
($fb96b826c0c5f37a$export$41c562ebe57d11e2).event = function (n40) {
|
|
2753
2438
|
return $dc040a17866866fa$var$H && (n40 = $dc040a17866866fa$var$H(n40)), n40.persist = $dc040a17866866fa$var$Z, n40.isPropagationStopped = $dc040a17866866fa$var$Y, n40.isDefaultPrevented = $dc040a17866866fa$var$q, n40.nativeEvent = n40;
|
|
2754
2439
|
};
|
|
2755
|
-
|
|
2756
2440
|
var $dc040a17866866fa$var$J = {
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
},
|
|
2762
|
-
|
|
2763
|
-
|
|
2441
|
+
configurable: !0,
|
|
2442
|
+
get: function () {
|
|
2443
|
+
return this.class;
|
|
2444
|
+
}
|
|
2445
|
+
},
|
|
2446
|
+
$dc040a17866866fa$var$K = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode;
|
|
2764
2447
|
($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode = function (n41) {
|
|
2765
2448
|
var t31 = n41.type,
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2449
|
+
e21 = n41.props,
|
|
2450
|
+
r14 = e21;
|
|
2769
2451
|
if ("string" == typeof t31) {
|
|
2770
2452
|
var u7 = -1 === t31.indexOf("-");
|
|
2771
|
-
|
|
2772
2453
|
for (var o3 in r14 = {}, e21) {
|
|
2773
2454
|
var i2 = e21[o3];
|
|
2774
2455
|
$dc040a17866866fa$var$V && "children" === o3 && "noscript" === t31 || "value" === o3 && "defaultValue" in e21 && null == i2 || ("defaultValue" === o3 && "value" in e21 && null == e21.value ? o3 = "value" : "download" === o3 && !0 === i2 ? i2 = "" : /ondoubleclick/i.test(o3) ? o3 = "ondblclick" : /^onchange(textarea|input)/i.test(o3 + t31) && !$dc040a17866866fa$var$z(e21.type) ? o3 = "oninput" : /^onfocus$/i.test(o3) ? o3 = "onfocusin" : /^onblur$/i.test(o3) ? o3 = "onfocusout" : /^on(Ani|Tra|Tou|BeforeInp)/.test(o3) ? o3 = o3.toLowerCase() : u7 && $dc040a17866866fa$var$P.test(o3) ? o3 = o3.replace(/[A-Z0-9]/, "-$&").toLowerCase() : null === i2 && (i2 = void 0), r14[o3] = i2);
|
|
2775
2456
|
}
|
|
2776
|
-
|
|
2777
2457
|
"select" == t31 && r14.multiple && Array.isArray(r14.value) && (r14.value = ($fb96b826c0c5f37a$export$47e4c5b300681277)(e21.children).forEach(function (n42) {
|
|
2778
2458
|
n42.props.selected = -1 != r14.value.indexOf(n42.props.value);
|
|
2779
2459
|
})), "select" == t31 && null != r14.defaultValue && (r14.value = ($fb96b826c0c5f37a$export$47e4c5b300681277)(e21.children).forEach(function (n43) {
|
|
2780
2460
|
n43.props.selected = r14.multiple ? -1 != r14.defaultValue.indexOf(n43.props.value) : r14.defaultValue == n43.props.value;
|
|
2781
2461
|
})), n41.props = r14, e21.class != e21.className && ($dc040a17866866fa$var$J.enumerable = "className" in e21, null != e21.className && (r14.class = e21.className), Object.defineProperty(r14, "className", $dc040a17866866fa$var$J));
|
|
2782
2462
|
}
|
|
2783
|
-
|
|
2784
2463
|
n41.$$typeof = $dc040a17866866fa$var$j, $dc040a17866866fa$var$K && $dc040a17866866fa$var$K(n41);
|
|
2785
2464
|
};
|
|
2786
|
-
|
|
2787
2465
|
var $dc040a17866866fa$var$Q = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r;
|
|
2788
|
-
|
|
2789
2466
|
($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r = function (n44) {
|
|
2790
2467
|
$dc040a17866866fa$var$Q && $dc040a17866866fa$var$Q(n44), n44.__c;
|
|
2791
2468
|
};
|
|
@@ -2793,13 +2470,11 @@ const $ec8c39fdad15601a$var$THEME_ICONS = {
|
|
|
2793
2470
|
light: "outline",
|
|
2794
2471
|
dark: "solid"
|
|
2795
2472
|
};
|
|
2796
|
-
|
|
2797
2473
|
class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export$221d75b3f55bb0bd) {
|
|
2798
2474
|
renderIcon(category) {
|
|
2799
2475
|
const {
|
|
2800
2476
|
icon: icon
|
|
2801
2477
|
} = category;
|
|
2802
|
-
|
|
2803
2478
|
if (icon) {
|
|
2804
2479
|
if (icon.svg) return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("span", {
|
|
2805
2480
|
class: "flex",
|
|
@@ -2811,12 +2486,10 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
|
|
|
2811
2486
|
src: icon.src
|
|
2812
2487
|
});
|
|
2813
2488
|
}
|
|
2814
|
-
|
|
2815
2489
|
const categoryIcons = ($fcccfb36ed0cde68$export$2e2bcd8739ae039).categories[category.id] || ($fcccfb36ed0cde68$export$2e2bcd8739ae039).categories.custom;
|
|
2816
2490
|
const style = this.props.icons == "auto" ? $ec8c39fdad15601a$var$THEME_ICONS[this.props.theme] : this.props.icons;
|
|
2817
2491
|
return categoryIcons[style] || categoryIcons;
|
|
2818
2492
|
}
|
|
2819
|
-
|
|
2820
2493
|
render() {
|
|
2821
2494
|
let selectedCategoryIndex = null;
|
|
2822
2495
|
return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("nav", {
|
|
@@ -2856,7 +2529,6 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
|
|
|
2856
2529
|
})
|
|
2857
2530
|
});
|
|
2858
2531
|
}
|
|
2859
|
-
|
|
2860
2532
|
constructor() {
|
|
2861
2533
|
super();
|
|
2862
2534
|
this.categories = ($7adb23b0109cc36a$export$2d0294657ab35f1b).categories.filter(category => {
|
|
@@ -2866,29 +2538,22 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
|
|
|
2866
2538
|
categoryId: this.categories[0].id
|
|
2867
2539
|
};
|
|
2868
2540
|
}
|
|
2869
|
-
|
|
2870
2541
|
}
|
|
2871
|
-
|
|
2872
2542
|
class $e0d4dda61265ff1e$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export$221d75b3f55bb0bd) {
|
|
2873
2543
|
shouldComponentUpdate(nextProps) {
|
|
2874
2544
|
for (let k in nextProps) {
|
|
2875
2545
|
if (k == "children") continue;
|
|
2876
2546
|
if (nextProps[k] != this.props[k]) return true;
|
|
2877
2547
|
}
|
|
2878
|
-
|
|
2879
2548
|
return false;
|
|
2880
2549
|
}
|
|
2881
|
-
|
|
2882
2550
|
render() {
|
|
2883
2551
|
return this.props.children;
|
|
2884
2552
|
}
|
|
2885
|
-
|
|
2886
2553
|
}
|
|
2887
|
-
|
|
2888
2554
|
const $89bd6bb200cc8fef$var$Performance = {
|
|
2889
2555
|
rowsPerRender: 10
|
|
2890
2556
|
};
|
|
2891
|
-
|
|
2892
2557
|
class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export$16fa2f45be04daa8) {
|
|
2893
2558
|
getInitialState(props = this.props) {
|
|
2894
2559
|
return {
|
|
@@ -2896,7 +2561,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
2896
2561
|
theme: this.initTheme(props.theme)
|
|
2897
2562
|
};
|
|
2898
2563
|
}
|
|
2899
|
-
|
|
2900
2564
|
componentWillMount() {
|
|
2901
2565
|
this.dir = ($7adb23b0109cc36a$export$dbe3113d60765c1a).rtl ? "rtl" : "ltr";
|
|
2902
2566
|
this.refs = {
|
|
@@ -2909,17 +2573,14 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
2909
2573
|
skinToneRadio: ($fb96b826c0c5f37a$export$7d1e3a5e95ceca43)()
|
|
2910
2574
|
};
|
|
2911
2575
|
this.initGrid();
|
|
2912
|
-
|
|
2913
2576
|
if (this.props.stickySearch == false && this.props.searchPosition == "sticky") {
|
|
2914
2577
|
console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`.");
|
|
2915
2578
|
this.props.searchPosition = "static";
|
|
2916
2579
|
}
|
|
2917
2580
|
}
|
|
2918
|
-
|
|
2919
2581
|
componentDidMount() {
|
|
2920
2582
|
this.register();
|
|
2921
2583
|
this.shadowRoot = this.base.parentNode;
|
|
2922
|
-
|
|
2923
2584
|
if (this.props.autoFocus) {
|
|
2924
2585
|
const {
|
|
2925
2586
|
searchInput: searchInput
|
|
@@ -2927,32 +2588,25 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
2927
2588
|
if (searchInput.current) searchInput.current.focus();
|
|
2928
2589
|
}
|
|
2929
2590
|
}
|
|
2930
|
-
|
|
2931
2591
|
componentWillReceiveProps(nextProps) {
|
|
2932
2592
|
this.nextState || (this.nextState = {});
|
|
2933
|
-
|
|
2934
2593
|
for (const k1 in nextProps) this.nextState[k1] = nextProps[k1];
|
|
2935
|
-
|
|
2936
2594
|
clearTimeout(this.nextStateTimer);
|
|
2937
2595
|
this.nextStateTimer = setTimeout(() => {
|
|
2938
2596
|
let requiresGridReset = false;
|
|
2939
|
-
|
|
2940
2597
|
for (const k in this.nextState) {
|
|
2941
2598
|
this.props[k] = this.nextState[k];
|
|
2942
2599
|
if (k === "custom" || k === "categories") requiresGridReset = true;
|
|
2943
2600
|
}
|
|
2944
|
-
|
|
2945
2601
|
delete this.nextState;
|
|
2946
2602
|
const nextState = this.getInitialState();
|
|
2947
2603
|
if (requiresGridReset) return this.reset(nextState);
|
|
2948
2604
|
this.setState(nextState);
|
|
2949
2605
|
});
|
|
2950
2606
|
}
|
|
2951
|
-
|
|
2952
2607
|
componentWillUnmount() {
|
|
2953
2608
|
this.unregister();
|
|
2954
2609
|
}
|
|
2955
|
-
|
|
2956
2610
|
async reset(nextState = {}) {
|
|
2957
2611
|
await ($7adb23b0109cc36a$export$2cd8252107eb640b)(this.props);
|
|
2958
2612
|
this.initGrid();
|
|
@@ -2962,35 +2616,28 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
2962
2616
|
this.observeRows();
|
|
2963
2617
|
});
|
|
2964
2618
|
}
|
|
2965
|
-
|
|
2966
2619
|
register() {
|
|
2967
2620
|
document.addEventListener("click", this.handleClickOutside);
|
|
2968
2621
|
this.observe();
|
|
2969
2622
|
}
|
|
2970
|
-
|
|
2971
2623
|
unregister() {
|
|
2972
2624
|
document.removeEventListener("click", this.handleClickOutside);
|
|
2973
2625
|
this.unobserve();
|
|
2974
2626
|
}
|
|
2975
|
-
|
|
2976
2627
|
observe() {
|
|
2977
2628
|
this.observeCategories();
|
|
2978
2629
|
this.observeRows();
|
|
2979
2630
|
}
|
|
2980
|
-
|
|
2981
2631
|
unobserve({
|
|
2982
2632
|
except = []
|
|
2983
2633
|
} = {}) {
|
|
2984
2634
|
if (!Array.isArray(except)) except = [except];
|
|
2985
|
-
|
|
2986
2635
|
for (const observer of this.observers) {
|
|
2987
2636
|
if (except.includes(observer)) continue;
|
|
2988
2637
|
observer.disconnect();
|
|
2989
2638
|
}
|
|
2990
|
-
|
|
2991
2639
|
this.observers = [].concat(except);
|
|
2992
2640
|
}
|
|
2993
|
-
|
|
2994
2641
|
initGrid() {
|
|
2995
2642
|
const {
|
|
2996
2643
|
categories: categories
|
|
@@ -3001,7 +2648,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3001
2648
|
this.navKey = navKey;
|
|
3002
2649
|
this.grid = [];
|
|
3003
2650
|
this.grid.setsize = 0;
|
|
3004
|
-
|
|
3005
2651
|
const addRow = (rows, category) => {
|
|
3006
2652
|
const row = [];
|
|
3007
2653
|
row.__categoryId = category.id;
|
|
@@ -3014,27 +2660,22 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3014
2660
|
rows.push(rowRef);
|
|
3015
2661
|
return row;
|
|
3016
2662
|
};
|
|
3017
|
-
|
|
3018
2663
|
for (let category1 of categories) {
|
|
3019
2664
|
const rows = [];
|
|
3020
2665
|
let row = addRow(rows, category1);
|
|
3021
|
-
|
|
3022
2666
|
for (let emoji of category1.emojis) {
|
|
3023
2667
|
if (row.length == this.getPerLine()) row = addRow(rows, category1);
|
|
3024
2668
|
this.grid.setsize += 1;
|
|
3025
2669
|
row.push(emoji);
|
|
3026
2670
|
}
|
|
3027
|
-
|
|
3028
2671
|
this.refs.categories.set(category1.id, {
|
|
3029
2672
|
root: ($fb96b826c0c5f37a$export$7d1e3a5e95ceca43)(),
|
|
3030
2673
|
rows: rows
|
|
3031
2674
|
});
|
|
3032
2675
|
}
|
|
3033
2676
|
}
|
|
3034
|
-
|
|
3035
2677
|
initTheme(theme) {
|
|
3036
2678
|
if (theme != "auto") return theme;
|
|
3037
|
-
|
|
3038
2679
|
if (!this.darkMedia) {
|
|
3039
2680
|
this.darkMedia = matchMedia("(prefers-color-scheme: dark)");
|
|
3040
2681
|
if (this.darkMedia.media.match(/^not/)) return "light";
|
|
@@ -3045,24 +2686,20 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3045
2686
|
});
|
|
3046
2687
|
});
|
|
3047
2688
|
}
|
|
3048
|
-
|
|
3049
2689
|
return this.darkMedia.matches ? "dark" : "light";
|
|
3050
2690
|
}
|
|
3051
|
-
|
|
3052
2691
|
initDynamicPerLine(props = this.props) {
|
|
3053
2692
|
if (!props.dynamicWidth) return;
|
|
3054
2693
|
const {
|
|
3055
2694
|
element: element,
|
|
3056
2695
|
emojiButtonSize: emojiButtonSize
|
|
3057
2696
|
} = props;
|
|
3058
|
-
|
|
3059
2697
|
const calculatePerLine = () => {
|
|
3060
2698
|
const {
|
|
3061
2699
|
width: width
|
|
3062
2700
|
} = element.getBoundingClientRect();
|
|
3063
2701
|
return Math.floor(width / emojiButtonSize);
|
|
3064
2702
|
};
|
|
3065
|
-
|
|
3066
2703
|
const observer = new ResizeObserver(() => {
|
|
3067
2704
|
this.unobserve({
|
|
3068
2705
|
except: observer
|
|
@@ -3081,29 +2718,24 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3081
2718
|
this.observers.push(observer);
|
|
3082
2719
|
return calculatePerLine();
|
|
3083
2720
|
}
|
|
3084
|
-
|
|
3085
2721
|
getPerLine() {
|
|
3086
2722
|
return this.state.perLine || this.props.perLine;
|
|
3087
2723
|
}
|
|
3088
|
-
|
|
3089
2724
|
getEmojiByPos([p1, p2]) {
|
|
3090
2725
|
const grid = this.state.searchResults || this.grid;
|
|
3091
2726
|
const emoji = grid[p1] && grid[p1][p2];
|
|
3092
2727
|
if (!emoji) return;
|
|
3093
2728
|
return ($c4d155af13ad4d4b$export$2e2bcd8739ae039).get(emoji);
|
|
3094
2729
|
}
|
|
3095
|
-
|
|
3096
2730
|
observeCategories() {
|
|
3097
2731
|
const navigation = this.refs.navigation.current;
|
|
3098
2732
|
if (!navigation) return;
|
|
3099
2733
|
const visibleCategories = new Map();
|
|
3100
|
-
|
|
3101
2734
|
const setFocusedCategory = categoryId => {
|
|
3102
2735
|
if (categoryId != navigation.state.categoryId) navigation.setState({
|
|
3103
2736
|
categoryId: categoryId
|
|
3104
2737
|
});
|
|
3105
2738
|
};
|
|
3106
|
-
|
|
3107
2739
|
const observerOptions = {
|
|
3108
2740
|
root: this.refs.scroll.current,
|
|
3109
2741
|
threshold: [0.0, 1.0]
|
|
@@ -3113,31 +2745,26 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3113
2745
|
const id = entry.target.dataset.id;
|
|
3114
2746
|
visibleCategories.set(id, entry.intersectionRatio);
|
|
3115
2747
|
}
|
|
3116
|
-
|
|
3117
2748
|
const ratios = [...visibleCategories];
|
|
3118
|
-
|
|
3119
2749
|
for (const [id, ratio] of ratios) if (ratio) {
|
|
3120
2750
|
setFocusedCategory(id);
|
|
3121
2751
|
break;
|
|
3122
2752
|
}
|
|
3123
2753
|
}, observerOptions);
|
|
3124
|
-
|
|
3125
2754
|
for (const {
|
|
3126
2755
|
root: root
|
|
3127
2756
|
} of this.refs.categories.values()) observer.observe(root.current);
|
|
3128
|
-
|
|
3129
2757
|
this.observers.push(observer);
|
|
3130
2758
|
}
|
|
3131
|
-
|
|
3132
2759
|
observeRows() {
|
|
3133
|
-
const visibleRows = {
|
|
2760
|
+
const visibleRows = {
|
|
2761
|
+
...this.state.visibleRows
|
|
3134
2762
|
};
|
|
3135
2763
|
const observer = new IntersectionObserver(entries => {
|
|
3136
2764
|
for (const entry of entries) {
|
|
3137
2765
|
const index = parseInt(entry.target.dataset.index);
|
|
3138
2766
|
if (entry.isIntersecting) visibleRows[index] = true;else delete visibleRows[index];
|
|
3139
2767
|
}
|
|
3140
|
-
|
|
3141
2768
|
this.setState({
|
|
3142
2769
|
visibleRows: visibleRows
|
|
3143
2770
|
});
|
|
@@ -3145,26 +2772,21 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3145
2772
|
root: this.refs.scroll.current,
|
|
3146
2773
|
rootMargin: `${this.props.emojiButtonSize * ($89bd6bb200cc8fef$var$Performance.rowsPerRender + 5)}px 0px ${this.props.emojiButtonSize * $89bd6bb200cc8fef$var$Performance.rowsPerRender}px`
|
|
3147
2774
|
});
|
|
3148
|
-
|
|
3149
2775
|
for (const {
|
|
3150
2776
|
rows: rows
|
|
3151
2777
|
} of this.refs.categories.values()) {
|
|
3152
2778
|
for (const row of rows) if (row.current) observer.observe(row.current);
|
|
3153
2779
|
}
|
|
3154
|
-
|
|
3155
2780
|
this.observers.push(observer);
|
|
3156
2781
|
}
|
|
3157
|
-
|
|
3158
2782
|
preventDefault(e) {
|
|
3159
2783
|
e.preventDefault();
|
|
3160
2784
|
}
|
|
3161
|
-
|
|
3162
2785
|
unfocusSearch() {
|
|
3163
2786
|
const input = this.refs.searchInput.current;
|
|
3164
2787
|
if (!input) return;
|
|
3165
2788
|
input.blur();
|
|
3166
2789
|
}
|
|
3167
|
-
|
|
3168
2790
|
navigate({
|
|
3169
2791
|
e: e,
|
|
3170
2792
|
input: input,
|
|
@@ -3176,53 +2798,42 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3176
2798
|
const grid = this.state.searchResults || this.grid;
|
|
3177
2799
|
if (!grid.length) return;
|
|
3178
2800
|
let [p1, p2] = this.state.pos;
|
|
3179
|
-
|
|
3180
2801
|
const pos = (() => {
|
|
3181
2802
|
if (p1 == 0) {
|
|
3182
2803
|
if (p2 == 0 && !e.repeat && (left || up)) return null;
|
|
3183
2804
|
}
|
|
3184
|
-
|
|
3185
2805
|
if (p1 == -1) {
|
|
3186
2806
|
if (!e.repeat && (right || down) && input.selectionStart == input.value.length) return [0, 0];
|
|
3187
2807
|
return null;
|
|
3188
2808
|
}
|
|
3189
|
-
|
|
3190
2809
|
if (left || right) {
|
|
3191
2810
|
let row = grid[p1];
|
|
3192
2811
|
const increment = left ? -1 : 1;
|
|
3193
2812
|
p2 += increment;
|
|
3194
|
-
|
|
3195
2813
|
if (!row[p2]) {
|
|
3196
2814
|
p1 += increment;
|
|
3197
2815
|
row = grid[p1];
|
|
3198
|
-
|
|
3199
2816
|
if (!row) {
|
|
3200
2817
|
p1 = left ? 0 : grid.length - 1;
|
|
3201
2818
|
p2 = left ? 0 : grid[p1].length - 1;
|
|
3202
2819
|
return [p1, p2];
|
|
3203
2820
|
}
|
|
3204
|
-
|
|
3205
2821
|
p2 = left ? row.length - 1 : 0;
|
|
3206
2822
|
}
|
|
3207
|
-
|
|
3208
2823
|
return [p1, p2];
|
|
3209
2824
|
}
|
|
3210
|
-
|
|
3211
2825
|
if (up || down) {
|
|
3212
2826
|
p1 += up ? -1 : 1;
|
|
3213
2827
|
const row = grid[p1];
|
|
3214
|
-
|
|
3215
2828
|
if (!row) {
|
|
3216
2829
|
p1 = up ? 0 : grid.length - 1;
|
|
3217
2830
|
p2 = up ? 0 : grid[p1].length - 1;
|
|
3218
2831
|
return [p1, p2];
|
|
3219
2832
|
}
|
|
3220
|
-
|
|
3221
2833
|
if (!row[p2]) p2 = row.length - 1;
|
|
3222
2834
|
return [p1, p2];
|
|
3223
2835
|
}
|
|
3224
2836
|
})();
|
|
3225
|
-
|
|
3226
2837
|
if (pos) e.preventDefault();else {
|
|
3227
2838
|
if (this.state.pos[0] > -1) this.setState({
|
|
3228
2839
|
pos: [-1, -1]
|
|
@@ -3238,7 +2849,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3238
2849
|
});
|
|
3239
2850
|
});
|
|
3240
2851
|
}
|
|
3241
|
-
|
|
3242
2852
|
scrollTo({
|
|
3243
2853
|
categoryId: categoryId,
|
|
3244
2854
|
row: row
|
|
@@ -3249,13 +2859,11 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3249
2859
|
const scrollRect = scroll.getBoundingClientRect();
|
|
3250
2860
|
let scrollTop = 0;
|
|
3251
2861
|
if (row >= 0) categoryId = grid[row].__categoryId;
|
|
3252
|
-
|
|
3253
2862
|
if (categoryId) {
|
|
3254
2863
|
const ref = this.refs[categoryId] || this.refs.categories.get(categoryId).root;
|
|
3255
2864
|
const categoryRect = ref.current.getBoundingClientRect();
|
|
3256
2865
|
scrollTop = categoryRect.top - (scrollRect.top - scroll.scrollTop) + 1;
|
|
3257
2866
|
}
|
|
3258
|
-
|
|
3259
2867
|
if (row >= 0) {
|
|
3260
2868
|
if (!row) scrollTop = 0;else {
|
|
3261
2869
|
const rowIndex = grid[row].__index;
|
|
@@ -3264,11 +2872,9 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3264
2872
|
if (rowTop < scroll.scrollTop) scrollTop = rowTop;else if (rowBot > scroll.scrollTop + scrollRect.height) scrollTop = rowBot - scrollRect.height;else return;
|
|
3265
2873
|
}
|
|
3266
2874
|
}
|
|
3267
|
-
|
|
3268
2875
|
this.ignoreMouse();
|
|
3269
2876
|
scroll.scrollTop = scrollTop;
|
|
3270
2877
|
}
|
|
3271
|
-
|
|
3272
2878
|
ignoreMouse() {
|
|
3273
2879
|
this.mouseIsIgnored = true;
|
|
3274
2880
|
clearTimeout(this.ignoreMouseTimer);
|
|
@@ -3276,7 +2882,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3276
2882
|
delete this.mouseIsIgnored;
|
|
3277
2883
|
}, 100);
|
|
3278
2884
|
}
|
|
3279
|
-
|
|
3280
2885
|
handleEmojiOver(pos) {
|
|
3281
2886
|
if (this.mouseIsIgnored || this.state.showSkins) return;
|
|
3282
2887
|
this.setState({
|
|
@@ -3284,7 +2889,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3284
2889
|
keyboard: false
|
|
3285
2890
|
});
|
|
3286
2891
|
}
|
|
3287
|
-
|
|
3288
2892
|
handleEmojiClick({
|
|
3289
2893
|
e: e,
|
|
3290
2894
|
emoji: emoji,
|
|
@@ -3292,7 +2896,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3292
2896
|
}) {
|
|
3293
2897
|
if (!this.props.onEmojiSelect) return;
|
|
3294
2898
|
if (!emoji && pos) emoji = this.getEmojiByPos(pos);
|
|
3295
|
-
|
|
3296
2899
|
if (emoji) {
|
|
3297
2900
|
const emojiData = ($693b183b0a78708f$export$d10ac59fbe52a745)(emoji, {
|
|
3298
2901
|
skinIndex: this.state.skin - 1
|
|
@@ -3301,7 +2904,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3301
2904
|
this.props.onEmojiSelect(emojiData, e);
|
|
3302
2905
|
}
|
|
3303
2906
|
}
|
|
3304
|
-
|
|
3305
2907
|
closeSkins() {
|
|
3306
2908
|
if (!this.state.showSkins) return;
|
|
3307
2909
|
this.setState({
|
|
@@ -3311,13 +2913,11 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3311
2913
|
this.base.removeEventListener("click", this.handleBaseClick);
|
|
3312
2914
|
this.base.removeEventListener("keydown", this.handleBaseKeydown);
|
|
3313
2915
|
}
|
|
3314
|
-
|
|
3315
2916
|
handleSkinMouseOver(tempSkin) {
|
|
3316
2917
|
this.setState({
|
|
3317
2918
|
tempSkin: tempSkin
|
|
3318
2919
|
});
|
|
3319
2920
|
}
|
|
3320
|
-
|
|
3321
2921
|
handleSkinClick(skin) {
|
|
3322
2922
|
this.ignoreMouse();
|
|
3323
2923
|
this.closeSkins();
|
|
@@ -3327,7 +2927,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3327
2927
|
});
|
|
3328
2928
|
($f72b75cf796873c7$export$2e2bcd8739ae039).set("skin", skin);
|
|
3329
2929
|
}
|
|
3330
|
-
|
|
3331
2930
|
renderNav() {
|
|
3332
2931
|
return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($ec8c39fdad15601a$export$2e2bcd8739ae039), {
|
|
3333
2932
|
ref: this.refs.navigation,
|
|
@@ -3339,7 +2938,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3339
2938
|
onClick: this.handleCategoryClick
|
|
3340
2939
|
}, this.navKey);
|
|
3341
2940
|
}
|
|
3342
|
-
|
|
3343
2941
|
renderPreview() {
|
|
3344
2942
|
const emoji = this.getEmojiByPos(this.state.pos);
|
|
3345
2943
|
const noSearchResults = this.state.searchResults && !this.state.searchResults.length;
|
|
@@ -3384,7 +2982,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3384
2982
|
}), !emoji && this.props.skinTonePosition == "preview" && this.renderSkinToneButton()]
|
|
3385
2983
|
});
|
|
3386
2984
|
}
|
|
3387
|
-
|
|
3388
2985
|
renderEmojiButton(emoji, {
|
|
3389
2986
|
pos: pos,
|
|
3390
2987
|
posinset: posinset,
|
|
@@ -3440,7 +3037,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3440
3037
|
})
|
|
3441
3038
|
}, key);
|
|
3442
3039
|
}
|
|
3443
|
-
|
|
3444
3040
|
renderSearch() {
|
|
3445
3041
|
const renderSkinTone = this.props.previewPosition == "none" || this.props.skinTonePosition == "search";
|
|
3446
3042
|
return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("div", {
|
|
@@ -3474,7 +3070,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3474
3070
|
})]
|
|
3475
3071
|
});
|
|
3476
3072
|
}
|
|
3477
|
-
|
|
3478
3073
|
renderSearchResults() {
|
|
3479
3074
|
const {
|
|
3480
3075
|
searchResults: searchResults
|
|
@@ -3508,7 +3103,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3508
3103
|
})]
|
|
3509
3104
|
});
|
|
3510
3105
|
}
|
|
3511
|
-
|
|
3512
3106
|
renderCategories() {
|
|
3513
3107
|
const {
|
|
3514
3108
|
categories: categories
|
|
@@ -3575,7 +3169,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3575
3169
|
})
|
|
3576
3170
|
});
|
|
3577
3171
|
}
|
|
3578
|
-
|
|
3579
3172
|
renderSkinToneButton() {
|
|
3580
3173
|
if (this.props.skinTonePosition == "none") return null;
|
|
3581
3174
|
return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("div", {
|
|
@@ -3603,7 +3196,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3603
3196
|
})
|
|
3604
3197
|
});
|
|
3605
3198
|
}
|
|
3606
|
-
|
|
3607
3199
|
renderLiveRegion() {
|
|
3608
3200
|
const emoji = this.getEmojiByPos(this.state.pos);
|
|
3609
3201
|
const contents = emoji ? emoji.name : "";
|
|
@@ -3613,7 +3205,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3613
3205
|
children: contents
|
|
3614
3206
|
});
|
|
3615
3207
|
}
|
|
3616
|
-
|
|
3617
3208
|
renderSkins() {
|
|
3618
3209
|
const skinToneButton = this.refs.skinToneButton.current;
|
|
3619
3210
|
const skinToneButtonRect = skinToneButton.getBoundingClientRect();
|
|
@@ -3668,7 +3259,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3668
3259
|
})
|
|
3669
3260
|
});
|
|
3670
3261
|
}
|
|
3671
|
-
|
|
3672
3262
|
render() {
|
|
3673
3263
|
const lineWidth = this.props.perLine * this.props.emojiButtonSize;
|
|
3674
3264
|
return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("section", {
|
|
@@ -3697,14 +3287,12 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3697
3287
|
}), this.props.navPosition == "bottom" && this.renderNav(), this.props.previewPosition == "bottom" && this.renderPreview(), this.state.showSkins && this.renderSkins(), this.renderLiveRegion()]
|
|
3698
3288
|
});
|
|
3699
3289
|
}
|
|
3700
|
-
|
|
3701
3290
|
constructor(props) {
|
|
3702
3291
|
super();
|
|
3703
3292
|
($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleClickOutside", e => {
|
|
3704
3293
|
const {
|
|
3705
3294
|
element: element
|
|
3706
3295
|
} = this.props;
|
|
3707
|
-
|
|
3708
3296
|
if (e.target != element) {
|
|
3709
3297
|
if (this.state.showSkins) this.closeSkins();
|
|
3710
3298
|
if (this.props.onClickOutside) this.props.onClickOutside(e);
|
|
@@ -3712,7 +3300,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3712
3300
|
});
|
|
3713
3301
|
($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleBaseClick", e => {
|
|
3714
3302
|
if (!this.state.showSkins) return;
|
|
3715
|
-
|
|
3716
3303
|
if (!e.target.closest(".menu")) {
|
|
3717
3304
|
e.preventDefault();
|
|
3718
3305
|
e.stopImmediatePropagation();
|
|
@@ -3721,7 +3308,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3721
3308
|
});
|
|
3722
3309
|
($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleBaseKeydown", e => {
|
|
3723
3310
|
if (!this.state.showSkins) return;
|
|
3724
|
-
|
|
3725
3311
|
if (e.key == "Escape") {
|
|
3726
3312
|
e.preventDefault();
|
|
3727
3313
|
e.stopImmediatePropagation();
|
|
@@ -3742,12 +3328,10 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3742
3328
|
value: value
|
|
3743
3329
|
} = input;
|
|
3744
3330
|
const searchResults = await ($c4d155af13ad4d4b$export$2e2bcd8739ae039).search(value);
|
|
3745
|
-
|
|
3746
3331
|
const afterRender = () => {
|
|
3747
3332
|
if (!this.refs.scroll.current) return;
|
|
3748
3333
|
this.refs.scroll.current.scrollTop = 0;
|
|
3749
3334
|
};
|
|
3750
|
-
|
|
3751
3335
|
if (!searchResults) return this.setState({
|
|
3752
3336
|
searchResults: searchResults,
|
|
3753
3337
|
pos: [-1, -1]
|
|
@@ -3756,7 +3340,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3756
3340
|
const grid = [];
|
|
3757
3341
|
grid.setsize = searchResults.length;
|
|
3758
3342
|
let row = null;
|
|
3759
|
-
|
|
3760
3343
|
for (let emoji of searchResults) {
|
|
3761
3344
|
if (!grid.length || row.length == this.getPerLine()) {
|
|
3762
3345
|
row = [];
|
|
@@ -3764,10 +3347,8 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3764
3347
|
row.__index = grid.length;
|
|
3765
3348
|
grid.push(row);
|
|
3766
3349
|
}
|
|
3767
|
-
|
|
3768
3350
|
row.push(emoji);
|
|
3769
3351
|
}
|
|
3770
|
-
|
|
3771
3352
|
this.ignoreMouse();
|
|
3772
3353
|
this.setState({
|
|
3773
3354
|
searchResults: grid,
|
|
@@ -3778,7 +3359,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3778
3359
|
// const specialKey = e.altKey || e.ctrlKey || e.metaKey
|
|
3779
3360
|
const input = e.currentTarget;
|
|
3780
3361
|
e.stopImmediatePropagation();
|
|
3781
|
-
|
|
3782
3362
|
switch (e.key) {
|
|
3783
3363
|
case "ArrowLeft":
|
|
3784
3364
|
// if (specialKey) return
|
|
@@ -3789,7 +3369,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3789
3369
|
left: true
|
|
3790
3370
|
});
|
|
3791
3371
|
break;
|
|
3792
|
-
|
|
3793
3372
|
case "ArrowRight":
|
|
3794
3373
|
// if (specialKey) return
|
|
3795
3374
|
// e.preventDefault()
|
|
@@ -3799,7 +3378,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3799
3378
|
right: true
|
|
3800
3379
|
});
|
|
3801
3380
|
break;
|
|
3802
|
-
|
|
3803
3381
|
case "ArrowUp":
|
|
3804
3382
|
// if (specialKey) return
|
|
3805
3383
|
// e.preventDefault()
|
|
@@ -3809,7 +3387,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3809
3387
|
up: true
|
|
3810
3388
|
});
|
|
3811
3389
|
break;
|
|
3812
|
-
|
|
3813
3390
|
case "ArrowDown":
|
|
3814
3391
|
// if (specialKey) return
|
|
3815
3392
|
// e.preventDefault()
|
|
@@ -3819,7 +3396,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3819
3396
|
down: true
|
|
3820
3397
|
});
|
|
3821
3398
|
break;
|
|
3822
|
-
|
|
3823
3399
|
case "Enter":
|
|
3824
3400
|
e.preventDefault();
|
|
3825
3401
|
this.handleEmojiClick({
|
|
@@ -3827,7 +3403,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3827
3403
|
pos: this.state.pos
|
|
3828
3404
|
});
|
|
3829
3405
|
break;
|
|
3830
|
-
|
|
3831
3406
|
case "Escape":
|
|
3832
3407
|
e.preventDefault();
|
|
3833
3408
|
if (this.state.searchResults) this.clearSearch();else this.unfocusSearch();
|
|
@@ -3879,32 +3454,26 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
|
|
|
3879
3454
|
...this.getInitialState(props)
|
|
3880
3455
|
};
|
|
3881
3456
|
}
|
|
3882
|
-
|
|
3883
3457
|
}
|
|
3884
|
-
|
|
3885
3458
|
class $efa000751917694d$export$2e2bcd8739ae039 extends ($26f27c338a96b1a6$export$2e2bcd8739ae039) {
|
|
3886
3459
|
async connectedCallback() {
|
|
3887
3460
|
const props = ($7adb23b0109cc36a$export$75fe5f91d452f94b)(this.props, ($b247ea80b67298d5$export$2e2bcd8739ae039), this);
|
|
3888
3461
|
props.element = this;
|
|
3889
|
-
|
|
3890
3462
|
props.ref = component => {
|
|
3891
3463
|
this.component = component;
|
|
3892
3464
|
};
|
|
3893
|
-
|
|
3894
3465
|
await ($7adb23b0109cc36a$export$2cd8252107eb640b)(props);
|
|
3895
3466
|
if (this.disconnected) return;
|
|
3896
|
-
($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($89bd6bb200cc8fef$export$2e2bcd8739ae039), {
|
|
3467
|
+
($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($89bd6bb200cc8fef$export$2e2bcd8739ae039), {
|
|
3468
|
+
...props
|
|
3897
3469
|
}), this.shadowRoot);
|
|
3898
3470
|
}
|
|
3899
|
-
|
|
3900
3471
|
constructor(props) {
|
|
3901
3472
|
super(props, {
|
|
3902
3473
|
styles: (/*@__PURE__*/$parcel$interopDefault($329d53ba9fd7125f$exports))
|
|
3903
3474
|
});
|
|
3904
3475
|
}
|
|
3905
|
-
|
|
3906
3476
|
}
|
|
3907
|
-
|
|
3908
3477
|
($c770c458706daa72$export$2e2bcd8739ae039)($efa000751917694d$export$2e2bcd8739ae039, "Props", ($b247ea80b67298d5$export$2e2bcd8739ae039));
|
|
3909
3478
|
if (typeof customElements !== "undefined" && !customElements.get("em-emoji-picker")) customElements.define("em-emoji-picker", $efa000751917694d$export$2e2bcd8739ae039);
|
|
3910
3479
|
var $329d53ba9fd7125f$exports = {};
|
|
@@ -3915,7 +3484,8 @@ function $e5534fc185f7111e$export$2e2bcd8739ae039(props) {
|
|
|
3915
3484
|
const instance = (React.useRef)(null);
|
|
3916
3485
|
if (instance.current) instance.current.update(props);
|
|
3917
3486
|
(React.useEffect)(() => {
|
|
3918
|
-
instance.current = new ($efa000751917694d$export$2e2bcd8739ae039)({
|
|
3487
|
+
instance.current = new ($efa000751917694d$export$2e2bcd8739ae039)({
|
|
3488
|
+
...props,
|
|
3919
3489
|
ref: ref
|
|
3920
3490
|
});
|
|
3921
3491
|
return () => {
|
|
@@ -3941,23 +3511,20 @@ function $e5534fc185f7111e$export$2e2bcd8739ae039(props) {
|
|
|
3941
3511
|
* @param {Props} props
|
|
3942
3512
|
* @return {React.FC}
|
|
3943
3513
|
*/
|
|
3944
|
-
|
|
3945
3514
|
function EmojiPicker(props) {
|
|
3946
3515
|
var theme = props.theme,
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
/** @type {string[]} */
|
|
3516
|
+
onSelectEmoji = props.onSelectEmoji,
|
|
3517
|
+
disableRecent = props.disableRecent,
|
|
3518
|
+
customEmojis = props.customEmojis,
|
|
3519
|
+
language = props.language;
|
|
3952
3520
|
|
|
3521
|
+
/** @type {string[]} */
|
|
3953
3522
|
var categories = React.useMemo(function () {
|
|
3954
3523
|
/** @type {string[]} */
|
|
3955
3524
|
var categoryies = [];
|
|
3956
|
-
|
|
3957
3525
|
if (!disableRecent) {
|
|
3958
3526
|
categoryies.push("frequent");
|
|
3959
3527
|
}
|
|
3960
|
-
|
|
3961
3528
|
categoryies = [].concat(_toConsumableArray(categoryies), ["people", "nature", "foods", "activity", "places", "objects", "symbols", "flags"]);
|
|
3962
3529
|
return categoryies;
|
|
3963
3530
|
}, [disableRecent]);
|
|
@@ -3965,7 +3532,6 @@ function EmojiPicker(props) {
|
|
|
3965
3532
|
if (!language) {
|
|
3966
3533
|
return undefined;
|
|
3967
3534
|
}
|
|
3968
|
-
|
|
3969
3535
|
return require("@emoji-mart/data/i18n/".concat(language !== null && language !== void 0 ? language : 'en', ".json"));
|
|
3970
3536
|
}, [language]);
|
|
3971
3537
|
return /*#__PURE__*/React__default["default"].createElement($e5534fc185f7111e$export$2e2bcd8739ae039, {
|
|
@@ -3979,7 +3545,6 @@ function EmojiPicker(props) {
|
|
|
3979
3545
|
i18n: i18n
|
|
3980
3546
|
});
|
|
3981
3547
|
}
|
|
3982
|
-
|
|
3983
3548
|
var EmojiPicker$1 = /*#__PURE__*/React.memo(EmojiPicker);
|
|
3984
3549
|
|
|
3985
3550
|
/**
|
|
@@ -3998,15 +3563,14 @@ var EmojiPicker$1 = /*#__PURE__*/React.memo(EmojiPicker);
|
|
|
3998
3563
|
* @param {Props} props
|
|
3999
3564
|
* @return {JSX.Element}
|
|
4000
3565
|
*/
|
|
4001
|
-
|
|
4002
3566
|
function EmojiPickerContainer(_ref) {
|
|
4003
3567
|
var showPicker = _ref.showPicker,
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
3568
|
+
theme = _ref.theme,
|
|
3569
|
+
handleSelectEmoji = _ref.handleSelectEmoji,
|
|
3570
|
+
disableRecent = _ref.disableRecent,
|
|
3571
|
+
customEmojis = _ref.customEmojis,
|
|
3572
|
+
position = _ref.position,
|
|
3573
|
+
language = _ref.language;
|
|
4010
3574
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4011
3575
|
className: "react-emoji-picker--container"
|
|
4012
3576
|
}, showPicker && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -4029,6 +3593,7 @@ function EmojiPickerContainer(_ref) {
|
|
|
4029
3593
|
}
|
|
4030
3594
|
|
|
4031
3595
|
var EMOJI_PICKER_CONTAINER_HEIGHT = 435;
|
|
3596
|
+
|
|
4032
3597
|
/**
|
|
4033
3598
|
* @typedef {import('../types/types').SanitizeFn} SanitizeFn
|
|
4034
3599
|
*/
|
|
@@ -4047,42 +3612,37 @@ var EMOJI_PICKER_CONTAINER_HEIGHT = 435;
|
|
|
4047
3612
|
* @property {(fn: PolluteFn) => void} addPolluteFn
|
|
4048
3613
|
* @property {(html: string) => void} appendContent
|
|
4049
3614
|
* @property {HTMLDivElement=} buttonElement
|
|
3615
|
+
* @property {React.MutableRefObject=} buttonRef
|
|
4050
3616
|
* @property {import('../types/types').Languages=} language
|
|
4051
3617
|
*/
|
|
4052
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4053
3618
|
|
|
3619
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4054
3620
|
/** @type {React.FC<Props>} */
|
|
4055
|
-
|
|
4056
3621
|
var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
|
|
4057
3622
|
var theme = props.theme,
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
3623
|
+
keepOpened = props.keepOpened,
|
|
3624
|
+
disableRecent = props.disableRecent,
|
|
3625
|
+
customEmojis = props.customEmojis,
|
|
3626
|
+
addSanitizeFn = props.addSanitizeFn,
|
|
3627
|
+
addPolluteFn = props.addPolluteFn,
|
|
3628
|
+
appendContent = props.appendContent,
|
|
3629
|
+
buttonElement = props.buttonElement,
|
|
3630
|
+
buttonRef = props.buttonRef,
|
|
3631
|
+
language = props.language;
|
|
4067
3632
|
var _useState = React.useState(false),
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
3633
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3634
|
+
showPicker = _useState2[0],
|
|
3635
|
+
setShowPicker = _useState2[1];
|
|
4071
3636
|
/** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
3637
|
var _useState3 = React.useState(),
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
3638
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3639
|
+
customButton = _useState4[0],
|
|
3640
|
+
setCustomButton = _useState4[1];
|
|
4078
3641
|
/** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
3642
|
var _useState5 = React.useState(),
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
3643
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3644
|
+
emojiPickerPosition = _useState6[0],
|
|
3645
|
+
setEmojiPickerPosition = _useState6[1];
|
|
4086
3646
|
React.useEffect(function () {
|
|
4087
3647
|
addSanitizeFn(replaceAllTextEmojiToString);
|
|
4088
3648
|
}, [addSanitizeFn]);
|
|
@@ -4098,24 +3658,21 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
|
|
|
4098
3658
|
/** @type {HTMLElement} */
|
|
4099
3659
|
// @ts-ignore
|
|
4100
3660
|
var element = event.target;
|
|
4101
|
-
|
|
4102
3661
|
if (element.classList.contains("react-input-emoji--button") || element.classList.contains("react-input-emoji--button--icon")) {
|
|
4103
3662
|
return;
|
|
4104
3663
|
}
|
|
4105
|
-
|
|
4106
3664
|
setShowPicker(false);
|
|
4107
3665
|
}
|
|
4108
|
-
|
|
4109
3666
|
document.addEventListener("click", checkClickOutside);
|
|
4110
3667
|
return function () {
|
|
4111
3668
|
document.removeEventListener("click", checkClickOutside);
|
|
4112
3669
|
};
|
|
4113
3670
|
}, []);
|
|
3671
|
+
|
|
4114
3672
|
/**
|
|
4115
3673
|
*
|
|
4116
3674
|
* @param {React.MouseEvent} event
|
|
4117
3675
|
*/
|
|
4118
|
-
|
|
4119
3676
|
function toggleShowPicker(event) {
|
|
4120
3677
|
event.stopPropagation();
|
|
4121
3678
|
event.preventDefault();
|
|
@@ -4124,18 +3681,18 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
|
|
|
4124
3681
|
return !currentShowPicker;
|
|
4125
3682
|
});
|
|
4126
3683
|
}
|
|
3684
|
+
|
|
4127
3685
|
/**
|
|
4128
3686
|
*
|
|
4129
3687
|
* @param {React.MouseEvent} event
|
|
4130
3688
|
* @return {'above' | 'below'}
|
|
4131
3689
|
*/
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
3690
|
function calcTopPosition(event) {
|
|
4135
3691
|
var btn = event.currentTarget;
|
|
4136
3692
|
var btnRect = btn.getBoundingClientRect();
|
|
4137
|
-
var popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;
|
|
3693
|
+
var popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;
|
|
4138
3694
|
|
|
3695
|
+
// Decide to display above or below based on available space
|
|
4139
3696
|
if (btnRect.top >= popoverHeight) {
|
|
4140
3697
|
// Display above
|
|
4141
3698
|
return 'above';
|
|
@@ -4143,30 +3700,31 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
|
|
|
4143
3700
|
// Display below
|
|
4144
3701
|
return 'below';
|
|
4145
3702
|
}
|
|
4146
|
-
}
|
|
3703
|
+
}
|
|
4147
3704
|
|
|
3705
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4148
3706
|
/**
|
|
4149
3707
|
*
|
|
4150
3708
|
* @param {import("../types/types").EmojiMartItem} emoji
|
|
4151
3709
|
*/
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
3710
|
function handleSelectEmoji(emoji) {
|
|
4155
3711
|
appendContent(getImageEmoji(emoji));
|
|
4156
|
-
|
|
4157
3712
|
if (!keepOpened) {
|
|
4158
3713
|
setShowPicker(function (currentShowPicker) {
|
|
4159
3714
|
return !currentShowPicker;
|
|
4160
3715
|
});
|
|
4161
3716
|
}
|
|
4162
3717
|
}
|
|
4163
|
-
|
|
4164
3718
|
React.useEffect(function () {
|
|
4165
|
-
|
|
3719
|
+
var _buttonRef$current;
|
|
3720
|
+
if (buttonRef !== null && buttonRef !== void 0 && (_buttonRef$current = buttonRef.current) !== null && _buttonRef$current !== void 0 && _buttonRef$current.style) {
|
|
3721
|
+
buttonRef.current.style.position = "relative";
|
|
3722
|
+
setCustomButton(buttonRef.current);
|
|
3723
|
+
} else if (buttonElement !== null && buttonElement !== void 0 && buttonElement.style) {
|
|
4166
3724
|
buttonElement.style.position = "relative";
|
|
4167
3725
|
setCustomButton(buttonElement);
|
|
4168
3726
|
}
|
|
4169
|
-
}, [buttonElement]);
|
|
3727
|
+
}, [buttonRef, buttonElement]);
|
|
4170
3728
|
return customButton ? /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(EmojiPickerContainer, {
|
|
4171
3729
|
showPicker: showPicker,
|
|
4172
3730
|
theme: theme,
|
|
@@ -4178,7 +3736,8 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
|
|
|
4178
3736
|
}), /*#__PURE__*/React__default["default"].createElement(EmojiPickerButton, {
|
|
4179
3737
|
showPicker: showPicker,
|
|
4180
3738
|
toggleShowPicker: toggleShowPicker,
|
|
4181
|
-
buttonElement: customButton
|
|
3739
|
+
buttonElement: customButton,
|
|
3740
|
+
buttonRef: buttonRef
|
|
4182
3741
|
})), customButton) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(EmojiPickerContainer, {
|
|
4183
3742
|
showPicker: showPicker,
|
|
4184
3743
|
theme: theme,
|
|
@@ -4204,37 +3763,34 @@ function getTextFromAtToCaret() {
|
|
|
4204
3763
|
if (!range) return null;
|
|
4205
3764
|
var text = range.text.substring(range.begin, range.end);
|
|
4206
3765
|
return text || null;
|
|
4207
|
-
}
|
|
3766
|
+
}
|
|
4208
3767
|
|
|
3768
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4209
3769
|
/** */
|
|
4210
|
-
|
|
4211
3770
|
function deleteTextFromAtToCaret() {
|
|
4212
3771
|
var range = getRangeFromAtToCaret();
|
|
4213
|
-
if (!range) return;
|
|
3772
|
+
if (!range) return;
|
|
4214
3773
|
|
|
3774
|
+
// @ts-ignore
|
|
4215
3775
|
range.element.deleteData(range.begin, range.end - range.begin);
|
|
4216
3776
|
}
|
|
3777
|
+
|
|
4217
3778
|
/**
|
|
4218
3779
|
*
|
|
4219
3780
|
* @return {{begin: number, end: number, text: string, element: Node} | null}
|
|
4220
3781
|
*/
|
|
4221
|
-
|
|
4222
3782
|
function getRangeFromAtToCaret() {
|
|
4223
3783
|
var elementWithFocus = getElementWithFocus();
|
|
4224
|
-
|
|
4225
3784
|
if (!elementWithFocus) {
|
|
4226
3785
|
return null;
|
|
4227
3786
|
}
|
|
4228
|
-
|
|
4229
3787
|
var element = elementWithFocus.element,
|
|
4230
|
-
|
|
3788
|
+
caretOffset = elementWithFocus.caretOffset;
|
|
4231
3789
|
var text = element.textContent;
|
|
4232
3790
|
var lastAt = text.lastIndexOf("@");
|
|
4233
|
-
|
|
4234
3791
|
if (lastAt === -1 || lastAt >= caretOffset || lastAt !== 0 && text[lastAt - 1] !== " ") {
|
|
4235
3792
|
return null;
|
|
4236
3793
|
}
|
|
4237
|
-
|
|
4238
3794
|
return {
|
|
4239
3795
|
begin: lastAt,
|
|
4240
3796
|
end: caretOffset,
|
|
@@ -4242,49 +3798,46 @@ function getRangeFromAtToCaret() {
|
|
|
4242
3798
|
element: element
|
|
4243
3799
|
};
|
|
4244
3800
|
}
|
|
3801
|
+
|
|
4245
3802
|
/**
|
|
4246
3803
|
*
|
|
4247
3804
|
* @return {{element: Node, caretOffset: number}}
|
|
4248
3805
|
*/
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
3806
|
function getElementWithFocus() {
|
|
4252
3807
|
var element = getSelectionStart();
|
|
4253
|
-
|
|
4254
3808
|
if (element === null) {
|
|
4255
3809
|
return null;
|
|
4256
3810
|
}
|
|
4257
|
-
|
|
4258
3811
|
var caretOffset = 0;
|
|
4259
|
-
|
|
4260
3812
|
if (typeof window.getSelection != "undefined") {
|
|
4261
3813
|
var range = window.getSelection().getRangeAt(0);
|
|
4262
3814
|
var preCaretRange = range.cloneRange();
|
|
4263
3815
|
preCaretRange.selectNodeContents(element);
|
|
4264
3816
|
preCaretRange.setEnd(range.endContainer, range.endOffset);
|
|
4265
3817
|
caretOffset = preCaretRange.toString().length;
|
|
4266
|
-
} else if (
|
|
4267
|
-
|
|
3818
|
+
} else if (
|
|
3819
|
+
// @ts-ignore
|
|
3820
|
+
typeof document.selection != "undefined" &&
|
|
3821
|
+
// @ts-ignore
|
|
4268
3822
|
document.selection.type != "Control") {
|
|
4269
3823
|
// @ts-ignore
|
|
4270
|
-
var textRange = document.selection.createRange();
|
|
4271
|
-
|
|
3824
|
+
var textRange = document.selection.createRange();
|
|
3825
|
+
// @ts-ignore
|
|
4272
3826
|
var preCaretTextRange = document.body.createTextRange();
|
|
4273
3827
|
preCaretTextRange.moveToElementText(element);
|
|
4274
3828
|
preCaretTextRange.setEndPoint("EndToEnd", textRange);
|
|
4275
3829
|
caretOffset = preCaretTextRange.text.length;
|
|
4276
3830
|
}
|
|
4277
|
-
|
|
4278
3831
|
return {
|
|
4279
3832
|
element: element,
|
|
4280
3833
|
caretOffset: caretOffset
|
|
4281
3834
|
};
|
|
4282
3835
|
}
|
|
3836
|
+
|
|
4283
3837
|
/**
|
|
4284
3838
|
*
|
|
4285
3839
|
* @return {Node | null}
|
|
4286
3840
|
*/
|
|
4287
|
-
|
|
4288
3841
|
function getSelectionStart() {
|
|
4289
3842
|
var node = document.getSelection().anchorNode;
|
|
4290
3843
|
return (node === null || node === void 0 ? void 0 : node.nodeType) == 3 ? node : null;
|
|
@@ -4293,113 +3846,93 @@ function getSelectionStart() {
|
|
|
4293
3846
|
/**
|
|
4294
3847
|
* @typedef {import('../types/types').MentionUser} MentionUser
|
|
4295
3848
|
*/
|
|
4296
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4297
3849
|
|
|
3850
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4298
3851
|
/**
|
|
4299
3852
|
*
|
|
4300
3853
|
* @param {(text: string) => Promise<MentionUser[]>=} searchMention
|
|
4301
3854
|
* @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}
|
|
4302
3855
|
*/
|
|
4303
|
-
|
|
4304
3856
|
function useMention(searchMention) {
|
|
3857
|
+
var _ref2;
|
|
4305
3858
|
var _useState = React.useState(false),
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
/** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */
|
|
4310
|
-
|
|
3859
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3860
|
+
loading = _useState2[0],
|
|
3861
|
+
setLoading = _useState2[1];
|
|
4311
3862
|
|
|
3863
|
+
/** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */
|
|
4312
3864
|
var _useState3 = React.useState([]),
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
/** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */
|
|
4317
|
-
|
|
3865
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3866
|
+
mentionUsers = _useState4[0],
|
|
3867
|
+
setMentionUsers = _useState4[1];
|
|
4318
3868
|
|
|
3869
|
+
/** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */
|
|
4319
3870
|
var _useState5 = React.useState(null),
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
3871
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3872
|
+
mentionSearchText = _useState6[0],
|
|
3873
|
+
setMentionSearchText = _useState6[1];
|
|
4324
3874
|
var onSelectUser = React.useCallback(function () {
|
|
4325
3875
|
deleteTextFromAtToCaret();
|
|
4326
3876
|
setMentionUsers([]);
|
|
4327
3877
|
}, []);
|
|
4328
|
-
/** */
|
|
4329
3878
|
|
|
3879
|
+
/** */
|
|
4330
3880
|
var checkMentionText = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4331
3881
|
var metionText, users;
|
|
4332
3882
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4333
|
-
while (1) {
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
if (!(metionText === null)) {
|
|
4340
|
-
_context.next = 6;
|
|
4341
|
-
break;
|
|
4342
|
-
}
|
|
4343
|
-
|
|
4344
|
-
setMentionUsers([]);
|
|
4345
|
-
_context.next = 12;
|
|
3883
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3884
|
+
case 0:
|
|
3885
|
+
metionText = getTextFromAtToCaret();
|
|
3886
|
+
setMentionSearchText(metionText);
|
|
3887
|
+
if (!(metionText === null)) {
|
|
3888
|
+
_context.next = 6;
|
|
4346
3889
|
break;
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
3890
|
+
}
|
|
3891
|
+
setMentionUsers([]);
|
|
3892
|
+
_context.next = 12;
|
|
3893
|
+
break;
|
|
3894
|
+
case 6:
|
|
3895
|
+
setLoading(true);
|
|
3896
|
+
_context.next = 9;
|
|
3897
|
+
return searchMention(metionText);
|
|
3898
|
+
case 9:
|
|
3899
|
+
users = _context.sent;
|
|
3900
|
+
setLoading(false);
|
|
3901
|
+
setMentionUsers(users);
|
|
3902
|
+
case 12:
|
|
3903
|
+
case "end":
|
|
3904
|
+
return _context.stop();
|
|
4362
3905
|
}
|
|
4363
3906
|
}, _callee);
|
|
4364
3907
|
})), [searchMention]);
|
|
4365
|
-
/** @type {(event: React.KeyboardEvent) => void} */
|
|
4366
3908
|
|
|
4367
|
-
|
|
4368
|
-
|
|
3909
|
+
/** @type {(event: React.KeyboardEvent) => void} */
|
|
3910
|
+
var onKeyUp = React.useCallback(function (_x) {
|
|
3911
|
+
return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
4369
3912
|
var _getElementWithFocus;
|
|
4370
|
-
|
|
4371
3913
|
var elementWithFocus;
|
|
4372
3914
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4373
|
-
while (1) {
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
case 3:
|
|
4392
|
-
case "end":
|
|
4393
|
-
return _context2.stop();
|
|
4394
|
-
}
|
|
3915
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
3916
|
+
case 0:
|
|
3917
|
+
if (!(typeof searchMention !== "function")) {
|
|
3918
|
+
_context2.next = 2;
|
|
3919
|
+
break;
|
|
3920
|
+
}
|
|
3921
|
+
return _context2.abrupt("return");
|
|
3922
|
+
case 2:
|
|
3923
|
+
if (event.key === "Backspace" && (_getElementWithFocus = getElementWithFocus()) !== null && _getElementWithFocus !== void 0 && _getElementWithFocus.element.parentElement.hasAttribute("data-mention-id")) {
|
|
3924
|
+
elementWithFocus = getElementWithFocus();
|
|
3925
|
+
elementWithFocus.element.parentElement.remove();
|
|
3926
|
+
} else if (!["ArrowUp", "ArrowDown", "Esc", "Escape"].includes(event.key)) {
|
|
3927
|
+
checkMentionText();
|
|
3928
|
+
}
|
|
3929
|
+
case 3:
|
|
3930
|
+
case "end":
|
|
3931
|
+
return _context2.stop();
|
|
4395
3932
|
}
|
|
4396
3933
|
}, _callee2);
|
|
4397
|
-
}));
|
|
4398
|
-
|
|
4399
|
-
return function (_x) {
|
|
4400
|
-
return _ref2.apply(this, arguments);
|
|
4401
|
-
};
|
|
4402
|
-
}(), [checkMentionText, searchMention]);
|
|
3934
|
+
}))).apply(this, arguments);
|
|
3935
|
+
}, [checkMentionText, searchMention]);
|
|
4403
3936
|
var onFocus = React.useCallback(function () {
|
|
4404
3937
|
checkMentionText();
|
|
4405
3938
|
}, [checkMentionText]);
|
|
@@ -4432,21 +3965,18 @@ function useMention(searchMention) {
|
|
|
4432
3965
|
/**
|
|
4433
3966
|
* @typedef {{prevUser: () => void; nextUser: () => void;}} Ref
|
|
4434
3967
|
*/
|
|
4435
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4436
3968
|
|
|
3969
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4437
3970
|
/** @type {React.ForwardRefRenderFunction<Ref, Props>} */
|
|
4438
|
-
|
|
4439
3971
|
var MentionUserList = function MentionUserList(_ref, ref) {
|
|
4440
3972
|
var users = _ref.users,
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
3973
|
+
mentionSearchText = _ref.mentionSearchText,
|
|
3974
|
+
onSelect = _ref.onSelect,
|
|
3975
|
+
addEventListener = _ref.addEventListener;
|
|
4445
3976
|
var _useState = React.useState(0),
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
3977
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3978
|
+
selectedUser = _useState2[0],
|
|
3979
|
+
setSelectedUser = _useState2[1];
|
|
4450
3980
|
React.useImperativeHandle(ref, function () {
|
|
4451
3981
|
return {
|
|
4452
3982
|
prevUser: function prevUser() {
|
|
@@ -4454,7 +3984,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
|
|
|
4454
3984
|
if (currentSelectedUser === 0) {
|
|
4455
3985
|
return 0;
|
|
4456
3986
|
}
|
|
4457
|
-
|
|
4458
3987
|
return currentSelectedUser - 1;
|
|
4459
3988
|
});
|
|
4460
3989
|
},
|
|
@@ -4463,7 +3992,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
|
|
|
4463
3992
|
if (currentSelectedUser === users.length - 1) {
|
|
4464
3993
|
return users.length - 1;
|
|
4465
3994
|
}
|
|
4466
|
-
|
|
4467
3995
|
return currentSelectedUser + 1;
|
|
4468
3996
|
});
|
|
4469
3997
|
}
|
|
@@ -4472,24 +4000,22 @@ var MentionUserList = function MentionUserList(_ref, ref) {
|
|
|
4472
4000
|
React.useEffect(function () {
|
|
4473
4001
|
setSelectedUser(0);
|
|
4474
4002
|
}, [users]);
|
|
4003
|
+
|
|
4475
4004
|
/**
|
|
4476
4005
|
*
|
|
4477
4006
|
* @param {string} selectedText
|
|
4478
4007
|
* @param {string} rest
|
|
4479
4008
|
* @return {string}
|
|
4480
4009
|
*/
|
|
4481
|
-
|
|
4482
4010
|
function getMentionSelectedNameEl(selectedText, rest) {
|
|
4483
4011
|
return "<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">".concat(selectedText, "</span>").concat(rest);
|
|
4484
4012
|
}
|
|
4485
|
-
/** @type {(MentionUser & {nameHtml: string})[]} */
|
|
4486
|
-
|
|
4487
4013
|
|
|
4014
|
+
/** @type {(MentionUser & {nameHtml: string})[]} */
|
|
4488
4015
|
var usersFiltered = React.useMemo(function () {
|
|
4489
4016
|
var searchText = mentionSearchText ? mentionSearchText.substring(1).toLocaleLowerCase() : "";
|
|
4490
4017
|
return users.map(function (user) {
|
|
4491
4018
|
var nameHtml = user.name;
|
|
4492
|
-
|
|
4493
4019
|
if (mentionSearchText && mentionSearchText.length > 1) {
|
|
4494
4020
|
if (user.name.toLowerCase().startsWith(searchText)) {
|
|
4495
4021
|
nameHtml = getMentionSelectedNameEl(user.name.substring(0, searchText.length), user.name.substring(searchText.length));
|
|
@@ -4499,24 +4025,22 @@ var MentionUserList = function MentionUserList(_ref, ref) {
|
|
|
4499
4025
|
if (name.toLocaleLowerCase().startsWith(searchText)) {
|
|
4500
4026
|
return getMentionSelectedNameEl(name.substring(0, searchText.length), name.substring(searchText.length));
|
|
4501
4027
|
}
|
|
4502
|
-
|
|
4503
4028
|
return name;
|
|
4504
4029
|
}).join(" ");
|
|
4505
4030
|
}
|
|
4506
4031
|
}
|
|
4507
|
-
|
|
4508
4032
|
return _objectSpread2(_objectSpread2({}, user), {}, {
|
|
4509
4033
|
nameHtml: nameHtml
|
|
4510
4034
|
});
|
|
4511
4035
|
});
|
|
4512
|
-
}, [mentionSearchText, users]);
|
|
4036
|
+
}, [mentionSearchText, users]);
|
|
4513
4037
|
|
|
4038
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4514
4039
|
/**
|
|
4515
4040
|
*
|
|
4516
4041
|
* @param {MentionUser} user
|
|
4517
4042
|
* @returns {(event: React.MouseEvent) => void} event
|
|
4518
4043
|
*/
|
|
4519
|
-
|
|
4520
4044
|
function handleClick(user) {
|
|
4521
4045
|
return function (event) {
|
|
4522
4046
|
event.stopPropagation();
|
|
@@ -4524,7 +4048,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
|
|
|
4524
4048
|
onSelect(user);
|
|
4525
4049
|
};
|
|
4526
4050
|
}
|
|
4527
|
-
|
|
4528
4051
|
React.useEffect(function () {
|
|
4529
4052
|
var unsubscribe = addEventListener("enter", function (event) {
|
|
4530
4053
|
event.stopPropagation();
|
|
@@ -4559,7 +4082,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
|
|
|
4559
4082
|
})));
|
|
4560
4083
|
}));
|
|
4561
4084
|
};
|
|
4562
|
-
|
|
4563
4085
|
var MentionUserListWithRef = /*#__PURE__*/React.forwardRef(MentionUserList);
|
|
4564
4086
|
MentionUserListWithRef.propTypes = {
|
|
4565
4087
|
users: t__default["default"].array.isRequired
|
|
@@ -4584,32 +4106,27 @@ MentionUserListWithRef.propTypes = {
|
|
|
4584
4106
|
* @property {(html: string) => void} appendContent
|
|
4585
4107
|
* @property {(fn: SanitizeFn) => void} addSanitizeFn
|
|
4586
4108
|
*/
|
|
4587
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4588
4109
|
|
|
4110
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4589
4111
|
/** @type {React.FC<Props>} */
|
|
4590
|
-
|
|
4591
4112
|
var MentionWrapper = function MentionWrapper(_ref) {
|
|
4592
4113
|
var searchMention = _ref.searchMention,
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4114
|
+
addEventListener = _ref.addEventListener,
|
|
4115
|
+
appendContent = _ref.appendContent,
|
|
4116
|
+
addSanitizeFn = _ref.addSanitizeFn;
|
|
4597
4117
|
/** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */
|
|
4598
4118
|
var metionUserListRef = React.useRef(null);
|
|
4599
|
-
|
|
4600
4119
|
var _useState = React.useState(false),
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4120
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4121
|
+
showUserList = _useState2[0],
|
|
4122
|
+
setShowUserList = _useState2[1];
|
|
4605
4123
|
var _useMention = useMention(searchMention),
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4124
|
+
mentionSearchText = _useMention.mentionSearchText,
|
|
4125
|
+
mentionUsers = _useMention.mentionUsers,
|
|
4126
|
+
loading = _useMention.loading,
|
|
4127
|
+
onKeyUp = _useMention.onKeyUp,
|
|
4128
|
+
onFocus = _useMention.onFocus,
|
|
4129
|
+
onSelectUser = _useMention.onSelectUser;
|
|
4613
4130
|
React.useEffect(function () {
|
|
4614
4131
|
addSanitizeFn(function (html) {
|
|
4615
4132
|
var container = document.createElement("div");
|
|
@@ -4629,7 +4146,6 @@ var MentionWrapper = function MentionWrapper(_ref) {
|
|
|
4629
4146
|
function checkClickOutside() {
|
|
4630
4147
|
setShowUserList(false);
|
|
4631
4148
|
}
|
|
4632
|
-
|
|
4633
4149
|
document.addEventListener("click", checkClickOutside);
|
|
4634
4150
|
return function () {
|
|
4635
4151
|
document.removeEventListener("click", checkClickOutside);
|
|
@@ -4649,13 +4165,11 @@ var MentionWrapper = function MentionWrapper(_ref) {
|
|
|
4649
4165
|
function handleKeyDown(event) {
|
|
4650
4166
|
switch (event.key) {
|
|
4651
4167
|
case "Esc": // IE/Edge specific value
|
|
4652
|
-
|
|
4653
4168
|
case "Escape":
|
|
4654
4169
|
setShowUserList(false);
|
|
4655
4170
|
break;
|
|
4656
4171
|
}
|
|
4657
4172
|
}
|
|
4658
|
-
|
|
4659
4173
|
var unsubscribe = addEventListener("keyDown", handleKeyDown);
|
|
4660
4174
|
return function () {
|
|
4661
4175
|
unsubscribe();
|
|
@@ -4685,16 +4199,15 @@ var MentionWrapper = function MentionWrapper(_ref) {
|
|
|
4685
4199
|
};
|
|
4686
4200
|
}
|
|
4687
4201
|
}, [addEventListener, showUserList]);
|
|
4202
|
+
|
|
4688
4203
|
/**
|
|
4689
4204
|
*
|
|
4690
4205
|
* @param {MetionUser} user
|
|
4691
4206
|
*/
|
|
4692
|
-
|
|
4693
4207
|
function handleSelect(user) {
|
|
4694
4208
|
onSelectUser();
|
|
4695
4209
|
appendContent("<span class=\"react-input-emoji--mention--text\" data-mention-id=\"".concat(user.id, "\" data-mention-name=\"").concat(user.name, "\">@").concat(user.name, "</span> "));
|
|
4696
4210
|
}
|
|
4697
|
-
|
|
4698
4211
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, loading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4699
4212
|
className: "react-input-emoji--mention--container"
|
|
4700
4213
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -4716,8 +4229,8 @@ var MentionWrapper = function MentionWrapper(_ref) {
|
|
|
4716
4229
|
};
|
|
4717
4230
|
|
|
4718
4231
|
// @ts-check
|
|
4719
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4720
4232
|
|
|
4233
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4721
4234
|
/**
|
|
4722
4235
|
* @template T
|
|
4723
4236
|
* @returns {import('../types/types').ListenerObj<T>}
|
|
@@ -4739,22 +4252,20 @@ function createObserver() {
|
|
|
4739
4252
|
return listener(event);
|
|
4740
4253
|
});
|
|
4741
4254
|
},
|
|
4742
|
-
|
|
4743
4255
|
get currentListerners() {
|
|
4744
4256
|
return listeners;
|
|
4745
4257
|
}
|
|
4746
|
-
|
|
4747
4258
|
};
|
|
4748
4259
|
}
|
|
4749
4260
|
|
|
4750
4261
|
// @ts-check
|
|
4262
|
+
|
|
4751
4263
|
/**
|
|
4752
4264
|
* @typedef {import('../types/types').TextInputListeners} TextInputListeners
|
|
4753
4265
|
*/
|
|
4754
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4755
4266
|
|
|
4267
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4756
4268
|
/** */
|
|
4757
|
-
|
|
4758
4269
|
function useEventListeners() {
|
|
4759
4270
|
/** @type {TextInputListeners} */
|
|
4760
4271
|
var listeners = React.useMemo(function () {
|
|
@@ -4768,11 +4279,11 @@ function useEventListeners() {
|
|
|
4768
4279
|
blur: createObserver()
|
|
4769
4280
|
};
|
|
4770
4281
|
}, []);
|
|
4282
|
+
|
|
4771
4283
|
/**
|
|
4772
4284
|
* @template {keyof TextInputListeners} T, K
|
|
4773
4285
|
* @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}
|
|
4774
4286
|
*/
|
|
4775
|
-
|
|
4776
4287
|
var addEventListener = React.useCallback(function (event, fn) {
|
|
4777
4288
|
return listeners[event].subscribe(fn);
|
|
4778
4289
|
}, [listeners]);
|
|
@@ -4783,23 +4294,23 @@ function useEventListeners() {
|
|
|
4783
4294
|
}
|
|
4784
4295
|
|
|
4785
4296
|
// @ts-check
|
|
4297
|
+
|
|
4786
4298
|
/**
|
|
4787
4299
|
* @typedef {import('../types/types').PolluteFn} PolluteFn
|
|
4788
4300
|
*/
|
|
4789
|
-
// eslint-disable-next-line valid-jsdoc
|
|
4790
4301
|
|
|
4302
|
+
// eslint-disable-next-line valid-jsdoc
|
|
4791
4303
|
/** */
|
|
4792
|
-
|
|
4793
4304
|
function usePollute() {
|
|
4794
4305
|
/** @type {React.MutableRefObject<PolluteFn[]>} */
|
|
4795
4306
|
var polluteFnsRef = React.useRef([]);
|
|
4796
|
-
/** @type {(fn: PolluteFn) => void} */
|
|
4797
4307
|
|
|
4308
|
+
/** @type {(fn: PolluteFn) => void} */
|
|
4798
4309
|
var addPolluteFn = React.useCallback(function (fn) {
|
|
4799
4310
|
polluteFnsRef.current.push(fn);
|
|
4800
4311
|
}, []);
|
|
4801
|
-
/** @type {(html: string) => string} */
|
|
4802
4312
|
|
|
4313
|
+
/** @type {(html: string) => string} */
|
|
4803
4314
|
var pollute = React.useCallback(function (text) {
|
|
4804
4315
|
var result = polluteFnsRef.current.reduce(function (acc, fn) {
|
|
4805
4316
|
return fn(acc);
|
|
@@ -4813,6 +4324,7 @@ function usePollute() {
|
|
|
4813
4324
|
}
|
|
4814
4325
|
|
|
4815
4326
|
// @ts-check
|
|
4327
|
+
|
|
4816
4328
|
/**
|
|
4817
4329
|
* @typedef {import('./types/types').MentionUser} MetionUser
|
|
4818
4330
|
*/
|
|
@@ -4849,6 +4361,7 @@ function usePollute() {
|
|
|
4849
4361
|
* @property {import('./types/types').Languages=} language
|
|
4850
4362
|
* @property {(text: string) => Promise<MetionUser[]>=} searchMention
|
|
4851
4363
|
* @property {HTMLDivElement=} buttonElement
|
|
4364
|
+
* @property {React.MutableRefObject=} buttonRef
|
|
4852
4365
|
*/
|
|
4853
4366
|
|
|
4854
4367
|
/**
|
|
@@ -4857,50 +4370,46 @@ function usePollute() {
|
|
|
4857
4370
|
* @param {React.Ref<any>} ref
|
|
4858
4371
|
* @return {JSX.Element}
|
|
4859
4372
|
*/
|
|
4860
|
-
|
|
4861
4373
|
function InputEmoji(props, ref) {
|
|
4862
4374
|
var onChange = props.onChange,
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4375
|
+
onEnter = props.onEnter,
|
|
4376
|
+
shouldReturn = props.shouldReturn,
|
|
4377
|
+
onResize = props.onResize,
|
|
4378
|
+
onClick = props.onClick,
|
|
4379
|
+
onFocus = props.onFocus,
|
|
4380
|
+
onBlur = props.onBlur,
|
|
4381
|
+
onKeyDown = props.onKeyDown,
|
|
4382
|
+
theme = props.theme,
|
|
4383
|
+
cleanOnEnter = props.cleanOnEnter,
|
|
4384
|
+
placeholder = props.placeholder,
|
|
4385
|
+
maxLength = props.maxLength,
|
|
4386
|
+
keepOpened = props.keepOpened,
|
|
4387
|
+
inputClass = props.inputClass,
|
|
4388
|
+
disableRecent = props.disableRecent,
|
|
4389
|
+
tabIndex = props.tabIndex,
|
|
4390
|
+
value = props.value,
|
|
4391
|
+
customEmojis = props.customEmojis,
|
|
4392
|
+
language = props.language,
|
|
4393
|
+
searchMention = props.searchMention,
|
|
4394
|
+
buttonElement = props.buttonElement,
|
|
4395
|
+
buttonRef = props.buttonRef,
|
|
4396
|
+
borderRadius = props.borderRadius,
|
|
4397
|
+
borderColor = props.borderColor,
|
|
4398
|
+
fontSize = props.fontSize,
|
|
4399
|
+
fontFamily = props.fontFamily;
|
|
4888
4400
|
|
|
4401
|
+
/** @type {React.MutableRefObject<import('./text-input').Ref | null>} */
|
|
4889
4402
|
var textInputRef = React.useRef(null);
|
|
4890
|
-
|
|
4891
4403
|
var _useEventListeners = useEventListeners(),
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4404
|
+
addEventListener = _useEventListeners.addEventListener,
|
|
4405
|
+
listeners = _useEventListeners.listeners;
|
|
4895
4406
|
var _useSanitize = useSanitize(props.shouldReturn),
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4407
|
+
addSanitizeFn = _useSanitize.addSanitizeFn,
|
|
4408
|
+
sanitize = _useSanitize.sanitize,
|
|
4409
|
+
sanitizedTextRef = _useSanitize.sanitizedTextRef;
|
|
4900
4410
|
var _usePollute = usePollute(),
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4411
|
+
addPolluteFn = _usePollute.addPolluteFn,
|
|
4412
|
+
pollute = _usePollute.pollute;
|
|
4904
4413
|
var updateHTML = React.useCallback(function () {
|
|
4905
4414
|
var nextValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
4906
4415
|
if (textInputRef.current === null) return;
|
|
@@ -4926,7 +4435,9 @@ function InputEmoji(props, ref) {
|
|
|
4926
4435
|
if (sanitizedTextRef.current !== value) {
|
|
4927
4436
|
setValue(value);
|
|
4928
4437
|
}
|
|
4929
|
-
}, [sanitizedTextRef, setValue, value]);
|
|
4438
|
+
}, [sanitizedTextRef, setValue, value]);
|
|
4439
|
+
|
|
4440
|
+
// useEffect(() => {
|
|
4930
4441
|
// updateHTML();
|
|
4931
4442
|
// }, [updateHTML]);
|
|
4932
4443
|
|
|
@@ -4940,34 +4451,26 @@ function InputEmoji(props, ref) {
|
|
|
4940
4451
|
if (typeof maxLength !== "undefined" && event.key !== "Backspace" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
|
|
4941
4452
|
event.preventDefault();
|
|
4942
4453
|
}
|
|
4943
|
-
|
|
4944
4454
|
if (event.key === "Enter" && textInputRef.current) {
|
|
4945
4455
|
event.preventDefault();
|
|
4946
4456
|
var text = sanitize(textInputRef.current.html);
|
|
4947
4457
|
emitChange(sanitizedTextRef.current);
|
|
4948
|
-
|
|
4949
4458
|
if (typeof onEnter === "function" && listeners.enter.currentListerners.length === 0) {
|
|
4950
4459
|
onEnter(text);
|
|
4951
4460
|
}
|
|
4952
|
-
|
|
4953
4461
|
if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {
|
|
4954
4462
|
updateHTML("");
|
|
4955
4463
|
}
|
|
4956
|
-
|
|
4957
4464
|
if (typeof onKeyDown === "function") {
|
|
4958
4465
|
onKeyDown(event.nativeEvent);
|
|
4959
4466
|
}
|
|
4960
|
-
|
|
4961
4467
|
return false;
|
|
4962
4468
|
}
|
|
4963
|
-
|
|
4964
4469
|
if (typeof onKeyDown === "function") {
|
|
4965
4470
|
onKeyDown(event.nativeEvent);
|
|
4966
4471
|
}
|
|
4967
|
-
|
|
4968
4472
|
return true;
|
|
4969
4473
|
}
|
|
4970
|
-
|
|
4971
4474
|
var unsubscribe = addEventListener("keyDown", handleKeydown);
|
|
4972
4475
|
return function () {
|
|
4973
4476
|
unsubscribe();
|
|
@@ -4979,12 +4482,10 @@ function InputEmoji(props, ref) {
|
|
|
4979
4482
|
if (typeof onClick === "function") {
|
|
4980
4483
|
onClick();
|
|
4981
4484
|
}
|
|
4982
|
-
|
|
4983
4485
|
if (typeof onFocus === "function") {
|
|
4984
4486
|
onFocus();
|
|
4985
4487
|
}
|
|
4986
4488
|
}
|
|
4987
|
-
|
|
4988
4489
|
var unsubscribe = addEventListener("focus", handleFocus);
|
|
4989
4490
|
return function () {
|
|
4990
4491
|
unsubscribe();
|
|
@@ -4997,82 +4498,70 @@ function InputEmoji(props, ref) {
|
|
|
4997
4498
|
onBlur();
|
|
4998
4499
|
}
|
|
4999
4500
|
}
|
|
5000
|
-
|
|
5001
4501
|
var unsubscribe = addEventListener("blur", handleBlur);
|
|
5002
4502
|
return function () {
|
|
5003
4503
|
unsubscribe();
|
|
5004
4504
|
};
|
|
5005
4505
|
}, [addEventListener, onBlur]);
|
|
4506
|
+
|
|
5006
4507
|
/**
|
|
5007
4508
|
*
|
|
5008
4509
|
* @param {string} html
|
|
5009
4510
|
*/
|
|
5010
|
-
|
|
5011
4511
|
function handleTextInputChange(html) {
|
|
5012
4512
|
sanitize(html);
|
|
5013
|
-
|
|
5014
4513
|
if (value !== sanitizedTextRef.current) {
|
|
5015
4514
|
emitChange(sanitizedTextRef.current);
|
|
5016
4515
|
}
|
|
5017
4516
|
}
|
|
4517
|
+
|
|
5018
4518
|
/**
|
|
5019
4519
|
*
|
|
5020
4520
|
* @param {string} html
|
|
5021
4521
|
*/
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
4522
|
function appendContent(html) {
|
|
5025
4523
|
if (typeof maxLength !== "undefined" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
|
|
5026
4524
|
return;
|
|
5027
4525
|
}
|
|
5028
|
-
|
|
5029
4526
|
if (textInputRef.current !== null) {
|
|
5030
4527
|
textInputRef.current.appendContent(html);
|
|
5031
4528
|
}
|
|
5032
4529
|
}
|
|
4530
|
+
|
|
5033
4531
|
/**
|
|
5034
4532
|
* Handle copy of current selected text
|
|
5035
4533
|
* @param {React.ClipboardEvent} event
|
|
5036
4534
|
*/
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
4535
|
function handleCopy(event) {
|
|
5040
4536
|
var selection = window.getSelection();
|
|
5041
|
-
|
|
5042
4537
|
if (selection !== null) {
|
|
5043
4538
|
var selectedText = '';
|
|
5044
|
-
|
|
5045
4539
|
if (selection.anchorNode && selection.anchorNode.nodeType === Node.ELEMENT_NODE) {
|
|
5046
4540
|
// @ts-ignore
|
|
5047
4541
|
selectedText = selection.anchorNode.innerHTML;
|
|
5048
4542
|
} else if (selection.anchorNode && selection.anchorNode.nodeType === Node.TEXT_NODE) {
|
|
5049
4543
|
var _selection$anchorNode;
|
|
5050
|
-
|
|
5051
4544
|
selectedText = (_selection$anchorNode = selection.anchorNode.textContent) !== null && _selection$anchorNode !== void 0 ? _selection$anchorNode : '';
|
|
5052
4545
|
}
|
|
5053
|
-
|
|
5054
4546
|
var text = replaceAllTextEmojiToString(selectedText);
|
|
5055
4547
|
event.clipboardData.setData("text", text);
|
|
5056
4548
|
event.preventDefault();
|
|
5057
4549
|
}
|
|
5058
4550
|
}
|
|
4551
|
+
|
|
5059
4552
|
/**
|
|
5060
4553
|
* Handle past on input
|
|
5061
4554
|
* @param {React.ClipboardEvent} event
|
|
5062
4555
|
*/
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
4556
|
function handlePaste(event) {
|
|
5066
4557
|
event.preventDefault();
|
|
5067
4558
|
var content;
|
|
5068
|
-
|
|
5069
4559
|
if (event.clipboardData) {
|
|
5070
4560
|
content = event.clipboardData.getData("text/plain");
|
|
5071
4561
|
content = pollute(content);
|
|
5072
4562
|
document.execCommand("insertHTML", false, content);
|
|
5073
4563
|
}
|
|
5074
4564
|
}
|
|
5075
|
-
|
|
5076
4565
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
5077
4566
|
className: "react-emoji"
|
|
5078
4567
|
}, /*#__PURE__*/React__default["default"].createElement(MentionWrapper, {
|
|
@@ -5111,15 +4600,13 @@ function InputEmoji(props, ref) {
|
|
|
5111
4600
|
addPolluteFn: addPolluteFn,
|
|
5112
4601
|
appendContent: appendContent,
|
|
5113
4602
|
buttonElement: buttonElement,
|
|
4603
|
+
buttonRef: buttonRef,
|
|
5114
4604
|
language: language
|
|
5115
4605
|
}));
|
|
5116
4606
|
}
|
|
5117
|
-
|
|
5118
4607
|
var InputEmojiWithRef = /*#__PURE__*/React.forwardRef(InputEmoji);
|
|
5119
4608
|
InputEmojiWithRef.defaultProps = {
|
|
5120
|
-
theme:
|
|
5121
|
-
/** @type {const} */
|
|
5122
|
-
"auto",
|
|
4609
|
+
theme: /** @type {const} */"auto",
|
|
5123
4610
|
height: 30,
|
|
5124
4611
|
placeholder: "Type a message",
|
|
5125
4612
|
borderRadius: 21,
|