@viur/shop-components 0.14.2 → 0.14.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.
@@ -8,6 +8,10 @@ on:
8
8
  tags:
9
9
  - v*
10
10
 
11
+ permissions:
12
+ contents: read
13
+ id-token: write
14
+
11
15
  jobs:
12
16
  publish-npm:
13
17
  runs-on: ubuntu-latest
@@ -18,11 +22,28 @@ jobs:
18
22
  with:
19
23
  node-version: 22
20
24
  registry-url: https://registry.npmjs.org/
25
+
26
+ - name: Ensure npm supports trusted publishing
27
+ run: npm install -g npm@latest
21
28
  - run: npm ci
22
- - name: Publish npm package
23
- run: npm publish
24
- env:
25
- NODE_AUTH_TOKEN: ${{secrets.NPM_API_TOKEN}}
29
+
30
+ - name: Determine npm tag
31
+ id: npm_tag
32
+ run: |
33
+ TAG_NAME="${GITHUB_REF_NAME}"
34
+ echo "Detected tag: $TAG_NAME"
35
+
36
+ if [[ "$TAG_NAME" =~ -alpha[0-9]*$ ]]; then
37
+ echo "tag=alpha" >> $GITHUB_OUTPUT
38
+ elif [[ "$TAG_NAME" =~ -beta[0-9]*$ ]]; then
39
+ echo "tag=beta" >> $GITHUB_OUTPUT
40
+ elif [[ "$TAG_NAME" =~ -rc[0-9]*$ ]]; then
41
+ echo "tag=rc" >> $GITHUB_OUTPUT
42
+ else
43
+ echo "tag=latest" >> $GITHUB_OUTPUT
44
+ fi
45
+ - name: Publish to npm (Trusted Publishing)
46
+ run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }}
26
47
 
27
48
 
28
49
  gh-release:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viur/shop-components",
3
- "version": "0.14.2",
3
+ "version": "0.14.4",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@viur/ignite": "^5.1.2",
27
27
  "@viur/shoelace": "^1.0.10-v2.20.0",
28
- "@viur/vue-utils": "^3.1.4",
28
+ "@viur/vue-utils": "^3.3.1",
29
29
  "@vueuse/core": "^13.1.0",
30
30
  "pinia": "^2.3.1",
31
31
  "vue": "^3.5.13",
package/src/Shop.vue CHANGED
@@ -26,7 +26,9 @@
26
26
  </div>
27
27
 
28
28
  <div class="viur-shop-sidebar-wrap" :class="{ bottom: (summary==='bottom') }" v-if="shopStore.state.currentTab!=='complete'">
29
- <shop-summary ></shop-summary>
29
+ <slot name="summary">
30
+ <shop-summary ></shop-summary>
31
+ </slot>
30
32
  </div>
31
33
  </div>
32
34
  <template v-if="shopStore.state.debug">
@@ -16,7 +16,7 @@
16
16
  </template>
17
17
 
18
18
  <script setup>
19
- import {computed, reactive, watch} from 'vue'
19
+ import {computed, onMounted, reactive, watch} from 'vue'
20
20
  import LoadingHandler from './LoadingHandler.vue';
21
21
  import ViForm from "@viur/vue-utils/forms/ViForm.vue";
22
22
  import {useViurShopStore} from "../shop";
@@ -80,6 +80,15 @@ function formChange(data){
80
80
  }
81
81
  }
82
82
 
83
+ onMounted(()=>{
84
+ // Set form language based on locale (use locale if not de-DE, otherwise use store language)
85
+ if (shopStore.state.locale!=="de-DE"){
86
+ state.language = shopStore.state.locale.split("-")[1].toLowerCase() // use country
87
+ }else{
88
+ state.language = shopStore.state.language
89
+ }
90
+ })
91
+
83
92
 
84
93
  watch(()=>addressState.billingIsShipping, (newVal,oldVal)=>{
85
94
  if(oldVal && !newVal){
@@ -74,7 +74,7 @@
74
74
  <div class="availability"
75
75
  :class="`availability--${item.shop_availability}`"
76
76
  >
77
- {{$t(item.shop_availability)}}
77
+ <span class="availability-description">{{$t(item.shop_availability.toString())}}</span>
78
78
  </div>
79
79
  </div>
80
80
 
@@ -135,28 +135,38 @@ function removeArticle(){
135
135
  flex-basis: 70%;
136
136
  font-size: .9em;
137
137
  align-items: center;
138
- justify-content: flex-start;
138
+ justify-content: center;
139
139
  white-space: nowrap;
140
140
  &:before {
141
141
  content: '';
142
142
  display: block;
143
143
  background-color: #666;
144
144
  width: .7em;
145
+ min-width: .7em;
145
146
  height: .7em;
146
147
  border-radius: 50%;
147
148
  margin-right: 5px;
148
149
  margin-bottom: 2px;
149
150
  }
150
151
  }
152
+ .availability-description {
153
+ min-width: 0;
154
+ white-space: nowrap;
155
+ overflow: hidden;
156
+ text-overflow: ellipsis;
157
+ }
151
158
  .availability--onrequest,
152
- .availability--instock {
159
+ .availability--instock,
160
+ .availability--true
161
+ {
153
162
  color: var(--ignt-color-success);
154
163
  &:before {
155
164
  background-color: var(--ignt-color-success);
156
165
  }
157
166
  }
158
167
  .availability--discontinued,
159
- .availability--outofstock {
168
+ .availability--outofstock,
169
+ .availability--false {
160
170
  color: var(--ignt-color-danger);
161
171
  &:before {
162
172
  background-color: var(--ignt-color-danger);
@@ -303,7 +313,7 @@ function removeArticle(){
303
313
  .viur-shop-cart-leaf-availability {
304
314
  grid-column: 4 / span 1;
305
315
  align-self: center;
306
- text-align: right;
316
+ text-align: center;
307
317
  }
308
318
 
309
319
  .viur-shop-cart-leaf-label,
@@ -31,12 +31,13 @@ function close(){
31
31
 
32
32
  <style scoped>
33
33
 
34
- .decent{
34
+ .decent {
35
35
  margin: 0;
36
36
  transition: all ease .3s;
37
37
 
38
38
  &::part(base){
39
- border: none;
39
+ border: none;
40
+ border-radius: 0;
40
41
  }
41
42
 
42
43
  &::part(label){
@@ -46,4 +47,4 @@ function close(){
46
47
  }
47
48
  }
48
49
 
49
- </style>
50
+ </style>
@@ -88,11 +88,15 @@ export function useCart() {
88
88
  if(item.discount){
89
89
  shopStore.state.discounts[item.discount.dest.key] = item.discount
90
90
  }
91
- await fetchCartItems(item['key'])
91
+ await fetchCartItems(item['key'], parentKey=true)
92
92
  }
93
93
  }
94
+ if (parentKey){
95
+ shopStore.state.cartList=shopStore.state.cartList.concat(currentLeafs)
96
+ }else{
97
+ shopStore.state.cartList=currentLeafs
98
+ }
94
99
 
95
- shopStore.state.cartList=shopStore.state.cartList.concat(currentLeafs)
96
100
  return resp
97
101
  })
98
102
  }