New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/ui-extensions

Package Overview
Dependencies
Maintainers
25
Versions
709
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/ui-extensions - npm Package Compare versions

Comparing version 0.0.0-unstable-20230920161200 to 0.0.0-unstable-20230921121138

36

build/cjs/surfaces/customer-account.js

@@ -6,7 +6,2 @@ 'use strict';

var extension = require('./customer-account/extension.js');
var Card = require('./customer-account/components/Card/Card.js');
var CustomerAccountAction = require('./customer-account/components/CustomerAccountAction/CustomerAccountAction.js');
var PaymentIcon = require('./customer-account/components/PaymentIcon/PaymentIcon.js');
var PolicyModal = require('./customer-account/components/PolicyModal/PolicyModal.js');
var Thumbnail = require('./customer-account/components/Thumbnail/Thumbnail.js');
var Banner = require('./checkout/components/Banner/Banner.js');

@@ -20,4 +15,4 @@ var BlockLayout = require('./checkout/components/BlockLayout/BlockLayout.js');

var ChoiceList = require('./checkout/components/ChoiceList/ChoiceList.js');
var DatePicker = require('./checkout/components/DatePicker/DatePicker.js');
var DateField = require('./checkout/components/DateField/DateField.js');
var DatePicker = require('./checkout/components/DatePicker/DatePicker.js');
var Disclosure = require('./checkout/components/Disclosure/Disclosure.js');

@@ -38,3 +33,9 @@ var Divider = require('./checkout/components/Divider/Divider.js');

var ListItem = require('./checkout/components/ListItem/ListItem.js');
var LoginWithShop = require('./checkout/components/LoginWithShop/LoginWithShop.js');
var Modal = require('./checkout/components/Modal/Modal.js');
var PaymentIcon = require('./checkout/components/PaymentIcon/PaymentIcon.js');
var PhoneField = require('./checkout/components/PhoneField/PhoneField.js');
var Pressable = require('./checkout/components/Pressable/Pressable.js');
var Popover = require('./checkout/components/Popover/Popover.js');
var ScrollView = require('./checkout/components/ScrollView/ScrollView.js');
var Select = require('./checkout/components/Select/Select.js');

@@ -50,7 +51,4 @@ var SkeletonImage = require('./checkout/components/SkeletonImage/SkeletonImage.js');

var TextField = require('./checkout/components/TextField/TextField.js');
var Tooltip = require('./checkout/components/Tooltip/Tooltip.js');
var View = require('./checkout/components/View/View.js');
var Modal = require('./checkout/components/Modal/Modal.js');
var Popover = require('./checkout/components/Popover/Popover.js');
var Tooltip = require('./checkout/components/Tooltip/Tooltip.js');
var ScrollView = require('./checkout/components/ScrollView/ScrollView.js');
var style = require('./checkout/style/style.js');

@@ -62,7 +60,2 @@

exports.extension = extension.extension;
exports.Card = Card.Card;
exports.CustomerAccountAction = CustomerAccountAction.CustomerAccountAction;
exports.PaymentIcon = PaymentIcon.PaymentIcon;
exports.PolicyModal = PolicyModal.PolicyModal;
exports.Thumbnail = Thumbnail.Thumbnail;
exports.Banner = Banner.Banner;

@@ -76,4 +69,4 @@ exports.BlockLayout = BlockLayout.BlockLayout;

exports.ChoiceList = ChoiceList.ChoiceList;
exports.DatePicker = DatePicker.DatePicker;
exports.DateField = DateField.DateField;
exports.DatePicker = DatePicker.DatePicker;
exports.Disclosure = Disclosure.Disclosure;

@@ -94,3 +87,9 @@ exports.Divider = Divider.Divider;

exports.ListItem = ListItem.ListItem;
exports.LoginWithShop = LoginWithShop.LoginWithShop;
exports.Modal = Modal.Modal;
exports.PaymentIcon = PaymentIcon.PaymentIcon;
exports.PhoneField = PhoneField.PhoneField;
exports.Pressable = Pressable.Pressable;
exports.Popover = Popover.Popover;
exports.ScrollView = ScrollView.ScrollView;
exports.Select = Select.Select;

@@ -106,9 +105,6 @@ exports.SkeletonImage = SkeletonImage.SkeletonImage;

exports.TextField = TextField.TextField;
exports.Tooltip = Tooltip.Tooltip;
exports.View = View.View;
exports.Modal = Modal.Modal;
exports.Popover = Popover.Popover;
exports.Tooltip = Tooltip.Tooltip;
exports.ScrollView = ScrollView.ScrollView;
exports.Style = style.Style;
exports.isConditionalStyle = style.isConditionalStyle;
exports.isConditionalStyleWithDefault = style.isConditionalStyleWithDefault;

@@ -5,5 +5,5 @@ export * from './customer-account/targets';

export * from './customer-account/api';
export * from './customer-account/components';
export * from './checkout/components';
export * from './checkout/shared';
export * from './checkout/style';
//# sourceMappingURL=customer-account.d.ts.map

@@ -1,5 +0,4 @@

