@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
|
@@ -1607,9 +1607,6 @@ var categoryCollectionMeta = {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
}]
|
|
1609
1609
|
},
|
|
1610
|
-
noLayout: {
|
|
1611
|
-
type: "boolean"
|
|
1612
|
-
},
|
|
1613
1610
|
emptyMessage: {
|
|
1614
1611
|
type: "slot",
|
|
1615
1612
|
defaultValue: {
|
|
@@ -1638,6 +1635,16 @@ var categoryCollectionMeta = {
|
|
|
1638
1635
|
};
|
|
1639
1636
|
})) != null ? _ctx$categories$map : [];
|
|
1640
1637
|
}
|
|
1638
|
+
},
|
|
1639
|
+
noLayout: {
|
|
1640
|
+
type: "boolean",
|
|
1641
|
+
displayName: "No layout",
|
|
1642
|
+
description: "Do not render a container element."
|
|
1643
|
+
},
|
|
1644
|
+
noAutoRepeat: {
|
|
1645
|
+
type: "boolean",
|
|
1646
|
+
displayName: "No auto-repeat",
|
|
1647
|
+
description: "Do not automatically repeat children for every category."
|
|
1641
1648
|
}
|
|
1642
1649
|
},
|
|
1643
1650
|
defaultStyles: {
|
|
@@ -1656,6 +1663,7 @@ function CategoryCollection(props) {
|
|
|
1656
1663
|
|
|
1657
1664
|
var children = props.children,
|
|
1658
1665
|
noLayout = props.noLayout,
|
|
1666
|
+
noAutoRepeat = props.noAutoRepeat,
|
|
1659
1667
|
className = props.className,
|
|
1660
1668
|
loadingMessage = props.loadingMessage,
|
|
1661
1669
|
emptyMessage = props.emptyMessage,
|
|
@@ -1686,7 +1694,7 @@ function CategoryCollection(props) {
|
|
|
1686
1694
|
var firstCategoryNotEmptyIndex = (_categories$findIndex = categories == null ? void 0 : categories.findIndex(function (category) {
|
|
1687
1695
|
return !category.isEmpty;
|
|
1688
1696
|
})) != null ? _categories$findIndex : -1;
|
|
1689
|
-
var renderedData = categories == null ? void 0 : categories.map(function (category, i) {
|
|
1697
|
+
var renderedData = noAutoRepeat ? children : categories == null ? void 0 : categories.map(function (category, i) {
|
|
1690
1698
|
return React__default.createElement(CategoryProvider, {
|
|
1691
1699
|
category: category,
|
|
1692
1700
|
key: category.id
|
|
@@ -1701,11 +1709,14 @@ function CategoryCollection(props) {
|
|
|
1701
1709
|
return React__default.isValidElement(emptyMessage) ? emptyMessage : null;
|
|
1702
1710
|
}
|
|
1703
1711
|
|
|
1704
|
-
return React__default.createElement(
|
|
1712
|
+
return React__default.createElement(host.DataProvider, {
|
|
1713
|
+
name: "categories",
|
|
1714
|
+
data: categories
|
|
1715
|
+
}, React__default.createElement(PrimaryCategoryContext.Provider, {
|
|
1705
1716
|
value: firstCategoryNotEmpty != null ? firstCategoryNotEmpty : categories[0]
|
|
1706
1717
|
}, noLayout ? React__default.createElement(React__default.Fragment, null, renderedData) : React__default.createElement("div", {
|
|
1707
1718
|
className: className
|
|
1708
|
-
}, renderedData));
|
|
1719
|
+
}, renderedData)));
|
|
1709
1720
|
}
|
|
1710
1721
|
function registerCategoryCollection(loader, customCategoryCollectionMeta) {
|
|
1711
1722
|
var doRegisterComponent = function doRegisterComponent() {
|
|
@@ -2118,7 +2129,16 @@ var productCollectionMeta = {
|
|
|
2118
2129
|
value: "price-desc"
|
|
2119
2130
|
}]
|
|
2120
2131
|
},
|
|
2121
|
-
noLayout:
|
|
2132
|
+
noLayout: {
|
|
2133
|
+
type: "boolean",
|
|
2134
|
+
displayName: "No layout",
|
|
2135
|
+
description: "Do not render a container element."
|
|
2136
|
+
},
|
|
2137
|
+
noAutoRepeat: {
|
|
2138
|
+
type: "boolean",
|
|
2139
|
+
displayName: "No auto-repeat",
|
|
2140
|
+
description: "Do not automatically repeat children for every category."
|
|
2141
|
+
}
|
|
2122
2142
|
},
|
|
2123
2143
|
defaultStyles: {
|
|
2124
2144
|
display: "grid",
|
|
@@ -2142,6 +2162,7 @@ function ProductCollection(props) {
|
|
|
2142
2162
|
includeSubCategories = props.includeSubCategories,
|
|
2143
2163
|
brand = props.brand,
|
|
2144
2164
|
noLayout = props.noLayout,
|
|
2165
|
+
noAutoRepeat = props.noAutoRepeat,
|
|
2145
2166
|
setControlContextData = props.setControlContextData,
|
|
2146
2167
|
emptyMessage = props.emptyMessage,
|
|
2147
2168
|
loadingMessage = props.loadingMessage,
|
|
@@ -2182,7 +2203,7 @@ function ProductCollection(props) {
|
|
|
2182
2203
|
});
|
|
2183
2204
|
}
|
|
2184
2205
|
|
|
2185
|
-
var renderedData = data == null ? void 0 : data.products.map(function (product, i) {
|
|
2206
|
+
var renderedData = noAutoRepeat ? children : data == null ? void 0 : data.products.map(function (product, i) {
|
|
2186
2207
|
return React__default.createElement(ProductProvider, {
|
|
2187
2208
|
product: product,
|
|
2188
2209
|
key: product.id
|
|
@@ -2197,9 +2218,12 @@ function ProductCollection(props) {
|
|
|
2197
2218
|
return React__default.isValidElement(emptyMessage) ? emptyMessage : null;
|
|
2198
2219
|
}
|
|
2199
2220
|
|
|
2200
|
-
return
|
|
2221
|
+
return React__default.createElement(host.DataProvider, {
|
|
2222
|
+
name: "products",
|
|
2223
|
+
data: data == null ? void 0 : data.products
|
|
2224
|
+
}, noLayout ? React__default.createElement(React__default.Fragment, null, renderedData) : React__default.createElement("div", {
|
|
2201
2225
|
className: className
|
|
2202
|
-
}, renderedData);
|
|
2226
|
+
}, renderedData));
|
|
2203
2227
|
}
|
|
2204
2228
|
function registerProductCollection(loader, customProductCollectionMeta) {
|
|
2205
2229
|
var doRegisterComponent = function doRegisterComponent() {
|