@saasquatch/squatch-js 2.8.1-0 → 2.8.1

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 CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.8.1] - 2025-11-17
11
+
12
+ ### Fixed
13
+
14
+ - Prevent overriding of API domain with auto popups
15
+
10
16
  ## [2.8.0] - 2025-10-22
11
17
 
12
18
  ### Added
@@ -387,7 +393,8 @@ No release notes.
387
393
 
388
394
  No release notes.
389
395
 
390
- [unreleased]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.8.0...HEAD
396
+ [unreleased]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.8.1...HEAD
397
+ [2.8.1]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.7.0...@saasquatch%2Fsquatch-js@2.8.1
391
398
  [2.8.0]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.7.0...@saasquatch%2Fsquatch-js@2.8.0
392
399
  [2.7.0]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.6.3...@saasquatch%2Fsquatch-js@2.7.0
393
400
  [2.6.3]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.6.2...@saasquatch%2Fsquatch-js@2.6.3
package/README.md CHANGED
@@ -197,19 +197,11 @@ squatch.api().upsertUser({...});
197
197
  ### `squatch-popup`
198
198
 
199
199
  ```html
200
- <squatch-embed
201
- widget="WIDGET_TYPE"
202
- [
203
- open
204
- |
205
- container="#selector"
206
- |
207
- locale="en_US"
208
- ]
209
- >
200
+ <squatch-popup
201
+ widget="WIDGET_TYPE" [ open | container="#selector" | locale="en_US" ]>
210
202
  <!-- Clicking a child of squatch-popup opens the popup -->
211
203
  <button>Click me to open</button>
212
- </squatch-embed>
204
+ </squatch-popup>
213
205
  ```
214
206
 
215
207
  - `widget: string`: Specifies the SaaSquatch `widgetType` identifier of the desired widget
@@ -1798,11 +1798,11 @@ function _getAutoConfig() {
1798
1798
  _log$3("No _saasquatchExtra param");
1799
1799
  return;
1800
1800
  }
1801
- const config = validateConfig();
1802
- if (!config.domain || !config.tenantAlias) {
1803
- _log$3(
1804
- "domain and tenantAlias must be provided in config to use _saasquatchExtra"
1805
- );
1801
+ const config = validateConfig({
1802
+ tenantAlias: "UNKNOWN"
1803
+ });
1804
+ if (!config.domain) {
1805
+ _log$3("domain must be provided in config to use _saasquatchExtra");
1806
1806
  return;
1807
1807
  }
1808
1808
  let raw;
@@ -1816,7 +1816,8 @@ function _getAutoConfig() {
1816
1816
  return domain.replace(/^https?:\/\//, "");
1817
1817
  }
1818
1818
  const normalizedDomain = normalizeDomain(config.domain);
1819
- const widgetConfig = (_a2 = raw == null ? void 0 : raw[normalizedDomain]) == null ? void 0 : _a2[config.tenantAlias];
1819
+ const tenantAlias = Object.keys((raw == null ? void 0 : raw[normalizedDomain]) || {})[0];
1820
+ const widgetConfig = (_a2 = raw == null ? void 0 : raw[normalizedDomain]) == null ? void 0 : _a2[tenantAlias];
1820
1821
  if (!widgetConfig) {
1821
1822
  _log$3("_saasquatchExtra did not have an expected structure");
1822
1823
  return void 0;
@@ -1830,8 +1831,7 @@ function _getAutoConfig() {
1830
1831
  },
1831
1832
  squatchConfig: {
1832
1833
  ...config,
1833
- domain: config.domain,
1834
- tenantAlias: config.tenantAlias
1834
+ tenantAlias
1835
1835
  }
1836
1836
  };
1837
1837
  }