@hellocoop/vue 1.0.0 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  import { Button, type ProviderHint, type Scope } from '../types';
2
- interface Props {
2
+ type Props = {
3
3
  label?: string;
4
4
  style?: any;
5
5
  color?: Button.Color;
@@ -11,7 +11,7 @@ interface Props {
11
11
  providerHint?: ProviderHint[];
12
12
  showLoader?: boolean;
13
13
  disabled?: boolean;
14
- }
14
+ };
15
15
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
16
16
  label: string;
17
17
  color: string;
package/dist/index.mjs CHANGED
@@ -1,26 +1,26 @@
1
- import { provide as w, inject as L, defineComponent as n, ref as v, openBlock as a, createElementBlock as d, normalizeClass as B, unref as h, normalizeStyle as H, createElementVNode as U, createBlock as i, renderSlot as p, createCommentVNode as g } from "vue";
2
- const c = {
1
+ import { provide as v, inject as H, defineComponent as a, onMounted as S, ref as B, openBlock as l, createElementBlock as p, normalizeClass as U, unref as g, normalizeStyle as k, createElementVNode as y, createBlock as i, renderSlot as f, createCommentVNode as b } from "vue";
2
+ const s = {
3
3
  login: "/api/hellocoop?login=true",
4
4
  auth: "/api/hellocoop?auth=true",
5
5
  logout: "/api/hellocoop?logout=true"
6
- }, f = "HelloAuth", P = () => L(f), E = {
6
+ }, m = "HelloAuth", P = () => H(m), G = {
7
7
  props: ["auth", "config"],
8
- setup(t) {
9
- var o, e, l;
10
- (o = t == null ? void 0 : t.config) != null && o.login && (c.login = t.config.login), (e = t == null ? void 0 : t.config) != null && e.auth && (c.auth = t.config.auth), (l = t == null ? void 0 : t.config) != null && l.logout && (c.logout = t.config.logout), w(f, t.auth);
8
+ setup(e) {
9
+ var o, t, n;
10
+ (o = e == null ? void 0 : e.config) != null && o.login && (s.login = e.config.login), (t = e == null ? void 0 : e.config) != null && t.auth && (s.auth = e.config.auth), (n = e == null ? void 0 : e.config) != null && n.logout && (s.logout = e.config.logout), v(m, e.auth);
11
11
  },
12
12
  render() {
13
13
  return this.$slots.default();
14
14
  }
15
15
  };
16
- var u;
17
- ((t) => {
18
- t.STYLES_URL = "https://cdn.hello.coop/css/hello-btn.css", t.HOVER_MAPPING = {
16
+ var h;
17
+ ((e) => {
18
+ e.STYLES_URL = "https://cdn.hello.coop/css/hello-btn.css", e.HOVER_MAPPING = {
19
19
  pop: "",
20
20
  glow: "hello-btn-hover-glow",
21
21
  flare: "hello-btn-hover-flare",
22
22
  none: "hello-btn-hover-none"
23
- }, t.CLASS_MAPPING = {
23
+ }, e.CLASS_MAPPING = {
24
24
  black: {
25
25
  "ignore-light": "",
26
26
  "ignore-dark": "hello-btn-black-on-dark",
@@ -34,8 +34,8 @@ var u;
34
34
  "aware-static": "hello-btn-white-and-static"
35
35
  }
36
36
  };
37
- })(u || (u = {}));
38
- const S = ["disabled"], k = ["innerHTML"], r = /* @__PURE__ */ n({
37
+ })(h || (h = {}));
38
+ const I = ["disabled"], $ = ["innerHTML"], r = /* @__PURE__ */ a({
39
39
  __name: "BaseButton",
40
40
  props: {
41
41
  label: { default: "ō&nbsp;&nbsp;&nbsp;Continue with Hellō" },
@@ -50,137 +50,146 @@ const S = ["disabled"], k = ["innerHTML"], r = /* @__PURE__ */ n({
50
50
  showLoader: { type: Boolean, default: !1 },
51
51
  disabled: { type: Boolean, default: !1 }
52
52
  },
53
- setup(t) {
54
- const o = v(!1), e = t, l = new URL(c.login, window.location.origin);
55
- e.scope && l.searchParams.set("scope", e.scope.join(" ")), l.searchParams.set("target_uri", e.targetURI || window.location.pathname), e.updateScope && l.searchParams.set("scope", "profile_update " + e.updateScope), e.providerHint && l.searchParams.set("provider_hint", e.providerHint.join(" "));
56
- const m = () => {
57
- o.value = !0, window.location.href = l.href;
53
+ setup(e) {
54
+ let o = !1;
55
+ S(() => {
56
+ typeof window < "u" && !o && (Array.from(document.head.getElementsByTagName("link")).find(
57
+ (_) => {
58
+ var d;
59
+ return _.getAttribute("rel") === "stylesheet" && ((d = _.getAttribute("href")) == null ? void 0 : d.startsWith(h.STYLES_URL));
60
+ }
61
+ ) || console.warn("Could not find Hellō stylesheet. Please add to pages with Hellō buttons. See http://hello.dev/docs/buttons/#stylesheet for more info."), o = !0);
62
+ });
63
+ const t = B(!1), n = e, c = new URL(s.login, window.location.origin);
64
+ n.scope && c.searchParams.set("scope", n.scope.join(" ")), c.searchParams.set("target_uri", n.targetURI || window.location.pathname), n.updateScope && c.searchParams.set("scope", "profile_update " + n.updateScope), n.providerHint && c.searchParams.set("provider_hint", n.providerHint.join(" "));
65
+ const L = () => {
66
+ t.value = !0, window.location.href = c.href;
58
67
  };
59
- return (s, R) => {
60
- var _;
61
- return a(), d("button", {
62
- onClick: m,
63
- class: B(["hello-btn", (_ = h(u).CLASS_MAPPING[e.color]) == null ? void 0 : _[e.theme], h(u).HOVER_MAPPING[s.hover], (s.showLoader || o.value) && "hello-btn-loader"]),
64
- disabled: e.disabled || o.value,
65
- style: H(s.style)
68
+ return (u, _) => {
69
+ var d;
70
+ return l(), p("button", {
71
+ onClick: L,
72
+ class: U(["hello-btn", (d = g(h).CLASS_MAPPING[n.color]) == null ? void 0 : d[n.theme], g(h).HOVER_MAPPING[u.hover], (u.showLoader || t.value) && "hello-btn-loader"]),
73
+ disabled: n.disabled || t.value,
74
+ style: k(u.style)
66
75
  }, [
67
- U("span", { innerHTML: s.label }, null, 8, k)
68
- ], 14, S);
76
+ y("span", { innerHTML: u.label }, null, 8, $)
77
+ ], 14, I);
69
78
  };
70
79
  }
71
- }), G = /* @__PURE__ */ n({
80
+ }), T = /* @__PURE__ */ a({
72
81
  __name: "ContinueButton",
73
- setup(t) {
74
- return (o, e) => (a(), i(r));
82
+ setup(e) {
83
+ return (o, t) => (l(), i(r));
75
84
  }
76
- }), A = /* @__PURE__ */ n({
85
+ }), x = /* @__PURE__ */ a({
77
86
  __name: "LoginButton",
78
- setup(t) {
79
- return (o, e) => (a(), i(r, { label: "ō   Login with Hellō" }));
87
+ setup(e) {
88
+ return (o, t) => (l(), i(r, { label: "ō   Login with Hellō" }));
80
89
  }
81
- }), x = /* @__PURE__ */ n({
90
+ }), M = /* @__PURE__ */ a({
82
91
  __name: "UpdateEmailButton",
83
- setup(t) {
84
- return (o, e) => (a(), i(r, {
92
+ setup(e) {
93
+ return (o, t) => (l(), i(r, {
85
94
  label: "ō   Update Email with Hellō",
86
95
  updateScope: "email"
87
96
  }));
88
97
  }
89
- }), O = /* @__PURE__ */ n({
98
+ }), N = /* @__PURE__ */ a({
90
99
  __name: "UpdatePictureButton",
91
- setup(t) {
92
- return (o, e) => (a(), i(r, {
100
+ setup(e) {
101
+ return (o, t) => (l(), i(r, {
93
102
  label: "ō   Update Picture with Hellō",
94
103
  updateScope: "picture"
95
104
  }));
96
105
  }
97
- }), M = /* @__PURE__ */ n({
106
+ }), O = /* @__PURE__ */ a({
98
107
  __name: "UpdateTwitterButton",
99
- setup(t) {
100
- return (o, e) => (a(), i(r, {
108
+ setup(e) {
109
+ return (o, t) => (l(), i(r, {
101
110
  label: "ō   Update Twitter with Hellō",
102
111
  updateScope: "twitter"
103
112
  }));
104
113
  }
105
- }), N = /* @__PURE__ */ n({
114
+ }), V = /* @__PURE__ */ a({
106
115
  __name: "UpdateDiscordButton",
107
- setup(t) {
108
- return (o, e) => (a(), i(r, {
116
+ setup(e) {
117
+ return (o, t) => (l(), i(r, {
109
118
  label: "ō   Update Discord with Hellō",
110
119
  updateScope: "discord"
111
120
  }));
112
121
  }
113
- }), T = /* @__PURE__ */ n({
122
+ }), j = /* @__PURE__ */ a({
114
123
  __name: "UpdateGitHubButton",
115
- setup(t) {
116
- return (o, e) => (a(), i(r, {
124
+ setup(e) {
125
+ return (o, t) => (l(), i(r, {
117
126
  label: "ō   Update GitHub with Hellō",
118
127
  updateScope: "github"
119
128
  }));
120
129
  }
121
- }), V = /* @__PURE__ */ n({
130
+ }), D = /* @__PURE__ */ a({
122
131
  __name: "UpdateGitLabButton",
123
- setup(t) {
124
- return (o, e) => (a(), i(r, {
132
+ setup(e) {
133
+ return (o, t) => (l(), i(r, {
125
134
  label: "ō   Update GitLab with Hellō",
126
135
  updateScope: "gitlab"
127
136
  }));
128
137
  }
129
- }), I = async (t) => {
138
+ }), C = async (e) => {
130
139
  try {
131
- return await (await fetch(t)).json();
140
+ return await (await fetch(e)).json();
132
141
  } catch (o) {
133
142
  console.error(o);
134
143
  return;
135
144
  }
136
- }, b = () => {
137
- const t = P(), { data: o = t, isValidating: e } = useSWR(c.auth, I);
145
+ }, w = () => {
146
+ const e = P(), { data: o = e, isValidating: t } = useSWR(s.auth, C);
138
147
  return {
139
148
  auth: o || {},
140
- isLoading: e,
149
+ isLoading: t,
141
150
  isLoggedIn: o == null ? void 0 : o.isLoggedIn
142
151
  };
143
- }, $ = { key: 0 }, j = /* @__PURE__ */ n({
152
+ }, A = { key: 0 }, Y = /* @__PURE__ */ a({
144
153
  __name: "LoggedIn",
145
- setup(t) {
154
+ setup(e) {
146
155
  const o = () => {
147
- var e;
148
- return ((e = b()) == null ? void 0 : e.isLoggedIn) || !1;
156
+ var t;
157
+ return ((t = w()) == null ? void 0 : t.isLoggedIn) || !1;
149
158
  };
150
- return (e, l) => o() ? (a(), d("div", $, [
151
- p(e.$slots, "default")
152
- ])) : g("", !0);
159
+ return (t, n) => o() ? (l(), p("div", A, [
160
+ f(t.$slots, "default")
161
+ ])) : b("", !0);
153
162
  }
154
- }), C = { key: 0 }, D = /* @__PURE__ */ n({
163
+ }), E = { key: 0 }, z = /* @__PURE__ */ a({
155
164
  __name: "LoggedOut",
156
- setup(t) {
165
+ setup(e) {
157
166
  const o = () => {
158
- var e;
159
- return ((e = b()) == null ? void 0 : e.isLoggedIn) || !1;
167
+ var t;
168
+ return ((t = w()) == null ? void 0 : t.isLoggedIn) || !1;
160
169
  };
161
- return (e, l) => o() ? g("", !0) : (a(), d("div", C, [
162
- p(e.$slots, "default")
170
+ return (t, n) => o() ? b("", !0) : (l(), p("div", E, [
171
+ f(t.$slots, "default")
163
172
  ]));
164
173
  }
165
- }), z = () => c.logout;
166
- function Y() {
167
- window.location.href = c.logout;
174
+ }), W = () => s.logout;
175
+ function F() {
176
+ window.location.href = s.logout;
168
177
  }
169
178
  export {
170
- G as ContinueButton,
171
- E as HelloProvider,
172
- j as LoggedIn,
173
- D as LoggedOut,
174
- A as LoginButton,
175
- N as UpdateDiscordButton,
176
- x as UpdateEmailButton,
177
- T as UpdateGitHubButton,
178
- V as UpdateGitLabButton,
179
- O as UpdatePictureButton,
180
- M as UpdateTwitterButton,
181
- z as getLogOutRoute,
182
- Y as logOut,
183
- c as routeConfig,
184
- b as useAuth,
179
+ T as ContinueButton,
180
+ G as HelloProvider,
181
+ Y as LoggedIn,
182
+ z as LoggedOut,
183
+ x as LoginButton,
184
+ V as UpdateDiscordButton,
185
+ M as UpdateEmailButton,
186
+ j as UpdateGitHubButton,
187
+ D as UpdateGitLabButton,
188
+ N as UpdatePictureButton,
189
+ O as UpdateTwitterButton,
190
+ W as getLogOutRoute,
191
+ F as logOut,
192
+ s as routeConfig,
193
+ w as useAuth,
185
194
  P as useHelloProviderContext
186
195
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a["@hellocoop/vue"]={},a.Vue))})(this,function(a,e){"use strict";const i={login:"/api/hellocoop?login=true",auth:"/api/hellocoop?auth=true",logout:"/api/hellocoop?logout=true"},u="HelloAuth",_=()=>e.inject(u),p={props:["auth","config"],setup(o){var n,t,l;(n=o==null?void 0:o.config)!=null&&n.login&&(i.login=o.config.login),(t=o==null?void 0:o.config)!=null&&t.auth&&(i.auth=o.config.auth),(l=o==null?void 0:o.config)!=null&&l.logout&&(i.logout=o.config.logout),e.provide(u,o.auth)},render(){return this.$slots.default()}};var r;(o=>{o.STYLES_URL="https://cdn.hello.coop/css/hello-btn.css",o.HOVER_MAPPING={pop:"",glow:"hello-btn-hover-glow",flare:"hello-btn-hover-flare",none:"hello-btn-hover-none"},o.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"}}})(r||(r={}));const f=["disabled"],g=["innerHTML"],c=e.defineComponent({__name:"BaseButton",props:{label:{default:"ō&nbsp;&nbsp;&nbsp;Continue with Hellō"},style:{},color:{default:"black"},theme:{default:"ignore-light"},hover:{default:"pop"},scope:{},updateScope:{},targetURI:{},providerHint:{},showLoader:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(o){const n=e.ref(!1),t=o,l=new URL(i.login,window.location.origin);t.scope&&l.searchParams.set("scope",t.scope.join(" ")),l.searchParams.set("target_uri",t.targetURI||window.location.pathname),t.updateScope&&l.searchParams.set("scope","profile_update "+t.updateScope),t.providerHint&&l.searchParams.set("provider_hint",t.providerHint.join(" "));const R=()=>{n.value=!0,window.location.href=l.href};return(s,A)=>{var h;return e.openBlock(),e.createElementBlock("button",{onClick:R,class:e.normalizeClass(["hello-btn",(h=e.unref(r).CLASS_MAPPING[t.color])==null?void 0:h[t.theme],e.unref(r).HOVER_MAPPING[s.hover],(s.showLoader||n.value)&&"hello-btn-loader"]),disabled:t.disabled||n.value,style:e.normalizeStyle(s.style)},[e.createElementVNode("span",{innerHTML:s.label},null,8,g)],14,f)}}}),m=e.defineComponent({__name:"ContinueButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c))}}),b=e.defineComponent({__name:"LoginButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c,{label:"ō   Login with Hellō"}))}}),B=e.defineComponent({__name:"UpdateEmailButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Email with Hellō",updateScope:"email"}))}}),k=e.defineComponent({__name:"UpdatePictureButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Picture with Hellō",updateScope:"picture"}))}}),w=e.defineComponent({__name:"UpdateTwitterButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Twitter with Hellō",updateScope:"twitter"}))}}),L=e.defineComponent({__name:"UpdateDiscordButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Discord with Hellō",updateScope:"discord"}))}}),C=e.defineComponent({__name:"UpdateGitHubButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update GitHub with Hellō",updateScope:"github"}))}}),H=e.defineComponent({__name:"UpdateGitLabButton",setup(o){return(n,t)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update GitLab with Hellō",updateScope:"gitlab"}))}}),U=async o=>{try{return await(await fetch(o)).json()}catch(n){console.error(n);return}},d=()=>{const o=_(),{data:n=o,isValidating:t}=useSWR(i.auth,U);return{auth:n||{},isLoading:t,isLoggedIn:n==null?void 0:n.isLoggedIn}},S={key:0},P=e.defineComponent({__name:"LoggedIn",setup(o){const n=()=>{var t;return((t=d())==null?void 0:t.isLoggedIn)||!1};return(t,l)=>n()?(e.openBlock(),e.createElementBlock("div",S,[e.renderSlot(t.$slots,"default")])):e.createCommentVNode("",!0)}}),I={key:0},$=e.defineComponent({__name:"LoggedOut",setup(o){const n=()=>{var t;return((t=d())==null?void 0:t.isLoggedIn)||!1};return(t,l)=>n()?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"default")]))}}),y=()=>i.logout;function E(){window.location.href=i.logout}a.ContinueButton=m,a.HelloProvider=p,a.LoggedIn=P,a.LoggedOut=$,a.LoginButton=b,a.UpdateDiscordButton=L,a.UpdateEmailButton=B,a.UpdateGitHubButton=C,a.UpdateGitLabButton=H,a.UpdatePictureButton=k,a.UpdateTwitterButton=w,a.getLogOutRoute=y,a.logOut=E,a.routeConfig=i,a.useAuth=d,a.useHelloProviderContext=_,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
1
+ (function(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l["@hellocoop/vue"]={},l.Vue))})(this,function(l,e){"use strict";const i={login:"/api/hellocoop?login=true",auth:"/api/hellocoop?auth=true",logout:"/api/hellocoop?logout=true"},p="HelloAuth",f=()=>e.inject(p),g={props:["auth","config"],setup(t){var n,o,a;(n=t==null?void 0:t.config)!=null&&n.login&&(i.login=t.config.login),(o=t==null?void 0:t.config)!=null&&o.auth&&(i.auth=t.config.auth),(a=t==null?void 0:t.config)!=null&&a.logout&&(i.logout=t.config.logout),e.provide(p,t.auth)},render(){return this.$slots.default()}};var r;(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"}}})(r||(r={}));const m=["disabled"],b=["innerHTML"],c=e.defineComponent({__name:"BaseButton",props:{label:{default:"ō&nbsp;&nbsp;&nbsp;Continue with Hellō"},style:{},color:{default:"black"},theme:{default:"ignore-light"},hover:{default:"pop"},scope:{},updateScope:{},targetURI:{},providerHint:{},showLoader:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(t){let n=!1;e.onMounted(()=>{typeof window<"u"&&!n&&(Array.from(document.head.getElementsByTagName("link")).find(_=>{var u;return _.getAttribute("rel")==="stylesheet"&&((u=_.getAttribute("href"))==null?void 0:u.startsWith(r.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 o=e.ref(!1),a=t,s=new URL(i.login,window.location.origin);a.scope&&s.searchParams.set("scope",a.scope.join(" ")),s.searchParams.set("target_uri",a.targetURI||window.location.pathname),a.updateScope&&s.searchParams.set("scope","profile_update "+a.updateScope),a.providerHint&&s.searchParams.set("provider_hint",a.providerHint.join(" "));const T=()=>{o.value=!0,window.location.href=s.href};return(d,_)=>{var u;return e.openBlock(),e.createElementBlock("button",{onClick:T,class:e.normalizeClass(["hello-btn",(u=e.unref(r).CLASS_MAPPING[a.color])==null?void 0:u[a.theme],e.unref(r).HOVER_MAPPING[d.hover],(d.showLoader||o.value)&&"hello-btn-loader"]),disabled:a.disabled||o.value,style:e.normalizeStyle(d.style)},[e.createElementVNode("span",{innerHTML:d.label},null,8,b)],14,m)}}}),B=e.defineComponent({__name:"ContinueButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c))}}),w=e.defineComponent({__name:"LoginButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c,{label:"ō   Login with Hellō"}))}}),k=e.defineComponent({__name:"UpdateEmailButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Email with Hellō",updateScope:"email"}))}}),L=e.defineComponent({__name:"UpdatePictureButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Picture with Hellō",updateScope:"picture"}))}}),S=e.defineComponent({__name:"UpdateTwitterButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Twitter with Hellō",updateScope:"twitter"}))}}),C=e.defineComponent({__name:"UpdateDiscordButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update Discord with Hellō",updateScope:"discord"}))}}),H=e.defineComponent({__name:"UpdateGitHubButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update GitHub with Hellō",updateScope:"github"}))}}),y=e.defineComponent({__name:"UpdateGitLabButton",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(c,{label:"ō   Update GitLab with Hellō",updateScope:"gitlab"}))}}),U=async t=>{try{return await(await fetch(t)).json()}catch(n){console.error(n);return}},h=()=>{const t=f(),{data:n=t,isValidating:o}=useSWR(i.auth,U);return{auth:n||{},isLoading:o,isLoggedIn:n==null?void 0:n.isLoggedIn}},P={key:0},I=e.defineComponent({__name:"LoggedIn",setup(t){const n=()=>{var o;return((o=h())==null?void 0:o.isLoggedIn)||!1};return(o,a)=>n()?(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(o.$slots,"default")])):e.createCommentVNode("",!0)}}),$={key:0},E=e.defineComponent({__name:"LoggedOut",setup(t){const n=()=>{var o;return((o=h())==null?void 0:o.isLoggedIn)||!1};return(o,a)=>n()?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$,[e.renderSlot(o.$slots,"default")]))}}),A=()=>i.logout;function R(){window.location.href=i.logout}l.ContinueButton=B,l.HelloProvider=g,l.LoggedIn=I,l.LoggedOut=E,l.LoginButton=w,l.UpdateDiscordButton=C,l.UpdateEmailButton=k,l.UpdateGitHubButton=H,l.UpdateGitLabButton=y,l.UpdatePictureButton=L,l.UpdateTwitterButton=S,l.getLogOutRoute=A,l.logOut=R,l.routeConfig=i,l.useAuth=h,l.useHelloProviderContext=f,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hellocoop/vue",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Svelte SDK for Hellō https://hello.dev",
5
5
  "repository": {
6
6
  "type": "git",