@hellocoop/vue 2.1.6 → 2.1.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/README.md CHANGED
@@ -3,8 +3,7 @@
3
3
  [Hellō](https://hello.dev) is an identity network that provides login and registration using the standard OpenID Connect protocol. Hellō offers your users choice between all popular social login providers.
4
4
 
5
5
  This [Vue](https://vuejs.org/) package provides:
6
+
6
7
  - Vue components for buttons and logged in context
7
8
 
8
9
  See the [Vue SDK documentation](https://www.hello.dev/docs/sdks/vue) for details.
9
-
10
-
package/dist/auth.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Claims } from './types';
2
-
3
2
  type AuthCookie = {
4
3
  sub: string;
5
4
  iat: number;
@@ -1,5 +1,4 @@
1
1
  import { Button, ProviderHint, Scope } from '../types';
2
-
3
2
  type Props = {
4
3
  label?: string;
5
4
  style?: any;
@@ -17,29 +16,7 @@ type Props = {
17
16
  loginHint?: string;
18
17
  domainHint?: string;
19
18
  };
20
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
21
- label: string;
22
- color: string;
23
- theme: string;
24
- hover: string;
25
- showLoader: boolean;
26
- disabled: boolean;
27
- promptLogin: boolean;
28
- promptConsent: boolean;
29
- loginHint: string;
30
- domainHint: string;
31
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
32
- label: string;
33
- color: string;
34
- theme: string;
35
- hover: string;
36
- showLoader: boolean;
37
- disabled: boolean;
38
- promptLogin: boolean;
39
- promptConsent: boolean;
40
- loginHint: string;
41
- domainHint: string;
42
- }>>> & Readonly<{}>, {
19
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
43
20
  label: string;
44
21
  color: Button.Color;
45
22
  theme: Button.Theme;
@@ -50,22 +27,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
50
27
  promptConsent: boolean;
51
28
  loginHint: string;
52
29
  domainHint: string;
53
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
30
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
54
31
  export default _default;
55
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
56
- type __VLS_TypePropsToRuntimeProps<T> = {
57
- [K in keyof T]-?: {} extends Pick<T, K> ? {
58
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
59
- } : {
60
- type: import('vue').PropType<T[K]>;
61
- required: true;
62
- };
63
- };
64
- type __VLS_WithDefaults<P, D> = {
65
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
66
- default: D[K];
67
- }> : P[K];
68
- };
69
- type __VLS_Prettify<T> = {
70
- [K in keyof T]: T[K];
71
- } & {};
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
2
2
  export default _default;
package/dist/index.d.ts CHANGED
@@ -5,4 +5,4 @@ export { default as LoggedIn } from './login-status/LoggedIn.vue';
5
5
  export { default as LoggedOut } from './login-status/LoggedOut.vue';
6
6
  export * from './auth.js';
7
7
  export * from './logout.js';
8
- export { default as HelloProvider, routeConfig, useHelloProviderContext } from './provider.js';
8
+ export { default as HelloProvider, routeConfig, useHelloProviderContext, } from './provider.js';
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { provide as oe, inject as le, defineComponent as C, onMounted as Q, ref as X, openBlock as E, createElementBlock as M, normalizeClass as se, unref as Y, normalizeStyle as ue, createElementVNode as ce, createBlock as j, getCurrentInstance as fe, reactive as de, onUnmounted as he, watch as ve, isReadonly as ge, toRefs as me, renderSlot as Z, createCommentVNode as ee } from "vue";
1
+ import { inject as oe, provide as le, defineComponent as E, onMounted as Q, ref as X, createElementBlock as M, openBlock as I, normalizeStyle as ue, normalizeClass as se, unref as Y, createElementVNode as ce, createBlock as j, getCurrentInstance as fe, reactive as de, onUnmounted as he, watch as ve, isReadonly as ge, toRefs as me, createCommentVNode as Z, renderSlot as ee } from "vue";
2
2
  const w = {
3
3
  login: "/api/hellocoop?login=true",
4
4
  auth: "/api/hellocoop?auth=true",
5
5
  logout: "/api/hellocoop?logout=true"
6
- }, te = "HelloAuth", ye = () => le(te), Be = {
6
+ }, te = "HelloAuth", ye = () => oe(te), Te = {
7
7
  props: ["auth", "config"],
8
8
  setup(t) {
9
9
  var n, e, i;
10
- (n = t == null ? void 0 : t.config) != null && n.login && (w.login = t.config.login), (e = t == null ? void 0 : t.config) != null && e.auth && (w.auth = t.config.auth), (i = t == null ? void 0 : t.config) != null && i.logout && (w.logout = t.config.logout), oe(te, t.auth);
10
+ (n = t == null ? void 0 : t.config) != null && n.login && (w.login = t.config.login), (e = t == null ? void 0 : t.config) != null && e.auth && (w.auth = t.config.auth), (i = t == null ? void 0 : t.config) != null && i.logout && (w.logout = t.config.logout), le(te, t.auth);
11
11
  },
12
12
  render() {
13
13
  return this.$slots.default();
@@ -35,7 +35,7 @@ var A;
35
35
  }
36
36
  };
37
37
  })(A || (A = {}));
38
- const be = ["disabled"], pe = ["innerHTML"], U = /* @__PURE__ */ C({
38
+ const pe = ["disabled"], be = ["innerHTML"], U = /* @__PURE__ */ E({
39
39
  __name: "BaseButton",
40
40
  props: {
41
41
  label: { default: "ō&nbsp;&nbsp;&nbsp;Continue with Hellō" },
@@ -57,44 +57,56 @@ const be = ["disabled"], pe = ["innerHTML"], U = /* @__PURE__ */ C({
57
57
  setup(t) {
58
58
  let n = !1;
59
59
  Q(() => {
60
- typeof window < "u" && !n && (Array.from(document.head.getElementsByTagName("link")).find(
61
- (f) => {
62
- var s;
63
- return f.getAttribute("rel") === "stylesheet" && ((s = f.getAttribute("href")) == null ? void 0 : s.startsWith(A.STYLES_URL));
60
+ typeof window < "u" && !n && (Array.from(
61
+ document.head.getElementsByTagName("link")
62
+ ).find(
63
+ (d) => {
64
+ var u;
65
+ return d.getAttribute("rel") === "stylesheet" && ((u = d.getAttribute("href")) == null ? void 0 : u.startsWith(A.STYLES_URL));
64
66
  }
65
- ) || console.warn("Could not find Hellō stylesheet. Please add to pages with Hellō buttons. See http://hello.dev/docs/buttons/#stylesheet for more info."), n = !0);
67
+ ) || console.warn(
68
+ "Could not find Hellō stylesheet. Please add to pages with Hellō buttons. See http://hello.dev/docs/buttons/#stylesheet for more info."
69
+ ), n = !0);
66
70
  });
67
71
  const e = X(!1), i = t, a = new URL(w.login, window.location.origin);
68
- i.scope && a.searchParams.set("scope", i.scope.join(" ")), a.searchParams.set("target_uri", i.targetURI || window.location.pathname), i.update && a.searchParams.set("prompt", "consent"), i.promptLogin && i.promptConsent ? a.searchParams.set("prompt", "login consent") : i.promptLogin ? a.searchParams.set("prompt", "login") : i.promptConsent && a.searchParams.set("prompt", "consent"), i.loginHint && a.searchParams.set("login_hint", i.loginHint), i.domainHint && a.searchParams.set("login_hint", i.domainHint), i.providerHint && a.searchParams.set("provider_hint", i.providerHint.join(" "));
72
+ i.scope && a.searchParams.set("scope", i.scope.join(" ")), a.searchParams.set(
73
+ "target_uri",
74
+ i.targetURI || window.location.pathname
75
+ ), i.update && a.searchParams.set("prompt", "consent"), i.promptLogin && i.promptConsent ? a.searchParams.set("prompt", "login consent") : i.promptLogin ? a.searchParams.set("prompt", "login") : i.promptConsent && a.searchParams.set("prompt", "consent"), i.loginHint && a.searchParams.set("login_hint", i.loginHint), i.domainHint && a.searchParams.set("login_hint", i.domainHint), i.providerHint && a.searchParams.set("provider_hint", i.providerHint.join(" "));
69
76
  const r = () => {
70
77
  e.value = !0, window.location.href = a.href;
71
78
  };
72
- return (l, f) => {
73
- var s;
74
- return E(), M("button", {
75
- onClick: r,
76
- class: se(["hello-btn", (s = Y(A).CLASS_MAPPING[i.color]) == null ? void 0 : s[i.theme], Y(A).HOVER_MAPPING[l.hover], (l.showLoader || e.value) && "hello-btn-loader"]),
79
+ return (l, d) => {
80
+ var u;
81
+ return I(), M("button", {
82
+ class: se([
83
+ "hello-btn",
84
+ (u = Y(A).CLASS_MAPPING[i.color]) == null ? void 0 : u[i.theme],
85
+ Y(A).HOVER_MAPPING[l.hover],
86
+ (l.showLoader || e.value) && "hello-btn-loader"
87
+ ]),
77
88
  disabled: i.disabled || e.value,
78
- style: ue(l.style)
89
+ style: ue(l.style),
90
+ onClick: r
79
91
  }, [
80
- ce("span", { innerHTML: l.label }, null, 8, pe)
81
- ], 14, be);
92
+ ce("span", { innerHTML: l.label }, null, 8, be)
93
+ ], 14, pe);
82
94
  };
83
95
  }
84
- }), De = /* @__PURE__ */ C({
96
+ }), De = /* @__PURE__ */ E({
85
97
  __name: "ContinueButton",
86
98
  setup(t) {
87
- return (n, e) => (E(), j(U));
99
+ return (n, e) => (I(), j(U));
88
100
  }
89
- }), xe = /* @__PURE__ */ C({
101
+ }), xe = /* @__PURE__ */ E({
90
102
  __name: "LoginButton",
91
103
  setup(t) {
92
- return (n, e) => (E(), j(U, { label: "ō   Login with Hellō" }));
104
+ return (n, e) => (I(), j(U, { label: "ō   Login with Hellō" }));
93
105
  }
94
- }), $e = /* @__PURE__ */ C({
106
+ }), $e = /* @__PURE__ */ E({
95
107
  __name: "UpdateProfileButton",
96
108
  setup(t) {
97
- return (n, e) => (E(), j(U, {
109
+ return (n, e) => (I(), j(U, {
98
110
  label: "ō   Update Profile with Hellō",
99
111
  update: !0
100
112
  }));
@@ -131,12 +143,12 @@ var F = (
131
143
  var e = this.serializeKey(n);
132
144
  return this.items.get(e);
133
145
  }, t.prototype.set = function(n, e, i) {
134
- var a = this.serializeKey(n), r = i || this.ttl, l = Date.now(), f = {
146
+ var a = this.serializeKey(n), r = i || this.ttl, l = Date.now(), d = {
135
147
  data: e,
136
148
  createdAt: l,
137
149
  expiresAt: r ? l + r : 1 / 0
138
150
  };
139
- this.dispatchExpire(r, f, a), this.items.set(a, f);
151
+ this.dispatchExpire(r, d, a), this.items.set(a, d);
140
152
  }, t.prototype.dispatchExpire = function(n, e, i) {
141
153
  var a = this;
142
154
  n && setTimeout(function() {
@@ -148,10 +160,10 @@ var F = (
148
160
  }, t;
149
161
  }()
150
162
  );
151
- function Re() {
163
+ function Le() {
152
164
  return typeof navigator.onLine < "u" ? navigator.onLine : !0;
153
165
  }
154
- function Le() {
166
+ function Re() {
155
167
  return typeof document < "u" && typeof document.visibilityState < "u" ? document.visibilityState !== "hidden" : !0;
156
168
  }
157
169
  var Ce = function(t) {
@@ -160,134 +172,124 @@ var Ce = function(t) {
160
172
  });
161
173
  };
162
174
  const x = {
163
- isOnline: Re,
164
- isDocumentVisible: Le,
175
+ isOnline: Le,
176
+ isDocumentVisible: Re,
165
177
  fetcher: Ce
166
178
  };
167
- var y = globalThis && globalThis.__assign || function() {
179
+ var y = function() {
168
180
  return y = Object.assign || function(t) {
169
181
  for (var n, e = 1, i = arguments.length; e < i; e++) {
170
182
  n = arguments[e];
171
- for (var a in n)
172
- Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
183
+ for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
173
184
  }
174
185
  return t;
175
186
  }, y.apply(this, arguments);
176
- }, R = globalThis && globalThis.__awaiter || function(t, n, e, i) {
187
+ }, R = function(t, n, e, i) {
177
188
  function a(r) {
178
189
  return r instanceof e ? r : new e(function(l) {
179
190
  l(r);
180
191
  });
181
192
  }
182
193
  return new (e || (e = Promise))(function(r, l) {
183
- function f(u) {
194
+ function d(c) {
184
195
  try {
185
- o(i.next(u));
196
+ o(i.next(c));
186
197
  } catch (g) {
187
198
  l(g);
188
199
  }
189
200
  }
190
- function s(u) {
201
+ function u(c) {
191
202
  try {
192
- o(i.throw(u));
203
+ o(i.throw(c));
193
204
  } catch (g) {
194
205
  l(g);
195
206
  }
196
207
  }
197
- function o(u) {
198
- u.done ? r(u.value) : a(u.value).then(f, s);
208
+ function o(c) {
209
+ c.done ? r(c.value) : a(c.value).then(d, u);
199
210
  }
200
211
  o((i = i.apply(t, n || [])).next());
201
212
  });
202
- }, L = globalThis && globalThis.__generator || function(t, n) {
213
+ }, C = function(t, n) {
203
214
  var e = { label: 0, sent: function() {
204
- if (r[0] & 1)
205
- throw r[1];
215
+ if (r[0] & 1) throw r[1];
206
216
  return r[1];
207
217
  }, trys: [], ops: [] }, i, a, r, l;
208
- return l = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (l[Symbol.iterator] = function() {
218
+ return l = { next: d(0), throw: d(1), return: d(2) }, typeof Symbol == "function" && (l[Symbol.iterator] = function() {
209
219
  return this;
210
220
  }), l;
211
- function f(o) {
212
- return function(u) {
213
- return s([o, u]);
221
+ function d(o) {
222
+ return function(c) {
223
+ return u([o, c]);
214
224
  };
215
225
  }
216
- function s(o) {
217
- if (i)
218
- throw new TypeError("Generator is already executing.");
219
- for (; e; )
220
- try {
221
- if (i = 1, a && (r = o[0] & 2 ? a.return : o[0] ? a.throw || ((r = a.return) && r.call(a), 0) : a.next) && !(r = r.call(a, o[1])).done)
222
- return r;
223
- switch (a = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
224
- case 0:
225
- case 1:
226
- r = o;
227
- break;
228
- case 4:
229
- return e.label++, { value: o[1], done: !1 };
230
- case 5:
231
- e.label++, a = o[1], o = [0];
232
- continue;
233
- case 7:
234
- o = e.ops.pop(), e.trys.pop();
235
- continue;
236
- default:
237
- if (r = e.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
238
- e = 0;
239
- continue;
240
- }
241
- if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
242
- e.label = o[1];
243
- break;
244
- }
245
- if (o[0] === 6 && e.label < r[1]) {
246
- e.label = r[1], r = o;
247
- break;
248
- }
249
- if (r && e.label < r[2]) {
250
- e.label = r[2], e.ops.push(o);
251
- break;
252
- }
253
- r[2] && e.ops.pop(), e.trys.pop();
226
+ function u(o) {
227
+ if (i) throw new TypeError("Generator is already executing.");
228
+ for (; e; ) try {
229
+ if (i = 1, a && (r = o[0] & 2 ? a.return : o[0] ? a.throw || ((r = a.return) && r.call(a), 0) : a.next) && !(r = r.call(a, o[1])).done) return r;
230
+ switch (a = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
231
+ case 0:
232
+ case 1:
233
+ r = o;
234
+ break;
235
+ case 4:
236
+ return e.label++, { value: o[1], done: !1 };
237
+ case 5:
238
+ e.label++, a = o[1], o = [0];
239
+ continue;
240
+ case 7:
241
+ o = e.ops.pop(), e.trys.pop();
242
+ continue;
243
+ default:
244
+ if (r = e.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
245
+ e = 0;
254
246
  continue;
255
- }
256
- o = n.call(t, e);
257
- } catch (u) {
258
- o = [6, u], a = 0;
259
- } finally {
260
- i = r = 0;
247
+ }
248
+ if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
249
+ e.label = o[1];
250
+ break;
251
+ }
252
+ if (o[0] === 6 && e.label < r[1]) {
253
+ e.label = r[1], r = o;
254
+ break;
255
+ }
256
+ if (r && e.label < r[2]) {
257
+ e.label = r[2], e.ops.push(o);
258
+ break;
259
+ }
260
+ r[2] && e.ops.pop(), e.trys.pop();
261
+ continue;
261
262
  }
262
- if (o[0] & 5)
263
- throw o[1];
263
+ o = n.call(t, e);
264
+ } catch (c) {
265
+ o = [6, c], a = 0;
266
+ } finally {
267
+ i = r = 0;
268
+ }
269
+ if (o[0] & 5) throw o[1];
264
270
  return { value: o[0] ? o[1] : void 0, done: !0 };
265
271
  }
266
- }, Ee = globalThis && globalThis.__read || function(t, n) {
272
+ }, Ee = function(t, n) {
267
273
  var e = typeof Symbol == "function" && t[Symbol.iterator];
268
- if (!e)
269
- return t;
274
+ if (!e) return t;
270
275
  var i = e.call(t), a, r = [], l;
271
276
  try {
272
- for (; (n === void 0 || n-- > 0) && !(a = i.next()).done; )
273
- r.push(a.value);
274
- } catch (f) {
275
- l = { error: f };
277
+ for (; (n === void 0 || n-- > 0) && !(a = i.next()).done; ) r.push(a.value);
278
+ } catch (d) {
279
+ l = { error: d };
276
280
  } finally {
277
281
  try {
278
282
  a && !a.done && (e = i.return) && e.call(i);
279
283
  } finally {
280
- if (l)
281
- throw l.error;
284
+ if (l) throw l.error;
282
285
  }
283
286
  }
284
287
  return r;
285
- }, Ie = globalThis && globalThis.__spreadArray || function(t, n, e) {
286
- if (e || arguments.length === 2)
287
- for (var i = 0, a = n.length, r; i < a; i++)
288
- (r || !(i in n)) && (r || (r = Array.prototype.slice.call(n, 0, i)), r[i] = n[i]);
288
+ }, Ie = function(t, n, e) {
289
+ if (e || arguments.length === 2) for (var i = 0, a = n.length, r; i < a; i++)
290
+ (r || !(i in n)) && (r || (r = Array.prototype.slice.call(n, 0, i)), r[i] = n[i]);
289
291
  return t.concat(r || Array.prototype.slice.call(n));
290
- }, ne = new F(), V = new F(), $ = new F(), re = {
292
+ }, ne = new F(), H = new F(), $ = new F(), re = {
291
293
  cache: ne,
292
294
  refreshInterval: 0,
293
295
  ttl: 0,
@@ -303,12 +305,12 @@ var y = globalThis && globalThis.__assign || function() {
303
305
  isDocumentVisible: x.isDocumentVisible
304
306
  };
305
307
  function Se(t, n, e) {
306
- var i = V.get(t);
308
+ var i = H.get(t);
307
309
  if (i)
308
310
  i.data.push(n);
309
311
  else {
310
312
  var a = 5e3;
311
- V.set(t, [n], e > 0 ? e + a : e);
313
+ H.set(t, [n], e > 0 ? e + a : e);
312
314
  }
313
315
  }
314
316
  function Ae(t, n, e) {
@@ -321,99 +323,99 @@ function Ae(t, n, e) {
321
323
  }
322
324
  var J = function(t, n, e, i) {
323
325
  return e === void 0 && (e = ne), i === void 0 && (i = re.ttl), R(void 0, void 0, void 0, function() {
324
- var a, r, l, f, s, o, u;
325
- return L(this, function(g) {
326
+ var a, r, l, d, u, o, c;
327
+ return C(this, function(g) {
326
328
  switch (g.label) {
327
329
  case 0:
328
- if (!Pe(n))
329
- return [3, 5];
330
+ if (!Pe(n)) return [3, 5];
330
331
  g.label = 1;
331
332
  case 1:
332
333
  return g.trys.push([1, 3, , 4]), [4, n];
333
334
  case 2:
334
335
  return a = g.sent(), [3, 4];
335
336
  case 3:
336
- return f = g.sent(), r = f, [3, 4];
337
+ return d = g.sent(), r = d, [3, 4];
337
338
  case 4:
338
339
  return [3, 6];
339
340
  case 5:
340
341
  a = n, g.label = 6;
341
342
  case 6:
342
- if (l = !1, s = { data: a, error: r, isValidating: l }, typeof a < "u")
343
+ if (l = !1, u = { data: a, error: r, isValidating: l }, typeof a < "u")
343
344
  try {
344
- e.set(t, s, i);
345
- } catch (v) {
346
- console.error("swrv(mutate): failed to set cache", v);
345
+ e.set(t, u, i);
346
+ } catch (h) {
347
+ console.error("swrv(mutate): failed to set cache", h);
347
348
  }
348
- return o = V.get(t), o && o.data.length && (u = o.data.filter(function(v) {
349
- return v.key === t;
350
- }), u.forEach(function(v, d) {
351
- typeof s.data < "u" && (v.data = s.data), v.error = s.error, v.isValidating = s.isValidating;
352
- var b = d === u.length - 1;
353
- b || delete u[d];
354
- }), u = u.filter(Boolean)), [2, s];
349
+ return o = H.get(t), o && o.data.length && (c = o.data.filter(function(h) {
350
+ return h.key === t;
351
+ }), c.forEach(function(h, s) {
352
+ typeof u.data < "u" && (h.data = u.data), h.error = u.error, h.isValidating = u.isValidating, h.isLoading = u.isValidating;
353
+ var p = s === c.length - 1;
354
+ p || delete c[s];
355
+ }), c = c.filter(Boolean)), [2, u];
355
356
  }
356
357
  });
357
358
  });
358
359
  };
359
- function Te() {
360
+ function Ve() {
360
361
  for (var t = this, n = [], e = 0; e < arguments.length; e++)
361
362
  n[e] = arguments[e];
362
- var i, a, r = y({}, re), l = !1, f = !1, s = fe(), o = (s == null ? void 0 : s.proxy) || s;
363
+ var i, a, r = y({}, re), l = !1, d = !1, u = fe(), o = (u == null ? void 0 : u.proxy) || u;
363
364
  if (!o)
364
365
  return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."), null;
365
- var u = (o == null ? void 0 : o.$isServer) || !1;
366
+ var c = (o == null ? void 0 : o.$isServer) || !1;
366
367
  n.length >= 1 && (i = n[0]), n.length >= 2 && (a = n[1]), n.length > 2 && (r = y(y({}, r), n[2]));
367
- var g = u ? r.serverTTL : r.ttl, v = typeof i == "function" ? i : X(i);
368
+ var g = c ? r.serverTTL : r.ttl, h = typeof i == "function" ? i : X(i);
368
369
  typeof a > "u" && (a = r.fetcher);
369
- var d = null;
370
- d || (d = de({
370
+ var s = null;
371
+ s || (s = de({
371
372
  data: void 0,
372
373
  error: void 0,
373
374
  isValidating: !0,
375
+ isLoading: !0,
374
376
  key: null
375
377
  }));
376
- var b = function(h, c) {
378
+ var p = function(v, f) {
377
379
  return R(t, void 0, void 0, function() {
378
- var N, m, I, S, H, z, O, G = this;
379
- return L(this, function(k) {
380
- switch (k.label) {
380
+ var N, m, S, L, O, z, k, G = this;
381
+ return C(this, function(B) {
382
+ switch (B.label) {
381
383
  case 0:
382
- return N = d.data === void 0, m = v.value, m ? (I = r.cache.get(m), S = I && I.data, d.isValidating = !0, S && (d.data = S.data, d.error = S.error), H = h || a, !H || !r.isDocumentVisible() && !N || (c == null ? void 0 : c.forceRevalidate) !== void 0 && !(c != null && c.forceRevalidate) ? (d.isValidating = !1, [
384
+ return N = s.data === void 0, m = h.value, m ? (S = r.cache.get(m), L = S && S.data, s.isValidating = !0, s.isLoading = !L, L && (s.data = L.data, s.error = L.error), O = v || a, !O || !r.isDocumentVisible() && !N || (f == null ? void 0 : f.forceRevalidate) !== void 0 && !(f != null && f.forceRevalidate) ? (s.isValidating = !1, s.isLoading = !1, [
383
385
  2
384
386
  /*return*/
385
- ]) : I && (z = !!(Date.now() - I.createdAt >= r.dedupingInterval || c != null && c.forceRevalidate), !z) ? (d.isValidating = !1, [
387
+ ]) : S && (z = !!(Date.now() - S.createdAt >= r.dedupingInterval || f != null && f.forceRevalidate), !z) ? (s.isValidating = !1, s.isLoading = !1, [
386
388
  2
387
389
  /*return*/
388
- ]) : (O = function() {
390
+ ]) : (k = function() {
389
391
  return R(G, void 0, void 0, function() {
390
- var p, K, B, W;
391
- return L(this, function(P) {
392
+ var b, K, T, W;
393
+ return C(this, function(P) {
392
394
  switch (P.label) {
393
395
  case 0:
394
- return p = $.get(m), p ? [3, 2] : (K = Array.isArray(m) ? m : [m], B = H.apply(void 0, Ie([], Ee(K), !1)), $.set(m, B, r.dedupingInterval), [4, J(m, B, r.cache, g)]);
396
+ return b = $.get(m), b ? [3, 2] : (K = Array.isArray(m) ? m : [m], T = O.apply(void 0, Ie([], Ee(K), !1)), $.set(m, T, r.dedupingInterval), [4, J(m, T, r.cache, g)]);
395
397
  case 1:
396
398
  return P.sent(), [3, 4];
397
399
  case 2:
398
- return [4, J(m, p.data, r.cache, g)];
400
+ return [4, J(m, b.data, r.cache, g)];
399
401
  case 3:
400
402
  P.sent(), P.label = 4;
401
403
  case 4:
402
- return d.isValidating = !1, $.delete(m), d.error !== void 0 && (W = !l && r.shouldRetryOnError && (c ? c.shouldRetryOnError : !0), W && Ae(b, c ? c.errorRetryCount : 1, r)), [
404
+ return s.isValidating = !1, s.isLoading = !1, $.delete(m), s.error !== void 0 && (W = !l && r.shouldRetryOnError && (f ? f.shouldRetryOnError : !0), W && Ae(p, f ? f.errorRetryCount : 1, r)), [
403
405
  2
404
406
  /*return*/
405
407
  ];
406
408
  }
407
409
  });
408
410
  });
409
- }, S && r.revalidateDebounce ? (setTimeout(function() {
411
+ }, L && r.revalidateDebounce ? (setTimeout(function() {
410
412
  return R(G, void 0, void 0, function() {
411
- return L(this, function(p) {
412
- switch (p.label) {
413
+ return C(this, function(b) {
414
+ switch (b.label) {
413
415
  case 0:
414
- return l ? [3, 2] : [4, O()];
416
+ return l ? [3, 2] : [4, k()];
415
417
  case 1:
416
- p.sent(), p.label = 2;
418
+ b.sent(), b.label = 2;
417
419
  case 2:
418
420
  return [
419
421
  2
@@ -427,9 +429,9 @@ function Te() {
427
429
  /*return*/
428
430
  ];
429
431
  case 1:
430
- return [4, O()];
432
+ return [4, k()];
431
433
  case 2:
432
- k.sent(), k.label = 3;
434
+ B.sent(), B.label = 3;
433
435
  case 3:
434
436
  return [
435
437
  2
@@ -438,26 +440,26 @@ function Te() {
438
440
  }
439
441
  });
440
442
  });
441
- }, T = function() {
443
+ }, V = function() {
442
444
  return R(t, void 0, void 0, function() {
443
- return L(this, function(h) {
444
- return [2, b(null, { shouldRetryOnError: !1 })];
445
+ return C(this, function(v) {
446
+ return [2, p(null, { shouldRetryOnError: !1 })];
445
447
  });
446
448
  });
447
449
  }, _ = null;
448
450
  Q(function() {
449
- var h = function() {
451
+ var v = function() {
450
452
  return R(t, void 0, void 0, function() {
451
- return L(this, function(c) {
452
- switch (c.label) {
453
+ return C(this, function(f) {
454
+ switch (f.label) {
453
455
  case 0:
454
- return !d.error && r.isOnline() ? [4, b()] : [3, 2];
456
+ return !s.error && r.isOnline() ? [4, p()] : [3, 2];
455
457
  case 1:
456
- return c.sent(), [3, 3];
458
+ return f.sent(), [3, 3];
457
459
  case 2:
458
- _ && clearTimeout(_), c.label = 3;
460
+ _ && clearTimeout(_), f.label = 3;
459
461
  case 3:
460
- return r.refreshInterval && !l && (_ = setTimeout(h, r.refreshInterval)), [
462
+ return r.refreshInterval && !l && (_ = setTimeout(v, r.refreshInterval)), [
461
463
  2
462
464
  /*return*/
463
465
  ];
@@ -465,31 +467,31 @@ function Te() {
465
467
  });
466
468
  });
467
469
  };
468
- r.refreshInterval && (_ = setTimeout(h, r.refreshInterval)), r.revalidateOnFocus && (document.addEventListener("visibilitychange", T, !1), window.addEventListener("focus", T, !1));
470
+ r.refreshInterval && (_ = setTimeout(v, r.refreshInterval)), r.revalidateOnFocus && (document.addEventListener("visibilitychange", V, !1), window.addEventListener("focus", V, !1));
469
471
  }), he(function() {
470
- l = !0, _ && clearTimeout(_), r.revalidateOnFocus && (document.removeEventListener("visibilitychange", T, !1), window.removeEventListener("focus", T, !1));
471
- var h = V.get(v.value);
472
- h && (h.data = h.data.filter(function(c) {
473
- return c !== d;
472
+ l = !0, _ && clearTimeout(_), r.revalidateOnFocus && (document.removeEventListener("visibilitychange", V, !1), window.removeEventListener("focus", V, !1));
473
+ var v = H.get(h.value);
474
+ v && (v.data = v.data.filter(function(f) {
475
+ return f !== s;
474
476
  }));
475
477
  });
476
478
  try {
477
- ve(v, function(h) {
478
- ge(v) || (v.value = h), d.key = h, d.isValidating = !!h, Se(v.value, d, g), !u && !f && v.value && b(), f = !1;
479
+ ve(h, function(v) {
480
+ ge(h) || (h.value = v), s.key = v, s.isValidating = !!v, Se(h.value, s, g), !c && !d && h.value && p(), d = !1;
479
481
  }, {
480
482
  immediate: !0
481
483
  });
482
484
  } catch {
483
485
  }
484
- var ae = y(y({}, me(d)), { mutate: function(h, c) {
485
- return b(h, y(y({}, c), { forceRevalidate: !0 }));
486
+ var ae = y(y({}, me(s)), { mutate: function(v, f) {
487
+ return p(v, y(y({}, f), { forceRevalidate: !0 }));
486
488
  } });
487
489
  return ae;
488
490
  }
489
491
  function Pe(t) {
490
492
  return t !== null && typeof t == "object" && typeof t.then == "function";
491
493
  }
492
- const Ve = async (t) => {
494
+ const He = async (t) => {
493
495
  try {
494
496
  return await (await fetch(t)).json();
495
497
  } catch (n) {
@@ -497,7 +499,10 @@ const Ve = async (t) => {
497
499
  return;
498
500
  }
499
501
  }, ie = () => {
500
- const t = ye(), { data: n = t, isValidating: e } = Te(w.auth, Ve);
502
+ const t = ye(), { data: n = t, isValidating: e } = Ve(
503
+ w.auth,
504
+ He
505
+ );
501
506
  return {
502
507
  auth: n || {},
503
508
  // @ts-ignore //TBD
@@ -505,26 +510,26 @@ const Ve = async (t) => {
505
510
  // @ts-ignore
506
511
  isLoggedIn: n == null ? void 0 : n.isLoggedIn
507
512
  };
508
- }, He = { key: 0 }, Me = /* @__PURE__ */ C({
513
+ }, Oe = { key: 0 }, Me = /* @__PURE__ */ E({
509
514
  __name: "LoggedIn",
510
515
  setup(t) {
511
516
  const n = () => {
512
517
  var e;
513
518
  return ((e = ie()) == null ? void 0 : e.isLoggedIn) || !1;
514
519
  };
515
- return (e, i) => n() ? (E(), M("div", He, [
516
- Z(e.$slots, "default")
517
- ])) : ee("", !0);
520
+ return (e, i) => n() ? (I(), M("div", Oe, [
521
+ ee(e.$slots, "default")
522
+ ])) : Z("", !0);
518
523
  }
519
- }), Oe = { key: 0 }, je = /* @__PURE__ */ C({
524
+ }), ke = { key: 0 }, je = /* @__PURE__ */ E({
520
525
  __name: "LoggedOut",
521
526
  setup(t) {
522
527
  const n = () => {
523
528
  var e;
524
529
  return ((e = ie()) == null ? void 0 : e.isLoggedIn) || !1;
525
530
  };
526
- return (e, i) => n() ? ee("", !0) : (E(), M("div", Oe, [
527
- Z(e.$slots, "default")
531
+ return (e, i) => n() ? Z("", !0) : (I(), M("div", ke, [
532
+ ee(e.$slots, "default")
528
533
  ]));
529
534
  }
530
535
  }), Ue = () => w.logout;
@@ -533,7 +538,7 @@ function Fe() {
533
538
  }
534
539
  export {
535
540
  De as ContinueButton,
536
- Be as HelloProvider,
541
+ Te as HelloProvider,
537
542
  Me as LoggedIn,
538
543
  je as LoggedOut,
539
544
  xe as LoginButton,
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(g,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(g=typeof globalThis<"u"?globalThis:g||self,a(g["@hellocoop/vue"]={},g.Vue))})(this,function(g,a){"use strict";const w={login:"/api/hellocoop?login=true",auth:"/api/hellocoop?auth=true",logout:"/api/hellocoop?logout=true"},N="HelloAuth",z=()=>a.inject(N),Z={props:["auth","config"],setup(t){var n,e,i;(n=t==null?void 0:t.config)!=null&&n.login&&(w.login=t.config.login),(e=t==null?void 0:t.config)!=null&&e.auth&&(w.auth=t.config.auth),(i=t==null?void 0:t.config)!=null&&i.logout&&(w.logout=t.config.logout),a.provide(N,t.auth)},render(){return this.$slots.default()}};var S;(t=>{t.STYLES_URL="https://cdn.hello.coop/css/hello-btn.css",t.HOVER_MAPPING={pop:"",glow:"hello-btn-hover-glow",flare:"hello-btn-hover-flare",none:"hello-btn-hover-none"},t.CLASS_MAPPING={black:{"ignore-light":"","ignore-dark":"hello-btn-black-on-dark","aware-invert":"hello-btn-black-and-invert","aware-static":"hello-btn-black-and-static"},white:{"ignore-light":"hello-btn-white-on-light","ignore-dark":"hello-btn-white-on-dark","aware-invert":"hello-btn-white-and-invert","aware-static":"hello-btn-white-and-static"}}})(S||(S={}));const ee=["disabled"],te=["innerHTML"],V=a.defineComponent({__name:"BaseButton",props:{label:{default:"ō&nbsp;&nbsp;&nbsp;Continue with Hellō"},style:{},color:{default:"black"},theme:{default:"ignore-light"},hover:{default:"pop"},scope:{},update:{type:Boolean},targetURI:{},providerHint:{},showLoader:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},promptLogin:{type:Boolean,default:!1},promptConsent:{type:Boolean,default:!1},loginHint:{default:""},domainHint:{default:""}},setup(t){let n=!1;a.onMounted(()=>{typeof window<"u"&&!n&&(Array.from(document.head.getElementsByTagName("link")).find(d=>{var u;return d.getAttribute("rel")==="stylesheet"&&((u=d.getAttribute("href"))==null?void 0:u.startsWith(S.STYLES_URL))})||console.warn("Could not find Hellō stylesheet. Please add to pages with Hellō buttons. See http://hello.dev/docs/buttons/#stylesheet for more info."),n=!0)});const e=a.ref(!1),i=t,o=new URL(w.login,window.location.origin);i.scope&&o.searchParams.set("scope",i.scope.join(" ")),o.searchParams.set("target_uri",i.targetURI||window.location.pathname),i.update&&o.searchParams.set("prompt","consent"),i.promptLogin&&i.promptConsent?o.searchParams.set("prompt","login consent"):i.promptLogin?o.searchParams.set("prompt","login"):i.promptConsent&&o.searchParams.set("prompt","consent"),i.loginHint&&o.searchParams.set("login_hint",i.loginHint),i.domainHint&&o.searchParams.set("login_hint",i.domainHint),i.providerHint&&o.searchParams.set("provider_hint",i.providerHint.join(" "));const r=()=>{e.value=!0,window.location.href=o.href};return(s,d)=>{var u;return a.openBlock(),a.createElementBlock("button",{onClick:r,class:a.normalizeClass(["hello-btn",(u=a.unref(S).CLASS_MAPPING[i.color])==null?void 0:u[i.theme],a.unref(S).HOVER_MAPPING[s.hover],(s.showLoader||e.value)&&"hello-btn-loader"]),disabled:i.disabled||e.value,style:a.normalizeStyle(s.style)},[a.createElementVNode("span",{innerHTML:s.label},null,8,te)],14,ee)}}}),ne=a.defineComponent({__name:"ContinueButton",setup(t){return(n,e)=>(a.openBlock(),a.createBlock(V))}}),re=a.defineComponent({__name:"LoginButton",setup(t){return(n,e)=>(a.openBlock(),a.createBlock(V,{label:"ō   Login with Hellō"}))}}),ie=a.defineComponent({__name:"UpdateProfileButton",setup(t){return(n,e)=>(a.openBlock(),a.createBlock(V,{label:"ō   Update Profile with Hellō",update:!0}))}});var B=new WeakMap,x=0;function oe(t){if(!t.length)return"";for(var n="arg",e=0;e<t.length;++e){var i=void 0;t[e]===null||typeof t[e]!="object"&&typeof t[e]!="function"?typeof t[e]=="string"?i='"'+t[e]+'"':i=String(t[e]):B.has(t[e])?i=B.get(t[e]):(i=x,B.set(t[e],x++)),n+="@"+i}return n}function ae(t){if(typeof t=="function")try{t=t()}catch{t=""}return Array.isArray(t)?t=oe(t):t=String(t||""),t}var O=function(){function t(n){n===void 0&&(n=0),this.items=new Map,this.ttl=n}return t.prototype.serializeKey=function(n){return ae(n)},t.prototype.get=function(n){var e=this.serializeKey(n);return this.items.get(e)},t.prototype.set=function(n,e,i){var o=this.serializeKey(n),r=i||this.ttl,s=Date.now(),d={data:e,createdAt:s,expiresAt:r?s+r:1/0};this.dispatchExpire(r,d,o),this.items.set(o,d)},t.prototype.dispatchExpire=function(n,e,i){var o=this;n&&setTimeout(function(){var r=Date.now(),s=r>=e.expiresAt;s&&o.delete(i)},n)},t.prototype.delete=function(n){this.items.delete(n)},t}();function le(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function se(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var ue=function(t){return fetch(t).then(function(n){return n.json()})};const H={isOnline:le,isDocumentVisible:se,fetcher:ue};var b=globalThis&&globalThis.__assign||function(){return b=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},b.apply(this,arguments)},R=globalThis&&globalThis.__awaiter||function(t,n,e,i){function o(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function d(c){try{l(i.next(c))}catch(y){s(y)}}function u(c){try{l(i.throw(c))}catch(y){s(y)}}function l(c){c.done?r(c.value):o(c.value).then(d,u)}l((i=i.apply(t,n||[])).next())})},L=globalThis&&globalThis.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function d(l){return function(c){return u([l,c])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=l[0]&2?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[l[0]&2,r.value]),l[0]){case 0:case 1:r=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,o=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){e.label=l[1];break}if(l[0]===6&&e.label<r[1]){e.label=r[1],r=l;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(l);break}r[2]&&e.ops.pop(),e.trys.pop();continue}l=n.call(t,e)}catch(c){l=[6,c],o=0}finally{i=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},ce=globalThis&&globalThis.__read||function(t,n){var e=typeof Symbol=="function"&&t[Symbol.iterator];if(!e)return t;var i=e.call(t),o,r=[],s;try{for(;(n===void 0||n-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(d){s={error:d}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(s)throw s.error}}return r},fe=globalThis&&globalThis.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++)(r||!(i in n))&&(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))},G=new O,T=new O,D=new O,K={cache:G,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:H.fetcher,isOnline:H.isOnline,isDocumentVisible:H.isDocumentVisible};function de(t,n,e){var i=T.get(t);if(i)i.data.push(n);else{var o=5e3;T.set(t,[n],e>0?e+o:e)}}function he(t,n,e){if(e.isDocumentVisible()&&!(e.errorRetryCount!==void 0&&n>e.errorRetryCount)){var i=Math.min(n||0,e.errorRetryCount),o=i*e.errorRetryInterval;setTimeout(function(){t(null,{errorRetryCount:i+1,shouldRetryOnError:!0})},o)}}var W=function(t,n,e,i){return e===void 0&&(e=G),i===void 0&&(i=K.ttl),R(void 0,void 0,void 0,function(){var o,r,s,d,u,l,c;return L(this,function(y){switch(y.label){case 0:if(!ve(n))return[3,5];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,n];case 2:return o=y.sent(),[3,4];case 3:return d=y.sent(),r=d,[3,4];case 4:return[3,6];case 5:o=n,y.label=6;case 6:if(s=!1,u={data:o,error:r,isValidating:s},typeof o<"u")try{e.set(t,u,i)}catch(m){console.error("swrv(mutate): failed to set cache",m)}return l=T.get(t),l&&l.data.length&&(c=l.data.filter(function(m){return m.key===t}),c.forEach(function(m,h){typeof u.data<"u"&&(m.data=u.data),m.error=u.error,m.isValidating=u.isValidating;var _=h===c.length-1;_||delete c[h]}),c=c.filter(Boolean)),[2,u]}})})};function ge(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var i,o,r=b({},K),s=!1,d=!1,u=a.getCurrentInstance(),l=(u==null?void 0:u.proxy)||u;if(!l)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var c=(l==null?void 0:l.$isServer)||!1;n.length>=1&&(i=n[0]),n.length>=2&&(o=n[1]),n.length>2&&(r=b(b({},r),n[2]));var y=c?r.serverTTL:r.ttl,m=typeof i=="function"?i:a.ref(i);typeof o>"u"&&(o=r.fetcher);var h=null;h||(h=a.reactive({data:void 0,error:void 0,isValidating:!0,key:null}));var _=function(v,f){return R(t,void 0,void 0,function(){var Y,p,k,I,$,q,j,J=this;return L(this,function(U){switch(U.label){case 0:return Y=h.data===void 0,p=m.value,p?(k=r.cache.get(p),I=k&&k.data,h.isValidating=!0,I&&(h.data=I.data,h.error=I.error),$=v||o,!$||!r.isDocumentVisible()&&!Y||(f==null?void 0:f.forceRevalidate)!==void 0&&!(f!=null&&f.forceRevalidate)?(h.isValidating=!1,[2]):k&&(q=!!(Date.now()-k.createdAt>=r.dedupingInterval||f!=null&&f.forceRevalidate),!q)?(h.isValidating=!1,[2]):(j=function(){return R(J,void 0,void 0,function(){var C,Q,F,X;return L(this,function(P){switch(P.label){case 0:return C=D.get(p),C?[3,2]:(Q=Array.isArray(p)?p:[p],F=$.apply(void 0,fe([],ce(Q),!1)),D.set(p,F,r.dedupingInterval),[4,W(p,F,r.cache,y)]);case 1:return P.sent(),[3,4];case 2:return[4,W(p,C.data,r.cache,y)];case 3:P.sent(),P.label=4;case 4:return h.isValidating=!1,D.delete(p),h.error!==void 0&&(X=!s&&r.shouldRetryOnError&&(f?f.shouldRetryOnError:!0),X&&he(_,f?f.errorRetryCount:1,r)),[2]}})})},I&&r.revalidateDebounce?(setTimeout(function(){return R(J,void 0,void 0,function(){return L(this,function(C){switch(C.label){case 0:return s?[3,2]:[4,j()];case 1:C.sent(),C.label=2;case 2:return[2]}})})},r.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,j()];case 2:U.sent(),U.label=3;case 3:return[2]}})})},A=function(){return R(t,void 0,void 0,function(){return L(this,function(v){return[2,_(null,{shouldRetryOnError:!1})]})})},E=null;a.onMounted(function(){var v=function(){return R(t,void 0,void 0,function(){return L(this,function(f){switch(f.label){case 0:return!h.error&&r.isOnline()?[4,_()]:[3,2];case 1:return f.sent(),[3,3];case 2:E&&clearTimeout(E),f.label=3;case 3:return r.refreshInterval&&!s&&(E=setTimeout(v,r.refreshInterval)),[2]}})})};r.refreshInterval&&(E=setTimeout(v,r.refreshInterval)),r.revalidateOnFocus&&(document.addEventListener("visibilitychange",A,!1),window.addEventListener("focus",A,!1))}),a.onUnmounted(function(){s=!0,E&&clearTimeout(E),r.revalidateOnFocus&&(document.removeEventListener("visibilitychange",A,!1),window.removeEventListener("focus",A,!1));var v=T.get(m.value);v&&(v.data=v.data.filter(function(f){return f!==h}))});try{a.watch(m,function(v){a.isReadonly(m)||(m.value=v),h.key=v,h.isValidating=!!v,de(m.value,h,y),!c&&!d&&m.value&&_(),d=!1},{immediate:!0})}catch{}var Re=b(b({},a.toRefs(h)),{mutate:function(v,f){return _(v,b(b({},f),{forceRevalidate:!0}))}});return Re}function ve(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}const me=async t=>{try{return await(await fetch(t)).json()}catch(n){console.error(n);return}},M=()=>{const t=z(),{data:n=t,isValidating:e}=ge(w.auth,me);return{auth:n||{},isLoading:e,isLoggedIn:n==null?void 0:n.isLoggedIn}},ye={key:0},pe=a.defineComponent({__name:"LoggedIn",setup(t){const n=()=>{var e;return((e=M())==null?void 0:e.isLoggedIn)||!1};return(e,i)=>n()?(a.openBlock(),a.createElementBlock("div",ye,[a.renderSlot(e.$slots,"default")])):a.createCommentVNode("",!0)}}),be={key:0},we=a.defineComponent({__name:"LoggedOut",setup(t){const n=()=>{var e;return((e=M())==null?void 0:e.isLoggedIn)||!1};return(e,i)=>n()?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",be,[a.renderSlot(e.$slots,"default")]))}}),_e=()=>w.logout;function Ce(){window.location.href=w.logout}g.ContinueButton=ne,g.HelloProvider=Z,g.LoggedIn=pe,g.LoggedOut=we,g.LoginButton=re,g.UpdateProfileButton=ie,g.getLogOutRoute=_e,g.logOut=Ce,g.routeConfig=w,g.useAuth=M,g.useHelloProviderContext=z,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
1
+ (function(g,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(g=typeof globalThis<"u"?globalThis:g||self,a(g["@hellocoop/vue"]={},g.Vue))})(this,function(g,a){"use strict";const w={login:"/api/hellocoop?login=true",auth:"/api/hellocoop?auth=true",logout:"/api/hellocoop?logout=true"},N="HelloAuth",z=()=>a.inject(N),Z={props:["auth","config"],setup(t){var n,e,i;(n=t==null?void 0:t.config)!=null&&n.login&&(w.login=t.config.login),(e=t==null?void 0:t.config)!=null&&e.auth&&(w.auth=t.config.auth),(i=t==null?void 0:t.config)!=null&&i.logout&&(w.logout=t.config.logout),a.provide(N,t.auth)},render(){return this.$slots.default()}};var k;(t=>{t.STYLES_URL="https://cdn.hello.coop/css/hello-btn.css",t.HOVER_MAPPING={pop:"",glow:"hello-btn-hover-glow",flare:"hello-btn-hover-flare",none:"hello-btn-hover-none"},t.CLASS_MAPPING={black:{"ignore-light":"","ignore-dark":"hello-btn-black-on-dark","aware-invert":"hello-btn-black-and-invert","aware-static":"hello-btn-black-and-static"},white:{"ignore-light":"hello-btn-white-on-light","ignore-dark":"hello-btn-white-on-dark","aware-invert":"hello-btn-white-and-invert","aware-static":"hello-btn-white-and-static"}}})(k||(k={}));const ee=["disabled"],te=["innerHTML"],B=a.defineComponent({__name:"BaseButton",props:{label:{default:"ō&nbsp;&nbsp;&nbsp;Continue with Hellō"},style:{},color:{default:"black"},theme:{default:"ignore-light"},hover:{default:"pop"},scope:{},update:{type:Boolean},targetURI:{},providerHint:{},showLoader:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},promptLogin:{type:Boolean,default:!1},promptConsent:{type:Boolean,default:!1},loginHint:{default:""},domainHint:{default:""}},setup(t){let n=!1;a.onMounted(()=>{typeof window<"u"&&!n&&(Array.from(document.head.getElementsByTagName("link")).find(h=>{var u;return h.getAttribute("rel")==="stylesheet"&&((u=h.getAttribute("href"))==null?void 0:u.startsWith(k.STYLES_URL))})||console.warn("Could not find Hellō stylesheet. Please add to pages with Hellō buttons. See http://hello.dev/docs/buttons/#stylesheet for more info."),n=!0)});const e=a.ref(!1),i=t,o=new URL(w.login,window.location.origin);i.scope&&o.searchParams.set("scope",i.scope.join(" ")),o.searchParams.set("target_uri",i.targetURI||window.location.pathname),i.update&&o.searchParams.set("prompt","consent"),i.promptLogin&&i.promptConsent?o.searchParams.set("prompt","login consent"):i.promptLogin?o.searchParams.set("prompt","login"):i.promptConsent&&o.searchParams.set("prompt","consent"),i.loginHint&&o.searchParams.set("login_hint",i.loginHint),i.domainHint&&o.searchParams.set("login_hint",i.domainHint),i.providerHint&&o.searchParams.set("provider_hint",i.providerHint.join(" "));const r=()=>{e.value=!0,window.location.href=o.href};return(s,h)=>{var u;return a.openBlock(),a.createElementBlock("button",{class:a.normalizeClass(["hello-btn",(u=a.unref(k).CLASS_MAPPING[i.color])==null?void 0:u[i.theme],a.unref(k).HOVER_MAPPING[s.hover],(s.showLoader||e.value)&&"hello-btn-loader"]),disabled:i.disabled||e.value,style:a.normalizeStyle(s.style),onClick:r},[a.createElementVNode("span",{innerHTML:s.label},null,8,te)],14,ee)}}}),ne=a.defineComponent({__name:"ContinueButton",setup(t){return(n,e)=>(a.openBlock(),a.createBlock(B))}}),re=a.defineComponent({__name:"LoginButton",setup(t){return(n,e)=>(a.openBlock(),a.createBlock(B,{label:"ō   Login with Hellō"}))}}),ie=a.defineComponent({__name:"UpdateProfileButton",setup(t){return(n,e)=>(a.openBlock(),a.createBlock(B,{label:"ō   Update Profile with Hellō",update:!0}))}});var O=new WeakMap,x=0;function oe(t){if(!t.length)return"";for(var n="arg",e=0;e<t.length;++e){var i=void 0;t[e]===null||typeof t[e]!="object"&&typeof t[e]!="function"?typeof t[e]=="string"?i='"'+t[e]+'"':i=String(t[e]):O.has(t[e])?i=O.get(t[e]):(i=x,O.set(t[e],x++)),n+="@"+i}return n}function ae(t){if(typeof t=="function")try{t=t()}catch{t=""}return Array.isArray(t)?t=oe(t):t=String(t||""),t}var H=function(){function t(n){n===void 0&&(n=0),this.items=new Map,this.ttl=n}return t.prototype.serializeKey=function(n){return ae(n)},t.prototype.get=function(n){var e=this.serializeKey(n);return this.items.get(e)},t.prototype.set=function(n,e,i){var o=this.serializeKey(n),r=i||this.ttl,s=Date.now(),h={data:e,createdAt:s,expiresAt:r?s+r:1/0};this.dispatchExpire(r,h,o),this.items.set(o,h)},t.prototype.dispatchExpire=function(n,e,i){var o=this;n&&setTimeout(function(){var r=Date.now(),s=r>=e.expiresAt;s&&o.delete(i)},n)},t.prototype.delete=function(n){this.items.delete(n)},t}();function le(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function se(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var ue=function(t){return fetch(t).then(function(n){return n.json()})};const T={isOnline:le,isDocumentVisible:se,fetcher:ue};var b=function(){return b=Object.assign||function(t){for(var n,e=1,i=arguments.length;e<i;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},b.apply(this,arguments)},C=function(t,n,e,i){function o(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function h(f){try{l(i.next(f))}catch(y){s(y)}}function u(f){try{l(i.throw(f))}catch(y){s(y)}}function l(f){f.done?r(f.value):o(f.value).then(h,u)}l((i=i.apply(t,n||[])).next())})},R=function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function h(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=l[0]&2?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[l[0]&2,r.value]),l[0]){case 0:case 1:r=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,o=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){e.label=l[1];break}if(l[0]===6&&e.label<r[1]){e.label=r[1],r=l;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(l);break}r[2]&&e.ops.pop(),e.trys.pop();continue}l=n.call(t,e)}catch(f){l=[6,f],o=0}finally{i=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},ce=function(t,n){var e=typeof Symbol=="function"&&t[Symbol.iterator];if(!e)return t;var i=e.call(t),o,r=[],s;try{for(;(n===void 0||n-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(h){s={error:h}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(s)throw s.error}}return r},fe=function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++)(r||!(i in n))&&(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))},G=new H,A=new H,D=new H,K={cache:G,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:T.fetcher,isOnline:T.isOnline,isDocumentVisible:T.isDocumentVisible};function de(t,n,e){var i=A.get(t);if(i)i.data.push(n);else{var o=5e3;A.set(t,[n],e>0?e+o:e)}}function he(t,n,e){if(e.isDocumentVisible()&&!(e.errorRetryCount!==void 0&&n>e.errorRetryCount)){var i=Math.min(n||0,e.errorRetryCount),o=i*e.errorRetryInterval;setTimeout(function(){t(null,{errorRetryCount:i+1,shouldRetryOnError:!0})},o)}}var W=function(t,n,e,i){return e===void 0&&(e=G),i===void 0&&(i=K.ttl),C(void 0,void 0,void 0,function(){var o,r,s,h,u,l,f;return R(this,function(y){switch(y.label){case 0:if(!ve(n))return[3,5];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,n];case 2:return o=y.sent(),[3,4];case 3:return h=y.sent(),r=h,[3,4];case 4:return[3,6];case 5:o=n,y.label=6;case 6:if(s=!1,u={data:o,error:r,isValidating:s},typeof o<"u")try{e.set(t,u,i)}catch(v){console.error("swrv(mutate): failed to set cache",v)}return l=A.get(t),l&&l.data.length&&(f=l.data.filter(function(v){return v.key===t}),f.forEach(function(v,c){typeof u.data<"u"&&(v.data=u.data),v.error=u.error,v.isValidating=u.isValidating,v.isLoading=u.isValidating;var _=c===f.length-1;_||delete f[c]}),f=f.filter(Boolean)),[2,u]}})})};function ge(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var i,o,r=b({},K),s=!1,h=!1,u=a.getCurrentInstance(),l=(u==null?void 0:u.proxy)||u;if(!l)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var f=(l==null?void 0:l.$isServer)||!1;n.length>=1&&(i=n[0]),n.length>=2&&(o=n[1]),n.length>2&&(r=b(b({},r),n[2]));var y=f?r.serverTTL:r.ttl,v=typeof i=="function"?i:a.ref(i);typeof o>"u"&&(o=r.fetcher);var c=null;c||(c=a.reactive({data:void 0,error:void 0,isValidating:!0,isLoading:!0,key:null}));var _=function(m,d){return C(t,void 0,void 0,function(){var Y,p,I,S,$,q,j,J=this;return R(this,function(U){switch(U.label){case 0:return Y=c.data===void 0,p=v.value,p?(I=r.cache.get(p),S=I&&I.data,c.isValidating=!0,c.isLoading=!S,S&&(c.data=S.data,c.error=S.error),$=m||o,!$||!r.isDocumentVisible()&&!Y||(d==null?void 0:d.forceRevalidate)!==void 0&&!(d!=null&&d.forceRevalidate)?(c.isValidating=!1,c.isLoading=!1,[2]):I&&(q=!!(Date.now()-I.createdAt>=r.dedupingInterval||d!=null&&d.forceRevalidate),!q)?(c.isValidating=!1,c.isLoading=!1,[2]):(j=function(){return C(J,void 0,void 0,function(){var L,Q,F,X;return R(this,function(P){switch(P.label){case 0:return L=D.get(p),L?[3,2]:(Q=Array.isArray(p)?p:[p],F=$.apply(void 0,fe([],ce(Q),!1)),D.set(p,F,r.dedupingInterval),[4,W(p,F,r.cache,y)]);case 1:return P.sent(),[3,4];case 2:return[4,W(p,L.data,r.cache,y)];case 3:P.sent(),P.label=4;case 4:return c.isValidating=!1,c.isLoading=!1,D.delete(p),c.error!==void 0&&(X=!s&&r.shouldRetryOnError&&(d?d.shouldRetryOnError:!0),X&&he(_,d?d.errorRetryCount:1,r)),[2]}})})},S&&r.revalidateDebounce?(setTimeout(function(){return C(J,void 0,void 0,function(){return R(this,function(L){switch(L.label){case 0:return s?[3,2]:[4,j()];case 1:L.sent(),L.label=2;case 2:return[2]}})})},r.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,j()];case 2:U.sent(),U.label=3;case 3:return[2]}})})},V=function(){return C(t,void 0,void 0,function(){return R(this,function(m){return[2,_(null,{shouldRetryOnError:!1})]})})},E=null;a.onMounted(function(){var m=function(){return C(t,void 0,void 0,function(){return R(this,function(d){switch(d.label){case 0:return!c.error&&r.isOnline()?[4,_()]:[3,2];case 1:return d.sent(),[3,3];case 2:E&&clearTimeout(E),d.label=3;case 3:return r.refreshInterval&&!s&&(E=setTimeout(m,r.refreshInterval)),[2]}})})};r.refreshInterval&&(E=setTimeout(m,r.refreshInterval)),r.revalidateOnFocus&&(document.addEventListener("visibilitychange",V,!1),window.addEventListener("focus",V,!1))}),a.onUnmounted(function(){s=!0,E&&clearTimeout(E),r.revalidateOnFocus&&(document.removeEventListener("visibilitychange",V,!1),window.removeEventListener("focus",V,!1));var m=A.get(v.value);m&&(m.data=m.data.filter(function(d){return d!==c}))});try{a.watch(v,function(m){a.isReadonly(v)||(v.value=m),c.key=m,c.isValidating=!!m,de(v.value,c,y),!f&&!h&&v.value&&_(),h=!1},{immediate:!0})}catch{}var Ce=b(b({},a.toRefs(c)),{mutate:function(m,d){return _(m,b(b({},d),{forceRevalidate:!0}))}});return Ce}function ve(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}const me=async t=>{try{return await(await fetch(t)).json()}catch(n){console.error(n);return}},M=()=>{const t=z(),{data:n=t,isValidating:e}=ge(w.auth,me);return{auth:n||{},isLoading:e,isLoggedIn:n==null?void 0:n.isLoggedIn}},ye={key:0},pe=a.defineComponent({__name:"LoggedIn",setup(t){const n=()=>{var e;return((e=M())==null?void 0:e.isLoggedIn)||!1};return(e,i)=>n()?(a.openBlock(),a.createElementBlock("div",ye,[a.renderSlot(e.$slots,"default")])):a.createCommentVNode("",!0)}}),be={key:0},we=a.defineComponent({__name:"LoggedOut",setup(t){const n=()=>{var e;return((e=M())==null?void 0:e.isLoggedIn)||!1};return(e,i)=>n()?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",be,[a.renderSlot(e.$slots,"default")]))}}),_e=()=>w.logout;function Le(){window.location.href=w.logout}g.ContinueButton=ne,g.HelloProvider=Z,g.LoggedIn=pe,g.LoggedOut=we,g.LoginButton=re,g.UpdateProfileButton=ie,g.getLogOutRoute=_e,g.logOut=Le,g.routeConfig=w,g.useAuth=M,g.useHelloProviderContext=z,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
@@ -1,8 +1,14 @@
1
1
  declare function __VLS_template(): {
2
- default?(_: {}): any;
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: any;
3
8
  };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
4
10
  declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
5
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
6
12
  export default _default;
7
13
  type __VLS_WithTemplateSlots<T, S> = T & {
8
14
  new (): {
@@ -1,8 +1,14 @@
1
1
  declare function __VLS_template(): {
2
- default?(_: {}): any;
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: any;
3
8
  };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
4
10
  declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
5
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
6
12
  export default _default;
7
13
  type __VLS_WithTemplateSlots<T, S> = T & {
8
14
  new (): {
package/dist/types.d.ts CHANGED
@@ -8,11 +8,11 @@ export declare const VALID_SCOPES: readonly ["name", "nickname", "preferred_user
8
8
  export declare const VALID_RESPONSE_TYPE: readonly ["id_token", "code"];
9
9
  export declare const VALID_RESPONSE_MODE: string[];
10
10
  export declare const VALID_PROVIDER_HINT: readonly ["apple", "discord", "facebook", "github", "gitlab", "google", "twitch", "twitter", "tumblr", "mastodon", "microsoft", "line", "wordpress", "yahoo", "phone", "ethereum", "qrcode", "apple--", "microsoft--", "google--", "email--", "passkey--"];
11
- export type Scope = typeof VALID_SCOPES[number];
12
- export type AuthResponseType = typeof VALID_RESPONSE_TYPE[number];
13
- export type AuthResponseMode = typeof VALID_RESPONSE_MODE[number];
14
- export type ProviderHint = typeof VALID_PROVIDER_HINT[number];
15
- type IdentityClaims = typeof VALID_IDENTITY_CLAIMS[number];
11
+ export type Scope = (typeof VALID_SCOPES)[number];
12
+ export type AuthResponseType = (typeof VALID_RESPONSE_TYPE)[number];
13
+ export type AuthResponseMode = (typeof VALID_RESPONSE_MODE)[number];
14
+ export type ProviderHint = (typeof VALID_PROVIDER_HINT)[number];
15
+ type IdentityClaims = (typeof VALID_IDENTITY_CLAIMS)[number];
16
16
  type OptionalClaims = {
17
17
  [K in IdentityClaims]?: unknown;
18
18
  };
@@ -34,9 +34,9 @@ export type TokenHeader = {
34
34
  alg: string;
35
35
  };
36
36
  export declare namespace Button {
37
- type Color = "black" | "white";
38
- type Theme = "ignore-light" | "ignore-dark" | "aware-invert" | "aware-static";
39
- type Hover = "pop" | "glow" | "flare" | "none";
37
+ type Color = 'black' | 'white';
38
+ type Theme = 'ignore-light' | 'ignore-dark' | 'aware-invert' | 'aware-static';
39
+ type Hover = 'pop' | 'glow' | 'flare' | 'none';
40
40
  type Update = boolean;
41
41
  const STYLES_URL = "https://cdn.hello.coop/css/hello-btn.css";
42
42
  const HOVER_MAPPING: {
@@ -47,16 +47,16 @@ export declare namespace Button {
47
47
  };
48
48
  const CLASS_MAPPING: {
49
49
  black: {
50
- "ignore-light": string;
51
- "ignore-dark": string;
52
- "aware-invert": string;
53
- "aware-static": string;
50
+ 'ignore-light': string;
51
+ 'ignore-dark': string;
52
+ 'aware-invert': string;
53
+ 'aware-static': string;
54
54
  };
55
55
  white: {
56
- "ignore-light": string;
57
- "ignore-dark": string;
58
- "aware-invert": string;
59
- "aware-static": string;
56
+ 'ignore-light': string;
57
+ 'ignore-dark': string;
58
+ 'aware-invert': string;
59
+ 'aware-static': string;
60
60
  };
61
61
  };
62
62
  }
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
1
  {
2
- "name": "@hellocoop/vue",
3
- "version": "2.1.6",
4
- "description": "Svelte SDK for Hellō https://hello.dev",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/hellocoop/packages.git"
8
- },
9
- "homepage": "https://www.hello.dev/docs/sdks/vue",
10
- "keywords": [
11
- "vuejs",
12
- "vue",
13
- "vue.js",
14
- "hello",
15
- "openid",
16
- "oidc",
17
- "sso"
18
- ],
19
- "author": {
20
- "name": "Hello Identity Co-op",
21
- "email": "contact@hello.coop",
22
- "url": "https://hello.coop"
23
- },
24
- "main": "./dist/index.umd.js",
25
- "module": "./dist/index.mjs",
26
- "exports": {
27
- ".": {
28
- "import": "./dist/index.mjs",
29
- "require": "./dist/index.umd.js"
30
- }
31
- },
32
- "unpkg": "dist/index.umd.min.js",
33
- "types": "./dist/index.d.ts",
34
- "license": "MIT",
35
- "bugs": {
36
- "url": "https://github.com/hellocoop/packages/issues"
37
- },
38
- "files": [
39
- "dist"
40
- ],
41
- "scripts": {
42
- "build": "vite build",
43
- "prebuild": "rimraf dist node_modules"
44
- },
45
- "dependencies": {
46
- "@vitejs/plugin-vue": "^5.1.4",
47
- "swrv": "^1.0.4",
48
- "vue": "^3.0.5"
49
- },
50
- "devDependencies": {
51
- "typescript": "^5.2.2",
52
- "vite-plugin-dts": "^3.6.3"
53
- },
54
- "gitHead": "d90d99cd74ed47abb3c8808dacf128d57d0b786e"
2
+ "name": "@hellocoop/vue",
3
+ "version": "2.1.9",
4
+ "description": "Svelte SDK for Hellō https://hello.dev",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/hellocoop/packages.git"
8
+ },
9
+ "homepage": "https://www.hello.dev/docs/sdks/vue",
10
+ "keywords": [
11
+ "vuejs",
12
+ "vue",
13
+ "vue.js",
14
+ "hello",
15
+ "openid",
16
+ "oidc",
17
+ "sso"
18
+ ],
19
+ "author": {
20
+ "name": "Hello Identity Co-op",
21
+ "email": "contact@hello.coop",
22
+ "url": "https://hello.coop"
23
+ },
24
+ "main": "./dist/index.umd.js",
25
+ "module": "./dist/index.mjs",
26
+ "exports": {
27
+ ".": {
28
+ "import": "./dist/index.mjs",
29
+ "require": "./dist/index.umd.js"
30
+ }
31
+ },
32
+ "unpkg": "dist/index.umd.min.js",
33
+ "types": "./dist/index.d.ts",
34
+ "license": "MIT",
35
+ "bugs": {
36
+ "url": "https://github.com/hellocoop/packages/issues"
37
+ },
38
+ "files": [
39
+ "dist"
40
+ ],
41
+ "scripts": {
42
+ "build": "vite build",
43
+ "prebuild": "rimraf dist node_modules"
44
+ },
45
+ "devDependencies": {
46
+ "typescript": "^5.7.2",
47
+ "vite-plugin-dts": "^4.3.0"
48
+ },
49
+ "gitHead": "2b89ccef8ad8c71a09085c06e709b802ff790484",
50
+ "dependencies": {
51
+ "@vitejs/plugin-vue": "^5.2.1",
52
+ "swrv": "^1.0.4",
53
+ "vue": "^3.5.13"
54
+ }
55
55
  }