@shopify/ui-extensions 2025.10.0 → 2025.10.2
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/README.md +16 -34
- package/build/ts/surfaces/admin/components/Avatar/Avatar.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Badge/Badge.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Chip/Chip.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Heading/Heading.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Icon/Icon.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Image/Image.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Paragraph/Paragraph.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Text/Text.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Thumbnail/Thumbnail.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/docs-types.d.ts +26 -10
- package/build/ts/surfaces/admin/docs-types.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/standard-api/standard-api.d.ts +1 -1
- package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts +0 -11
- package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/pin-pad-api.d.ts +12 -5
- package/build/ts/surfaces/point-of-sale/api/pin-pad-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/types/pin-pad.d.ts +13 -4
- package/build/ts/surfaces/point-of-sale/types/pin-pad.d.ts.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/surfaces/admin/components/Avatar/examples/basic-usage.html +1 -0
- package/src/surfaces/admin/components/Avatar/examples/color-consistency-demo.html +7 -0
- package/src/surfaces/admin/components/Avatar/examples/default-avatar-no-props.html +1 -0
- package/src/surfaces/admin/components/Avatar/examples/default.html +1 -4
- package/src/surfaces/admin/components/Avatar/examples/error-handling-example.html +6 -0
- package/src/surfaces/admin/components/Avatar/examples/fulfillment-partner-avatars.html +14 -0
- package/src/surfaces/admin/components/Avatar/examples/in-customer-list-context.html +24 -0
- package/src/surfaces/admin/components/Avatar/examples/long-initials-handling.html +5 -0
- package/src/surfaces/admin/components/Avatar/examples/size-variations.html +7 -0
- package/src/surfaces/admin/components/Avatar/examples/staff-member-profiles.html +10 -0
- package/src/surfaces/admin/components/Avatar/examples/with-image-source-and-fallback.html +6 -0
- package/src/surfaces/admin/components/Avatar/examples/with-section-component.html +17 -0
- package/src/surfaces/admin/components/Badge/examples/different-sizes-for-emphasis.html +4 -0
- package/src/surfaces/admin/components/Badge/examples/order-status-badges.html +6 -0
- package/src/surfaces/admin/components/Badge/examples/status-indicators-with-icons.html +15 -0
- package/src/surfaces/admin/components/Badge/examples/within-table-context.html +18 -0
- package/src/surfaces/admin/components/Chip/examples/basic-usage.html +3 -0
- package/src/surfaces/admin/components/Chip/examples/color-variants.html +12 -0
- package/src/surfaces/admin/components/Chip/examples/product-status.html +8 -0
- package/src/surfaces/admin/components/Chip/examples/text-truncation.html +12 -0
- package/src/surfaces/admin/components/Chip/examples/with-icon-graphic.html +4 -0
- package/src/surfaces/admin/components/Heading/examples/basic-heading.html +1 -0
- package/src/surfaces/admin/components/Heading/examples/heading-with-custom-accessibility.html +3 -0
- package/src/surfaces/admin/components/Heading/examples/heading-with-line-clamping.html +5 -0
- package/src/surfaces/admin/components/Heading/examples/heading-within-section-hierarchy.html +12 -0
- package/src/surfaces/admin/components/Icon/examples/basic-usage.html +7 -0
- package/src/surfaces/admin/components/Icon/examples/in-badge-components.html +4 -0
- package/src/surfaces/admin/components/Icon/examples/in-button-components.html +6 -0
- package/src/surfaces/admin/components/Icon/examples/small-size.html +1 -0
- package/src/surfaces/admin/components/Icon/examples/subdued-color.html +1 -0
- package/src/surfaces/admin/components/Icon/examples/with-id-property.html +1 -0
- package/src/surfaces/admin/components/Icon/examples/with-interest-relationship.html +1 -0
- package/src/surfaces/admin/components/Icon/examples/with-semantic-tone.html +6 -0
- package/src/surfaces/admin/components/Image/examples/auto-sized-image.html +5 -0
- package/src/surfaces/admin/components/Image/examples/basic-usage.html +1 -0
- package/src/surfaces/admin/components/Image/examples/decorative-image.html +7 -0
- package/src/surfaces/admin/components/Image/examples/responsive-images-with-srcset.html +9 -0
- package/src/surfaces/admin/components/Image/examples/responsive-layout-with-aspect-ratio.html +7 -0
- package/src/surfaces/admin/components/Image/examples/with-border-styling.html +12 -0
- package/src/surfaces/admin/components/Image/examples/within-layout-components.html +26 -0
- package/src/surfaces/admin/components/Paragraph/examples/admin-ui-patterns.html +21 -0
- package/src/surfaces/admin/components/Paragraph/examples/basic-usage.html +3 -0
- package/src/surfaces/admin/components/Paragraph/examples/line-clamping.html +8 -0
- package/src/surfaces/admin/components/Paragraph/examples/rtl-support.html +1 -0
- package/src/surfaces/admin/components/Paragraph/examples/screen-reader-text.html +3 -0
- package/src/surfaces/admin/components/Paragraph/examples/tabular-numbers.html +3 -0
- package/src/surfaces/admin/components/Paragraph/examples/with-tone-and-color.html +9 -0
- package/src/surfaces/admin/components/Text/examples/accessibility-hidden-text.html +1 -0
- package/src/surfaces/admin/components/Text/examples/basic-usage.html +1 -0
- package/src/surfaces/admin/components/Text/examples/interest-for-association.html +6 -0
- package/src/surfaces/admin/components/Text/examples/right-to-left-text.html +1 -0
- package/src/surfaces/admin/components/Text/examples/semantic-address.html +1 -0
- package/src/surfaces/admin/components/Text/examples/status-tones.html +5 -0
- package/src/surfaces/admin/components/Text/examples/strong-text.html +1 -0
- package/src/surfaces/admin/components/Text/examples/subdued-color.html +1 -0
- package/src/surfaces/admin/components/Text/examples/tabular-numbers.html +1 -0
- package/src/surfaces/admin/components/Thumbnail/examples/basic-usage.html +5 -0
- package/src/surfaces/admin/components/Thumbnail/examples/different-sizes.html +17 -0
- package/src/surfaces/admin/components/Thumbnail/examples/empty-state.html +1 -0
- package/src/surfaces/admin/components/Thumbnail/examples/with-event-handling.html +6 -0
- package/src/surfaces/admin/docs-types.ts +33 -12
- package/src/surfaces/customer-account/api/standard-api/standard-api.ts +1 -1
- package/src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts +0 -18
- package/src/surfaces/point-of-sale/api/pin-pad-api.ts +12 -5
- package/src/surfaces/point-of-sale/types/pin-pad.ts +13 -4
package/README.md
CHANGED
|
@@ -1,42 +1,24 @@
|
|
|
1
1
|
# `@shopify/ui-extensions`
|
|
2
2
|
|
|
3
|
-
This package contains the public type definitions and utilities needed to create
|
|
3
|
+
This package contains the public type definitions and utilities needed to create Shopify UI extensions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package supports the development of UI extension for [Admin](https://shopify.dev/docs/api/admin-extensions), [Customer account](https://shopify.dev/docs/api/customer-account-ui-extensions), [POS](https://shopify.dev/docs/api/pos-ui-extensions), and [Checkout](https://shopify.dev/docs/api/checkout-ui-extensions) surfaces.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
All extensions, regardless of where they appear in Shopify, make use of the same [underlying technology](https://github.com/Shopify/remote-dom), and most of the same “core” components (e.g., `s-block`, `s-button`, `s-text-field`, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
A checkout extension using “vanilla” JavaScript would be written as follows:
|
|
9
|
+
A checkout extension using Preact would be written as follows:
|
|
12
10
|
|
|
13
11
|
```ts
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
value: metafield?.value ?? '',
|
|
27
|
-
onChange(value) {
|
|
28
|
-
textfield.updateProps({value});
|
|
29
|
-
|
|
30
|
-
applyMetafieldChange({
|
|
31
|
-
namespace: 'custom',
|
|
32
|
-
key: 'gift_note',
|
|
33
|
-
value,
|
|
34
|
-
valueType: 'string',
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
root.appendChild(textfield);
|
|
40
|
-
},
|
|
41
|
-
);
|
|
12
|
+
import '@shopify/ui-extensions/preact';
|
|
13
|
+
import {render} from 'preact';
|
|
14
|
+
|
|
15
|
+
export default function extension() {
|
|
16
|
+
render(<Extension />, document.body);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function Extension() {
|
|
20
|
+
return (
|
|
21
|
+
<s-text>Line item title: {shopify.target.value.merchandise.title}</s-text>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
42
24
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Avatar/Avatar.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Avatar.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Avatar/Avatar.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAuLX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Badge/Badge.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Badge.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Badge/Badge.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA2FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Chip/Chip.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Chip.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Chip/Chip.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAuGX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Heading/Heading.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Heading.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Heading/Heading.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAoHX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Icon/Icon.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Icon.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Icon/Icon.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA0IX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Image/Image.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Image.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Image/Image.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAkJX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paragraph.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Paragraph/Paragraph.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Paragraph.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Paragraph/Paragraph.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAqJX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Text/Text.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Text.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Text/Text.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA8KX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thumbnail.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Thumbnail/Thumbnail.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Thumbnail.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Thumbnail/Thumbnail.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA6FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
import { ReferenceEntityTemplateSchema, CodeTabType } from '@shopify/generate-docs';
|
|
2
|
+
import { ReferenceEntityTemplateSchema, CodeTabType, ExampleType, ExampleSectionSchema, ExampleGroupType } from '@shopify/generate-docs';
|
|
3
3
|
type AllowedCSSProperties = Pick<CSSProperties, 'minHeight' | 'minBlockSize'>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
type AdminCodeTabType = CodeTabType & {
|
|
5
|
+
layout?: string;
|
|
6
|
+
customStyles?: AllowedCSSProperties;
|
|
7
|
+
};
|
|
8
|
+
interface CodeLinkType {
|
|
9
|
+
name: string;
|
|
10
|
+
url: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
}
|
|
13
|
+
interface AdminCodeblockType {
|
|
14
|
+
title: string;
|
|
15
|
+
tabs: AdminCodeTabType[];
|
|
16
|
+
links?: CodeLinkType[];
|
|
17
|
+
}
|
|
18
|
+
type AdminExampleType = Omit<ExampleType, 'codeblock'> & {
|
|
19
|
+
codeblock: AdminCodeblockType | AdminCodeblockType[];
|
|
20
|
+
};
|
|
21
|
+
type AdminExampleGroupType = Omit<ExampleGroupType, 'examples'> & {
|
|
22
|
+
examples: AdminExampleType[];
|
|
23
|
+
};
|
|
24
|
+
export interface AdminReferenceEntityTemplateSchema extends Omit<ReferenceEntityTemplateSchema, 'defaultExample' | 'examples'> {
|
|
25
|
+
defaultExample?: AdminExampleType;
|
|
26
|
+
examples?: Omit<ExampleSectionSchema, 'exampleGroups' | 'examples'> & {
|
|
27
|
+
exampleGroups?: AdminExampleGroupType[] | null;
|
|
28
|
+
examples?: AdminExampleType[] | null;
|
|
13
29
|
};
|
|
14
30
|
}
|
|
15
31
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-types.d.ts","sourceRoot":"","sources":["../../../../src/surfaces/admin/docs-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,6BAA6B,EAC7B,WAAW,
|
|
1
|
+
{"version":3,"file":"docs-types.d.ts","sourceRoot":"","sources":["../../../../src/surfaces/admin/docs-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,6BAA6B,EAC7B,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAGhC,KAAK,oBAAoB,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,cAAc,CAAC,CAAC;AAE9E,KAAK,gBAAgB,GAAG,WAAW,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,KAAK,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG;IACvD,SAAS,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;CACtD,CAAC;AAEF,KAAK,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAChE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,6BAA6B,EAAE,gBAAgB,GAAG,UAAU,CAAC;IAC1E,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,eAAe,GAAG,UAAU,CAAC,GAAG;QACpE,aAAa,CAAC,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAC;QAC/C,QAAQ,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;KACtC,CAAC;CACH"}
|
|
@@ -84,7 +84,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
|
|
|
84
84
|
*
|
|
85
85
|
* - Use noun + past tense verb format. For example, \`Changes saved\`.
|
|
86
86
|
*
|
|
87
|
-
* For errors, or information that needs to persist on the page, use a [banner](/docs/api/checkout-ui-extensions/
|
|
87
|
+
* For errors, or information that needs to persist on the page, use a [banner](/docs/api/checkout-ui-extensions/polaris-web-components/feedback/banner) component.
|
|
88
88
|
*/
|
|
89
89
|
toast: ToastApi;
|
|
90
90
|
/**
|
|
@@ -19,15 +19,6 @@ export interface NavigationHistoryEntry {
|
|
|
19
19
|
*/
|
|
20
20
|
getState(): unknown;
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* The NavigationCurrentEntryChangeEvent interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed.
|
|
24
|
-
*/
|
|
25
|
-
export interface NavigationCurrentEntryChangeEvent {
|
|
26
|
-
/**
|
|
27
|
-
* Returns the NavigationHistoryEntry that was navigated from.
|
|
28
|
-
*/
|
|
29
|
-
from: NavigationHistoryEntry;
|
|
30
|
-
}
|
|
31
22
|
export interface Navigation {
|
|
32
23
|
/**
|
|
33
24
|
* The navigate() method navigates to a specific URL, updating any provided state in the history entries list.
|
|
@@ -41,7 +32,5 @@ export interface Navigation {
|
|
|
41
32
|
* The back() method of the Navigation interface navigates to the previous entry in the history list.
|
|
42
33
|
*/
|
|
43
34
|
back(): void;
|
|
44
|
-
addEventListener(type: 'currententrychange', cb: (event: NavigationCurrentEntryChangeEvent) => void): void;
|
|
45
|
-
removeEventListener(type: 'currententrychange', cb: (event: NavigationCurrentEntryChangeEvent) => void): void;
|
|
46
35
|
}
|
|
47
36
|
//# sourceMappingURL=navigation-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,4KAA4K;IAC5K,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"navigation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,4KAA4K;IAC5K,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E;;OAEG;IACH,YAAY,EAAE,sBAAsB,CAAC;IACrC;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;CACd"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { PinPadOptions, PinValidationResult } from '../types/pin-pad';
|
|
2
2
|
export interface PinPadApiContent {
|
|
3
|
-
/** Shows a
|
|
3
|
+
/** Shows a PIN pad to the user in a modal dialog.
|
|
4
|
+
*
|
|
5
|
+
* `onSubmit` is called when the PIN is submitted for validation by the user. The callback
|
|
6
|
+
* should validate the PIN and accept or reject it.
|
|
7
|
+
*
|
|
8
|
+
* If the PIN is accepted, the modal will be dismissed and the `onDismissed` callback
|
|
9
|
+
* (provided via `options`) will be called. It is recommended that any post-validation
|
|
10
|
+
* navigation is performed in this callback rather than in `onSubmit`.
|
|
11
|
+
*
|
|
12
|
+
* If the PIN is rejected, the optional `errorMessage` will be displayed to the user and the modal
|
|
13
|
+
* will not be dismissed.
|
|
4
14
|
*
|
|
5
|
-
* @param onSubmit the function to be called when the PIN is submitted.
|
|
6
|
-
* The callback should be used to validate the PIN and return `accept` or `reject`.
|
|
7
|
-
* @param options the options for the pin pad
|
|
8
15
|
*/
|
|
9
16
|
showPinPad(onSubmit: (pin: number[]) => Promise<PinValidationResult> | PinValidationResult, options?: PinPadOptions): void;
|
|
10
17
|
}
|
|
11
18
|
/**
|
|
12
|
-
* Access the
|
|
19
|
+
* Access the PIN Pad API for PIN pad functionality in a modal.
|
|
13
20
|
*/
|
|
14
21
|
export interface PinPadApi {
|
|
15
22
|
pinPad: PinPadApiContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pin-pad-api.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/point-of-sale/api/pin-pad-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B
|
|
1
|
+
{"version":3,"file":"pin-pad-api.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/point-of-sale/api/pin-pad-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;OAYG;IACH,UAAU,CACR,QAAQ,EAAE,CACR,GAAG,EAAE,MAAM,EAAE,KACV,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,EACvD,OAAO,CAAC,EAAE,aAAa,GACtB,IAAI,CAAC;CACT;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,gBAAgB,CAAC;CAC1B"}
|
|
@@ -25,27 +25,34 @@ export interface PinPadActionType {
|
|
|
25
25
|
}
|
|
26
26
|
export interface PinPadOptions {
|
|
27
27
|
/**
|
|
28
|
-
* The function to be called
|
|
28
|
+
* The function to be called whenever the entered PIN is updated
|
|
29
29
|
*/
|
|
30
30
|
onPinEntry?: (pin: number[]) => void;
|
|
31
31
|
/**
|
|
32
|
-
* The function to be called when the
|
|
32
|
+
* The function to be called when the PIN pad modal is dismissed
|
|
33
33
|
*/
|
|
34
34
|
onDismissed?: (result: PinPadResult) => void;
|
|
35
35
|
/**
|
|
36
|
-
* The content for the prompt on the
|
|
36
|
+
* The content for the prompt on the PIN pad. This will be overridden by any
|
|
37
|
+
* `errorMessage` provided when rejecting a PIN from the `onSubmit` callback.
|
|
37
38
|
*/
|
|
38
39
|
label?: string;
|
|
39
40
|
/**
|
|
40
41
|
* Whether the entered PIN should be masked
|
|
42
|
+
*
|
|
43
|
+
* @default true
|
|
41
44
|
*/
|
|
42
45
|
masked?: boolean;
|
|
43
46
|
/**
|
|
44
47
|
* The minimum length of the PIN
|
|
48
|
+
*
|
|
49
|
+
* @default 4
|
|
45
50
|
*/
|
|
46
51
|
minPinLength?: PinLength;
|
|
47
52
|
/**
|
|
48
53
|
* The maximum length of the PIN
|
|
54
|
+
*
|
|
55
|
+
* @default 6
|
|
49
56
|
*/
|
|
50
57
|
maxPinLength?: PinLength;
|
|
51
58
|
/**
|
|
@@ -57,7 +64,9 @@ export interface PinPadOptions {
|
|
|
57
64
|
*/
|
|
58
65
|
title?: string;
|
|
59
66
|
/**
|
|
60
|
-
* Whether the
|
|
67
|
+
* Whether the PIN should be automatically submitted when the user has entered the maximum PIN length
|
|
68
|
+
*
|
|
69
|
+
* @default false
|
|
61
70
|
*/
|
|
62
71
|
autoSubmit?: boolean;
|
|
63
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pin-pad.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/point-of-sale/types/pin-pad.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAC,GAClB;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C
|
|
1
|
+
{"version":3,"file":"pin-pad.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/point-of-sale/types/pin-pad.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAC,GAClB;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|