@bagelink/vue 0.0.296 → 0.0.300

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/dist/style.css CHANGED
@@ -932,22 +932,34 @@ th[data-v-2137a7a8] {
932
932
  border-radius: var(--card-border-radius);
933
933
  }
934
934
 
935
- .alert_icon[data-v-dfb0f29d] {
935
+ .alert[data-v-f5e16fcc] {
936
+ padding: 1rem;
937
+ border-radius: 10px;
938
+ background: #739def30;
939
+ display: flex;
940
+ align-items: flex-start;
941
+ gap: 1rem;
942
+ }
943
+ .alert_icon[data-v-f5e16fcc] {
936
944
  line-height: 1;
937
945
  }
938
- .warning[data-v-dfb0f29d] {
939
- background-color: #fef9e7;
940
- color: #856404;
946
+ .alert.warning[data-v-f5e16fcc] {
947
+ background-color: #efdb7330;
941
948
  }
942
- .error[data-v-dfb0f29d] {
943
- background-color: #f8d7da;
944
- color: #721c24;
949
+ .alert.error[data-v-f5e16fcc] {
950
+ background-color: #DC354530;
945
951
  }
946
952
 
947
953
  .inline[data-v-64e0d988] {
948
954
  display: inline;
949
955
  }
950
956
 
957
+ .bgl_vid iframe[data-v-ba12b0ff],
958
+ .bgl_vid video[data-v-ba12b0ff] {
959
+ width: 100%;
960
+ height: auto;
961
+ }
962
+
951
963
  .del-top {
952
964
  transform: translateY(-2.6rem);
953
965
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.296",
4
+ "version": "0.0.300",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -28,17 +28,24 @@ const color = {
28
28
  </script>
29
29
 
30
30
  <style scoped>
31
+ .alert {
32
+ padding: 1rem;
33
+ border-radius: 10px;
34
+ background: #739def30;
35
+ display: flex;
36
+ align-items: flex-start;
37
+ gap: 1rem;
38
+ }
39
+
31
40
  .alert_icon {
32
41
  line-height: 1;
33
42
  }
34
43
 
35
- .warning {
36
- background-color: #fef9e7;
37
- color: #856404;
44
+ .alert.warning {
45
+ background-color: #efdb7330;
38
46
  }
39
47
 
40
- .error {
41
- background-color: #f8d7da;
42
- color: #721c24;
48
+ .alert.error {
49
+ background-color: #DC354530;
43
50
  }
44
51
  </style>
@@ -1,23 +1,9 @@
1
1
  <template>
2
- <div>
3
- <iframe
4
- v-if="isYoutubeOrVimeo"
5
- :src="videoUrl"
6
- :style="{ aspectRatio }"
7
- frameborder="0"
8
- allowfullscreen
9
- title="Video"
10
- />
11
- <video
12
- v-else
13
- :src="src"
14
- :autoplay="autoplay"
15
- :muted="mute"
16
- :loop="loop"
17
- :style="{ aspectRatio }"
18
- controls="controllers"
19
- />
20
- </div>
2
+ <div class="bgl_vid">
3
+ <iframe v-if="embedType" :src="videoUrl" :style="{ aspectRatio }" frameborder="0" allowfullscreen title="Video" />
4
+ <video v-else :src="src" :autoplay="autoplay" :muted="mute" :loop="loop" :style="{ aspectRatio }"
5
+ :controls="controls" />
6
+ </div>
21
7
  </template>
22
8
 
23
9
  <script setup lang="ts">
@@ -26,7 +12,7 @@ type Props = {
26
12
  autoplay: boolean;
27
13
  mute: boolean;
28
14
  aspectRatio: string;
29
- controllers: boolean;
15
+ controls: boolean;
30
16
  loop: boolean;
31
17
  };
32
18
 
@@ -34,24 +20,35 @@ const props = defineProps<Props>();
34
20
 
35
21
  const aspectRatio = $computed(() => props.aspectRatio.replace(':', '/'));
36
22
 
37
- const isYoutubeOrVimeo = $computed(() => {
38
- const youtubeRegex = /youtube\.com|youtu\.be/;
39
- const vimeoRegex = /vimeo\.com/;
40
- return youtubeRegex.test(props.src) || vimeoRegex.test(props.src);
23
+ const embedType = $computed<'YouTube' | 'Vimeo' | null>(() => {
24
+ const youtubeRegex = /youtube\.com|youtu\.be/;
25
+ if (youtubeRegex.test(props.src)) return 'YouTube';
26
+ const vimeoRegex = /vimeo\.com/;
27
+ if (vimeoRegex.test(props.src)) return 'Vimeo';
28
+ return null;
41
29
  });
42
30
 
43
31
  const videoUrl = $computed(() => {
44
- if (isYoutubeOrVimeo.value) {
45
- // Handle YouTube and Vimeo URLs here
46
- // For simplicity, returning the URL as is, but you might need to transform it
47
- return props.src;
48
- }
49
- return '';
32
+ if (embedType) {
33
+ if (embedType === 'YouTube') {
34
+ const videoId = props.src.split(/v=|youtu\.be\//)?.[1]?.split('&')?.[0];
35
+ return `https://www.youtube.com/embed/${videoId}`;
36
+ }
37
+ if (embedType === 'Vimeo') {
38
+ const vimeoRegex = /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/;
39
+ const videoId = props.src.match(vimeoRegex)?.[3];
40
+ return `https://player.vimeo.com/video/${videoId}`;
41
+ }
42
+ }
43
+ return props.src;
50
44
  });
45
+
46
+ console.log('Video URL:', videoUrl);
51
47
  </script>
52
48
 
53
49
  <style scoped>
54
- iframe, video {
50
+ .bgl_vid iframe,
51
+ .bgl_vid video {
55
52
  width: 100%;
56
53
  height: auto;
57
54
  }
@@ -23,6 +23,7 @@ export { default as Accordion } from './Accordion.vue';
23
23
  export { default as ComboBox } from './ComboBox.vue';
24
24
  export { default as Alert } from './Alert.vue';
25
25
  export { default as Badge } from './Badge.vue';
26
+ export { default as BglVideo } from './BglVideo.vue';
26
27
 
27
28
  export * from './form';
28
29
  export * from './dashboard';