@justifi/webcomponents 3.0.4 → 3.1.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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### 3.1.4
8
+ > 04 May 2023
9
+
10
+ - Fix missing url to show recently added introduction page.
7
11
  #### 3.0.3
8
12
  > 04 May 2023
9
13
 
@@ -22,7 +22,7 @@ const MessageEventType = {
22
22
  };
23
23
 
24
24
  const name = "@justifi/webcomponents";
25
- const version = "3.0.4";
25
+ const version = "3.1.4";
26
26
  const description = "JustiFi Web Components";
27
27
  const main = "dist/index.cjs.js";
28
28
  const module$1 = "dist/components/index.js";
@@ -1,5 +1,3 @@
1
- import { userEvent, within } from '@storybook/testing-library';
2
- import { expect } from '@storybook/jest';
3
1
  const isDev = process.env.NODE_ENV === 'development';
4
2
  export default {
5
3
  title: 'Components/CardForm',
@@ -84,23 +82,8 @@ export const SingleLine = Template.bind({});
84
82
  SingleLine.args = {
85
83
  'single-line': true,
86
84
  };
87
- export const Embedded = Template.bind({});
88
- Embedded.decorators = [
89
- (story) => `
90
- <style>
91
- #wrapper {
92
- background-color: #aaaaaa;
93
- }
94
- </style>
95
- <div id="wrapper" style="width: 50%;">
96
- ${story()}
97
- </div>
98
- `,
99
- ];
100
- export const Styled = Template.bind({});
101
- Styled.args = {
102
- cssVariables: (`
103
- --jfi-layout-padding: 0;
85
+ const styledVariables = `
86
+ --jfi-layout-padding: 0;
104
87
  --jfi-layout-form-control-spacing-x: .5rem;
105
88
  --jfi-layout-form-control-spacing-y: 1rem;
106
89
  --jfi-form-label-font-weight: 700;
@@ -130,24 +113,8 @@ Styled.args = {
130
113
  --jfi-error-message-color: #C12727;
131
114
  --jfi-error-message-margin: .25rem 0 0 0;
132
115
  --jfi-error-message-font-size: .875rem;
133
- `)
134
- };
135
- export const Completed = Template.bind({});
136
- Completed.play = async ({ canvasElement, step }) => {
137
- // Need to wait for iFrame to load
138
- addEventListener('cardFormReady', async () => {
139
- const canvas = within(canvasElement);
140
- await step('CardForm is rendered', async () => {
141
- expect(canvas.getByTestId('card-form-iframe')).toBeDefined();
142
- });
143
- await step('Validate form when empty shows errors', async () => {
144
- userEvent.click(canvas.getByRole('button', { name: 'Validate' }));
145
- });
146
- // Expect errors to show up, but can't figure out how to get them
147
- await step('Call tokenize with empty form shows errors', async () => {
148
- userEvent.click(canvas.getByRole('button', { name: 'Tokenize' }));
149
- });
150
- // Expect errors to show up, but can't figure out how to get them
151
- // Fill form
152
- });
116
+ `;
117
+ export const Styled = Template.bind({});
118
+ Styled.args = {
119
+ 'css-variables': styledVariables
153
120
  };
@@ -18,7 +18,7 @@ const MessageEventType = {
18
18
  };
19
19
 
20
20
  const name = "@justifi/webcomponents";
21
- const version = "3.0.4";
21
+ const version = "3.1.4";
22
22
  const description = "JustiFi Web Components";
23
23
  const main = "dist/index.cjs.js";
24
24
  const module = "dist/components/index.js";
@@ -18,7 +18,7 @@ const MessageEventType = {
18
18
  };
19
19
 
20
20
  const name = "@justifi/webcomponents";
21
- const version = "3.0.4";
21
+ const version = "3.1.4";
22
22
  const description = "JustiFi Web Components";
23
23
  const main = "dist/index.cjs.js";
24
24
  const module = "dist/components/index.js";
@@ -15,6 +15,4 @@ declare const _default: {
15
15
  export default _default;
16
16
  export declare const Basic: any;
17
17
  export declare const SingleLine: any;
18
- export declare const Embedded: any;
19
18
  export declare const Styled: any;
20
- export declare const Completed: any;
@@ -1 +1 @@
1
- import{r as o,c as r,h as t,H as i}from"./p-48c17d38.js";const e={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}},s=class{constructor(t){o(this,t),this.paymentMethodFormReady=r(this,"paymentMethodFormReady",7),this.paymentMethodFormTokenize=r(this,"paymentMethodFormTokenize",7),this.computedTheme=(()=>{const o=getComputedStyle(document.body);return{layout:{padding:o.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:o.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:o.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:o.getPropertyValue("--jfi-form-control-background-color"),borderColor:o.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:o.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:o.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:o.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:o.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:o.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:o.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:o.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:o.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:o.getPropertyValue("--jfi-form-control-border-style"),boxShadow:o.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:o.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:o.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:o.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:o.getPropertyValue("--jfi-form-control-color"),colorFocus:o.getPropertyValue("--jfi-form-control-color-focus"),fontSize:o.getPropertyValue("--jfi-form-control-font-size"),fontWeight:o.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:o.getPropertyValue("--jfi-form-control-line-height"),margin:o.getPropertyValue("--jfi-form-control-margin"),padding:o.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:o.getPropertyValue("--jfi-form-label-color"),fontFamily:o.getPropertyValue("--jfi-form-label-font-family"),fontSize:o.getPropertyValue("--jfi-form-label-font-size"),fontWeight:o.getPropertyValue("--jfi-form-label-font-weight"),margin:o.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:o.getPropertyValue("--jfi-error-message-color"),margin:o.getPropertyValue("--jfi-error-message-margin"),fontSize:o.getPropertyValue("--jfi-error-message-font-size")}}})(),this.paymentMethodFormType=void 0,this.paymentMethodFormValidationMode=void 0,this.iframeOrigin=void 0,this.singleLine=void 0,this.height=55}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}componentShouldUpdate(){this.sendStyleOverrides()}sendStyleOverrides(){this.computedTheme&&this.postMessage(e[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}dispatchMessageEvent(o){const r=o.data,t=r.eventType,i=r.data;t===e[this.paymentMethodFormType].ready&&this.paymentMethodFormReady.emit(i),t===e[this.paymentMethodFormType].resize&&(this.height=i.height)}postMessage(o,r){var t,i;null===(i=null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow)||void 0===i||i.postMessage(Object.assign({eventType:o},r),"*")}async postMessageWithResponseListener(o,r){return new Promise((t=>{const i=r=>{r.data.eventType===o&&(window.removeEventListener("message",i),t(r.data.data))};window.addEventListener("message",i),this.postMessage(o,r)}))}async tokenize(o,r,t){return this.postMessageWithResponseListener(e[this.paymentMethodFormType].tokenize,{clientId:o,componentVersion:"3.0.4",paymentMethodMetadata:r,account:t})}async validate(){return this.postMessageWithResponseListener(e[this.paymentMethodFormType].validate)}composeQueryParams(o){return o.map((r=>r===o[0]?`?${r}`:`&${r}`)).join("")}getIframeSrc(){let o=`${this.iframeOrigin||"https://js.justifi.ai/v2"}/${this.paymentMethodFormType}`,r=[];return this.paymentMethodFormValidationMode&&r.push(`validationMode=${this.paymentMethodFormValidationMode}`),this.singleLine&&r.push(`singleLine=${this.singleLine}`),o.concat(this.composeQueryParams(r))}render(){return t(i,null,t("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:o=>this.iframeElement=o,height:this.height}))}};s.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";export{s as justifi_payment_method_form}
1
+ import{r as o,c as r,h as t,H as i}from"./p-48c17d38.js";const e={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}},s=class{constructor(t){o(this,t),this.paymentMethodFormReady=r(this,"paymentMethodFormReady",7),this.paymentMethodFormTokenize=r(this,"paymentMethodFormTokenize",7),this.computedTheme=(()=>{const o=getComputedStyle(document.body);return{layout:{padding:o.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:o.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:o.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:o.getPropertyValue("--jfi-form-control-background-color"),borderColor:o.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:o.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:o.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:o.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:o.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:o.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:o.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:o.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:o.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:o.getPropertyValue("--jfi-form-control-border-style"),boxShadow:o.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:o.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:o.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:o.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:o.getPropertyValue("--jfi-form-control-color"),colorFocus:o.getPropertyValue("--jfi-form-control-color-focus"),fontSize:o.getPropertyValue("--jfi-form-control-font-size"),fontWeight:o.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:o.getPropertyValue("--jfi-form-control-line-height"),margin:o.getPropertyValue("--jfi-form-control-margin"),padding:o.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:o.getPropertyValue("--jfi-form-label-color"),fontFamily:o.getPropertyValue("--jfi-form-label-font-family"),fontSize:o.getPropertyValue("--jfi-form-label-font-size"),fontWeight:o.getPropertyValue("--jfi-form-label-font-weight"),margin:o.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:o.getPropertyValue("--jfi-error-message-color"),margin:o.getPropertyValue("--jfi-error-message-margin"),fontSize:o.getPropertyValue("--jfi-error-message-font-size")}}})(),this.paymentMethodFormType=void 0,this.paymentMethodFormValidationMode=void 0,this.iframeOrigin=void 0,this.singleLine=void 0,this.height=55}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}componentShouldUpdate(){this.sendStyleOverrides()}sendStyleOverrides(){this.computedTheme&&this.postMessage(e[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}dispatchMessageEvent(o){const r=o.data,t=r.eventType,i=r.data;t===e[this.paymentMethodFormType].ready&&this.paymentMethodFormReady.emit(i),t===e[this.paymentMethodFormType].resize&&(this.height=i.height)}postMessage(o,r){var t,i;null===(i=null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow)||void 0===i||i.postMessage(Object.assign({eventType:o},r),"*")}async postMessageWithResponseListener(o,r){return new Promise((t=>{const i=r=>{r.data.eventType===o&&(window.removeEventListener("message",i),t(r.data.data))};window.addEventListener("message",i),this.postMessage(o,r)}))}async tokenize(o,r,t){return this.postMessageWithResponseListener(e[this.paymentMethodFormType].tokenize,{clientId:o,componentVersion:"3.1.4",paymentMethodMetadata:r,account:t})}async validate(){return this.postMessageWithResponseListener(e[this.paymentMethodFormType].validate)}composeQueryParams(o){return o.map((r=>r===o[0]?`?${r}`:`&${r}`)).join("")}getIframeSrc(){let o=`${this.iframeOrigin||"https://js.justifi.ai/v2"}/${this.paymentMethodFormType}`,r=[];return this.paymentMethodFormValidationMode&&r.push(`validationMode=${this.paymentMethodFormValidationMode}`),this.singleLine&&r.push(`singleLine=${this.singleLine}`),o.concat(this.composeQueryParams(r))}render(){return t(i,null,t("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:o=>this.iframeElement=o,height:this.height}))}};s.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";export{s as justifi_payment_method_form}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-48c17d38.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-587697d6",[[1,"justifi-payment-form",{bankAccount:[4,"bank-account"],card:[4],email:[1],iframeOrigin:[1,"iframe-origin"],clientId:[1,"client-id"],accountId:[1,"account-id"],submitButtonText:[1,"submit-button-text"],submitButtonEnabled:[32],selectedPaymentMethodType:[32],allowedPaymentMethodTypes:[32],fillBillingForm:[64],enableSubmitButton:[64]},[[0,"paymentMethodSelected","paymentMethodSelectedHandler"]]]]],["p-282af003",[[0,"justifi-bank-account-form",{validationMode:[1025,"validation-mode"],iframeOrigin:[1025,"iframe-origin"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-af8d98bb",[[0,"justifi-card-form",{validationMode:[1025,"validation-mode"],iframeOrigin:[1025,"iframe-origin"],singleLine:[4,"single-line"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-57d070c8",[[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}]]],["p-f2438424",[[1,"select-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],options:[16],internalValue:[32]}],[1,"text-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],internalValue:[32]}]]],["p-0d4b4f19",[[1,"justifi-billing-form",{legend:[1],billingFields:[32],billingFieldsErrors:[32],fill:[64],validate:[64],getValues:[64]},[[0,"fieldReceivedInput","setFormValue"]]],[0,"justifi-payment-method-selector",{paymentMethodTypes:[16],selectedPaymentMethodType:[1,"selected-payment-method-type"]}]]],["p-defe7fd5",[[0,"justifi-payment-method-form",{paymentMethodFormType:[1,"payment-method-form-type"],paymentMethodFormValidationMode:[1025,"payment-method-form-validation-mode"],iframeOrigin:[1,"iframe-origin"],singleLine:[4,"single-line"],height:[32],tokenize:[64],validate:[64]}]]]],e)));
1
+ import{p as e,b as t}from"./p-48c17d38.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-587697d6",[[1,"justifi-payment-form",{bankAccount:[4,"bank-account"],card:[4],email:[1],iframeOrigin:[1,"iframe-origin"],clientId:[1,"client-id"],accountId:[1,"account-id"],submitButtonText:[1,"submit-button-text"],submitButtonEnabled:[32],selectedPaymentMethodType:[32],allowedPaymentMethodTypes:[32],fillBillingForm:[64],enableSubmitButton:[64]},[[0,"paymentMethodSelected","paymentMethodSelectedHandler"]]]]],["p-282af003",[[0,"justifi-bank-account-form",{validationMode:[1025,"validation-mode"],iframeOrigin:[1025,"iframe-origin"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-af8d98bb",[[0,"justifi-card-form",{validationMode:[1025,"validation-mode"],iframeOrigin:[1025,"iframe-origin"],singleLine:[4,"single-line"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-57d070c8",[[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}]]],["p-f2438424",[[1,"select-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],options:[16],internalValue:[32]}],[1,"text-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],internalValue:[32]}]]],["p-0d4b4f19",[[1,"justifi-billing-form",{legend:[1],billingFields:[32],billingFieldsErrors:[32],fill:[64],validate:[64],getValues:[64]},[[0,"fieldReceivedInput","setFormValue"]]],[0,"justifi-payment-method-selector",{paymentMethodTypes:[16],selectedPaymentMethodType:[1,"selected-payment-method-type"]}]]],["p-fbed6d27",[[0,"justifi-payment-method-form",{paymentMethodFormType:[1,"payment-method-form-type"],paymentMethodFormValidationMode:[1025,"payment-method-form-validation-mode"],iframeOrigin:[1,"iframe-origin"],singleLine:[4,"single-line"],height:[32],tokenize:[64],validate:[64]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justifi/webcomponents",
3
- "version": "3.0.4",
3
+ "version": "3.1.4",
4
4
  "description": "JustiFi Web Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/components/index.js",