woocommerce/plugins/woocommerce-blocks/assets/js/base/utils/index.js

19 lines
617 B
JavaScript
Raw Normal View History

Active filters block (https://github.com/woocommerce/woocommerce-blocks/pull/1168) * Basic block construction * Register on PHP side * wc-active-filters script * Price utils * Refactor price slider so state reflects the query Moves some logic from the component to the block so that min and max price can change (via query) and be reflected by the price sliders. This allows the active filters block to change the query and have those new values reflected by the slider. * Fix type checking of numbers * Styles for filter block * Improved attribute helper for getting attribute taxonomy data from ID/taxonomy * Refactor attribute filter to use updateAttributeFilter helper * Disable checkboxes when loading to avoid multiple queries * Add todos - this is blocked * Remove checked state from Attribute Filter so it gets updated from the store (https://github.com/woocommerce/woocommerce-blocks/pull/1170) * isLoading check * active price filtering rendering * Block heading * Implement block options; chip display with clear button * Clear all should remove all attributes * Enable previews * Introduce a component to look up terms from slugs using collections (which are cached) * Correct all docblocks * activePriceFilters null return * renderRemovableListItem * Remove useMemo for hasFilters * Switch classnames notation * Ensure slug is array in removeAttributeFilterBySlug * null -> undefined return types for attributes * Remove fragment * Check we have a termObject in ActiveAttributeFilters * Refactor formatPriceRange return statements * Ensure query array index will exist * Only sort when adding a query * Remove aria-label with dupe text * hasFilters is function * Update useQueryStateByKey usage * More doc block fixes * Update getAttributeFromTaxonomy return and docblock * getAttributeFromID return/docblock
2019-11-15 14:41:23 +00:00
export * from './errors';
export * from './address';
export * from './shipping-rates';
export * from './legacy-events';
export * from './render-frontend';
Add Inner Block Rendering and Atomic Block Styles (https://github.com/woocommerce/woocommerce-blocks/pull/2607) * Register Atomic Blocks and save some block content * renderInnerBlocks utility * Frontend Rendering * Clean up atomic block classnames * Move shared styles * Create a hoc for attribute mapping * Rename some unpluralised class names * Remove prefixes from atomic component class names * Updated styles * Update styles from master * Revert product list styles * 2020 fixes * Separate renderFrontend from renderInnerBlocks * Lazy loading of components * Tweak loading classes * FIx all products loading state * Revert lazy implementation - creates too many unneccessary files due to webpack config * Cleanup * Remove wcBlocksBuildUrl * Move call to register_atomic_blocks * Remove duplicate key * reuse render frontend * Corectly handle frontend attribute mapping to keep editor working * Style updates * Update side effects * Remove width style from rating to fix alignment * Move ssr grid styles to main stylesheet * Put back prefixed classnames * 2020 styling fixes * Create frontend files instead of doing it all in block map * Update assets/js/atomic/utils/get-block-map.js Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> * Update assets/js/atomic/utils/render-parent-block.js Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> * Fix last child alignment regardless of block type * More specificity fixes * 2020 button alignment * static fix to prevent offsets * fix placeholder image in firefox * Issues reported in feedback Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2020-06-05 12:18:16 +00:00
export * from './get-valid-block-attributes';
export * from './product-data';
export * from './derive-selected-shipping-rates';
export * from './get-icons-from-payment-methods';
New contexts for `StoreNoticesContainer` and notice grouping (https://github.com/woocommerce/woocommerce-blocks/pull/7711) * Refactor Store Notices Move snackbar hiding filter before notice creation Implements showApplyCouponNotice Refactor context providers Use STORE_NOTICE_CONTEXTS use refs to track notice containers Refactor ref usage Use existing noticeContexts * Move new notice code to checkout package * Combine store and snackbars * Update noticeContexts imports * Remove context provider * Update data store * Fix 502 * Add new error contexts * Force types * Unnecessary reorder of imports * Fix global handling * Document forceType * Optional props are undefined * Remove function name * Missing condition * Remove context prop * Define ACTION_TYPES * Remove controls * Update assets/js/base/context/event-emit/utils.ts Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com> * CONTACT_INFORMATION * Remove ref from registerContainer * Abstract container locating methods * pass context correctly when displaying notices * Remove debugging buttons * Update filter usage - remove useMemo so filter can work inline * Refactor existing error notices from the API (https://github.com/woocommerce/woocommerce-blocks/pull/7728) * Update API type defs * Move create notice utils * Replace useCheckoutNotices with new contexts * processCheckoutResponseHeaders should check headers are defined * Scroll to error notices only if we're not editing a field * Error handling utils * processErrorResponse when pushing changes * processErrorResponse when processing checkout * remove formatStoreApiErrorMessage * Add todo for cart errors * Remove unused deps * unused imports * Fix linting warnings * Unused dep * Update assets/js/types/type-defs/api-response.ts Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com> * Add todo * Use generic * remove const * Update array types * Phone should be in address blocks Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com> * Update store name to wc/store/store-notices * Fix assertResponseIsValid * Funnel woocommerce_rest_invalid_email_address to the correct place * woocommerce_rest_missing_email_address * Move comments around * Move data back into const * Spacing * Remove spacing * Remove forced snack bar and styling * Move notices within wrapper * Remove type * hasStoreNoticesContainer rename * Group by status/context * Remove global context * Remove white space * remove changes to simplify diff * white space * Move comment to typescript * List style * showApplyCouponNotice docs * See if scrollIntoView exists * fix notice tests Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2022-12-19 15:30:13 +00:00
export * from './create-notice';
export * from './get-navigation-type';
2023-04-28 10:29:45 +00:00
export * from './map-keys';
export * from './camel-case-keys';
export * from './snake-case-keys';
export * from './debounce';
export * from './keyby';
export * from './pick';
Experiment: Replace style hooks coming from `@wordpress/block-editor` (https://github.com/woocommerce/woocommerce-blocks/pull/9251) * Replace all style hooks with useStyleProps hook * Remove border/color/spacing hooks * Style Props Hook * Make use of `change-case` package * Tidy up block wrappers * Attribute filter does not use frontend.ts nor styles within block * Remove frontend from filter blocks and unused styleprops usage * Tidy up variable names so its clearer attributes are not required specifically from blocks * Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/block.tsx Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> * Update assets/js/blocks/attribute-filter/block-wrapper.tsx Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> * Update assets/js/blocks/active-filters/block-wrapper.tsx Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> * Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/block.tsx Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com> * Update assets/js/blocks/rating-filter/block-wrapper.tsx Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com> * Update assets/js/blocks/stock-filter/block-wrapper.tsx Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com> * Update assets/js/blocks/price-filter/block-wrapper.tsx Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com> * Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/block.tsx Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com> * Simplify styleprop * Styleprops simplify * Fix withFeaturedItem styles * Like the original hook, flatten props and combine with parsed styles --------- Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2023-05-12 12:42:16 +00:00
export * from './get-inline-styles';