@saasquatch/squatch-js 2.6.0-7 → 2.6.0-9
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 +3 -0
- package/README.md +14 -5
- package/coverage/clover.xml +582 -566
- package/coverage/coverage-final.json +20 -19
- package/coverage/lcov.info +964 -930
- package/dist/async.d.ts +4 -2
- package/dist/globals.d.ts +4 -0
- package/dist/squatch.esm.js +59 -49
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +59 -49
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/dist/utils/validate.d.ts +0 -2
- package/dist/widgets/PopupWidget.d.ts +2 -2
- package/dist/widgets/Widgets.d.ts +8 -8
- package/dist/widgets/declarative/DeclarativeWidget.d.ts +10 -5
- package/package.json +1 -1
- package/coverage/lcov-report/DeclarativeWidget.ts.html +0 -790
- package/coverage/lcov-report/WidgetApi.ts.html +0 -631
- package/coverage/lcov-report/Widgets.ts.html +0 -1105
- package/coverage/lcov-report/api/AnalyticsApi.ts.html +0 -304
- package/coverage/lcov-report/api/EventsApi.ts.html +0 -352
- package/coverage/lcov-report/api/WidgetApi.ts.html +0 -658
- package/coverage/lcov-report/api/graphql.ts.html +0 -130
- package/coverage/lcov-report/squatch.ts.html +0 -721
- package/coverage/lcov-report/utils/cookieUtils.ts.html +0 -415
- package/coverage/lcov-report/utils/decodeUserJwt.ts.html +0 -133
- package/coverage/lcov-report/utils/domready.ts.html +0 -160
- package/coverage/lcov-report/utils/io.ts.html +0 -400
- package/coverage/lcov-report/utils/utmUtils.ts.html +0 -277
- package/coverage/lcov-report/utils/validate.ts.html +0 -268
- package/coverage/lcov-report/validate.ts.html +0 -268
- package/coverage/lcov-report/widgets/EmbedWidget.ts.html +0 -481
- package/coverage/lcov-report/widgets/PopupWidget.ts.html +0 -685
- package/coverage/lcov-report/widgets/Widget.ts.html +0 -1159
- package/coverage/lcov-report/widgets/Widgets.ts.html +0 -1102
- package/coverage/lcov-report/widgets/declarative/DeclarativeWidget.ts.html +0 -790
- package/coverage/lcov-report/widgets/declarative/DeclarativeWidgets.ts.html +0 -388
- package/dist/squatch.min.js.map +0 -1
- package/dist/squatch.modern.js +0 -2
- package/dist/squatch.modern.js.map +0 -1
- package/dist/stats.html +0 -208
- package/dist/utils/domUtils.d.ts +0 -1
- package/dist/utils/loadEvent.d.ts +0 -2
- package/dist/widgets/CtaWidget.d.ts +0 -24
- package/dist/widgets/IREmbedWidget.d.ts +0 -29
- package/dist/widgets/IRPopupWidget.d.ts +0 -32
- package/dist/widgets/declarative/DeclarativeEmbedWidget.d.ts +0 -12
- package/stats.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
- Added custom web-components `squatch-embed` and `squatch-popup` for easier widget rendering.
|
|
11
|
+
- Support for additional namespacing of squatchjs
|
|
12
|
+
|
|
10
13
|
## [2.5.0] - 2023-05-16
|
|
11
14
|
|
|
12
15
|
### Removed
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ Include either of the squatchjs generated web-components in your page's HTML to
|
|
|
43
43
|
<!-- POPUP WIDGET -->
|
|
44
44
|
<squatch-popup widget="WIDGET_TYPE"><!-- Widget is rendered here --></squatch-popup>
|
|
45
45
|
```
|
|
46
|
-
For rendering widgets and API calls,
|
|
46
|
+
For rendering widgets and API calls, squatchjs respects configurations set on the following:
|
|
47
47
|
- `window.squatchToken`: Signed JWT for calls to the SaaSquatch API -- [How to generate valid JWT Tokens](https://docs.saasquatch.com/topics/json-web-tokens#example-building-the-jwt)
|
|
48
48
|
- `window.squatchTenant`: SaaSquatch tenant alias
|
|
49
49
|
- `window.squatchConfig`: Additional configuration overrides (Optional)
|
|
@@ -140,7 +140,7 @@ squatch.api().upsertUser({...});
|
|
|
140
140
|
|
|
141
141
|
### `squatch-embed`
|
|
142
142
|
```html
|
|
143
|
-
<squatch-embed widget="WIDGET_TYPE" [ container="#selector" ]>
|
|
143
|
+
<squatch-embed widget="WIDGET_TYPE" [ container="#selector" | locale="en_US" ]>
|
|
144
144
|
<!-- Children of squatch-embed act as a loading state -->
|
|
145
145
|
Loading...
|
|
146
146
|
</squatch-embed>
|
|
@@ -148,14 +148,17 @@ squatch.api().upsertUser({...});
|
|
|
148
148
|
|
|
149
149
|
- `widget`: Specifies the SaaSquatch `widgetType` identifier of the desired widget
|
|
150
150
|
- Required
|
|
151
|
+
- Changing this attribute's value causes the widget to reload.
|
|
151
152
|
- `container`: A CSS selector for a container element to use as the parent of the widget's iframe.
|
|
152
153
|
- Default: `null`
|
|
153
154
|
- Note, if no container is specified, the widget iframe will attach to the shadow DOM of `squatch-embed`.
|
|
154
|
-
|
|
155
|
+
- `locale`: Locale that determines the widget translation displayed. Should be of the form "xx_XX".
|
|
156
|
+
- Default: Browser's current locale
|
|
157
|
+
- Changing this attribute's value causes the widget to reload.
|
|
155
158
|
|
|
156
159
|
### `squatch-popup`
|
|
157
160
|
```html
|
|
158
|
-
<squatch-embed widget="WIDGET_TYPE" [ open ]>
|
|
161
|
+
<squatch-embed widget="WIDGET_TYPE" [ open | container="#selector" | locale="en_US" ]>
|
|
159
162
|
<!-- Clicking a child of squatch-popup opens the popup -->
|
|
160
163
|
<button>Click me to open</button>
|
|
161
164
|
</squatch-embed>
|
|
@@ -165,11 +168,17 @@ squatch.api().upsertUser({...});
|
|
|
165
168
|
- Required
|
|
166
169
|
- `open: boolean`: Whether to the popup is open when loaded into the page
|
|
167
170
|
- Default: `false`
|
|
171
|
+
- `container`: A CSS selector for a container element to use as the parent of the widget's iframe.
|
|
172
|
+
- Default: `null`
|
|
173
|
+
- Note, if no container is specified, the widget iframe will attach to the shadow DOM of `squatch-embed`.
|
|
174
|
+
- `locale`: Locale that determines the widget translation displayed. Should be of the form "xx_XX".
|
|
175
|
+
- Default: Browser's current locale
|
|
176
|
+
- Changing this attribute's value causes the widget to reload.
|
|
168
177
|
|
|
169
178
|
## Legacy
|
|
170
179
|
|
|
171
180
|
### Rendering a widget via Widgets API
|
|
172
|
-
Note: `engagementMedium` is required in the `squatch.widgets()` functions if you want to load the widget. Otherwise,
|
|
181
|
+
Note: `engagementMedium` is required in the `squatch.widgets()` functions if you want to load the widget. Otherwise, squatch.js will look for your portal settings and render the widget that's mapped to the URL where this snippet is included.
|
|
173
182
|
|
|
174
183
|
```html
|
|
175
184
|
<script type="text/javascript">
|