vibe-editor 0.0.4 → 0.0.6

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.
Files changed (78) hide show
  1. package/package.json +66 -61
  2. package/src/scripts/js/Core.js +28 -9
  3. package/src/scripts/js/entry.js +6 -5
  4. package/src/scripts/js/gui/Annotations.js +27 -12
  5. package/src/scripts/js/gui/ScoreManipulator.js +6 -4
  6. package/src/scripts/js/gui/Tabbar.js +13 -4
  7. package/src/scripts/js/handlers/AnnotationChangeHandler.js +13 -1
  8. package/src/scripts/js/handlers/InsertModeHandler.js +3 -3
  9. package/src/scripts/js/handlers/PhantomElementHandler.js +3 -10
  10. package/src/scripts/js/handlers/WindowHandler.js +7 -7
  11. package/src/scripts/js/scripts/Core.js +932 -0
  12. package/src/scripts/js/scripts/MusicProcessor.js +810 -0
  13. package/src/scripts/js/scripts/VIBE.js +219 -0
  14. package/src/scripts/js/scripts/datastructures/MeasureMatrix.js +156 -0
  15. package/src/scripts/js/scripts/gui/Annotations.js +549 -0
  16. package/src/scripts/js/scripts/gui/Cursor.js +203 -0
  17. package/src/scripts/js/scripts/gui/PhantomElement.js +132 -0
  18. package/src/scripts/js/scripts/gui/ScoreManipulator.js +188 -0
  19. package/src/scripts/js/scripts/gui/Tabbar.js +705 -0
  20. package/src/scripts/js/{gui/Toolbar copy.js → scripts/gui/Toolbar.js} +15 -11
  21. package/src/scripts/js/scripts/handlers/AnnotationChangeHandler.js +650 -0
  22. package/src/scripts/js/scripts/handlers/ClickModeHandler.js +535 -0
  23. package/src/scripts/js/{gui → scripts/handlers}/CustomAnnotationShapeDrawer.js +34 -17
  24. package/src/scripts/js/{handlers/ModHandler.js → scripts/handlers/CustomToolbarHandler.js} +54 -66
  25. package/src/scripts/js/scripts/handlers/GlobalKeyboardHandler.js +372 -0
  26. package/src/scripts/js/scripts/handlers/Handler.js +2 -0
  27. package/src/scripts/js/{handlers/InsertModeHandler_deprecated.js → scripts/handlers/InsertModeHandler.js} +117 -164
  28. package/src/scripts/js/scripts/handlers/KeyModeHandler.js +405 -0
  29. package/src/scripts/js/scripts/handlers/LabelHandler.js +463 -0
  30. package/src/scripts/js/scripts/handlers/NoteDragHandler.js +97 -0
  31. package/src/scripts/js/scripts/handlers/PhantomElementHandler.js +161 -0
  32. package/src/scripts/js/scripts/handlers/ScoreManipulatorHandler.js +233 -0
  33. package/src/scripts/js/scripts/handlers/SidebarHandler.js +506 -0
  34. package/src/scripts/js/scripts/handlers/TooltipHandler.js +132 -0
  35. package/src/scripts/js/scripts/handlers/WindowHandler.js +278 -0
  36. package/src/scripts/js/scripts/utils/MEIOperations.js +2121 -0
  37. package/src/scripts/js/{utils/Mouse2MEI.js → scripts/utils/Mouse2SVG.js} +225 -57
  38. package/src/scripts/js/scripts/utils/SVGEditor.js +453 -0
  39. package/src/scripts/js/scripts/utils/Types.js +2 -0
  40. package/src/scripts/js/{utils/VerovioWrapper copy.js → scripts/utils/VerovioWrapper.js} +32 -18
  41. package/src/scripts/js/scripts/utils/coordinates.js +78 -0
  42. package/src/scripts/js/utils/Mouse2SVG.js +11 -4
  43. package/src/scripts/js/utils/VerovioWrapper.js +4 -4
  44. package/src/scripts/js/utils/coordinates.js +26 -2
  45. package/src/styles/vibe.css +32 -6
  46. package/src/scripts/js/.DS_Store +0 -0
  47. package/src/scripts/js/MusicPlayer.js +0 -572
  48. package/src/scripts/js/datastructures/ScoreGraph copy.js +0 -432
  49. package/src/scripts/js/gui/CustomAnnotationDrawer.js +0 -114
  50. package/src/scripts/js/handlers/AnnotationDragHandler.js +0 -113
  51. package/src/scripts/js/handlers/AnnotationLineHandler.js +0 -113
  52. package/src/scripts/js/handlers/ArticulationHandler.js +0 -20
  53. package/src/scripts/js/handlers/HarmonyHandler.js +0 -282
  54. package/src/scripts/js/handlers/InsertModeHandler copy.js +0 -423
  55. package/src/scripts/js/handlers/KeyModeHandler copy.js +0 -407
  56. package/src/scripts/js/handlers/KeyModeHandler_deprecated.js +0 -411
  57. package/src/scripts/js/handlers/NoteDragHandler copy.js +0 -148
  58. package/src/scripts/js/handlers/NoteDragHandler_deprecated.js +0 -150
  59. package/src/scripts/js/handlers/SelectionHandler.js +0 -262
  60. package/src/scripts/js/utils/RectWrapper.js +0 -10
  61. package/src/scripts/js/utils/SVGFiller.js +0 -245
  62. package/src/scripts/js/utils/VerovioWrapperLocal.js +0 -156
  63. package/src/scripts/js/utils/firefoxBBoxes.js +0 -143
  64. /package/src/scripts/js/{assets → scripts/assets}/mei_template.js +0 -0
  65. /package/src/scripts/js/{constants.js → scripts/constants.js} +0 -0
  66. /package/src/scripts/js/{datastructures → scripts/datastructures}/ScoreGraph.js +0 -0
  67. /package/src/scripts/js/{datastructures → scripts/datastructures}/ScoreGraph_deprecated.js +0 -0
  68. /package/src/scripts/js/{datastructures → scripts/datastructures}/ScoreNode.js +0 -0
  69. /package/src/scripts/js/{gui → scripts/gui}/HarmonyLabel.js +0 -0
  70. /package/src/scripts/js/{gui → scripts/gui}/Label.js +0 -0
  71. /package/src/scripts/js/{gui → scripts/gui}/TempoLabel.js +0 -0
  72. /package/src/scripts/js/{handlers → scripts/handlers}/DeleteHandler.js +0 -0
  73. /package/src/scripts/js/{utils → scripts/utils}/DOMCreator.js +0 -0
  74. /package/src/scripts/js/{utils → scripts/utils}/MEIConverter.js +0 -0
  75. /package/src/scripts/js/{utils → scripts/utils}/ReactWrapper.js +0 -0
  76. /package/src/scripts/js/{utils → scripts/utils}/convenienceQueries.js +0 -0
  77. /package/src/scripts/js/{utils → scripts/utils}/mappings.js +0 -0
  78. /package/src/scripts/js/{utils → scripts/utils}/random.js +0 -0
