@bagelink/vue 0.0.374 → 0.0.384

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.
@@ -5,6 +5,7 @@ export interface ModalOptions {
5
5
  title?: string;
6
6
  dismissable?: boolean;
7
7
  side?: boolean;
8
+ width?: string;
8
9
  actions?: BtnOptions[];
9
10
  class?: string;
10
11
  visible?: boolean;
@@ -13,6 +14,7 @@ export interface ModalFormOptions {
13
14
  side?: boolean;
14
15
  title?: string;
15
16
  visible?: boolean;
17
+ width?: string;
16
18
  dismissable?: boolean;
17
19
  schema: BglFormSchemaT<any> | (() => BglFormSchemaT) | BglFormSchemaT;
18
20
  onSubmit?: (formData: any) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/plugins/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACf,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhE,MAAM,WAAW,YAAY;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,cAAc,CAAC,GAAG,cAAc,CAAA;IACrE,QAAQ,CAAC,EAA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AC,CAAC;IACpC,SAAS,EAAE,OAAO,GAAG,WAAW,CAAC;IACjC,YAAY,EAAE,YAAY,GAAG,gBAAgB,CAAA;CAC7C;AACD,MAAM,WAAW,uBAAuB;IACvC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,SAAS,EAAE,WAAW,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAA;CAC9B;AACD,MAAM,WAAW,QAAQ;IACxB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACxE,aAAa,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,uBAAuB,GAAG,SAAS,CAAC;IAC/G,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAmB,CAAC;AAEnE,eAAO,MAAM,QAAQ,QAAO,QAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAyCzB,CAAC"}
package/dist/style.css CHANGED
@@ -376,161 +376,161 @@ a[data-v-d09a83c5] {
376
376
  filter: brightness(80%);
377
377
  }
378
378
  .bg-dark {
379
- position: fixed;
380
- top: 0;
381
- right: 0;
382
- left: 0;
383
- bottom: 0;
384
- background-color: rgba(0, 0, 0, 0.7);
385
- z-index: 999;
386
- pointer-events: none;
387
- opacity: 0;
388
- transition: all ease-in-out 0.3s;
389
- max-height: 100vh;
390
- overflow: auto;
391
- margin: 0 auto;
392
- width: 100%;
393
- text-align: center;
394
- display: grid;
395
- align-items: center;
379
+ position: fixed;
380
+ top: 0;
381
+ right: 0;
382
+ left: 0;
383
+ bottom: 0;
384
+ background-color: rgba(0, 0, 0, 0.7);
385
+ z-index: 999;
386
+ pointer-events: none;
387
+ opacity: 0;
388
+ transition: all ease-in-out 0.3s;
389
+ max-height: 100vh;
390
+ overflow: auto;
391
+ margin: 0 auto;
392
+ width: 100%;
393
+ text-align: center;
394
+ display: grid;
395
+ align-items: center;
396
396
  }
397
397
 
398
398
  .bg-lignt {
399
- background-color: var(--bgl-white);
399
+ background-color: var(--bgl-white);
400
400
  }
401
401
 
402
402
  .modal {
403
- width: 96%;
404
- max-width: 680px;
405
- transform: scale(0.5);
406
- opacity: 0;
407
- transition: all ease-in-out 0.15s;
408
- margin-left: auto;
409
- margin-right: auto;
410
- height: fit-content;
403
+ width: 96%;
404
+ max-width: 720px;
405
+ transform: scale(0.5);
406
+ opacity: 0;
407
+ transition: all ease-in-out 0.15s;
408
+ margin-left: auto;
409
+ margin-right: auto;
410
+ height: fit-content;
411
411
  }
412
412
 
413
413
  .small-modal .modal {
414
- max-width: 300px;
415
- text-align: center;
414
+ max-width: 300px;
415
+ text-align: center;
416
416
  }
417
417
 
418
418
  .tool-bar {
419
- margin: -2rem -1rem 1rem;
420
- display: flex;
421
- justify-content: space-between;
422
- position: -webkit-sticky;
423
- position: sticky;
424
- padding-top: 1rem;
425
- top: 0rem;
426
- z-index: 3;
427
- background: var(--bgl-white);
419
+ margin: -2rem -1rem 1rem;
420
+ display: flex;
421
+ justify-content: space-between;
422
+ position: -webkit-sticky;
423
+ position: sticky;
424
+ padding-top: 1rem;
425
+ top: 0rem;
426
+ z-index: 3;
427
+ background: var(--bgl-white);
428
428
  }
429
429
 
430
430
  .modal-size {
431
- cursor: pointer;
431
+ cursor: pointer;
432
432
  }
433
433
 
434
434
  .is-side .modal {
435
- inset-inline-end: -600px;
436
- transform: scale(1);
437
- opacity: 1;
438
- /* position: fixed; */
439
- /* top: 20px; */
440
- /* bottom: 20px; */
441
- max-width: 600px;
442
- width: 90%;
443
- margin-top: 20px;
444
- margin-bottom: 20px;
445
- margin-inline-start: auto;
446
- margin-inline-end: 20px;
447
- min-height: calc(100vh - 40px);
448
- transform: translateX(100%);
435
+ inset-inline-end: -600px;
436
+ transform: scale(1);
437
+ opacity: 1;
438
+ /* position: fixed; */
439
+ /* top: 20px; */
440
+ /* bottom: 20px; */
441
+ max-width: 600px;
442
+ width: 90%;
443
+ margin-top: 20px;
444
+ margin-bottom: 20px;
445
+ margin-inline-start: auto;
446
+ margin-inline-end: 20px;
447
+ min-height: calc(100vh - 40px);
448
+ transform: translateX(100%);
449
449
  }
450
450
 
451
451
  .is-active .modal {
452
- transform: scale(1);
453
- opacity: 1;
454
- box-shadow: 6px 6px 20px 20px #0000001c;
452
+ transform: scale(1);
453
+ opacity: 1;
454
+ box-shadow: 6px 6px 20px 20px #0000001c;
455
455
  }
456
456
 
457
457
  .bg-lignt .modal {
458
- transform: scale(1);
459
- border: 1px solid var(--border-color);
458
+ transform: scale(1);
459
+ border: 1px solid var(--border-color);
460
460
  }
461
461
 
462
462
  .bg-lignt.is-active .modal {
463
- box-shadow: none;
463
+ box-shadow: none;
464
464
  }
465
465
 
466
466
  .is-active.is-side .modal {
467
- inset-inline-end: 20px;
468
- transform: translateX(0%);
467
+ inset-inline-end: 20px;
468
+ transform: translateX(0%);
469
469
  }
470
470
 
471
471
  .bg-dark.is-active {
472
- opacity: 1;
473
- pointer-events: all;
472
+ opacity: 1;
473
+ pointer-events: all;
474
474
  }
475
475
 
476
476
  .is-side.bg-dark.is-active {
477
- opacity: 1;
478
- align-items: stretch;
477
+ opacity: 1;
478
+ align-items: stretch;
479
479
  }
480
480
 
481
481
  .is-side.is-active .modal {
482
- pointer-events: all;
482
+ pointer-events: all;
483
483
  }
484
484
 
485
485
  @media screen and (max-width: 910px) {
486
- .tool-bar {
487
- margin: -1rem 0rem 1rem;
488
- padding-bottom: 1rem;
489
- align-items: center;
490
- }
486
+ .tool-bar {
487
+ margin: -1rem 0rem 1rem;
488
+ padding-bottom: 1rem;
489
+ align-items: center;
490
+ }
491
491
 
492
- .is-active.is-side .modal {
493
- margin-inline-end: 5%;
494
- margin-inline-start: 5%;
495
- }
492
+ .is-active.is-side .modal {
493
+ margin-inline-end: 5%;
494
+ margin-inline-start: 5%;
495
+ }
496
496
  }
497
497
 
498
498
  .modal-title {
499
- text-align: center;
500
- font-weight: 600;
501
- font-size: 20px;
502
- margin-top: 0.5rem;
503
- margin-bottom: 0 !important;
504
- width: 100%;
505
- -webkit-padding-end: 40px;
506
- padding-inline-end: 40px;
507
- line-height: 2;
508
- display: -webkit-box;
509
- max-width: 100%;
510
- -webkit-line-clamp: 1;
511
- -webkit-box-orient: vertical;
512
- overflow: hidden;
513
- text-overflow: ellipsis;
499
+ text-align: center;
500
+ font-weight: 600;
501
+ font-size: 20px;
502
+ margin-top: 0.5rem;
503
+ margin-bottom: 0 !important;
504
+ width: 100%;
505
+ -webkit-padding-end: 40px;
506
+ padding-inline-end: 40px;
507
+ line-height: 2;
508
+ display: -webkit-box;
509
+ max-width: 100%;
510
+ -webkit-line-clamp: 1;
511
+ -webkit-box-orient: vertical;
512
+ overflow: hidden;
513
+ text-overflow: ellipsis;
514
514
  }
515
515
  .modal-footer {
516
- gap: 1rem;
517
- display: flex;
518
- justify-content: space-between;
519
- align-items: center;
516
+ gap: 1rem;
517
+ display: flex;
518
+ justify-content: space-between;
519
+ align-items: center;
520
520
  }
521
- .modal-footer>div {
522
- gap: 1rem;
523
- display: flex;
524
- justify-content: space-between;
525
- align-items: center;
526
- gap: 0;
521
+ .modal-footer > div {
522
+ gap: 1rem;
523
+ display: flex;
524
+ justify-content: space-between;
525
+ align-items: center;
526
+ gap: 0;
527
527
  }
528
528
 
529
- .modal-title[data-v-7e6899c7] {
529
+ .modal-title[data-v-204f5236] {
530
530
  margin-top: 0.5rem;
531
531
  }
532
532
  @media screen and (max-width: 910px) {
533
- .modal-title[data-v-7e6899c7] {
533
+ .modal-title[data-v-204f5236] {
534
534
  margin-top: 1rem;
535
535
  }
536
536
  }
@@ -879,11 +879,15 @@ display: block;
879
879
  color: var(--bgl-red);
880
880
  }
881
881
 
882
- .bgl_vid iframe[data-v-23835d69],
883
- .bgl_vid video[data-v-23835d69] {
884
- width: 100%;
885
- height: auto;
886
- display: block
882
+ .bgl_vid iframe[data-v-bbfc4353],
883
+ .bgl_vid video[data-v-bbfc4353] {
884
+ width: 100%;
885
+ height: auto;
886
+ display: block;
887
+ }
888
+ .bgl_vid.vid_empty[data-v-bbfc4353] {
889
+ padding-top: 56.25%;
890
+ background: #f0f0f0;
887
891
  }
888
892
 
889
893
  .blocker[data-v-068aa914] {
@@ -1477,7 +1481,7 @@ display: block;
1477
1481
  color: var(--bgl-white);
1478
1482
  }
1479
1483
 
1480
- .bagel-input .fileUploadWrap[data-v-1be8d7b1] {
1484
+ .bagel-input .fileUploadWrap[data-v-0dbacaa0] {
1481
1485
  outline: 1px solid var(--border-color);
1482
1486
  border-radius: var(--input-border-radius);
1483
1487
  text-align: center;
@@ -1487,45 +1491,46 @@ display: block;
1487
1491
  height: 132px;
1488
1492
  font-size: var(--input-font-size);
1489
1493
  }
1490
- .previewName[data-v-1be8d7b1] {
1494
+ .previewName[data-v-0dbacaa0] {
1491
1495
  padding: 0.5rem;
1492
1496
  text-align: start;
1493
1497
  color: var(--input-color);
1494
1498
  display: grid;
1495
1499
  grid-template-columns: 1fr 22px;
1496
1500
  align-items: center;
1501
+ padding-inline: 14px;
1497
1502
  }
1498
- .previewName p[data-v-1be8d7b1] {
1503
+ .previewName p[data-v-0dbacaa0] {
1499
1504
  overflow: hidden;
1500
1505
  text-overflow: ellipsis;
1501
1506
  white-space: nowrap;
1502
1507
  }
1503
- .imagePreviewWrap[data-v-1be8d7b1] {
1508
+ .imagePreviewWrap[data-v-0dbacaa0] {
1504
1509
  background: var(--input-bg);
1505
1510
  border-radius: var(--input-border-radius);
1506
1511
  height: 90px;
1507
1512
  padding: 5px;
1508
1513
  }
1509
- img.preview[data-v-1be8d7b1] {
1514
+ img.preview[data-v-0dbacaa0] {
1510
1515
  height: 80px;
1511
1516
  border-radius: var(--input-border-radius);
1512
1517
  object-fit: contain;
1513
1518
  }
1514
- .fileUploadWrap.dragover[data-v-1be8d7b1],
1515
- .fileUploadWrap[data-v-1be8d7b1]:hover {
1519
+ .fileUploadWrap.dragover[data-v-0dbacaa0],
1520
+ .fileUploadWrap[data-v-0dbacaa0]:hover {
1516
1521
  box-shadow: inset 0 0 10px #00000012;
1517
1522
  }
1518
- .bagel-input .fileUploadWrap.fileDropZone[data-v-1be8d7b1] {
1523
+ .bagel-input .fileUploadWrap.fileDropZone[data-v-0dbacaa0] {
1519
1524
  background: var(--input-bg);
1520
1525
  display: flex;
1521
1526
  align-items: center;
1522
1527
  justify-content: center;
1523
1528
  color: var(--bgl-gray);
1524
1529
  }
1525
- .bagel-input .fileUploadWrap.fileDropZone[data-v-1be8d7b1]:after {
1526
- content: "Drop files here or click to upload";
1530
+ .bagel-input .fileUploadWrap.fileDropZone[data-v-0dbacaa0]:after {
1531
+ content: 'Drop files here or click to upload';
1527
1532
  }
1528
- .pie[data-v-1be8d7b1] {
1533
+ .pie[data-v-0dbacaa0] {
1529
1534
  width: 30px;
1530
1535
  height: 30px;
1531
1536
  position: relative;
@@ -1533,40 +1538,44 @@ img.preview[data-v-1be8d7b1] {
1533
1538
  align-items: center;
1534
1539
  justify-content: center;
1535
1540
  }
1536
- .pie[data-v-1be8d7b1]:before {
1537
- content: "";
1541
+ .pie[data-v-0dbacaa0]:before {
1542
+ content: '';
1538
1543
  position: absolute;
1539
1544
  border-radius: 50%;
1540
1545
  inset: 0;
1541
1546
  transition: all 0.2s ease-in-out;
1542
1547
  background: conic-gradient(var(--bgl-primary) calc(var(--p) * 1%), #0000 0);
1543
- -webkit-mask: radial-gradient(farthest-side,
1544
- #0000 calc(99% - var(--b)),
1545
- #000 calc(100% - var(--b)));
1546
- mask: radial-gradient(farthest-side,
1547
- #0000 calc(99% - var(--b)),
1548
- #000 calc(100% - var(--b)));
1549
- }
1550
- .pie .success[data-v-1be8d7b1] {
1548
+ -webkit-mask: radial-gradient(
1549
+ farthest-side,
1550
+ #0000 calc(99% - var(--b)),
1551
+ #000 calc(100% - var(--b))
1552
+ );
1553
+ mask: radial-gradient(
1554
+ farthest-side,
1555
+ #0000 calc(99% - var(--b)),
1556
+ #000 calc(100% - var(--b))
1557
+ );
1558
+ }
1559
+ .pie .success[data-v-0dbacaa0] {
1551
1560
  transform: scale(0);
1552
1561
  opacity: 0;
1553
1562
  transition: all 0.3s ease-in-out;
1554
1563
  }
1555
- .pie .progress[data-v-1be8d7b1] {
1564
+ .pie .progress[data-v-0dbacaa0] {
1556
1565
  position: absolute;
1557
1566
  font-size: 10px;
1558
1567
  }
1559
- .pie.complete .progress[data-v-1be8d7b1] {
1568
+ .pie.complete .progress[data-v-0dbacaa0] {
1560
1569
  display: none;
1561
1570
  }
1562
- .pie.complete .success[data-v-1be8d7b1] {
1571
+ .pie.complete .success[data-v-0dbacaa0] {
1563
1572
  transform: scale(1.3);
1564
1573
  opacity: 1;
1565
1574
  }
1566
- .pie.complete[data-v-1be8d7b1]:before {
1575
+ .pie.complete[data-v-0dbacaa0]:before {
1567
1576
  background: conic-gradient(var(--bgl-green) calc(var(--p) * 1%), #0000 0);
1568
1577
  }
1569
- .pie.complete[data-v-1be8d7b1] {
1578
+ .pie.complete[data-v-0dbacaa0] {
1570
1579
  color: var(--bgl-green);
1571
1580
  }
1572
1581
 
@@ -1688,10 +1697,10 @@ img.preview[data-v-1be8d7b1] {
1688
1697
  margin: 1rem 0;
1689
1698
  }
1690
1699
  .tiptap {
1691
- min-height: 500px;
1700
+ min-height: 200px;
1692
1701
  background: var(--input-bg);
1693
1702
  overflow: auto;
1694
- max-height: 600px;
1703
+ max-height: 500px;
1695
1704
  padding: 0.7rem;
1696
1705
  color: var(--input-color);
1697
1706
  border-radius: var(--input-border-radius);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.374",
4
+ "version": "0.0.384",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -61,6 +61,8 @@
61
61
  "@vuepic/vue-datepicker": "^8.0.0",
62
62
  "@tiptap/pm": "^2.2.4",
63
63
  "@tiptap/starter-kit": "^2.2.4",
64
+ "@tiptap/extension-image": "^2.2.4",
65
+ "@tiptap/extension-youtube": "^2.2.4",
64
66
  "@tiptap/vue-3": "^2.2.4",
65
67
  "vue": "*",
66
68
  "vue-draggable-next": "^2.2.1",
@@ -1,57 +1,58 @@
1
1
  <template>
2
- <div class="bgl_vid">
2
+ <div class="bgl_vid" :class="{ vid_empty: !src }">
3
3
  <iframe
4
4
  v-if="embedType"
5
5
  :src="videoUrl"
6
6
  :style="{ aspectRatio }"
7
7
  frameborder="0"
8
8
  allowfullscreen
9
- title="Video"
10
- />
9
+ title="Video" />
11
10
  <video
12
- v-else
11
+ v-else-if="src"
13
12
  :src="src"
14
13
  :autoplay="autoplay"
15
14
  :muted="mute"
16
15
  :loop="loop"
17
16
  :style="{ aspectRatio }"
18
17
  :controls="controls"
19
- playsinline
20
- />
18
+ playsinline />
21
19
  </div>
22
20
  </template>
23
21
 
24
22
  <script setup lang="ts">
25
23
  type Props = {
26
- src: string;
27
- autoplay: boolean;
28
- mute: boolean;
29
- aspectRatio: string;
30
- controls: boolean;
31
- loop: boolean;
24
+ src?: string;
25
+ autoplay?: boolean;
26
+ mute?: boolean;
27
+ aspectRatio?: string;
28
+ controls?: boolean;
29
+ loop?: boolean;
32
30
  };
33
31
 
34
32
  const props = defineProps<Props>();
35
33
 
36
- const aspectRatio = $computed(() => props.aspectRatio.replace(':', '/'));
34
+ const aspectRatio = $computed(
35
+ () => props.aspectRatio?.replace(':', '/') || '16/9'
36
+ );
37
37
 
38
38
  const embedType = $computed<'YouTube' | 'Vimeo' | null>(() => {
39
39
  const youtubeRegex = /youtube\.com|youtu\.be/;
40
- if (youtubeRegex.test(props.src)) return 'YouTube';
40
+ if (youtubeRegex.test(props.src || '')) return 'YouTube';
41
41
  const vimeoRegex = /vimeo\.com/;
42
- if (vimeoRegex.test(props.src)) return 'Vimeo';
42
+ if (vimeoRegex.test(props.src || '')) return 'Vimeo';
43
43
  return null;
44
44
  });
45
45
 
46
46
  const videoUrl = $computed(() => {
47
47
  if (embedType) {
48
48
  if (embedType === 'YouTube') {
49
- const videoId = props.src.split(/v=|youtu\.be\//)?.[1]?.split('&')?.[0];
49
+ const videoId = props.src?.split(/v=|youtu\.be\//)?.[1]?.split('&')?.[0];
50
50
  return `https://www.youtube.com/embed/${videoId}`;
51
51
  }
52
52
  if (embedType === 'Vimeo') {
53
- const vimeoRegex = /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/;
54
- const videoId = props.src.match(vimeoRegex)?.[3];
53
+ const vimeoRegex =
54
+ /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/;
55
+ const videoId = props.src?.match(vimeoRegex)?.[3];
55
56
  return `https://player.vimeo.com/video/${videoId}`;
56
57
  }
57
58
  }
@@ -64,8 +65,13 @@ console.log('Video URL:', videoUrl);
64
65
  <style scoped>
65
66
  .bgl_vid iframe,
66
67
  .bgl_vid video {
67
- width: 100%;
68
- height: auto;
69
- display: block
68
+ width: 100%;
69
+ height: auto;
70
+ display: block;
71
+ }
72
+
73
+ .bgl_vid.vid_empty {
74
+ padding-top: 56.25%;
75
+ background: #f0f0f0;
70
76
  }
71
77
  </style>