@subiz/widget-v4 4.1.210 → 4.1.211
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 +21 -2
- package/assets/less/chatbox.less +9 -0
- package/assets/less/form.less +10 -0
- package/assets/less/message.less +114 -13
- package/assets/less/widget.less +21 -16
- package/compiled_src/call/css.js +1 -1
- package/compiled_src/chatbox/Buttons.js +7 -4
- package/compiled_src/chatbox/ChatButton.js +115 -29
- package/compiled_src/chatbox/Event.js +37 -5
- package/compiled_src/chatbox/Events.js +348 -129
- package/compiled_src/chatbox/FormAttachment.js +1 -1
- package/compiled_src/chatbox/Header.js +6 -2
- package/compiled_src/chatbox/InfoMessage.js +1 -1
- package/compiled_src/chatbox/MessageInput.js +24 -9
- package/compiled_src/chatbox/OrderAttachments.js +13 -13
- package/compiled_src/chatbox/QuoteMessage.js +3 -2
- package/compiled_src/chatbox/TextMessage.js +22 -18
- package/compiled_src/chatbox/Widget.js +200 -129
- package/compiled_src/chatbox/block.js +39 -29
- package/compiled_src/chatbox/conversation-history.js +44 -0
- package/compiled_src/chatbox/event-layout.js +59 -0
- package/compiled_src/chatbox/greeting.js +32 -0
- package/compiled_src/common.js +13 -9
- package/compiled_src/form/css.js +1 -1
- package/compiled_src/lib.js +22 -32
- package/compiled_src/notif/css.js +1 -1
- package/compiled_src/plugin.js +11 -18
- package/compiled_src/popup/css.js +1 -1
- package/compiled_src/popup/popup.js +1 -1
- package/compiled_src/store/api.js +0 -2
- package/compiled_src/store/api_fake.js +1 -1
- package/compiled_src/store/attachments.js +28 -0
- package/compiled_src/store/chain.js +24 -10
- package/compiled_src/store/kv.js +9 -13
- package/compiled_src/store/lsdb.js +1 -1
- package/compiled_src/store/store.js +356 -117
- package/compiled_src/util/common.js +48 -41
- package/compiled_src/util/event.js +15 -0
- package/compiled_src/util/pubsub.js +28 -13
- package/compiled_src/util/url.js +18 -0
- package/dist/.HASH +1 -0
- package/dist/127.js +13 -13
- package/dist/132.js +1 -1
- package/dist/1a0ddc53cbb.127.js +1 -0
- package/dist/{1a0d80f6e72.132.js → 1a0ddc53cbb.132.js} +1 -1
- package/dist/1a0ddc53cbb.278.js +1 -0
- package/dist/{1a0d80f6e72.339.js → 1a0ddc53cbb.339.js} +1 -1
- package/dist/1a0ddc53cbb.app.js +1 -0
- package/dist/{1a0d80f6e72.chat.html → 1a0ddc53cbb.chat.html} +1 -1
- package/dist/1a0ddc53cbb.chat.js +1 -0
- package/dist/{1a0d80f6e72.form.html → 1a0ddc53cbb.form.html} +1 -1
- package/dist/1a0ddc53cbb.form.js +1 -0
- package/dist/{1a0d80f6e72.index.html → 1a0ddc53cbb.index.html} +1 -1
- package/dist/{1a0d80f6e72.library.html → 1a0ddc53cbb.library.html} +1 -1
- package/dist/1a0ddc53cbb.library.js +1 -0
- package/dist/{1a0d80f6e72.preview.html → 1a0ddc53cbb.preview.html} +1 -1
- package/dist/1a0ddc53cbb.preview.js +1 -0
- package/dist/1a0ddc53cbb.webview.js +1 -0
- package/dist/screenshoot.js +1492 -616
- package/package.json +10 -3
- package/src/chatbox/Buttons.js +5 -4
- package/src/chatbox/ChatButton.js +120 -39
- package/src/chatbox/Event.js +38 -5
- package/src/chatbox/Events.js +306 -134
- package/src/chatbox/FormAttachment.js +1 -1
- package/src/chatbox/Header.js +4 -4
- package/src/chatbox/InfoMessage.js +1 -1
- package/src/chatbox/MessageInput.js +15 -10
- package/src/chatbox/OrderAttachments.js +13 -13
- package/src/chatbox/QuoteMessage.js +3 -2
- package/src/chatbox/TextMessage.js +21 -20
- package/src/chatbox/Widget.js +150 -150
- package/src/chatbox/block.js +29 -27
- package/src/chatbox/conversation-history.js +37 -0
- package/src/chatbox/event-layout.js +72 -0
- package/src/chatbox/greeting.js +13 -0
- package/src/common.js +15 -9
- package/src/lib.js +22 -35
- package/src/plugin.js +11 -13
- package/src/popup/popup.js +1 -1
- package/src/store/api.js +0 -2
- package/src/store/api_fake.js +1 -1
- package/src/store/attachments.js +21 -0
- package/src/store/chain.js +25 -12
- package/src/store/kv.js +10 -19
- package/src/store/lsdb.js +1 -1
- package/src/store/store.js +313 -130
- package/src/util/common.js +48 -43
- package/src/util/event.js +7 -0
- package/src/util/pubsub.js +27 -8
- package/src/util/url.js +14 -0
- package/test.cjs +59 -0
- package/assets/less/contact.less +0 -126
- package/compiled_src/util/common.test.js +0 -414
- package/compiled_src/util/event.test.js +0 -38
- package/compiled_src/util/extractor.test.js +0 -299
- package/compiled_src/util/extractor.test2.js +0 -61
- package/compiled_src/util/gate.test.js +0 -18
- package/compiled_src/util/pubsub.test.js +0 -35
- package/dist/1a0d80f6e72.127.js +0 -1
- package/dist/1a0d80f6e72.278.js +0 -1
- package/dist/1a0d80f6e72.74.js +0 -1
- package/dist/1a0d80f6e72.997.js +0 -1
- package/dist/1a0d80f6e72.app.js +0 -1
- package/dist/1a0d80f6e72.chat.js +0 -1
- package/dist/1a0d80f6e72.form.js +0 -1
- package/dist/1a0d80f6e72.library.js +0 -1
- package/dist/1a0d80f6e72.preview.js +0 -1
- package/dist/1a0d80f6e72.webview.js +0 -1
- package/dist/74.js +0 -376
- package/dist/997.js +0 -37
- package/dist/HASH +0 -1
- package/src/contact/contact.js +0 -400
- package/src/contact/css.js +0 -1
- package/src/util/common.test.js +0 -301
- package/src/util/event.test.js +0 -31
- package/src/util/extractor.test.js +0 -240
- package/src/util/extractor.test2.js +0 -56
- package/src/util/gate.test.js +0 -20
- package/src/util/pubsub.test.js +0 -37
- /package/dist/{1a0d80f6e72.185.js → 1a0ddc53cbb.185.js} +0 -0
- /package/dist/{1a0d80f6e72.27.js → 1a0ddc53cbb.27.js} +0 -0
- /package/dist/{1a0d80f6e72.459.js → 1a0ddc53cbb.459.js} +0 -0
- /package/dist/{1a0d80f6e72.490.js → 1a0ddc53cbb.490.js} +0 -0
package/dist/74.js
DELETED
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[74],{
|
|
3
|
-
|
|
4
|
-
/***/ 9074
|
|
5
|
-
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6
|
-
|
|
7
|
-
__webpack_require__.r(__webpack_exports__);
|
|
8
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
/* harmony export */ "default": () => (/* binding */ Contact),
|
|
10
|
-
/* harmony export */ replaceCssVariable: () => (/* binding */ replaceCssVariable)
|
|
11
|
-
/* harmony export */ });
|
|
12
|
-
/* unused harmony import specifier */ var sb;
|
|
13
|
-
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8026);
|
|
14
|
-
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172);
|
|
15
|
-
/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2840);
|
|
16
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
-
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); }
|
|
19
|
-
;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let CSS = (() => __webpack_require__.e(/* import() */ 997).then(() => (__webpack_require__(997))))();
|
|
23
|
-
class Contact extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .Mw {
|
|
24
|
-
constructor(props) {
|
|
25
|
-
super(props);
|
|
26
|
-
_defineProperty(this, "state", {
|
|
27
|
-
map: false,
|
|
28
|
-
map_loading: false,
|
|
29
|
-
map_initialized: false
|
|
30
|
-
});
|
|
31
|
-
this.showMap = this.showMap.bind(this);
|
|
32
|
-
this.hideMap = this.hideMap.bind(this);
|
|
33
|
-
}
|
|
34
|
-
async initMap() {
|
|
35
|
-
if (this.map_initialized) return;
|
|
36
|
-
this.setState({
|
|
37
|
-
map_initialized: true,
|
|
38
|
-
map_loading: true
|
|
39
|
-
});
|
|
40
|
-
await new Loader({
|
|
41
|
-
apiKey: 'YOUR_API_KEY',
|
|
42
|
-
version: 'weekly'
|
|
43
|
-
}).load();
|
|
44
|
-
this.gmap = new google.maps.Map(document.getElementById('map'));
|
|
45
|
-
this.setState({
|
|
46
|
-
map_loading: false
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
js2css(js, onlyProps) {
|
|
50
|
-
return _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css(js, onlyProps, {
|
|
51
|
-
'@font_size': this.props.plugin.popup.font_size,
|
|
52
|
-
'@font_family': this.props.plugin.popup.font_family,
|
|
53
|
-
'@text_color': this.props.plugin.popup.text_color,
|
|
54
|
-
'@primary_color': this.props.plugin.popup.primary_color,
|
|
55
|
-
'@background': this.props.plugin.popup.background,
|
|
56
|
-
'@spacer0': spacer / 2 + 'px',
|
|
57
|
-
'@spacer': spacer + 'px',
|
|
58
|
-
'@spacer2': spacer * 2 + 'px',
|
|
59
|
-
'@spacer3': spacer * 3 + 'px'
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
renderMapButton(button) {
|
|
63
|
-
let icon = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("svg", {
|
|
64
|
-
width: "20px",
|
|
65
|
-
"aria-hidden": "true",
|
|
66
|
-
focusable: "false",
|
|
67
|
-
"data-prefix": "fas",
|
|
68
|
-
"data-icon": "map-marker-alt",
|
|
69
|
-
role: "img",
|
|
70
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
71
|
-
viewBox: "0 0 384 512",
|
|
72
|
-
class: "svg-inline--fa fa-map-marker-alt fa-w-12 fa-3x"
|
|
73
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("path", {
|
|
74
|
-
fill: "red",
|
|
75
|
-
d: "M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z",
|
|
76
|
-
class: ""
|
|
77
|
-
}));
|
|
78
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
79
|
-
class: "contact_button",
|
|
80
|
-
onClick: this.showMap
|
|
81
|
-
}, this.renderMapModal(button), icon);
|
|
82
|
-
}
|
|
83
|
-
async setMap(lat, lng) {
|
|
84
|
-
console.log('HEE');
|
|
85
|
-
await this.initMap();
|
|
86
|
-
console.log('HEE22');
|
|
87
|
-
window.gmap = this.gmap;
|
|
88
|
-
this.gmap.map.setCenter(new google.maps.LatLng(lat, lng));
|
|
89
|
-
}
|
|
90
|
-
renderMapModal(button) {
|
|
91
|
-
let cls = 'map_modal';
|
|
92
|
-
if (this.state.map) cls += ' map_modal__show';else cls += ' map_modal__hide';
|
|
93
|
-
let overlaycls = 'overlay';
|
|
94
|
-
if (!this.state.map) overlaycls += ' overlay__hidden';
|
|
95
|
-
let $locations = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.map(button.map.locations, loc => {
|
|
96
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
97
|
-
class: "map_location",
|
|
98
|
-
onClick: e => this.setMap(loc.latitude, loc.longitude)
|
|
99
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", null, loc.name), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", null, loc.latitude), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", null, loc.longitude));
|
|
100
|
-
});
|
|
101
|
-
$locations.unshift((0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
102
|
-
class: "map_title"
|
|
103
|
-
}, button.map.title));
|
|
104
|
-
let $map = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
105
|
-
id: "map",
|
|
106
|
-
style: "height: 100%; width: 100%"
|
|
107
|
-
}, ' ');
|
|
108
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
109
|
-
class: overlaycls,
|
|
110
|
-
onClick: this.hideMap
|
|
111
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
112
|
-
class: cls,
|
|
113
|
-
onClick: e => e.stopPropagation()
|
|
114
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
115
|
-
class: "map_body"
|
|
116
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
117
|
-
class: "map_locations"
|
|
118
|
-
}, $locations), $map, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
119
|
-
class: "mapouter"
|
|
120
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
121
|
-
class: "gmap_canvas"
|
|
122
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("iframe", {
|
|
123
|
-
width: "300",
|
|
124
|
-
height: "400",
|
|
125
|
-
id: "gmap_canvas",
|
|
126
|
-
src: "https://maps.google.com/maps?q=2880%20Broadway,%20New%20York&t=&z=13&ie=UTF8&iwloc=&output=embed",
|
|
127
|
-
frameborder: "0",
|
|
128
|
-
scrolling: "no",
|
|
129
|
-
marginheight: "0",
|
|
130
|
-
marginwidth: "0"
|
|
131
|
-
}))))));
|
|
132
|
-
}
|
|
133
|
-
hideMap(e) {
|
|
134
|
-
e.stopPropagation();
|
|
135
|
-
this.setState({
|
|
136
|
-
map: false
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
showMap() {
|
|
140
|
-
this.setState({
|
|
141
|
-
map: true
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
renderZaloButton(button) {
|
|
145
|
-
let icon = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("svg", {
|
|
146
|
-
width: "20px ",
|
|
147
|
-
"aria-hidden": "true",
|
|
148
|
-
focusable: "false",
|
|
149
|
-
"data-prefix": "fab",
|
|
150
|
-
"data-icon": "facebook-f",
|
|
151
|
-
role: "img",
|
|
152
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
153
|
-
viewBox: "0 0 320 512",
|
|
154
|
-
class: "svg-inline--fa fa-facebook-f fa-w-10 fa-5x"
|
|
155
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("path", {
|
|
156
|
-
fill: "currentColor",
|
|
157
|
-
d: "M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z",
|
|
158
|
-
class: ""
|
|
159
|
-
}));
|
|
160
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
161
|
-
class: "contact_button"
|
|
162
|
-
}, icon);
|
|
163
|
-
}
|
|
164
|
-
renderFacebookButton(button) {
|
|
165
|
-
let icon = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("svg", {
|
|
166
|
-
width: "20px ",
|
|
167
|
-
"aria-hidden": "true",
|
|
168
|
-
focusable: "false",
|
|
169
|
-
"data-prefix": "fab",
|
|
170
|
-
"data-icon": "facebook-f",
|
|
171
|
-
role: "img",
|
|
172
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
173
|
-
viewBox: "0 0 320 512",
|
|
174
|
-
class: "svg-inline--fa fa-facebook-f fa-w-10 fa-5x"
|
|
175
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("path", {
|
|
176
|
-
fill: "currentColor",
|
|
177
|
-
d: "M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z",
|
|
178
|
-
class: ""
|
|
179
|
-
}));
|
|
180
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
181
|
-
class: "contact_button"
|
|
182
|
-
}, icon);
|
|
183
|
-
}
|
|
184
|
-
renderChatButton() {
|
|
185
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", null, "Chat");
|
|
186
|
-
}
|
|
187
|
-
renderCallButton() {
|
|
188
|
-
let icon = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("svg", {
|
|
189
|
-
width: "20px",
|
|
190
|
-
"aria-hidden": "true",
|
|
191
|
-
focusable: "false",
|
|
192
|
-
"data-prefix": "fas",
|
|
193
|
-
"data-icon": "phone",
|
|
194
|
-
role: "img",
|
|
195
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
196
|
-
viewBox: "0 0 512 512",
|
|
197
|
-
class: "svg-inline--fa fa-phone fa-w-16 fa-7x"
|
|
198
|
-
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("path", {
|
|
199
|
-
fill: "currentColor",
|
|
200
|
-
d: "M493.4 24.6l-104-24c-11.3-2.6-22.9 3.3-27.5 13.9l-48 112c-4.2 9.8-1.4 21.3 6.9 28l60.6 49.6c-36 76.7-98.9 140.5-177.2 177.2l-49.6-60.6c-6.8-8.3-18.2-11.1-28-6.9l-112 48C3.9 366.5-2 378.1.6 389.4l24 104C27.1 504.2 36.7 512 48 512c256.1 0 464-207.5 464-464 0-11.2-7.7-20.9-18.6-23.4z",
|
|
201
|
-
class: ""
|
|
202
|
-
}));
|
|
203
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", null, icon);
|
|
204
|
-
}
|
|
205
|
-
renderButtons(buttons) {
|
|
206
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.size(buttons) === 0) return null;
|
|
207
|
-
return _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.map(buttons, button => {
|
|
208
|
-
if (button.type === 'map') return this.renderMapButton(button);
|
|
209
|
-
if (button.type === 'zalo') return this.renderZaloButton(button);
|
|
210
|
-
if (button.type === 'facebook') return this.renderFacebookButton(button);
|
|
211
|
-
if (button.type === 'call') return this.renderCallButton(button);
|
|
212
|
-
if (button.type === 'chat') return this.renderChatButton(button);
|
|
213
|
-
return null;
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
renderByLayoutSideByStandard() {
|
|
217
|
-
let $buttons = this.renderButtons(this.props.plugin.contact.buttons);
|
|
218
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", null, $buttons);
|
|
219
|
-
}
|
|
220
|
-
renderLineComponent(com) {
|
|
221
|
-
let style = Object.assign({}, com.style, this.props.mobile ? com.mobile_style : {});
|
|
222
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
223
|
-
style: this.js2css(style)
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
renderTextComponent(com) {
|
|
227
|
-
let style = Object.assign({}, com.style, this.props.mobile ? com.mobile_style : {});
|
|
228
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
229
|
-
class: "text",
|
|
230
|
-
style: this.js2css(style),
|
|
231
|
-
dangerouslySetInnerHTML: {
|
|
232
|
-
__html: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(com, 'text.html')
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
async refreshCSS() {
|
|
237
|
-
let css = (await CSS).default.default.toString();
|
|
238
|
-
var outcss = replaceCssVariable(css, this.props.plugin.popup);
|
|
239
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setCss(this.props.plugin.id, this.$cssStyleDiv, outcss);
|
|
240
|
-
this.setState({
|
|
241
|
-
cssready: true
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
componentDidMount() {
|
|
245
|
-
this.$cssStyleDiv = document.createElement('style');
|
|
246
|
-
document.head.appendChild(this.$cssStyleDiv);
|
|
247
|
-
this.$cssStyleDiv.type = 'text/css';
|
|
248
|
-
this.$cssStyleDiv.id = 'subiz-style-for-' + this.props.plugin.id;
|
|
249
|
-
this.refreshCSS();
|
|
250
|
-
let pluginstringify = JSON.stringify(this.props.plugin);
|
|
251
|
-
this.setState({
|
|
252
|
-
pluginjson: pluginstringify
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
render() {
|
|
256
|
-
if (!this.state.cssready) return null;
|
|
257
|
-
let pluginstringify = JSON.stringify(this.props.plugin);
|
|
258
|
-
if (this.state.pluginjson !== pluginstringify) {
|
|
259
|
-
this.refreshCSS();
|
|
260
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.setTimeout(() => this.setState({
|
|
261
|
-
pluginjson: pluginstringify
|
|
262
|
-
}));
|
|
263
|
-
}
|
|
264
|
-
if (this.state.close) return null;
|
|
265
|
-
let containercss = '';
|
|
266
|
-
let bodycss = '';
|
|
267
|
-
let layout = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, 'contact.layout', 'standard');
|
|
268
|
-
let $body = null;
|
|
269
|
-
if (layout === 'standard' || !layout) {
|
|
270
|
-
$body = this.renderByLayoutSideByStandard();
|
|
271
|
-
}
|
|
272
|
-
if (layout === 'footer') {
|
|
273
|
-
$body = this.renderByLayoutFooter(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
|
|
274
|
-
}
|
|
275
|
-
if (layout === 'mini') {
|
|
276
|
-
$body = this.renderByLayoutMini(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
|
|
277
|
-
}
|
|
278
|
-
if (layout === 'docked') {
|
|
279
|
-
$body = this.renderByLayoutDocked(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, `popup.pages.${this.state.pageIndex}`));
|
|
280
|
-
}
|
|
281
|
-
let left, right, bottom, top, transform;
|
|
282
|
-
let position = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(this.props.plugin, 'contact.position', 'bottom-left');
|
|
283
|
-
if (position === 'center-left') {
|
|
284
|
-
left = '0';
|
|
285
|
-
top = '50%';
|
|
286
|
-
transform = 'translateY(-50%)';
|
|
287
|
-
} else if (position === 'top-left') {
|
|
288
|
-
left = '0';
|
|
289
|
-
top = '20px';
|
|
290
|
-
} else if (position === 'bottom-right') {
|
|
291
|
-
right = '0';
|
|
292
|
-
bottom = '20px';
|
|
293
|
-
} else if (position === 'center-right') {
|
|
294
|
-
right = '0';
|
|
295
|
-
top = '50%';
|
|
296
|
-
transform = 'translateY(-50%)';
|
|
297
|
-
} else if (position === 'top-right') {
|
|
298
|
-
right = '0';
|
|
299
|
-
top = '20px';
|
|
300
|
-
} else {
|
|
301
|
-
left = '0';
|
|
302
|
-
bottom = '20px';
|
|
303
|
-
}
|
|
304
|
-
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
305
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.js2css({
|
|
306
|
-
position: 'absolute',
|
|
307
|
-
left,
|
|
308
|
-
right,
|
|
309
|
-
bottom,
|
|
310
|
-
top,
|
|
311
|
-
transform,
|
|
312
|
-
display: 'flex',
|
|
313
|
-
align_items: 'center',
|
|
314
|
-
justify_content: 'center',
|
|
315
|
-
overflow: 'hidden'
|
|
316
|
-
}),
|
|
317
|
-
onClick: e => e.stopPropagation()
|
|
318
|
-
}, $body);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
function isEmpty(value) {
|
|
322
|
-
return value === undefined || value === null || value === '';
|
|
323
|
-
}
|
|
324
|
-
async function runCampaign(byTrigger) {
|
|
325
|
-
if (ran && byTrigger !== 'area_clicked') return;
|
|
326
|
-
ran = true;
|
|
327
|
-
pageIndex = 0;
|
|
328
|
-
let page = sb.get(camp, `pages.${pageIndex}`) || {};
|
|
329
|
-
showPage(page);
|
|
330
|
-
triggerType = byTrigger;
|
|
331
|
-
let {
|
|
332
|
-
body: impression
|
|
333
|
-
} = await store.sendImpression(camp.id, byTrigger);
|
|
334
|
-
impressionToken = sb.get(impression, 'impression_token') || '';
|
|
335
|
-
}
|
|
336
|
-
function eq(a, b) {
|
|
337
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
338
|
-
}
|
|
339
|
-
function replaceCssVariable(css, setting) {
|
|
340
|
-
var tokens = [css];
|
|
341
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@font_family'");
|
|
342
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@font_size'");
|
|
343
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@text_color'");
|
|
344
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@primary_color'");
|
|
345
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@background'");
|
|
346
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer'");
|
|
347
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer0'");
|
|
348
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer2'");
|
|
349
|
-
tokens = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.tokenize(tokens, "'@spacer3'");
|
|
350
|
-
var ret = [];
|
|
351
|
-
for (var i = 0; i < tokens.length; i++) {
|
|
352
|
-
var item = tokens[i];
|
|
353
|
-
if (typeof item === 'string') {
|
|
354
|
-
ret.push(item);
|
|
355
|
-
continue;
|
|
356
|
-
}
|
|
357
|
-
var path = item.type.substr(2, item.type.length - 3);
|
|
358
|
-
var val = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(setting, path) || _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.get(DEFVAL, path) || '';
|
|
359
|
-
ret.push(val);
|
|
360
|
-
}
|
|
361
|
-
return ret.join('');
|
|
362
|
-
}
|
|
363
|
-
const DEFVAL = {
|
|
364
|
-
font_size: '16px',
|
|
365
|
-
font_family: 'roboto',
|
|
366
|
-
text_color: '#333',
|
|
367
|
-
primary_color: '#333'
|
|
368
|
-
};
|
|
369
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
370
|
-
/* harmony export */ "DEFVAL", 0, /* binding */ DEFVAL
|
|
371
|
-
/* harmony export */ ]);
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
/***/ }
|
|
375
|
-
|
|
376
|
-
}]);
|
package/dist/997.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[997],{
|
|
3
|
-
|
|
4
|
-
/***/ 997
|
|
5
|
-
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6
|
-
|
|
7
|
-
__webpack_require__.r(__webpack_exports__);
|
|
8
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__webpack_require__(1938));
|
|
9
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
10
|
-
/* harmony export */ "default", 0, __WEBPACK_DEFAULT_EXPORT__
|
|
11
|
-
/* harmony export */ ]);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/***/ },
|
|
15
|
-
|
|
16
|
-
/***/ 1938
|
|
17
|
-
(module, __webpack_exports__, __webpack_require__) {
|
|
18
|
-
|
|
19
|
-
__webpack_require__.r(__webpack_exports__);
|
|
20
|
-
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
|
|
21
|
-
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
22
|
-
// Imports
|
|
23
|
-
|
|
24
|
-
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
|
|
25
|
-
// Module
|
|
26
|
-
___CSS_LOADER_EXPORT___.push([module.id, "/*\n#sbz92 * {\n\tall: unset !important;\n}\n\n#sbz92 {\n\tz-index: @z-index + 100 !important;\n\t#makeImportant() !important;\n}\n\n// prevent #subiz inheriting client site styles\ndiv#sbz92 {\n\tall: initial;\n}\n\n// prevent #subiz inheriting client site !important styles\nbody div#sbz92 {\n\tall: initial !important;\n}\n\nbody div#sbz92 .overlay {\n\tposition: fixed !important;\n\tuser-select: none !important;\n}\n*/\n#sbz92 {\n z-index: 2000000100 !important;\n /* Handle on hover */\n}\n#sbz92 *,\n#sbz92 *::before,\n#sbz92 *::after {\n box-sizing: border-box;\n}\n#sbz92 [tabindex='-1']:focus:not(:focus-visible) {\n outline: 0;\n}\n#sbz92 b,\n#sbz92 strong {\n font-weight: 500;\n}\n#sbz92 a {\n color: #020202;\n text-decoration: none;\n background-color: transparent;\n font-weight: 600;\n}\n#sbz92 a:hover {\n cursor: pointer;\n color: #000000;\n text-decoration: underline;\n}\n#sbz92 a:not([href]) {\n color: inherit;\n text-decoration: none;\n}\n#sbz92 a:not([href]):hover {\n color: inherit;\n text-decoration: none;\n}\n#sbz92 img {\n vertical-align: middle;\n border-style: none;\n}\n#sbz92 svg {\n overflow: hidden;\n vertical-align: middle;\n}\n#sbz92 label {\n display: inline-block;\n}\n#sbz92 button {\n border-radius: 0;\n}\n#sbz92 button:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n#sbz92 input,\n#sbz92 button,\n#sbz92 select,\n#sbz92 optgroup,\n#sbz92 textarea {\n margin: 0;\n}\n#sbz92 button,\n#sbz92 input {\n overflow: visible;\n}\n#sbz92 button,\n#sbz92 select {\n text-transform: none;\n}\n#sbz92 select {\n word-wrap: normal;\n}\n#sbz92 button,\n#sbz92 [type=\"button\"],\n#sbz92 [type=\"reset\"],\n#sbz92 [type=\"submit\"] {\n -webkit-appearance: button;\n}\n#sbz92 button:not(:disabled),\n#sbz92 [type='button']:not(:disabled),\n#sbz92 [type='reset']:not(:disabled),\n#sbz92 [type='submit']:not(:disabled) {\n cursor: pointer;\n}\n#sbz92 button::-moz-focus-inner,\n#sbz92 [type='button']::-moz-focus-inner,\n#sbz92 [type='reset']::-moz-focus-inner,\n#sbz92 [type='submit']::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n#sbz92 input[type='radio'],\n#sbz92 input[type='checkbox'] {\n box-sizing: border-box;\n padding: 0;\n}\n#sbz92 input[type='date'],\n#sbz92 input[type='time'],\n#sbz92 input[type='datetime-local'],\n#sbz92 input[type='month'] {\n -webkit-appearance: listbox;\n}\n#sbz92 textarea {\n overflow: auto;\n resize: vertical;\n}\n#sbz92 [type='number']::-webkit-inner-spin-button,\n#sbz92 [type='number']::-webkit-outer-spin-button {\n height: auto;\n}\n#sbz92 [hidden] {\n display: none;\n}\n#sbz92 ::-webkit-input-placeholder {\n /* Edge */\n color: #777;\n}\n#sbz92 :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: #777;\n}\n#sbz92 ::placeholder {\n color: #777;\n}\n#sbz92 div {\n display: block;\n text-rendering: geometricPrecision;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n#sbz92 ::-webkit-scrollbar {\n width: 7px;\n height: 7px;\n}\n#sbz92 ::-webkit-scrollbar-track {\n border-radius: 10px;\n}\n#sbz92 ::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: #d6d6d6;\n}\n#sbz92 ::-webkit-scrollbar-thumb:hover {\n background: #aaa;\n}\n#sbz92 .badge {\n padding: 2px 8px;\n font-size: 12px;\n font-weight: 600;\n border-radius: 6px;\n display: inline-flex;\n align-items: center;\n}\n#sbz92 .badge.badge--success {\n color: #28a745;\n -webkit-text-fill-color: #28a745;\n background: #28a74526;\n}\n#sbz92 .dot {\n width: 8px;\n height: 8px;\n border-radius: 4px;\n flex-shrink: 0;\n background: #000;\n}\n#sbz92 .dot.dot--success {\n background: #28a745;\n}\n#sbz92 .overlay {\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: #000c;\n z-index: 20000000000100;\n overflow: auto;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n#sbz92 .overlay.overlay__hidden {\n display: none;\n}\n#sbz92 .map_modal {\n max-with: 80%;\n max-height: 80%;\n width: 400px;\n height: 400px;\n background: white;\n}\n#sbz92 .map_body {\n width: 100%;\n height: 100%;\n display: flex;\n}\n#sbz92 .map_location {\n border-bottom: 1px solid lightgray;\n padding: 20px;\n font-size: 16px;\n font-family: 'roboto';\n}\n#sbz92 .map_title {\n font-size: 18px;\n font-weight: 500;\n padding: 10px;\n text-align: center;\n border-bottom: 1px solid lightgray;\n font-family: 'roboto';\n}\n#sbz92 .map_locations {\n border-right: 1px solid lightgray;\n width: 200px;\n height: 100%;\n}\n#sbz92 .sm.contact_button {\n width: 40px;\n height: 40px;\n}\n#sbz92 .lg.contact_button {\n width: 60px;\n height: 60px;\n}\n#sbz92 .contact_button {\n width: 50px;\n height: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background: pink;\n}\n", ""]);
|
|
27
|
-
// Exports
|
|
28
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
29
|
-
|
|
30
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
31
|
-
/* harmony export */ "default", 0, __WEBPACK_DEFAULT_EXPORT__
|
|
32
|
-
/* harmony export */ ]);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/***/ }
|
|
36
|
-
|
|
37
|
-
}]);
|
package/dist/HASH
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1a0d80f6e72
|