@dotdev/next-components
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -63,3 +63,3 @@ "use strict"; | ||
React.createElement(react_router_dom_1.Route, { exact: true, path: "/account/logout", render: function (props) { return (React.createElement(_this.props.templates.account.logout, __assign({}, props, _this.props))); } }), | ||
React.createElement(react_router_dom_1.Route, { exact: true, path: "/giftcard/:number", render: function (props) { return (React.createElement(_this.props.templates.giftcard, __assign({}, props, _this.props))); } }), | ||
React.createElement(react_router_dom_1.Route, { exact: true, path: "/gift_cards/:id/:token", render: function (props) { return (React.createElement(_this.props.templates.giftcard, __assign({}, props, _this.props))); } }), | ||
React.createElement(react_router_dom_1.Route, { exact: true, path: "/apps/toolkit/wishlist/:id", render: function (props) { return (React.createElement(_this.props.templates.wishlist, __assign({}, props, _this.props))); } }), | ||
@@ -66,0 +66,0 @@ React.createElement(react_router_dom_1.Route, { exact: true, path: "/password", render: function (props) { return (React.createElement(_this.props.templates.password, __assign({}, props, _this.props))); } }), |
@@ -7,2 +7,3 @@ import * as React from "react"; | ||
private transform; | ||
private legacyTransform; | ||
render(): JSX.Element; | ||
@@ -9,0 +10,0 @@ } |
@@ -33,3 +33,26 @@ "use strict"; | ||
_this.transform = function (data) { | ||
if (0 < data.length && !data[0]._name) { | ||
return _this.legacyTransform(data); | ||
} | ||
var sections = []; | ||
data.map(function (item, index) { | ||
var blockKeys = Object.keys(item).filter(function (itemKey) { | ||
return itemKey.startsWith("blocks"); | ||
}); | ||
var blocks = blockKeys.reduce(function (allBlocks, blockKey) { | ||
var _a; | ||
return (__assign({}, allBlocks, (_a = {}, _a[blockKey] = (item[blockKey] || []).map(function (block, i) { return ({ | ||
id: i, | ||
type: "default", | ||
settings: block | ||
}); }), _a))); | ||
}, {}); | ||
var fields = item; | ||
delete fields.blocks; | ||
sections.push(__assign({ id: index + "_" + item._name, type: "dynamic", name: item._name, settings: fields }, blocks)); | ||
}); | ||
return sections; | ||
}; | ||
_this.legacyTransform = function (data) { | ||
var sections = []; | ||
data.map(function (item) { | ||
@@ -36,0 +59,0 @@ Object.keys(item).forEach(function (key) { |
@@ -17,2 +17,3 @@ export declare class Notifications { | ||
CART_ITEM_REMOVED_FAILED: string; | ||
CART_NOTE_UPDATE_SUCCESS: string; | ||
CART_QTY_UPDATE_SUCCESS: string; | ||
@@ -19,0 +20,0 @@ CART_QTY_UPDATE_FAILED: string; |
@@ -123,4 +123,6 @@ "use strict"; | ||
var items = JSON.parse(local) ? JSON.parse(local).items : []; | ||
return items.length ? items.filter(function (item) { return parseInt(item.variantId) == variantId; }) | ||
.length : false; | ||
return items.length | ||
? items.filter(function (item) { return parseInt(item.variantId) == variantId; }) | ||
.length | ||
: false; | ||
}; | ||
@@ -127,0 +129,0 @@ this.addItem = function (productId, variantId) { |
{ | ||
"name": "@dotdev/next-components", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"license": "SEE LICENSE IN LICENCE.md", | ||
@@ -5,0 +5,0 @@ "description": "Common components for Next projects", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124962
1812