@dropins/storefront-pdp 1.2.0-beta3 → 1.2.0-beta4
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.
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '../../../@adobe-commerce/elsie/src/lib';
|
|
2
|
+
import { Container, SlotProps } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
|
+
type DefaultSlotContext = {
|
|
6
|
+
data: ProductModel | null;
|
|
7
|
+
};
|
|
5
8
|
export interface ProductAttributesProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
slots?: {
|
|
10
|
+
Attributes?: SlotProps<DefaultSlotContext>;
|
|
11
|
+
};
|
|
6
12
|
}
|
|
7
13
|
export declare const ProductAttributes: Container<ProductAttributesProps, ProductModel | null>;
|
|
14
|
+
export {};
|
|
8
15
|
//# sourceMappingURL=ProductAttributes.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as
|
|
3
|
+
import{jsxs as c,jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{useState as m,useMemo as h,useEffect as x}from"@dropins/tools/preact-compat.js";import{classes as P,Slot as A}from"@dropins/tools/lib.js";import{events as s}from"@dropins/tools/event-bus.js";import{i as L,t as j}from"../chunks/date.js";import{g as C}from"../chunks/getFetchedProductData.js";import{useText as I}from"@dropins/tools/i18n.js";import{c as M}from"../chunks/isProductConfigurationValid.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";const N=({initialData:l=null,children:T,slots:e,...i})=>{var n;const u=I("PDP.Product.Details.label").label,{defaultLocale:f="en-US"}=M.getConfig(),[d,p]=m(f),[r,b]=m(l),g=h(()=>({data:r}),[r]);return x(()=>{const o=s.on("pdp/data",b),t=s.on("locale",p);return()=>{o==null||o.off(),t==null||t.off()}},[]),r?c("div",{...i,className:P(["pdp-attributes",i.className]),children:[u,e!=null&&e.Attributes?a(A,{name:"Attributes",slot:e==null?void 0:e.Attributes,context:{...g}}):a("ul",{children:(n=r==null?void 0:r.attributes)==null?void 0:n.map(({label:o,value:t},D)=>{const S=L(t)?j(t,d):t.toString();return c("li",{children:[o,": ",a("span",{dangerouslySetInnerHTML:{__html:S}})]},D)})})]}):null};N.getInitialData=C;export{N as ProductAttributes,N as default};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-pdp", "version": "1.2.0-
|
|
1
|
+
{"name": "@dropins/storefront-pdp", "version": "1.2.0-beta4", "@dropins/tools": "~1.2.0", "license": "SEE LICENSE IN LICENSE.md"}
|