@dropins/mcp 0.1.0
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/LICENSE.md +127 -0
- package/README.md +314 -0
- package/dist/common/project-reader.d.ts +55 -0
- package/dist/common/project-reader.js +173 -0
- package/dist/common/registry-loader.d.ts +101 -0
- package/dist/common/registry-loader.js +386 -0
- package/dist/common/response-handling.d.ts +12 -0
- package/dist/common/response-handling.js +21 -0
- package/dist/common/sanitize.d.ts +8 -0
- package/dist/common/sanitize.js +45 -0
- package/dist/common/synonyms.d.ts +9 -0
- package/dist/common/synonyms.js +127 -0
- package/dist/common/telemetry.d.ts +14 -0
- package/dist/common/telemetry.js +54 -0
- package/dist/common/types.d.ts +308 -0
- package/dist/common/types.js +1 -0
- package/dist/common/version.d.ts +2 -0
- package/dist/common/version.js +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +136 -0
- package/dist/operations/analyze-project.d.ts +13 -0
- package/dist/operations/analyze-project.js +125 -0
- package/dist/operations/check-block-health.d.ts +19 -0
- package/dist/operations/check-block-health.js +1149 -0
- package/dist/operations/check-config.d.ts +13 -0
- package/dist/operations/check-config.js +228 -0
- package/dist/operations/explain-event-flow.d.ts +16 -0
- package/dist/operations/explain-event-flow.js +218 -0
- package/dist/operations/get-upgrade-diff.d.ts +13 -0
- package/dist/operations/get-upgrade-diff.js +144 -0
- package/dist/operations/list-api-functions.d.ts +13 -0
- package/dist/operations/list-api-functions.js +53 -0
- package/dist/operations/list-containers.d.ts +13 -0
- package/dist/operations/list-containers.js +44 -0
- package/dist/operations/list-design-tokens.d.ts +13 -0
- package/dist/operations/list-design-tokens.js +47 -0
- package/dist/operations/list-events.d.ts +16 -0
- package/dist/operations/list-events.js +39 -0
- package/dist/operations/list-graphql-queries.d.ts +19 -0
- package/dist/operations/list-graphql-queries.js +84 -0
- package/dist/operations/list-i18n-keys.d.ts +19 -0
- package/dist/operations/list-i18n-keys.js +105 -0
- package/dist/operations/list-models.d.ts +16 -0
- package/dist/operations/list-models.js +80 -0
- package/dist/operations/list-slots.d.ts +16 -0
- package/dist/operations/list-slots.js +81 -0
- package/dist/operations/scaffold-block.d.ts +31 -0
- package/dist/operations/scaffold-block.js +331 -0
- package/dist/operations/scaffold-extension.d.ts +28 -0
- package/dist/operations/scaffold-extension.js +346 -0
- package/dist/operations/scaffold-slot.d.ts +22 -0
- package/dist/operations/scaffold-slot.js +189 -0
- package/dist/operations/search-commerce-docs.d.ts +16 -0
- package/dist/operations/search-commerce-docs.js +101 -0
- package/dist/operations/search-docs.d.ts +23 -0
- package/dist/operations/search-docs.js +298 -0
- package/dist/operations/suggest-event-handler.d.ts +16 -0
- package/dist/operations/suggest-event-handler.js +175 -0
- package/dist/operations/suggest-slot-implementation.d.ts +19 -0
- package/dist/operations/suggest-slot-implementation.js +183 -0
- package/dist/registry/api-functions.json +3045 -0
- package/dist/registry/block-patterns.json +78 -0
- package/dist/registry/containers.json +2003 -0
- package/dist/registry/design-tokens.json +577 -0
- package/dist/registry/docs/boilerplate.json +55 -0
- package/dist/registry/docs/dropins-all.json +97 -0
- package/dist/registry/docs/dropins-b2b.json +607 -0
- package/dist/registry/docs/dropins-cart.json +163 -0
- package/dist/registry/docs/dropins-checkout.json +193 -0
- package/dist/registry/docs/dropins-order.json +139 -0
- package/dist/registry/docs/dropins-payment-services.json +73 -0
- package/dist/registry/docs/dropins-personalization.json +67 -0
- package/dist/registry/docs/dropins-product-details.json +139 -0
- package/dist/registry/docs/dropins-product-discovery.json +85 -0
- package/dist/registry/docs/dropins-recommendations.json +67 -0
- package/dist/registry/docs/dropins-user-account.json +121 -0
- package/dist/registry/docs/dropins-user-auth.json +103 -0
- package/dist/registry/docs/dropins-wishlist.json +85 -0
- package/dist/registry/docs/get-started.json +85 -0
- package/dist/registry/docs/how-tos.json +19 -0
- package/dist/registry/docs/index.json +139 -0
- package/dist/registry/docs/licensing.json +19 -0
- package/dist/registry/docs/merchants.json +523 -0
- package/dist/registry/docs/resources.json +13 -0
- package/dist/registry/docs/sdk.json +139 -0
- package/dist/registry/docs/setup.json +145 -0
- package/dist/registry/docs/troubleshooting.json +19 -0
- package/dist/registry/events.json +2200 -0
- package/dist/registry/examples/index.json +19 -0
- package/dist/registry/examples/storefront-checkout.json +377 -0
- package/dist/registry/examples/storefront-quote-management.json +49 -0
- package/dist/registry/extensions.json +272 -0
- package/dist/registry/graphql.json +3469 -0
- package/dist/registry/i18n.json +1873 -0
- package/dist/registry/models.json +1001 -0
- package/dist/registry/sdk.json +2357 -0
- package/dist/registry/slots.json +2270 -0
- package/dist/registry/tools-components.json +595 -0
- package/dist/resources/guides.d.ts +7 -0
- package/dist/resources/guides.js +625 -0
- package/dist/resources/handlers.d.ts +31 -0
- package/dist/resources/handlers.js +322 -0
- package/package.json +47 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dropin": "storefront-quote-management",
|
|
3
|
+
"extensions": [],
|
|
4
|
+
"sharedExtensionFiles": {},
|
|
5
|
+
"blocks": [
|
|
6
|
+
{
|
|
7
|
+
"name": "commerce-auth",
|
|
8
|
+
"description": "Example commerce-auth block for storefront-quote-management",
|
|
9
|
+
"files": {
|
|
10
|
+
"commerce-auth.js": "/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { AuthCombine } from '@dropins/storefront-auth/containers/AuthCombine.js';\nimport { render as authProvider } from '@dropins/storefront-auth/render.js';\nimport { revokeCustomerToken } from '@dropins/storefront-auth/api.js';\nimport { events } from '@dropins/tools/event-bus.js';\n\nexport default async function decorate(block) {\n const blockAttributes = Array.from(block.attributes);\n\n const button = document.createElement('button');\n blockAttributes.forEach((attribute) => {\n button.setAttribute(attribute.name, attribute.value);\n });\n\n events.on(\n 'authenticated',\n (authenticated) => {\n if (authenticated) {\n button.innerText = 'Logout';\n button.removeEventListener('click', handleLoginClick);\n button.addEventListener('click', handleLogoutClick);\n } else {\n button.innerText = 'Login';\n button.removeEventListener('click', handleLogoutClick);\n button.addEventListener('click', handleLoginClick);\n }\n },\n {\n eager: true,\n }\n );\n\n button.removeAttribute('disabled');\n\n block.replaceWith(button);\n\n return button;\n}\n\nconst handleLoginClick = () => {\n const signInModal = document.createElement('div');\n signInModal.setAttribute('id', 'signin-modal');\n signInModal.onclick = () => {\n signInModal.remove();\n };\n\n const signInForm = document.createElement('div');\n signInForm.setAttribute('id', 'signin-form');\n signInForm.onclick = (event) => {\n event.stopPropagation();\n };\n\n authProvider.render(AuthCombine, {\n signInFormConfig: { renderSignUpLink: true },\n signUpFormConfig: {},\n resetPasswordFormConfig: {},\n })(signInForm);\n\n signInModal.appendChild(signInForm);\n document.body.appendChild(signInModal);\n\n events.on('authenticated', (authenticated) => {\n if (authenticated) {\n signInModal.remove();\n }\n });\n};\n\nconst handleLogoutClick = () => {\n revokeCustomerToken();\n};\n"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "commerce-b2b-manage-quote",
|
|
15
|
+
"description": "Example commerce-b2b-manage-quote block for storefront-quote-management",
|
|
16
|
+
"files": {
|
|
17
|
+
"commerce-b2b-manage-quote.js": "/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { ManageNegotiableQuote } from '@dropins/quote-management/containers/ManageNegotiableQuote.js';\nimport { QuotesListTable } from '@dropins/quote-management/containers/QuotesListTable.js';\nimport { render as quoteProvider } from '@dropins/quote-management/render.js';\nimport { events } from '@dropins/tools/event-bus.js';\n\nexport default async function decorate(block) {\n const urlParams = new URLSearchParams(window.location.search);\n const quoteId = urlParams.get('quoteId');\n\n if (!quoteId) {\n block.setAttribute('data-testid', 'quote-list-table');\n // Render the quote list table\n quoteProvider.render(QuotesListTable, {\n onViewQuote: (quoteId) => {\n window.location.href = `?quoteId=${quoteId}`;\n },\n })(block);\n } else {\n block.setAttribute('data-testid', 'manage-quote');\n // Render the manage quote component\n quoteProvider.render(ManageNegotiableQuote, {})(block);\n\n // On delete success: navigate back to quotes list after delay to show success banner\n const deleteListener = events.on('quote-management/negotiable-quote-deleted', ({ deletedQuoteUids }) => {\n if (deletedQuoteUids && deletedQuoteUids.length > 0) {\n // Delay redirect by 2 seconds\n setTimeout(() => {\n window.location.href = window.location.pathname;\n }, 2000);\n }\n }\n );\n\n // On duplicate success: navigate to new quote after delay to show success banner\n const duplicateListener = events.on('quote-management/quote-duplicated', ({ quote }) => {\n if (quote && quote.uid) {\n // Delay redirect by 2 seconds\n setTimeout(() => {\n window.location.href = `${window.location.pathname}?quoteId=${quote.uid}`;\n }, 2000);\n }\n }\n );\n\n // Clean up listeners if block is removed\n const observer = new MutationObserver(() => {\n if (!document.body.contains(block)) {\n deleteListener?.off();\n duplicateListener?.off();\n observer.disconnect();\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n}\n"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "commerce-b2b-manage-quote-templates",
|
|
22
|
+
"description": "Example commerce-b2b-manage-quote-templates block for storefront-quote-management",
|
|
23
|
+
"files": {
|
|
24
|
+
"commerce-b2b-manage-quote-templates.js": "import { QuoteTemplatesListTable } from '@dropins/quote-management/containers/QuoteTemplatesListTable.js';\nimport { ManageNegotiableQuoteTemplate } from '@dropins/quote-management/containers/ManageNegotiableQuoteTemplate.js';\nimport { render as quoteProvider } from '@dropins/quote-management/render.js';\nimport { events } from '@dropins/tools/event-bus.js';\n\nexport default async function decorate(block) {\n const urlParams = new URLSearchParams(window.location.search);\n const quoteTemplateId = urlParams.get('quoteTemplateId');\n\n // Helper function to navigate to the generated quote\n const navigateToQuote = (quoteId) => {\n if (quoteId) {\n // Delay redirect by 2 seconds to allow success banner to be seen\n setTimeout(() => {\n // Navigate to the quote management page with the new quote ID\n // Adjust the path based on your storefront structure\n window.location.href = `?quoteId=${quoteId}`;\n }, 2000);\n }\n };\n\n if (!quoteTemplateId) {\n block.setAttribute('data-testid', 'quote-template-list-table');\n // Render the quote list table\n quoteProvider.render(QuoteTemplatesListTable, {\n onViewQuoteTemplate: (templateId) => {\n window.location.href = `?quoteTemplateId=${templateId}`;\n },\n // On generate quote success: navigate to new quote after delay to show success banner\n onGenerateQuoteFromTemplate: (templateId, templateName, quoteId) => {\n navigateToQuote(quoteId);\n },\n })(block);\n } else {\n block.setAttribute('data-testid', 'manage-quote-template');\n // Render the manage quote template component\n quoteProvider.render(ManageNegotiableQuoteTemplate, {})(block);\n\n // On generate quote success: navigate to new quote after delay to show success banner\n const generateQuoteListener = events.on('quote-management/quote-template-generated', ({ quoteId }) => {\n navigateToQuote(quoteId);\n }\n );\n\n // Clean up listeners if block is removed\n const observer = new MutationObserver(() => {\n if (!document.body.contains(block)) {\n generateQuoteListener?.off();\n observer.disconnect();\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n}\n"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "commerce-b2b-request-quote-button",
|
|
29
|
+
"description": "Example commerce-b2b-request-quote-button block for storefront-quote-management",
|
|
30
|
+
"files": {
|
|
31
|
+
"commerce-b2b-request-quote-button.js": "/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { events } from '@dropins/tools/event-bus.js';\nimport { RequestNegotiableQuoteForm } from '@dropins/quote-management/containers/RequestNegotiableQuoteForm.js';\nimport { render as quoteProvider } from '@dropins/quote-management/render.js';\nimport { Icon, Button, provider as UI } from '@dropins/tools/components.js';\nimport { h } from '@dropins/tools/preact.js';\n\nexport default async function decorate(block) {\n block.setAttribute('hidden', true);\n\n const button = document.createElement('button');\n button.textContent = 'Request Quote';\n button.setAttribute('disabled', true);\n\n let cartId = null;\n const uniqueId = Date.now();\n\n button.addEventListener('click', async () => {\n if (!cartId) {\n return;\n }\n\n button.setAttribute('disabled', true);\n button.textContent = 'Requesting...';\n\n const resetButton = () => {\n button.textContent = 'Request Quote';\n button.removeAttribute('disabled');\n };\n\n showQuoteForm(cartId, resetButton);\n });\n\n events.on('cart/data', (data) => {\n const isEmpty = data?.items?.length === 0 ?? true;\n const isGuest = data?.isGuestCart ?? true;\n\n // Only enable if not guest and cart is not empty\n if (!isGuest && !isEmpty) {\n cartId = data?.id;\n block.removeAttribute('hidden');\n button.removeAttribute('disabled');\n }\n else {\n block.setAttribute('hidden', true);\n button.setAttribute('disabled', true);\n }\n }, {\n eager: true,\n });\n\n block.appendChild(button);\n}\n\nconst showQuoteForm = async (cartId, onClose) => {\n const quoteModal = document.createElement('div');\n quoteModal.setAttribute('id', 'quote-modal');\n\n // Close the quote modal when a negotiable quote is requested\n const { off: unsubscribe } = events.on('quote-management/negotiable-quote-requested', () => {\n setTimeout(() => {\n quoteModal.dispatchEvent(new CustomEvent('close-modal'));\n }, 3000);\n });\n\n quoteModal.addEventListener('close-modal', () => {\n // Unsubscribe from the event when the quote modal is closed to avoid memory leaks\n unsubscribe();\n quoteModal.remove();\n onClose && onClose();\n })\n\n quoteModal.onclick = () => {\n quoteModal.dispatchEvent(new CustomEvent('close-modal'));\n };\n\n const quoteForm = document.createElement('div');\n quoteForm.setAttribute('id', 'quote-form');\n quoteForm.onclick = (event) => {\n // Prevent the event from bubbling up to the quote modal\n event.stopPropagation();\n };\n\n quoteProvider.render(RequestNegotiableQuoteForm, {\n cartId,\n onError: (message) => {\n console.error('onError', message);\n },\n onSubmitErrors: (errors) => {\n console.error('onSubmitErrors', errors);\n },\n slots: {\n // Append a close button to the Save Draft button\n SaveDraftButton: (ctx) => {\n const closeButtonContainer = document.createElement('div');\n UI.render(Button, {\n type: 'button',\n children: 'Close',\n onClick: () => {\n quoteModal.dispatchEvent(new CustomEvent('close-modal'));\n },\n variant: 'secondary',\n })(closeButtonContainer);\n ctx.appendSibling(closeButtonContainer);\n }\n },\n })(quoteForm);\n\n // Append a close button to the quote form\n UI.render(Button, {\n type: 'button',\n className: 'quote-form__close-button',\n onClick: () => {\n quoteModal.dispatchEvent(new CustomEvent('close-modal'));\n },\n icon: h(Icon, {\n source: 'Close'\n }),\n variant: 'tertiary',\n })(quoteForm);\n\n quoteModal.appendChild(quoteForm);\n document.body.appendChild(quoteModal);\n}\n"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "commerce-b2b-set-shipping-address",
|
|
36
|
+
"description": "Example commerce-b2b-set-shipping-address block for storefront-quote-management",
|
|
37
|
+
"files": {
|
|
38
|
+
"commerce-b2b-set-shipping-address.js": "/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\n/**\n * Set Shipping Address Button Block\n * \n * This block creates a test button that calls the setShippingAddress API\n * with a hardcoded address. It serves as a reference implementation for\n * developers integrating the shipping address feature.\n */\n\nimport { setShippingAddress } from '@dropins/quote-management/api.js';\n\n/**\n * Hardcoded test address for demonstration purposes.\n * In a production application, this would come from a proper address\n * selection UI (e.g., Account Drop-in address selector).\n */\nconst TEST_ADDRESS = {\n firstname: 'John',\n lastname: 'Doe',\n company: 'Adobe Inc.',\n street: ['345 Park Avenue'],\n city: 'San Jose',\n region: 'CA',\n postcode: '95110',\n countryCode: 'US',\n telephone: '555-0123',\n saveInAddressBook: false,\n};\n\n/**\n * Decorates a button element with shipping address functionality.\n * \n * @param {HTMLElement} element - The button element to decorate\n */\nexport default function decorateSetShippingAddressButton(element) {\n element.textContent = 'Set Test Shipping Address';\n \n element.addEventListener('click', async () => {\n // Get quote ID from URL parameters\n const urlParams = new URLSearchParams(window.location.search);\n const quoteId = urlParams.get('quoteId');\n \n // Validate that a quote is selected\n if (!quoteId) {\n alert('No active quote selected. Please navigate to a quote first.');\n return;\n }\n \n // Show loading state\n element.disabled = true;\n const originalText = element.textContent;\n element.textContent = '⏳ Setting address...';\n \n try {\n // Call the setShippingAddress API with hardcoded test data\n const updatedQuote = await setShippingAddress({\n quoteUid: quoteId,\n addressData: TEST_ADDRESS,\n });\n \n // Success feedback\n element.textContent = '✅ Address Set Successfully';\n console.log('✅ Shipping address updated successfully');\n console.log('Updated quote:', updatedQuote);\n \n // Reset button after 2 seconds\n setTimeout(() => {\n element.disabled = false;\n element.textContent = originalText;\n }, 2000);\n \n } catch (error) {\n // Error feedback\n element.textContent = '❌ Failed';\n console.error('❌ Error setting shipping address:', error);\n \n // Show user-friendly error message\n alert(`Failed to set shipping address: ${error.message}`);\n \n // Reset button after 2 seconds\n setTimeout(() => {\n element.disabled = false;\n element.textContent = originalText;\n }, 2000);\n }\n });\n}\n\n"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "commerce-cart-setup",
|
|
43
|
+
"description": "Example commerce-cart-setup block for storefront-quote-management",
|
|
44
|
+
"files": {
|
|
45
|
+
"commerce-cart-setup.js": "/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { events } from '@dropins/tools/event-bus.js';\nimport { addProductsToCart } from '@dropins/storefront-cart/api.js';\n\nexport default async function decorate(block) {\n const blockAttributes = Array.from(block.attributes);\n\n const button = document.createElement('button');\n blockAttributes.forEach(attribute => {\n button.setAttribute(attribute.name, attribute.value);\n });\n\n button.innerText = 'Cart Setup';\n button.addEventListener('click', handleCartSetupClick);\n\n block.replaceWith(button);\n\n events.on('cart/data', (data) => {\n const isEmpty = data?.items?.length === 0 ?? true;\n const isGuest = data?.isGuestCart ?? true;\n\n // Only enable if not guest and cart is empty\n if (!isGuest && isEmpty) {\n button.removeAttribute('disabled');\n }\n else {\n button.setAttribute('disabled', true);\n }\n });\n\n return button;\n}\n\nconst handleCartSetupClick = async (event) => {\n event.preventDefault();\n\n const cartItems = JSON.parse(event.target.dataset.cartItems);\n\n const { data } = await addProductsToCart(cartItems);\n\n console.log('data', data);\n}"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"description": "Auto-generated extension registry from checkout extension block examples",
|
|
4
|
+
"managerImport": "import { getExtensionManager } from './extension-manager.js'",
|
|
5
|
+
"managerDescription": "Use getExtensionManager() to load and execute extensions. getExtensionManager() is a singleton wrapper around createExtensionManager (from '@dropins/tools/lib.js') — it initializes once with the extensions registered in extensions/index.js and reuses the same instance thereafter. Hooks are executed via extensionManager.executeHook(hookName, context).",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"name": "checkout/address-form-render",
|
|
9
|
+
"description": "Customize address form rendering — extensions wrap context.render() to augment behavior before/after rendering",
|
|
10
|
+
"whenFired": "When an address form (shipping or billing) mounts in the DOM",
|
|
11
|
+
"contextShape": {
|
|
12
|
+
"container": "HTMLElement — the address form container element",
|
|
13
|
+
"addressType": "string — 'shipping' or 'billing'",
|
|
14
|
+
"formProps": "object — the form configuration props",
|
|
15
|
+
"render": "function — the default render function, can be wrapped by extensions",
|
|
16
|
+
"getFormContainer": "function — returns the form container reference for setting props",
|
|
17
|
+
"hasCartAddress": "boolean — whether the cart already has an address of this type",
|
|
18
|
+
"addressDataKey": "string — session storage key for cached address data"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "checkout/payment-methods",
|
|
23
|
+
"description": "Register custom payment methods in the checkout UI",
|
|
24
|
+
"whenFired": "During payment method rendering, before methods are displayed",
|
|
25
|
+
"contextShape": {
|
|
26
|
+
"paymentMethods": "Record<string, PaymentMethodConfig> — add entries to register custom payment methods"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "checkout/payment-response",
|
|
31
|
+
"description": "Handle payment gateway response after redirect-based payment processing",
|
|
32
|
+
"whenFired": "At the very start of checkout initialization, before the checkout renders — use this to detect if the user is returning from a payment redirect and handle the response before normal checkout flow begins",
|
|
33
|
+
"contextShape": {
|
|
34
|
+
"block": "HTMLElement — the checkout block DOM element",
|
|
35
|
+
"shouldExit": "boolean — set to true to stop the redirect flow"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "checkout/place-order",
|
|
40
|
+
"description": "Customize or intercept the order placement process",
|
|
41
|
+
"whenFired": "After validation passes, during order submission",
|
|
42
|
+
"contextShape": {
|
|
43
|
+
"cartId": "string — the cart ID",
|
|
44
|
+
"code": "string — payment method code",
|
|
45
|
+
"preventDefault": "boolean — set to true to handle order placement yourself"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "checkout/shipping-methods-render",
|
|
50
|
+
"description": "Customize shipping methods rendering — extensions wrap context.render() to augment behavior before/after rendering, including customizing each ShippingMethodItem via slots",
|
|
51
|
+
"whenFired": "When the ShippingMethods container mounts and renders available shipping options",
|
|
52
|
+
"contextShape": {
|
|
53
|
+
"container": "HTMLElement — the shipping methods container element",
|
|
54
|
+
"render": "function — the default render function, can be wrapped by extensions. Accepts optional props including slots.ShippingMethodItem"
|
|
55
|
+
},
|
|
56
|
+
"slotContext": {
|
|
57
|
+
"ShippingMethodItem": {
|
|
58
|
+
"method": "ShippingMethod — the shipping method object (includes value, title, amount, carrier, etc.)",
|
|
59
|
+
"isSelected": "boolean — whether this method is currently selected",
|
|
60
|
+
"onSelect": "function — call to select this shipping method",
|
|
61
|
+
"replaceWith": "function(element) — replace the default item with a custom element",
|
|
62
|
+
"onRender": "function(callback) — register a callback invoked on re-renders (e.g., when selection changes). Receives the updated context"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "checkout/validate",
|
|
68
|
+
"description": "Add custom validation logic before order placement",
|
|
69
|
+
"whenFired": "When the user clicks Place Order — runs only after default form validation passes, so extensions can assume basic form fields are valid",
|
|
70
|
+
"contextShape": {
|
|
71
|
+
"code": "string — payment method code",
|
|
72
|
+
"isValid": "boolean — set to false to block order placement"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"existingExtensions": [
|
|
77
|
+
{
|
|
78
|
+
"id": "address-autocomplete",
|
|
79
|
+
"name": "Address Autocomplete Extension",
|
|
80
|
+
"hooks": [
|
|
81
|
+
"checkout/address-form-render"
|
|
82
|
+
],
|
|
83
|
+
"externalScripts": [],
|
|
84
|
+
"externalStyles": [
|
|
85
|
+
"${extensionBasePath}address-autocomplete.css"
|
|
86
|
+
],
|
|
87
|
+
"sourceFile": "address-autocomplete/address-autocomplete-extension.js"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "address-validation",
|
|
91
|
+
"name": "Address Validation Extension",
|
|
92
|
+
"hooks": [
|
|
93
|
+
"checkout/validate"
|
|
94
|
+
],
|
|
95
|
+
"externalScripts": [],
|
|
96
|
+
"externalStyles": [
|
|
97
|
+
"${extensionBasePath}address-validation-extension.css"
|
|
98
|
+
],
|
|
99
|
+
"sourceFile": "address-validation/address-validation-extension.js"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "adyen-bancontact",
|
|
103
|
+
"name": "Adyen Bancontact",
|
|
104
|
+
"hooks": [
|
|
105
|
+
"checkout/payment-methods",
|
|
106
|
+
"checkout/validate",
|
|
107
|
+
"checkout/place-order"
|
|
108
|
+
],
|
|
109
|
+
"externalScripts": [],
|
|
110
|
+
"externalStyles": [],
|
|
111
|
+
"sourceFile": "adyen/adyen-bancontact-extension.js"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "adyen-blik",
|
|
115
|
+
"name": "Adyen BLIK",
|
|
116
|
+
"hooks": [
|
|
117
|
+
"checkout/payment-methods",
|
|
118
|
+
"checkout/validate",
|
|
119
|
+
"checkout/place-order"
|
|
120
|
+
],
|
|
121
|
+
"externalScripts": [],
|
|
122
|
+
"externalStyles": [],
|
|
123
|
+
"sourceFile": "adyen/adyen-blik-extension.js"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "adyen-cc",
|
|
127
|
+
"name": "Adyen Credit Card",
|
|
128
|
+
"hooks": [
|
|
129
|
+
"checkout/payment-methods",
|
|
130
|
+
"checkout/validate",
|
|
131
|
+
"checkout/place-order"
|
|
132
|
+
],
|
|
133
|
+
"externalScripts": [],
|
|
134
|
+
"externalStyles": [],
|
|
135
|
+
"sourceFile": "adyen/adyen-cc-extension.js"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "adyen-cc-vault",
|
|
139
|
+
"name": "Adyen Credit Card Vault",
|
|
140
|
+
"hooks": [
|
|
141
|
+
"checkout/payment-methods",
|
|
142
|
+
"checkout/place-order"
|
|
143
|
+
],
|
|
144
|
+
"externalScripts": [],
|
|
145
|
+
"externalStyles": [],
|
|
146
|
+
"sourceFile": "adyen/adyen-cc-vault-extension.js"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"id": "adyen-googlepay",
|
|
150
|
+
"name": "Adyen Google Pay",
|
|
151
|
+
"hooks": [
|
|
152
|
+
"checkout/payment-methods"
|
|
153
|
+
],
|
|
154
|
+
"externalScripts": [],
|
|
155
|
+
"externalStyles": [],
|
|
156
|
+
"sourceFile": "adyen/adyen-googlepay-extension.js"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "adyen-ideal",
|
|
160
|
+
"name": "Adyen iDEAL",
|
|
161
|
+
"hooks": [
|
|
162
|
+
"checkout/payment-response",
|
|
163
|
+
"checkout/payment-methods",
|
|
164
|
+
"checkout/place-order"
|
|
165
|
+
],
|
|
166
|
+
"externalScripts": [],
|
|
167
|
+
"externalStyles": [],
|
|
168
|
+
"sourceFile": "adyen/adyen-ideal-extension.js"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "adyen-klarna",
|
|
172
|
+
"name": "Adyen Klarna",
|
|
173
|
+
"hooks": [
|
|
174
|
+
"checkout/payment-response",
|
|
175
|
+
"checkout/payment-methods",
|
|
176
|
+
"checkout/place-order"
|
|
177
|
+
],
|
|
178
|
+
"externalScripts": [],
|
|
179
|
+
"externalStyles": [],
|
|
180
|
+
"sourceFile": "adyen/adyen-klarna-extension.js"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "adyen-klarna-account",
|
|
184
|
+
"name": "Adyen Klarna Pay Over Time",
|
|
185
|
+
"hooks": [
|
|
186
|
+
"checkout/payment-response",
|
|
187
|
+
"checkout/payment-methods",
|
|
188
|
+
"checkout/place-order"
|
|
189
|
+
],
|
|
190
|
+
"externalScripts": [],
|
|
191
|
+
"externalStyles": [],
|
|
192
|
+
"sourceFile": "adyen/adyen-klarna-account-extension.js"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "adyen-paypal",
|
|
196
|
+
"name": "Adyen PayPal",
|
|
197
|
+
"hooks": [
|
|
198
|
+
"checkout/payment-response",
|
|
199
|
+
"checkout/payment-methods"
|
|
200
|
+
],
|
|
201
|
+
"externalScripts": [],
|
|
202
|
+
"externalStyles": [],
|
|
203
|
+
"sourceFile": "adyen/adyen-paypal-extension.js"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"id": "bopis",
|
|
207
|
+
"name": "Buy Online Pickup In Store",
|
|
208
|
+
"hooks": [
|
|
209
|
+
"checkout/address-form-render",
|
|
210
|
+
"checkout/validate"
|
|
211
|
+
],
|
|
212
|
+
"externalScripts": [],
|
|
213
|
+
"externalStyles": [
|
|
214
|
+
"${extensionBasePath}bopis.css"
|
|
215
|
+
],
|
|
216
|
+
"sourceFile": "bopis/bopis-extension.js"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "braintree-payment",
|
|
220
|
+
"name": "Braintree Payment Gateway",
|
|
221
|
+
"hooks": [
|
|
222
|
+
"checkout/payment-methods",
|
|
223
|
+
"checkout/place-order"
|
|
224
|
+
],
|
|
225
|
+
"externalScripts": [
|
|
226
|
+
"https://js.braintreegateway.com/web/dropin/1.43.0/js/dropin.min.js"
|
|
227
|
+
],
|
|
228
|
+
"externalStyles": [],
|
|
229
|
+
"sourceFile": "braintree/braintree-extension.js"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "custom-shipping-methods",
|
|
233
|
+
"name": "Custom Shipping Methods",
|
|
234
|
+
"hooks": [
|
|
235
|
+
"checkout/shipping-methods-render"
|
|
236
|
+
],
|
|
237
|
+
"externalScripts": [],
|
|
238
|
+
"externalStyles": [
|
|
239
|
+
"${extensionBasePath}custom-shipping-methods-extension.css"
|
|
240
|
+
],
|
|
241
|
+
"sourceFile": "custom-shipping-methods/custom-shipping-methods-extension.js"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"id": "recurring-order",
|
|
245
|
+
"name": "Recurring Order Extension",
|
|
246
|
+
"hooks": [
|
|
247
|
+
"checkout/shipping-methods-render",
|
|
248
|
+
"checkout/validate",
|
|
249
|
+
"checkout/place-order"
|
|
250
|
+
],
|
|
251
|
+
"externalScripts": [],
|
|
252
|
+
"externalStyles": [
|
|
253
|
+
"${extensionBasePath}recurring-order-extension.css"
|
|
254
|
+
],
|
|
255
|
+
"sourceFile": "recurring-order/recurring-order-extension.js"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "test-extension",
|
|
259
|
+
"name": "Test Extension (Hooks Demo)",
|
|
260
|
+
"hooks": [
|
|
261
|
+
"checkout/validate",
|
|
262
|
+
"checkout/payment-methods",
|
|
263
|
+
"checkout/place-order"
|
|
264
|
+
],
|
|
265
|
+
"externalScripts": [],
|
|
266
|
+
"externalStyles": [
|
|
267
|
+
"${extensionBasePath}test-extension.css"
|
|
268
|
+
],
|
|
269
|
+
"sourceFile": "test-extension/test-extension.js"
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
}
|