export type { CartCost, CartLineCost, CheckoutSettings, Customer, ExtensionSettings, Merchandise, ImageDetails, Product, ProductVariant, SelectedOption, SessionToken, Money, Shop, Version, Metafield, AppMetafield, AppMetafieldEntryTarget, AppMetafieldEntry, CartLine, PaymentOption, SelectedPaymentOption, CartDiscountCode, CartDiscountAllocation, CartCodeDiscountAllocation, CartAutomaticDiscountAllocation, CartCustomDiscountAllocation, AppliedGiftCard, Currency, Country, Market, DeliveryGroup, DeliveryGroupType, CartLineReference, DeliveryOptionReference, DeliveryOption, ShippingOption, PickupLocationOption, PickupPointOption, NumberRange, Order, OrderStatusApi, OrderStatusCompany, OrderStatusLocalization, OrderStatusPurchasingCompany, OrderStatusBuyerIdentity, } from './api/order-status/order-status';
export type { Attribute, CurrencyCode, CountryCode, Timezone, GraphQLError, SellingPlan, StorefrontApiVersion, MailingAddress, ApiVersion, Capability, Editor, Extension, I18nTranslate, I18n, Language, Storage, } from './api/shared';
export type { ApiVersion, BuyerIdentity, Capability, CartCost, CartLineCost, CheckoutSettings, Customer, Editor, Extension, ExtensionSettings, Merchandise, ImageDetails, Product, ProductVariant, PurchasingCompany, SelectedOption, SessionToken, Money, Storage, Shop, Version, Metafield, AppMetafield, AppMetafieldEntryTarget, AppMetafieldEntry, CartLine, PaymentOption, SelectedPaymentOption, CartDiscountCode, CartDiscountAllocation, CartCodeDiscountAllocation, CartAutomaticDiscountAllocation, CartCustomDiscountAllocation, AppliedGiftCard, I18n, I18nTranslate, Currency, Country, Market, Language, Localization, DeliveryGroup, DeliveryGroupType, CartLineReference, DeliveryOptionReference, DeliveryOption, ShippingOption, PickupLocationOption, PickupPointOption, NumberRange, Order, OrderStatusApi, } from './api/order-status/order-status';
export type { Attribute, CurrencyCode, CountryCode, Timezone, GraphQLError, SellingPlan, StorefrontApiVersion, MailingAddress, } from './api/shared';
export type { CartLineItemApi } from './api/cart-line/cart-line-item';
export type { RendererVersion, StandardApi, FullExtensionNavigation, StandardExtensionNavigation, NavigationCurrentEntryChangeEvent, NavigationHistoryEntry, NavigationOptions, NavigationType, NavigateFunction, BuyerIdentity, PurchasingCompany, Company, Localization, } from './api/standard-api/standard-api';
//# sourceMappingURL=api.d.ts.map
import type { StatefulRemoteSubscribable } from '@remote-ui/async-subscription';
import type { CurrencyCode, CountryCode, Timezone, GraphQLError, StorefrontApiVersion, SellingPlan, Attribute, MailingAddress, I18n, Language, Storage } from '../shared';
import type { CurrencyCode, CountryCode, Timezone, GraphQLError, StorefrontApiVersion, SellingPlan, Attribute, MailingAddress } from '../shared';
import type { ExtensionTarget } from '../../targets';
import { Extension } from '../shared';
import { ApiVersion } from '../../../../shared';
/**
* A key-value storage object for extension targets.
*
* Stored data is only available to this specific app
* at this specific extension target.
*
* The storage backend is implemented with `localStorage` and
* should persist across the buyer's checkout session.
* However, data persistence isn't guaranteed.
*/
export interface Storage {
/**
* Read and return a stored value by key.
*
* The stored data is deserialized from JSON and returned as
* its original primitive.
*
* Returns `null` if no stored data exists.
*/
read<T = unknown>(key: string): Promise<T | null>;
/**
* Write stored data for this key.
*
* The data must be serializable to JSON.
*/
write(key: string, data: any): Promise<void>;
/**
* Delete stored data by key.
*/
delete(key: string): Promise<void>;
}
/**
* The capabilities an extension has access to.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
export type Capability = 'api_access' | 'network_access' | 'block_progress';
/**
* Meta information about an extension target.
*/
export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The API version that was set in the extension config file.
*
* @example '2023-04', '2023-07'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.ui.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
capabilities: StatefulRemoteSubscribable<Capability[]>;
/**
* Information about the editor where the extension is being rendered.
*
* The value is undefined if the extension is not rendering in an editor.
*/
editor?: Editor;
/**
* Whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the buyer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the buyer navigates back.
*/
rendered: StatefulRemoteSubscribable<boolean>;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'customer-account.order-status.block.render'
* @see https://shopify.dev/docs/api/checkout-ui-extensions/unstable/extension-targets-overview
* @see https://shopify.dev/docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
export interface Editor {
/**
* Indicates whether the extension is rendering in the checkout editor.
*/
type: 'checkout';
}
/**
* Metadata associated with the checkout.

@@ -81,4 +190,71 @@ */

}
export type ApiVersion = '2023-04' | '2023-07' | 'unstable';
export type { ApiVersion } from '../../../../shared';
export type Version = string;
/**
* This returns a translated string matching a key in a locale file.
*
* @example translate("banner.title")
*/
export type I18nTranslate<ReplacementType = string> = (key: string, options?: {
[placeholderKey: string]: ReplacementType | string | number;
}) => ReplacementType extends string | number ? string : (string | ReplacementType)[];
export interface I18n {
/**
* Returns a localized number.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `decimal` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatNumber: (number: number | bigint, options?: {
inExtensionLocale?: boolean;
} & Intl.NumberFormatOptions) => string;
/**
* Returns a localized currency value.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `currency` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatCurrency: (number: number | bigint, options?: {
inExtensionLocale?: boolean;
} & Intl.NumberFormatOptions) => string;
/**
* Returns a localized date value.
*
* This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses
* the buyer's locale by default. Formatting options can be passed in as
* options.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatDate: (date: Date, options?: {
inExtensionLocale?: boolean;
} & Intl.DateTimeFormatOptions) => string;
/**
* Returns translated content in the buyer's locale,
* as supported by the extension.
*
* - `options.count` is a special numeric value used in pluralization.
* - The other option keys and values are treated as replacements for interpolation.
* - If the replacements are all primitives, then `translate()` returns a single string.
* - If replacements contain UI components, then `translate()` returns an array of elements.
*/
translate: I18nTranslate;
}
export interface Language {
/**
* The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
*
* @example 'en' for English, or 'en-US' for English local to United States.
* @see https://en.wikipedia.org/wiki/IETF_language_tag
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
isoCode: string;
}
export interface Currency {

@@ -108,3 +284,3 @@ /**

}
export interface OrderStatusLocalization {
export interface Localization {
/**

@@ -177,3 +353,3 @@ * The currency that the buyer sees for money amounts in the checkout.

*/
buyerIdentity?: OrderStatusBuyerIdentity;
buyerIdentity?: BuyerIdentity;
/**

@@ -230,3 +406,3 @@ * Settings applied to the buyer's checkout.

*/
localization: OrderStatusLocalization;
localization: Localization;
/**

@@ -329,3 +505,3 @@ * The metafields that apply to the current order. The actual resource

}
export interface OrderStatusBuyerIdentity {
export interface BuyerIdentity {
/**

@@ -359,3 +535,3 @@ * The buyer's customer account. The value is undefined if the buyer isn’t a

*/
purchasingCompany: StatefulRemoteSubscribable<OrderStatusPurchasingCompany | undefined>;
purchasingCompany: StatefulRemoteSubscribable<PurchasingCompany | undefined>;
}

