spree_storefront 5.0.3 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a3165bdc79f4acc7b7ac36a86572a2f6d114fdacc1b125af2b0e86d21983d92
4
- data.tar.gz: 852b2926ade744ce9b0c41f0d5f04d68b10c3d5408100b3531dea0966b663fee
3
+ metadata.gz: 2558511bde3c23461f7d59985b314ea15d992912d29ba2566ce9d057b6a8cff2
4
+ data.tar.gz: 99bff2e39e457da5b2bec3fab6ab64b5953128bae0b2a42945c19e16d2b682f3
5
5
  SHA512:
6
- metadata.gz: 2727b7cca478cbe94b87e22cca326b11259138f2e36069487d546bb865cc4ca6952b05e94595350e31907916acb2c1d6f1a22ba45e3dbf382cf3c3af5c000aad
7
- data.tar.gz: 5bfc483ae97000fe62611cb3cd7fd39eca7c28104e8a193016a5e21dcf35ec2ee526c8fd1311cd2a4de42dfa95cafec65a5d791ceec662d586b92774d35daa48
6
+ metadata.gz: 709743a94e95bed8ef6a542231843103f60bf7699c610da106d96cd73178fe8a354eeeed5960d71349319ab77ee2915e11e97ec6efd12642f0af3d5af96175a5
7
+ data.tar.gz: bf929b7256f749ce99590d6f293326f157e2489700411d25e513a9ec0c4359d1352519fb1e1dea0cedfb6881771085e634af4b25b8f012ee4dbee474bd2e81f5
@@ -1,22 +1,18 @@
1
1
  .editor-overlay {
2
2
  z-index: 1089;
3
3
  width: 100%;
4
+ container-type: inline-size;
5
+ container-name: editor-overlay;
4
6
  }
5
7
 
6
8
  .editor-overlay-toolbar {
7
9
  position: absolute;
8
- top: -26px;
9
- left: -1px;
10
+ min-width: max-content;
10
11
  background-color: #0081f1;
11
12
  color: #fff;
12
- padding: 4px 8px;
13
13
  font-size: 12px;
14
14
  font-weight: bold;
15
- border-radius: 4px 4px 0 0;
16
- cursor: pointer;
17
15
  display: none;
18
- }
19
- .editor-overlay-toolbar {
20
16
  right: 2px;
21
17
  top: 2px;
22
18
  left: auto;
@@ -25,6 +21,15 @@
25
21
  padding: 2px 2px;
26
22
  border-radius: 4px;
27
23
  }
