notations 0.0.46 → 0.0.49
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/lib/cjs/beats.d.ts +34 -69
- package/lib/cjs/beats.js +178 -439
- package/lib/cjs/beats.js.map +1 -1
- package/lib/cjs/beatutils.d.ts +3 -0
- package/lib/cjs/beatutils.js +64 -0
- package/lib/cjs/beatutils.js.map +1 -0
- package/lib/cjs/beatview.d.ts +18 -0
- package/lib/cjs/beatview.js +62 -0
- package/lib/cjs/beatview.js.map +1 -0
- package/lib/cjs/carnatic/LineView.d.ts +2 -7
- package/lib/cjs/carnatic/LineView.js +13 -31
- package/lib/cjs/carnatic/LineView.js.map +1 -1
- package/lib/cjs/carnatic/NotationView.d.ts +8 -7
- package/lib/cjs/carnatic/NotationView.js +76 -153
- package/lib/cjs/carnatic/NotationView.js.map +1 -1
- package/lib/cjs/carnatic/atomviews.js +149 -287
- package/lib/cjs/carnatic/atomviews.js.map +1 -1
- package/lib/cjs/carnatic/beatviews.d.ts +4 -13
- package/lib/cjs/carnatic/beatviews.js +23 -118
- package/lib/cjs/carnatic/beatviews.js.map +1 -1
- package/lib/cjs/carnatic/embelishments.d.ts +1 -1
- package/lib/cjs/carnatic/embelishments.js +189 -283
- package/lib/cjs/carnatic/embelishments.js.map +1 -1
- package/lib/cjs/carnatic/gamakas.js +15 -47
- package/lib/cjs/carnatic/gamakas.js.map +1 -1
- package/lib/cjs/commands.js +111 -271
- package/lib/cjs/commands.js.map +1 -1
- package/lib/cjs/core.d.ts +14 -1
- package/lib/cjs/core.js +291 -477
- package/lib/cjs/core.js.map +1 -1
- package/lib/cjs/cycle.js +175 -367
- package/lib/cjs/cycle.js.map +1 -1
- package/lib/cjs/entity.js +48 -102
- package/lib/cjs/entity.js.map +1 -1
- package/lib/cjs/grids.d.ts +125 -0
- package/lib/cjs/grids.js +550 -0
- package/lib/cjs/grids.js.map +1 -0
- package/lib/cjs/iterators.js +96 -234
- package/lib/cjs/iterators.js.map +1 -1
- package/lib/cjs/layouts.d.ts +1 -1
- package/lib/cjs/layouts.js +62 -98
- package/lib/cjs/layouts.js.map +1 -1
- package/lib/cjs/loader.d.ts +2 -2
- package/lib/cjs/loader.js +23 -123
- package/lib/cjs/loader.js.map +1 -1
- package/lib/cjs/notation.d.ts +0 -3
- package/lib/cjs/notation.js +139 -241
- package/lib/cjs/notation.js.map +1 -1
- package/lib/cjs/parser.d.ts +2 -0
- package/lib/cjs/parser.js +225 -214
- package/lib/cjs/parser.js.map +1 -1
- package/lib/cjs/shapes.js +149 -283
- package/lib/cjs/shapes.js.map +1 -1
- package/lib/cjs/utils.d.ts +8 -0
- package/lib/cjs/utils.js +60 -55
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/beats.d.ts +34 -69
- package/lib/esm/beats.js +172 -438
- package/lib/esm/beats.js.map +1 -1
- package/lib/esm/beatutils.d.ts +3 -0
- package/lib/esm/beatutils.js +37 -0
- package/lib/esm/beatutils.js.map +1 -0
- package/lib/esm/beatview.d.ts +18 -0
- package/lib/esm/beatview.js +35 -0
- package/lib/esm/beatview.js.map +1 -0
- package/lib/esm/carnatic/LineView.d.ts +2 -7
- package/lib/esm/carnatic/LineView.js +12 -31
- package/lib/esm/carnatic/LineView.js.map +1 -1
- package/lib/esm/carnatic/NotationView.d.ts +8 -7
- package/lib/esm/carnatic/NotationView.js +74 -152
- package/lib/esm/carnatic/NotationView.js.map +1 -1
- package/lib/esm/carnatic/atomviews.js +144 -284
- package/lib/esm/carnatic/atomviews.js.map +1 -1
- package/lib/esm/carnatic/beatviews.d.ts +4 -13
- package/lib/esm/carnatic/beatviews.js +21 -94
- package/lib/esm/carnatic/beatviews.js.map +1 -1
- package/lib/esm/carnatic/embelishments.d.ts +1 -1
- package/lib/esm/carnatic/embelishments.js +187 -296
- package/lib/esm/carnatic/embelishments.js.map +1 -1
- package/lib/esm/carnatic/gamakas.js +14 -48
- package/lib/esm/carnatic/gamakas.js.map +1 -1
- package/lib/esm/commands.js +100 -271
- package/lib/esm/commands.js.map +1 -1
- package/lib/esm/core.d.ts +14 -1
- package/lib/esm/core.js +287 -484
- package/lib/esm/core.js.map +1 -1
- package/lib/esm/cycle.js +172 -367
- package/lib/esm/cycle.js.map +1 -1
- package/lib/esm/entity.js +48 -104
- package/lib/esm/entity.js.map +1 -1
- package/lib/esm/grids.d.ts +125 -0
- package/lib/esm/grids.js +517 -0
- package/lib/esm/grids.js.map +1 -0
- package/lib/esm/iterators.js +93 -235
- package/lib/esm/iterators.js.map +1 -1
- package/lib/esm/layouts.d.ts +1 -1
- package/lib/esm/layouts.js +60 -97
- package/lib/esm/layouts.js.map +1 -1
- package/lib/esm/loader.d.ts +2 -2
- package/lib/esm/loader.js +20 -120
- package/lib/esm/loader.js.map +1 -1
- package/lib/esm/notation.d.ts +0 -3
- package/lib/esm/notation.js +135 -242
- package/lib/esm/notation.js.map +1 -1
- package/lib/esm/parser.d.ts +2 -0
- package/lib/esm/parser.js +220 -210
- package/lib/esm/parser.js.map +1 -1
- package/lib/esm/shapes.js +148 -288
- package/lib/esm/shapes.js.map +1 -1
- package/lib/esm/utils.d.ts +8 -0
- package/lib/esm/utils.js +55 -51
- package/lib/esm/utils.js.map +1 -1
- package/package.json +18 -17
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BeatView as BeatViewBase
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly beat: Beat;
|
|
6
|
-
readonly rootElement: SVGGraphicsElement;
|
|
7
|
-
readonly cycle: Cycle;
|
|
8
|
-
private _embelishments;
|
|
9
|
-
atomView: AtomView;
|
|
10
|
-
needsLayout: boolean;
|
|
11
|
-
constructor(beat: Beat, rootElement: SVGGraphicsElement, cycle: Cycle, config?: any);
|
|
1
|
+
import { Embelishment } from "../shapes";
|
|
2
|
+
import { BeatView as BeatViewBase } from "../beatview";
|
|
3
|
+
export declare class BeatView extends BeatViewBase {
|
|
4
|
+
createAtomView(): import("../shapes").AtomView;
|
|
12
5
|
refreshLayout(): void;
|
|
13
|
-
get embelishments(): Embelishment[];
|
|
14
6
|
protected createEmbelishments(): Embelishment[];
|
|
15
|
-
setStyles(config: any): void;
|
|
16
7
|
}
|
|
@@ -1,143 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __values = (this && this.__values) || function(o) {
|
|
41
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
42
|
-
if (m) return m.call(o);
|
|
43
|
-
if (o && typeof o.length === "number") return {
|
|
44
|
-
next: function () {
|
|
45
|
-
if (o && i >= o.length) o = void 0;
|
|
46
|
-
return { value: o && o[i++], done: !o };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
50
|
-
};
|
|
51
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
3
|
exports.BeatView = void 0;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
function BeatView(beat, rootElement, cycle, config) {
|
|
60
|
-
var _this = _super.call(this, TSU.DOM.createSVGNode("g", {
|
|
61
|
-
parent: rootElement,
|
|
62
|
-
attrs: {
|
|
63
|
-
class: "beatView",
|
|
64
|
-
beatId: "" + beat.uuid,
|
|
65
|
-
id: "" + beat.uuid,
|
|
66
|
-
roleName: beat.role.name,
|
|
67
|
-
layoutLine: "" + beat.layoutLine,
|
|
68
|
-
layoutColumn: "" + beat.layoutColumn,
|
|
69
|
-
beatIndex: "" + beat.index,
|
|
70
|
-
},
|
|
71
|
-
})) || this;
|
|
72
|
-
_this.beat = beat;
|
|
73
|
-
_this.rootElement = rootElement;
|
|
74
|
-
_this.cycle = cycle;
|
|
75
|
-
_this.needsLayout = true;
|
|
76
|
-
_this.atomView = (0, atomviews_1.createAtomView)(_this.element, beat.atom, beat.role.defaultToNotes);
|
|
77
|
-
_this.atomView.refreshLayout();
|
|
78
|
-
return _this;
|
|
4
|
+
const atomviews_1 = require("./atomviews");
|
|
5
|
+
const beatview_1 = require("../beatview");
|
|
6
|
+
const embelishments_1 = require("./embelishments");
|
|
7
|
+
class BeatView extends beatview_1.BeatView {
|
|
8
|
+
createAtomView() {
|
|
9
|
+
return (0, atomviews_1.createAtomView)(this.element, this.beat.atom, this.beat.role.defaultToNotes);
|
|
79
10
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var newY = this.hasY ? this._y : 0;
|
|
11
|
+
refreshLayout() {
|
|
12
|
+
const newX = this.hasX ? this._x : 0;
|
|
13
|
+
const newY = this.hasY ? this._y : 0;
|
|
84
14
|
this.element.setAttribute("transform", "translate(" + newX + "," + newY + ")");
|
|
85
15
|
this.invalidateBounds();
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var e = _c.value;
|
|
89
|
-
e.refreshLayout();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
93
|
-
finally {
|
|
94
|
-
try {
|
|
95
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
96
|
-
}
|
|
97
|
-
finally { if (e_1) throw e_1.error; }
|
|
98
|
-
}
|
|
16
|
+
for (const e of this.embelishments)
|
|
17
|
+
e.refreshLayout();
|
|
99
18
|
this.invalidateBounds();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
return this._embelishments;
|
|
107
|
-
},
|
|
108
|
-
enumerable: false,
|
|
109
|
-
configurable: true
|
|
110
|
-
});
|
|
111
|
-
BeatView.prototype.createEmbelishments = function () {
|
|
112
|
-
var embelishments = [];
|
|
113
|
-
var beat = this.beat;
|
|
114
|
-
var rootElement = this.rootElement;
|
|
19
|
+
}
|
|
20
|
+
createEmbelishments() {
|
|
21
|
+
let embelishments = [];
|
|
22
|
+
const beat = this.beat;
|
|
23
|
+
const rootElement = this.rootElement;
|
|
115
24
|
if (beat.beatIndex == 0 && beat.barIndex == 0 && beat.instance == 0) {
|
|
116
|
-
|
|
25
|
+
const emb = new embelishments_1.BeatStartLines(this, rootElement);
|
|
117
26
|
embelishments = [emb];
|
|
118
27
|
}
|
|
119
28
|
else {
|
|
120
|
-
|
|
121
|
-
|
|
29
|
+
const cycle = this.cycle;
|
|
30
|
+
const bar = cycle.bars[beat.barIndex];
|
|
122
31
|
if (beat.beatIndex == bar.beatCount - 1) {
|
|
123
32
|
if (beat.instance == bar.instanceCount(beat.beatIndex) - 1) {
|
|
124
33
|
if (beat.barIndex == cycle.bars.length - 1) {
|
|
125
|
-
|
|
34
|
+
const emb = new embelishments_1.BeatEndLines(this, rootElement, 2);
|
|
126
35
|
embelishments = [emb];
|
|
127
36
|
}
|
|
128
37
|
else {
|
|
129
|
-
|
|
38
|
+
const emb = new embelishments_1.BeatEndLines(this, rootElement);
|
|
130
39
|
embelishments = [emb];
|
|
131
40
|
}
|
|
132
41
|
}
|
|
133
42
|
}
|
|
134
43
|
}
|
|
135
44
|
return embelishments;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
this.needsLayout = true;
|
|
139
|
-
};
|
|
140
|
-
return BeatView;
|
|
141
|
-
}(shapes_1.ElementShape));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
142
47
|
exports.BeatView = BeatView;
|
|
143
48
|
//# sourceMappingURL=beatviews.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beatviews.js","sourceRoot":"","sources":["../../../src/carnatic/beatviews.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"beatviews.js","sourceRoot":"","sources":["../../../src/carnatic/beatviews.ts"],"names":[],"mappings":";;;AAEA,2CAA6C;AAC7C,0CAAuD;AACvD,mD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,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE;gBAIvC,IAAI,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;oBAC1D,IAAI,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;wBAE1C,MAAM,GAAG,GAAG,IAAI,4BAAY,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;wBACnD,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC;qBACvB;yBAAM;wBAEL,MAAM,GAAG,GAAG,IAAI,4BAAY,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;wBAChD,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC;qBACvB;iBACF;aACF;SACF;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AA7CD,4BA6CC","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { Embelishment } from \"../shapes\";\nimport { createAtomView } from \"./atomviews\";\nimport { BeatView as BeatViewBase } from \"../beatview\";\nimport { BeatStartLines, BeatEndLines } from \"./embelishments\";\n\nexport class BeatView extends BeatViewBase {\n createAtomView() {\n return createAtomView(this.element, this.beat.atom, this.beat.role.defaultToNotes);\n }\n\n refreshLayout(): void {\n const newX = this.hasX ? this._x : 0;\n const newY = this.hasY ? this._y : 0;\n this.element.setAttribute(\"transform\", \"translate(\" + newX + \",\" + newY + \")\");\n this.invalidateBounds();\n for (const e of this.embelishments) e.refreshLayout();\n this.invalidateBounds();\n }\n\n protected createEmbelishments(): Embelishment[] {\n let embelishments: Embelishment[] = [];\n const beat = this.beat;\n // TODO - Should this be the group's parent element?\n const rootElement = this.rootElement;\n if (beat.beatIndex == 0 && beat.barIndex == 0 && beat.instance == 0) {\n // first beat in bar - Do a BarStart\n const emb = new BeatStartLines(this, rootElement);\n embelishments = [emb];\n } else {\n const cycle = this.cycle;\n const bar = cycle.bars[beat.barIndex];\n if (beat.beatIndex == bar.beatCount - 1) {\n // It is important that we are not just looking at the last beat of the bar\n // but also in the last \"instance\" of the beat in this bar to account for\n // kalais\n if (beat.instance == bar.instanceCount(beat.beatIndex) - 1) {\n if (beat.barIndex == cycle.bars.length - 1) {\n // last beat in last bar so - do a thalam end (2 lines)\n const emb = new BeatEndLines(this, rootElement, 2);\n embelishments = [emb];\n } else {\n // end of a bar so single line end\n const emb = new BeatEndLines(this, rootElement);\n embelishments = [emb];\n }\n }\n }\n }\n return embelishments;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as TSU from "@panyam/tsutils";
|
|
2
2
|
import { Note } from "../core";
|
|
3
|
-
import { BeatView } from "../
|
|
3
|
+
import { BeatView } from "../beatview";
|
|
4
4
|
import { Embelishment } from "../shapes";
|
|
5
5
|
import { LeafAtomView } from "./atomviews";
|
|
6
6
|
import { JaaruGamaka } from "./gamakas";
|