@@ -365,3 +541,3 @@ /**

*/
export interface OrderStatusPurchasingCompany {
export interface PurchasingCompany {
/**

@@ -372,3 +548,3 @@ * Includes information of the company that the business customer is purchasing on behalf of.

*/
company: OrderStatusCompany;
company: Company;
/**

@@ -379,5 +555,5 @@ * Includes information of the company location that the business customer is purchasing on behalf of.

*/
location: OrderStatusCompanyLocation;
location: CompanyLocation;
}
export interface OrderStatusCompany {
export interface Company {
/**

@@ -402,3 +578,3 @@ * The company ID.

}
export interface OrderStatusCompanyLocation {
export interface CompanyLocation {
/**

@@ -458,19 +634,2 @@ * The company location ID.

/**
* A `Money` value representing the subtotal value of the items in the cart at the current
* step of checkout.
*/
subtotalAmount: StatefulRemoteSubscribable<Money>;
/**
* A `Money` value representing the total shipping a buyer can expect to pay at the current
* step of checkout. This value includes shipping discounts. Returns undefined if shipping
* has not been negotiated yet, such as on the information step.
*/
totalShippingAmount: StatefulRemoteSubscribable<Money | undefined>;
/**
* A `Money` value representing the total tax a buyer can expect to pay at the current
* step of checkout or the total tax included in product and shipping prices. Returns
* undefined if taxes are unavailable.
*/
totalTaxAmount: StatefulRemoteSubscribable<Money | undefined>;
/**
* A `Money` value representing the minimum a buyer can expect to pay at the current

@@ -1064,3 +1223,2 @@ * step of checkout. This value excludes amounts yet to be negotiated. For example,

}
export {};
//# sourceMappingURL=order-status.d.ts.map

@@ -1,186 +0,1 @@

import type { ExtensionTarget } from '../targets';
import type { StatefulRemoteSubscribable } from '@remote-ui/async-subscription';
import { ApiVersion } from '../../../shared';
/**
* A key-value storage object for extension targets.
*
* Stored data is only available to this specific app
* but can be shared across multiple extension targets.
*
* The storage backend is implemented with `localStorage` and
* should persist for ... days
* However, data persistence isn't guaranteed.
*/
export interface Storage {
/**
* Read and return a stored value by key.
*
* The stored data is deserialized from JSON and returned as
* its original primitive.
*
* Returns `null` if no stored data exists.
*/
read<T = unknown>(key: string): Promise<T | null>;
/**
* Write stored data for this key.
*
* The data must be serializable to JSON.
*/
write(key: string, data: any): Promise<void>;
/**
* Delete stored data by key.
*/
delete(key: string): Promise<void>;
}
export interface Language {
/**
* The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
*
* @example 'en' for English, or 'en-US' for English local to United States.
* @see https://en.wikipedia.org/wiki/IETF_language_tag
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
isoCode: string;
}
/**
* This defines the i18n.translate() signature.
*/
export interface I18nTranslate {
/**
* This returns a translated string matching a key in a locale file.
*
* @example translate("banner.title")
*/
<ReplacementType = string>(key: string, options?: {
[placeholderKey: string]: ReplacementType | string | number;
}): ReplacementType extends string | number ? string : (string | ReplacementType)[];
}
export interface I18n {
/**
* Returns a localized number.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `decimal` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatNumber: (number: number | bigint, options?: {
inExtensionLocale?: boolean;
} & Intl.NumberFormatOptions) => string;
/**
* Returns a localized currency value.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `currency` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatCurrency: (number: number | bigint, options?: {
inExtensionLocale?: boolean;
} & Intl.NumberFormatOptions) => string;
/**
* Returns a localized date value.
*
* This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses
* the buyer's locale by default. Formatting options can be passed in as
* options.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatDate: (date: Date, options?: {
inExtensionLocale?: boolean;
} & Intl.DateTimeFormatOptions) => string;
/**
* Returns translated content in the buyer's locale,
* as supported by the extension.
*
* - `options.count` is a special numeric value used in pluralization.
* - The other option keys and values are treated as replacements for interpolation.
* - If the replacements are all primitives, then `translate()` returns a single string.
* - If replacements contain UI components, then `translate()` returns an array of elements.
*/
translate: I18nTranslate;
}
/**
* The capabilities an extension has access to.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
export type Capability = 'api_access' | 'network_access' | 'block_progress';
/**
* Meta information about an extension target.
*/
export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The API version that was set in the extension config file.
*
* @example '2023-04', '2023-07'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.ui.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
capabilities: StatefulRemoteSubscribable<Capability[]>;
/**
* Information about the editor where the extension is being rendered.
*
* The value is undefined if the extension is not rendering in an editor.
*/
editor?: Editor;
/**
* Whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the buyer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the buyer navigates back.
*/
rendered: StatefulRemoteSubscribable<boolean>;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'customer-account.order-status.block.render'
* @see https://shopify.dev/docs/api/checkout-ui-extensions/unstable/extension-targets-overview
* @see https://shopify.dev/docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
export interface Editor {
/**
* Indicates whether the extension is rendering in the checkout editor.
*/
type: 'checkout';
}
export type { ApiVersion } from '../../../shared';
export type ValueOrPromise<T> = T extends PromiseLike<any> ? T : T | Promise<T>;

@@ -187,0 +2,0 @@ export type CurrencyCode = 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL';

@@ -16,5 +16,2 @@ import type { ExtensionTargets } from './targets';

export declare const extend: import("../../utilities/registration").ExtensionRegistrationFunctionWithRoot<ExtensionTargets>;
export interface RunExtension<Api, Return> {
(api: Api): Promise<Return>;
}
//# sourceMappingURL=extension.d.ts.map

@@ -1,9 +0,5 @@

import { StatefulRemoteSubscribable } from '@remote-ui/async-subscription';
import { AnyComponent } from '../checkout';
import { CartLineItemApi } from './api/cart-line/cart-line-item';
import type { OrderStatusApi } from './api/order-status/order-status';
import type { RenderExtension, RunExtension } from './extension';
import { StandardApi, FullExtensionNavigation } from './api/standard-api/standard-api';
type Components = typeof import('./components');
type AllComponents = Components[keyof Components];
import type { RenderExtension } from './extension';
/**

@@ -17,5 +13,3 @@ * A UI extension will register for one or more extension targets using `shopify.extend()`.

*/
export type ExtensionTargets = OrderStatusExtensionTargets & CustomerAccountExtensionTargets;
export type ExtensionTarget = keyof ExtensionTargets;
export interface OrderStatusExtensionTargets {
export interface ExtensionTargets {
/**

@@ -39,4 +33,2 @@ * A [dynamic extension target](https://shopify.dev/docs/api/checkout-ui-extensions/extension-targets-overview#dynamic-extension-targets) that renders exclusively on the Order Status Page.

'customer-account.order-status.cart-line-list.render-after': RenderExtension<OrderStatusApi<'customer-account.order-status.cart-line-list.render-after'>, AnyComponent>;
'customer-account.order-status.delivery-details.render-after': RenderExtension<OrderStatusApi<'customer-account.order-status.delivery-details.render-after'>, AnyComponent>;
'customer-account.order-status.payment-details.render-after': RenderExtension<OrderStatusApi<'customer-account.order-status.payment-details.render-after'>, AnyComponent>;
/**

@@ -47,39 +39,3 @@ * A static extension target that is rendered after a purchase below the customer information on the Order Status page.

}
export type OrderStatusExtensionTarget = keyof OrderStatusExtensionTargets;
export interface CustomerAccountExtensionTargets {
'CustomerAccount::FullPage::RenderWithin': RenderExtension<Omit<StandardApi<'CustomerAccount::FullPage::RenderWithin'>, 'navigation'> & FullPageApi, AllComponents>;
'customer-account.page.render': RenderExtension<Omit<StandardApi<'customer-account.page.render'>, 'navigation'> & FullPageApi, AllComponents>;
'CustomerAccount::Returns::Initiate': RunExtension<StandardApi<'CustomerAccount::Returns::Initiate'> & {
orderId: string;
}, void>;
'CustomerAccount::KitchenSink': RenderExtension<StandardApi<'CustomerAccount::KitchenSink'> & {
name: string;
}, AllComponents>;
'CustomerAccount::KitchenSinkRun': RunExtension<StandardApi<'CustomerAccount::KitchenSinkRun'> & {
name: string;
}, string>;
'customer-account.dynamic.render': RenderExtension<StandardApi<'customer-account.dynamic.render'>, AllComponents>;
'customer-account.order-index.block.render': RenderExtension<StandardApi<'customer-account.order-index.block.render'>, AllComponents>;
'customer-account.profile.block.render': RenderExtension<StandardApi<'customer-account.profile.block.render'>, AllComponents>;
'customer-account.profile.addresses.render-after': RenderExtension<StandardApi<'customer-account.profile.addresses.render-after'>, AllComponents>;
'customer-account.profile.payment.render-after': RenderExtension<StandardApi<'customer-account.profile.payment.render-after'>, AllComponents>;
'customer-account.profile.company-details.render-after': RenderExtension<StandardApi<'customer-account.profile.company-details.render-after'>, AllComponents>;
'customer-account.profile.company-location-addresses.render-after': RenderExtension<StandardApi<'customer-account.profile.company-location-addresses.render-after'> & {
locationId: string;
}, AllComponents>;
'customer-account.profile.company-location-payment.render-after': RenderExtension<StandardApi<'customer-account.profile.company-location-payment.render-after'> & {
locationId: string;
}, AllComponents>;
'customer-account.profile.company-location-staff.render-after': RenderExtension<StandardApi<'customer-account.profile.company-location-staff.render-after'> & {
locationId: string;
}, AllComponents>;
'customer-account.order-status.action.menu-item.render': RenderExtension<StandardApi & {
orderId: string;
}, AllComponents>;
'customer-account.order-status.action.render': RenderExtension<StandardApi & ActionExtensionApi & {
orderId: string;
}, AllComponents>;
'customer-account.navigation.menu-item.render': RenderExtension<StandardApi<'customer-account.navigation.menu-item.render'>, AllComponents>;
}
export type CustomerAccountExtensionTarget = keyof CustomerAccountExtensionTargets;
export type ExtensionTarget = keyof ExtensionTargets;
/**

@@ -105,20 +61,2 @@ * For a given extension target, returns the value that is expected to be

/**
* A union type containing the extension targets on order status page that follow the pattern of
* accepting a [`@remote-ui/core` `RemoteRoot`](https://github.com/Shopify/remote-ui/tree/main/packages/core)
* and an additional `api` argument, and using those arguments to render
* UI.
*/
export type RenderOrderStatusExtensionTarget = {
[Target in keyof OrderStatusExtensionTargets]: OrderStatusExtensionTargets[Target] extends RenderExtension<any, any> ? Target : never;
}[keyof OrderStatusExtensionTargets];
/**
* A union type containing the extension targets on customer account except order status page that follow the pattern of
* accepting a [`@remote-ui/core` `RemoteRoot`](https://github.com/Shopify/remote-ui/tree/main/packages/core)
* and an additional `api` argument, and using those arguments to render
* UI.
*/
export type RenderCustomerAccountExtensionTarget = {
[Target in keyof CustomerAccountExtensionTargets]: CustomerAccountExtensionTargets[Target] extends RenderExtension<any, any> ? Target : never;
}[keyof CustomerAccountExtensionTargets];
/**
* A mapping of each “render extension” name to its callback type.

@@ -143,28 +81,3 @@ */

export type AllowedComponentsForRenderExtension<Target extends keyof RenderExtensions> = ExtractedAllowedComponentsFromRenderExtension<RenderExtensions[Target]>;
export interface FullPageApi {
location: StatefulRemoteSubscribable<{
pathname: string;
search: string;
}>;
navigation: FullExtensionNavigation;
}
export interface ActionExtensionApi {
close(): void;
}
/**
* For a given extension target, returns the type of the API that the
* extension will receive at runtime.
*/
export type ApiForExtension<Target extends keyof ExtensionTargets> = ExtractedApiFromExtension<ExtensionTargets[Target]>;
type ExtractedApiFromRunExtension<T> = T extends RunExtension<infer Api, unknown> ? Api : never;
type ExtractedApiFromExtension<T> = T extends RenderExtension<any, any> ? ExtractedApiFromRenderExtension<T> : T extends RunExtension<any, any> ? ExtractedApiFromRunExtension<T> : never;
/**
* A union type containing all extension targets that follow the pattern of
* accepting an `api` argument, and using those arguments to run code that does not render anything, but instead return
* a value or execute a side effect.
*/
export type RunExtensionTarget = {
[Target in keyof ExtensionTargets]: ExtensionTargets[Target] extends RunExtension<any, any> ? Target : never;
}[keyof ExtensionTargets];
export {};
//# sourceMappingURL=targets.d.ts.map
{
"name": "@shopify/ui-extensions",
"version": "0.0.0-unstable-20230920161200",
"version": "0.0.0-unstable-20230921121138",
"scripts": {

@@ -5,0 +5,0 @@ "docs:admin": "sh ./docs/surfaces/admin/build-docs.sh \"admin\"",

@@ -5,5 +5,5 @@ export * from './customer-account/targets';

export * from './customer-account/api';
export * from './customer-account/components';
export * from './checkout/components';
export * from './checkout/shared';
export * from './checkout/style';
export type {
ApiVersion,
BuyerIdentity,
Capability,
CartCost,

@@ -6,2 +9,4 @@ CartLineCost,

Customer,
Editor,
Extension,
ExtensionSettings,

@@ -12,5 +17,7 @@ Merchandise,

ProductVariant,
PurchasingCompany,
SelectedOption,
SessionToken,
Money,
Storage,
Shop,

@@ -31,5 +38,9 @@ Version,

AppliedGiftCard,
I18n,
I18nTranslate,
Currency,
Country,
Market,
Language,
Localization,
DeliveryGroup,

@@ -46,6 +57,2 @@ DeliveryGroupType,

OrderStatusApi,
OrderStatusCompany,
OrderStatusLocalization,
OrderStatusPurchasingCompany,
OrderStatusBuyerIdentity,
} from './api/order-status/order-status';

@@ -61,28 +68,4 @@ export type {

MailingAddress,
ApiVersion,
Capability,
Editor,
Extension,
I18nTranslate,
I18n,
Language,
Storage,
} from './api/shared';
export type {CartLineItemApi} from './api/cart-line/cart-line-item';
export type {
RendererVersion,
StandardApi,
FullExtensionNavigation,
StandardExtensionNavigation,
NavigationCurrentEntryChangeEvent,
NavigationHistoryEntry,
NavigationOptions,
NavigationType,
NavigateFunction,
BuyerIdentity,
PurchasingCompany,
Company,
Localization,
} from './api/standard-api/standard-api';

@@ -12,10 +12,128 @@ import type {StatefulRemoteSubscribable} from '@remote-ui/async-subscription';

MailingAddress,
I18n,
Language,
Storage,
} from '../shared';
import type {ExtensionTarget} from '../../targets';
import {Extension} from '../shared';
import {ApiVersion} from '../../../../shared';
/**
* A key-value storage object for extension targets.
*
* Stored data is only available to this specific app
* at this specific extension target.
*
* The storage backend is implemented with `localStorage` and
* should persist across the buyer's checkout session.
* However, data persistence isn't guaranteed.
*/
export interface Storage {
/**
* Read and return a stored value by key.
*
* The stored data is deserialized from JSON and returned as
* its original primitive.
*
* Returns `null` if no stored data exists.
*/
read<T = unknown>(key: string): Promise<T | null>;
/**
* Write stored data for this key.
*
* The data must be serializable to JSON.
*/
write(key: string, data: any): Promise<void>;
/**
* Delete stored data by key.
*/
delete(key: string): Promise<void>;
}
/**
* The capabilities an extension has access to.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
export type Capability = 'api_access' | 'network_access' | 'block_progress';
/**
* Meta information about an extension target.
*/
export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The API version that was set in the extension config file.
*
* @example '2023-04', '2023-07'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.ui.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
capabilities: StatefulRemoteSubscribable<Capability[]>;
/**
* Information about the editor where the extension is being rendered.
*
* The value is undefined if the extension is not rendering in an editor.
*/
editor?: Editor;
/**
* Whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the buyer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the buyer navigates back.
*/
rendered: StatefulRemoteSubscribable<boolean>;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'customer-account.order-status.block.render'
* @see https://shopify.dev/docs/api/checkout-ui-extensions/unstable/extension-targets-overview
* @see https://shopify.dev/docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
export interface Editor {
/**
* Indicates whether the extension is rendering in the checkout editor.
*/
type: 'checkout';
}
/**
* Metadata associated with the checkout.

@@ -120,6 +238,85 @@ */

export type ApiVersion = '2023-04' | '2023-07' | 'unstable';
export type {ApiVersion} from '../../../../shared';
export type Version = string;
/**
* This returns a translated string matching a key in a locale file.
*
* @example translate("banner.title")
*/
export type I18nTranslate<ReplacementType = string> = (
key: string,
options?: {[placeholderKey: string]: ReplacementType | string | number},
) => ReplacementType extends string | number
? string
: (string | ReplacementType)[];
export interface I18n {
/**
* Returns a localized number.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `decimal` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatNumber: (
number: number | bigint,
options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions,
) => string;
/**
* Returns a localized currency value.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `currency` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatCurrency: (
number: number | bigint,
options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions,
) => string;
/**
* Returns a localized date value.
*
* This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses
* the buyer's locale by default. Formatting options can be passed in as
* options.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatDate: (
date: Date,
options?: {inExtensionLocale?: boolean} & Intl.DateTimeFormatOptions,
) => string;
/**
* Returns translated content in the buyer's locale,
* as supported by the extension.
*
* - `options.count` is a special numeric value used in pluralization.
* - The other option keys and values are treated as replacements for interpolation.
* - If the replacements are all primitives, then `translate()` returns a single string.
* - If replacements contain UI components, then `translate()` returns an array of elements.
*/
translate: I18nTranslate;
}
export interface Language {
/**
* The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
*
* @example 'en' for English, or 'en-US' for English local to United States.
* @see https://en.wikipedia.org/wiki/IETF_language_tag
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
isoCode: string;
}
export interface Currency {

@@ -153,3 +350,3 @@ /**

export interface OrderStatusLocalization {
export interface Localization {
/**

@@ -232,3 +429,3 @@ * The currency that the buyer sees for money amounts in the checkout.

*/
buyerIdentity?: OrderStatusBuyerIdentity;
buyerIdentity?: BuyerIdentity;

@@ -294,3 +491,3 @@ /**

*/
localization: OrderStatusLocalization;
localization: Localization;

@@ -402,3 +599,3 @@ /**

export interface OrderStatusBuyerIdentity {
export interface BuyerIdentity {
/**

@@ -435,5 +632,3 @@ * The buyer's customer account. The value is undefined if the buyer isn’t a

*/
purchasingCompany: StatefulRemoteSubscribable<
OrderStatusPurchasingCompany | undefined
>;
purchasingCompany: StatefulRemoteSubscribable<PurchasingCompany | undefined>;
}

@@ -444,3 +639,3 @@

*/
export interface OrderStatusPurchasingCompany {
export interface PurchasingCompany {
/**

@@ -451,3 +646,3 @@ * Includes information of the company that the business customer is purchasing on behalf of.

*/
company: OrderStatusCompany;
company: Company;
/**

@@ -458,6 +653,6 @@ * Includes information of the company location that the business customer is purchasing on behalf of.

*/
location: OrderStatusCompanyLocation;
location: CompanyLocation;
}
export interface OrderStatusCompany {
export interface Company {
/**

@@ -483,3 +678,3 @@ * The company ID.

export interface OrderStatusCompanyLocation {
export interface CompanyLocation {
/**

@@ -544,22 +739,2 @@ * The company location ID.

/**
* A `Money` value representing the subtotal value of the items in the cart at the current
* step of checkout.
*/
subtotalAmount: StatefulRemoteSubscribable<Money>;
/**
* A `Money` value representing the total shipping a buyer can expect to pay at the current
* step of checkout. This value includes shipping discounts. Returns undefined if shipping
* has not been negotiated yet, such as on the information step.
*/
totalShippingAmount: StatefulRemoteSubscribable<Money | undefined>;
/**
* A `Money` value representing the total tax a buyer can expect to pay at the current
* step of checkout or the total tax included in product and shipping prices. Returns
* undefined if taxes are unavailable.
*/
totalTaxAmount: StatefulRemoteSubscribable<Money | undefined>;
/**
* A `Money` value representing the minimum a buyer can expect to pay at the current

@@ -566,0 +741,0 @@ * step of checkout. This value excludes amounts yet to be negotiated. For example,

@@ -1,212 +0,1 @@

import type {ExtensionTarget} from '../targets';
import type {StatefulRemoteSubscribable} from '@remote-ui/async-subscription';
import {ApiVersion} from '../../../shared';
/**
* A key-value storage object for extension targets.
*
* Stored data is only available to this specific app
* but can be shared across multiple extension targets.
*
* The storage backend is implemented with `localStorage` and
* should persist for ... days
* However, data persistence isn't guaranteed.
*/
export interface Storage {
/**
* Read and return a stored value by key.
*
* The stored data is deserialized from JSON and returned as
* its original primitive.
*
* Returns `null` if no stored data exists.
*/
read<T = unknown>(key: string): Promise<T | null>;
/**
* Write stored data for this key.
*
* The data must be serializable to JSON.
*/
write(key: string, data: any): Promise<void>;
/**
* Delete stored data by key.
*/
delete(key: string): Promise<void>;
}
export interface Language {
/**
* The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
*
* @example 'en' for English, or 'en-US' for English local to United States.
* @see https://en.wikipedia.org/wiki/IETF_language_tag
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
isoCode: string;
}
/**
* This defines the i18n.translate() signature.
*/
export interface I18nTranslate {
/**
* This returns a translated string matching a key in a locale file.
*
* @example translate("banner.title")
*/
<ReplacementType = string>(
key: string,
options?: {[placeholderKey: string]: ReplacementType | string | number},
): ReplacementType extends string | number
? string
: (string | ReplacementType)[];
}
export interface I18n {
/**
* Returns a localized number.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `decimal` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatNumber: (
number: number | bigint,
options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions,
) => string;
/**
* Returns a localized currency value.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `currency` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatCurrency: (
number: number | bigint,
options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions,
) => string;
/**
* Returns a localized date value.
*
* This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses
* the buyer's locale by default. Formatting options can be passed in as
* options.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatDate: (
date: Date,
options?: {inExtensionLocale?: boolean} & Intl.DateTimeFormatOptions,
) => string;
/**
* Returns translated content in the buyer's locale,
* as supported by the extension.
*
* - `options.count` is a special numeric value used in pluralization.
* - The other option keys and values are treated as replacements for interpolation.
* - If the replacements are all primitives, then `translate()` returns a single string.
* - If replacements contain UI components, then `translate()` returns an array of elements.
*/
translate: I18nTranslate;
}
/**
* The capabilities an extension has access to.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
export type Capability = 'api_access' | 'network_access' | 'block_progress';
/**
* Meta information about an extension target.
*/
export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The API version that was set in the extension config file.
*
* @example '2023-04', '2023-07'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.ui.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
*/
capabilities: StatefulRemoteSubscribable<Capability[]>;
/**
* Information about the editor where the extension is being rendered.
*
* The value is undefined if the extension is not rendering in an editor.
*/
editor?: Editor;
/**
* Whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the buyer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the buyer navigates back.
*/
rendered: StatefulRemoteSubscribable<boolean>;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'customer-account.order-status.block.render'
* @see https://shopify.dev/docs/api/checkout-ui-extensions/unstable/extension-targets-overview
* @see https://shopify.dev/docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
export interface Editor {
/**
* Indicates whether the extension is rendering in the checkout editor.
*/
type: 'checkout';
}
export type {ApiVersion} from '../../../shared';
export type ValueOrPromise<T> = T extends PromiseLike<any> ? T : T | Promise<T>;

@@ -213,0 +2,0 @@

@@ -22,5 +22,1 @@ import {createExtensionRegistrationFunction} from '../../utilities/registration';

export const extend = extension;
export interface RunExtension<Api, Return> {
(api: Api): Promise<Return>;
}

@@ -1,2 +0,1 @@

import {StatefulRemoteSubscribable} from '@remote-ui/async-subscription';
import {AnyComponent} from '../checkout';

@@ -6,12 +5,4 @@

import type {OrderStatusApi} from './api/order-status/order-status';
import type {RenderExtension, RunExtension} from './extension';
import {
StandardApi,
FullExtensionNavigation,
} from './api/standard-api/standard-api';
import type {RenderExtension} from './extension';
type Components = typeof import('./components');
type AllComponents = Components[keyof Components];
/**

@@ -25,7 +16,3 @@ * A UI extension will register for one or more extension targets using `shopify.extend()`.

*/
export type ExtensionTargets = OrderStatusExtensionTargets &
CustomerAccountExtensionTargets;
export type ExtensionTarget = keyof ExtensionTargets;
export interface OrderStatusExtensionTargets {
export interface ExtensionTargets {
/**

@@ -59,10 +46,2 @@ * A [dynamic extension target](https://shopify.dev/docs/api/checkout-ui-extensions/extension-targets-overview#dynamic-extension-targets) that renders exclusively on the Order Status Page.

>;
'customer-account.order-status.delivery-details.render-after': RenderExtension<
OrderStatusApi<'customer-account.order-status.delivery-details.render-after'>,
AnyComponent
>;
'customer-account.order-status.payment-details.render-after': RenderExtension<
OrderStatusApi<'customer-account.order-status.payment-details.render-after'>,
AnyComponent
>;
/**

@@ -76,86 +55,5 @@ * A static extension target that is rendered after a purchase below the customer information on the Order Status page.

}
export type OrderStatusExtensionTarget = keyof OrderStatusExtensionTargets;
export interface CustomerAccountExtensionTargets {
'CustomerAccount::FullPage::RenderWithin': RenderExtension<
Omit<StandardApi<'CustomerAccount::FullPage::RenderWithin'>, 'navigation'> &
FullPageApi,
AllComponents
>;
'customer-account.page.render': RenderExtension<
Omit<StandardApi<'customer-account.page.render'>, 'navigation'> &
FullPageApi,
AllComponents
>;
'CustomerAccount::Returns::Initiate': RunExtension<
StandardApi<'CustomerAccount::Returns::Initiate'> & {orderId: string},
void
>;
'CustomerAccount::KitchenSink': RenderExtension<
StandardApi<'CustomerAccount::KitchenSink'> & {name: string},
AllComponents
>;
'CustomerAccount::KitchenSinkRun': RunExtension<
StandardApi<'CustomerAccount::KitchenSinkRun'> & {name: string},
string
>;
'customer-account.dynamic.render': RenderExtension<
StandardApi<'customer-account.dynamic.render'>,
AllComponents
>;
'customer-account.order-index.block.render': RenderExtension<
StandardApi<'customer-account.order-index.block.render'>,
AllComponents
>;
'customer-account.profile.block.render': RenderExtension<
StandardApi<'customer-account.profile.block.render'>,
AllComponents
>;
'customer-account.profile.addresses.render-after': RenderExtension<
StandardApi<'customer-account.profile.addresses.render-after'>,
AllComponents
>;
'customer-account.profile.payment.render-after': RenderExtension<
StandardApi<'customer-account.profile.payment.render-after'>,
AllComponents
>;
'customer-account.profile.company-details.render-after': RenderExtension<
StandardApi<'customer-account.profile.company-details.render-after'>,
AllComponents
>;
'customer-account.profile.company-location-addresses.render-after': RenderExtension<
StandardApi<'customer-account.profile.company-location-addresses.render-after'> & {
locationId: string;
},
AllComponents
>;
'customer-account.profile.company-location-payment.render-after': RenderExtension<
StandardApi<'customer-account.profile.company-location-payment.render-after'> & {
locationId: string;
},
AllComponents
>;
'customer-account.profile.company-location-staff.render-after': RenderExtension<
StandardApi<'customer-account.profile.company-location-staff.render-after'> & {
locationId: string;
},
AllComponents
>;
'customer-account.order-status.action.menu-item.render': RenderExtension<
StandardApi & {orderId: string},
AllComponents
>;
'customer-account.order-status.action.render': RenderExtension<
StandardApi & ActionExtensionApi & {orderId: string},
AllComponents
>;
'customer-account.navigation.menu-item.render': RenderExtension<
StandardApi<'customer-account.navigation.menu-item.render'>,
AllComponents
>;
}
export type ExtensionTarget = keyof ExtensionTargets;
export type CustomerAccountExtensionTarget =
keyof CustomerAccountExtensionTargets;
/**

@@ -191,32 +89,2 @@ * For a given extension target, returns the value that is expected to be

/**
* A union type containing the extension targets on order status page that follow the pattern of
* accepting a [`@remote-ui/core` `RemoteRoot`](https://github.com/Shopify/remote-ui/tree/main/packages/core)
* and an additional `api` argument, and using those arguments to render
* UI.
*/
export type RenderOrderStatusExtensionTarget = {
[Target in keyof OrderStatusExtensionTargets]: OrderStatusExtensionTargets[Target] extends RenderExtension<
any,
any
>
? Target
: never;
}[keyof OrderStatusExtensionTargets];
/**
* A union type containing the extension targets on customer account except order status page that follow the pattern of
* accepting a [`@remote-ui/core` `RemoteRoot`](https://github.com/Shopify/remote-ui/tree/main/packages/core)
* and an additional `api` argument, and using those arguments to render
* UI.
*/
export type RenderCustomerAccountExtensionTarget = {
[Target in keyof CustomerAccountExtensionTargets]: CustomerAccountExtensionTargets[Target] extends RenderExtension<
any,
any
>
? Target
: never;
}[keyof CustomerAccountExtensionTargets];
/**
* A mapping of each “render extension” name to its callback type.

@@ -254,47 +122,1 @@ */

> = ExtractedAllowedComponentsFromRenderExtension<RenderExtensions[Target]>;
export interface FullPageApi {
location: StatefulRemoteSubscribable<{
pathname: string;
search: string;
}>;
navigation: FullExtensionNavigation;
}
export interface ActionExtensionApi {
close(): void;
}
/**
* For a given extension target, returns the type of the API that the
* extension will receive at runtime.
*/
export type ApiForExtension<Target extends keyof ExtensionTargets> =
ExtractedApiFromExtension<ExtensionTargets[Target]>;
type ExtractedApiFromRunExtension<T> = T extends RunExtension<
infer Api,
unknown
>
? Api
: never;
type ExtractedApiFromExtension<T> = T extends RenderExtension<any, any>
? ExtractedApiFromRenderExtension<T>
: T extends RunExtension<any, any>
? ExtractedApiFromRunExtension<T>
: never;
/**
* A union type containing all extension targets that follow the pattern of
* accepting an `api` argument, and using those arguments to run code that does not render anything, but instead return
* a value or execute a side effect.
*/
export type RunExtensionTarget = {
[Target in keyof ExtensionTargets]: ExtensionTargets[Target] extends RunExtension<
any,
any
>
? Target
: never;
}[keyof ExtensionTargets];

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc