@cal.macconnachie/web-components 2.2.0 → 2.3.0

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/dist/index.d.ts CHANGED
@@ -5,8 +5,6 @@ import { nothing } from 'lit';
5
5
  import { PropertyValues } from 'lit';
6
6
  import { TemplateResult } from 'lit-html';
7
7
 
8
- export declare const apiClient: ({ baseUrl }: ApiClientConfig) => AxiosInstance;
9
-
10
8
  declare interface ApiClientConfig {
11
9
  baseUrl: string;
12
10
  }
package/dist/index.js CHANGED
@@ -1513,6 +1513,18 @@ class E extends L {
1513
1513
  const { user: e } = await this.getApiService().checkSession();
1514
1514
  e && this.handleAuthSuccess(e);
1515
1515
  } catch {
1516
+ try {
1517
+ window.__authRefreshPromise || (window.__authRefreshPromise = (async () => {
1518
+ try {
1519
+ await this.getApiService().refresh();
1520
+ } finally {
1521
+ window.__authRefreshPromise = null;
1522
+ }
1523
+ })()), await window.__authRefreshPromise;
1524
+ const { user: t } = await this.getApiService().checkSession();
1525
+ t && this.handleAuthSuccess(t);
1526
+ } catch {
1527
+ }
1516
1528
  }
1517
1529
  }
1518
1530
  firstUpdated() {
@@ -7705,7 +7717,7 @@ Ve([
7705
7717
  Ve([
7706
7718
  u({ type: String, attribute: "position", reflect: !0 })
7707
7719
  ], Te.prototype, "position");
7708
- function wa({
7720
+ function ya({
7709
7721
  message: r,
7710
7722
  variant: e = "default",
7711
7723
  position: t = "top-right",
@@ -9957,7 +9969,7 @@ class Sr extends Error {
9957
9969
  super(e), this.name = "AuthRefreshError";
9958
9970
  }
9959
9971
  }
9960
- const ma = ({ baseUrl: r }) => {
9972
+ const wa = ({ baseUrl: r }) => {
9961
9973
  const e = O.create({
9962
9974
  baseURL: r,
9963
9975
  headers: {
@@ -10019,8 +10031,8 @@ const ma = ({ baseUrl: r }) => {
10019
10031
  return Promise.reject(o);
10020
10032
  }
10021
10033
  ), e;
10022
- }, xa = ma;
10023
- function $a() {
10034
+ };
10035
+ function xa() {
10024
10036
  Ns(), Fs(), js(), Zs(), Js(), Gs(), So(), Eo(), Ao(), Po(), Ro(), zo(), Ws(), Io(), Bo(), No();
10025
10037
  }
10026
10038
  export {
@@ -10041,9 +10053,8 @@ export {
10041
10053
  Te as BaseToast,
10042
10054
  Pe as QuantitySelect,
10043
10055
  Oe as ThemeToggle,
10044
- xa as apiClient,
10045
- ma as createApiClient,
10046
- $a as registerAll,
10056
+ wa as createApiClient,
10057
+ xa as registerAll,
10047
10058
  Ns as registerAuthForm,
10048
10059
  Fs as registerBaseButton,
10049
10060
  js as registerBaseCard,
@@ -10060,5 +10071,5 @@ export {
10060
10071
  Io as registerBaseToast,
10061
10072
  Bo as registerQuantitySelect,
10062
10073
  No as registerThemeToggle,
10063
- wa as showToast
10074
+ ya as showToast
10064
10075
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cal.macconnachie/web-components",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Web components hosted on a CDN",
5
5
  "keywords": [
6
6
  "web-components",