Skip to content

Commit

Permalink
chore(release): 1.401.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-travis-ci committed Jul 16, 2023
1 parent b43adec commit 5c5e2e5
Show file tree
Hide file tree
Showing 18 changed files with 251 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.401.0](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.400.0...v1.401.0) (2023-07-16)


### Features

* **checkout:** CHECKOUT-7538 Introduce extension messenger and command handler ([#2050](https://github.com/bigcommerce/checkout-sdk-js/issues/2050)) ([b43adec](https://github.com/bigcommerce/checkout-sdk-js/commit/b43adecf32105a6a7bf9451e4c80fd0beb77eae2))

## [1.400.0](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.399.2...v1.400.0) (2023-07-13)


Expand Down
2 changes: 1 addition & 1 deletion dist/checkout-button.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/checkout-button.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/checkout-button.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/checkout-button.umd.js.map

Large diffs are not rendered by default.

52 changes: 49 additions & 3 deletions dist/checkout-sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,7 @@ declare interface CheckoutSelectors {
*/
declare class CheckoutService {
private _store;
private _extensionMessenger;
private _billingAddressActionCreator;
private _checkoutActionCreator;
private _configActionCreator;
Expand Down Expand Up @@ -3435,11 +3436,21 @@ declare class CheckoutService {
* Currently, only one extension is allowed per region.
*
* @alpha
* @param container The ID of a container which the extension should be inserted.
* @param region The name of an area where the extension should be presented.
* @param container - The ID of a container which the extension should be inserted.
* @param region - The name of an area where the extension should be presented.
* @returns A promise that resolves to the current state.
*/
renderExtension(container: string, region: ExtensionRegion): Promise<CheckoutSelectors>;
/**
* Manages the command handler for an extension.
*
* @alpha
* @param extensionId - The ID of the extension sending the command.
* @param command - The command to be handled.
* @param handler - The handler function for the extension command.
* @returns A function that, when called, will deregister the command handler.
*/
listenExtensionCommand(extensionId: string, command: ExtensionCommand, handler: ExtensionCommandHandler): () => void;
/**
* Dispatches an action through the data store and returns the current state
* once the action is dispatched.
Expand Down Expand Up @@ -4971,7 +4982,17 @@ declare interface Extension {
url: string;
}

declare enum ExtensionRegion {
declare const enum ExtensionCommand {
ReloadCheckout = "RELOAD_CHECKOUT",
ShowLoadingIndicator = "SHOW_LOADING_INDICATOR",
SetIframeStyle = "SET_IFRAME_STYLE"
}

declare type ExtensionCommandHandler = (data: ExtensionOriginEvent) => void;

declare type ExtensionOriginEvent = ReloadCheckoutEvent | ShowLoadingIndicatorEvent | SetIframeStylePayload;

declare const enum ExtensionRegion {
ShippingShippingAddressFormBefore = "shipping.shippingAddressForm.before",
ShippingShippingAddressFormAfter = "shipping.shippingAddressForm.after"
}
Expand Down Expand Up @@ -6953,6 +6974,13 @@ declare interface Region {
name: string;
}

declare interface ReloadCheckoutEvent {
type: ExtensionCommand.ReloadCheckout;
payload: {
extensionId: string;
};
}

/**
* Throw this error if we are unable to make a request to the server. It wraps
* any server response into a JS error object.
Expand Down Expand Up @@ -7007,6 +7035,16 @@ declare interface SepaPlaceHolder_2 {
ibanNumber?: string;
}

declare interface SetIframeStylePayload {
type: ExtensionCommand.ReloadCheckout;
payload: {
extensionId: string;
style: {
[key: string]: string | number | null;
};
};
}

/**
* A set of options that are required to initialize the shipping step of the
* current checkout flow.
Expand Down Expand Up @@ -7065,6 +7103,14 @@ declare interface ShopperCurrency extends StoreCurrency {
isTransactional: boolean;
}

declare interface ShowLoadingIndicatorEvent {
type: ExtensionCommand.ReloadCheckout;
payload: {
extensionId: string;
show: boolean;
};
}

declare interface SignInEmail {
sent_email: string;
expiry: number;
Expand Down
2 changes: 1 addition & 1 deletion dist/checkout-sdk.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/checkout-sdk.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/checkout-sdk.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/checkout-sdk.umd.js.map

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [CheckoutButtonMethodType](enums/CheckoutButtonMethodType.md)
- [CheckoutIncludes](enums/CheckoutIncludes.md)
- [EmbeddedCheckoutEventType](enums/EmbeddedCheckoutEventType.md)
- [ExtensionCommand](enums/ExtensionCommand.md)
- [ExtensionRegion](enums/ExtensionRegion.md)
- [HostedFieldType](enums/HostedFieldType.md)
- [HostedInputEventType](enums/HostedInputEventType.md)
Expand Down Expand Up @@ -325,15 +326,18 @@
- [Promotion](interfaces/Promotion.md)
- [Radius](interfaces/Radius.md)
- [Region](interfaces/Region.md)
- [ReloadCheckoutEvent](interfaces/ReloadCheckoutEvent.md)
- [RequestOptions](interfaces/RequestOptions.md)
- [SearchArea](interfaces/SearchArea.md)
- [SepaPlaceHolder](interfaces/SepaPlaceHolder.md)
- [SepaPlaceHolder_2](interfaces/SepaPlaceHolder_2.md)
- [SetIframeStylePayload](interfaces/SetIframeStylePayload.md)
- [ShippingInitializeOptions](interfaces/ShippingInitializeOptions.md)
- [ShippingOption](interfaces/ShippingOption.md)
- [ShippingRequestOptions](interfaces/ShippingRequestOptions.md)
- [ShopperConfig](interfaces/ShopperConfig.md)
- [ShopperCurrency](interfaces/ShopperCurrency.md)
- [ShowLoadingIndicatorEvent](interfaces/ShowLoadingIndicatorEvent.md)
- [SignInEmail](interfaces/SignInEmail.md)
- [SignInEmailRequestBody](interfaces/SignInEmailRequestBody.md)
- [SpamProtectionOptions](interfaces/SpamProtectionOptions.md)
Expand Down Expand Up @@ -434,6 +438,8 @@
- [ConsignmentsRequestBody](README.md#consignmentsrequestbody)
- [CustomerAddressRequestBody](README.md#customeraddressrequestbody)
- [CustomerInitializeOptions](README.md#customerinitializeoptions)
- [ExtensionCommandHandler](README.md#extensioncommandhandler)
- [ExtensionOriginEvent](README.md#extensionoriginevent)
- [FlashMessageType](README.md#flashmessagetype)
- [FormFieldFieldType](README.md#formfieldfieldtype)
- [FormFieldType](README.md#formfieldtype)
Expand Down Expand Up @@ -600,6 +606,32 @@ ___

___

### ExtensionCommandHandler

Ƭ **ExtensionCommandHandler**: (`data`: [`ExtensionOriginEvent`](README.md#extensionoriginevent)) => `void`

#### Type declaration

▸ (`data`): `void`

##### Parameters

| Name | Type |
| :------ | :------ |
| `data` | [`ExtensionOriginEvent`](README.md#extensionoriginevent) |

##### Returns

`void`

___

### ExtensionOriginEvent

Ƭ **ExtensionOriginEvent**: [`ReloadCheckoutEvent`](interfaces/ReloadCheckoutEvent.md) \| [`ShowLoadingIndicatorEvent`](interfaces/ShowLoadingIndicatorEvent.md) \| [`SetIframeStylePayload`](interfaces/SetIframeStylePayload.md)

___

### FlashMessageType

Ƭ **FlashMessageType**: ``"error"`` \| ``"info"`` \| ``"warning"`` \| ``"success"``
Expand Down
37 changes: 37 additions & 0 deletions docs/classes/CheckoutService.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ retrieve the current checkout state and subscribe to its changes.
- [initializePayment](CheckoutService.md#initializepayment)
- [initializeShipping](CheckoutService.md#initializeshipping)
- [initializeSpamProtection](CheckoutService.md#initializespamprotection)
- [listenExtensionCommand](CheckoutService.md#listenextensioncommand)
- [loadBillingAddressFields](CheckoutService.md#loadbillingaddressfields)
- [loadBillingCountries](CheckoutService.md#loadbillingcountries)
- [loadCheckout](CheckoutService.md#loadcheckout)
Expand Down Expand Up @@ -775,6 +776,42 @@ A promise that resolves to the current state.

___

### listenExtensionCommand

▸ **listenExtensionCommand**(`extensionId`, `command`, `handler`): () => `void`

Manages the command handler for an extension.

**`alpha`**

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `extensionId` | `string` | The ID of the extension sending the command. |
| `command` | [`ExtensionCommand`](../enums/ExtensionCommand.md) | The command to be handled. |
| `handler` | [`ExtensionCommandHandler`](../README.md#extensioncommandhandler) | The handler function for the extension command. |

#### Returns

`fn`

A function that, when called, will deregister the command handler.

▸ (): `void`

Manages the command handler for an extension.

**`alpha`**

##### Returns

`void`

A function that, when called, will deregister the command handler.

___

### loadBillingAddressFields

▸ **loadBillingAddressFields**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/CheckoutSelectors.md)\>
Expand Down
29 changes: 29 additions & 0 deletions docs/enums/ExtensionCommand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[@bigcommerce/checkout-sdk](../README.md) / ExtensionCommand

# Enumeration: ExtensionCommand

## Table of contents

### Enumeration Members

- [ReloadCheckout](ExtensionCommand.md#reloadcheckout)
- [SetIframeStyle](ExtensionCommand.md#setiframestyle)
- [ShowLoadingIndicator](ExtensionCommand.md#showloadingindicator)

## Enumeration Members

### ReloadCheckout

• **ReloadCheckout**

___

### SetIframeStyle

• **SetIframeStyle**

___

### ShowLoadingIndicator

• **ShowLoadingIndicator**
28 changes: 28 additions & 0 deletions docs/interfaces/ReloadCheckoutEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[@bigcommerce/checkout-sdk](../README.md) / ReloadCheckoutEvent

# Interface: ReloadCheckoutEvent

## Table of contents

### Properties

- [payload](ReloadCheckoutEvent.md#payload)
- [type](ReloadCheckoutEvent.md#type)

## Properties

### payload

• **payload**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `extensionId` | `string` |

___

### type

• **type**: [`ReloadCheckout`](../enums/ExtensionCommand.md#reloadcheckout)
29 changes: 29 additions & 0 deletions docs/interfaces/SetIframeStylePayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[@bigcommerce/checkout-sdk](../README.md) / SetIframeStylePayload

# Interface: SetIframeStylePayload

## Table of contents

### Properties

- [payload](SetIframeStylePayload.md#payload)
- [type](SetIframeStylePayload.md#type)

## Properties

### payload

• **payload**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `extensionId` | `string` |
| `style` | `Object` |

___

### type

• **type**: [`ReloadCheckout`](../enums/ExtensionCommand.md#reloadcheckout)
29 changes: 29 additions & 0 deletions docs/interfaces/ShowLoadingIndicatorEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[@bigcommerce/checkout-sdk](../README.md) / ShowLoadingIndicatorEvent

# Interface: ShowLoadingIndicatorEvent

## Table of contents

### Properties

- [payload](ShowLoadingIndicatorEvent.md#payload)
- [type](ShowLoadingIndicatorEvent.md#type)

## Properties

### payload

• **payload**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `extensionId` | `string` |
| `show` | `boolean` |

___

### type

• **type**: [`ReloadCheckout`](../enums/ExtensionCommand.md#reloadcheckout)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bigcommerce/checkout-sdk",
"version": "1.400.0",
"version": "1.401.0",
"description": "BigCommerce Checkout JavaScript SDK",
"license": "MIT",
"main": "dist/checkout-sdk.js",
Expand Down

0 comments on commit 5c5e2e5

Please sign in to comment.