notations 0.0.67 → 0.0.69

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 (53) hide show
  1. package/README.md +56 -26
  2. package/dist/NotationView.css +107 -0
  3. package/dist/NotationView.css.map +1 -0
  4. package/dist/NotationView.min.css +1 -0
  5. package/dist/NotationView.min.css.map +1 -0
  6. package/dist/notations.umd.js +35875 -0
  7. package/dist/notations.umd.min.js +112 -0
  8. package/dist/notations.umd.min.js.LICENSE.txt +24 -0
  9. package/dist/notations.umd.min.js.map +1 -0
  10. package/lib/cjs/beats.js.map +1 -1
  11. package/lib/cjs/beatutils.js.map +1 -1
  12. package/lib/cjs/beatview.js.map +1 -1
  13. package/lib/cjs/carnatic/LineView.js.map +1 -1
  14. package/lib/cjs/carnatic/NotationView.js.map +1 -1
  15. package/lib/cjs/carnatic/embelishments.js +3 -8
  16. package/lib/cjs/carnatic/embelishments.js.map +1 -1
  17. package/lib/cjs/carnatic/gamakas.js.map +1 -1
  18. package/lib/cjs/commands.js.map +1 -1
  19. package/lib/cjs/core.js.map +1 -1
  20. package/lib/cjs/cycle.js.map +1 -1
  21. package/lib/cjs/entity.js.map +1 -1
  22. package/lib/cjs/grids.js.map +1 -1
  23. package/lib/cjs/iterators.js.map +1 -1
  24. package/lib/cjs/layouts.js.map +1 -1
  25. package/lib/cjs/loader.js.map +1 -1
  26. package/lib/cjs/notation.js.map +1 -1
  27. package/lib/cjs/parser.js.map +1 -1
  28. package/lib/cjs/shapes.js +1 -1
  29. package/lib/cjs/shapes.js.map +1 -1
  30. package/lib/cjs/utils.js.map +1 -1
  31. package/lib/esm/beats.js.map +1 -1
  32. package/lib/esm/beatutils.js.map +1 -1
  33. package/lib/esm/beatview.js.map +1 -1
  34. package/lib/esm/carnatic/LineView.js.map +1 -1
  35. package/lib/esm/carnatic/NotationView.js.map +1 -1
  36. package/lib/esm/carnatic/embelishments.js +3 -8
  37. package/lib/esm/carnatic/embelishments.js.map +1 -1
  38. package/lib/esm/carnatic/gamakas.js.map +1 -1
  39. package/lib/esm/commands.js.map +1 -1
  40. package/lib/esm/core.js.map +1 -1
  41. package/lib/esm/cycle.js.map +1 -1
  42. package/lib/esm/entity.js.map +1 -1
  43. package/lib/esm/grids.js.map +1 -1
  44. package/lib/esm/iterators.js.map +1 -1
  45. package/lib/esm/layouts.js.map +1 -1
  46. package/lib/esm/loader.js.map +1 -1
  47. package/lib/esm/notation.js.map +1 -1
  48. package/lib/esm/parser.js.map +1 -1
  49. package/lib/esm/shapes.js +1 -1
  50. package/lib/esm/shapes.js.map +1 -1
  51. package/lib/esm/utils.js.map +1 -1
  52. package/package.json +22 -15
  53. package/styles/NotationView.scss +81 -1
package/README.md CHANGED
@@ -1,42 +1,72 @@
1
-
2
1
  # Notations
3
2
 
4
- Notations is a Typescript library for rendering Carnatic music. Notations comes with:
3
+ A TypeScript library for parsing, modeling, and rendering Carnatic music notation.
5
4
 
