@plasmicpkgs/commerce 0.0.56 → 0.0.59
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/dist/commerce.cjs.development.js +34 -10
- package/dist/commerce.cjs.development.js.map +1 -1
- package/dist/commerce.cjs.production.min.js +1 -1
- package/dist/commerce.cjs.production.min.js.map +1 -1
- package/dist/commerce.esm.js +34 -10
- package/dist/commerce.esm.js.map +1 -1
- package/dist/registerCategoryCollection.d.ts +1 -0
- package/dist/registerProductCollection.d.ts +1 -0
- package/package.json +3 -3
package/dist/commerce.esm.js
CHANGED
|
@@ -1600,9 +1600,6 @@ var categoryCollectionMeta = {
|
|
|
1600
1600
|
}
|
|
1601
1601
|
}]
|
|
1602
1602
|
},
|
|
1603
|
-
noLayout: {
|
|
1604
|
-
type: "boolean"
|
|
1605
|
-
},
|
|
1606
1603
|
emptyMessage: {
|
|
1607
1604
|
type: "slot",
|
|
1608
1605
|
defaultValue: {
|
|
@@ -1631,6 +1628,16 @@ var categoryCollectionMeta = {
|
|
|
1631
1628
|
};
|
|
1632
1629
|
})) != null ? _ctx$categories$map : [];
|
|
1633
1630
|
}
|
|
1631
|
+
},
|
|
1632
|
+
noLayout: {
|
|
1633
|
+
type: "boolean",
|
|
1634
|
+
displayName: "No layout",
|
|
1635
|
+
description: "Do not render a container element."
|
|
1636
|
+
},
|
|
1637
|
+
noAutoRepeat: {
|
|
1638
|
+
type: "boolean",
|
|
1639
|
+
displayName: "No auto-repeat",
|
|
1640
|
+
description: "Do not automatically repeat children for every category."
|
|
1634
1641
|
}
|
|
1635
1642
|
},
|
|
1636
1643
|
defaultStyles: {
|
|
@@ -1649,6 +1656,7 @@ function CategoryCollection(props) {
|
|
|
1649
1656
|
|
|
1650
1657
|
var children = props.children,
|
|
1651
1658
|
noLayout = props.noLayout,
|
|
1659
|
+
noAutoRepeat = props.noAutoRepeat,
|
|
1652
1660
|
className = props.className,
|
|
1653
1661
|
loadingMessage = props.loadingMessage,
|
|
1654
1662
|
emptyMessage = props.emptyMessage,
|
|
@@ -1679,7 +1687,7 @@ function CategoryCollection(props) {
|
|
|
1679
1687
|
var firstCategoryNotEmptyIndex = (_categories$findIndex = categories == null ? void 0 : categories.findIndex(function (category) {
|
|
1680
1688
|
return !category.isEmpty;
|
|
1681
1689
|
})) != null ? _categories$findIndex : -1;
|
|
1682
|
-
var renderedData = categories == null ? void 0 : categories.map(function (category, i) {
|
|
1690
|
+
var renderedData = noAutoRepeat ? children : categories == null ? void 0 : categories.map(function (category, i) {
|
|
1683
1691
|
return React.createElement(CategoryProvider, {
|
|
1684
1692
|
category: category,
|
|
1685
1693
|
key: category.id
|
|
@@ -1694,11 +1702,14 @@ function CategoryCollection(props) {
|
|
|
1694
1702
|
return React.isValidElement(emptyMessage) ? emptyMessage : null;
|
|
1695
1703
|
}
|
|
1696
1704
|
|
|
1697
|
-
return React.createElement(
|
|
1705
|
+
return React.createElement(DataProvider, {
|
|
1706
|
+
name: "categories",
|
|
1707
|
+
data: categories
|
|
1708
|
+
}, React.createElement(PrimaryCategoryContext.Provider, {
|
|
1698
1709
|
value: firstCategoryNotEmpty != null ? firstCategoryNotEmpty : categories[0]
|
|
1699
1710
|
}, noLayout ? React.createElement(React.Fragment, null, renderedData) : React.createElement("div", {
|
|
1700
1711
|
className: className
|
|
1701
|
-
}, renderedData));
|
|
1712
|
+
}, renderedData)));
|
|
1702
1713
|
}
|
|
1703
1714
|
function registerCategoryCollection(loader, customCategoryCollectionMeta) {
|
|
1704
1715
|
var doRegisterComponent = function doRegisterComponent() {
|
|
@@ -2111,7 +2122,16 @@ var productCollectionMeta = {
|
|
|
2111
2122
|
value: "price-desc"
|
|
2112
2123
|
}]
|
|
2113
2124
|
},
|
|
2114
|
-
noLayout:
|
|
2125
|
+
noLayout: {
|
|
2126
|
+
type: "boolean",
|
|
2127
|
+
displayName: "No layout",
|
|
2128
|
+
description: "Do not render a container element."
|
|
2129
|
+
},
|
|
2130
|
+
noAutoRepeat: {
|
|
2131
|
+
type: "boolean",
|
|
2132
|
+
displayName: "No auto-repeat",
|
|
2133
|
+
description: "Do not automatically repeat children for every category."
|
|
2134
|
+
}
|
|
2115
2135
|
},
|
|
2116
2136
|
defaultStyles: {
|
|
2117
2137
|
display: "grid",
|
|
@@ -2135,6 +2155,7 @@ function ProductCollection(props) {
|
|
|
2135
2155
|
includeSubCategories = props.includeSubCategories,
|
|
2136
2156
|
brand = props.brand,
|
|
2137
2157
|
noLayout = props.noLayout,
|
|
2158
|
+
noAutoRepeat = props.noAutoRepeat,
|
|
2138
2159
|
setControlContextData = props.setControlContextData,
|
|
2139
2160
|
emptyMessage = props.emptyMessage,
|
|
2140
2161
|
loadingMessage = props.loadingMessage,
|
|
@@ -2175,7 +2196,7 @@ function ProductCollection(props) {
|
|
|
2175
2196
|
});
|
|
2176
2197
|
}
|
|
2177
2198
|
|
|
2178
|
-
var renderedData = data == null ? void 0 : data.products.map(function (product, i) {
|
|
2199
|
+
var renderedData = noAutoRepeat ? children : data == null ? void 0 : data.products.map(function (product, i) {
|
|
2179
2200
|
return React.createElement(ProductProvider, {
|
|
2180
2201
|
product: product,
|
|
2181
2202
|
key: product.id
|
|
@@ -2190,9 +2211,12 @@ function ProductCollection(props) {
|
|
|
2190
2211
|
return React.isValidElement(emptyMessage) ? emptyMessage : null;
|
|
2191
2212
|
}
|
|
2192
2213
|
|
|
2193
|
-
return
|
|
2214
|
+
return React.createElement(DataProvider, {
|
|
2215
|
+
name: "products",
|
|
2216
|
+
data: data == null ? void 0 : data.products
|
|
2217
|
+
}, noLayout ? React.createElement(React.Fragment, null, renderedData) : React.createElement("div", {
|
|
2194
2218
|
className: className
|
|
2195
|
-
}, renderedData);
|
|
2219
|
+
}, renderedData));
|
|
2196
2220
|
}
|
|
2197
2221
|
function registerProductCollection(loader, customProductCollectionMeta) {
|
|
2198
2222
|
var doRegisterComponent = function doRegisterComponent() {
|