@@ -12,9 +12,9 @@ class VerovioWrapper {
12
12
  //@ts-ignore
13
13
  this.vrvToolkit = new verovio.toolkit() || null;
14
14
  this.r = 1;
15
- // if (this.isRetina()) {
16
- // this.r = 2
17
- // }
15
+ if (this.isRetina()) {
16
+ this.r = 2;
17
+ }
18
18
  this.widthValue = 1500;
19
19
  var pageWidth = (this.widthValue / (window.devicePixelRatio / this.r)) / (screen.availHeight / window.innerWidth);
20
20
  this.options = {
@@ -24,7 +24,7 @@ class VerovioWrapper {
24
24
  pageMarginTop: 50,
25
25
  adjustPageHeight: true,
26
26
  font: 'Bravura',
27
- pageWidth: pageWidth,
27
+ //pageWidth: pageWidth, // adjust size with window size
28
28
  //pageHeight: pageWidth / 4,
29
29
  //justifyVertically: true,
30
30
  svgViewBox: true,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformToDOMMatrixCoordinates = exports.getDOMMatrixCoordinates = void 0;
3
+ exports.transformToDOMMatrixCoordinates = exports.getCanvasCordinates = exports.getDOMMatrixCoordinates = void 0;
4
4
  /**
5
5
  * Get DOMMatrix coordnates of element according to parent canvas class. Returns null if no canvas is found. If element is DOMRect, canvas must be provided
6
6
  * @param element
@@ -33,9 +33,33 @@ function getDOMMatrixCoordinates(element, canvas = null) {
33
33
  ptRB = ptRB.matrixTransform(canvasMatrix);
34
34
  var width = ptRB.x - ptLT.x;
35
35
  var height = ptRB.y - ptLT.y;
36
- return { left: ptLT.x, top: ptLT.y, right: ptRB.x, bottom: ptRB.y, width: width, height: height, x: ptLT.x, y: ptLT.y };
36
+ return { left: ptLT.x, top: ptLT.y, right: ptRB.x, bottom: ptRB.y, width: width, height: height, x: ptLT.x, y: ptLT.y, matrix: canvasMatrix };
37
37
  }
38
38
  exports.getDOMMatrixCoordinates = getDOMMatrixCoordinates;
39
+ function getCanvasCordinates(coords, canvas = null) {
40
+ if (!coords.matrix) {
41
+ throw new Error("DOMMatrix is missing.");
42
+ }
43
+ if (canvas === null) {
44
+ canvas = canvas instanceof Element ? canvas.closest(".canvas") : null;
45
+ if (canvas instanceof DOMRect) {
46
+ throw new Error("Canvas must be provided, if input is instance of DOMRect. Actual instance: " + canvas.constructor.name);
47
+ }
48
+ if (canvas === null)
49
+ return;
50
+ }
51
+ // Reverse the transformation
52
+ var canvasMatrix = coords.matrix.inverse();
53
+ var ptLT = new DOMPoint(coords.left, coords.top);
54
+ ptLT = ptLT.matrixTransform(canvasMatrix);
55
+ var ptRB = new DOMPoint(coords.right, coords.bottom);
56
+ ptRB = ptRB.matrixTransform(canvasMatrix);
57
+ var width = ptRB.x - ptLT.x;
58
+ var height = ptRB.y - ptLT.y;
59
+ // Create and return the DOMRect
60
+ return new DOMRect(ptLT.x, ptLT.y, width, height);
61
+ }
62
+ exports.getCanvasCordinates = getCanvasCordinates;
39
63
  /**
40
64
  * Transforms the given coordinates for a given canvas
41
65
  * @param x
@@ -478,11 +478,19 @@ text{
478
478
  border-color: black;
479
479
  border-style: solid;
480
480
  border-width: 3px;
481
+ position: absolute;
482
+ }
483
+
484
+ .annotFO{
485
+ /* width: 100%;
486
+ height: 100%; */
487
+ width: 15%;
488
+ height: 10%;
481
489
  }
482
490
 
483
491
 
484
492
  .annotStaticText .annotFO div{
485
- background-color: white;
493
+ background-color: rgb(201, 167, 167);
486
494
  border: 1px solid black;
487
495
  }
488
496
 
@@ -692,16 +700,16 @@ g.currentlyPlaying *{
692
700
  cursor: pointer;
693
701
  }
694
702
 
695
- .voiceBtn.inactive > rect{
703
+ .voiceBtn.inactive rect{
696
704
  fill: lightgray;
697
705
  }
698
706
 
699
- .voiceBtn.inactive > text{
707
+ .voiceBtn.inactive text{
700
708
  fill: gray;
701
709
  }
702
710
 
703
711
 
704
- .voiceBtn > rect{
712
+ .voiceBtn rect, .voiceBtn foreignObject{
705
713
  stroke-width: 5%;
706
714
  stroke: black;
707
715
  width: 100%;
@@ -709,13 +717,31 @@ g.currentlyPlaying *{
709
717
  fill: antiquewhite
710
718
  }
711
719
 
712
- .voiceBtn > text{
720
+ rect.voiceBtn{
721
+ stroke: black;
722
+ fill: antiquewhite;
723
+ }
724
+
725
+ .voiceBtn foreignObject > div{
726
+ text-align: center;
727
+ position:relative;
728
+ top: -20%;
729
+ }
730
+
731
+ /* .voiceBtn text, .voiceBtn foreignObject > div{
713
732
  font-size: 100%;
714
733
  width: 100%;
715
734
  height: 100%;
716
735
  fill: black;
717
736
  }
718
737
 
738
+
739
+
740
+ rect.voiceBtn + text{
741
+ font-size: 100%;
742
+ fill: black;
743
+ } */
744
+
719
745
  .tooltip.show{
720
746
  display:contents;
721
747
  background: skyblue;
@@ -777,7 +803,7 @@ g.currentlyPlaying *{
777
803
 
778
804
  foreignObject > [contenteditable]{
779
805
  font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
780
-
806
+ font-size: 1em;
781
807
  }
782
808
 
783
809
  button{
Binary file