notations 0.0.47 → 0.0.50

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 (113) hide show
  1. package/lib/cjs/beats.d.ts +34 -69
  2. package/lib/cjs/beats.js +178 -439
  3. package/lib/cjs/beats.js.map +1 -1
  4. package/lib/cjs/beatutils.d.ts +3 -0
  5. package/lib/cjs/beatutils.js +64 -0
  6. package/lib/cjs/beatutils.js.map +1 -0
  7. package/lib/cjs/beatview.d.ts +18 -0
  8. package/lib/cjs/beatview.js +62 -0
  9. package/lib/cjs/beatview.js.map +1 -0
  10. package/lib/cjs/carnatic/LineView.d.ts +2 -7
  11. package/lib/cjs/carnatic/LineView.js +13 -31
  12. package/lib/cjs/carnatic/LineView.js.map +1 -1
  13. package/lib/cjs/carnatic/NotationView.d.ts +8 -7
  14. package/lib/cjs/carnatic/NotationView.js +73 -153
  15. package/lib/cjs/carnatic/NotationView.js.map +1 -1
  16. package/lib/cjs/carnatic/atomviews.js +149 -287
  17. package/lib/cjs/carnatic/atomviews.js.map +1 -1
  18. package/lib/cjs/carnatic/beatviews.d.ts +4 -13
  19. package/lib/cjs/carnatic/beatviews.js +23 -118
  20. package/lib/cjs/carnatic/beatviews.js.map +1 -1
  21. package/lib/cjs/carnatic/embelishments.d.ts +1 -1
  22. package/lib/cjs/carnatic/embelishments.js +189 -283
  23. package/lib/cjs/carnatic/embelishments.js.map +1 -1
  24. package/lib/cjs/carnatic/gamakas.js +15 -47
  25. package/lib/cjs/carnatic/gamakas.js.map +1 -1
  26. package/lib/cjs/commands.js +111 -271
  27. package/lib/cjs/commands.js.map +1 -1
  28. package/lib/cjs/core.d.ts +14 -1
  29. package/lib/cjs/core.js +291 -477
  30. package/lib/cjs/core.js.map +1 -1
  31. package/lib/cjs/cycle.js +175 -367
  32. package/lib/cjs/cycle.js.map +1 -1
  33. package/lib/cjs/entity.js +48 -102
  34. package/lib/cjs/entity.js.map +1 -1
  35. package/lib/cjs/grids.d.ts +125 -0
  36. package/lib/cjs/grids.js +550 -0
  37. package/lib/cjs/grids.js.map +1 -0
  38. package/lib/cjs/iterators.js +96 -234
  39. package/lib/cjs/iterators.js.map +1 -1
  40. package/lib/cjs/layouts.d.ts +1 -1
  41. package/lib/cjs/layouts.js +62 -98
  42. package/lib/cjs/layouts.js.map +1 -1
  43. package/lib/cjs/loader.d.ts +2 -2
  44. package/lib/cjs/loader.js +23 -123
  45. package/lib/cjs/loader.js.map +1 -1
  46. package/lib/cjs/notation.d.ts +0 -3
  47. package/lib/cjs/notation.js +139 -241
  48. package/lib/cjs/notation.js.map +1 -1
  49. package/lib/cjs/parser.d.ts +2 -0
  50. package/lib/cjs/parser.js +230 -214
  51. package/lib/cjs/parser.js.map +1 -1
  52. package/lib/cjs/shapes.js +149 -283
  53. package/lib/cjs/shapes.js.map +1 -1
  54. package/lib/cjs/utils.d.ts +8 -0
  55. package/lib/cjs/utils.js +60 -55
  56. package/lib/cjs/utils.js.map +1 -1
  57. package/lib/esm/beats.d.ts +34 -69
  58. package/lib/esm/beats.js +172 -438
  59. package/lib/esm/beats.js.map +1 -1
  60. package/lib/esm/beatutils.d.ts +3 -0
  61. package/lib/esm/beatutils.js +37 -0
  62. package/lib/esm/beatutils.js.map +1 -0
  63. package/lib/esm/beatview.d.ts +18 -0
  64. package/lib/esm/beatview.js +35 -0
  65. package/lib/esm/beatview.js.map +1 -0
  66. package/lib/esm/carnatic/LineView.d.ts +2 -7
  67. package/lib/esm/carnatic/LineView.js +12 -31
  68. package/lib/esm/carnatic/LineView.js.map +1 -1
  69. package/lib/esm/carnatic/NotationView.d.ts +8 -7
  70. package/lib/esm/carnatic/NotationView.js +71 -152
  71. package/lib/esm/carnatic/NotationView.js.map +1 -1
  72. package/lib/esm/carnatic/atomviews.js +144 -284
  73. package/lib/esm/carnatic/atomviews.js.map +1 -1
  74. package/lib/esm/carnatic/beatviews.d.ts +4 -13
  75. package/lib/esm/carnatic/beatviews.js +21 -94
  76. package/lib/esm/carnatic/beatviews.js.map +1 -1
  77. package/lib/esm/carnatic/embelishments.d.ts +1 -1
  78. package/lib/esm/carnatic/embelishments.js +187 -296
  79. package/lib/esm/carnatic/embelishments.js.map +1 -1
  80. package/lib/esm/carnatic/gamakas.js +14 -48
  81. package/lib/esm/carnatic/gamakas.js.map +1 -1
  82. package/lib/esm/commands.js +100 -271
  83. package/lib/esm/commands.js.map +1 -1
  84. package/lib/esm/core.d.ts +14 -1
  85. package/lib/esm/core.js +287 -484
  86. package/lib/esm/core.js.map +1 -1
  87. package/lib/esm/cycle.js +172 -367
  88. package/lib/esm/cycle.js.map +1 -1
  89. package/lib/esm/entity.js +48 -104
  90. package/lib/esm/entity.js.map +1 -1
  91. package/lib/esm/grids.d.ts +125 -0
  92. package/lib/esm/grids.js +517 -0
  93. package/lib/esm/grids.js.map +1 -0
  94. package/lib/esm/iterators.js +93 -235
  95. package/lib/esm/iterators.js.map +1 -1
  96. package/lib/esm/layouts.d.ts +1 -1
  97. package/lib/esm/layouts.js +60 -97
  98. package/lib/esm/layouts.js.map +1 -1
  99. package/lib/esm/loader.d.ts +2 -2
  100. package/lib/esm/loader.js +20 -120
  101. package/lib/esm/loader.js.map +1 -1
  102. package/lib/esm/notation.d.ts +0 -3
  103. package/lib/esm/notation.js +135 -242
  104. package/lib/esm/notation.js.map +1 -1
  105. package/lib/esm/parser.d.ts +2 -0
  106. package/lib/esm/parser.js +225 -210
  107. package/lib/esm/parser.js.map +1 -1
  108. package/lib/esm/shapes.js +148 -288
  109. package/lib/esm/shapes.js.map +1 -1
  110. package/lib/esm/utils.d.ts +8 -0
  111. package/lib/esm/utils.js +55 -51
  112. package/lib/esm/utils.js.map +1 -1
  113. package/package.json +18 -17
