@subiz/widget-v4 4.1.61 → 4.1.63
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 +10 -0
- package/app.js +2 -6
- package/assets/less/widget.less +16 -7
- package/dist/{213.js → 132.js} +121 -121
- package/dist/18dd22fb422.132.js +1 -0
- package/dist/18dd22fb422.27.js +1 -0
- package/dist/18dd22fb422.278.js +1 -0
- package/dist/18dd22fb422.459.js +1 -0
- package/dist/{18d5e97bf55.605.js → 18dd22fb422.490.js} +1 -1
- package/dist/18dd22fb422.497.js +1 -0
- package/dist/18dd22fb422.74.js +1 -0
- package/dist/18dd22fb422.997.js +1 -0
- package/dist/18dd22fb422.app.js +1 -0
- package/dist/{18d5e97bf55.index.html → 18dd22fb422.index.html} +1 -1
- package/dist/{18d5e97bf55.library.html → 18dd22fb422.library.html} +1 -1
- package/dist/18dd22fb422.library.js +1 -0
- package/dist/{18d5e97bf55.preview.html → 18dd22fb422.preview.html} +1 -1
- package/dist/18dd22fb422.preview.js +1 -0
- package/dist/18dd22fb422.screenshoot.js +1 -0
- package/dist/18dd22fb422.webview.js +1 -0
- package/dist/{782.js → 27.js} +6 -6
- package/dist/{178.js → 278.js} +54 -54
- package/dist/{362.js → 459.js} +6 -6
- package/dist/{605.js → 490.js} +57 -57
- package/dist/{841.js → 497.js} +688 -677
- package/dist/{335.js → 74.js} +30 -30
- package/dist/{678.js → 997.js} +6 -6
- package/dist/HASH +1 -1
- package/dist/malicious-app.js +4 -8
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +291 -291
- package/malicious-app.js +4 -8
- package/package.json +6 -6
- package/src/chatbox/Widget.js +56 -32
- package/src/store/api.js +17 -0
- package/src/store/api_fake.js +3 -0
- package/src/store/store.js +16 -50
- package/dist/18d5e97bf55.178.js +0 -1
- package/dist/18d5e97bf55.213.js +0 -1
- package/dist/18d5e97bf55.335.js +0 -1
- package/dist/18d5e97bf55.362.js +0 -1
- package/dist/18d5e97bf55.678.js +0 -1
- package/dist/18d5e97bf55.782.js +0 -1
- package/dist/18d5e97bf55.841.js +0 -1
- package/dist/18d5e97bf55.app.js +0 -1
- package/dist/18d5e97bf55.library.js +0 -1
- package/dist/18d5e97bf55.preview.js +0 -1
- package/dist/18d5e97bf55.screenshoot.js +0 -1
- package/dist/18d5e97bf55.webview.js +0 -1
package/dist/{605.js → 490.js}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
(self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[
|
|
2
|
+
(self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[490],{
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 1490:
|
|
5
5
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6
6
|
|
|
7
7
|
__webpack_require__.r(__webpack_exports__);
|
|
8
8
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
9
|
/* harmony export */ "default": () => (/* binding */ Notif)
|
|
10
10
|
/* harmony export */ });
|
|
11
|
-
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
12
|
-
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
13
|
-
/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
11
|
+
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1405);
|
|
12
|
+
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172);
|
|
13
|
+
/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2840);
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
let notifCSS = (() => __webpack_require__.e(/* import() */
|
|
21
|
-
class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .
|
|
20
|
+
let notifCSS = (() => __webpack_require__.e(/* import() */ 459).then(__webpack_require__.bind(__webpack_require__, 5488)))();
|
|
21
|
+
class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .Mw {
|
|
22
22
|
constructor(props) {
|
|
23
23
|
super(props);
|
|
24
24
|
_defineProperty(this, "state", {
|
|
@@ -32,19 +32,19 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
32
32
|
title: '',
|
|
33
33
|
last_show: 0
|
|
34
34
|
});
|
|
35
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
35
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setTimeout(async () => {
|
|
36
36
|
let {
|
|
37
37
|
body: impression
|
|
38
38
|
} = await this.props.store.sendImpression(this.props.plugin.id);
|
|
39
|
-
this.impressionToken = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
40
|
-
let image = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
41
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
39
|
+
this.impressionToken = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(impression, 'impression_token') || '';
|
|
40
|
+
let image = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.background_url');
|
|
41
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.preloadImg(image, () => this.setState({
|
|
42
42
|
imageReady: true
|
|
43
43
|
}));
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
setOver(over) {
|
|
47
|
-
if (!over) this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
47
|
+
if (!over) this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now();else this.mouse_leave = 0;
|
|
48
48
|
}
|
|
49
49
|
randomTimestampt() {
|
|
50
50
|
let random = Math.floor(Math.random() * 5);
|
|
@@ -57,10 +57,10 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
57
57
|
onClick(e) {
|
|
58
58
|
if (this.props.plugin._dont_follow) return;
|
|
59
59
|
this.props.store.sendConversion(this.props.plugin.id, null, this.impressionToken);
|
|
60
|
-
let url = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
60
|
+
let url = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.url');
|
|
61
61
|
if (!url) return;
|
|
62
62
|
if (!url.startsWith('http://') && !url.startsWith('https://')) url = '//' + url;
|
|
63
|
-
let new_tab = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
63
|
+
let new_tab = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.new_tab', false);
|
|
64
64
|
if (new_tab) return window.open(url);
|
|
65
65
|
window.location.href = url;
|
|
66
66
|
}
|
|
@@ -97,24 +97,24 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
97
97
|
}
|
|
98
98
|
async waitForT() {
|
|
99
99
|
if (this.props.t) return;
|
|
100
|
-
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
100
|
+
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.sleep(100);
|
|
101
101
|
return this.waitForT();
|
|
102
102
|
}
|
|
103
103
|
async setClose(close) {
|
|
104
104
|
await this.waitForT();
|
|
105
105
|
if (!this.props.t) return;
|
|
106
106
|
if (!close) {
|
|
107
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
107
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.clearTimeout(this.lastCloseTimeout);
|
|
108
108
|
this.setState({
|
|
109
109
|
closeAnimation: false
|
|
110
110
|
});
|
|
111
111
|
let timestamp = this.randomTimestampt();
|
|
112
|
-
let profiles = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
113
|
-
let user = profiles[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
112
|
+
let profiles = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.profiles', []);
|
|
113
|
+
let user = profiles[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.size(profiles))] || {};
|
|
114
114
|
if (user.avatar_url && user.avatar_url.startsWith('http')) {
|
|
115
|
-
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
115
|
+
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.preloadImg(user.avatar_url);
|
|
116
116
|
}
|
|
117
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
117
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.map(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, 'notification.custom_avatar_urls'), url => {
|
|
118
118
|
profiles.push({
|
|
119
119
|
type: 'person',
|
|
120
120
|
fullname: randomName(),
|
|
@@ -125,48 +125,48 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
125
125
|
age: randomAge()
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
|
-
let i18n_messages = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
129
|
-
let i18n_message = i18n_messages[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
130
|
-
let fallbackmsgs = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
131
|
-
let fallbackmessage = fallbackmsgs[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
132
|
-
let i18n_title = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
128
|
+
let i18n_messages = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.i18n_message_quill_deltas', []);
|
|
129
|
+
let i18n_message = i18n_messages[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.size(i18n_messages))];
|
|
130
|
+
let fallbackmsgs = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.message_quill_deltas', []);
|
|
131
|
+
let fallbackmessage = fallbackmsgs[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.size(fallbackmsgs))];
|
|
132
|
+
let i18n_title = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.i18n_title_quill_delta');
|
|
133
133
|
return this.setState({
|
|
134
134
|
close: false,
|
|
135
|
-
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
135
|
+
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now(),
|
|
136
136
|
timestamp: timestamp,
|
|
137
137
|
user: user,
|
|
138
|
-
title: this.props.t.i18n(i18n_title) || _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
138
|
+
title: this.props.t.i18n(i18n_title) || _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props, 'plugin.notification.title_quill_delta'),
|
|
139
139
|
message: this.props.t.i18n(i18n_message) || fallbackmessage
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
this.setState({
|
|
143
143
|
closeAnimation: true
|
|
144
144
|
});
|
|
145
|
-
this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
146
|
-
this.lastCloseTimeout = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
145
|
+
this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now();
|
|
146
|
+
this.lastCloseTimeout = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setTimeout(() => this.setState({
|
|
147
147
|
close: true,
|
|
148
148
|
closeAnimation: false
|
|
149
149
|
}), 150);
|
|
150
|
-
if (this.props.plugin._dont_close) _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
150
|
+
if (this.props.plugin._dont_close) _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setTimeout(() => this.setState({
|
|
151
151
|
closeAnimation: false,
|
|
152
152
|
close: false
|
|
153
153
|
}), 1000);
|
|
154
154
|
}
|
|
155
155
|
async refreshCSS() {
|
|
156
156
|
let plugins = this.props.store.matchPlugin();
|
|
157
|
-
let found = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
157
|
+
let found = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.find(plugins, plugin => plugin.id === this.props.plugin.id);
|
|
158
158
|
if (!found) return;
|
|
159
159
|
let css = (await notifCSS).default.default.toString();
|
|
160
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
160
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setCss(this.props.plugin.id, this.$cssStyleDiv, css);
|
|
161
161
|
this.setClose(this.state.close);
|
|
162
162
|
}
|
|
163
163
|
componentWillUnmount() {
|
|
164
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
165
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
164
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.clearInterval(this.interval);
|
|
165
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setCss(this.props.plugin.id, this.$cssStyleDiv, '');
|
|
166
166
|
}
|
|
167
167
|
async componentDidMount() {
|
|
168
168
|
this.setState({
|
|
169
|
-
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
169
|
+
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now()
|
|
170
170
|
});
|
|
171
171
|
this.$cssStyleDiv = document.getElementById('subiz-style-for-' + this.props.plugin.id);
|
|
172
172
|
if (!this.$cssStyleDiv) {
|
|
@@ -177,20 +177,20 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
177
177
|
}
|
|
178
178
|
this.props.store.onResetCSS(this, () => this.refreshCSS());
|
|
179
179
|
await this.refreshCSS();
|
|
180
|
-
this.interval = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
180
|
+
this.interval = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setInterval(() => {
|
|
181
181
|
if (this.props._destroy) return this.componentWillUnmount();
|
|
182
182
|
let mouseleave = this.mouse_leave;
|
|
183
|
-
if (mouseleave === 0) mouseleave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
184
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
183
|
+
if (mouseleave === 0) mouseleave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now();
|
|
184
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now() - mouseleave < 1000) return;
|
|
185
185
|
if (!this.state.close && !this.props.plugin._dont_close) {
|
|
186
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
186
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now() - this.state.last_show > 8000) return this.setClose(true);
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
189
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.Date.now() - this.state.last_show > this.props.plugin.notification.interval_sec) {
|
|
190
190
|
return this.setClose(false);
|
|
191
191
|
}
|
|
192
192
|
}, 1000);
|
|
193
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
193
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setTimeout(() => {
|
|
194
194
|
this.setState({
|
|
195
195
|
cssready: true
|
|
196
196
|
});
|
|
@@ -198,21 +198,21 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
198
198
|
}, 50);
|
|
199
199
|
}
|
|
200
200
|
renderTextFromQuillDelta(quilldelta, profile) {
|
|
201
|
-
let qd = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
201
|
+
let qd = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.parseJSON(quilldelta);
|
|
202
202
|
if (!qd || !qd.ops) return null;
|
|
203
|
-
let out = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
203
|
+
let out = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.map(qd.ops, op => {
|
|
204
204
|
let out = null;
|
|
205
205
|
if (!op.insert) return null;
|
|
206
206
|
if (typeof op.insert == 'string') out = op.insert;
|
|
207
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
208
|
-
let key = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
207
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(op, 'insert.dynamicField')) {
|
|
208
|
+
let key = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(op, 'insert.dynamicField.key');
|
|
209
209
|
if (key === 'user.fullname') out = profile.fullname;
|
|
210
210
|
if (key === 'user.email') out = profile.email;
|
|
211
211
|
if (key === 'user.address') out = profile.address;
|
|
212
212
|
if (key === 'user.phone') out = profile.phone;
|
|
213
213
|
}
|
|
214
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
215
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
214
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(op, 'attributes.bold')) out = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("b", null, out);
|
|
215
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(op, 'attributes.italic')) out = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("b", null, out);
|
|
216
216
|
return out;
|
|
217
217
|
}).filter(a => a);
|
|
218
218
|
if (out.length == 1 && (out[0] == '\n' || out[0] == '')) return [];
|
|
@@ -224,11 +224,11 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
224
224
|
if (!this.state.imageReady) return null;
|
|
225
225
|
if (this.state.close) return null;
|
|
226
226
|
if (!this.state.message) return null;
|
|
227
|
-
let notif = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
227
|
+
let notif = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, 'notification', {});
|
|
228
228
|
if (!notif) return null;
|
|
229
229
|
let animation = '';
|
|
230
|
-
let pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
231
|
-
if (this.props.mobile) pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
230
|
+
let pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(notif, 'position', 'bottom-left');
|
|
231
|
+
if (this.props.mobile) pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(notif, 'mobile_position', pos);
|
|
232
232
|
if (pos === 'top-left' || pos === 'top-right') animation = 'fadeInDown';else if (pos === 'top-center') animation = 'fadeInDownCenter';else if (pos === 'bottom-center') animation = 'fadeInUpCenter';else if (pos === 'bottom-right') {
|
|
233
233
|
animation = 'fadeInUpBig';
|
|
234
234
|
} else {
|
|
@@ -237,7 +237,7 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
237
237
|
}
|
|
238
238
|
let user = this.state.user || {};
|
|
239
239
|
let subtextStyle = notif.subtext_style || {};
|
|
240
|
-
if (subtextStyle.color === undefined) subtextStyle.color = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
240
|
+
if (subtextStyle.color === undefined) subtextStyle.color = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(notif, 'message_style.color', 'black');
|
|
241
241
|
let st = 'position: fixed !important; z-index: 1000000000 !important';
|
|
242
242
|
if (this.props.plugin._preview) st = 'position: absolute !important;';
|
|
243
243
|
if (this.state.closeAnimation) animation = 'fadeOut';
|
|
@@ -249,11 +249,11 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
249
249
|
});
|
|
250
250
|
let $time = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
251
251
|
class: "notif_time",
|
|
252
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
252
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css(notif.subtext_style)
|
|
253
253
|
}, this.state.timestamp);
|
|
254
254
|
let $title = this.renderTextFromQuillDelta(this.state.title, user);
|
|
255
255
|
let $message = this.renderTextFromQuillDelta(this.state.message, user);
|
|
256
|
-
if (!_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
256
|
+
if (!_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.size($title) && !_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.size($message)) $time = null;
|
|
257
257
|
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
258
258
|
class: animation + ' notif' + ' notif__' + pos,
|
|
259
259
|
onClick: e => this.onClick(e),
|
|
@@ -266,18 +266,18 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
266
266
|
alt: "notification background",
|
|
267
267
|
class: "notif_bg",
|
|
268
268
|
src: notif.background_url,
|
|
269
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
269
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css(notif.background_style)
|
|
270
270
|
}), this.renderCloseButton(), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
271
271
|
class: "notif_avatar",
|
|
272
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
272
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css(notif.avatar_style)
|
|
273
273
|
}, $avatar), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
274
274
|
class: "notif_body"
|
|
275
275
|
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
276
276
|
class: "notif_title",
|
|
277
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
277
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css(notif.title_style)
|
|
278
278
|
}, $title), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
279
279
|
class: "notif_message",
|
|
280
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
280
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css(notif.message_style)
|
|
281
281
|
}, $message), $time)));
|
|
282
282
|
}
|
|
283
283
|
}
|