Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cornerstone/6.13.0 #15

Merged
merged 65 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b305105
refactor(payment): PAYPAL-2079 removed accelerated checkout integrati…
serhii-tkachenko Mar 28, 2023
066e3e1
ci(storefront): bctheme-00 use node 16 in github actions (#2346)
BC-krasnoshapka Apr 11, 2023
d8882a7
fix(storefront): BCTHEME-1326 Running Lighthouse npm script fails in …
bc-vlad-dlogush Apr 12, 2023
3d021da
feat(other): LOCAL-1444 delivery translation
bc-svc-local Apr 13, 2023
9b4f774
feat(payment): PAYPAL-2195 added classes for applepay button
andriiVitvitskyi1990 Apr 11, 2023
59e32cf
fix(storefront): STRF-10416 - Updates the 'description' in a product …
bc-jz Apr 19, 2023
b2c22db
Merge pull request #2350 from bigcommerce/STRF-10416
bc-jz Apr 20, 2023
99be4e8
fix(storefront): BCTHEME-1420 If the gift is a variant, the button Ch…
bc-vlad-dlogush Apr 25, 2023
faf2598
feat(payment): BOLT-576 Add Bolt SPB support to cornerstone
PavlenkoM May 12, 2023
1511e98
fix(storefront): Remove default whitespace from multiline input (#2355)
pvaladez May 12, 2023
cce7637
fix(checkout): CHECKOUT-7213 refresh cart page if no item in the cart…
bc-mackxu May 18, 2023
2ac5b9e
fix(storefront): BCTHEME-1473 reverting PR for BCTHEME-1171 (#2354)
bc-alexsaiannyi May 22, 2023
e681b72
feat(other): LOCAL-1444 delivery translation (#2358)
bc-svc-local May 22, 2023
de5d564
Releasing 6.11.0-rc.1
bc-vlad-dlogush May 22, 2023
9424f8a
Releasing 6.11.0
bc-vlad-dlogush May 23, 2023
e558f1f
feat(other): LOCAL-1444 delivery translation
bc-svc-local Jun 1, 2023
9bcd8f2
fix(storefront): BCTHEME-1323 (sanitize product.description) in the t…
bc-vlad-dlogush Jun 7, 2023
c2ab2d0
feat(payment): PAYPAL-2039 added style configs to payment buttons (#2…
bc-dronov Jun 7, 2023
0efd14f
chore: DATA-11047 Bump stencil-utils version
bc-rmalyavc Jun 7, 2023
16bd54e
feat(payment): PAYPAL-2495 added ACH payment method section to My Acc…
serhii-tkachenko Jun 26, 2023
576d5a3
chore: DATA-11172 Populate data tags despite of data_tag_enabled setting
bc-rmalyavc Jun 26, 2023
5b8d890
feat(other): LOCAL-1444 delivery translation
bc-svc-local Jul 1, 2023
1e7eb82
fix(storefront): BCTHEME-1679 sync package lock file (#2373)
bc-vlad-dlogush Jul 4, 2023
0a4a79e
fix(storefront): BCTHEME-1172 Stored payment method name is not visib…
bc-vlad-dlogush Jul 4, 2023
a24c410
fix(storefront): BCTHEME-1633 Write a Review on product page shows bl…
bc-yevhenii-buliuk Jul 4, 2023
db4f2e9
fix(storefront): BCTHEME-1378 fix add product to cart on iphone x (ip…
yurytut1993 Jul 4, 2023
63c66af
feat(other): LOCAL-1444 delivery translation
bc-svc-local Jul 4, 2023
65ce99b
Releasing 6.12.0-rc.1
bc-vlad-dlogush Jul 5, 2023
9e1c8f3
feat(checkout): CHECKOUT-7557 display fees on cart page
bc-shawnwang Jul 6, 2023
6f5aa92
Releasing 6.12.0
bc-vlad-dlogush Jul 6, 2023
cdc3776
Merge pull request #2376 from bc-shawnwang/CHECKOUT-7557
huntario Jul 19, 2023
048c0db
build(deps): bump tough-cookie from 4.0.0 to 4.1.3
dependabot[bot] Jul 8, 2023
50b1359
build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4
dependabot[bot] Jul 18, 2023
fcd0768
Updated primary node/npm versions in the readme (#2384)
BC-krasnoshapka Jul 31, 2023
13749be
2386 replace twitter image (#2387)
AndrewBarber Aug 16, 2023
6266427
Added nvm config (#2389)
BC-krasnoshapka Aug 17, 2023
93c65a3
feat(checkout): CHECKOUT-7176 Displaying the Hidden Cart Source Input…
bc-mackxu Sep 6, 2023
965ed76
build(deps-dev): bump @babel/traverse from 7.13.0 to 7.23.2 (#2398)
dependabot[bot] Oct 23, 2023
9229a0c
Releasing 6.13.0-rc.1
Oct 31, 2023
59d9471
feat(payment): PAYPAL-3064 changed default paypal checkout color (#2405)
bc-dronov Nov 29, 2023
0840f0f
feat(payment): PAYPAL-3064 changed default paypal button size (#2406)
bc-dronov Dec 1, 2023
99a7a42
fix(storefront): BCTHEME-1646 Top Global Region Image Widget overlaps…
bc-yevhenii-buliuk Dec 5, 2023
e35b208
fix(storefront): BCTHEME-1748 Check lang helpers usage and existence …
bc-vlad-dlogush Dec 6, 2023
89db439
fix(storefront): PSE-868 Pagebuilder menu items are in the wrong case…
bc-NikitaPuzanenko Dec 15, 2023
32b0971
fix(storefront): BCTHEME-1626 Please Select a file popup forces shopp…
bc-yevhenii-buliuk Dec 15, 2023
88d37a9
chore: correct typo in default it appears deafault (#2410)
danielphilipjohnson Dec 15, 2023
278a7aa
feat(storefront): PSE-805 Add autocomplete to common input fields (#2…
bc-NikitaPuzanenko Dec 19, 2023
b9f2086
feat(storefront): BCTHEME-1750 Update Shop By Price Widget (#2408)
bc-yevhenii-buliuk Dec 26, 2023
9760047
feat(other): LOCAL-1444 delivery translation (#2412)
bc-svc-local Jan 4, 2024
9f95e96
Use triple sash to prevent escaping ampersands in customer's company …
CodingHerbivore Jan 4, 2024
c22ed7f
feat(storefront): Dispatch an event on productOptionsChanged (#2400)
mgarciaebo Jan 4, 2024
b8154be
feat(checkout): CHECKOUT-7125 Adding additional aria attributes to co…
bc-NikitaPuzanenko Jan 4, 2024
a9b47cd
fix(storefront): BCTHEME-1755 Videos added through the Product Editor…
bc-yevhenii-buliuk Jan 4, 2024
53e5b5e
fix(storefront): BCTHEME-1710 Pre-Orded text in Polish looks cropped …
bc-yevhenii-buliuk Jan 8, 2024
f332100
feat(other): LOCAL-1444 delivery translation (#2416)
bc-svc-local Jan 25, 2024
481bf05
fix(storefront): BCTHEME-1757 Anchor links on category pages are not …
bc-vlad-dlogush Feb 1, 2024
80497bf
feat(other): LOCAL-1444 delivery translation (#2423)
bc-svc-local Feb 1, 2024
4289e04
git merge 6.12.0
travish Feb 2, 2024
5175014
fix(storefront): BCTHEME-1764 Update layout with correct usage of mai…
bc-vlad-dlogush Feb 5, 2024
f8910e4
fix(storefront): BCTHEME-1765 With Product Filtering enabled widgets …
bc-vlad-dlogush Feb 5, 2024
65cc349
Releasing 6.13.0-rc.2
Feb 6, 2024
f290f24
Fix HTML markup for product listing and below content region (#2426)
sacr3dc0w Feb 8, 2024
83b3bd2
Releasing 6.13.0-rc.3
Feb 8, 2024
d799535
Releasing 6.13.0
Feb 12, 2024
a5cb4d6
git merge 6.13.0
travish Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node: [14.x]
node: [16.x]

steps:
- name: Checkout code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
node: [14.x]
node: [16.x]

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
node: [14.x]
node: [16.x]

steps:
- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.15
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Draft

## 6.13.0 (02-12-2024)

- Fix HTML markup for product listing and below content region [#2426](https://github.com/bigcommerce/cornerstone/pull/2426)
- With Product Filtering enabled widgets on category page disappear after navigating using pagination [#2425](https://github.com/bigcommerce/cornerstone/pull/2425)
- Update layout with correct usage of main tag [#2421](https://github.com/bigcommerce/cornerstone/pull/2421)
- Anchor links on category pages are not working when product filtering is enabled [#2415](https://github.com/bigcommerce/cornerstone/pull/2415)
- Dispatch an event on productOptionsChanged [#2400](https://github.com/bigcommerce/cornerstone/pull/2400)
- Check lang helpers usage and existence of key in translation file [#2403](https://github.com/bigcommerce/cornerstone/pull/2403)
- Display fees on cart page [#2376](https://github.com/bigcommerce/cornerstone/pull/2376)
- Replace Twitter logo with X logo within social sharing and social link components [#2387](https://github.com/bigcommerce/cornerstone/pull/2387)
- Added nvm config [#2389](https://github.com/bigcommerce/cornerstone/pull/2389)
- Displaying the Hidden cart_order_source Input Field on PDP page [#2392](https://github.com/bigcommerce/cornerstone/pull/2392)
- Videos added through the Product Editor have their thumbnails cropped compared to videos added through the page builder [#2413](https://github.com/bigcommerce/cornerstone/pull/2413)
- Update Shop By Price Widget [#2408](https://github.com/bigcommerce/cornerstone/pull/2408)
- 'Please Select a file' popup forces shopper to re-upload file if the option type is 'File Upload' and is set to required [#2409](https://github.com/bigcommerce/cornerstone/pull/2409)
- Top Global Region Image Widget overlaps the mobile menu [#2402](https://github.com/bigcommerce/cornerstone/pull/2402)
- Changed default PayPal checkout button color [#2405](https://github.com/bigcommerce/cornerstone/pull/2405)
- Changed default PayPal checkout button size [#2406](https://github.com/bigcommerce/cornerstone/pull/2406)
- Change case of Page builder menu item text [#2407](https://github.com/bigcommerce/cornerstone/pull/2407)
- Corrected typo with the word default previously deafault in config.json [#2410](https://github.com/bigcommerce/cornerstone/pull/2410)
- Adding autocomplete to common input fields [2397](https://github.com/bigcommerce/cornerstone/pull/2397)
- Pre-Orded text in Polish looks cropped in the button on Product page [2414](https://github.com/bigcommerce/cornerstone/pull/2414)
- Use triple sash on customer's company name to prevent escaping ampersands [#2399](https://github.com/bigcommerce/cornerstone/pull/2399)
- Adding aria attributes to cart page coupon code and gift cert buttons [#2391](https://github.com/bigcommerce/cornerstone/pull/2391)

## 6.12.0 (07-06-2023)

- sync package lock file [#2373](https://github.com/bigcommerce/cornerstone/pull/2373)
- Stored payment method name is not visible in Cornerstone Bold theme style [#2371](https://github.com/bigcommerce/cornerstone/pull/2371)
- (sanitize product.description) in the theme results to ‘error length of description’ from Google indexing for lengthy product description [#2363](https://github.com/bigcommerce/cornerstone/pull/2363)
- Added style configs to payment buttons [#2361](https://github.com/bigcommerce/cornerstone/pull/2361)
- Bump Stencil utils to 6.15.1 [#2365][https://github.com/bigcommerce/cornerstone/pull/2365]
- Write a Review on product page shows blank pop up on second click. [#2368][https://github.com/bigcommerce/cornerstone/pull/2368]
- Added ACH payment method section to My Account -> Payment Methods page [#2362](https://github.com/bigcommerce/cornerstone/pull/2362)
- Remove data_tag_enabled check from everywhere [#2369][https://github.com/bigcommerce/cornerstone/pull/2369]
- Fix add product to cart on iphone x (iphone version 11) [#2370][https://github.com/bigcommerce/cornerstone/pull/2370]
- Display fees on cart page [#2360](https://github.com/bigcommerce/cornerstone/pull/2376)

## 6.11.0 (05-24-2023)

- Reverted fix for sold-out badge appearance [#2354](https://github.com/bigcommerce/cornerstone/pull/2354)
- If the gift is a variant, the button "Change" shows in cart, and other variant are visible [#2349](https://github.com/bigcommerce/cornerstone/pull/2349)
- Removes the URL encoding from the 'description' in the product rich snippet schema [#2350](https://github.com/bigcommerce/cornerstone/pull/2350)
- Running Lighthouse npm script fails in terminal [#2345](https://github.com/bigcommerce/cornerstone/pull/2345)
- Removed accelerated checkout integration [#2341](https://github.com/bigcommerce/cornerstone/pull/2341)
- Added css classes for ApplePay Button [[#2344]](https://github.com/bigcommerce/cornerstone/pull/2344)
- Added styling config for the Bolt smart payment button [[#2356]](https://github.com/bigcommerce/cornerstone/pull/2356)
- Remove default whitespace from multiline input [#2355](https://github.com/bigcommerce/cornerstone/pull/2355)
- Refresh page if no more item in the cart [#2360](https://github.com/bigcommerce/cornerstone/pull/2360)

## 6.10.0 (03-23-2023)

- A bug with the display of the product quantity on the PDP [#2340](https://github.com/bigcommerce/cornerstone/pull/2340)
Expand Down
105 changes: 103 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,107 @@ git pull upstream main

- Run this command in a separate terminal so it will continue to run while you are developing.

# Cornerstone

![tests](https://github.com/bigcommerce/cornerstone/workflows/Theme%20Bundling%20Test/badge.svg?branch=master)

Stencil's Cornerstone theme is the building block for BigCommerce theme developers to get started quickly developing premium quality themes on the BigCommerce platform.

### Stencil Utils

[Stencil-utils](https://github.com/bigcommerce/stencil-utils) is our supporting library for our events and remote interactions.

## JS API

When writing theme JavaScript (JS) there is an API in place for running JS on a per page basis. To properly write JS for your theme, the following page types are available to you:

- "pages/account/addresses"
- "pages/account/add-address"
- "pages/account/add-return"
- "pages/account/add-wishlist"
- "pages/account/recent-items"
- "pages/account/download-item"
- "pages/account/edit"
- "pages/account/return-saved"
- "pages/account/returns"
- "pages/account/payment-methods"
- "pages/auth/login"
- "pages/auth/account-created"
- "pages/auth/create-account"
- "pages/auth/new-password"
- "pages/blog"
- "pages/blog-post"
- "pages/brand"
- "pages/brands"
- "pages/cart"
- "pages/category"
- "pages/compare"
- "pages/errors"
- "pages/gift-certificate/purchase"
- "pages/gift-certificate/balance"
- "pages/gift-certificate/redeem"
- "global"
- "pages/home"
- "pages/order-complete"
- "pages/page"
- "pages/product"
- "pages/search"
- "pages/sitemap"
- "pages/subscribed"
- "pages/account/wishlist-details"
- "pages/account/wishlists"

These page types will correspond to the pages within your theme. Each one of these page types map to an ES6 module that extends the base `PageManager` abstract class.

```javascript
export default class Auth extends PageManager {
constructor() {
// Set up code goes here; attach to internals and use internals as you would 'this'
}
}
```

### JS Template Context Injection

Occasionally you may need to use dynamic data from the template context within your client-side theme application code.

Two helpers are provided to help achieve this.

The inject helper allows you to compose a JSON object with a subset of the template context to be sent to the browser.

```
{{inject "stringBasedKey" contextValue}}
```

To retrieve the parsable JSON object, just call `{{jsContext}}` after all of the `{{@inject}}` calls.

For example, to setup the product name in your client-side app, you can do the following if you're in the context of a product:

```html
{{inject "myProductName" product.title}}

<script>
// Note the lack of quotes around the jsContext handlebars helper, it becomes a string automatically.
var jsContext = JSON.parse({{jsContext}}); // jsContext would output "{\"myProductName\": \"Sample Product\"}" which can feed directly into your JavaScript

console.log(jsContext.myProductName); // Will output: Sample Product
</script>
```

You can compose your JSON object across multiple pages to create a different set of client-side data depending on the currently loaded template context.

The stencil theme makes the jsContext available on both the active page scoped and global PageManager objects as `this.context`.

## Polyfilling via Feature Detection

Cornerstone implements [this strategy](https://philipwalton.com/articles/loading-polyfills-only-when-needed/) for polyfilling.

In `templates/components/common/polyfill-script.html` there is a simple feature detection script which can be extended to detect any recent JS features you intend to use in your theme code.

If any one of the conditions is not met, an additional blocking JS bundle configured in `assets/js/polyfills.js` will be loaded to polyfill modern JS features before the main bundle executes.

This intentionally prioritizes the experience of the 90%+ of shoppers who are on modern browsers in terms of performance, while maintaining compatibility (at the expense of additional JS download+parse for the polyfills) for users on legacy browsers.

## Static assets

Some static assets in the Stencil theme are handled with Grunt if required. This
Expand All @@ -64,9 +165,9 @@ and run:
npm install
```

Note: package-lock.json file was generated by Node version 10 and npm version 6.11.3. The app supports Node 10 as well as multiple versions of npm, but we should always use those versions when updating package-lock.json, unless it is decided to upgrade those, and in this case the readme should be updated as well. If using a different version for node OR npm, please delete the package-lock.json file prior to installing node packages and also prior to pushing to github.
Note: package-lock.json file was generated by Node version 18 and npm version 9. The app supports Node 18 as well as multiple versions of npm, but we should always use those versions when updating package-lock.json, unless it is decided to upgrade those, and in this case the readme should be updated as well. If using a different version for node OR npm, please delete the package-lock.json file prior to installing node packages and also prior to pushing to github.

If updating or adding a dependency, please double check that you are working on Node version 10 and npm version 6.11.3 and run `npm update <package_name>` or `npm install <package_name>` (avoid running npm install for updating a package). After updating the package, please make sure that the changes in the package-lock.json reflect only the updated/new package prior to pushing the changes to github.
If updating or adding a dependency, please double check that you are working on Node version 18 and npm version 9 and run `npm update <package_name>` or `npm install <package_name>` (avoid running npm install for updating a package). After updating the package, please make sure that the changes in the package-lock.json reflect only the updated/new package prior to pushing the changes to github.

### Icons

Expand Down
6 changes: 0 additions & 6 deletions assets/icons/twitter.svg

This file was deleted.

5 changes: 5 additions & 0 deletions assets/icons/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/img/icon-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/img/payment-methods/ach.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions assets/js/polyfills.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import 'whatwg-fetch';
import objectFitImages from 'object-fit-images';

require('formdata-polyfill');

document.addEventListener('DOMContentLoaded', () => {
objectFitImages();
});
13 changes: 11 additions & 2 deletions assets/js/theme/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,17 @@ export default class Cart extends PageManager {
this.$cartAdditionalCheckoutBtns.html(response.additionalCheckoutButtons);

$cartPageTitle.replaceWith(response.pageTitle);
this.bindEvents();
this.$overlay.hide();

const quantity =
$('[data-cart-quantity]', this.$cartContent).data('cartQuantity') || 0;

if (!quantity) {
return window.location.reload();
}

this.bindEvents();
this.$overlay.hide();

$('body').trigger('cart-quantity-update', quantity);

$(`[data-cart-itemid='${this.$activeCartItemId}']`, this.$cartContent)
Expand Down Expand Up @@ -312,6 +317,7 @@ export default class Cart extends PageManager {

$(event.currentTarget).hide();
$couponContainer.show();
$couponContainer.attr('aria-hidden', false);
$('.coupon-code-cancel').show();
$codeInput.trigger('focus');
});
Expand All @@ -320,6 +326,7 @@ export default class Cart extends PageManager {
event.preventDefault();

$couponContainer.hide();
$couponContainer.attr('aria-hidden', true);
$('.coupon-code-cancel').hide();
$('.coupon-code-add').show();
});
Expand Down Expand Up @@ -353,12 +360,14 @@ export default class Cart extends PageManager {
event.preventDefault();
$(event.currentTarget).toggle();
$certContainer.toggle();
$certContainer.attr('aria-hidden', false);
$('.gift-certificate-cancel').toggle();
});

$('.gift-certificate-cancel').on('click', (event) => {
event.preventDefault();
$certContainer.toggle();
$certContainer.attr('aria-hidden', true);
$('.gift-certificate-add').toggle();
$('.gift-certificate-cancel').toggle();
});
Expand Down
18 changes: 14 additions & 4 deletions assets/js/theme/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { hooks } from '@bigcommerce/stencil-utils';
import CatalogPage from './catalog';
import compareProducts from './global/compare-products';
import FacetedSearch from './common/faceted-search';
import { createTranslationDictionary } from './common/utils/translations-utils';
import { createTranslationDictionary } from '../theme/common/utils/translations-utils';

export default class Category extends CatalogPage {
constructor(context) {
Expand Down Expand Up @@ -48,11 +48,21 @@ export default class Category extends CatalogPage {

compareProducts(this.context);

if ($('#facetedSearch').length > 0) {
this.initFacetedSearch();
} else {
this.initFacetedSearch();

if (!$('#facetedSearch').length) {
this.onSortBySubmit = this.onSortBySubmit.bind(this);
hooks.on('sortBy-submitted', this.onSortBySubmit);

// Refresh range view when shop-by-price enabled
const urlParams = new URLSearchParams(window.location.search);

if (urlParams.has('search_query')) {
$('.reset-filters').show();
}

$('input[name="price_min"]').attr('value', urlParams.get('price_min'));
$('input[name="price_max"]').attr('value', urlParams.get('price_max'));
}

$('a.reset-btn').on('click', () =>
Expand Down
Loading
Loading