24
+
25
+ /* If the editor overlay is really small, move the toolbar to the bottom so it doesn't cover the content */
26
+ @container editor-overlay (max-width: 200px) {
27
+ .editor-overlay-toolbar {
28
+ top: 100%;
29
+ right: 0px;
30
+ }
31
+ }
32
+
28
33
  .editor-overlay-toolbar button {
29
34
  padding: 8px;
30
35
  border-radius: 4px;
@@ -1,8 +1,6 @@
1
1
  module Spree
2
2
  module Account
3
3
  class WishedItemsController < BaseController
4
- skip_before_action :verify_authenticity_token
5
-
6
4
  # POST /account/wished_items
7
5
  def create
8
6
  variant = current_store.variants.find(wished_item_params[:variant_id])
@@ -38,8 +38,10 @@ module Spree
38
38
 
39
39
  return if fonts.blank?
40
40
 
41
+ font_weights = (200..700).step(100).to_a
42
+
41
43
  imports = fonts.map do |font|
42
- "family=#{font.split(' ').join('+')}:wght@200..700"
44
+ "family=#{font.split.join('+')}:wght@#{font_weights.join(';')}"
43
45
  end.compact.join('&')
44
46
 
45
47
  return if imports.blank?
@@ -3,41 +3,48 @@ import { Controller } from "@hotwired/stimulus"
3
3
  export default class extends Controller {
4
4
  static targets = [ 'quantity', 'increase', 'decrease' ]
5
5
 
6
+ static values = {
7
+ min: { type: Number, default: 1 },
8
+ max: { type: Number, default: 9999 }
9
+ }
10
+
11
+ static classes = ['disabled']
12
+
6
13
  connect() {
7
- if (this.quantity <= 1) this.disableButton(this.decreaseTarget)
14
+ if (this.quantity <= this.minValue) this.disableButton(this.decreaseTarget)
8
15
  }
9
16
 
10
17
  get quantity() {
11
- return parseInt(this.quantityTarget.value) || 1
18
+ return parseInt(this.quantityTarget.value) || this.minValue
12
19
  }
13
20
 
14
21
  get maxQuantity() {
15
- return parseInt(this.quantityTarget.max) || 9999
22
+ return parseInt(this.quantityTarget.max) || this.maxValue
16
23
  }
17
24
 
18
25
  set quantity(value) {
19
- this.quantityTarget.value = parseInt(value) || 1
26
+ this.quantityTarget.value = parseInt(value) || this.minValue
20
27
  }
21
28
 
22
29
  increase() {
23
30
  if (this.quantity < this.maxQuantity) this.quantity = this.quantity + 1
24
- if (this.quantity > 1) this.enableButton(this.decreaseTarget)
31
+ if (this.quantity > this.minValue) this.enableButton(this.decreaseTarget)
25
32
  if (this.quantity == this.maxQuantity && this.increaseTarget.type != 'submit') this.disableButton(this.increaseTarget)
26
33
  }
27
34
 
28
35
  decrease() {
29
- if (this.quantity > 1) this.quantity = this.quantity - 1
30
- if (this.quantity == 1 && this.decreaseTarget.type != 'submit') this.disableButton(this.decreaseTarget)
36
+ if (this.quantity > this.minValue) this.quantity = this.quantity - 1
37
+ if (this.quantity == this.minValue && this.decreaseTarget.type != 'submit') this.disableButton(this.decreaseTarget)
31
38
  if (this.quantity < this.maxQuantity) this.enableButton(this.increaseTarget)
32
39
  }
33
40
 
34
41
  disableButton(button) {
35
42
  button.setAttribute('disabled', 'disabled')
36
- button.classList.add('opacity-50', 'cursor-not-allowed')
43
+ button.classList.add(...this.disabledClasses)
37
44
  }
38
45
 
39
46
  enableButton(button) {
40
47
  button.removeAttribute('disabled')
41
- button.classList.remove('opacity-50', 'cursor-not-allowed')
48
+ button.classList.remove(...this.disabledClasses)
42
49
  }
43
50
  }
@@ -6,6 +6,8 @@ export default class extends Controller {
6
6
  static targets = ['add', 'remove']
7
7
  static values = {
8
8
  variantId: String,
9
+ createWishlistPath: String,
10
+ destroyWishlistPath: String
9
11
  }
10
12
 
11
13
  connect() {
@@ -27,7 +29,7 @@ export default class extends Controller {
27
29
 
28
30
  const headers = {}
29
31
 
30
- const response = await post('/account/wishlist/wished_items', {
32
+ const response = await post(this.createWishlistPathValue, {
31
33
  body: body,
32
34
  headers: headers,
33
35
  responseKind: 'turbo-stream'
@@ -45,7 +47,7 @@ export default class extends Controller {
45
47
 
46
48
  const headers = {}
47
49
 
48
- const response = await destroy(`/account/wishlist/wished_items/${this.variantIdValue}`, {
50
+ const response = await destroy(this.destroyWishlistPathValue, {
49
51
  headers: headers,
50
52
  responseKind: 'turbo-stream'
51
53
  })
@@ -8,7 +8,7 @@
8
8
  <%= render 'spree/shared/head' %>
9
9
  <%= render 'spree/shared/custom_head' %>
10
10
  </head>
11
- <body id="checkout-page" class="w-full bg-background text-text">
11
+ <body id="checkout-page" class="theme-<%= current_theme.class.name.demodulize.underscore %> w-full bg-background text-text">
12
12
  <%= render_storefront_partials(:body_start_partials) %>
13
13
  <%= current_store.storefront_custom_code_body_start&.html_safe %>
14
14
 
@@ -6,7 +6,7 @@
6
6
  <%= render 'spree/shared/json_ld' %>
7
7
  <%= current_store.storefront_custom_code_head&.html_safe %>
8
8
  </head>
9
- <body class="bg-background w-full text-text <%= current_page&.slug %>-page <% if current_theme_preview.present? %>inside-page-builder<% end %>">
9
+ <body class="theme-<%= current_theme.class.name.demodulize.underscore %> bg-background w-full text-text <%= current_page&.slug %>-page <% if current_theme_preview.present? %>inside-page-builder<% end %>">
10
10
  <%= render_storefront_partials(:body_start_partials) %>
11
11
  <%= current_store.storefront_custom_code_body_start&.html_safe %>
12
12
 
@@ -1,6 +1,6 @@
1
1
  <div class="flex items-center">
2
2
  <%= form_for line_item, url: spree.line_item_url(line_item, order_token: line_item.order.token), data: { controller: 'turbo-stream-form' } do |item_form| %>
3
- <div class="quantity-picker" data-controller="quantity-picker">
3
+ <div class="quantity-picker" data-controller="quantity-picker" data-quantity-picker-disabled-class="opacity-50 cursor-not-allowed">
4
4
  <!-- this is a dummy button to work with turbo frame forms when hitting ENTER -->
5
5
  <%= button_tag render('spree/shared/icons/minus'), type: 'submit', class: 'hidden' %>
6
6
  <%= quantity_modifier_button_tag render('spree/shared/icons/minus'), type: 'submit', action: 'decrease', class: 'quantity-decrease-button' %>
@@ -38,7 +38,7 @@
38
38
  <div <%= block_attributes(block) %> class="flex justify-center w-full">
39
39
  <% if block.image.attached? && block.image.variable? %>
40
40
  <% image_style = "aspect-ratio: #{spree_asset_aspect_ratio(block.image)}; --desktop-height: #{block.preferred_height}px; --mobile-height: #{block.preferred_mobile_height}px;" %>
41
- <%= image_tag spree_image_url(block.image, width: 1000, height: 1000), height: block.preferred_height, width: block.preferred_width, class: "custom-desktop-height custom-mobile-height", style: image_style %>
41
+ <%= image_tag spree_image_url(block.image, width: 1000, height: 1000), height: block.preferred_height, class: "custom-desktop-height custom-mobile-height", style: image_style %>
42
42
  <% end %>
43
43
  </div>
44
44
  <% end %>
@@ -37,16 +37,23 @@
37
37
  </div>
38
38
  </div>
39
39
 
40
- <% if products %>
41
- <div style='<%= section_styles(section) %>'>
42
- <div class='page-container'>
43
- <div class='grid gap-y-8 gap-x-4 grid-cols-2 lg:grid-cols-4 lg:gap-x-6 lg:gap-y-10 mb-7' id='products'>
40
+ <div style="<%= section_styles(section) %>">
41
+ <div class="page-container">
42
+ <% if products.any? %>
43
+ <div class="grid gap-y-8 gap-x-4 grid-cols-2 lg:grid-cols-4 lg:gap-x-6 lg:gap-y-10 mb-7" id="products">
44
44
  <%= render 'spree/shared/products', products: products %>
45
45
  </div>
46
- </div>
47
- <%= render 'spree/products/show_more_button' %>
48
- </div>
49
46
 
50
- <%= render 'spree/products/json_ld_list', products: products unless turbo_frame_request? %>
51
- <% end %>
47
+ <%= render 'spree/products/show_more_button' %>
48
+ <%= render('spree/products/json_ld_list', products: products) unless turbo_frame_request? %>
49
+ <% else %>
50
+ <div class="grid">
51
+ <div class="text-center py-10">
52
+ <h2 class="text-xl font-semibold mb-2"><%= Spree.t(:no_products_found) %></h2>
53
+ <p class="text-sm"><%= Spree.t(:try_removing_filters) %></p>
54
+ </div>
55
+ </div>
56
+ <% end %>
57
+ </div>
58
+ </div>
52
59
  <% end %>
@@ -6,6 +6,8 @@
6
6
  <div class="wished-item-<%= variant.id %> h-full"
7
7
  data-controller="wished-item"
8
8
  data-wished-item-variant-id-value="<%= variant.id %>"
9
+ data-wished-item-create-wishlist-path-value="<%= spree.account_wishlist_wished_items_path %>"
10
+ data-wished-item-destroy-wishlist-path-value="<%= spree.account_wishlist_wished_item_path(variant.id) %>"
9
11
  >
10
12
  <%= button_tag type: 'submit',
11
13
  class: "#{css_classes} disabled:animate-pulse",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_storefront
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vendo Connect Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-06 00:00:00.000000000 Z
11
+ date: 2025-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.3
19
+ version: 5.0.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.3
26
+ version: 5.0.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: active_link_to
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -542,9 +542,9 @@ licenses:
542
542
  - AGPL-3.0-or-later
543
543
  metadata:
544
544
  bug_tracker_uri: https://github.com/spree/spree/issues
545
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.3
545
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.4
546
546
  documentation_uri: https://docs.spreecommerce.org/
547
- source_code_uri: https://github.com/spree/spree/tree/v5.0.3
547
+ source_code_uri: https://github.com/spree/spree/tree/v5.0.4
548
548
  post_install_message:
549
549
  rdoc_options: []
550
550
  require_paths: