@foxy.io/elements 1.36.0-beta.2 → 1.36.0-beta.4
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/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +27 -13
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/shared-231687fd.js +1 -0
- package/dist/cdn/{shared-5a9e9e89.js → shared-82e82908.js} +1 -1
- package/dist/cdn/shared-9ca85d1e.js +1 -0
- package/dist/cdn/translations/customer-portal/de.json +18 -0
- package/dist/cdn/translations/customer-portal/en.json +18 -0
- package/dist/cdn/translations/customer-portal/es.json +18 -0
- package/dist/cdn/translations/customer-portal/fr.json +18 -0
- package/dist/cdn/translations/customer-portal/nl.json +18 -0
- package/dist/cdn/translations/customer-portal/pl.json +18 -0
- package/dist/cdn/translations/customer-portal/sv.json +18 -0
- package/dist/cdn/translations/customer-portal/zh-hk.json +18 -0
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js +3 -7
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js.map +1 -1
- package/dist/elements/public/CartForm/types.d.ts +1 -9
- package/dist/elements/public/CartForm/types.js.map +1 -1
- package/dist/elements/public/CustomerPortal/CustomerPortal.d.ts +4 -0
- package/dist/elements/public/CustomerPortal/CustomerPortal.js +48 -13
- package/dist/elements/public/CustomerPortal/CustomerPortal.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +7 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.d.ts +25 -0
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.js +72 -0
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.js.map +1 -0
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
- package/dist/elements/public/CustomerPortal/index.d.ts +2 -0
- package/dist/elements/public/CustomerPortal/index.js +4 -0
- package/dist/elements/public/CustomerPortal/index.js.map +1 -1
- package/dist/elements/public/EmailTemplateForm/types.d.ts +1 -3
- package/dist/elements/public/EmailTemplateForm/types.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/composers/available_fraud_protections.js +7 -7
- package/dist/elements/public/PaymentsApi/api/composers/available_fraud_protections.js.map +1 -1
- package/dist/elements/public/StoreForm/types.d.ts +4 -38
- package/dist/elements/public/StoreForm/types.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.d.ts +1 -3
- package/dist/elements/public/SubscriptionSettingsForm/types.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.js +13 -17
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/UserCard/UserCard.js +0 -2
- package/dist/elements/public/UserCard/UserCard.js.map +1 -1
- package/dist/elements/public/UserInvitationCard/types.d.ts +3 -1
- package/dist/elements/public/UserInvitationCard/types.js +1 -1
- package/dist/elements/public/UserInvitationCard/types.js.map +1 -1
- package/dist/elements/public/UserInvitationForm/types.d.ts +2 -41
- package/dist/elements/public/UserInvitationForm/types.js.map +1 -1
- package/package.json +3 -3
- package/dist/cdn/shared-0e156ee7.js +0 -1
|
@@ -1,42 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Graph, Resource } from '@foxy.io/sdk/core';
|
|
1
|
+
import type { Resource } from '@foxy.io/sdk/core';
|
|
3
2
|
import type { Rels } from '@foxy.io/sdk/backend';
|
|
4
|
-
export
|
|
5
|
-
curie: 'fx:user_invitation';
|
|
6
|
-
links: {
|
|
7
|
-
'self': UserInvitation;
|
|
8
|
-
'fx:user': Rels.User;
|
|
9
|
-
'fx:store': Rels.Store;
|
|
10
|
-
'fx:resend': {
|
|
11
|
-
curie: 'fx:resend';
|
|
12
|
-
};
|
|
13
|
-
'fx:accept': {
|
|
14
|
-
curie: 'fx:accept';
|
|
15
|
-
};
|
|
16
|
-
'fx:reject': {
|
|
17
|
-
curie: 'fx:reject';
|
|
18
|
-
};
|
|
19
|
-
'fx:revoke': {
|
|
20
|
-
curie: 'fx:revoke';
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
props: {
|
|
24
|
-
store_url: string;
|
|
25
|
-
store_name: string;
|
|
26
|
-
store_email: string;
|
|
27
|
-
store_domain: string;
|
|
28
|
-
first_name: string | null;
|
|
29
|
-
last_name: string | null;
|
|
30
|
-
email: string;
|
|
31
|
-
status: 'sent' | 'accepted' | 'rejected' | 'revoked' | 'expired';
|
|
32
|
-
date_created: string;
|
|
33
|
-
date_modified: string;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface UserInvitations extends Graph {
|
|
37
|
-
curie: 'fx:user_invitations';
|
|
38
|
-
links: CollectionGraphLinks<UserInvitations>;
|
|
39
|
-
props: CollectionGraphProps;
|
|
40
|
-
child: UserInvitation;
|
|
41
|
-
}
|
|
42
|
-
export declare type Data = Resource<UserInvitation>;
|
|
3
|
+
export declare type Data = Resource<Rels.UserInvitation>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nexport type Data = Resource<Rels.UserInvitation>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxy.io/elements",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.36.0-beta.
|
|
4
|
+
"version": "1.36.0-beta.4",
|
|
5
5
|
"description": "E-commerce web components by Foxy.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepack": "npm run lint && rimraf dist && node ./.build/compile-for-npm.js && rollup -c"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@foxy.io/sdk": "^1.
|
|
30
|
+
"@foxy.io/sdk": "^1.13.0",
|
|
31
31
|
"@open-wc/lit-helpers": "^0.3.12",
|
|
32
32
|
"@open-wc/scoped-elements": "^1.2.1",
|
|
33
33
|
"@polymer/iron-icons": "^3.0.1",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"cookie-storage": "^6.1.0",
|
|
39
39
|
"dedent": "^1.5.3",
|
|
40
40
|
"email-validator": "^2.0.4",
|
|
41
|
+
"highlight.js": "^10.7.3",
|
|
41
42
|
"html-entities": "^2.4.0",
|
|
42
43
|
"i18next": "^19.7.0",
|
|
43
44
|
"i18next-http-backend": "^1.0.18",
|
|
@@ -49,7 +50,6 @@
|
|
|
49
50
|
"uainfer": "^0.5.0",
|
|
50
51
|
"vanilla-hcaptcha": "^1.0.2",
|
|
51
52
|
"webcomponent-qr-code": "^1.0.5",
|
|
52
|
-
"highlight.js": "^10.7.3",
|
|
53
53
|
"xstate": "^4.16.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,aF as t,aG as s}from"./shared-d1195c27.js";var n=function(e,t,s,n){return new(s||(s=Promise))((function(i,r){function a(e){try{h(n.next(e))}catch(e){r(e)}}function o(e){try{h(n.throw(e))}catch(e){r(e)}}function h(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,o)}h((n=n.apply(e,t||[])).next())}))};class i extends e{constructor(e){super(Object.assign(Object.assign({},e),{fetch:(...e)=>this.__fetch(...e)}))}signIn(t){return n(this,void 0,void 0,(function*(){i.v8n.credentials.check(t);const s=yield this.fetch(new URL("./authenticate",this.base).toString(),{body:JSON.stringify(t),method:"POST"});if(!s.ok){const t=401===s.status?"UNAUTHORIZED":"UNKNOWN";throw new e.AuthError({code:t})}{const e=yield s.json(),t=Object.assign(Object.assign({},e),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(t))}}))}signUp(t){return n(this,void 0,void 0,(function*(){i.v8n.signUpParams.check(t);const s=new URL("./sign_up",this.base),n=yield this.fetch(s.toString(),{method:"POST",body:JSON.stringify(t)});if(!n.ok){if(400===n.status)throw new e.AuthError({code:"INVALID_FORM"});if(401===n.status)throw new e.AuthError({code:"UNAUTHORIZED"});if(403===n.status)throw new e.AuthError({code:"UNAVAILABLE"});throw new e.AuthError({code:"UNKNOWN"})}}))}sendPasswordResetEmail(t){return n(this,void 0,void 0,(function*(){i.v8n.email.check(t.email);if(!(yield this.fetch(new URL("./forgot_password",this.base).toString(),{body:JSON.stringify(t),method:"POST"})).ok)throw new e.AuthError({code:"UNKNOWN"})}))}signOut(){return n(this,void 0,void 0,(function*(){if(!(yield this.fetch(new URL("./authenticate",this.base).toString(),{method:"DELETE"})).ok)throw new e.AuthError({code:"UNKNOWN"});this.storage.clear(),this.cache.clear()}))}__fetch(e,t){var r;return n(this,void 0,void 0,(function*(){let n=JSON.parse(null!==(r=this.storage.getItem(i.SESSION))&&void 0!==r?r:"null");const a=new s.Request(e,t);if(null!==n){new Date(n.date_created).getTime()+1e3*n.expires_in<Date.now()?(this.console.info("Session has expired, signing out."),this.storage.clear(),this.cache.clear(),n=null):a.headers.set("Authorization",`Bearer ${n.session_token}`)}a.headers.set("Content-Type","application/json"),a.headers.set("FOXY-API-VERSION","1"),this.console.trace(`${a.method} ${a.url}`);const o=yield s.fetch(a);if(n&&o.ok){const e=Object.assign(Object.assign({},n),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(e))}return o}))}}i.SESSION="session",i.v8n=Object.assign({},e.v8n,{signUpParams:t().schema({verification:t().schema({token:t().string(),type:t().passesAnyOf(t().exact("hcaptcha"))}),first_name:t().optional(t().string().maxLength(50)),last_name:t().optional(t().string().maxLength(50)),password:t().string().maxLength(50),email:t().string().maxLength(100)}),credentials:t().schema({email:t().string(),newPassword:t().optional(t().string()),password:t().string()}),email:t().string()});let r=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([a-zµμ]*)/gi;function a(e="",t="ms"){var s=null;return(e=e.replace(/(\d),(\d)/g,"$1$2")).replace(r,(function(e,t,n){(n=a[n]||a[n.toLowerCase().replace(/s$/,"")])&&(s=(s||0)+parseFloat(t,10)*n)})),s&&s/a[t]}a.nanosecond=a.ns=1e-6,a["µs"]=a["μs"]=a.us=a.microsecond=.001,a.millisecond=a.ms=1,a.second=a.sec=a.s=1e3*a.ms,a.minute=a.min=a.m=60*a.s,a.hour=a.hr=a.h=60*a.m,a.day=a.d=24*a.h,a.week=a.wk=a.w=7*a.d,a.month=a.b=30.4375*a.d,a.year=a.yr=a.y=365.25*a.d;var o=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(s[n[i]]=e[n[i]])}return s};class h{constructor(e){var{url:t}=e,s=o(e,["url"]);this.onsubmit=null,this.__tokenizationRequests=[],this.__iframeMessageHandler=e=>{var t,s;const n=JSON.parse(e.data);switch(n.type){case"tokenization_response":{const e=this.__tokenizationRequests.find((e=>e.id===n.id));n.token?null==e||e.resolve(n.token):null==e||e.reject(),this.__tokenizationRequests=this.__tokenizationRequests.filter((e=>e.id!==n.id));break}case"submit":null===(t=this.onsubmit)||void 0===t||t.call(this);break;case"resize":this.__iframe&&(this.__iframe.style.height=n.height);break;case"ready":this.configure(this.__config),null===(s=this.__mountingTask)||void 0===s||s.resolve()}},this.__iframeLoadHandler=e=>{if(this.__channel){const t=e.currentTarget.contentWindow;if(!t)throw new Error("Content window is not available.");t.postMessage("connect","*",[this.__channel.port2])}},this.__mountingTask=null,this.__channel=null,this.__iframe=null,this.__config=s,this.__url=t}configure(e){var t;this.__config=e;const s=Object.assign({type:"config"},e);null===(t=this.__channel)||void 0===t||t.port1.postMessage(JSON.stringify(s))}tokenize(){return new Promise(((e,t)=>{if(this.__channel){const s=this._createId();this.__tokenizationRequests.push({id:s,reject:t,resolve:e}),this.__channel.port1.postMessage(JSON.stringify({id:s,type:"tokenization_request"}))}else t()}))}unmount(){var e,t,s,n,i,r;null===(e=this.__channel)||void 0===e||e.port1.removeEventListener("message",this.__iframeMessageHandler),null===(t=this.__channel)||void 0===t||t.port1.close(),null===(s=this.__channel)||void 0===s||s.port2.close(),this.__channel=null,null===(n=this.__iframe)||void 0===n||n.removeEventListener("load",this.__iframeLoadHandler),null===(i=this.__iframe)||void 0===i||i.remove(),this.__iframe=null,null===(r=this.__mountingTask)||void 0===r||r.reject(),this.__mountingTask=null}mount(e){return this.unmount(),this.__channel=this._createMessageChannel(),this.__channel.port1.addEventListener("message",this.__iframeMessageHandler),this.__channel.port1.start(),this.__iframe=this._createIframe(e),this.__iframe.addEventListener("load",this.__iframeLoadHandler),this.__iframe.style.transition="height 0.15s ease",this.__iframe.style.margin="-2px",this.__iframe.style.height="100px",this.__iframe.style.width="calc(100% + 4px)",this.__iframe.src=this.__url,e.append(this.__iframe),new Promise(((e,t)=>{this.__mountingTask={reject:t,resolve:e}}))}clear(){var e;null===(e=this.__channel)||void 0===e||e.port1.postMessage(JSON.stringify({type:"clear"}))}_createMessageChannel(){return new MessageChannel}_createIframe(e){return e.ownerDocument.createElement("iframe")}_createId(){return`${Date.now()}${Math.random().toFixed(6).slice(2)}`}}export{i as A,h as P,a as p};
|