@saasquatch/squatch-js 2.4.3-4 → 2.4.3
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/CHANGELOG.md +291 -278
- package/LICENSE +20 -20
- package/README.md +1 -0
- package/demo/sandbox.ts +5 -7
- package/demo/toolbar.tsx +1 -1
- package/dist/api/AnalyticsApi.d.ts +1 -1
- package/dist/api/WidgetApi.d.ts +17 -4
- package/dist/squatch.d.ts +2 -12
- package/dist/squatch.esm.js +159 -267
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +158 -268
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +3 -3
- package/dist/squatch.min.js.map +1 -1
- package/dist/squatch.modern.js +1 -1
- package/dist/squatch.modern.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types.d.ts +8 -10
- package/dist/utils/cookieUtils.d.ts +0 -1
- package/dist/utils/io.d.ts +1 -2
- package/dist/utils/validate.d.ts +0 -2
- package/dist/widgets/Widgets.d.ts +17 -3
- package/package.json +105 -104
- package/dist/utils/utmUtils.d.ts +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,278 +1,291 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
## [2.
|
|
11
|
-
|
|
12
|
-
###
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
###
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
```js
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## [2.1.
|
|
132
|
-
|
|
133
|
-
No release notes.
|
|
134
|
-
|
|
135
|
-
## [2.1.
|
|
136
|
-
|
|
137
|
-
No release notes.
|
|
138
|
-
|
|
139
|
-
## [2.1.
|
|
140
|
-
|
|
141
|
-
No release notes.
|
|
142
|
-
|
|
143
|
-
## [2.1.
|
|
144
|
-
|
|
145
|
-
No release notes.
|
|
146
|
-
|
|
147
|
-
## [2.1.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
## [2.0.
|
|
170
|
-
|
|
171
|
-
###
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
## [2.0.
|
|
176
|
-
|
|
177
|
-
### Fixed
|
|
178
|
-
|
|
179
|
-
- Fix
|
|
180
|
-
|
|
181
|
-
## [2.0.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
## [2.0.
|
|
194
|
-
|
|
195
|
-
No release notes.
|
|
196
|
-
|
|
197
|
-
## [2.0.
|
|
198
|
-
|
|
199
|
-
No release notes.
|
|
200
|
-
|
|
201
|
-
## [2.0.
|
|
202
|
-
|
|
203
|
-
No release notes.
|
|
204
|
-
|
|
205
|
-
## [2.0.
|
|
206
|
-
|
|
207
|
-
No release notes.
|
|
208
|
-
|
|
209
|
-
## [2.0.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
## [2.0.
|
|
233
|
-
|
|
234
|
-
No release notes.
|
|
235
|
-
|
|
236
|
-
## [2.0.
|
|
237
|
-
|
|
238
|
-
No release notes.
|
|
239
|
-
|
|
240
|
-
## [2.0.
|
|
241
|
-
|
|
242
|
-
No release notes.
|
|
243
|
-
|
|
244
|
-
[
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
[2.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
[2.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
[
|
|
257
|
-
[2.
|
|
258
|
-
[2.
|
|
259
|
-
[2.
|
|
260
|
-
[2.
|
|
261
|
-
[2.
|
|
262
|
-
[2.0
|
|
263
|
-
[2.
|
|
264
|
-
[2.0
|
|
265
|
-
[2.
|
|
266
|
-
[2.
|
|
267
|
-
[2.
|
|
268
|
-
[2.
|
|
269
|
-
[2.
|
|
270
|
-
[2.
|
|
271
|
-
[2.
|
|
272
|
-
[2.
|
|
273
|
-
[2.0
|
|
274
|
-
[2.0.
|
|
275
|
-
[2.0.
|
|
276
|
-
[2.0.
|
|
277
|
-
[2.0.
|
|
278
|
-
[2.0.
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [2.4.3] - 2023-04-20
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Updated license copyright to be in line with SaaSquatch open-source policy.
|
|
14
|
+
|
|
15
|
+
## [2.4.2] - 2023-04-10
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added value to return data `squatchReferralCookie` to retrieve the encoded cookie
|
|
20
|
+
|
|
21
|
+
- Example:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
squatch
|
|
25
|
+
.api()
|
|
26
|
+
.squatchReferralCookie()
|
|
27
|
+
.then(function (response) {
|
|
28
|
+
const cookie = response.encodedCookie;
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## [2.4.1] - 2022-09-23
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Added event idempotencyKey to types
|
|
37
|
+
|
|
38
|
+
## [2.4.0] - 2022-03-15
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- EmbedWidget now supports a `container` as either a selector or an HTMLElement as a parameter
|
|
43
|
+
|
|
44
|
+
- Widget contents will be loaded in a hidden widget and can be opened and closed with `widget.open()` and `widget.close()`
|
|
45
|
+
|
|
46
|
+
- Example:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
var initObj = {
|
|
50
|
+
id: "testUser",
|
|
51
|
+
accountId: "testUser",
|
|
52
|
+
widgetType: "<MY_WIDGET>",
|
|
53
|
+
user: {
|
|
54
|
+
id: "testUser",
|
|
55
|
+
accountId: "testUser",
|
|
56
|
+
},
|
|
57
|
+
jwt: "<MY_JWT>",
|
|
58
|
+
engagementMedium: "EMBED",
|
|
59
|
+
container: ".myContainer",
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
squatch
|
|
63
|
+
.widgets()
|
|
64
|
+
.upsertUser(initObj)
|
|
65
|
+
.then(function (response) {
|
|
66
|
+
widget = response.widget;
|
|
67
|
+
widget.open();
|
|
68
|
+
})
|
|
69
|
+
.catch(function (error) {
|
|
70
|
+
console.log(error);
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- PopupWidget now supports a `trigger` as a selector
|
|
75
|
+
|
|
76
|
+
- provides the ability to use a class other than `.squatchpop` for opening the widget
|
|
77
|
+
|
|
78
|
+
- `sq:refresh` event is sent when `.open()` is called on EmbedWidget and PopupWidget
|
|
79
|
+
|
|
80
|
+
## [2.3.1] - 2022-01-11
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- Reduced resize timeout to 500ms from 5000ms
|
|
85
|
+
|
|
86
|
+
## [2.3.0] - 2021-05-19
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- Typescript definitions
|
|
91
|
+
- CommonJS/ES modules build for smaller bundle sizes when using squatch-js from NPM
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- `main` is now a CommonJS build instead of a UMD build
|
|
96
|
+
|
|
97
|
+
## [2.2.1] - 2020-06-17
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- Remove the need to have JS Options, so that older clients can upgrade to squatch.js v2 easily.
|
|
102
|
+
|
|
103
|
+
## [2.2.0] - 2020-06-12
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
|
|
107
|
+
- Reads `_saasquatch` from the URL and stores a 1st-party cookie on the specified landing page's domain.
|
|
108
|
+
- Sets `cookies` on users during an upsert **automatically**
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
{
|
|
112
|
+
user: {
|
|
113
|
+
id: "abc",
|
|
114
|
+
accountId: "abc",
|
|
115
|
+
cookies: "SAASQUATCHCOOKIE",
|
|
116
|
+
...
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
- Reads the 1st-party cookie when using `autofill`
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
squatch
|
|
124
|
+
.api()
|
|
125
|
+
.squatchReferralCookie()
|
|
126
|
+
.then(function (response) {
|
|
127
|
+
element.value = response.codes["program-id"];
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## [2.1.8] - 2020-05-25
|
|
132
|
+
|
|
133
|
+
No release notes.
|
|
134
|
+
|
|
135
|
+
## [2.1.7] - 2020-05-21
|
|
136
|
+
|
|
137
|
+
No release notes.
|
|
138
|
+
|
|
139
|
+
## [2.1.6] - 2019-04-15
|
|
140
|
+
|
|
141
|
+
No release notes.
|
|
142
|
+
|
|
143
|
+
## [2.1.5] - 2019-02-19
|
|
144
|
+
|
|
145
|
+
No release notes.
|
|
146
|
+
|
|
147
|
+
## [2.1.4] - 2019-01-03
|
|
148
|
+
|
|
149
|
+
No release notes.
|
|
150
|
+
|
|
151
|
+
## [2.1.3] - 2018-12-05
|
|
152
|
+
|
|
153
|
+
No release notes.
|
|
154
|
+
|
|
155
|
+
## [2.1.2] - 2018-10-22
|
|
156
|
+
|
|
157
|
+
No release notes.
|
|
158
|
+
|
|
159
|
+
## [2.1.1] - 2018-10-19
|
|
160
|
+
|
|
161
|
+
### Fixed
|
|
162
|
+
|
|
163
|
+
- POPUP Widget in iOS Safari is not clickable when is hidden anymore
|
|
164
|
+
|
|
165
|
+
## [2.1.0] - 2018-09-26
|
|
166
|
+
|
|
167
|
+
No release notes.
|
|
168
|
+
|
|
169
|
+
## [2.0.17] - 2017-12-21
|
|
170
|
+
|
|
171
|
+
### Fixed
|
|
172
|
+
|
|
173
|
+
- Fixed content-type detection bug
|
|
174
|
+
|
|
175
|
+
## [2.0.16] - 2017-10-24
|
|
176
|
+
|
|
177
|
+
### Fixed
|
|
178
|
+
|
|
179
|
+
- Fix scrolling issue to allow scrolling within popup modal
|
|
180
|
+
|
|
181
|
+
## [2.0.15] - 2017-10-12
|
|
182
|
+
|
|
183
|
+
### Added
|
|
184
|
+
|
|
185
|
+
- Support for scrolling popup in mobile
|
|
186
|
+
|
|
187
|
+
## [2.0.14] - 2017-10-11
|
|
188
|
+
|
|
189
|
+
### Fixed
|
|
190
|
+
|
|
191
|
+
- Fix registration form message in popup
|
|
192
|
+
|
|
193
|
+
## [2.0.13] - 2017-08-03
|
|
194
|
+
|
|
195
|
+
No release notes.
|
|
196
|
+
|
|
197
|
+
## [2.0.12] - 2017-07-18
|
|
198
|
+
|
|
199
|
+
No release notes.
|
|
200
|
+
|
|
201
|
+
## [2.0.11] - 2017-07-18
|
|
202
|
+
|
|
203
|
+
No release notes.
|
|
204
|
+
|
|
205
|
+
## [2.0.10] - 2017-06-30
|
|
206
|
+
|
|
207
|
+
No release notes.
|
|
208
|
+
|
|
209
|
+
## [2.0.9] - 2017-06-08
|
|
210
|
+
|
|
211
|
+
No release notes.
|
|
212
|
+
|
|
213
|
+
## [2.0.8] - 2017-06-08
|
|
214
|
+
|
|
215
|
+
No release notes.
|
|
216
|
+
|
|
217
|
+
## [2.0.7] - 2017-04-24
|
|
218
|
+
|
|
219
|
+
No release notes.
|
|
220
|
+
|
|
221
|
+
## [2.0.6] - 2017-02-14
|
|
222
|
+
|
|
223
|
+
### Fixed
|
|
224
|
+
|
|
225
|
+
- Fix share tracking
|
|
226
|
+
- Ignore CONVERSION_WIDGET widget rules when there's no referrals
|
|
227
|
+
|
|
228
|
+
### Changed
|
|
229
|
+
|
|
230
|
+
- Auto-fill content type check changed to non-case sensitive
|
|
231
|
+
|
|
232
|
+
## [2.0.5] - 2016-12-07
|
|
233
|
+
|
|
234
|
+
No release notes.
|
|
235
|
+
|
|
236
|
+
## [2.0.4] - 2016-12-06
|
|
237
|
+
|
|
238
|
+
No release notes.
|
|
239
|
+
|
|
240
|
+
## [2.0.3] - 2016-11-30
|
|
241
|
+
|
|
242
|
+
No release notes.
|
|
243
|
+
|
|
244
|
+
## [2.0.2] - 2016-11-29
|
|
245
|
+
|
|
246
|
+
No release notes.
|
|
247
|
+
|
|
248
|
+
## [2.0.1] - 2016-11-25
|
|
249
|
+
|
|
250
|
+
No release notes.
|
|
251
|
+
|
|
252
|
+
## [2.0.0] - 2016-11-25
|
|
253
|
+
|
|
254
|
+
No release notes.
|
|
255
|
+
|
|
256
|
+
[unreleased]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.3...HEAD
|
|
257
|
+
[2.4.3]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.2...@saasquatch%2Fsquatch-js@2.4.3
|
|
258
|
+
[2.4.2]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.1...@saasquatch%2Fsquatch-js@2.4.2
|
|
259
|
+
[2.4.1]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.0...@saasquatch%2Fsquatch-js@2.4.1
|
|
260
|
+
[2.4.0]: https://github.com/saasquatch/squatch-js/compare/v2.3.1...@saasquatch%2Fsquatch-js@2.4.0
|
|
261
|
+
[2.3.1]: https://github.com/saasquatch/squatch-js/compare/v2.3.0...v2.3.1
|
|
262
|
+
[2.3.0]: https://github.com/saasquatch/squatch-js/compare/v2.2.1...v2.3.0
|
|
263
|
+
[2.2.1]: https://github.com/saasquatch/squatch-js/compare/v2.2.0...v2.2.1
|
|
264
|
+
[2.2.0]: https://github.com/saasquatch/squatch-js/compare/v2.1.8...v2.2.0
|
|
265
|
+
[2.1.8]: https://github.com/saasquatch/squatch-js/compare/v2.1.7...v2.1.8
|
|
266
|
+
[2.1.7]: https://github.com/saasquatch/squatch-js/compare/v2.1.6...v2.1.7
|
|
267
|
+
[2.1.6]: https://github.com/saasquatch/squatch-js/compare/v2.1.5...v2.1.6
|
|
268
|
+
[2.1.5]: https://github.com/saasquatch/squatch-js/compare/v2.1.4...v2.1.5
|
|
269
|
+
[2.1.4]: https://github.com/saasquatch/squatch-js/compare/v2.1.3...v2.1.4
|
|
270
|
+
[2.1.3]: https://github.com/saasquatch/squatch-js/compare/v2.1.2...v2.1.3
|
|
271
|
+
[2.1.2]: https://github.com/saasquatch/squatch-js/compare/v2.1.1...v2.1.2
|
|
272
|
+
[2.1.1]: https://github.com/saasquatch/squatch-js/compare/v2.1.0...v2.1.1
|
|
273
|
+
[2.1.0]: https://github.com/saasquatch/squatch-js/compare/v2.0.17...v2.1.0
|
|
274
|
+
[2.0.17]: https://github.com/saasquatch/squatch-js/compare/v2.0.16...v2.0.17
|
|
275
|
+
[2.0.16]: https://github.com/saasquatch/squatch-js/compare/v2.0.15...v2.0.16
|
|
276
|
+
[2.0.15]: https://github.com/saasquatch/squatch-js/compare/v2.0.14...v2.0.15
|
|
277
|
+
[2.0.14]: https://github.com/saasquatch/squatch-js/compare/v2.0.13...v2.0.14
|
|
278
|
+
[2.0.13]: https://github.com/saasquatch/squatch-js/compare/v2.0.12...v2.0.13
|
|
279
|
+
[2.0.12]: https://github.com/saasquatch/squatch-js/compare/v2.0.11...v2.0.12
|
|
280
|
+
[2.0.11]: https://github.com/saasquatch/squatch-js/compare/v2.0.10...v2.0.11
|
|
281
|
+
[2.0.10]: https://github.com/saasquatch/squatch-js/compare/v2.0.9...v2.0.10
|
|
282
|
+
[2.0.9]: https://github.com/saasquatch/squatch-js/compare/v2.0.8...v2.0.9
|
|
283
|
+
[2.0.8]: https://github.com/saasquatch/squatch-js/compare/v2.0.7...v2.0.8
|
|
284
|
+
[2.0.7]: https://github.com/saasquatch/squatch-js/compare/v2.0.6...v2.0.7
|
|
285
|
+
[2.0.6]: https://github.com/saasquatch/squatch-js/compare/v2.0.5...v2.0.6
|
|
286
|
+
[2.0.5]: https://github.com/saasquatch/squatch-js/compare/v2.0.4...v2.0.5
|
|
287
|
+
[2.0.4]: https://github.com/saasquatch/squatch-js/compare/v2.0.3...v2.0.4
|
|
288
|
+
[2.0.3]: https://github.com/saasquatch/squatch-js/compare/v2.0.2...v2.0.3
|
|
289
|
+
[2.0.2]: https://github.com/saasquatch/squatch-js/compare/v2.0.1...v2.0.2
|
|
290
|
+
[2.0.1]: https://github.com/saasquatch/squatch-js/compare/v2.0.0...v2.0.1
|
|
291
|
+
[2.0.0]: https://github.com/saasquatch/squatch-js/releases/tag/v2.0.0
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 ReferralSaaSquatch.com, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
21
|
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -45,6 +45,7 @@ Note: `engagementMedium` is required in the `squatch.widgets()` functions if you
|
|
|
45
45
|
widgetType: 'p/PROGRAM-ID/w/referrerWidget', // Update PROGRAM-ID
|
|
46
46
|
jwt: 'TOKEN' // String (required by default, or disable Security in the portal)
|
|
47
47
|
|
|
48
|
+
});
|
|
48
49
|
});
|
|
49
50
|
</script>
|
|
50
51
|
```
|
package/demo/sandbox.ts
CHANGED
|
@@ -36,7 +36,8 @@ export const popup: Sandbox = {
|
|
|
36
36
|
widgetType: "REFERRER_WIDGET",
|
|
37
37
|
engagementMedium: "POPUP",
|
|
38
38
|
user: user,
|
|
39
|
-
jwt:
|
|
39
|
+
jwt:
|
|
40
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWI5ODBkMzRlNGIwY2FiZWUwN2YyY2IwIiwiYWNjb3VudElkIjoiQVpKWlNWRzBMUzFMQjE5UiIsImVtYWlsIjoiY2hlc3RlcnNjb3R0LnVleHdsdGdoQG1haWxvc2F1ci5pbyJ9fQ.MkrO7-980M7NRJcOUcdqCO1JftqmynLMK8bTEB3WObo",
|
|
40
41
|
},
|
|
41
42
|
};
|
|
42
43
|
|
|
@@ -52,7 +53,8 @@ export const embed: Sandbox = {
|
|
|
52
53
|
accountId: "AZJZSVG0LS1LB19R",
|
|
53
54
|
email: "chesterscott.uexwltgh@mailosaur.io",
|
|
54
55
|
},
|
|
55
|
-
jwt:
|
|
56
|
+
jwt:
|
|
57
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWI5ODBkMzRlNGIwY2FiZWUwN2YyY2IwIiwiYWNjb3VudElkIjoiQVpKWlNWRzBMUzFMQjE5UiIsImVtYWlsIjoiY2hlc3RlcnNjb3R0LnVleHdsdGdoQG1haWxvc2F1ci5pbyJ9fQ.MkrO7-980M7NRJcOUcdqCO1JftqmynLMK8bTEB3WObo",
|
|
56
58
|
},
|
|
57
59
|
};
|
|
58
60
|
|
|
@@ -110,15 +112,11 @@ export function toURL(sandbox: Sandbox) {
|
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
export function href(sandbox: Sandbox) {
|
|
113
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
114
115
|
const param = window.btoa(JSON.stringify(sandbox));
|
|
115
116
|
var url = window.location.href;
|
|
116
117
|
if (url.indexOf("?") > 0) {
|
|
117
118
|
url = url.substring(0, url.indexOf("?"));
|
|
118
119
|
}
|
|
119
|
-
|
|
120
|
-
urlParams.delete("sandbox");
|
|
121
|
-
|
|
122
|
-
url += `?sandbox=${encodeURIComponent(param)}&${urlParams.toString()}`;
|
|
120
|
+
url += `?sandbox=${encodeURIComponent(param)}`;
|
|
123
121
|
return url;
|
|
124
122
|
}
|