|
5854 | 5854 | "syntaxKind": "PropertySignature", |
5855 | 5855 | "name": "renderMode", |
5856 | 5856 | "value": "ShippingOptionItemRenderMode", |
5857 | | - "description": "The render mode of this shipping option, indicating how the extension is displayed in the checkout UI." |
| 5857 | + "description": "The render mode of this shipping option, indicating how the extension is displayed in the checkout UI.", |
| 5858 | + "deprecationMessage": "Do not rely on render context. This target can render inside an overlay, so use inline UI instead of opening overlays such as modals." |
5858 | 5859 | }, |
5859 | 5860 | { |
5860 | 5861 | "filePath": "src/surfaces/checkout/api/shipping/shipping-option-item.ts", |
|
5864 | 5865 | "description": "The shipping option that this extension is attached to. Use this to read the option's cost, carrier, delivery estimate, and other details.\n\nAvailable only on the corresponding item target. Shipping option item targets expose shipping option properties; pickup location item targets expose pickup location properties." |
5865 | 5866 | } |
5866 | 5867 | ], |
5867 | | - "value": "export interface ShippingOptionItemApi {\n /**\n * The shipping option that this extension is attached to. Use this to read the option's cost, carrier, delivery estimate, and other details.\n *\n * Available only on the corresponding item target. Shipping option item\n * targets expose shipping option properties; pickup location item targets\n * expose pickup location properties.\n */\n target: SubscribableSignalLike<ShippingOption>;\n\n /**\n * Whether the buyer has selected the target shipping option. When `true`, the target option is the buyer's active choice. When `false`, the buyer has chosen a different shipping option.\n *\n * Available only on the corresponding item target. Shipping option item\n * targets expose shipping option properties; pickup location item targets\n * expose pickup location properties.\n */\n isTargetSelected: SubscribableSignalLike<boolean>;\n\n /**\n * The render mode of this shipping option, indicating how the extension is displayed in the checkout UI.\n */\n renderMode: ShippingOptionItemRenderMode;\n}" |
| 5868 | + "value": "export interface ShippingOptionItemApi {\n /**\n * The shipping option that this extension is attached to. Use this to read the option's cost, carrier, delivery estimate, and other details.\n *\n * Available only on the corresponding item target. Shipping option item\n * targets expose shipping option properties; pickup location item targets\n * expose pickup location properties.\n */\n target: SubscribableSignalLike<ShippingOption>;\n\n /**\n * Whether the buyer has selected the target shipping option. When `true`, the target option is the buyer's active choice. When `false`, the buyer has chosen a different shipping option.\n *\n * Available only on the corresponding item target. Shipping option item\n * targets expose shipping option properties; pickup location item targets\n * expose pickup location properties.\n */\n isTargetSelected: SubscribableSignalLike<boolean>;\n\n /**\n * The render mode of this shipping option, indicating how the extension is displayed in the checkout UI.\n *\n * @deprecated Do not rely on render context. This target can render inside an overlay, so use inline UI instead of opening overlays such as modals.\n */\n renderMode: ShippingOptionItemRenderMode;\n}" |
5868 | 5869 | } |
5869 | 5870 | }, |
5870 | 5871 | "ShippingOptionItemRenderMode": { |
|
5879 | 5880 | "syntaxKind": "PropertySignature", |
5880 | 5881 | "name": "overlay", |
5881 | 5882 | "value": "boolean", |
5882 | | - "description": "Whether the shipping option is rendered in an overlay. When `true`, the extension appears in a modal or sheet on top of the checkout page. When `false`, the extension renders inline within the shipping options list." |
| 5883 | + "description": "Whether the shipping option is rendered in an overlay. When `true`, the extension appears in a modal or sheet on top of the checkout page. When `false`, the extension renders inline within the shipping options list.", |
| 5884 | + "deprecationMessage": "Do not rely on render context. Use inline UI instead of opening overlays such as modals." |
5883 | 5885 | } |
5884 | 5886 | ], |
5885 | | - "value": "export interface ShippingOptionItemRenderMode {\n /**\n * Whether the shipping option is rendered in an overlay. When `true`, the extension appears in a modal or sheet on top of the checkout page. When `false`, the extension renders inline within the shipping options list.\n */\n overlay: boolean;\n}" |
| 5887 | + "value": "export interface ShippingOptionItemRenderMode {\n /**\n * Whether the shipping option is rendered in an overlay. When `true`, the extension appears in a modal or sheet on top of the checkout page. When `false`, the extension renders inline within the shipping options list.\n *\n * @deprecated Do not rely on render context. Use inline UI instead of opening overlays such as modals.\n */\n overlay: boolean;\n}" |
5886 | 5888 | } |
5887 | 5889 | }, |
5888 | 5890 | "ShippingOptionListApi": { |
@@ -168159,10 +168161,10 @@ |
168159 | 168161 | "returns": { |
168160 | 168162 | "filePath": "src/surfaces/checkout/preact/shipping-option-target.ts", |
168161 | 168163 | "description": "", |
168162 | | - "name": "{\n shippingOptionTarget: ShippingOption;\n isTargetSelected: boolean;\n renderMode: ShippingOptionItemRenderMode;\n}", |
168163 | | - "value": "{\n shippingOptionTarget: ShippingOption;\n isTargetSelected: boolean;\n renderMode: ShippingOptionItemRenderMode;\n}" |
| 168164 | + "name": "{\n shippingOptionTarget: ShippingOption;\n isTargetSelected: boolean;\n /**\n * @deprecated Do not rely on render context. This target can render inside an overlay, so use inline UI instead of opening overlays such as modals.\n */\n renderMode: ShippingOptionItemRenderMode;\n}", |
| 168165 | + "value": "{\n shippingOptionTarget: ShippingOption;\n isTargetSelected: boolean;\n /**\n * @deprecated Do not rely on render context. This target can render inside an overlay, so use inline UI instead of opening overlays such as modals.\n */\n renderMode: ShippingOptionItemRenderMode;\n}" |
168164 | 168166 | }, |
168165 | | - "value": "export function useShippingOptionTarget(): {\n shippingOptionTarget: ShippingOption;\n isTargetSelected: boolean;\n renderMode: ShippingOptionItemRenderMode;\n} {\n const api = useApi<\n | 'purchase.checkout.shipping-option-item.render-after'\n | 'purchase.checkout.shipping-option-item.details.render'\n >();\n if (!api.target || api.isTargetSelected === undefined) {\n throw new ExtensionHasNoTargetError(\n 'useShippingOptionTarget',\n api.extension.target,\n );\n }\n\n const shippingOptionTarget = useSubscription(api.target);\n const isTargetSelected = useSubscription(api.isTargetSelected);\n const renderMode = api.renderMode;\n\n const shippingOption = useMemo(() => {\n return {\n shippingOptionTarget,\n isTargetSelected,\n renderMode,\n };\n }, [shippingOptionTarget, isTargetSelected, renderMode]);\n\n return shippingOption;\n}" |
| 168167 | + "value": "export function useShippingOptionTarget(): {\n shippingOptionTarget: ShippingOption;\n isTargetSelected: boolean;\n /**\n * @deprecated Do not rely on render context. This target can render inside an overlay, so use inline UI instead of opening overlays such as modals.\n */\n renderMode: ShippingOptionItemRenderMode;\n} {\n const api = useApi<\n | 'purchase.checkout.shipping-option-item.render-after'\n | 'purchase.checkout.shipping-option-item.details.render'\n >();\n if (!api.target || api.isTargetSelected === undefined) {\n throw new ExtensionHasNoTargetError(\n 'useShippingOptionTarget',\n api.extension.target,\n );\n }\n\n const shippingOptionTarget = useSubscription(api.target);\n const isTargetSelected = useSubscription(api.isTargetSelected);\n const renderMode = api.renderMode;\n\n const shippingOption = useMemo(() => {\n return {\n shippingOptionTarget,\n isTargetSelected,\n renderMode,\n };\n }, [shippingOptionTarget, isTargetSelected, renderMode]);\n\n return shippingOption;\n}" |
168166 | 168168 | } |
168167 | 168169 | }, |
168168 | 168170 | "UseShopGeneratedType": { |
|
0 commit comments