Add Cart totals to Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/1411)
* Add Cart totals to Cart block * Accessibility improvements * Load vendors styles separately * Use same shipping placeholders for cart and checkout * Refactor how we import @wordpress/components styles so only panel styles are imported * Remove style-loader from vendors styles build process * Add htmlFor attribute to TotalsCouponCodeInput * Update totalItems shape to match API * Fix wrong total items shape using numbers instead of strings * Rename wc-blocks classes to wc-block * Remove unnecessary parseInt() * Add radix to parseInt() * Rename totalRows to totalRowsConfig * Move placeholder content out of the component * Use Card component for cart's sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/1423) * Use Card component for cart's sidebar * Split RadioControl component * No need to use Label in RadioControlOption * Remove no longer valid @todo comment * Use 'checked' prop instead of 'selected' in RadioControlOption * Rename wc-blocks classes to wc-block * Rename wc-blocks classes to wc-block (II) * Make sure radio control ids are unique using withComponentId * Load PanelBody and PanelRow from last version of @wordpress/components * Create vendors-frontend.js file * Load wordpress-component instead of @wordpress/components from <Button> component * Only load 'withRestApiHydration' HOC * Make vendors-frontend a dependency of cart-frontend script * Revert "Only load 'withRestApiHydration' HOC" This reverts commit 9f9b9759a98047b26e7d8f04189ffe78c1d5bb06. * Fix fieldset background
This commit is contained in:
parent
0150681c4b
commit
bd2b8cb279
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { Button as WPButton } from '@wordpress/components';
|
||||
import { Button as WPButton } from 'wordpress-components';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
background-color: #000;
|
||||
color: #fff;
|
||||
display: block;
|
||||
font-size: inherit;
|
||||
font-weight: bold;
|
||||
padding: $gap-small;
|
||||
text-align: center;
|
||||
|
|
|
@ -2,112 +2,38 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import classnames from 'classnames';
|
||||
import withComponentId from '@woocommerce/base-hocs/with-component-id';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import Label from '../label';
|
||||
import RadioControlOption from './option';
|
||||
import './style.scss';
|
||||
|
||||
const RadioControl = ( {
|
||||
className,
|
||||
componentId,
|
||||
selected,
|
||||
id,
|
||||
onChange,
|
||||
options = [],
|
||||
} ) => {
|
||||
const onChangeValue = ( event ) => onChange( event.target.value );
|
||||
return (
|
||||
options.length && (
|
||||
<div
|
||||
className={ classnames( 'wc-block-radio-control', className ) }
|
||||
>
|
||||
{ options.map(
|
||||
( {
|
||||
value,
|
||||
label,
|
||||
description,
|
||||
secondaryLabel,
|
||||
secondaryDescription,
|
||||
} ) => (
|
||||
<label
|
||||
key={ `${ id }-${ value }` }
|
||||
className="wc-block-radio-control__option"
|
||||
htmlFor={ `${ id }-${ value }` }
|
||||
>
|
||||
<input
|
||||
id={ `${ id }-${ value }` }
|
||||
className="wc-block-radio-control__input"
|
||||
type="radio"
|
||||
name={ id }
|
||||
value={ value }
|
||||
onChange={ onChangeValue }
|
||||
checked={ value === selected }
|
||||
aria-describedby={ classnames( {
|
||||
[ `${ id }-${ value }__label` ]: label,
|
||||
[ `${ id }-${ value }__secondary-label` ]: secondaryLabel,
|
||||
[ `${ id }-${ value }__description` ]: description,
|
||||
[ `${ id }-${ value }__secondary-description` ]: secondaryDescription,
|
||||
} ) }
|
||||
/>
|
||||
{ label && (
|
||||
<Label
|
||||
label={ label }
|
||||
wrapperElement="span"
|
||||
wrapperProps={ {
|
||||
className:
|
||||
'wc-block-radio-control__label',
|
||||
id: `${ id }-${ value }__label`,
|
||||
} }
|
||||
>
|
||||
{ label }
|
||||
</Label>
|
||||
) }
|
||||
{ secondaryLabel && (
|
||||
<Label
|
||||
label={ secondaryLabel }
|
||||
wrapperElement="span"
|
||||
wrapperProps={ {
|
||||
className:
|
||||
'wc-block-radio-control__secondary-label',
|
||||
id: `${ id }-${ value }__secondary-label`,
|
||||
} }
|
||||
>
|
||||
{ secondaryLabel }
|
||||
</Label>
|
||||
) }
|
||||
{ description && (
|
||||
<Label
|
||||
label={ description }
|
||||
wrapperElement="span"
|
||||
wrapperProps={ {
|
||||
className:
|
||||
'wc-block-radio-control__description',
|
||||
id: `${ id }-${ value }__description`,
|
||||
} }
|
||||
>
|
||||
{ description }
|
||||
</Label>
|
||||
) }
|
||||
{ secondaryDescription && (
|
||||
<Label
|
||||
label={ secondaryDescription }
|
||||
wrapperElement="span"
|
||||
wrapperProps={ {
|
||||
className:
|
||||
'wc-block-radio-control__secondary-description',
|
||||
id: `${ id }-${ value }__secondary-description`,
|
||||
} }
|
||||
>
|
||||
{ secondaryDescription }
|
||||
</Label>
|
||||
) }
|
||||
</label>
|
||||
)
|
||||
) }
|
||||
{ options.map( ( option ) => (
|
||||
<RadioControlOption
|
||||
key={ option.value }
|
||||
name={ `radio-control-${ componentId }` }
|
||||
checked={ option.value === selected }
|
||||
option={ option }
|
||||
onChange={ onChange }
|
||||
/>
|
||||
) ) }
|
||||
</div>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
export default RadioControl;
|
||||
export default withComponentId( RadioControl );
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import classnames from 'classnames';
|
||||
|
||||
const Option = ( { checked, name, onChange, option } ) => {
|
||||
const {
|
||||
value,
|
||||
label,
|
||||
description,
|
||||
secondaryLabel,
|
||||
secondaryDescription,
|
||||
} = option;
|
||||
const onChangeValue = ( event ) => onChange( event.target.value );
|
||||
|
||||
return (
|
||||
<label
|
||||
className="wc-block-radio-control__option"
|
||||
htmlFor={ `${ name }-${ value }` }
|
||||
>
|
||||
<input
|
||||
id={ `${ name }-${ value }` }
|
||||
className="wc-block-radio-control__input"
|
||||
type="radio"
|
||||
name={ name }
|
||||
value={ value }
|
||||
onChange={ onChangeValue }
|
||||
checked={ checked }
|
||||
aria-describedby={ classnames( {
|
||||
[ `${ name }-${ value }__label` ]: label,
|
||||
[ `${ name }-${ value }__secondary-label` ]: secondaryLabel,
|
||||
[ `${ name }-${ value }__description` ]: description,
|
||||
[ `${ name }-${ value }__secondary-description` ]: secondaryDescription,
|
||||
} ) }
|
||||
/>
|
||||
{ label && (
|
||||
<span
|
||||
id={ `${ name }-${ value }__label` }
|
||||
className="wc-block-radio-control__label"
|
||||
>
|
||||
{ label }
|
||||
</span>
|
||||
) }
|
||||
{ secondaryLabel && (
|
||||
<span
|
||||
id={ `${ name }-${ value }__secondary-label` }
|
||||
className="wc-block-radio-control__secondary-label"
|
||||
>
|
||||
{ secondaryLabel }
|
||||
</span>
|
||||
) }
|
||||
{ description && (
|
||||
<span
|
||||
id={ `${ name }-${ value }__description` }
|
||||
className="wc-block-radio-control__description"
|
||||
>
|
||||
{ description }
|
||||
</span>
|
||||
) }
|
||||
{ secondaryDescription && (
|
||||
<span
|
||||
id={ `${ name }-${ value }__secondary-description` }
|
||||
className="wc-block-radio-control__secondary-description"
|
||||
>
|
||||
{ secondaryDescription }
|
||||
</span>
|
||||
) }
|
||||
</label>
|
||||
);
|
||||
};
|
||||
|
||||
export default Option;
|
|
@ -0,0 +1,2 @@
|
|||
export { default as TotalsCouponCodeInput } from './totals-coupon-code-input';
|
||||
export { default as TotalsItem } from './totals-item';
|
|
@ -0,0 +1,66 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useState } from '@wordpress/element';
|
||||
import { PanelBody, PanelRow } from 'wordpress-components';
|
||||
import Button from '@woocommerce/base-components/button';
|
||||
import TextInput from '@woocommerce/base-components/text-input';
|
||||
import Label from '@woocommerce/base-components/label';
|
||||
import PropTypes from 'prop-types';
|
||||
import withComponentId from '@woocommerce/base-hocs/with-component-id';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
|
||||
const TotalsCouponCodeInput = ( { componentId, onSubmit } ) => {
|
||||
const [ couponValue, setCouponValue ] = useState( '' );
|
||||
return (
|
||||
<PanelBody
|
||||
className="wc-block-coupon-code"
|
||||
title={
|
||||
<Label
|
||||
label={ __(
|
||||
'Coupon Code?',
|
||||
'woo-gutenberg-products-block'
|
||||
) }
|
||||
screenReaderLabel={ __(
|
||||
'Introduce Coupon Code',
|
||||
'woo-gutenberg-products-block'
|
||||
) }
|
||||
htmlFor={ `wc-block-coupon-code__input-${ componentId }` }
|
||||
/>
|
||||
}
|
||||
initialOpen={ false }
|
||||
>
|
||||
<PanelRow className="wc-block-coupon-code__row">
|
||||
<TextInput
|
||||
id={ `wc-block-coupon-code__input-${ componentId }` }
|
||||
className="wc-block-coupon-code__input"
|
||||
label={ __( 'Enter code', 'woo-gutenberg-products-block' ) }
|
||||
value={ couponValue }
|
||||
onChange={ ( newCouponValue ) =>
|
||||
setCouponValue( newCouponValue )
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
className="wc-block-coupon-code__button"
|
||||
onClick={ () => {
|
||||
onSubmit( couponValue );
|
||||
} }
|
||||
type="submit"
|
||||
>
|
||||
{ __( 'Apply', 'woo-gutenberg-products-block' ) }
|
||||
</Button>
|
||||
</PanelRow>
|
||||
</PanelBody>
|
||||
);
|
||||
};
|
||||
|
||||
TotalsCouponCodeInput.propTypes = {
|
||||
onSubmit: PropTypes.func,
|
||||
};
|
||||
|
||||
export default withComponentId( TotalsCouponCodeInput );
|
|
@ -0,0 +1,47 @@
|
|||
.wc-block-coupon-code {
|
||||
// Extra class for specificity
|
||||
&.components-panel__body {
|
||||
&.is-opened {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
|
||||
> .components-panel__body-title {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
> .components-panel__body-title,
|
||||
.components-panel__body-toggle {
|
||||
&,
|
||||
&:hover,
|
||||
&:focus,
|
||||
&:active {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.components-panel__body-toggle {
|
||||
font-weight: normal;
|
||||
font-size: inherit;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-block-coupon-code__row {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.wc-block-coupon-code__input {
|
||||
margin-top: 0;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.wc-block-coupon-code__button {
|
||||
margin-left: $gap;
|
||||
padding-left: $gap-large;
|
||||
padding-right: $gap-large;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
|
||||
const TotalsItem = ( { className, currency, label, value, description } ) => {
|
||||
return (
|
||||
<div
|
||||
className={ classnames( 'wc-block-totals-table-item', className ) }
|
||||
>
|
||||
<span className="wc-block-totals-table-item__label">{ label }</span>
|
||||
<FormattedMonetaryAmount
|
||||
className="wc-block-totals-table-item__value"
|
||||
currency={ currency }
|
||||
displayType="text"
|
||||
value={ value }
|
||||
/>
|
||||
<span className="wc-block-totals-table-item__description">
|
||||
{ description }
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
TotalsItem.propTypes = {
|
||||
currency: PropTypes.object.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
value: PropTypes.number.isRequired,
|
||||
className: PropTypes.string,
|
||||
description: PropTypes.node,
|
||||
};
|
||||
|
||||
export default TotalsItem;
|
|
@ -0,0 +1,19 @@
|
|||
.wc-block-totals-table-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 15px 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wc-block-totals-table-item__label {
|
||||
flex-grow: 1;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.wc-block-totals-table-item__value {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wc-block-totals-table-item__description {
|
||||
width: 100%;
|
||||
}
|
|
@ -1,7 +1,11 @@
|
|||
.wc-block-cart__submit-button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wc-block-cart__payment-methods {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin: $gap auto;
|
||||
margin: $gap auto 0;
|
||||
max-width: 150px;
|
||||
}
|
||||
|
|
|
@ -1,31 +1,186 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useState } from '@wordpress/element';
|
||||
import {
|
||||
TotalsCouponCodeInput,
|
||||
TotalsItem,
|
||||
} from '@woocommerce/base-components/totals';
|
||||
import RadioControl from '@woocommerce/base-components/radio-control';
|
||||
import {
|
||||
COUPONS_ENABLED,
|
||||
DISPLAY_PRICES_INCLUDING_TAXES,
|
||||
} from '@woocommerce/block-settings';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/base-utils';
|
||||
import { Card, CardBody } from 'wordpress-components';
|
||||
import { previewCartItems } from '@woocommerce/resource-previews';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import CheckoutButton from './checkout-button';
|
||||
import placeholderShippingMethods from '../../placeholder-shipping-methods';
|
||||
import CartLineItemsTitle from './cart-line-items-title';
|
||||
import CartLineItemsTable from './cart-line-items-table';
|
||||
|
||||
import './style.scss';
|
||||
import './editor.scss';
|
||||
|
||||
/**
|
||||
* Given an API response with cart totals, generates an array of rows to display in the Cart block.
|
||||
*
|
||||
* @param {Object} cartTotals - Cart totals data as provided by the API.
|
||||
* @returns {Object[]} Values to display in the cart block.
|
||||
*/
|
||||
const getTotalRowsConfig = ( cartTotals ) => {
|
||||
const totalItems = parseInt( cartTotals.total_items, 10 );
|
||||
const totalItemsTax = parseInt( cartTotals.total_items_tax, 10 );
|
||||
const totalRowsConfig = [
|
||||
{
|
||||
label: __( 'List items:', 'woo-gutenberg-products-block' ),
|
||||
value: DISPLAY_PRICES_INCLUDING_TAXES
|
||||
? totalItems + totalItemsTax
|
||||
: totalItems,
|
||||
},
|
||||
];
|
||||
const totalFees = parseInt( cartTotals.total_fees, 10 );
|
||||
if ( totalFees > 0 ) {
|
||||
const totalFeesTax = parseInt( cartTotals.total_fees_tax, 10 );
|
||||
totalRowsConfig.push( {
|
||||
label: __( 'Fees:', 'woo-gutenberg-products-block' ),
|
||||
value: DISPLAY_PRICES_INCLUDING_TAXES
|
||||
? totalFees + totalFeesTax
|
||||
: totalFees,
|
||||
} );
|
||||
}
|
||||
const totalDiscount = parseInt( cartTotals.total_discount, 10 );
|
||||
if ( totalDiscount > 0 ) {
|
||||
const totalDiscountTax = parseInt( cartTotals.total_discount_tax, 10 );
|
||||
totalRowsConfig.push( {
|
||||
label: __( 'Discount:', 'woo-gutenberg-products-block' ),
|
||||
value: DISPLAY_PRICES_INCLUDING_TAXES
|
||||
? totalDiscount + totalDiscountTax
|
||||
: totalDiscount,
|
||||
} );
|
||||
}
|
||||
if ( ! DISPLAY_PRICES_INCLUDING_TAXES ) {
|
||||
const totalTax = parseInt( cartTotals.total_tax, 10 );
|
||||
totalRowsConfig.push( {
|
||||
label: __( 'Taxes:', 'woo-gutenberg-products-block' ),
|
||||
value: totalTax,
|
||||
} );
|
||||
}
|
||||
const totalShipping = parseInt( cartTotals.total_shipping, 10 );
|
||||
const totalShippingTax = parseInt( cartTotals.total_shipping_tax, 10 );
|
||||
totalRowsConfig.push( {
|
||||
label: __( 'Shipping:', 'woo-gutenberg-products-block' ),
|
||||
value: DISPLAY_PRICES_INCLUDING_TAXES
|
||||
? totalShipping + totalShippingTax
|
||||
: totalShipping,
|
||||
description: __(
|
||||
'Shipping to location (change address)',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
} );
|
||||
|
||||
return totalRowsConfig;
|
||||
};
|
||||
|
||||
// @todo this are placeholders
|
||||
const onActivateCoupon = ( couponCode ) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log( 'coupon activated: ' + couponCode );
|
||||
};
|
||||
const cartTotals = {
|
||||
currency: 'EUR',
|
||||
currency_minor_unit: 2,
|
||||
total_items: '6000',
|
||||
total_items_tax: '0',
|
||||
total_fees: '0',
|
||||
total_fees_tax: '0',
|
||||
total_discount: '0',
|
||||
total_discount_tax: '0',
|
||||
total_shipping: '0',
|
||||
total_shipping_tax: '0',
|
||||
total_tax: '0',
|
||||
total_price: '6000',
|
||||
};
|
||||
|
||||
/**
|
||||
* Component that renders the Cart block when user has something in cart aka "full".
|
||||
*/
|
||||
const Cart = () => {
|
||||
const currency = getCurrencyFromPriceResponse( cartTotals );
|
||||
const totalRowsConfig = getTotalRowsConfig( cartTotals );
|
||||
|
||||
const [ selectedShippingOption, setSelectedShippingOption ] = useState(
|
||||
placeholderShippingMethods[ 0 ].value
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="wc-block-cart">
|
||||
<div className="wc-block-cart__main">
|
||||
<CartLineItemsTitle itemCount={ previewCartItems.length } />
|
||||
<CartLineItemsTable lineItems={ previewCartItems } />
|
||||
</div>
|
||||
<div className="wc-block-cart__sidebar">
|
||||
<CheckoutButton />
|
||||
</div>
|
||||
<Card className="wc-block-cart__sidebar" isElevated={ true }>
|
||||
<CardBody>
|
||||
<h2 className="wc-block-cart__totals-title">
|
||||
{ __( 'Cart totals', 'woo-gutenberg-products-block' ) }
|
||||
</h2>
|
||||
{ totalRowsConfig.map(
|
||||
( { label, value, description } ) => (
|
||||
<TotalsItem
|
||||
key={ label }
|
||||
currency={ currency }
|
||||
label={ label }
|
||||
value={ value }
|
||||
description={ description }
|
||||
/>
|
||||
)
|
||||
) }
|
||||
<fieldset className="wc-block-cart__shipping-options-fieldset">
|
||||
<legend className="screen-reader-text">
|
||||
{ __(
|
||||
'Choose the shipping method.',
|
||||
'woo-gutenberg-products-block'
|
||||
) }
|
||||
</legend>
|
||||
<RadioControl
|
||||
className="wc-block-cart__shipping-options"
|
||||
selected={ selectedShippingOption }
|
||||
options={ placeholderShippingMethods.map(
|
||||
( option ) => ( {
|
||||
label: option.label,
|
||||
value: option.value,
|
||||
description: [
|
||||
option.price,
|
||||
option.schedule,
|
||||
]
|
||||
.filter( Boolean )
|
||||
.join( ' — ' ),
|
||||
} )
|
||||
) }
|
||||
onChange={ ( newSelectedShippingOption ) =>
|
||||
setSelectedShippingOption(
|
||||
newSelectedShippingOption
|
||||
)
|
||||
}
|
||||
/>
|
||||
</fieldset>
|
||||
{ COUPONS_ENABLED && (
|
||||
<TotalsCouponCodeInput onSubmit={ onActivateCoupon } />
|
||||
) }
|
||||
<TotalsItem
|
||||
className="wc-block-cart__totals-footer"
|
||||
currency={ currency }
|
||||
label={ __( 'Total', 'woo-gutenberg-products-block' ) }
|
||||
value={ parseInt( cartTotals.total_price, 10 ) }
|
||||
/>
|
||||
<CheckoutButton />
|
||||
</CardBody>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
border: 1px solid $core-grey-light-600;
|
||||
border-width: 1px 0;
|
||||
min-width: 15rem;
|
||||
padding-bottom: $gap-largest;
|
||||
}
|
||||
|
||||
.wc-block-cart__item-count {
|
||||
|
@ -69,7 +70,57 @@ table.wc-block-cart-items {
|
|||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.wc-block-cart__totals-footer {
|
||||
color: #000;
|
||||
font-size: 1.25em;
|
||||
|
||||
> .wc-block-totals-table-item__label {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
// Added extra class and label for specificity.
|
||||
.wc-block-cart fieldset.wc-block-cart__shipping-options-fieldset {
|
||||
background-color: transparent;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.wc-block-cart__shipping-options {
|
||||
.wc-block-radio-control__label {
|
||||
flex-basis: 100%;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.wc-block-radio-control__description {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
.wc-block-radio-control__option {
|
||||
padding-left: $gap-large;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-block-radio-control__input {
|
||||
left: 0;
|
||||
top: $gap;
|
||||
}
|
||||
}
|
||||
|
||||
@include breakpoint( "<782px" ) {
|
||||
.wc-block-cart__totals-title {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@include breakpoint( ">782px" ) {
|
||||
.wc-block-cart__sidebar {
|
||||
max-width: 374px;
|
||||
}
|
||||
|
||||
.wc-block-cart {
|
||||
display: flex;
|
||||
}
|
||||
|
@ -80,11 +131,7 @@ table.wc-block-cart-items {
|
|||
}
|
||||
|
||||
.wc-block-cart__sidebar {
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.14);
|
||||
flex-grow: 1;
|
||||
padding: $gap $gap-large $gap-largest;
|
||||
}
|
||||
|
||||
.wc-block-cart-items {
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import placeholderShippingMethods from '../placeholder-shipping-methods';
|
||||
import './style.scss';
|
||||
import '../../../payment-methods-demo';
|
||||
|
||||
|
@ -293,29 +294,15 @@ const Block = ( { shippingMethods = [], isEditor = false } ) => {
|
|||
method: option,
|
||||
} )
|
||||
}
|
||||
options={ [
|
||||
{
|
||||
label: 'Click & Collect',
|
||||
value: 'collect',
|
||||
description:
|
||||
'Pickup between 12:00 - 16:00 (Mon-Fri)',
|
||||
secondaryLabel: 'FREE',
|
||||
},
|
||||
{
|
||||
label: 'Regular shipping',
|
||||
value: 'usps-normal',
|
||||
description: 'Dispatched via USPS',
|
||||
secondaryLabel: '€10.00',
|
||||
secondaryDescription: '5 business days',
|
||||
},
|
||||
{
|
||||
label: 'Express shipping',
|
||||
value: 'ups-express',
|
||||
description: 'Dispatched via USPS',
|
||||
secondaryLabel: '€50.00',
|
||||
secondaryDescription: '2 business days',
|
||||
},
|
||||
] }
|
||||
options={ placeholderShippingMethods.map(
|
||||
( option ) => ( {
|
||||
label: option.label,
|
||||
value: option.value,
|
||||
description: option.dispatcher,
|
||||
secondaryLabel: option.price,
|
||||
secondaryDescription: option.schedule,
|
||||
} )
|
||||
) }
|
||||
/>
|
||||
<CheckboxControl
|
||||
className="wc-block-checkout__add-note"
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
export default [
|
||||
{
|
||||
label: 'Click & Collect',
|
||||
value: 'collect',
|
||||
schedule: 'Pickup between 12:00 - 16:00 (Mon-Fri)',
|
||||
price: 'FREE',
|
||||
},
|
||||
{
|
||||
label: 'Regular shipping',
|
||||
value: 'usps-normal',
|
||||
dispatcher: 'Dispatched via USPS',
|
||||
price: '€10.00',
|
||||
schedule: '5 business days',
|
||||
},
|
||||
{
|
||||
label: 'Express shipping',
|
||||
value: 'ups-express',
|
||||
dispatcher: 'Dispatched via USPS',
|
||||
price: '€50.00',
|
||||
schedule: '2 business days',
|
||||
},
|
||||
];
|
|
@ -25,6 +25,11 @@ export const HAS_TAGS = getSetting( 'hasTags', true );
|
|||
export const HOME_URL = getSetting( 'homeUrl', '' );
|
||||
export const SHOP_URL = getSetting( 'shopUrl', '' );
|
||||
export const CHECKOUT_URL = getSetting( 'checkoutUrl', '' );
|
||||
export const COUPONS_ENABLED = getSetting( 'couponsEnabled', true );
|
||||
export const DISPLAY_PRICES_INCLUDING_TAXES = getSetting(
|
||||
'displayPricesIncludingTaxes',
|
||||
false
|
||||
);
|
||||
export const PRODUCT_COUNT = getSetting( 'productCount', 0 );
|
||||
export const ATTRIBUTES = getSetting( 'attributes', [] );
|
||||
export const WC_BLOCKS_ASSET_URL = getSetting( 'wcBlocksAssetUrl', '' );
|
||||
|
|
|
@ -124,6 +124,7 @@ const mainEntry = {
|
|||
'active-filters': './assets/js/blocks/active-filters/index.js',
|
||||
'block-error-boundary':
|
||||
'./assets/js/base/components/block-error-boundary/style.scss',
|
||||
'panel-style': './node_modules/@wordpress/components/src/panel/style.scss',
|
||||
|
||||
// cart & checkout blocks
|
||||
cart: './assets/js/blocks/cart-checkout/cart/index.js',
|
||||
|
@ -172,6 +173,7 @@ const getMainConfig = ( options = {} ) => {
|
|||
},
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
minSize: 0,
|
||||
cacheGroups: {
|
||||
commons: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
|
@ -192,6 +194,12 @@ const getMainConfig = ( options = {} ) => {
|
|||
chunks: 'all',
|
||||
priority: 10,
|
||||
},
|
||||
'vendors-style': {
|
||||
test: /\/node_modules\/.*?style\.s?css$/,
|
||||
name: 'vendors-style',
|
||||
chunks: 'all',
|
||||
priority: 7,
|
||||
},
|
||||
style: {
|
||||
test: /style\.scss$/,
|
||||
name: 'style',
|
||||
|
@ -224,7 +232,29 @@ const getMainConfig = ( options = {} ) => {
|
|||
},
|
||||
},
|
||||
{
|
||||
test: /\.s[c|a]ss$/,
|
||||
test: /\/node_modules\/.*?style\.s?css$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
||||
'postcss-loader',
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
query: {
|
||||
includePaths: [ 'node_modules' ],
|
||||
data:
|
||||
'@import "~@wordpress/base-styles/colors"; ' +
|
||||
'@import "~@wordpress/base-styles/variables"; ' +
|
||||
'@import "~@wordpress/base-styles/mixins"; ' +
|
||||
'@import "~@wordpress/base-styles/breakpoints"; ' +
|
||||
'@import "~@wordpress/base-styles/animations"; ' +
|
||||
'@import "~@wordpress/base-styles/z-index"; ',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.s?css$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
||||
|
@ -301,6 +331,19 @@ const getFrontConfig = ( options = {} ) => {
|
|||
// See https://webpack.js.org/configuration/output/#outputjsonpfunction
|
||||
jsonpFunction: 'webpackWcBlocksJsonp',
|
||||
},
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
minSize: 0,
|
||||
cacheGroups: {
|
||||
vendors: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendors',
|
||||
chunks: 'all',
|
||||
enforce: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
|
||||
"integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/highlight": "^7.0.0"
|
||||
}
|
||||
|
@ -174,7 +173,6 @@
|
|||
"version": "7.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz",
|
||||
"integrity": "sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.7.4"
|
||||
}
|
||||
|
@ -288,7 +286,6 @@
|
|||
"version": "7.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz",
|
||||
"integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^2.0.0",
|
||||
"esutils": "^2.0.2",
|
||||
|
@ -299,7 +296,6 @@
|
|||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
|
@ -902,7 +898,6 @@
|
|||
"version": "7.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz",
|
||||
"integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esutils": "^2.0.2",
|
||||
"lodash": "^4.17.13",
|
||||
|
@ -923,7 +918,6 @@
|
|||
"version": "10.0.27",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.27.tgz",
|
||||
"integrity": "sha512-Zp8BEpbMunFsTcqAK4D7YTm3MvCp1SekflSLJH8lze2fCcSZ/yMkXHo8kb3t1/1Tdd3hAqf3Fb7z9VZ+FMiC9w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@emotion/sheet": "0.9.4",
|
||||
"@emotion/stylis": "0.8.5",
|
||||
|
@ -934,14 +928,12 @@
|
|||
"@emotion/sheet": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.4.tgz",
|
||||
"integrity": "sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA=="
|
||||
},
|
||||
"@emotion/utils": {
|
||||
"version": "0.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz",
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -949,7 +941,6 @@
|
|||
"version": "10.0.22",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/core/-/core-10.0.22.tgz",
|
||||
"integrity": "sha512-7eoP6KQVUyOjAkE6y4fdlxbZRA4ILs7dqkkm6oZUJmihtHv0UBq98VgPirq9T8F9K2gKu0J/au/TpKryKMinaA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"@emotion/cache": "^10.0.17",
|
||||
|
@ -963,7 +954,6 @@
|
|||
"version": "10.0.27",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/css/-/css-10.0.27.tgz",
|
||||
"integrity": "sha512-6wZjsvYeBhyZQYNrGoR5yPMYbMBNEnanDrqmsqS1mzDm1cOTu12shvl2j4QHNS36UaTE0USIJawCH9C8oW34Zw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@emotion/serialize": "^0.11.15",
|
||||
"@emotion/utils": "0.11.3",
|
||||
|
@ -973,22 +963,19 @@
|
|||
"@emotion/utils": {
|
||||
"version": "0.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz",
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@emotion/hash": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.7.4.tgz",
|
||||
"integrity": "sha512-fxfMSBMX3tlIbKUdtGKxqB1fyrH6gVrX39Gsv3y8lRYKUqlgDt3UMqQyGnR1bQMa2B8aGnhLZokZgg8vT0Le+A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-fxfMSBMX3tlIbKUdtGKxqB1fyrH6gVrX39Gsv3y8lRYKUqlgDt3UMqQyGnR1bQMa2B8aGnhLZokZgg8vT0Le+A=="
|
||||
},
|
||||
"@emotion/is-prop-valid": {
|
||||
"version": "0.8.6",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.6.tgz",
|
||||
"integrity": "sha512-mnZMho3Sq8BfzkYYRVc8ilQTnc8U02Ytp6J1AwM6taQStZ3AhsEJBX2LzhA/LJirNCwM2VtHL3VFIZ+sNJUgUQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@emotion/memoize": "0.7.4"
|
||||
}
|
||||
|
@ -996,14 +983,12 @@
|
|||
"@emotion/memoize": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
|
||||
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw=="
|
||||
},
|
||||
"@emotion/serialize": {
|
||||
"version": "0.11.15",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.15.tgz",
|
||||
"integrity": "sha512-YE+qnrmGwyR+XB5j7Bi+0GT1JWsdcjM/d4POu+TXkcnrRs4RFCCsi3d/Ebf+wSStHqAlTT2+dfd+b9N9EO2KBg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@emotion/hash": "0.7.4",
|
||||
"@emotion/memoize": "0.7.4",
|
||||
|
@ -1015,22 +1000,19 @@
|
|||
"@emotion/utils": {
|
||||
"version": "0.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz",
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@emotion/sheet": {
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.3.tgz",
|
||||
"integrity": "sha512-c3Q6V7Df7jfwSq5AzQWbXHa5soeE4F5cbqi40xn0CzXxWW9/6Mxq48WJEtqfWzbZtW9odZdnRAkwCQwN12ob4A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-c3Q6V7Df7jfwSq5AzQWbXHa5soeE4F5cbqi40xn0CzXxWW9/6Mxq48WJEtqfWzbZtW9odZdnRAkwCQwN12ob4A=="
|
||||
},
|
||||
"@emotion/styled": {
|
||||
"version": "10.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-10.0.23.tgz",
|
||||
"integrity": "sha512-gNr04eqBQ2iYUx8wFLZDfm3N8/QUOODu/ReDXa693uyQGy2OqA+IhPJk+kA7id8aOfwAsMuvZ0pJImEXXKtaVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@emotion/styled-base": "^10.0.23",
|
||||
"babel-plugin-emotion": "^10.0.23"
|
||||
|
@ -1040,7 +1022,6 @@
|
|||
"version": "10.0.27",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/styled-base/-/styled-base-10.0.27.tgz",
|
||||
"integrity": "sha512-ufHM/HhE3nr309hJG9jxuFt71r6aHn7p+bwXduFxcwPFEfBIqvmZUMtZ9YxIsY61PVwK3bp4G1XhaCzy9smVvw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"@emotion/is-prop-valid": "0.8.6",
|
||||
|
@ -1051,34 +1032,29 @@
|
|||
"@emotion/utils": {
|
||||
"version": "0.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz",
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@emotion/stylis": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz",
|
||||
"integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ=="
|
||||
},
|
||||
"@emotion/unitless": {
|
||||
"version": "0.7.5",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz",
|
||||
"integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg=="
|
||||
},
|
||||
"@emotion/utils": {
|
||||
"version": "0.11.2",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.2.tgz",
|
||||
"integrity": "sha512-UHX2XklLl3sIaP6oiMmlVzT0J+2ATTVpf0dHQVyPJHTkOITvXfaSqnRk6mdDhV9pR8T/tHc3cex78IKXssmzrA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-UHX2XklLl3sIaP6oiMmlVzT0J+2ATTVpf0dHQVyPJHTkOITvXfaSqnRk6mdDhV9pR8T/tHc3cex78IKXssmzrA=="
|
||||
},
|
||||
"@emotion/weak-memoize": {
|
||||
"version": "0.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz",
|
||||
"integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA=="
|
||||
},
|
||||
"@hapi/address": {
|
||||
"version": "2.1.4",
|
||||
|
@ -1745,8 +1721,7 @@
|
|||
"@types/parse-json": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
|
||||
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
|
||||
},
|
||||
"@types/q": {
|
||||
"version": "1.5.2",
|
||||
|
@ -2379,6 +2354,12 @@
|
|||
"core-js": "^3.1.4"
|
||||
}
|
||||
},
|
||||
"@wordpress/base-styles": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-1.1.0.tgz",
|
||||
"integrity": "sha512-hsDPsIF1ah8Cy1pz1zuIMLiBR6qFsZQPKLStZ7n4K1HOrpkeAr+XXE0dbxnopHzt8Y4Csmxg4Hr/K1ho38NBFw==",
|
||||
"dev": true
|
||||
},
|
||||
"@wordpress/blob": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-2.5.1.tgz",
|
||||
|
@ -2559,7 +2540,6 @@
|
|||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/components/-/components-8.5.0.tgz",
|
||||
"integrity": "sha512-2wBpL7a9udh2yvzIA242Fhu2+srNv4WXFa0jjXJrf99smlVm2BxLMQtlNgfaV4LkYFAAnc0Bkud90NdrOoZ/ig==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@emotion/core": "10.0.22",
|
||||
|
@ -2596,7 +2576,6 @@
|
|||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.9.0.tgz",
|
||||
"integrity": "sha512-UhuHCQANb0ob5TBZSQl1y6i7FBTKXXI0jwzPKkWhLmMByjM8pIQte53nQu9RbwQ1I5ItHqhzKoy5wyaXdjgWkQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@wordpress/element": "^2.10.0",
|
||||
|
@ -2604,11 +2583,42 @@
|
|||
"lodash": "^4.17.15"
|
||||
}
|
||||
},
|
||||
"@wordpress/data": {
|
||||
"version": "4.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/data/-/data-4.11.0.tgz",
|
||||
"integrity": "sha512-FA/GU27I/hCyG0Cm8jVvo98nL8Ix0ysKK7aP96s/73Q6ODXisAZ9CGv9sceUIn92wEOyqug21WLS7lu4Cz3OYQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@wordpress/compose": "^3.9.0",
|
||||
"@wordpress/deprecated": "^2.6.1",
|
||||
"@wordpress/element": "^2.10.0",
|
||||
"@wordpress/is-shallow-equal": "^1.6.1",
|
||||
"@wordpress/priority-queue": "^1.3.1",
|
||||
"@wordpress/redux-routine": "^3.6.2",
|
||||
"equivalent-key-map": "^0.2.2",
|
||||
"is-promise": "^2.1.0",
|
||||
"lodash": "^4.17.15",
|
||||
"memize": "^1.0.5",
|
||||
"redux": "^4.0.0",
|
||||
"turbo-combine-reducers": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"@wordpress/element": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.10.0.tgz",
|
||||
"integrity": "sha512-CedhhFfcubM/lsluY7JPC49VG0/Ee0chOBJ1vyDEvIJmQk0bM3sLfgt5qVK773yivVOqD9blQMO+JihnaMXF8w==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@wordpress/escape-html": "^1.6.0",
|
||||
"lodash": "^4.17.15",
|
||||
"react": "^16.9.0",
|
||||
"react-dom": "^16.9.0"
|
||||
}
|
||||
},
|
||||
"@wordpress/keycodes": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.7.0.tgz",
|
||||
"integrity": "sha512-FPOFKSPY5WrvQuNr1l/WYn/ey+NoRO+RKQTlGR2EgpfWonqVGpV+CfEVyvgPVj8BBVcQHVDJYGkNEKDsoZ5l+g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@wordpress/i18n": "^3.7.0",
|
||||
|
@ -2619,7 +2629,6 @@
|
|||
"version": "3.4.8",
|
||||
"resolved": "https://registry.npmjs.org/downshift/-/downshift-3.4.8.tgz",
|
||||
"integrity": "sha512-dZL3iNL/LbpHNzUQAaVq/eTD1ocnGKKjbAl/848Q0KEp6t81LJbS37w3f93oD6gqqAnjdgM7Use36qZSipHXBw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.5",
|
||||
"compute-scroll-into-view": "^1.0.9",
|
||||
|
@ -3953,7 +3962,6 @@
|
|||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
|
@ -4603,7 +4611,6 @@
|
|||
"version": "10.0.27",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-10.0.27.tgz",
|
||||
"integrity": "sha512-SUNYcT4FqhOqvwv0z1oeYhqgheU8qrceLojuHyX17ngo7WtWqN5I9l3IGHzf21Xraj465CVzF4IvOlAF+3ed0A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/helper-module-imports": "^7.0.0",
|
||||
"@emotion/hash": "0.7.4",
|
||||
|
@ -4642,7 +4649,6 @@
|
|||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz",
|
||||
"integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.7.2",
|
||||
"cosmiconfig": "^6.0.0",
|
||||
|
@ -4670,8 +4676,7 @@
|
|||
"babel-plugin-syntax-jsx": {
|
||||
"version": "6.18.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz",
|
||||
"integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=",
|
||||
"dev": true
|
||||
"integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY="
|
||||
},
|
||||
"babel-plugin-syntax-object-rest-spread": {
|
||||
"version": "6.13.0",
|
||||
|
@ -5456,8 +5461,7 @@
|
|||
"body-scroll-lock": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-2.6.4.tgz",
|
||||
"integrity": "sha512-NP08WsovlmxEoZP9pdlqrE+AhNaivlTrz9a0FF37BQsnOrpN48eNqivKkE7SYpM9N+YIPjsdVzfLAUQDBm6OQw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-NP08WsovlmxEoZP9pdlqrE+AhNaivlTrz9a0FF37BQsnOrpN48eNqivKkE7SYpM9N+YIPjsdVzfLAUQDBm6OQw=="
|
||||
},
|
||||
"boolbase": {
|
||||
"version": "1.0.0",
|
||||
|
@ -5888,8 +5892,7 @@
|
|||
"callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
|
||||
},
|
||||
"camelcase": {
|
||||
"version": "5.3.1",
|
||||
|
@ -6432,7 +6435,6 @@
|
|||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
|
@ -6440,8 +6442,7 @@
|
|||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||
"dev": true
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
|
||||
},
|
||||
"color-string": {
|
||||
"version": "1.5.3",
|
||||
|
@ -6597,7 +6598,6 @@
|
|||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz",
|
||||
"integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.1"
|
||||
},
|
||||
|
@ -6605,8 +6605,7 @@
|
|||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -6693,7 +6692,6 @@
|
|||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz",
|
||||
"integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/parse-json": "^4.0.0",
|
||||
"import-fresh": "^3.1.0",
|
||||
|
@ -7075,8 +7073,7 @@
|
|||
"csstype": {
|
||||
"version": "2.6.8",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.8.tgz",
|
||||
"integrity": "sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA=="
|
||||
},
|
||||
"currently-unhandled": {
|
||||
"version": "0.4.1",
|
||||
|
@ -7897,7 +7894,6 @@
|
|||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-arrayish": "^0.2.1"
|
||||
}
|
||||
|
@ -7953,8 +7949,7 @@
|
|||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
||||
"dev": true
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
|
||||
},
|
||||
"escodegen": {
|
||||
"version": "1.12.1",
|
||||
|
@ -8297,8 +8292,7 @@
|
|||
"esutils": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
|
||||
},
|
||||
"etag": {
|
||||
"version": "1.8.1",
|
||||
|
@ -8980,8 +8974,7 @@
|
|||
"find-root": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
|
||||
"integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==",
|
||||
"dev": true
|
||||
"integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="
|
||||
},
|
||||
"find-up": {
|
||||
"version": "3.0.0",
|
||||
|
@ -10113,8 +10106,7 @@
|
|||
"gradient-parser": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/gradient-parser/-/gradient-parser-0.1.5.tgz",
|
||||
"integrity": "sha1-DH4heVWeXOfY1x9EI6+TcQCyJIw=",
|
||||
"dev": true
|
||||
"integrity": "sha1-DH4heVWeXOfY1x9EI6+TcQCyJIw="
|
||||
},
|
||||
"gridicons": {
|
||||
"version": "3.3.1",
|
||||
|
@ -10215,8 +10207,7 @@
|
|||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
||||
"dev": true
|
||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
|
||||
},
|
||||
"has-symbols": {
|
||||
"version": "1.0.1",
|
||||
|
@ -10689,7 +10680,6 @@
|
|||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
|
||||
"integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"parent-module": "^1.0.0",
|
||||
"resolve-from": "^4.0.0"
|
||||
|
@ -10965,8 +10955,7 @@
|
|||
"is-arrayish": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
|
||||
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
|
||||
"dev": true
|
||||
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
|
||||
},
|
||||
"is-binary-path": {
|
||||
"version": "1.0.1",
|
||||
|
@ -12242,8 +12231,7 @@
|
|||
"json-parse-better-errors": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
|
||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw=="
|
||||
},
|
||||
"json-schema": {
|
||||
"version": "0.2.3",
|
||||
|
@ -12385,8 +12373,7 @@
|
|||
"lines-and-columns": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
||||
"integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA="
|
||||
},
|
||||
"lint-staged": {
|
||||
"version": "9.5.0",
|
||||
|
@ -14776,7 +14763,6 @@
|
|||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"callsites": "^3.0.0"
|
||||
}
|
||||
|
@ -14813,7 +14799,6 @@
|
|||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz",
|
||||
"integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"error-ex": "^1.3.1",
|
||||
|
@ -14884,8 +14869,7 @@
|
|||
"path-parse": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
||||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
|
@ -14898,8 +14882,7 @@
|
|||
"path-type": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
|
||||
},
|
||||
"pbkdf2": {
|
||||
"version": "3.0.17",
|
||||
|
@ -14998,8 +14981,7 @@
|
|||
"popper.js": {
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.0.tgz",
|
||||
"integrity": "sha512-+G+EkOPoE5S/zChTpmBSSDYmhXJ5PsW8eMhH8cP/CQHMFPBG/kC9Y5IIw6qNYgdJ+/COf0ddY2li28iHaZRSjw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-+G+EkOPoE5S/zChTpmBSSDYmhXJ5PsW8eMhH8cP/CQHMFPBG/kC9Y5IIw6qNYgdJ+/COf0ddY2li28iHaZRSjw=="
|
||||
},
|
||||
"portfinder": {
|
||||
"version": "1.0.25",
|
||||
|
@ -16390,7 +16372,6 @@
|
|||
"version": "1.0.0-beta.14",
|
||||
"resolved": "https://registry.npmjs.org/reakit/-/reakit-1.0.0-beta.14.tgz",
|
||||
"integrity": "sha512-/KRlHT7tACx3PVvnX1DOuJxlWnfdfbdoEOJKdVPR8X4a9hkLPOZnLRaCNWKwHTVR7tAuVxo0K+ySsMuxWiGGYw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"body-scroll-lock": "^2.6.4",
|
||||
"popper.js": "^1.16.0",
|
||||
|
@ -16401,14 +16382,12 @@
|
|||
"reakit-system": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/reakit-system/-/reakit-system-0.7.2.tgz",
|
||||
"integrity": "sha512-IY0NwVguy2Awp0DFRzsCBtSnn5gpHtfM3pvfi6Qcwv7Wkms6ZUWxsqFpwNJTMBfXqEBo9dDuIkpCBZivtezYzA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-IY0NwVguy2Awp0DFRzsCBtSnn5gpHtfM3pvfi6Qcwv7Wkms6ZUWxsqFpwNJTMBfXqEBo9dDuIkpCBZivtezYzA=="
|
||||
},
|
||||
"reakit-utils": {
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://registry.npmjs.org/reakit-utils/-/reakit-utils-0.7.3.tgz",
|
||||
"integrity": "sha512-sQsgKYcn+OthBkvKz+TeHlYZq2SF5ZP9RutHg7O67GI+sdYqf0BVy6VeTe28TG4Vui6hoMheiMnZqhidOtN7EA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-sQsgKYcn+OthBkvKz+TeHlYZq2SF5ZP9RutHg7O67GI+sdYqf0BVy6VeTe28TG4Vui6hoMheiMnZqhidOtN7EA=="
|
||||
},
|
||||
"realpath-native": {
|
||||
"version": "1.1.0",
|
||||
|
@ -16749,7 +16728,6 @@
|
|||
"version": "1.14.2",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.2.tgz",
|
||||
"integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
|
@ -16793,8 +16771,7 @@
|
|||
"resolve-from": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
|
||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
|
||||
},
|
||||
"resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
|
@ -17800,8 +17777,7 @@
|
|||
"source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
|
||||
"dev": true
|
||||
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
|
||||
},
|
||||
"source-map-loader": {
|
||||
"version": "0.2.4",
|
||||
|
@ -18827,7 +18803,6 @@
|
|||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
|
@ -19127,8 +19102,7 @@
|
|||
"to-fast-properties": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
||||
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
|
||||
"dev": true
|
||||
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4="
|
||||
},
|
||||
"to-object-path": {
|
||||
"version": "0.3.0",
|
||||
|
@ -20261,6 +20235,76 @@
|
|||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
||||
"dev": true
|
||||
},
|
||||
"wordpress-components": {
|
||||
"version": "npm:@wordpress/components@8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/components/-/components-8.5.0.tgz",
|
||||
"integrity": "sha512-2wBpL7a9udh2yvzIA242Fhu2+srNv4WXFa0jjXJrf99smlVm2BxLMQtlNgfaV4LkYFAAnc0Bkud90NdrOoZ/ig==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@emotion/core": "10.0.22",
|
||||
"@emotion/styled": "10.0.23",
|
||||
"@wordpress/a11y": "^2.5.1",
|
||||
"@wordpress/compose": "^3.9.0",
|
||||
"@wordpress/deprecated": "^2.6.1",
|
||||
"@wordpress/dom": "^2.6.0",
|
||||
"@wordpress/element": "^2.10.0",
|
||||
"@wordpress/hooks": "^2.6.0",
|
||||
"@wordpress/i18n": "^3.7.0",
|
||||
"@wordpress/is-shallow-equal": "^1.6.1",
|
||||
"@wordpress/keycodes": "^2.7.0",
|
||||
"@wordpress/rich-text": "^3.9.0",
|
||||
"classnames": "^2.2.5",
|
||||
"clipboard": "^2.0.1",
|
||||
"dom-scroll-into-view": "^1.2.1",
|
||||
"downshift": "^3.3.4",
|
||||
"gradient-parser": "^0.1.5",
|
||||
"lodash": "^4.17.15",
|
||||
"memize": "^1.0.5",
|
||||
"moment": "^2.22.1",
|
||||
"mousetrap": "^1.6.2",
|
||||
"re-resizable": "^6.0.0",
|
||||
"react-dates": "^17.1.1",
|
||||
"react-spring": "^8.0.20",
|
||||
"reakit": "^1.0.0-beta.12",
|
||||
"rememo": "^3.0.0",
|
||||
"tinycolor2": "^1.4.1",
|
||||
"uuid": "^3.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/compose": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.9.0.tgz",
|
||||
"integrity": "sha512-UhuHCQANb0ob5TBZSQl1y6i7FBTKXXI0jwzPKkWhLmMByjM8pIQte53nQu9RbwQ1I5ItHqhzKoy5wyaXdjgWkQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@wordpress/element": "^2.10.0",
|
||||
"@wordpress/is-shallow-equal": "^1.6.1",
|
||||
"lodash": "^4.17.15"
|
||||
}
|
||||
},
|
||||
"@wordpress/keycodes": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.7.0.tgz",
|
||||
"integrity": "sha512-FPOFKSPY5WrvQuNr1l/WYn/ey+NoRO+RKQTlGR2EgpfWonqVGpV+CfEVyvgPVj8BBVcQHVDJYGkNEKDsoZ5l+g==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.4",
|
||||
"@wordpress/i18n": "^3.7.0",
|
||||
"lodash": "^4.17.15"
|
||||
}
|
||||
},
|
||||
"downshift": {
|
||||
"version": "3.4.8",
|
||||
"resolved": "https://registry.npmjs.org/downshift/-/downshift-3.4.8.tgz",
|
||||
"integrity": "sha512-dZL3iNL/LbpHNzUQAaVq/eTD1ocnGKKjbAl/848Q0KEp6t81LJbS37w3f93oD6gqqAnjdgM7Use36qZSipHXBw==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.5",
|
||||
"compute-scroll-into-view": "^1.0.9",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-is": "^16.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
|
||||
|
@ -20373,7 +20417,6 @@
|
|||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.7.2.tgz",
|
||||
"integrity": "sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.6.3"
|
||||
}
|
||||
|
|
|
@ -46,9 +46,9 @@
|
|||
"@babel/plugin-proposal-class-properties": "7.7.4",
|
||||
"@octokit/rest": "16.36.0",
|
||||
"@wordpress/babel-preset-default": "4.8.0",
|
||||
"@wordpress/base-styles": "^1.1.0",
|
||||
"@wordpress/blocks": "6.9.0",
|
||||
"@wordpress/browserslist-config": "2.6.0",
|
||||
"@wordpress/components": "8.5.0",
|
||||
"@wordpress/data-controls": "1.5.0",
|
||||
"@wordpress/date": "3.7.0",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "2.1.0",
|
||||
|
@ -108,6 +108,8 @@
|
|||
"npm": "6.13.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/components": "8.5.0",
|
||||
"wordpress-components": "npm:@wordpress/components@8.5.0",
|
||||
"@woocommerce/components": "4.0.0",
|
||||
"compare-versions": "3.5.1",
|
||||
"downshift": "4.0.4",
|
||||
|
|
|
@ -38,12 +38,14 @@ class Assets {
|
|||
self::register_style( 'wc-block-editor', plugins_url( self::get_block_asset_build_path( 'editor', 'css' ), __DIR__ ), array( 'wp-edit-blocks' ) );
|
||||
wp_style_add_data( 'wc-block-editor', 'rtl', 'replace' );
|
||||
self::register_style( 'wc-block-style', plugins_url( self::get_block_asset_build_path( 'style', 'css' ), __DIR__ ), [] );
|
||||
self::register_style( 'wc-block-vendors-style', plugins_url( self::get_block_asset_build_path( 'vendors-style', 'css' ), __DIR__ ), [] );
|
||||
wp_style_add_data( 'wc-block-style', 'rtl', 'replace' );
|
||||
|
||||
// Shared libraries and components across all blocks.
|
||||
self::register_script( 'wc-blocks-data-store', plugins_url( 'build/wc-blocks-data.js', __DIR__ ), [], false );
|
||||
self::register_script( 'wc-blocks', plugins_url( self::get_block_asset_build_path( 'blocks' ), __DIR__ ), [], false );
|
||||
self::register_script( 'wc-vendors', plugins_url( self::get_block_asset_build_path( 'vendors' ), __DIR__ ), [], false );
|
||||
self::register_script( 'wc-vendors-frontend', plugins_url( self::get_block_asset_build_path( 'vendors-frontend' ), __DIR__ ), [], false );
|
||||
|
||||
self::register_script( 'wc-blocks-registry', plugins_url( 'build/wc-blocks-registry.js', __DIR__ ), [], false );
|
||||
|
||||
|
@ -102,28 +104,30 @@ class Assets {
|
|||
return array_merge(
|
||||
$settings,
|
||||
[
|
||||
'min_columns' => wc_get_theme_support( 'product_blocks::min_columns', 1 ),
|
||||
'max_columns' => wc_get_theme_support( 'product_blocks::max_columns', 6 ),
|
||||
'default_columns' => wc_get_theme_support( 'product_blocks::default_columns', 3 ),
|
||||
'min_rows' => wc_get_theme_support( 'product_blocks::min_rows', 1 ),
|
||||
'max_rows' => wc_get_theme_support( 'product_blocks::max_rows', 6 ),
|
||||
'default_rows' => wc_get_theme_support( 'product_blocks::default_rows', 1 ),
|
||||
'thumbnail_size' => wc_get_theme_support( 'thumbnail_image_width', 300 ),
|
||||
'placeholderImgSrc' => wc_placeholder_img_src(),
|
||||
'min_height' => wc_get_theme_support( 'featured_block::min_height', 500 ),
|
||||
'default_height' => wc_get_theme_support( 'featured_block::default_height', 500 ),
|
||||
'isLargeCatalog' => $product_counts->publish > 100,
|
||||
'limitTags' => $tag_count > 100,
|
||||
'hasTags' => $tag_count > 0,
|
||||
'homeUrl' => esc_url( home_url( '/' ) ),
|
||||
'shopUrl' => get_permalink( wc_get_page_id( 'shop' ) ),
|
||||
'checkoutUrl' => get_permalink( wc_get_page_id( 'checkout' ) ),
|
||||
'showAvatars' => '1' === get_option( 'show_avatars' ),
|
||||
'reviewRatingsEnabled' => wc_review_ratings_enabled(),
|
||||
'productCount' => array_sum( (array) $product_counts ),
|
||||
'attributes' => array_values( wc_get_attribute_taxonomies() ),
|
||||
'wcBlocksAssetUrl' => plugins_url( 'assets/', __DIR__ ),
|
||||
'restApiRoutes' => [
|
||||
'min_columns' => wc_get_theme_support( 'product_blocks::min_columns', 1 ),
|
||||
'max_columns' => wc_get_theme_support( 'product_blocks::max_columns', 6 ),
|
||||
'default_columns' => wc_get_theme_support( 'product_blocks::default_columns', 3 ),
|
||||
'min_rows' => wc_get_theme_support( 'product_blocks::min_rows', 1 ),
|
||||
'max_rows' => wc_get_theme_support( 'product_blocks::max_rows', 6 ),
|
||||
'default_rows' => wc_get_theme_support( 'product_blocks::default_rows', 1 ),
|
||||
'thumbnail_size' => wc_get_theme_support( 'thumbnail_image_width', 300 ),
|
||||
'placeholderImgSrc' => wc_placeholder_img_src(),
|
||||
'min_height' => wc_get_theme_support( 'featured_block::min_height', 500 ),
|
||||
'default_height' => wc_get_theme_support( 'featured_block::default_height', 500 ),
|
||||
'isLargeCatalog' => $product_counts->publish > 100,
|
||||
'limitTags' => $tag_count > 100,
|
||||
'hasTags' => $tag_count > 0,
|
||||
'homeUrl' => esc_url( home_url( '/' ) ),
|
||||
'shopUrl' => get_permalink( wc_get_page_id( 'shop' ) ),
|
||||
'checkoutUrl' => get_permalink( wc_get_page_id( 'checkout' ) ),
|
||||
'couponsEnabled' => wc_coupons_enabled(),
|
||||
'displayPricesIncludingTaxes' => 'incl' === get_option( 'woocommerce_tax_display_shop' ),
|
||||
'showAvatars' => '1' === get_option( 'show_avatars' ),
|
||||
'reviewRatingsEnabled' => wc_review_ratings_enabled(),
|
||||
'productCount' => array_sum( (array) $product_counts ),
|
||||
'attributes' => array_values( wc_get_attribute_taxonomies() ),
|
||||
'wcBlocksAssetUrl' => plugins_url( 'assets/', __DIR__ ),
|
||||
'restApiRoutes' => [
|
||||
'/wc/store' => array_keys( \Automattic\WooCommerce\Blocks\RestApi::get_routes_from_namespace( 'wc/store' ) ),
|
||||
],
|
||||
]
|
||||
|
@ -178,12 +182,13 @@ class Assets {
|
|||
* @since 2.3.0
|
||||
* @since $VID:$ Changed $name to $script_name and added $handle argument.
|
||||
*
|
||||
* @param string $script_name Name of the script used to identify the file inside build folder.
|
||||
* @param string $handle Provided if the handle should be different than the script name. `wc-` prefix automatically added.
|
||||
* @param string $script_name Name of the script used to identify the file inside build folder.
|
||||
* @param string $handle Optional. Provided if the handle should be different than the script name. `wc-` prefix automatically added.
|
||||
* @param array $dependencies Optional. An array of registered script handles this script depends on. Default empty array.
|
||||
*/
|
||||
public static function register_block_script( $script_name, $handle = '' ) {
|
||||
public static function register_block_script( $script_name, $handle = '', $dependencies = [] ) {
|
||||
$handle = '' !== $handle ? $handle : $script_name;
|
||||
self::register_script( 'wc-' . $handle, plugins_url( self::get_block_asset_build_path( $script_name ), __DIR__ ) );
|
||||
self::register_script( 'wc-' . $handle, plugins_url( self::get_block_asset_build_path( $script_name ), __DIR__ ), $dependencies );
|
||||
wp_enqueue_script( 'wc-' . $handle );
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class Cart extends AbstractBlock {
|
|||
'render_callback' => array( $this, 'render' ),
|
||||
'editor_script' => 'wc-' . $this->block_name . '-block',
|
||||
'editor_style' => 'wc-block-editor',
|
||||
'style' => 'wc-block-style',
|
||||
'style' => [ 'wc-block-style', 'wc-block-vendors-style' ],
|
||||
'script' => 'wc-' . $this->block_name . '-block-frontend',
|
||||
)
|
||||
);
|
||||
|
@ -46,7 +46,8 @@ class Cart extends AbstractBlock {
|
|||
public function render( $attributes = array(), $content = '' ) {
|
||||
\Automattic\WooCommerce\Blocks\Assets::register_block_script(
|
||||
$this->block_name . '-frontend',
|
||||
$this->block_name . '-block-frontend'
|
||||
$this->block_name . '-block-frontend',
|
||||
[ 'wc-vendors-frontend' ]
|
||||
);
|
||||
return $content;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue