@shopify/ui-extensions 2026.7.4 → 2026.10.0-rc.10
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/build/cjs/surfaces/checkout/preact/market.js +8 -2
- package/build/cjs/surfaces/checkout/shared.js +0 -2
- package/build/cjs/surfaces/customer-account/preact/market.js +8 -2
- package/build/cjs/surfaces/point-of-sale/events.js +129 -1
- package/build/cjs/surfaces/point-of-sale/types/storage.js +11 -0
- package/build/cjs/surfaces/point-of-sale.js +1 -0
- package/build/esm/surfaces/checkout/preact/market.mjs +8 -2
- package/build/esm/surfaces/checkout/shared.mjs +0 -2
- package/build/esm/surfaces/customer-account/preact/market.mjs +8 -2
- package/build/esm/surfaces/point-of-sale/events.mjs +129 -2
- package/build/esm/surfaces/point-of-sale/types/storage.mjs +11 -0
- package/build/esm/surfaces/point-of-sale.mjs +1 -1
- package/build/esnext/surfaces/checkout/preact/market.esnext +8 -2
- package/build/esnext/surfaces/checkout/shared.esnext +0 -2
- package/build/esnext/surfaces/customer-account/preact/market.esnext +8 -2
- package/build/esnext/surfaces/point-of-sale/events.esnext +129 -2
- package/build/esnext/surfaces/point-of-sale/types/storage.esnext +11 -0
- package/build/esnext/surfaces/point-of-sale.esnext +1 -1
- package/build/ts/shared.d.ts +2 -2
- package/build/ts/shared.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/AdminAction.d.ts +61 -107
- package/build/ts/surfaces/admin/components/AdminBlock.d.ts +22 -107
- package/build/ts/surfaces/admin/components/AdminPrintAction.d.ts +20 -101
- package/build/ts/surfaces/admin/components/AppNav.d.ts +38 -1
- package/build/ts/surfaces/admin/components/Avatar.d.ts +100 -139
- package/build/ts/surfaces/admin/components/Badge.d.ts +107 -156
- package/build/ts/surfaces/admin/components/Banner.d.ts +102 -127
- package/build/ts/surfaces/admin/components/Box.d.ts +145 -234
- package/build/ts/surfaces/admin/components/Button.d.ts +156 -266
- package/build/ts/surfaces/admin/components/ButtonGroup.d.ts +89 -117
- package/build/ts/surfaces/admin/components/Checkbox.d.ts +139 -174
- package/build/ts/surfaces/admin/components/Chip.d.ts +117 -15
- package/build/ts/surfaces/admin/components/Choice.d.ts +88 -113
- package/build/ts/surfaces/admin/components/ChoiceList.d.ts +120 -129
- package/build/ts/surfaces/admin/components/Clickable.d.ts +227 -209
- package/build/ts/surfaces/admin/components/ClickableChip.d.ts +117 -153
- package/build/ts/surfaces/admin/components/ColorField.d.ts +111 -215
- package/build/ts/surfaces/admin/components/ColorPicker.d.ts +82 -137
- package/build/ts/surfaces/admin/components/DateField.d.ts +140 -230
- package/build/ts/surfaces/admin/components/DatePicker.d.ts +178 -181
- package/build/ts/surfaces/admin/components/Divider.d.ts +50 -118
- package/build/ts/surfaces/admin/components/DropZone.d.ts +153 -12
- package/build/ts/surfaces/admin/components/EmailField.d.ts +100 -197
- package/build/ts/surfaces/admin/components/EmptyState.d.ts +144 -0
- package/build/ts/surfaces/admin/components/Form.d.ts +25 -118
- package/build/ts/surfaces/admin/components/FunctionSettings.d.ts +26 -132
- package/build/ts/surfaces/admin/components/Grid.d.ts +165 -299
- package/build/ts/surfaces/admin/components/GridItem.d.ts +145 -261
- package/build/ts/surfaces/admin/components/Heading.d.ts +117 -117
- package/build/ts/surfaces/admin/components/Icon.d.ts +91 -129
- package/build/ts/surfaces/admin/components/Image.d.ts +216 -251
- package/build/ts/surfaces/admin/components/Link.d.ts +125 -126
- package/build/ts/surfaces/admin/components/ListItem.d.ts +63 -102
- package/build/ts/surfaces/admin/components/Menu.d.ts +82 -150
- package/build/ts/surfaces/admin/components/Modal.d.ts +232 -26
- package/build/ts/surfaces/admin/components/MoneyField.d.ts +103 -196
- package/build/ts/surfaces/admin/components/Number.d.ts +193 -0
- package/build/ts/surfaces/admin/components/NumberField.d.ts +114 -208
- package/build/ts/surfaces/admin/components/Option.d.ts +67 -108
- package/build/ts/surfaces/admin/components/OptionGroup.d.ts +69 -105
- package/build/ts/surfaces/admin/components/OrderedList.d.ts +56 -102
- package/build/ts/surfaces/admin/components/Page.d.ts +93 -13
- package/build/ts/surfaces/admin/components/Paragraph.d.ts +126 -138
- package/build/ts/surfaces/admin/components/PasswordField.d.ts +109 -203
- package/build/ts/surfaces/admin/components/Popover.d.ts +673 -0
- package/build/ts/surfaces/admin/components/Progress.d.ts +155 -0
- package/build/ts/surfaces/admin/components/QueryContainer.d.ts +77 -116
- package/build/ts/surfaces/admin/components/SearchField.d.ts +103 -191
- package/build/ts/surfaces/admin/components/Section.d.ts +132 -128
- package/build/ts/surfaces/admin/components/Select.d.ts +144 -193
- package/build/ts/surfaces/admin/components/Spinner.d.ts +60 -113
- package/build/ts/surfaces/admin/components/Stack.d.ts +156 -282
- package/build/ts/surfaces/admin/components/StandardComponents.d.ts +1 -1
- package/build/ts/surfaces/admin/components/StandardComponents.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Switch.d.ts +75 -165
- package/build/ts/surfaces/admin/components/Table.d.ts +100 -210
- package/build/ts/surfaces/admin/components/TableBody.d.ts +70 -106
- package/build/ts/surfaces/admin/components/TableCell.d.ts +70 -107
- package/build/ts/surfaces/admin/components/TableHeader.d.ts +79 -119
- package/build/ts/surfaces/admin/components/TableHeaderRow.d.ts +71 -107
- package/build/ts/surfaces/admin/components/TableRow.d.ts +81 -109
- package/build/ts/surfaces/admin/components/Text.d.ts +123 -164
- package/build/ts/surfaces/admin/components/TextArea.d.ts +100 -195
- package/build/ts/surfaces/admin/components/TextField.d.ts +120 -204
- package/build/ts/surfaces/admin/components/Thumbnail.d.ts +83 -133
- package/build/ts/surfaces/admin/components/Tooltip.d.ts +78 -146
- package/build/ts/surfaces/admin/components/URLField.d.ts +107 -209
- package/build/ts/surfaces/admin/components/UnorderedList.d.ts +58 -110
- package/build/ts/surfaces/admin/components/shared.d.ts +4193 -1203
- package/build/ts/surfaces/admin/extension-targets.d.ts +8 -0
- package/build/ts/surfaces/admin/extension-targets.d.ts.map +1 -1
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-index.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.app.home.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.app.intent.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.catalog-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.catalog-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.collection-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.collection-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.collection-index.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.company-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.company-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.company-location-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.customer-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.customer-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.customer-index.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.customer-index.selection-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.customer-segment-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.discount-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.discount-details.function-settings.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.discount-index.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.discount-index.selection-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-index.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-index.selection-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.gift-card-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.gift-card-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.order-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.order-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.order-details.print-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.order-fulfilled-card.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.order-index.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.order-index.selection-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.order-index.selection-print-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.configuration.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.configuration.should-render.d.ts +6 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.print-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.reorder.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-index.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-index.selection-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-index.selection-print-action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-purchase-option.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.block.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.configuration.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.configuration.should-render.d.ts +6 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-purchase-option.action.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.settings.internal-order-routing-rule.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.settings.order-routing-rule.render.d.ts +2 -0
- package/build/ts/surfaces/admin/targets/admin.settings.validation.render.d.ts +2 -0
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts +8 -5
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/Box.d.ts +56 -1
- package/build/ts/surfaces/checkout/components/components-shared.d.ts +1 -1
- package/build/ts/surfaces/checkout/preact/market.d.ts +8 -2
- package/build/ts/surfaces/checkout/preact/market.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/shared.d.ts +1 -3
- package/build/ts/surfaces/checkout/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/targets/purchase.cart-line-item.line-components.render.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.actions.render-before.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.block.render.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-item.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-list.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.contact.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-before.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.footer.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.gift-card.render.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.header.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-before.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.action-required.render.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.details.render.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.hosted-fields.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-before.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-option-item.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-before.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-before.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.details.render.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-before.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.block.render.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-item.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-list.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.customer-information.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.footer.render-after.d.ts +0 -1
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.header.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts +6 -1
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/components/Box.d.ts +56 -1
- package/build/ts/surfaces/customer-account/components/components-shared.d.ts +1 -1
- package/build/ts/surfaces/customer-account/preact/market.d.ts +8 -2
- package/build/ts/surfaces/customer-account/preact/market.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.footer.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-index.announcement.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-index.block.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.announcement.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.block.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-item.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-list.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.customer-information.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.fulfillment-details.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.payment-details.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.return-details.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.unfulfilled-items.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.menu-item.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.order.page.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.page.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.addresses.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.announcement.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.block.render.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-details.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-addresses.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-payment.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-staff.render-after.d.ts +0 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.payment.render-after.d.ts +0 -1
- package/build/ts/surfaces/point-of-sale/api/cart-api/cart-api.d.ts +13 -0
- package/build/ts/surfaces/point-of-sale/api/cart-api/cart-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/resolution-api/resolution-api.d.ts +23 -0
- package/build/ts/surfaces/point-of-sale/api/resolution-api/resolution-api.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/api.d.ts +3 -2
- package/build/ts/surfaces/point-of-sale/api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/targets/ResolutionComponents.d.ts +10 -0
- package/build/ts/surfaces/point-of-sale/components/targets/ResolutionComponents.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/events/scan-event.d.ts +34 -0
- package/build/ts/surfaces/point-of-sale/events/scan-event.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/events.d.ts +183 -1
- package/build/ts/surfaces/point-of-sale/events.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/extension-targets.d.ts +17 -3
- package/build/ts/surfaces/point-of-sale/extension-targets.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/globals.d.ts +8 -1
- package/build/ts/surfaces/point-of-sale/globals.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/targets/pos.cart.validations.resolution.render.d.ts +44 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.payment.validations.resolution.render.d.ts +44 -0
- package/build/ts/surfaces/point-of-sale/types/cart.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/types/cart.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/types/storage.d.ts +40 -0
- package/build/ts/surfaces/point-of-sale/types/storage.d.ts.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/shared.ts +4 -2
- package/src/surfaces/admin/components/AdminAction.d.ts +61 -107
- package/src/surfaces/admin/components/AdminBlock.d.ts +22 -107
- package/src/surfaces/admin/components/AdminPrintAction.d.ts +20 -101
- package/src/surfaces/admin/components/AppNav.d.ts +38 -1
- package/src/surfaces/admin/components/Avatar.d.ts +100 -139
- package/src/surfaces/admin/components/Badge.d.ts +107 -156
- package/src/surfaces/admin/components/Banner.d.ts +102 -127
- package/src/surfaces/admin/components/Box.d.ts +145 -234
- package/src/surfaces/admin/components/Button.d.ts +156 -266
- package/src/surfaces/admin/components/ButtonGroup.d.ts +89 -117
- package/src/surfaces/admin/components/Checkbox.d.ts +139 -174
- package/src/surfaces/admin/components/Chip.d.ts +117 -15
- package/src/surfaces/admin/components/Choice.d.ts +88 -113
- package/src/surfaces/admin/components/ChoiceList.d.ts +120 -129
- package/src/surfaces/admin/components/Clickable.d.ts +227 -209
- package/src/surfaces/admin/components/ClickableChip.d.ts +117 -153
- package/src/surfaces/admin/components/ColorField.d.ts +111 -215
- package/src/surfaces/admin/components/ColorPicker.d.ts +82 -137
- package/src/surfaces/admin/components/DateField.d.ts +140 -230
- package/src/surfaces/admin/components/DatePicker.d.ts +178 -181
- package/src/surfaces/admin/components/Divider.d.ts +50 -118
- package/src/surfaces/admin/components/DropZone.d.ts +153 -12
- package/src/surfaces/admin/components/EmailField.d.ts +100 -197
- package/src/surfaces/admin/components/EmptyState.d.ts +144 -0
- package/src/surfaces/admin/components/Form.d.ts +25 -118
- package/src/surfaces/admin/components/FunctionSettings.d.ts +26 -132
- package/src/surfaces/admin/components/Grid.d.ts +165 -299
- package/src/surfaces/admin/components/GridItem.d.ts +145 -261
- package/src/surfaces/admin/components/Heading.d.ts +117 -117
- package/src/surfaces/admin/components/Icon.d.ts +91 -129
- package/src/surfaces/admin/components/Image.d.ts +216 -251
- package/src/surfaces/admin/components/Link.d.ts +125 -126
- package/src/surfaces/admin/components/ListItem.d.ts +63 -102
- package/src/surfaces/admin/components/Menu.d.ts +82 -150
- package/src/surfaces/admin/components/Modal.d.ts +232 -26
- package/src/surfaces/admin/components/MoneyField.d.ts +103 -196
- package/src/surfaces/admin/components/Number.d.ts +193 -0
- package/src/surfaces/admin/components/NumberField.d.ts +114 -208
- package/src/surfaces/admin/components/Option.d.ts +67 -108
- package/src/surfaces/admin/components/OptionGroup.d.ts +69 -105
- package/src/surfaces/admin/components/OrderedList.d.ts +56 -102
- package/src/surfaces/admin/components/Page.d.ts +93 -13
- package/src/surfaces/admin/components/Paragraph.d.ts +126 -138
- package/src/surfaces/admin/components/PasswordField.d.ts +109 -203
- package/src/surfaces/admin/components/Popover.d.ts +673 -0
- package/src/surfaces/admin/components/Progress.d.ts +155 -0
- package/src/surfaces/admin/components/QueryContainer.d.ts +77 -116
- package/src/surfaces/admin/components/SearchField.d.ts +103 -191
- package/src/surfaces/admin/components/Section.d.ts +132 -128
- package/src/surfaces/admin/components/Select.d.ts +144 -193
- package/src/surfaces/admin/components/Spinner.d.ts +60 -113
- package/src/surfaces/admin/components/Stack.d.ts +156 -282
- package/src/surfaces/admin/components/StandardComponents.ts +2 -0
- package/src/surfaces/admin/components/Switch.d.ts +75 -165
- package/src/surfaces/admin/components/Table.d.ts +100 -210
- package/src/surfaces/admin/components/TableBody.d.ts +70 -106
- package/src/surfaces/admin/components/TableCell.d.ts +70 -107
- package/src/surfaces/admin/components/TableHeader.d.ts +79 -119
- package/src/surfaces/admin/components/TableHeaderRow.d.ts +71 -107
- package/src/surfaces/admin/components/TableRow.d.ts +81 -109
- package/src/surfaces/admin/components/Text.d.ts +123 -164
- package/src/surfaces/admin/components/TextArea.d.ts +100 -195
- package/src/surfaces/admin/components/TextField.d.ts +120 -204
- package/src/surfaces/admin/components/Thumbnail.d.ts +83 -133
- package/src/surfaces/admin/components/Tooltip.d.ts +78 -146
- package/src/surfaces/admin/components/URLField.d.ts +107 -209
- package/src/surfaces/admin/components/UnorderedList.d.ts +58 -110
- package/src/surfaces/admin/components/shared.d.ts +4193 -1203
- package/src/surfaces/admin/extension-targets.ts +18 -0
- package/src/surfaces/checkout/api/standard/standard.ts +8 -5
- package/src/surfaces/checkout/components/Box.d.ts +56 -1
- package/src/surfaces/checkout/components/components-shared.d.ts +1 -1
- package/src/surfaces/checkout/preact/market.ts +8 -2
- package/src/surfaces/checkout/shared.ts +1 -6
- package/src/surfaces/customer-account/api/order-status/order-status.ts +6 -1
- package/src/surfaces/customer-account/preact/market.ts +8 -2
- package/src/surfaces/point-of-sale/api/cart-api/cart-api.ts +14 -0
- package/src/surfaces/point-of-sale/api/resolution-api/resolution-api.ts +24 -0
- package/src/surfaces/point-of-sale/api.ts +7 -1
- package/src/surfaces/point-of-sale/components/targets/ResolutionComponents.ts +13 -0
- package/src/surfaces/point-of-sale/events/scan-event.ts +34 -0
- package/src/surfaces/point-of-sale/events.ts +215 -0
- package/src/surfaces/point-of-sale/extension-targets.ts +33 -2
- package/src/surfaces/point-of-sale/globals.ts +16 -1
- package/src/surfaces/point-of-sale/types/cart.ts +4 -0
- package/src/surfaces/point-of-sale/types/storage.ts +47 -0
- package/build/ts/surfaces/checkout/components/LoginWithShop.d.ts +0 -164
- package/build/ts/surfaces/customer-account/components/LoginWithShop.d.ts +0 -164
- package/src/surfaces/checkout/components/LoginWithShop.d.ts +0 -164
|
@@ -416,6 +416,24 @@ export interface ExtensionTargets {
|
|
|
416
416
|
BlockExtensionComponents
|
|
417
417
|
>;
|
|
418
418
|
|
|
419
|
+
// Configuration shouldRender targets
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* A non-rendering target that controls whether the product details configuration extension renders. Use this to conditionally show or hide your configuration extension based on product properties, user permissions, or external data.
|
|
423
|
+
*/
|
|
424
|
+
'admin.product-details.configuration.should-render': RunnableExtension<
|
|
425
|
+
ShouldRenderApi<'admin.product-details.configuration.should-render'>,
|
|
426
|
+
ShouldRenderOutput
|
|
427
|
+
>;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* A non-rendering target that controls whether the product variant details configuration extension renders. Use this to conditionally show or hide your configuration extension based on product variant properties, user permissions, or external data.
|
|
431
|
+
*/
|
|
432
|
+
'admin.product-variant-details.configuration.should-render': RunnableExtension<
|
|
433
|
+
ShouldRenderApi<'admin.product-variant-details.configuration.should-render'>,
|
|
434
|
+
ShouldRenderOutput
|
|
435
|
+
>;
|
|
436
|
+
|
|
419
437
|
/**
|
|
420
438
|
* A function settings target that renders within order routing settings, allowing merchants to configure order routing rule functions.
|
|
421
439
|
* @private
|
|
@@ -436,12 +436,15 @@ export interface Localization {
|
|
|
436
436
|
/**
|
|
437
437
|
* The [market](/docs/apps/build/markets) context of the checkout,
|
|
438
438
|
* carried over from the cart context. Markets group countries and
|
|
439
|
-
* regions with shared pricing, languages, and domains.
|
|
440
|
-
*
|
|
441
|
-
*
|
|
439
|
+
* regions with shared pricing, languages, and domains. In cases where
|
|
440
|
+
* multiple markets match, this returns the most narrowly scoped
|
|
441
|
+
* country region market. The market context updates when the buyer
|
|
442
|
+
* changes the country of their shipping address. The value is
|
|
443
|
+
* `undefined` if the market is unknown.
|
|
442
444
|
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
+
* > Caution: This `market` field is deprecated and will be removed in a future version of the API.
|
|
446
|
+
*
|
|
447
|
+
* @deprecated This `market` field will be removed in a future version of the API.
|
|
445
448
|
*/
|
|
446
449
|
market: SubscribableSignalLike<Market | undefined>;
|
|
447
450
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/* eslint-disable import-x/namespace */
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
|
|
10
10
|
/// <reference lib="DOM" />
|
|
11
|
-
import type {BoxProps$1,MaybeAllValuesShorthandProperty,BorderSizeKeyword, BorderStyleKeyword,ColorKeyword} from './components-shared.d.ts';
|
|
11
|
+
import type {BoxProps$1,MaybeAllValuesShorthandProperty,BorderSizeKeyword, BorderStyleKeyword, SizeUnits,ColorKeyword} from './components-shared.d.ts';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The subset of border size values available for this component.
|
|
@@ -84,6 +84,61 @@ export interface BoxElementProps extends Pick<BoxProps$1, 'accessibilityLabel' |
|
|
|
84
84
|
* @default 'none'
|
|
85
85
|
*/
|
|
86
86
|
borderRadius?: MaybeAllValuesShorthandProperty<Extract<BoxProps$1['borderRadius'], 'none' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'max'>>;
|
|
87
|
+
/**
|
|
88
|
+
* Sets the box's block position by specifying offsets from the box's
|
|
89
|
+
* default position, following the CSS `inset-block` shorthand:
|
|
90
|
+
* a block-start offset followed by a block-end offset, where only one
|
|
91
|
+
* of the two can be a size so each axis is only offset once.
|
|
92
|
+
*
|
|
93
|
+
* When `position` is set to `absolute`, offsets are insets from the
|
|
94
|
+
* nearest positioned ancestor. A percentage value refers to the block
|
|
95
|
+
* size of that ancestor.
|
|
96
|
+
*
|
|
97
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block
|
|
98
|
+
*
|
|
99
|
+
* @default 'auto'
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
insetBlock?: `auto ${SizeUnits}` | `${SizeUnits} auto` | 'auto';
|
|
103
|
+
/**
|
|
104
|
+
* Sets the box's inline position by specifying offsets from the box's
|
|
105
|
+
* default position, following the CSS `inset-inline` shorthand:
|
|
106
|
+
* an inline-start offset followed by an inline-end offset, where only
|
|
107
|
+
* one of the two can be a size so each axis is only offset once.
|
|
108
|
+
*
|
|
109
|
+
* When `position` is set to `absolute`, offsets are insets from the
|
|
110
|
+
* nearest positioned ancestor. A percentage value refers to the inline
|
|
111
|
+
* size of that ancestor.
|
|
112
|
+
*
|
|
113
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline
|
|
114
|
+
*
|
|
115
|
+
* @default 'auto'
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
insetInline?: `auto ${SizeUnits}` | `${SizeUnits} auto` | 'auto';
|
|
119
|
+
/**
|
|
120
|
+
* Changes how the box is positioned.
|
|
121
|
+
*
|
|
122
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/position
|
|
123
|
+
*
|
|
124
|
+
* @default 'relative'
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
position?: 'absolute' | 'relative';
|
|
128
|
+
/**
|
|
129
|
+
* Specifies a transformation of the box.
|
|
130
|
+
*
|
|
131
|
+
* Only two-dimensional translations are supported. The first value
|
|
132
|
+
* translates along the inline axis and the second along the block axis;
|
|
133
|
+
* inline translations are flipped in right-to-left writing modes.
|
|
134
|
+
* A percentage value refers to the corresponding size of the box itself.
|
|
135
|
+
*
|
|
136
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform
|
|
137
|
+
*
|
|
138
|
+
* @default 'none'
|
|
139
|
+
* @private
|
|
140
|
+
*/
|
|
141
|
+
transform?: `translate(${SizeUnits})` | `translate(${SizeUnits}, ${SizeUnits})` | `translate(${SizeUnits},${SizeUnits})` | 'none';
|
|
87
142
|
}
|
|
88
143
|
export interface BoxElement extends BoxElementProps, Omit<HTMLElement, 'id'> {
|
|
89
144
|
}
|
|
@@ -1384,7 +1384,7 @@ export interface ButtonBehaviorProps extends InteractionProps, FocusEventProps {
|
|
|
1384
1384
|
}
|
|
1385
1385
|
export interface LinkBehaviorProps extends InteractionProps, FocusEventProps {
|
|
1386
1386
|
/**
|
|
1387
|
-
* The URL to navigate to when clicked. The `click` event fires first, then navigation occurs. If `commandFor` is also set, the command executes instead of navigation.
|
|
1387
|
+
* The URL to navigate to when clicked, including `mailto:` and `tel:` URLs. The `click` event fires first, then navigation occurs. If `commandFor` is also set, the command executes instead of navigation.
|
|
1388
1388
|
*/
|
|
1389
1389
|
href?: string;
|
|
1390
1390
|
/**
|
|
@@ -5,8 +5,14 @@ import {useApi} from './api';
|
|
|
5
5
|
import {useSubscription} from './subscription';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Returns the market of the checkout,
|
|
9
|
-
*
|
|
8
|
+
* Returns the market of the checkout, carried over from the cart context.
|
|
9
|
+
* In cases where multiple markets match, this returns the most narrowly
|
|
10
|
+
* scoped country region market. Automatically re-renders your component
|
|
11
|
+
* if it changes.
|
|
12
|
+
*
|
|
13
|
+
* > Caution: This hook is deprecated and will be removed in a future version of the API.
|
|
14
|
+
*
|
|
15
|
+
* @deprecated This hook will be removed in a future version of the API.
|
|
10
16
|
* @publicDocs
|
|
11
17
|
*/
|
|
12
18
|
export function useLocalizationMarket<
|
|
@@ -70,15 +70,10 @@ export const SUPPORTED_COMPONENTS = [
|
|
|
70
70
|
'UrlField',
|
|
71
71
|
] as const;
|
|
72
72
|
|
|
73
|
-
/** @private */
|
|
74
|
-
export type PrivateComponent = 'LoginWithShop';
|
|
75
|
-
|
|
76
73
|
export type ThankYouComponent = 'Announcement';
|
|
77
74
|
|
|
78
75
|
/** @publicDocs */
|
|
79
|
-
export type AnyComponent =
|
|
80
|
-
| (typeof SUPPORTED_COMPONENTS)[number]
|
|
81
|
-
| PrivateComponent;
|
|
76
|
+
export type AnyComponent = (typeof SUPPORTED_COMPONENTS)[number];
|
|
82
77
|
|
|
83
78
|
/**
|
|
84
79
|
* The list of supported components.
|
|
@@ -201,7 +201,12 @@ export interface OrderStatusLocalization {
|
|
|
201
201
|
/**
|
|
202
202
|
* The [market](/docs/apps/build/markets) associated with the order, carried
|
|
203
203
|
* over from the cart context. Markets group countries and regions with shared pricing,
|
|
204
|
-
* languages, and domains.
|
|
204
|
+
* languages, and domains. In cases where multiple markets match, this returns the most
|
|
205
|
+
* narrowly scoped country region market. The value is `undefined` if the market is unknown.
|
|
206
|
+
*
|
|
207
|
+
* > Caution: This `market` field is deprecated and will be removed in a future version of the API.
|
|
208
|
+
*
|
|
209
|
+
* @deprecated This `market` field will be removed in a future version of the API.
|
|
205
210
|
*/
|
|
206
211
|
market: SubscribableSignalLike<Market | undefined>;
|
|
207
212
|
}
|
|
@@ -6,8 +6,14 @@ import {useSubscription} from './subscription';
|
|
|
6
6
|
import {ExtensionHasNoFieldError} from './errors';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Returns the market
|
|
10
|
-
*
|
|
9
|
+
* Returns the market associated with the order, carried over from the cart
|
|
10
|
+
* context. In cases where multiple markets match, this returns the most
|
|
11
|
+
* narrowly scoped country region market. Automatically re-renders your
|
|
12
|
+
* component if it changes.
|
|
13
|
+
*
|
|
14
|
+
* > Caution: This hook is deprecated and will be removed in a future version of the API.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated This hook will be removed in a future version of the API.
|
|
11
17
|
*/
|
|
12
18
|
export function useLocalizationMarket<
|
|
13
19
|
Target extends RenderOrderStatusExtensionTarget = RenderOrderStatusExtensionTarget,
|
|
@@ -138,6 +138,20 @@ export interface MutableCartApiContent {
|
|
|
138
138
|
options?: AddLineItemOptions,
|
|
139
139
|
): Promise<string>;
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Set the quantity of an existing line item identified by its `UUID`, preserving the line item's properties, discounts, and selling plans. This is equivalent to a merchant adjusting the quantity on the native cart line.
|
|
143
|
+
*
|
|
144
|
+
* If POS has split the line into multiple allocations that share the same `UUID` (for example, lines split across delivery methods), the target line is ambiguous and the call throws instead of guessing.
|
|
145
|
+
*
|
|
146
|
+
* Only available on API version `2026-10` and later.
|
|
147
|
+
*
|
|
148
|
+
* @param uuid the UUID of the line item to update
|
|
149
|
+
* @param quantity the new absolute quantity; must be an integer of 1 or greater. To remove a line item, use `removeLineItem` instead.
|
|
150
|
+
* @returns A promise that resolves after the cart state reflects the change.
|
|
151
|
+
* @throws {Error} if the line item is not found, the `UUID` matches multiple split-line allocations, the quantity is invalid, the cart is not editable because it is a return or exchange, or the POS app version does not support this method.
|
|
152
|
+
*/
|
|
153
|
+
updateLineItemQuantity(uuid: string, quantity: number): Promise<void>;
|
|
154
|
+
|
|
141
155
|
/**
|
|
142
156
|
* Remove a specific line item from the cart using its `UUID`. The line item will be completely removed from the cart along with any associated discounts, properties, or selling plans.
|
|
143
157
|
*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type {ReadonlySignalLike} from '../../../../shared';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The `ResolutionApi` object gives a validation resolution target access to
|
|
5
|
+
* the data of the intercepted event it was opened to resolve. Access it
|
|
6
|
+
* through `shopify.resolution`.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
export interface ResolutionApi<TEventData> {
|
|
11
|
+
resolution: ResolutionApiContent<TEventData>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
export interface ResolutionApiContent<TEventData> {
|
|
18
|
+
/**
|
|
19
|
+
* The data of the intercepted event this resolution target was opened for.
|
|
20
|
+
* The `value` property provides the current data, and `subscribe` allows
|
|
21
|
+
* listening for host-owned revalidation updates.
|
|
22
|
+
*/
|
|
23
|
+
event: ReadonlySignalLike<TEventData>;
|
|
24
|
+
}
|
|
@@ -21,10 +21,15 @@ export type {
|
|
|
21
21
|
} from './api/extension-api/extension-api';
|
|
22
22
|
export type {ActionTargetApi} from './api/action-target-api/action-target-api';
|
|
23
23
|
export type {DataTargetApi} from './api/data-target-api/data-target-api';
|
|
24
|
+
export type {
|
|
25
|
+
ResolutionApi,
|
|
26
|
+
ResolutionApiContent,
|
|
27
|
+
} from './api/resolution-api/resolution-api';
|
|
24
28
|
export type {
|
|
25
29
|
TransactionCompleteEvent,
|
|
26
30
|
CashTrackingSessionStartEvent,
|
|
27
31
|
CashTrackingSessionCompleteEvent,
|
|
32
|
+
ScanEvent,
|
|
28
33
|
ShopifyEventMap,
|
|
29
34
|
} from './events';
|
|
30
35
|
|
|
@@ -145,7 +150,8 @@ export type {
|
|
|
145
150
|
export type {CountryCode} from './types/country-code';
|
|
146
151
|
|
|
147
152
|
export type {Session, StaffMember} from './types/session';
|
|
148
|
-
export type {Storage} from './types/storage';
|
|
153
|
+
export type {Storage, SubscribableStorage} from './types/storage';
|
|
154
|
+
|
|
149
155
|
export {StorageError} from './types/storage';
|
|
150
156
|
|
|
151
157
|
export type {PinPadApiContent, PinPadApi} from './api/pin-pad-api';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type {StandardComponents} from './StandardComponents';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Components available on validation resolution targets. Resolution UI renders
|
|
5
|
+
* inside a POS-owned flow step, so page-level and block-level containers are
|
|
6
|
+
* excluded, along with the smart-grid-only `Tile`.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
export type ResolutionComponents = Exclude<
|
|
11
|
+
StandardComponents,
|
|
12
|
+
'Page' | 'POSBlock' | 'PosBlock' | 'Tile'
|
|
13
|
+
>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type {ScannerSource} from '../api/scanner-api/scanner-api';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Dispatched once for each successful scan captured by a camera, external,
|
|
5
|
+
* or embedded scanner. Every event carries a decoded `data` value and its
|
|
6
|
+
* `source`; no event is dispatched for initial or empty scanner state.
|
|
7
|
+
*
|
|
8
|
+
* The event is delivered only after POS has finished handling the scan
|
|
9
|
+
* itself.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* shopify.addEventListener('scan', (event) => {
|
|
14
|
+
* handleScan(event.data, event.source);
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
* @publicDocs
|
|
18
|
+
*/
|
|
19
|
+
export interface ScanEvent {
|
|
20
|
+
/** The event name. */
|
|
21
|
+
readonly type: 'scan';
|
|
22
|
+
/**
|
|
23
|
+
* The decoded string captured by the scan. Contains the scanned barcode, QR code, or other scannable data. Always present: an event is only dispatched for a successful scan.
|
|
24
|
+
*/
|
|
25
|
+
readonly data: string;
|
|
26
|
+
/**
|
|
27
|
+
* The scanner source that captured the scan. One of the following scanner types:
|
|
28
|
+
*
|
|
29
|
+
* • `'camera'` - Built-in device camera used for scanning
|
|
30
|
+
* • `'external'` - External scanner hardware connected to the device
|
|
31
|
+
* • `'embedded'` - Embedded scanner hardware built into the device
|
|
32
|
+
*/
|
|
33
|
+
readonly source: ScannerSource;
|
|
34
|
+
}
|
|
@@ -3,6 +3,9 @@ import type {
|
|
|
3
3
|
CashTrackingSessionStartEvent,
|
|
4
4
|
CashTrackingSessionCompleteEvent,
|
|
5
5
|
} from './events/cash-tracking-session-events';
|
|
6
|
+
import type {ScanEvent} from './events/scan-event';
|
|
7
|
+
import type {Cart} from './types/cart';
|
|
8
|
+
import type {MoneyV2} from './types/money';
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* Canonical event-name constants for POS host events. Prefer these over string
|
|
@@ -14,6 +17,18 @@ export const POS_EVENT_NAMES = {
|
|
|
14
17
|
TRANSACTION_COMPLETE: 'transactioncomplete',
|
|
15
18
|
CASH_TRACKING_SESSION_START: 'cashtrackingsessionstart',
|
|
16
19
|
CASH_TRACKING_SESSION_COMPLETE: 'cashtrackingsessioncomplete',
|
|
20
|
+
SCAN: 'scan',
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Canonical workflow-name constants for POS host interceptions. Prefer these
|
|
25
|
+
* over string literals when calling `shopify.intercept`.
|
|
26
|
+
*
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
export const POS_INTERCEPT_NAMES = {
|
|
30
|
+
CART_VALIDATIONS: 'cartvalidations',
|
|
31
|
+
PAYMENT_VALIDATIONS: 'paymentvalidations',
|
|
17
32
|
} as const;
|
|
18
33
|
|
|
19
34
|
/**
|
|
@@ -34,10 +49,210 @@ export interface ShopifyEventMap {
|
|
|
34
49
|
[POS_EVENT_NAMES.CASH_TRACKING_SESSION_START]: CashTrackingSessionStartEvent;
|
|
35
50
|
/** Dispatched when a cash tracking session closes after reconciliation. */
|
|
36
51
|
[POS_EVENT_NAMES.CASH_TRACKING_SESSION_COMPLETE]: CashTrackingSessionCompleteEvent;
|
|
52
|
+
/**
|
|
53
|
+
* Dispatched once for each successful scan captured by a camera, external,
|
|
54
|
+
* or embedded scanner, after POS has finished handling the scan itself.
|
|
55
|
+
* Every event carries decoded `data` and its `source`.
|
|
56
|
+
*/
|
|
57
|
+
[POS_EVENT_NAMES.SCAN]: ScanEvent;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Maps POS interceptable workflow names to their corresponding `Event` types.
|
|
62
|
+
*
|
|
63
|
+
* Used as the generic type parameter for `shopify.intercept`.
|
|
64
|
+
*
|
|
65
|
+
* @private
|
|
66
|
+
*/
|
|
67
|
+
export interface ShopifyInterceptMap {
|
|
68
|
+
[POS_INTERCEPT_NAMES.CART_VALIDATIONS]: CartValidationsEvent;
|
|
69
|
+
[POS_INTERCEPT_NAMES.PAYMENT_VALIDATIONS]: PaymentValidationsEvent;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The data carried by a `cartvalidations` event.
|
|
74
|
+
*
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
export interface CartValidationsEventData {
|
|
78
|
+
/** A snapshot of the POS cart taken when the event was produced. */
|
|
79
|
+
readonly cart: Cart;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The event a `cartvalidations` interceptor receives. Carries a snapshot of
|
|
84
|
+
* the POS cart taken when the event was produced.
|
|
85
|
+
*
|
|
86
|
+
* @private
|
|
87
|
+
*/
|
|
88
|
+
export interface CartValidationsEvent extends CartValidationsEventData {
|
|
89
|
+
readonly type: typeof POS_INTERCEPT_NAMES.CART_VALIDATIONS;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The kind of payment method being attempted.
|
|
94
|
+
*
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
export type InterceptedPaymentMethodType = 'cash';
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Identifies the payment method being attempted.
|
|
101
|
+
*
|
|
102
|
+
* `type` alone identifies singleton methods (for example `cash`). `identifier`
|
|
103
|
+
* disambiguates method types a shop can have several of (for example custom
|
|
104
|
+
* payment methods) as they become interceptable.
|
|
105
|
+
*
|
|
106
|
+
* @private
|
|
107
|
+
*/
|
|
108
|
+
export interface InterceptedPaymentMethod {
|
|
109
|
+
readonly type: InterceptedPaymentMethodType;
|
|
110
|
+
|
|
111
|
+
/** Present when `type` alone is ambiguous. Matching is exact on the pair. */
|
|
112
|
+
readonly identifier?: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The event a `paymentvalidations` interceptor receives. Carries the tender
|
|
117
|
+
* attempt's payment method and amount; split payments produce one event per
|
|
118
|
+
* tender, each with its own amount.
|
|
119
|
+
*
|
|
120
|
+
* @private
|
|
121
|
+
*/
|
|
122
|
+
export interface PaymentValidationsEvent extends PaymentValidationsEventData {
|
|
123
|
+
readonly type: typeof POS_INTERCEPT_NAMES.PAYMENT_VALIDATIONS;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The data carried by a `paymentvalidations` event.
|
|
128
|
+
*
|
|
129
|
+
* @private
|
|
130
|
+
*/
|
|
131
|
+
export interface PaymentValidationsEventData {
|
|
132
|
+
/** The payment method staff selected. */
|
|
133
|
+
readonly paymentMethod: InterceptedPaymentMethod;
|
|
134
|
+
|
|
135
|
+
/** The amount this tender would charge, in presentment currency. */
|
|
136
|
+
readonly amount: MoneyV2;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Targets the whole cart rather than a specific line item.
|
|
141
|
+
*
|
|
142
|
+
* @private
|
|
143
|
+
*/
|
|
144
|
+
export type CartTarget = '$.cart';
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Targets one cart line item by its `uuid` from this event's `cart` snapshot,
|
|
148
|
+
* for example `$.cart.lineItems['adfd6b06-4a24-4f5f-9f4b-ea21f4432dd4']`.
|
|
149
|
+
*
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
export type CartLineItemTarget = `$.cart.lineItems['${string}']`;
|
|
153
|
+
|
|
154
|
+
/** @private */
|
|
155
|
+
export type CartValidationTarget = CartTarget | CartLineItemTarget;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Targets the payment attempt being intercepted.
|
|
159
|
+
*
|
|
160
|
+
* @private
|
|
161
|
+
*/
|
|
162
|
+
export type PaymentTarget = '$.payment';
|
|
163
|
+
|
|
164
|
+
/** @private */
|
|
165
|
+
export type PaymentValidationTarget = PaymentTarget;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Where a validation applies, as an enumerated token. Targets are matched
|
|
169
|
+
* as exact strings, never evaluated as JSON paths.
|
|
170
|
+
*
|
|
171
|
+
* @private
|
|
172
|
+
*/
|
|
173
|
+
export type ValidationTarget = CartValidationTarget | PaymentValidationTarget;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Maps POS interceptable workflow names to their valid validation targets.
|
|
177
|
+
*
|
|
178
|
+
* @private
|
|
179
|
+
*/
|
|
180
|
+
interface ValidationTargetMap {
|
|
181
|
+
[POS_INTERCEPT_NAMES.CART_VALIDATIONS]: CartValidationTarget;
|
|
182
|
+
[POS_INTERCEPT_NAMES.PAYMENT_VALIDATIONS]: PaymentValidationTarget;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The interceptor callback for a POS interceptable workflow, keyed by the
|
|
187
|
+
* workflow name so the event and its valid validation targets stay paired.
|
|
188
|
+
*
|
|
189
|
+
* @private
|
|
190
|
+
*/
|
|
191
|
+
export type ShopifyInterceptor<K extends keyof ShopifyInterceptMap> = (
|
|
192
|
+
event: ShopifyInterceptMap[K],
|
|
193
|
+
) => InterceptResult<ValidationTargetMap[K]>;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The result an interceptor returns. An empty `operations` list allows the
|
|
197
|
+
* workflow; an `ERROR` validation blocks it.
|
|
198
|
+
*
|
|
199
|
+
* @private
|
|
200
|
+
*/
|
|
201
|
+
export interface InterceptResult<
|
|
202
|
+
TTarget extends ValidationTarget = ValidationTarget,
|
|
203
|
+
> {
|
|
204
|
+
operations: Operation<TTarget>[];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* A single host operation produced by an interceptor.
|
|
209
|
+
*
|
|
210
|
+
* @private
|
|
211
|
+
*/
|
|
212
|
+
export interface Operation<
|
|
213
|
+
TTarget extends ValidationTarget = ValidationTarget,
|
|
214
|
+
> {
|
|
215
|
+
validationAdd?: ValidationAdd<TTarget>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** @private */
|
|
219
|
+
export type ValidationLevel = 'WARNING' | 'ERROR';
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Adds a validation to the workflow being intercepted.
|
|
223
|
+
*
|
|
224
|
+
* @private
|
|
225
|
+
*/
|
|
226
|
+
export interface ValidationAdd<
|
|
227
|
+
TTarget extends ValidationTarget = ValidationTarget,
|
|
228
|
+
> {
|
|
229
|
+
/** `ERROR` blocks the workflow. `WARNING` does not. */
|
|
230
|
+
level: ValidationLevel;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Stable identifier for this validation. Handles are namespaced per
|
|
234
|
+
* extension and may repeat across targets: the same handle on two line
|
|
235
|
+
* items is two validations.
|
|
236
|
+
*/
|
|
237
|
+
handle: string;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Locates the data the validation applies to; the host decides where it
|
|
241
|
+
* renders. Omitted or unrecognized targets fall back to the event's root
|
|
242
|
+
* scope (`$.cart` / `$.payment`) — the validation still applies, rendered
|
|
243
|
+
* less specifically.
|
|
244
|
+
*
|
|
245
|
+
* Line item uuids are only valid within the event that delivered them:
|
|
246
|
+
* use `lineItems[n].uuid` from this event's cart snapshot, don't cache
|
|
247
|
+
* uuids across events. Bundle components are not addressable; target
|
|
248
|
+
* their parent line.
|
|
249
|
+
*/
|
|
250
|
+
target?: TTarget;
|
|
37
251
|
}
|
|
38
252
|
|
|
39
253
|
export type {
|
|
40
254
|
TransactionCompleteEvent,
|
|
41
255
|
CashTrackingSessionStartEvent,
|
|
42
256
|
CashTrackingSessionCompleteEvent,
|
|
257
|
+
ScanEvent,
|
|
43
258
|
};
|
|
@@ -14,12 +14,20 @@ import type {
|
|
|
14
14
|
OrderApi,
|
|
15
15
|
StorageApi,
|
|
16
16
|
CashDrawerApi,
|
|
17
|
+
ReadonlyCartApi,
|
|
18
|
+
ScannerApi,
|
|
19
|
+
ResolutionApi,
|
|
17
20
|
} from './api';
|
|
21
|
+
import type {
|
|
22
|
+
CartValidationsEventData,
|
|
23
|
+
PaymentValidationsEventData,
|
|
24
|
+
} from './events';
|
|
18
25
|
import type {ActionExtensionComponents} from './components/targets/ActionExtensionComponents';
|
|
19
26
|
import type {BlockExtensionComponents} from './components/targets/BlockExtensionComponents';
|
|
20
27
|
import type {SmartGridComponents} from './components/targets/SmartGridComponents';
|
|
21
28
|
import type {ReceiptComponents} from './components/targets/ReceiptComponents';
|
|
22
29
|
import type {BasicComponents} from './components/targets/BasicComponents';
|
|
30
|
+
import type {ResolutionComponents} from './components/targets/ResolutionComponents';
|
|
23
31
|
import type {TransactionCompleteWithReprintData} from './event/data';
|
|
24
32
|
|
|
25
33
|
/**
|
|
@@ -309,11 +317,10 @@ export interface RenderExtensionTargets {
|
|
|
309
317
|
/**
|
|
310
318
|
* Renders a full-screen modal interface launched from cart line item menu items. Use this target for complex line item workflows that require forms, multi-step processes, or detailed information displays beyond what a simple button can provide.
|
|
311
319
|
*
|
|
312
|
-
* Extensions at this target have access to detailed line item data through the Cart Line Item API and support workflows with multiple screens, navigation, and interactive components.
|
|
320
|
+
* Extensions at this target have access to detailed line item data through the Cart Line Item API and support workflows with multiple screens, navigation, and interactive components. Action render targets are themselves the modal destination, so the Action API (`shopify.action.presentModal()`) is not available here; use the Navigation API for in-workflow navigation.
|
|
313
321
|
*/
|
|
314
322
|
'pos.cart.line-item-details.action.render': RenderExtension<
|
|
315
323
|
ActionTargetApi<'pos.cart.line-item-details.action.render'> &
|
|
316
|
-
ActionApi &
|
|
317
324
|
CartApi &
|
|
318
325
|
CartLineItemApi,
|
|
319
326
|
BasicComponents
|
|
@@ -371,6 +378,30 @@ export interface RenderExtensionTargets {
|
|
|
371
378
|
CashDrawerApi,
|
|
372
379
|
BlockExtensionComponents
|
|
373
380
|
>;
|
|
381
|
+
/**
|
|
382
|
+
* Renders the remediation interface when a `cartvalidations` interceptor returns a validation. Use this target to resolve all of the app's findings for the event.
|
|
383
|
+
*
|
|
384
|
+
* @private
|
|
385
|
+
*/
|
|
386
|
+
'pos.cart.validations.resolution.render': RenderExtension<
|
|
387
|
+
StandardApi<'pos.cart.validations.resolution.render'> &
|
|
388
|
+
ScannerApi &
|
|
389
|
+
CartApi &
|
|
390
|
+
ResolutionApi<CartValidationsEventData>,
|
|
391
|
+
ResolutionComponents
|
|
392
|
+
>;
|
|
393
|
+
/**
|
|
394
|
+
* Renders the remediation interface when a `paymentvalidations` interceptor returns a validation. Use this target to resolve all of the app's findings for the event.
|
|
395
|
+
*
|
|
396
|
+
* @private
|
|
397
|
+
*/
|
|
398
|
+
'pos.payment.validations.resolution.render': RenderExtension<
|
|
399
|
+
StandardApi<'pos.payment.validations.resolution.render'> &
|
|
400
|
+
ScannerApi &
|
|
401
|
+
ReadonlyCartApi &
|
|
402
|
+
ResolutionApi<PaymentValidationsEventData>,
|
|
403
|
+
ResolutionComponents
|
|
404
|
+
>;
|
|
374
405
|
}
|
|
375
406
|
|
|
376
407
|
/**
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type {Navigation} from './api/navigation-api/navigation-api';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ShopifyEventMap,
|
|
4
|
+
ShopifyInterceptMap,
|
|
5
|
+
ShopifyInterceptor,
|
|
6
|
+
} from './events';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* The `shopify` global provides APIs that are available to all POS extensions
|
|
@@ -36,6 +40,17 @@ export interface BackgroundShopifyGlobal extends ShopifyGlobal {
|
|
|
36
40
|
type: K,
|
|
37
41
|
listener: (event: ShopifyEventMap[K]) => void,
|
|
38
42
|
): void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Register an interceptor for a POS host workflow that can be blocked.
|
|
46
|
+
* Returns a function that unregisters the interceptor.
|
|
47
|
+
*
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
intercept<K extends keyof ShopifyInterceptMap>(
|
|
51
|
+
type: K,
|
|
52
|
+
interceptor: ShopifyInterceptor<K>,
|
|
53
|
+
): () => void;
|
|
39
54
|
}
|
|
40
55
|
|
|
41
56
|
declare global {
|
|
@@ -23,6 +23,10 @@ export interface Cart {
|
|
|
23
23
|
* The final total amount including all items, taxes, and discounts, formatted as a currency string.
|
|
24
24
|
*/
|
|
25
25
|
grandTotal: string;
|
|
26
|
+
/**
|
|
27
|
+
* The ISO 4217 currency code for this cart.
|
|
28
|
+
*/
|
|
29
|
+
currency: string;
|
|
26
30
|
/**
|
|
27
31
|
* The cart note to set during bulk update. Replaces existing note or sets new note if none exists. Set to `undefined` to remove current note.
|
|
28
32
|
*/
|