@@ -1,301 +1,197 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __assign = (this && this.__assign) || function () {
17
- __assign = Object.assign || function(t) {
18
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19
- s = arguments[i];
20
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
- t[p] = s[p];
22
- }
23
- return t;
24
- };
25
- return __assign.apply(this, arguments);
26
- };
27
- var __values = (this && this.__values) || function(o) {
28
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
29
- if (m) return m.call(o);
30
- if (o && typeof o.length === "number") return {
31
- next: function () {
32
- if (o && i >= o.length) o = void 0;
33
- return { value: o && o[i++], done: !o };
34
- }
35
- };
36
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
37
- };
38
1
  import { Entity } from "./entity";
39
2
  import { Cycle } from "./cycle";
40
3
  import { Line } from "./core";
41
4
  import { LayoutParams } from "./layouts";
42
- var RoleDef = (function () {
43
- function RoleDef() {
5
+ export class RoleDef {
6
+ constructor() {
44
7
  this.name = "";
45
8
  this.notesOnly = false;
46
9
  this.index = 0;
47
10
  }
48
- return RoleDef;
49
- }());
50
- export { RoleDef };
51
- var Command = (function (_super) {
52
- __extends(Command, _super);
53
- function Command(params) {
54
- if (params === void 0) { params = []; }
55
- var _this = _super.call(this) || this;
56
- _this.autoGenerated = false;
57
- _this.prevSibling = null;
58
- _this.nextSibling = null;
59
- _this.params = params;
60
- _this.index = 0;
61
- _this.validateParams();
62
- return _this;
63
- }
64
- Command.prototype.validateParams = function () {
65
- };
66
- Object.defineProperty(Command.prototype, "name", {
67
- get: function () {
68
- return this.constructor.name;
69
- },
70
- enumerable: false,
71
- configurable: true
72
- });
73
- Object.defineProperty(Command.prototype, "type", {
74
- get: function () {
75
- return "Command";
76
- },
77
- enumerable: false,
78
- configurable: true
79
- });
80
- Command.prototype.debugValue = function () {
11
+ }
12
+ export class Command extends Entity {
13
+ constructor(params = []) {
14
+ super();
15
+ this.autoGenerated = false;
16
+ this.prevSibling = null;
17
+ this.nextSibling = null;
18
+ this.params = params;
19
+ this.index = 0;
20
+ this.validateParams();
21
+ }
22
+ validateParams() {
23
+ }
24
+ get name() {
25
+ return this.constructor.name;
26
+ }
27
+ get type() {
28
+ return "Command";
29
+ }
30
+ debugValue() {
81
31
  return { name: this.name, index: this.index, params: this.params };
82
- };
83
- Command.prototype.getParam = function (name) {
84
- var e_1, _a;
85
- try {
86
- for (var _b = __values(this.params), _c = _b.next(); !_c.done; _c = _b.next()) {
87
- var param = _c.value;
88
- if (param.key == name)
89
- return param.value;
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; }
32
+ }
33
+ getParam(name) {
34
+ for (const param of this.params) {
35
+ if (param.key == name)
36
+ return param.value;
98
37
  }
99
38
  return null;
100
- };
101
- Command.prototype.getParamAt = function (index) {
39
+ }
40
+ getParamAt(index) {
102
41
  return index < this.params.length ? this.params[index].value : null;
103
- };
104
- return Command;
105
- }(Entity));
106
- export { Command };
107
- var RawBlock = (function (_super) {
108
- __extends(RawBlock, _super);
109
- function RawBlock(content, contentType) {
110
- if (contentType === void 0) { contentType = "md"; }
111
- var _this = _super.call(this) || this;
112
- _this.content = content;
113
- _this.contentType = contentType;
114
- return _this;
115
- }
116
- RawBlock.prototype.debugValue = function () {
117
- return __assign(__assign({}, _super.prototype.debugValue.call(this)), { content: this.content, contentType: this.contentType });
118
- };
119
- return RawBlock;
120
- }(Entity));
121
- export { RawBlock };
122
- var MetaData = (function () {
123
- function MetaData(key, value, params) {
42
+ }
43
+ }
44
+ export class RawBlock extends Entity {
45
+ constructor(content, contentType = "md") {
46
+ super();
47
+ this.content = content;
48
+ this.contentType = contentType;
49
+ }
50
+ debugValue() {
51
+ return Object.assign(Object.assign({}, super.debugValue()), { content: this.content, contentType: this.contentType });
52
+ }
53
+ }
54
+ export class MetaData {
55
+ constructor(key, value, params) {
124
56
  this.key = key;
125
57
  this.value = value;
126
58
  this.params = params;
127
59
  params = params || {};
128
60
  }
129
- return MetaData;
130
- }());
131
- export { MetaData };
132
- var Notation = (function (_super) {
133
- __extends(Notation, _super);
134
- function Notation() {
135
- var _this = _super !== null && _super.apply(this, arguments) || this;
136
- _this._unnamedLayoutParams = [];
137
- _this._namedLayoutParams = new Map();
138
- _this._currRoleDef = null;
139
- _this.roles = [];
140
- _this.blocks = [];
141
- _this.lpsForLine = new Map();
142
- _this.currentAPB = 1;
143
- _this.currentCycle = Cycle.DEFAULT;
144
- _this.currentBreaks = [];
145
- _this.metadata = new Map();
146
- _this.onMissingRole = function (name) { return _this.newRoleDef(name, name == "sw"); };
147
- _this._currentLine = null;
148
- _this._layoutParams = null;
149
- return _this;
150
- }
151
- Notation.prototype.layoutParamsForLine = function (line) {
152
- return this.lpsForLine.get(line.uuid) || null;
153
- };
154
- Notation.prototype.setLayoutParamsForLine = function (line, layoutParams) {
155
- this.lpsForLine.set(line.uuid, layoutParams);
156
- };
157
- Object.defineProperty(Notation.prototype, "unnamedLayoutParams", {
158
- get: function () {
159
- return this._unnamedLayoutParams;
160
- },
161
- enumerable: false,
162
- configurable: true
163
- });
164
- Object.defineProperty(Notation.prototype, "namedLayoutParams", {
165
- get: function () {
166
- return this._namedLayoutParams;
167
- },
168
- enumerable: false,
169
- configurable: true
170
- });
171
- Object.defineProperty(Notation.prototype, "type", {
172
- get: function () {
173
- return "Notation";
174
- },
175
- enumerable: false,
176
- configurable: true
177
- });
178
- Notation.prototype.addLine = function (line) {
61
+ }
62
+ export class Notation extends Entity {
63
+ constructor() {
64
+ super(...arguments);
65
+ this._unnamedLayoutParams = [];
66
+ this._namedLayoutParams = new Map();
67
+ this._currRoleDef = null;
68
+ this.roles = [];
69
+ this.blocks = [];
70
+ this.currentAPB = 1;
71
+ this.currentCycle = Cycle.DEFAULT;
72
+ this.currentBreaks = [];
73
+ this.metadata = new Map();
74
+ this.onMissingRole = (name) => this.newRoleDef(name, name == "sw");
75
+ this._currentLine = null;
76
+ this._layoutParams = null;
77
+ }
78
+ get unnamedLayoutParams() {
79
+ return this._unnamedLayoutParams;
80
+ }
81
+ get namedLayoutParams() {
82
+ return this._namedLayoutParams;
83
+ }
84
+ get type() {
85
+ return "Notation";
86
+ }
87
+ addLine(line) {
179
88
  this.blocks.push(line);
180
- };
181
- Notation.prototype.removeLine = function (line) {
182
- var index = this.blocks.findIndex(function (l) { return l == line; });
89
+ }
90
+ removeLine(line) {
91
+ const index = this.blocks.findIndex((l) => l == line);
183
92
  if (index >= 0) {
184
93
  this.blocks.splice(index, 1);
185
94
  }
186
95
  return index;
187
- };
188
- Notation.prototype.addRawBlock = function (raw) {
96
+ }
97
+ addRawBlock(raw) {
189
98
  this.blocks.push(raw);
190
99
  this.resetLine();
191
- };
192
- Notation.prototype.addMetaData = function (meta) {
100
+ }
101
+ addMetaData(meta) {
193
102
  if (!this.metadata.has(meta.key)) {
194
- var raw = new RawBlock(meta.key, "metadata");
103
+ const raw = new RawBlock(meta.key, "metadata");
195
104
  this.addRawBlock(raw);
196
105
  }
197
106
  this.metadata.set(meta.key, meta);
198
- };
199
- Notation.prototype.debugValue = function () {
107
+ }
108
+ debugValue() {
200
109
  var _a;
201
- return __assign(__assign({}, _super.prototype.debugValue), { roles: this.roles, blocks: this.blocks.map(function (b) { return b.debugValue(); }), currentAPB: this.currentAPB, currentCycle: (_a = this.currentCycle) === null || _a === void 0 ? void 0 : _a.uuid, currentBreaks: this.currentBreaks });
202
- };
203
- Notation.prototype.getRoleDef = function (name) {
110
+ return Object.assign(Object.assign({}, super.debugValue), { roles: this.roles, blocks: this.blocks.map((b) => b.debugValue()), currentAPB: this.currentAPB, currentCycle: (_a = this.currentCycle) === null || _a === void 0 ? void 0 : _a.uuid, currentBreaks: this.currentBreaks });
111
+ }
112
+ getRoleDef(name) {
204
113
  name = name.trim().toLowerCase();
205
114
  if (name == "") {
206
115
  return this.roles[this.roles.length - 1] || null;
207
116
  }
208
- for (var i = 0; i < this.roles.length; i++) {
209
- var rd = this.roles[i];
117
+ for (let i = 0; i < this.roles.length; i++) {
118
+ const rd = this.roles[i];
210
119
  if (name == rd.name)
211
120
  return rd;
212
121
  }
213
122
  return null;
214
- };
215
- Notation.prototype.newRoleDef = function (name, notesOnly) {
216
- if (notesOnly === void 0) { notesOnly = false; }
123
+ }
124
+ newRoleDef(name, notesOnly = false) {
217
125
  name = name.trim().toLowerCase();
218
126
  if (name.trim() == "") {
219
127
  throw new Error("Role name cannot be empty");
220
128
  }
221
- var roleDef = this.getRoleDef(name);
129
+ const roleDef = this.getRoleDef(name);
222
130
  if (roleDef != null) {
223
131
  throw new Error("Role already exists");
224
132
  }
225
- var rd = new RoleDef();
133
+ const rd = new RoleDef();
226
134
  rd.name = name;
227
135
  rd.notesOnly = notesOnly;
228
136
  rd.index = this.roles.length;
229
137
  this.roles.push(rd);
230
138
  return rd;
231
- };
232
- Object.defineProperty(Notation.prototype, "currRoleDef", {
233
- get: function () {
234
- if (this._currRoleDef == null) {
235
- if (this.roles.length == 0) {
236
- return null;
237
- }
238
- else {
239
- this._currRoleDef = this.roles[this.roles.length - 1];
240
- }
139
+ }
140
+ get currRoleDef() {
141
+ if (this._currRoleDef == null) {
142
+ if (this.roles.length == 0) {
143
+ return null;
144
+ }
145
+ else {
146
+ this._currRoleDef = this.roles[this.roles.length - 1];
241
147
  }
242
- return this._currRoleDef;
243
- },
244
- enumerable: false,
245
- configurable: true
246
- });
247
- Notation.prototype.setCurrRole = function (name) {
148
+ }
149
+ return this._currRoleDef;
150
+ }
151
+ setCurrRole(name) {
248
152
  name = name.trim().toLowerCase();
249
153
  if (name.trim() == "") {
250
154
  throw new Error("Role name cannot be empty");
251
155
  }
252
- var roleDef = this.getRoleDef(name) || (this.onMissingRole ? this.onMissingRole(name) || null : null);
156
+ const roleDef = this.getRoleDef(name) || (this.onMissingRole ? this.onMissingRole(name) || null : null);
253
157
  if (roleDef == null) {
254
158
  throw new Error("Role not found: " + name);
255
159
  }
256
160
  this._currRoleDef = roleDef;
257
- };
258
- Object.defineProperty(Notation.prototype, "currentLine", {
259
- get: function () {
260
- if (this._currentLine == null) {
261
- return this.newLine();
262
- }
263
- return this._currentLine;
264
- },
265
- enumerable: false,
266
- configurable: true
267
- });
268
- Notation.prototype.resetLine = function () {
161
+ }
162
+ get currentLine() {
163
+ if (this._currentLine == null) {
164
+ return this.newLine();
165
+ }
166
+ return this._currentLine;
167
+ }
168
+ resetLine() {
269
169
  this._currentLine = null;
270
- };
271
- Notation.prototype.newLine = function () {
170
+ }
171
+ newLine() {
272
172
  if (this._currentLine && this._currentLine.isEmpty) {
273
173
  this.removeLine(this._currentLine);
274
174
  }
275
175
  this._currentLine = new Line();
276
176
  this.addLine(this._currentLine);
277
177
  return this._currentLine;
278
- };
279
- Notation.prototype.resetLayoutParams = function () {
178
+ }
179
+ resetLayoutParams() {
280
180
  this._layoutParams = null;
281
181
  this.resetLine();
282
- };
283
- Object.defineProperty(Notation.prototype, "layoutParams", {
284
- get: function () {
182
+ }
183
+ get layoutParams() {
184
+ if (this._layoutParams == null) {
185
+ this._layoutParams = this.findUnnamedLayoutParams();
285
186
  if (this._layoutParams == null) {
286
- this._layoutParams = this.findUnnamedLayoutParams();
287
- if (this._layoutParams == null) {
288
- this._layoutParams = this.snapshotLayoutParams();
289
- this._unnamedLayoutParams.push(this._layoutParams);
290
- }
187
+ this._layoutParams = this.snapshotLayoutParams();
188
+ this._unnamedLayoutParams.push(this._layoutParams);
291
189
  }
292
- return this._layoutParams;
293
- },
294
- enumerable: false,
295
- configurable: true
296
- });
297
- Notation.prototype.ensureNamedLayoutParams = function (name) {
298
- var lp = this._namedLayoutParams.get(name) || null;
190
+ }
191
+ return this._layoutParams;
192
+ }
193
+ ensureNamedLayoutParams(name) {
194
+ let lp = this._namedLayoutParams.get(name) || null;
299
195
  if (lp == null || this._layoutParams != lp) {
300
196
  if (lp == null) {
301
197
  lp = this.snapshotLayoutParams();
@@ -310,23 +206,20 @@ var Notation = (function (_super) {
310
206
  this.resetLine();
311
207
  }
312
208
  return this._layoutParams;
313
- };
314
- Notation.prototype.snapshotLayoutParams = function () {
209
+ }
210
+ snapshotLayoutParams() {
315
211
  return new LayoutParams({
316
212
  cycle: this.currentCycle,
317
213
  beatDuration: this.currentAPB,
318
214
  layout: this.currentBreaks,
319
215
  });
320
- };
321
- Notation.prototype.findUnnamedLayoutParams = function () {
322
- var _this = this;
323
- return (this._unnamedLayoutParams.find(function (lp) {
324
- return (lp.beatDuration == _this.currentAPB &&
325
- _this.currentCycle.equals(lp.cycle) &&
326
- lp.lineBreaksEqual(_this.currentBreaks));
216
+ }
217
+ findUnnamedLayoutParams() {
218
+ return (this._unnamedLayoutParams.find((lp) => {
219
+ return (lp.beatDuration == this.currentAPB &&
220
+ this.currentCycle.equals(lp.cycle) &&
221
+ lp.lineBreaksEqual(this.currentBreaks));
327
222
  }) || null);
328
- };
329
- return Notation;
330
- }(Entity));
331
- export { Notation };
223
+ }
224
+ }
332
225
  //# sourceMappingURL=notation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notation.js","sourceRoot":"","sources":["../../src/notation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;IAAA;QACE,SAAI,GA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BAClC,EAAE,CAAC,eAAe,CAAC,KAAI,CAAC,aAAa,CAAC,CACvC,CAAC;QACJ,CAAC,CAAC,IAAI,IAAI,CACX,CAAC;IACJ,CAAC;IACH,eAAC;AAAD,CAAC,AAtND,CAA8B,MAAM,GAsNnC","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { Entity } from \"./entity\";\nimport { Cycle } from \"./cycle\";\nimport { Line } from \"./core\";\nimport { LayoutParams } from \"./layouts\";\n\nexport class RoleDef {\n name = \"\";\n notesOnly = false;\n index = 0;\n}\n\nexport type CmdParam = { key: TSU.Nullable<string>; value: any };\nexport abstract class Command extends Entity {\n // Commands that are auto generated are usually created by other commands\n autoGenerated = false;\n prevSibling: null | Command = null;\n nextSibling: null | Command = null;\n params: CmdParam[];\n index: number;\n\n constructor(params: CmdParam[] = []) {\n super();\n this.params = params;\n this.index = 0;\n this.validateParams();\n }\n\n /**\n * called to validate parameters.\n */\n validateParams(): void {\n //\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n get type(): string {\n return \"Command\";\n }\n\n debugValue(): any {\n return { name: this.name, index: this.index, params: this.params };\n }\n\n getParam(name: string): any {\n for (const param of this.params) {\n if (param.key == name) return param.value;\n }\n return null;\n }\n\n getParamAt(index: number): any {\n return index < this.params.length ? this.params[index].value : null;\n }\n abstract applyToNotation(notebook: Notation): void;\n}\n\nexport class RawBlock extends Entity {\n constructor(public content: string, public contentType: string = \"md\") {\n super();\n }\n\n debugValue(): any {\n return { ...super.debugValue(), content: this.content, contentType: this.contentType };\n }\n}\n\nexport class MetaData {\n constructor(public readonly key: string, public readonly value: string, public readonly params?: any) {\n params = params || {};\n }\n}\n\nexport class Notation extends Entity {\n private _unnamedLayoutParams: LayoutParams[] = [];\n private _namedLayoutParams = new Map<string, LayoutParams>();\n private _currRoleDef: TSU.Nullable<RoleDef> = null;\n roles: RoleDef[] = [];\n blocks: (Line | RawBlock)[] = [];\n private lpsForLine = new Map<number, LayoutParams>();\n currentAPB = 1;\n currentCycle: Cycle = Cycle.DEFAULT;\n currentBreaks: number[] = [];\n metadata = new Map<string, MetaData>();\n onMissingRole: (name: string) => RoleDef | null = (name) => this.newRoleDef(name, name == \"sw\");\n\n layoutParamsForLine(line: Line): null | LayoutParams {\n return this.lpsForLine.get(line.uuid) || null;\n }\n\n setLayoutParamsForLine(line: Line, layoutParams: LayoutParams): void {\n this.lpsForLine.set(line.uuid, layoutParams);\n }\n\n get unnamedLayoutParams(): ReadonlyArray<LayoutParams> {\n return this._unnamedLayoutParams;\n }\n\n get namedLayoutParams(): ReadonlyMap<string, LayoutParams> {\n return this._namedLayoutParams;\n }\n\n get type(): unknown {\n return \"Notation\";\n }\n\n addLine(line: Line): void {\n this.blocks.push(line);\n }\n\n removeLine(line: Line): number {\n const index = this.blocks.findIndex((l) => l == line);\n if (index >= 0) {\n this.blocks.splice(index, 1);\n }\n return index;\n }\n\n addRawBlock(raw: RawBlock): void {\n this.blocks.push(raw);\n this.resetLine();\n }\n\n addMetaData(meta: MetaData): void {\n if (!this.metadata.has(meta.key)) {\n // Add a new raw block here\n // set this by key so even if metadata changes we can\n // get latest value of it\n const raw = new RawBlock(meta.key, \"metadata\");\n this.addRawBlock(raw);\n }\n this.metadata.set(meta.key, meta);\n }\n\n debugValue(): any {\n return {\n ...super.debugValue,\n roles: this.roles,\n blocks: this.blocks.map((b) => b.debugValue()),\n currentAPB: this.currentAPB,\n currentCycle: this.currentCycle?.uuid,\n currentBreaks: this.currentBreaks,\n };\n }\n\n getRoleDef(name: string): TSU.Nullable<RoleDef> {\n name = name.trim().toLowerCase();\n if (name == \"\") {\n return this.roles[this.roles.length - 1] || null;\n }\n for (let i = 0; i < this.roles.length; i++) {\n const rd = this.roles[i];\n if (name == rd.name) return rd;\n }\n return null;\n }\n\n newRoleDef(name: string, notesOnly = false): RoleDef {\n name = name.trim().toLowerCase();\n if (name.trim() == \"\") {\n throw new Error(\"Role name cannot be empty\");\n }\n const roleDef = this.getRoleDef(name);\n if (roleDef != null) {\n throw new Error(\"Role already exists\");\n // roleDef.notesOnly = notesOnly;\n // return roleDef;\n }\n // create new and add\n const rd = new RoleDef();\n rd.name = name;\n rd.notesOnly = notesOnly;\n rd.index = this.roles.length;\n this.roles.push(rd);\n\n return rd;\n }\n\n get currRoleDef(): RoleDef | null {\n if (this._currRoleDef == null) {\n if (this.roles.length == 0) {\n return null;\n } else {\n this._currRoleDef = this.roles[this.roles.length - 1];\n }\n }\n return this._currRoleDef;\n }\n\n setCurrRole(name: string): void {\n name = name.trim().toLowerCase();\n if (name.trim() == \"\") {\n throw new Error(\"Role name cannot be empty\");\n }\n const roleDef = this.getRoleDef(name) || (this.onMissingRole ? this.onMissingRole(name) || null : null);\n if (roleDef == null) {\n throw new Error(\"Role not found: \" + name);\n }\n this._currRoleDef = roleDef;\n }\n\n // Gets the current line, creating it if needed\n private _currentLine: Line | null = null;\n get currentLine(): Line {\n if (this._currentLine == null) {\n return this.newLine();\n }\n return this._currentLine;\n }\n\n resetLine(): void {\n this._currentLine = null;\n }\n\n newLine(): Line {\n if (this._currentLine && this._currentLine.isEmpty) {\n // then remove it first instead of adding another\n // so we dont have a string of empty lines\n this.removeLine(this._currentLine);\n }\n this._currentLine = new Line();\n this.addLine(this._currentLine);\n return this._currentLine;\n }\n\n private _layoutParams: LayoutParams | null = null;\n resetLayoutParams(): void {\n this._layoutParams = null;\n this.resetLine();\n }\n\n get layoutParams(): LayoutParams {\n if (this._layoutParams == null) {\n // create it or find one that matches current params\n this._layoutParams = this.findUnnamedLayoutParams();\n if (this._layoutParams == null) {\n this._layoutParams = this.snapshotLayoutParams();\n this._unnamedLayoutParams.push(this._layoutParams);\n }\n }\n return this._layoutParams;\n }\n\n ensureNamedLayoutParams(name: string): LayoutParams {\n let lp = this._namedLayoutParams.get(name) || null;\n if (lp == null || this._layoutParams != lp) {\n // no change so go ahead\n if (lp == null) {\n // does not exist so create one by re-snapshotting it\n // and saving it\n lp = this.snapshotLayoutParams();\n this._namedLayoutParams.set(name, lp);\n } else {\n // copy named LPs attributes into our locals\n this.currentCycle = lp.cycle;\n this.currentAPB = lp.beatDuration;\n this.currentBreaks = lp.lineBreaks;\n }\n this._layoutParams = lp;\n this.resetLine(); // since layout params have changed\n }\n return this._layoutParams;\n }\n\n protected snapshotLayoutParams(): LayoutParams {\n return new LayoutParams({\n cycle: this.currentCycle,\n beatDuration: this.currentAPB,\n layout: this.currentBreaks,\n });\n }\n\n /**\n * Find a layout params that is currently _unnamed but matches one\n * by current set of layout attributes.\n */\n protected findUnnamedLayoutParams(): LayoutParams | null {\n return (\n this._unnamedLayoutParams.find((lp) => {\n return (\n lp.beatDuration == this.currentAPB &&\n this.currentCycle.equals(lp.cycle) &&\n lp.lineBreaksEqual(this.currentBreaks)\n );\n }) || null\n );\n }\n}\n"]}
1
+ {"version":3,"file":"notation.js","sourceRoot":"","sources":["../../src/notation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,OAAO;IAApB;QACE,SAAI,GAAG,EAAE,CAAC;QACV,cAAS,GAAG,KAAK,CAAC;QAClB,UAAK,GAAG,CAAC,CAAC;IACZ,CAAC;CAAA;AAGD,MAAM,OAAgB,OAAQ,SAAQ,MAAM;IAQ1C,YAAY,SAAqB,EAAE;QACjC,KAAK,EAAE,CAAC;QAPV,kBAAa,GAAG,KAAK,CAAC;QACtB,gBAAW,GAAmB,IAAI,CAAC;QACnC,gBAAW,GAAmB,IAAI,CAAC;QAMjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAKD,cAAc;IAEd,CAAC;I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AAa,CAAC,CACvC,CAAC;QACJ,CAAC,CAAC,IAAI,IAAI,CACX,CAAC;IACJ,CAAC;CACF","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { Entity } from \"./entity\";\nimport { Cycle } from \"./cycle\";\nimport { Line } from \"./core\";\nimport { LayoutParams } from \"./layouts\";\n\nexport class RoleDef {\n name = \"\";\n notesOnly = false;\n index = 0;\n}\n\nexport type CmdParam = { key: TSU.Nullable<string>; value: any };\nexport abstract class Command extends Entity {\n // Commands that are auto generated are usually created by other commands\n autoGenerated = false;\n prevSibling: null | Command = null;\n nextSibling: null | Command = null;\n params: CmdParam[];\n index: number;\n\n constructor(params: CmdParam[] = []) {\n super();\n this.params = params;\n this.index = 0;\n this.validateParams();\n }\n\n /**\n * called to validate parameters.\n */\n validateParams(): void {\n //\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n get type(): string {\n return \"Command\";\n }\n\n debugValue(): any {\n return { name: this.name, index: this.index, params: this.params };\n }\n\n getParam(name: string): any {\n for (const param of this.params) {\n if (param.key == name) return param.value;\n }\n return null;\n }\n\n getParamAt(index: number): any {\n return index < this.params.length ? this.params[index].value : null;\n }\n abstract applyToNotation(notebook: Notation): void;\n}\n\nexport class RawBlock extends Entity {\n constructor(public content: string, public contentType: string = \"md\") {\n super();\n }\n\n debugValue(): any {\n return { ...super.debugValue(), content: this.content, contentType: this.contentType };\n }\n}\n\nexport class MetaData {\n constructor(public readonly key: string, public readonly value: string, public readonly params?: any) {\n params = params || {};\n }\n}\n\nexport class Notation extends Entity {\n private _unnamedLayoutParams: LayoutParams[] = [];\n private _namedLayoutParams = new Map<string, LayoutParams>();\n private _currRoleDef: TSU.Nullable<RoleDef> = null;\n roles: RoleDef[] = [];\n blocks: (Line | RawBlock)[] = [];\n currentAPB = 1;\n currentCycle: Cycle = Cycle.DEFAULT;\n currentBreaks: number[] = [];\n metadata = new Map<string, MetaData>();\n onMissingRole: (name: string) => RoleDef | null = (name) => this.newRoleDef(name, name == \"sw\");\n\n get unnamedLayoutParams(): ReadonlyArray<LayoutParams> {\n return this._unnamedLayoutParams;\n }\n\n get namedLayoutParams(): ReadonlyMap<string, LayoutParams> {\n return this._namedLayoutParams;\n }\n\n get type(): unknown {\n return \"Notation\";\n }\n\n addLine(line: Line): void {\n this.blocks.push(line);\n }\n\n removeLine(line: Line): number {\n const index = this.blocks.findIndex((l) => l == line);\n if (index >= 0) {\n this.blocks.splice(index, 1);\n }\n return index;\n }\n\n addRawBlock(raw: RawBlock): void {\n this.blocks.push(raw);\n this.resetLine();\n }\n\n addMetaData(meta: MetaData): void {\n if (!this.metadata.has(meta.key)) {\n // Add a new raw block here\n // set this by key so even if metadata changes we can\n // get latest value of it\n const raw = new RawBlock(meta.key, \"metadata\");\n this.addRawBlock(raw);\n }\n this.metadata.set(meta.key, meta);\n }\n\n debugValue(): any {\n return {\n ...super.debugValue,\n roles: this.roles,\n blocks: this.blocks.map((b) => b.debugValue()),\n currentAPB: this.currentAPB,\n currentCycle: this.currentCycle?.uuid,\n currentBreaks: this.currentBreaks,\n };\n }\n\n getRoleDef(name: string): TSU.Nullable<RoleDef> {\n name = name.trim().toLowerCase();\n if (name == \"\") {\n return this.roles[this.roles.length - 1] || null;\n }\n for (let i = 0; i < this.roles.length; i++) {\n const rd = this.roles[i];\n if (name == rd.name) return rd;\n }\n return null;\n }\n\n newRoleDef(name: string, notesOnly = false): RoleDef {\n name = name.trim().toLowerCase();\n if (name.trim() == \"\") {\n throw new Error(\"Role name cannot be empty\");\n }\n const roleDef = this.getRoleDef(name);\n if (roleDef != null) {\n throw new Error(\"Role already exists\");\n // roleDef.notesOnly = notesOnly;\n // return roleDef;\n }\n // create new and add\n const rd = new RoleDef();\n rd.name = name;\n rd.notesOnly = notesOnly;\n rd.index = this.roles.length;\n this.roles.push(rd);\n\n return rd;\n }\n\n get currRoleDef(): RoleDef | null {\n if (this._currRoleDef == null) {\n if (this.roles.length == 0) {\n return null;\n } else {\n this._currRoleDef = this.roles[this.roles.length - 1];\n }\n }\n return this._currRoleDef;\n }\n\n setCurrRole(name: string): void {\n name = name.trim().toLowerCase();\n if (name.trim() == \"\") {\n throw new Error(\"Role name cannot be empty\");\n }\n const roleDef = this.getRoleDef(name) || (this.onMissingRole ? this.onMissingRole(name) || null : null);\n if (roleDef == null) {\n throw new Error(\"Role not found: \" + name);\n }\n this._currRoleDef = roleDef;\n }\n\n // Gets the current line, creating it if needed\n private _currentLine: Line | null = null;\n get currentLine(): Line {\n if (this._currentLine == null) {\n return this.newLine();\n }\n return this._currentLine;\n }\n\n resetLine(): void {\n this._currentLine = null;\n }\n\n newLine(): Line {\n if (this._currentLine && this._currentLine.isEmpty) {\n // then remove it first instead of adding another\n // so we dont have a string of empty lines\n this.removeLine(this._currentLine);\n }\n this._currentLine = new Line();\n this.addLine(this._currentLine);\n return this._currentLine;\n }\n\n private _layoutParams: LayoutParams | null = null;\n resetLayoutParams(): void {\n this._layoutParams = null;\n this.resetLine();\n }\n\n get layoutParams(): LayoutParams {\n if (this._layoutParams == null) {\n // create it or find one that matches current params\n this._layoutParams = this.findUnnamedLayoutParams();\n if (this._layoutParams == null) {\n this._layoutParams = this.snapshotLayoutParams();\n this._unnamedLayoutParams.push(this._layoutParams);\n }\n }\n return this._layoutParams;\n }\n\n ensureNamedLayoutParams(name: string): LayoutParams {\n let lp = this._namedLayoutParams.get(name) || null;\n if (lp == null || this._layoutParams != lp) {\n // no change so go ahead\n if (lp == null) {\n // does not exist so create one by re-snapshotting it\n // and saving it\n lp = this.snapshotLayoutParams();\n this._namedLayoutParams.set(name, lp);\n } else {\n // copy named LPs attributes into our locals\n this.currentCycle = lp.cycle;\n this.currentAPB = lp.beatDuration;\n this.currentBreaks = lp.lineBreaks;\n }\n this._layoutParams = lp;\n this.resetLine(); // since layout params have changed\n }\n return this._layoutParams;\n }\n\n protected snapshotLayoutParams(): LayoutParams {\n return new LayoutParams({\n cycle: this.currentCycle,\n beatDuration: this.currentAPB,\n layout: this.currentBreaks,\n });\n }\n\n /**\n * Find a layout params that is currently _unnamed but matches one\n * by current set of layout attributes.\n */\n protected findUnnamedLayoutParams(): LayoutParams | null {\n return (\n this._unnamedLayoutParams.find((lp) => {\n return (\n lp.beatDuration == this.currentAPB &&\n this.currentCycle.equals(lp.cycle) &&\n lp.lineBreaksEqual(this.currentBreaks)\n );\n }) || null\n );\n }\n}\n"]}
@@ -18,6 +18,8 @@ export declare class Parser {
18
18
  newRest: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => Rest;
19
19
  newDoubleSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => Space;
20
20
  newSilentSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => Space;
21
+ applyPreMarker: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => Atom;
22
+ applyPostMarker: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => Atom;
21
23
  applyDuration: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => Atom;
22
24
  newArray: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => any[];
23
25
  concatAtoms: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => any;