@ecomplus/storefront-components 1.0.0-beta.176 → 1.0.0-beta.178

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
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-beta.178](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.177...@ecomplus/storefront-components@1.0.0-beta.178) (2024-05-07)
7
+
8
+ ### Features
9
+
10
+ - **components/login-block:** handling custom oauth handlers from globals ([5147a19](https://github.com/ecomplus/storefront/commit/5147a190c5e089ce1702b330b7a4cec788739ff2))
11
+
12
+ # [1.0.0-beta.177](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.176...@ecomplus/storefront-components@1.0.0-beta.177) (2024-05-02)
13
+
14
+ **Note:** Version bump only for package @ecomplus/storefront-components
15
+
6
16
  # [1.0.0-beta.176](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.175...@ecomplus/storefront-components@1.0.0-beta.176) (2024-04-25)
7
17
 
8
18
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecomplus/storefront-components",
3
- "version": "1.0.0-beta.176",
3
+ "version": "1.0.0-beta.178",
4
4
  "description": "Vue components for E-Com Plus Storefront",
5
5
  "main": "dist/storefront-components.min.js",
6
6
  "scripts": {
@@ -97,7 +97,7 @@
97
97
  {{ failAlertText }}
98
98
  </a-alert>
99
99
 
100
- <slot name="login-methods" v-bind="{ isWaitingLogin, confirmAccount }">
100
+ <slot name="login-methods" v-bind="{ isWaitingLogin, email, confirmAccount }">
101
101
  <transition enter-active-class="animated fadeInUp">
102
102
  <div
103
103
  v-if="oauthProviders.length"
@@ -118,8 +118,12 @@ export default {
118
118
  }
119
119
  },
120
120
 
121
- oauthPopup (link) {
122
- this.ecomPassport.popupOauthLink(link)
121
+ oauthPopup (fnOrLink) {
122
+ if (typeof fnOrLink === 'function') {
123
+ fnOrLink()
124
+ } else {
125
+ this.ecomPassport.popupOauthLink(fnOrLink)
126
+ }
123
127
  this.isWaitingPopup = true
124
128
  setTimeout(() => {
125
129
  this.isWaitingPopup = false
@@ -138,6 +142,26 @@ export default {
138
142
  },
139
143
 
140
144
  created () {
145
+ if (Array.isArray(window.OAUTH_PROVIDERS)) {
146
+ this.oauthProviders = []
147
+ if (window.OAUTH_PROVIDERS.includes('google') && window.signInWithGoogle) {
148
+ this.oauthProviders.push({
149
+ link: window.signInWithGoogle,
150
+ faIcon: 'fa-google',
151
+ provider: 'google',
152
+ providerName: 'Google'
153
+ })
154
+ }
155
+ if (window.OAUTH_PROVIDERS.includes('facebook') && window.signInWithFacebook) {
156
+ this.oauthProviders.push({
157
+ link: window.signInWithFacebook,
158
+ faIcon: 'fa-facebook-f',
159
+ provider: 'facebook',
160
+ providerName: 'Facebook'
161
+ })
162
+ }
163
+ if (this.oauthProviders.length) return
164
+ }
141
165
  if (!this.canFetchOauth) return
142
166
  this.ecomPassport.fetchOauthProviders()
143
167
  .then(({ host, baseUri, oauthPath, providers }) => {