@bagelink/vue 1.4.56 → 1.4.64

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.4.56",
4
+ "version": "1.4.64",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -66,7 +66,7 @@ defineExpose({ play, pause })
66
66
  const embedType = $computed<'YouTube' | 'Vimeo' | undefined>(() => {
67
67
  const youtubeRegex = /youtube\.com|youtu\.be/
68
68
  if (youtubeRegex.test(props.src || '')) return 'YouTube'
69
- const vimeoRegex = /vimeo\.com/
69
+ const vimeoRegex = /(?:player\.)?vimeo\.com/
70
70
  if (vimeoRegex.test(props.src || '')) return 'Vimeo'
71
71
  })
72
72
 
@@ -90,10 +90,15 @@ const videoUrl = $computed(() => {
90
90
  return `https://www.youtube.com/embed/${videoId}?${queryParams}`
91
91
  }
92
92
  if (embedType === 'Vimeo') {
93
- const vimeoRegex
94
- // eslint-disable-next-line regexp/no-unused-capturing-group
95
- = /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/
96
- const videoId = props.src?.match(vimeoRegex)?.[3]
93
+ // Handle both regular Vimeo URLs and player.vimeo.com embed URLs
94
+ const playerVimeoRegex = /player\.vimeo\.com\/video\/(\d+)/
95
+ const regularVimeoRegex = /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/
96
+
97
+ const playerMatch = props.src?.match(playerVimeoRegex)
98
+ const regularMatch = props.src?.match(regularVimeoRegex)
99
+
100
+ const videoId = playerMatch?.[1] || regularMatch?.[3]
101
+ console.log(videoId, { playerMatch, regularMatch })
97
102
  return `https://player.vimeo.com/video/${videoId}`
98
103
  }
99
104
  }
@@ -104,24 +109,13 @@ const videoUrl = $computed(() => {
104
109
  <template>
105
110
  <div ref="videoContainer" class="bgl_vid" :class="{ vid_empty: !src, vid_short: isYoutubeShort }">
106
111
  <iframe
107
- v-if="embedType"
108
- :src="videoUrl"
109
- :style="{ aspectRatio }"
110
- frameborder="0"
111
- title="Video"
112
+ v-if="embedType" :src="videoUrl" :style="{ aspectRatio }" frameborder="0" title="Video"
112
113
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
113
- referrerpolicy="strict-origin-when-cross-origin"
114
- allowfullscreen
114
+ referrerpolicy="strict-origin-when-cross-origin" allowfullscreen
115
115
  />
116
116
  <video
117
- v-else-if="src"
118
- ref="video"
119
- :autoplay="autoplay === true"
120
- :muted="mute"
121
- :loop="loop"
122
- :style="{ aspectRatio }"
123
- :controls="controls"
124
- :playsinline="playsinline"
117
+ v-else-if="src" ref="video" :autoplay="autoplay === true" :muted="mute" :loop="loop"
118
+ :style="{ aspectRatio }" :controls="controls" :playsinline="playsinline"
125
119
  >
126
120
  <source :src="src" :type="`video/${videoFormat}`">
127
121
  </video>
@@ -145,7 +139,8 @@ const videoUrl = $computed(() => {
145
139
  }
146
140
 
147
141
  .bgl_vid.vid_short {
148
- max-width: 56.25vh; /* Limit width for shorts to maintain aspect ratio */
142
+ max-width: 56.25vh;
143
+ /* Limit width for shorts to maintain aspect ratio */
149
144
  margin: 0 auto;
150
145
  }
151
146
  </style>
@@ -25,33 +25,43 @@ function getFillWidth(n: number): string {
25
25
 
26
26
  <template>
27
27
  <div class="rating">
28
- <Icon
29
- v-for="n in totalStars" :key="n" fill :name="iconType" class="star-icon p-0" :size="size" :style="{
30
- 'gap': `${size * 0.3}rem`,
31
- '--gradient-width': getFillWidth(n),
32
- '--fill-color': fillColor,
33
- '--empty-color': emptyColor,
34
- }"
35
- />
28
+ <template v-if="iconType === 'star'">
29
+ <span
30
+ v-for="n in totalStars" :key="n" class="star-icon p-025"
31
+ :style="{ '--gradient-width': getFillWidth(n), '--fill-color': fillColor, '--empty-color': emptyColor }"
32
+ >
33
+
34
+ </span>
35
+ </template>
36
+ <template v-else>
37
+ <Icon
38
+ v-for="n in totalStars" :key="n" fill :name="iconType" class="star-icon p-0" :size="size" :style="{
39
+ 'gap': `${size * 0.3}rem`,
40
+ '--gradient-width': getFillWidth(n),
41
+ '--fill-color': fillColor,
42
+ '--empty-color': emptyColor,
43
+ }"
44
+ />
45
+ </template>
36
46
  </div>
37
47
  </template>
38
48
 
39
49
  <style scoped>
40
50
  .rating {
41
- display: flex;
42
- align-items: center;
51
+ display: flex;
52
+ align-items: center;
43
53
  }
44
54
 
45
55
  .star-icon {
46
- --gradient-width: 0%;
47
- --fill-color: #fabf05;
48
- --empty-color: lightgray;
49
- position: relative;
50
- display: inline-block;
51
- background: linear-gradient(to right, var(--fill-color) var(--gradient-width), var(--empty-color) 0%);
52
- -webkit-background-clip: text;
53
- background-clip: text;
54
- color: transparent;
55
- fill: transparent;
56
+ --gradient-width: 0%;
57
+ --fill-color: #fabf05;
58
+ --empty-color: lightgray;
59
+ position: relative;
60
+ display: inline-block;
61
+ background: linear-gradient(to right, var(--fill-color) var(--gradient-width), var(--empty-color) 0%);
62
+ -webkit-background-clip: text;
63
+ background-clip: text;
64
+ color: transparent;
65
+ fill: transparent;
56
66
  }
57
67
  </style>
@@ -3674,6 +3674,11 @@
3674
3674
  flex-wrap: wrap;
3675
3675
  }
3676
3676
 
3677
+ .flex-reverse {
3678
+ flex-direction: row-reverse;
3679
+ }
3680
+
3681
+
3677
3682
  .column,
3678
3683
  .flex-column {
3679
3684
  flex-direction: column;
@@ -2954,6 +2954,10 @@
2954
2954
  flex-wrap: wrap;
2955
2955
  }
2956
2956
 
2957
+ .m_flex-reverse {
2958
+ flex-direction: row-reverse;
2959
+ }
2960
+
2957
2961
  .m_column {
2958
2962
  flex-direction: column;
2959
2963
  }