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.
- package/README.md +56 -26
- package/dist/NotationView.css +107 -0
- package/dist/NotationView.css.map +1 -0
- package/dist/NotationView.min.css +1 -0
- package/dist/NotationView.min.css.map +1 -0
- package/dist/notations.umd.js +35875 -0
- package/dist/notations.umd.min.js +112 -0
- package/dist/notations.umd.min.js.LICENSE.txt +24 -0
- package/dist/notations.umd.min.js.map +1 -0
- package/lib/cjs/beats.js.map +1 -1
- package/lib/cjs/beatutils.js.map +1 -1
- package/lib/cjs/beatview.js.map +1 -1
- package/lib/cjs/carnatic/LineView.js.map +1 -1
- package/lib/cjs/carnatic/NotationView.js.map +1 -1
- package/lib/cjs/carnatic/embelishments.js +3 -8
- package/lib/cjs/carnatic/embelishments.js.map +1 -1
- package/lib/cjs/carnatic/gamakas.js.map +1 -1
- package/lib/cjs/commands.js.map +1 -1
- package/lib/cjs/core.js.map +1 -1
- package/lib/cjs/cycle.js.map +1 -1
- package/lib/cjs/entity.js.map +1 -1
- package/lib/cjs/grids.js.map +1 -1
- package/lib/cjs/iterators.js.map +1 -1
- package/lib/cjs/layouts.js.map +1 -1
- package/lib/cjs/loader.js.map +1 -1
- package/lib/cjs/notation.js.map +1 -1
- package/lib/cjs/parser.js.map +1 -1
- package/lib/cjs/shapes.js +1 -1
- package/lib/cjs/shapes.js.map +1 -1
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/beats.js.map +1 -1
- package/lib/esm/beatutils.js.map +1 -1
- package/lib/esm/beatview.js.map +1 -1
- package/lib/esm/carnatic/LineView.js.map +1 -1
- package/lib/esm/carnatic/NotationView.js.map +1 -1
- package/lib/esm/carnatic/embelishments.js +3 -8
- package/lib/esm/carnatic/embelishments.js.map +1 -1
- package/lib/esm/carnatic/gamakas.js.map +1 -1
- package/lib/esm/commands.js.map +1 -1
- package/lib/esm/core.js.map +1 -1
- package/lib/esm/cycle.js.map +1 -1
- package/lib/esm/entity.js.map +1 -1
- package/lib/esm/grids.js.map +1 -1
- package/lib/esm/iterators.js.map +1 -1
- package/lib/esm/layouts.js.map +1 -1
- package/lib/esm/loader.js.map +1 -1
- package/lib/esm/notation.js.map +1 -1
- package/lib/esm/parser.js.map +1 -1
- package/lib/esm/shapes.js +1 -1
- package/lib/esm/shapes.js.map +1 -1
- package/lib/esm/utils.js.map +1 -1
- package/package.json +22 -15
- package/styles/NotationView.scss +81 -1
package/README.md
CHANGED
|
@@ -1,42 +1,72 @@
|
|
|
1
|
-
|
|
2
1
|
# Notations
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
A TypeScript library for parsing, modeling, and rendering Carnatic music notation.
|
|
5
4
|
|
|
6
|
-
|
|
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
|
-
##
|
|
7
|
+
## Features
|
|
10
8
|
|
|
11
|
-
|
|
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
|
-
|
|
14
|
+
## Quick Start
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
### Via CDN (no build tools required)
|
|
16
17
|
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
|
|
38
|
+
### Via npm/pnpm
|
|
27
39
|
|
|
40
|
+
```bash
|
|
41
|
+
npm install notations
|
|
28
42
|
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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"}
|