add price package (https://github.com/woocommerce/woocommerce-blocks/pull/3790)
This commit is contained in:
parent
8521264237
commit
99b78a1c9a
|
@ -26,6 +26,7 @@ module.exports = {
|
|||
'import/core-modules': [
|
||||
'@woocommerce/block-data',
|
||||
'@woocommerce/blocks-checkout',
|
||||
'@woocommerce/price-format',
|
||||
'@woocommerce/settings',
|
||||
'@woocommerce/shared-context',
|
||||
'@woocommerce/shared-hocs',
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import ProductPrice from '@woocommerce/base-components/product-price';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/blocks-checkout';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
||||
import {
|
||||
useInnerBlockLayoutContext,
|
||||
useProductDataContext,
|
||||
|
|
|
@ -5,7 +5,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|||
import Label from '@woocommerce/base-components/label';
|
||||
import ProductPrice from '@woocommerce/base-components/product-price';
|
||||
import ProductName from '@woocommerce/base-components/product-name';
|
||||
import { getCurrency } from '@woocommerce/blocks-checkout';
|
||||
import { getCurrency } from '@woocommerce/price-format';
|
||||
import PropTypes from 'prop-types';
|
||||
import Dinero from 'dinero.js';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
useCustomerDataContext,
|
||||
} from '@woocommerce/base-context';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/blocks-checkout';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
||||
import { useEffect, useRef } from '@wordpress/element';
|
||||
import { DISPLAY_CART_PRICES_INCLUDING_TAX } from '@woocommerce/block-settings';
|
||||
import { ValidationInputError } from '@woocommerce/base-components/validation';
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { __, sprintf } from '@wordpress/i18n';
|
||||
import { formatPrice } from '@woocommerce/blocks-checkout';
|
||||
import { formatPrice } from '@woocommerce/price-format';
|
||||
import { RemovableChip } from '@woocommerce/base-components/chip';
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
ProductMetadata,
|
||||
ProductSaleBadge,
|
||||
} from '@woocommerce/base-components/cart-checkout';
|
||||
import { getCurrency } from '@woocommerce/blocks-checkout';
|
||||
import { getCurrency } from '@woocommerce/price-format';
|
||||
import Dinero from 'dinero.js';
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,8 +15,9 @@ import {
|
|||
TotalsFees,
|
||||
TotalsTaxes,
|
||||
ExperimentalOrderMeta,
|
||||
getCurrencyFromPriceResponse,
|
||||
} from '@woocommerce/blocks-checkout';
|
||||
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
||||
import {
|
||||
COUPONS_ENABLED,
|
||||
DISPLAY_CART_PRICES_INCLUDING_TAX,
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
getShippingRatesPackageCount,
|
||||
getShippingRatesRateCount,
|
||||
} from '@woocommerce/base-utils';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/blocks-checkout';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
||||
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
|
||||
import {
|
||||
useCheckoutContext,
|
||||
|
|
|
@ -13,8 +13,8 @@ import {
|
|||
TotalsFees,
|
||||
TotalsTaxes,
|
||||
ExperimentalOrderMeta,
|
||||
getCurrencyFromPriceResponse,
|
||||
} from '@woocommerce/blocks-checkout';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
||||
import { useShippingDataContext } from '@woocommerce/base-context';
|
||||
import {
|
||||
COUPONS_ENABLED,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { useCallback, useState, useEffect } from '@wordpress/element';
|
|||
import PriceSlider from '@woocommerce/base-components/price-slider';
|
||||
import { useDebouncedCallback } from 'use-debounce';
|
||||
import PropTypes from 'prop-types';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/blocks-checkout';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
|
|
@ -107,6 +107,7 @@ const entries = {
|
|||
wcBlocksMiddleware: './assets/js/middleware/index.js',
|
||||
wcSharedContext: './assets/js/shared/context/index.js',
|
||||
wcSharedHocs: './assets/js/shared/hocs/index.js',
|
||||
priceFormat: './packages/prices/index.js',
|
||||
blocksCheckout: './packages/checkout/index.js',
|
||||
},
|
||||
main: {
|
||||
|
|
|
@ -19,6 +19,7 @@ const wcDepMap = {
|
|||
'@woocommerce/block-data': [ 'wc', 'wcBlocksData' ],
|
||||
'@woocommerce/shared-context': [ 'wc', 'wcSharedContext' ],
|
||||
'@woocommerce/shared-hocs': [ 'wc', 'wcSharedHocs' ],
|
||||
'@woocommerce/price-format': [ 'wc', 'priceFormat' ],
|
||||
'@woocommerce/blocks-checkout': [ 'wc', 'blocksCheckout' ],
|
||||
};
|
||||
|
||||
|
@ -29,6 +30,7 @@ const wcHandleMap = {
|
|||
'@woocommerce/block-data': 'wc-blocks-data-store',
|
||||
'@woocommerce/shared-context': 'wc-shared-context',
|
||||
'@woocommerce/shared-hocs': 'wc-shared-hocs',
|
||||
'@woocommerce/price-format': 'wc-price-format',
|
||||
'@woocommerce/blocks-checkout': 'wc-blocks-checkout',
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
export * from './totals';
|
||||
export * from './utils';
|
||||
export * from './shipping';
|
||||
export { default as ExperimentalOrderMeta } from './order-meta';
|
||||
export { default as ExperimentalOrderShippingPackages } from './order-shipping-packages';
|
||||
|
|
|
@ -4,11 +4,7 @@
|
|||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { DISPLAY_CART_PRICES_INCLUDING_TAX } from '@woocommerce/block-settings';
|
||||
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getCurrencyFromPriceResponse } from '../../utils';
|
||||
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
||||
|
||||
/**
|
||||
* Default render function for package rate options.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export * from './utils';
|
|
@ -96,6 +96,7 @@ class Assets {
|
|||
if ( Package::feature()->is_experimental_build() ) {
|
||||
$asset_api->register_script( 'wc-single-product-block', $asset_api->get_block_asset_build_path( 'single-product' ), $block_dependencies );
|
||||
}
|
||||
$asset_api->register_script( 'wc-price-format', 'build/price-format.js', [], false );
|
||||
|
||||
if ( Package::feature()->is_feature_plugin_build() ) {
|
||||
$asset_api->register_script( 'wc-blocks-checkout', 'build/blocks-checkout.js', [], false );
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"@woocommerce/editor-components(.*)$": "assets/js/editor-components/$1",
|
||||
"@woocommerce/blocks-registry": "assets/js/blocks-registry",
|
||||
"@woocommerce/blocks-checkout": "packages/checkout",
|
||||
"@woocommerce/price-format": "packages/prices",
|
||||
"@woocommerce/block-hocs(.*)$": "assets/js/hocs/$1",
|
||||
"@woocommerce/base-components(.*)$": "assets/js/base/components/$1",
|
||||
"@woocommerce/base-context(.*)$": "assets/js/base/context/$1",
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
"@woocommerce/block-hocs": [ "assets/js/hocs" ],
|
||||
"@woocommerce/blocks-registry": [ "assets/js/blocks-registry" ],
|
||||
"@woocommerce/blocks-checkout": [ "packages/checkout" ],
|
||||
"@woocommerce/price-format": [ "packages/prices" ],
|
||||
"@woocommerce/block-settings": [ "assets/js/settings/blocks" ],
|
||||
"@woocommerce/e2e-tests": [
|
||||
"node_modules/woocommerce/tests/e2e"
|
||||
|
|
Loading…
Reference in New Issue