6
- 1. An API for representing and rendering carnatic music.
7
- 2. A DSL and an accompanying parser for representing music in a simpler and intuitive way.
5
+ **[Live Demo](https://notations.us)** | **[Documentation](https://panyam.github.io/notations/)**
8
6
 
9
- ## Documentation
7
+ ## Features
10
8
 
11
- 📚 **[Full Documentation](https://panyam.github.io/notations/)** - Tutorials, API reference, cookbook examples, and more.
9
+ - **DSL Parser** - Intuitive text-based notation format
10
+ - **Flexible Rendering** - SVG-based output with CSS theming
11
+ - **Framework Agnostic** - Works with React, Vue, vanilla JS, or any framework
12
+ - **Light/Dark Mode** - Built-in theme support via CSS variables
12
13
 
13
- # Getting Started
14
+ ## Quick Start
14
15
 
15
- ## Installation
16
+ ### Via CDN (no build tools required)
16
17
 
17
- ```
18
- # Install Typescript
19
- npm i typescript
18
+ ```html
19
+ <link rel="stylesheet" href="https://unpkg.com/notations/dist/NotationView.min.css">
20
+ <script src="https://unpkg.com/notations/dist/notations.umd.min.js"></script>
20
21
 
21
- # Install the library (in a folder that already contains your package.json file).
22
- npm install --save notations
22
+ <script>
23
+ const source = `
24
+ \\cycle("|4|2|2|")
25
+ Sw: S R G M P D N S.
26
+ `;
23
27
 
28
+ const container = document.getElementById('notation');
29
+ const [notation, beatLayout, errors] = Notations.load(source);
30
+
31
+ if (errors.length === 0) {
32
+ const view = new Notations.Carnatic.NotationView(container);
33
+ view.renderNotation(notation, beatLayout);
34
+ }
35
+ </script>
24
36
  ```
25
37
 
26
- ## Example
38
+ ### Via npm/pnpm
27
39
 
40
+ ```bash
41
+ npm install notations
28
42
  ```
29
- import { NotationView } from notations;
30
-
31
- const element = document.getElementById("mydiv");
32
- const notationView = new NotationView(element);
33
- notationView.add(new Note("Ga"), new Space(),
34
- new Note("Ga"), new Space(),
35
- new Note("Ri"), new Space(),
36
- new Note("Ri"), new Space(),
37
- new Note("Sa"), new Note("Sa"),
38
- new Note("Ri"), new Note("Ri"),
39
- new Note("Ga"), new Note("Ga"),
40
- new Note("Ri"), new Note("Ri"));
43
+
44
+ ```typescript
45
+ import * as N from 'notations';
46
+ import 'notations/dist/NotationView.css';
47
+
48
+ const source = `
49
+ \\cycle("|4|2|2|")
50
+ Sw: S R G M P D N S.
51
+ `;
52
+
53
+ const [notation, beatLayout, errors] = N.load(source);
54
+
55
+ if (errors.length === 0) {
56
+ const container = document.getElementById('notation');
57
+ const view = new N.Carnatic.NotationView(container);
58
+ view.renderNotation(notation, beatLayout);
59
+ }
41
60
  ```
42
61
 
62
+ ## Documentation
63
+
64
+ - **[Getting Started](https://panyam.github.io/notations/getting-started/)** - Installation and setup
65
+ - **[Tutorials](https://panyam.github.io/notations/tutorials/)** - Learn the notation syntax
66
+ - **[API Reference](https://panyam.github.io/notations/api/)** - Full API documentation
67
+ - **[Integration Guide](https://panyam.github.io/notations/api/integration-guide/)** - React, Vue, Node.js integration
68
+ - **[Styling & Theming](https://panyam.github.io/notations/api/styling/)** - Customize appearance with CSS variables
69
+
70
+ ## License
71
+
72
+ ISC
@@ -0,0 +1,107 @@
1
+ /* ========================================
2
+ CSS Custom Properties (Theme Variables)
3
+ ======================================== */
4
+ :root {
5
+ /* Colors */
6
+ --notation-stroke-color: black;
7
+ --notation-fill-color: transparent;
8
+ --notation-text-color: #1a1a1a;
9
+ --notation-border-color: gray;
10
+ /* Strokes */
11
+ --notation-stroke-width: 1;
12
+ --notation-bar-line-width: 1;
13
+ /* Spacing (can be overridden) */
14
+ --notation-line-padding: 5px;
15
+ --notation-annotation-padding: 10px;
16
+ }
17
+
18
+ /* Dark mode */
19
+ :root.dark,
20
+ [data-theme=dark] {
21
+ --notation-stroke-color: #e5e5e5;
22
+ --notation-fill-color: transparent;
23
+ --notation-text-color: #f0f0f0;
24
+ --notation-border-color: #555;
25
+ }
26
+
27
+ /* System preference fallback */
28
+ @media (prefers-color-scheme: dark) {
29
+ :root:not(.light):not([data-theme=light]) {
30
+ --notation-stroke-color: #e5e5e5;
31
+ --notation-fill-color: transparent;
32
+ --notation-text-color: #f0f0f0;
33
+ --notation-border-color: #555;
34
+ }
35
+ }
36
+ /* ========================================
37
+ SVG Element Styles
38
+ ======================================== */
39
+ /* Octave indicator dots */
40
+ .notation-octave-dot {
41
+ stroke: var(--notation-stroke-color);
42
+ stroke-width: var(--notation-stroke-width);
43
+ }
44
+
45
+ /* Bar lines (start and end) */
46
+ .bar-start-line,
47
+ .bar-end-line {
48
+ stroke: var(--notation-stroke-color);
49
+ stroke-width: var(--notation-bar-line-width);
50
+ }
51
+
52
+ /* Jaaru (glide) paths */
53
+ .notation-jaaru-path {
54
+ stroke: var(--notation-stroke-color);
55
+ fill: var(--notation-fill-color);
56
+ }
57
+
58
+ /* Text elements - target all SVG text within notation */
59
+ .notationsContentRootTable text,
60
+ .atomViewTextRoot,
61
+ .notation-embelishment-label {
62
+ fill: var(--notation-text-color);
63
+ }
64
+
65
+ /* HTML text elements (metadata, headings, markdown content) */
66
+ .notationsContentRootTable,
67
+ .rawBlockContentCell,
68
+ .rawBlockContentCell * {
69
+ color: var(--notation-text-color);
70
+ }
71
+
72
+ /* ========================================
73
+ Layout Styles
74
+ ======================================== */
75
+ .lineRow {
76
+ border: none;
77
+ }
78
+
79
+ .lineAnnotationCell {
80
+ padding: 0px;
81
+ padding-left: 10px;
82
+ padding-right: 10px;
83
+ padding-top: 10px;
84
+ vertical-align: top;
85
+ }
86
+
87
+ .lineContentCell {
88
+ padding: 0px;
89
+ padding-top: 5px;
90
+ padding-bottom: 5px;
91
+ }
92
+
93
+ .rawBlockRow {
94
+ border: none;
95
+ }
96
+
97
+ .rawBlockContentCell {
98
+ padding-top: 5px;
99
+ padding-bottom: 5px;
100
+ }
101
+
102
+ .notationsContentRootTable {
103
+ border-top: solid 1px var(--notation-border-color);
104
+ width: 100%;
105
+ }
106
+
107
+ /*# sourceMappingURL=NotationView.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../styles/NotationView.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAIA;AACE;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;AAEA;EACA;EACA;;;AAGF;AACA;AAAA;EAEE;EACA;EACA;EACA;;;AAGF;AACA;EACE;IACE;IACA;IACA;IACA;;;AAIJ;AAAA;AAAA;AAIA;AACA;EACE;EACA;;;AAGF;AACA;AAAA;EAEE;EACA;;;AAGF;AACA;EACE;EACA;;;AAGF;AACA;AAAA;AAAA;EAGE;;;AAGF;AACA;AAAA;AAAA;EAGE;;;AAGF;AAAA;AAAA;AAIA;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAIF;EACE;;;AAGF;EACE;EACA;;;AAMF;EACE;EACA","file":"NotationView.css"}
@@ -0,0 +1 @@
1
+ :root{--notation-stroke-color: black;--notation-fill-color: transparent;--notation-text-color: #1a1a1a;--notation-border-color: gray;--notation-stroke-width: 1;--notation-bar-line-width: 1;--notation-line-padding: 5px;--notation-annotation-padding: 10px}:root.dark,[data-theme=dark]{--notation-stroke-color: #e5e5e5;--notation-fill-color: transparent;--notation-text-color: #f0f0f0;--notation-border-color: #555}@media(prefers-color-scheme: dark){:root:not(.light):not([data-theme=light]){--notation-stroke-color: #e5e5e5;--notation-fill-color: transparent;--notation-text-color: #f0f0f0;--notation-border-color: #555}}.notation-octave-dot{stroke:var(--notation-stroke-color);stroke-width:var(--notation-stroke-width)}.bar-start-line,.bar-end-line{stroke:var(--notation-stroke-color);stroke-width:var(--notation-bar-line-width)}.notation-jaaru-path{stroke:var(--notation-stroke-color);fill:var(--notation-fill-color)}.notationsContentRootTable text,.atomViewTextRoot,.notation-embelishment-label{fill:var(--notation-text-color)}.notationsContentRootTable,.rawBlockContentCell,.rawBlockContentCell *{color:var(--notation-text-color)}.lineRow{border:none}.lineAnnotationCell{padding:0px;padding-left:10px;padding-right:10px;padding-top:10px;vertical-align:top}.lineContentCell{padding:0px;padding-top:5px;padding-bottom:5px}.rawBlockRow{border:none}.rawBlockContentCell{padding-top:5px;padding-bottom:5px}.notationsContentRootTable{border-top:solid 1px var(--notation-border-color);width:100%}/*# sourceMappingURL=NotationView.min.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../styles/NotationView.scss"],"names":[],"mappings":"AAIA,MAEE,+BACA,mCACA,+BACA,8BAGA,2BACA,6BAGA,6BACA,oCAIF,6BAEE,iCACA,mCACA,+BACA,8BAIF,mCACE,0CACE,iCACA,mCACA,+BACA,+BASJ,qBACE,oCACA,0CAIF,8BAEE,oCACA,4CAIF,qBACE,oCACA,gCAIF,+EAGE,gCAIF,uEAGE,iCAOF,SACE,YAGF,oBACE,YACA,kBACA,mBACA,iBACA,mBAGF,iBACE,YACA,gBACA,mBAIF,aACE,YAGF,qBACE,gBACA,mBAMF,2BACE,kDACA","file":"NotationView.min.css"}