notations 0.0.30 → 0.0.34

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/lib/cjs/carnatic/atomviews.d.ts +4 -6
  2. package/lib/cjs/carnatic/atomviews.js +68 -61
  3. package/lib/cjs/carnatic/atomviews.js.map +1 -1
  4. package/lib/cjs/carnatic/beatviews.d.ts +3 -7
  5. package/lib/cjs/carnatic/beatviews.js +23 -53
  6. package/lib/cjs/carnatic/beatviews.js.map +1 -1
  7. package/lib/cjs/carnatic/embelishments.d.ts +13 -9
  8. package/lib/cjs/carnatic/embelishments.js +94 -49
  9. package/lib/cjs/carnatic/embelishments.js.map +1 -1
  10. package/lib/cjs/carnatic/gamakas.js.map +1 -1
  11. package/lib/cjs/carnatic/index.js.map +1 -1
  12. package/lib/cjs/commands.js.map +1 -1
  13. package/lib/cjs/core.d.ts +0 -9
  14. package/lib/cjs/core.js +1 -48
  15. package/lib/cjs/core.js.map +1 -1
  16. package/lib/cjs/index.js.map +1 -1
  17. package/lib/cjs/iterators.js.map +1 -1
  18. package/lib/cjs/layouts.js +8 -2
  19. package/lib/cjs/layouts.js.map +1 -1
  20. package/lib/cjs/loader.js.map +1 -1
  21. package/lib/cjs/notation.js.map +1 -1
  22. package/lib/cjs/parser.js.map +1 -1
  23. package/lib/cjs/shapes.d.ts +34 -19
  24. package/lib/cjs/shapes.js +164 -67
  25. package/lib/cjs/shapes.js.map +1 -1
  26. package/lib/cjs/utils.js.map +1 -1
  27. package/lib/esm/carnatic/atomviews.d.ts +4 -6
  28. package/lib/esm/carnatic/atomviews.js +68 -61
  29. package/lib/esm/carnatic/atomviews.js.map +1 -1
  30. package/lib/esm/carnatic/beatviews.d.ts +3 -7
  31. package/lib/esm/carnatic/beatviews.js +23 -53
  32. package/lib/esm/carnatic/beatviews.js.map +1 -1
  33. package/lib/esm/carnatic/embelishments.d.ts +13 -9
  34. package/lib/esm/carnatic/embelishments.js +94 -49
  35. package/lib/esm/carnatic/embelishments.js.map +1 -1
  36. package/lib/esm/carnatic/gamakas.js.map +1 -1
  37. package/lib/esm/carnatic/index.js.map +1 -1
  38. package/lib/esm/commands.js.map +1 -1
  39. package/lib/esm/core.d.ts +0 -9
  40. package/lib/esm/core.js +0 -47
  41. package/lib/esm/core.js.map +1 -1
  42. package/lib/esm/index.js.map +1 -1
  43. package/lib/esm/iterators.js.map +1 -1
  44. package/lib/esm/layouts.js +8 -2
  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.d.ts +34 -19
  50. package/lib/esm/shapes.js +164 -67
  51. package/lib/esm/shapes.js.map +1 -1
  52. package/lib/esm/utils.js.map +1 -1
  53. package/package.json +7 -4
@@ -9,11 +9,10 @@ export declare abstract class LeafAtomView extends AtomView {
9
9
  protected postSpacingSpan: SVGTSpanElement;
10
10
  protected rootShape: ElementShape;
11
11
  abstract get glyphLabel(): string;
12
- protected refreshBBox(): TSU.Geom.Rect;
13
- get minSize(): TSU.Geom.Size;
14
- currX: number;
15
- currY: number;
16
- protected updatePosition(x: null | number, y: null | number): [number | null, number | null];
12
+ protected refreshMinSize(): TSU.Geom.Size;
13
+ protected updateBounds(x: null | number, y: null | number, w: null | number, h: null | number): [number | null, number | null, number | null, number | null];
14
+ refreshLayout(): void;
15
+ protected addEmbelishment(slot: Embelishment[], emb: Embelishment): void;
17
16
  orderEmbelishments(): void;
18
17
  needsRootElement(): boolean;
19
18
  createElements(parent: SVGGraphicsElement): void;
@@ -21,6 +20,5 @@ export declare abstract class LeafAtomView extends AtomView {
21
20
  protected createPostSpacingElement(): void;
22
21
  protected moveGlyphToRoot(): void;
23
22
  protected createGlyphElement(parent: SVGGraphicsElement): void;
24
- refreshLayout(): void;
25
23
  }
26
24
  export declare function createAtomView(parent: SVGGraphicsElement, atom: FlatAtom): AtomView;
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
17
28
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
29
  if (k2 === undefined) k2 = k;
19
30
  Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
@@ -59,43 +70,37 @@ var LeafAtomView = (function (_super) {
59
70
  _this.topSlot = [];
60
71
  _this.rightSlot = [];
61
72
  _this.bottomSlot = [];
62
- _this.currX = 0;
63
- _this.currY = 0;
64
73
  return _this;
65
74
  }
66
- LeafAtomView.prototype.refreshBBox = function () {
67
- return this.glyph.bbox;
75
+ LeafAtomView.prototype.refreshMinSize = function () {
76
+ var out = __assign({}, (this.rootShape || this.glyph).minSize);
77
+ var totalWidth = this.leftSlot.reduce(function (a, b) { return a + b.minSize.width; }, 0) +
78
+ this.rightSlot.reduce(function (a, b) { return a + b.minSize.width; }, 0) +
79
+ this.leftSlot.length +
80
+ this.rightSlot.length;
81
+ var totalHeight = this.topSlot.reduce(function (a, b) { return a + b.minSize.height; }, 0) +
82
+ this.bottomSlot.reduce(function (a, b) { return a + b.minSize.height; }, 0);
83
+ out.width += totalWidth;
84
+ out.height += totalHeight;
85
+ return out;
68
86
  };
69
- Object.defineProperty(LeafAtomView.prototype, "minSize", {
70
- get: function () {
71
- var out = TSU.Geom.Rect.from((this.rootShape || this.glyph).bbox);
72
- var totalWidth = this.leftSlot.reduce(function (a, b) { return a + b.bbox.width; }, 0) +
73
- this.rightSlot.reduce(function (a, b) { return a + b.bbox.width; }, 0) +
74
- this.leftSlot.length +
75
- this.rightSlot.length;
76
- var totalHeight = this.topSlot.reduce(function (a, b) { return a + b.bbox.height; }, 0) + this.bottomSlot.reduce(function (a, b) { return a + b.bbox.height; }, 0);
77
- out.width += totalWidth;
78
- out.height += totalHeight;
79
- if (this.postSpacingSpan)
80
- out.width += this.postSpacingSpan.getBBox().width;
81
- return out;
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- LeafAtomView.prototype.updatePosition = function (x, y) {
87
+ LeafAtomView.prototype.updateBounds = function (x, y, w, h) {
88
+ return [x, y, NaN, NaN];
89
+ };
90
+ LeafAtomView.prototype.refreshLayout = function () {
87
91
  var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
88
- if (y != null) {
89
- this.glyph.moveTo(null, y);
90
- this.currY = y;
91
- }
92
- if (x != null) {
93
- this.currX = x;
92
+ var x = this.x;
93
+ var y = this.y;
94
+ this.glyph.setBounds(null, y, null, null, true);
95
+ var currX = x;
96
+ var currY = y;
97
+ if (currX != null) {
94
98
  try {
95
99
  for (var _e = __values(this.leftSlot), _f = _e.next(); !_f.done; _f = _e.next()) {
96
100
  var emb = _f.value;
97
- emb.x = x;
98
- x += emb.bbox.width + 1;
101
+ emb.x = currX;
102
+ emb.refreshLayout();
103
+ currX += emb.minSize.width + 1;
99
104
  }
100
105
  }
101
106
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -106,15 +111,16 @@ var LeafAtomView = (function (_super) {
106
111
  finally { if (e_1) throw e_1.error; }
107
112
  }
108
113
  var glyphRoot = this.rootShape || this.glyph;
109
- glyphRoot.x = x;
110
- x += glyphRoot.bbox.width;
111
- if (this.rootShape)
112
- this.glyph.reset();
114
+ console.log("Glyph Root: ", glyphRoot);
115
+ glyphRoot.x = currX;
116
+ glyphRoot.refreshLayout();
117
+ currX += glyphRoot.minSize.width;
113
118
  try {
114
119
  for (var _g = __values(this.rightSlot), _h = _g.next(); !_h.done; _h = _g.next()) {
115
120
  var emb = _h.value;
116
- emb.x = x;
117
- x += emb.bbox.width + 1;
121
+ emb.x = currX;
122
+ emb.refreshLayout();
123
+ currX += emb.minSize.width + 1;
118
124
  }
119
125
  }
120
126
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -125,16 +131,17 @@ var LeafAtomView = (function (_super) {
125
131
  finally { if (e_2) throw e_2.error; }
126
132
  }
127
133
  }
128
- if (x != null || y != null) {
129
- var gbbox = this.glyph.bbox;
130
- var y_1 = gbbox.y - 1;
134
+ if (currX != null || currY != null) {
135
+ var gminSize = this.glyph.minSize;
136
+ var glyphX = this.glyph.x;
137
+ var glyphY = this.glyph.y;
138
+ currY = glyphY - 1;
131
139
  try {
132
140
  for (var _j = __values(this.topSlot), _k = _j.next(); !_k.done; _k = _j.next()) {
133
141
  var emb = _k.value;
134
- var bb = emb.bbox;
135
- emb.x = gbbox.x + (gbbox.width - bb.width) / 2;
136
- emb.y = y_1 - bb.height;
137
- y_1 = emb.y;
142
+ var bb = emb.minSize;
143
+ emb.setBounds(glyphX + (gminSize.width - bb.width) / 2, currY - bb.height, null, null, true);
144
+ currY = emb.y;
138
145
  }
139
146
  }
140
147
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
@@ -144,14 +151,13 @@ var LeafAtomView = (function (_super) {
144
151
  }
145
152
  finally { if (e_3) throw e_3.error; }
146
153
  }
147
- y_1 = gbbox.y + gbbox.height + 2;
154
+ currY = glyphY + gminSize.height + 2;
148
155
  try {
149
156
  for (var _l = __values(this.bottomSlot), _m = _l.next(); !_m.done; _m = _l.next()) {
150
157
  var emb = _m.value;
151
- var bb = emb.bbox;
152
- emb.x = gbbox.x + (gbbox.width - bb.width) / 2;
153
- emb.y = y_1;
154
- y_1 = emb.y + bb.height;
158
+ var bb = emb.minSize;
159
+ emb.setBounds(glyphX + (gminSize.width - bb.width) / 2, currY, null, null, true);
160
+ currY = emb.y + bb.height;
155
161
  }
156
162
  }
157
163
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
@@ -162,7 +168,10 @@ var LeafAtomView = (function (_super) {
162
168
  finally { if (e_4) throw e_4.error; }
163
169
  }
164
170
  }
165
- return [this.currX, this.currY];
171
+ };
172
+ LeafAtomView.prototype.addEmbelishment = function (slot, emb) {
173
+ slot.push(emb);
174
+ this.addShape(emb);
166
175
  };
167
176
  LeafAtomView.prototype.orderEmbelishments = function () {
168
177
  var e_5, _a;
@@ -178,35 +187,35 @@ var LeafAtomView = (function (_super) {
178
187
  var emb = _c.value;
179
188
  switch (emb.type) {
180
189
  case gamakas_1.GamakaType.Kampitham:
181
- this.topSlot.push(new embelishments_1.Kampitham(this));
190
+ this.addEmbelishment(this.topSlot, new embelishments_1.Kampitham(this));
182
191
  break;
183
192
  case gamakas_1.GamakaType.Nokku:
184
- this.topSlot.push(new embelishments_1.Nokku(this));
193
+ this.addEmbelishment(this.topSlot, new embelishments_1.Nokku(this));
185
194
  break;
186
195
  case gamakas_1.GamakaType.Spuritham:
187
- this.topSlot.push(new embelishments_1.Spuritham(this));
196
+ this.addEmbelishment(this.topSlot, new embelishments_1.Spuritham(this));
188
197
  break;
189
198
  case gamakas_1.GamakaType.Prathyagatham:
190
- this.topSlot.push(new embelishments_1.Prathyagatham(this));
199
+ this.addEmbelishment(this.topSlot, new embelishments_1.Prathyagatham(this));
191
200
  break;
192
201
  case gamakas_1.GamakaType.Orikkai:
193
- this.topSlot.push(new embelishments_1.Orikkai(this));
202
+ this.addEmbelishment(this.topSlot, new embelishments_1.Orikkai(this));
194
203
  break;
195
204
  case gamakas_1.GamakaType.Odukkal:
196
- this.topSlot.push(new embelishments_1.Odukkal(this));
205
+ this.addEmbelishment(this.topSlot, new embelishments_1.Odukkal(this));
197
206
  break;
198
207
  case gamakas_1.GamakaType.Aahaatam_Raavi:
199
- this.topSlot.push(new embelishments_1.Raavi(this));
208
+ this.addEmbelishment(this.topSlot, new embelishments_1.Raavi(this));
200
209
  break;
201
210
  case gamakas_1.GamakaType.Aahaatam_Kandippu:
202
- this.topSlot.push(new embelishments_1.Kandippu(this));
211
+ this.addEmbelishment(this.topSlot, new embelishments_1.Kandippu(this));
203
212
  break;
204
213
  case gamakas_1.GamakaType.Vaali:
205
- this.topSlot.push(new embelishments_1.Vaali(this));
214
+ this.addEmbelishment(this.topSlot, new embelishments_1.Vaali(this));
206
215
  break;
207
216
  case gamakas_1.GamakaType.Jaaru_Eetra:
208
217
  case gamakas_1.GamakaType.Jaaru_Irakka:
209
- this.leftSlot.push(new embelishments_1.Jaaru(emb, this));
218
+ this.addEmbelishment(this.leftSlot, new embelishments_1.Jaaru(emb, this));
210
219
  break;
211
220
  }
212
221
  }
@@ -276,8 +285,6 @@ var LeafAtomView = (function (_super) {
276
285
  text: this.glyphLabel,
277
286
  }));
278
287
  };
279
- LeafAtomView.prototype.refreshLayout = function () {
280
- };
281
288
  return LeafAtomView;
282
289
  }(shapes_1.AtomView));
283
290
  exports.LeafAtomView = LeafAtomView;
@@ -1 +1 @@
1
- {"version":3,"file":"atomviews.js","sourceRoot":"","sources":["../../../src/carnatic/atomviews.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAuC;AACvC,gCAAmE;AACnE,oCAAiE;AAEjE,iDAYyB;AACzB,qCAAuC;AAEvC;IAA2C,gCAAQ;IAAnD;QAAA,qEAwNC;QAvNC,cAAQ,GAAmB,EAAE,CAAC;QAC9B,aAAO,GAAmB,EAAE,CAAC;QAC7B,eAAS,GAAmB,EAAE,CAAC;QAC/B,gBAAU,GAAmB,EAAE,CAAC;QA8BhC,WAAK,GAAG,CAAC,CAAC;QACV,WAAK,GAAG,CAAC,CAAC;;IAqLZ,CAAC;IAzMW,kCAAW,GAArB;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,sBAAI,iCAAO;aAAX;YACE,IAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SA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B;QACE,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,+BAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;SACpD;aAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,+BAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;SACvD;QACD,iBAAM,kBAAkB,WAAE,CAAC;IAC7B,CAAC;IAED,sBAAI,0BAAI;aAAR;YACE,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAY,CAAC;QACpC,CAAC;;;OAAA;IACH,eAAC;AAAD,CAAC,AAhDD,CAAuB,YAAY,GAgDlC;AAED;IAA2B,gCAAY;IAAvC;;IAQA,CAAC;IAPC,sBAAI,oCAAU;aAAd;YACE,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC7B,CAAC;;;OAAA;IAED,sBAAI,kCAAQ;aAAZ;YACE,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAgB,CAAC;QACxC,CAAC;;;OAAA;IACH,mBAAC;AAAD,CAAC,AARD,CAA2B,YAAY,GAQtC","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { Literal, AtomType, Note, Space, Syllable } from \"../core\";\nimport { AtomView, Embelishment, ElementShape } from \"../shapes\";\nimport { FlatAtom } from \"../iterators\";\nimport {\n OctaveIndicator,\n Kampitham,\n Nokku,\n Spuritham,\n Prathyagatham,\n Orikkai,\n Odukkal,\n Raavi,\n Kandippu,\n Vaali,\n Jaaru,\n} from \"./embelishments\";\nimport { GamakaType } from \"./gamakas\";\n\nexport abstract class LeafAtomView extends AtomView {\n leftSlot: Embelishment[] = [];\n topSlot: Embelishment[] = [];\n rightSlot: Embelishment[] = [];\n bottomSlot: Embelishment[] = [];\n\n // Spaces required before and after to accomodate for left and right slots\n protected postSpacingSpan: SVGTSpanElement;\n // Sometimes this.element may not be the root element if we need spacings\n // the rootElement is the top of the chain\n protected rootShape: ElementShape;\n\n abstract get glyphLabel(): string;\n\n protected refreshMinSize(): TSU.Geom.Size {\n const out = { ...(this.rootShape || this.glyph).minSize };\n const totalWidth =\n this.leftSlot.reduce((a, b) => a + b.minSize.width, 0) +\n this.rightSlot.reduce((a, b) => a + b.minSize.width, 0) +\n this.leftSlot.length + // Padding of 1\n this.rightSlot.length; // Padding of 1\n const totalHeight =\n this.topSlot.reduce((a, b) => a + b.minSize.height, 0) +\n this.bottomSlot.reduce((a, b) => a + b.minSize.height, 0);\n out.width += totalWidth;\n out.height += totalHeight;\n // if (this.postSpacingSpan) out.width += this.postSpacingSpan.getBBox().width;\n return out;\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, y, NaN, NaN];\n }\n\n refreshLayout(): void {\n // TODO - move this code out to refreshLayout?\n // set the glyphs Y first so we can layout others\n const x = this.x;\n const y = this.y;\n this.glyph.setBounds(null, y, null, null, true);\n\n // now layout leftSlots\n let currX = x;\n let currY = y;\n if (currX != null) {\n // place left embelishments\n for (const emb of this.leftSlot) {\n emb.x = currX;\n emb.refreshLayout();\n currX += emb.minSize.width + 1;\n }\n\n // now place the glyph\n const glyphRoot = this.rootShape || this.glyph;\n console.log(\"Glyph Root: \", glyphRoot);\n glyphRoot.x = currX;\n glyphRoot.refreshLayout();\n currX += glyphRoot.minSize.width;\n\n // And right embelishments\n for (const emb of this.rightSlot) {\n emb.x = currX;\n emb.refreshLayout();\n currX += emb.minSize.width + 1;\n }\n\n // now the spacing span\n // if (this.postSpacingSpan) { this.postSpacingSpan.setAttribute(\"x\", \"\" + x); }\n }\n\n // layout top and bottom if x or y has changed\n if (currX != null || currY != null) {\n const gminSize = this.glyph.minSize;\n\n // top embelishments\n const glyphX = this.glyph.x;\n const glyphY = this.glyph.y;\n currY = glyphY - 1;\n for (const emb of this.topSlot) {\n const bb = emb.minSize;\n emb.setBounds(glyphX + (gminSize.width - bb.width) / 2, currY - bb.height, null, null, true);\n currY = emb.y;\n }\n\n // bottom embelishments\n currY = glyphY + gminSize.height + 2;\n for (const emb of this.bottomSlot) {\n const bb = emb.minSize;\n emb.setBounds(glyphX + (gminSize.width - bb.width) / 2, currY, null, null, true);\n currY = emb.y + bb.height;\n }\n }\n }\n\n protected addEmbelishment(slot: Embelishment[], emb: Embelishment): void {\n slot.push(emb);\n this.addShape(emb);\n }\n\n /**\n * Orders embelishments and creates their views.\n */\n orderEmbelishments(): void {\n const atom = this.flatAtom.atom;\n if (atom.type != AtomType.SYLLABLE && atom.type != AtomType.NOTE) {\n return;\n }\n const lit = atom as Literal;\n if (lit.embelishments.length == 0) return;\n for (const emb of lit.embelishments) {\n switch (emb.type) {\n case GamakaType.Kampitham:\n this.addEmbelishment(this.topSlot, new Kampitham(this));\n break;\n case GamakaType.Nokku:\n this.addEmbelishment(this.topSlot, new Nokku(this));\n break;\n case GamakaType.Spuritham:\n this.addEmbelishment(this.topSlot, new Spuritham(this));\n break;\n case GamakaType.Prathyagatham:\n this.addEmbelishment(this.topSlot, new Prathyagatham(this));\n break;\n case GamakaType.Orikkai:\n this.addEmbelishment(this.topSlot, new Orikkai(this));\n break;\n case GamakaType.Odukkal:\n this.addEmbelishment(this.topSlot, new Odukkal(this));\n break;\n case GamakaType.Aahaatam_Raavi:\n this.addEmbelishment(this.topSlot, new Raavi(this));\n break;\n case GamakaType.Aahaatam_Kandippu:\n this.addEmbelishment(this.topSlot, new Kandippu(this));\n break;\n case GamakaType.Vaali:\n this.addEmbelishment(this.topSlot, new Vaali(this));\n break;\n case GamakaType.Jaaru_Eetra:\n case GamakaType.Jaaru_Irakka:\n this.addEmbelishment(this.leftSlot, new Jaaru(emb, this));\n break;\n }\n }\n }\n\n needsRootElement(): boolean {\n return this.rightSlot.length > 0 || this.flatAtom.atom.beforeRest;\n }\n\n createElements(parent: SVGGraphicsElement): void {\n // Create the glyph element first before anything\n // this allows embelishments to get early access to this element\n if (this.needsRootElement()) {\n this.createGlyphRoot(parent);\n }\n this.createGlyphElement(this.rootShape?.element || parent);\n\n // Order embelishments (without creating any views)\n this.orderEmbelishments();\n if (this.needsRootElement()) {\n // create as 2 sub span elements\n if (!this.rootShape) {\n this.createGlyphRoot(parent);\n // move the element into the parent\n this.moveGlyphToRoot();\n }\n\n this.createPostSpacingElement();\n }\n }\n\n protected createGlyphRoot(parent: SVGGraphicsElement): void {\n this.rootShape = new ElementShape(\n TSU.DOM.createSVGNode(\"tspan\", {\n doc: document,\n parent: parent,\n attrs: {\n depth: this.flatAtom.depth || 0,\n atomid: this.flatAtom.atom.uuid,\n id: \"atomViewRoot\" + this.flatAtom.atom.uuid,\n },\n }),\n );\n }\n\n protected createPostSpacingElement(): void {\n this.postSpacingSpan = TSU.DOM.createSVGNode(\"tspan\", {\n doc: document,\n parent: this.rootShape.element,\n attrs: {\n depth: this.flatAtom.depth || 0,\n atomid: this.flatAtom.atom.uuid,\n id: \"postSpacing\" + this.flatAtom.atom.uuid,\n },\n text: this.flatAtom.atom.beforeRest ? \" - \" : \" \",\n });\n }\n\n protected moveGlyphToRoot(): void {\n this.rootShape.element.appendChild(this.glyph.element);\n }\n\n protected createGlyphElement(parent: SVGGraphicsElement): void {\n const atom = this.flatAtom.atom;\n this.glyph = new ElementShape(\n TSU.DOM.createSVGNode(\"tspan\", {\n doc: document,\n parent: parent,\n attrs: {\n depth: this.flatAtom.depth || 0,\n atomid: atom.uuid,\n id: \"atom\" + atom.uuid,\n },\n text: this.glyphLabel, // + (note.beforeRest ? \" - \" : \" \"),\n }),\n );\n }\n}\n\nexport function createAtomView(parent: SVGGraphicsElement, atom: FlatAtom): AtomView {\n let out: AtomView;\n switch (atom.atom.type) {\n // Dealing with leaf atoms\n case AtomType.SPACE:\n out = new SpaceView(atom);\n break;\n case AtomType.SYLLABLE:\n out = new SyllableView(atom);\n break;\n case AtomType.NOTE:\n out = new NoteView(atom);\n break;\n default:\n // We should never get a group as we are iterating\n // at leaf atom levels\n throw new Error(\"Invalid atom type: \" + atom.atom.type);\n }\n out.createElements(parent);\n return out;\n}\n\nclass SpaceView extends LeafAtomView {\n get glyphLabel(): string {\n return this.space.isSilent ? \" \" : \",\";\n }\n\n get space(): Space {\n return this.flatAtom.atom as Space;\n }\n}\n\nclass NoteView extends LeafAtomView {\n protected shiftElement: SVGTSpanElement;\n get glyphLabel(): string {\n return this.note.value;\n }\n\n needsRootElement(): boolean {\n return this.note.shift == true || this.note.shift != 0 || super.needsRootElement();\n }\n\n protected createGlyphElement(parent: SVGGraphicsElement): void {\n super.createGlyphElement(parent);\n if (this.note.shift == true || this.note.shift != 0) {\n this.shiftElement = TSU.DOM.createSVGNode(\"tspan\", {\n doc: document,\n parent: this.rootShape.element,\n attrs: {\n depth: this.flatAtom.depth || 0,\n atomid: this.note.uuid,\n id: \"noteShift\" + this.note.uuid,\n \"baseline-shift\": \"sub\",\n },\n text: (this.note.shift == true ? \"*\" : this.note.shift) + \" \",\n });\n }\n }\n\n protected moveGlyphToRoot(): void {\n super.moveGlyphToRoot();\n if (this.shiftElement) {\n this.rootShape.element.appendChild(this.shiftElement);\n }\n }\n\n orderEmbelishments(): void {\n const note = this.note;\n // create the embelishments if needed\n if (note.octave > 0) {\n this.topSlot.push(new OctaveIndicator(this, note));\n } else if (this.note.octave < 0) {\n this.bottomSlot.push(new OctaveIndicator(this, note));\n }\n super.orderEmbelishments();\n }\n\n get note(): Note {\n return this.flatAtom.atom as Note;\n }\n}\n\nclass SyllableView extends LeafAtomView {\n get glyphLabel(): string {\n return this.syllable.value;\n }\n\n get syllable(): Syllable {\n return this.flatAtom.atom as Syllable;\n }\n}\n"]}
@@ -10,15 +10,11 @@ export declare class BeatView extends Shape implements BeatViewBase {
10
10
  private _embelishments;
11
11
  private atomViews;
12
12
  groupElement: SVGGElement;
13
- rootElement: SVGTextElement;
13
+ textElement: SVGTextElement;
14
14
  constructor(beat: Beat, rootElement: Element, cycle: Cycle, config?: any);
15
- protected _width: number;
16
- get width(): number;
17
- set width(value: number);
18
- refreshBBox(): TSU.Geom.Rect;
19
- protected updatePosition(x: null | number, y: null | number): [number | null, number | null];
15
+ protected refreshMinSize(): TSU.Geom.Size;
16
+ protected updateBounds(x: null | number, y: null | number, w: null | number, h: null | number): [number | null, number | null, number | null, number | null];
20
17
  setStyles(config: any): void;
21
18
  refreshLayout(): void;
22
- get minSize(): TSU.Geom.Size;
23
19
  get embelishments(): Embelishment[];
24
20
  }
@@ -72,7 +72,7 @@ var BeatView = (function (_super) {
72
72
  beatIndex: beat.index,
73
73
  },
74
74
  });
75
- _this.rootElement = TSU.DOM.createSVGNode("text", {
75
+ _this.textElement = TSU.DOM.createSVGNode("text", {
76
76
  parent: _this.groupElement,
77
77
  attrs: {
78
78
  class: "roleAtomsText",
@@ -98,7 +98,7 @@ var BeatView = (function (_super) {
98
98
  }
99
99
  flatAtom.atom.beforeRest = lit.beforeRest;
100
100
  }
101
- var atomView = (0, atomviews_1.createAtomView)(_this.rootElement, flatAtom);
101
+ var atomView = (0, atomviews_1.createAtomView)(_this.textElement, flatAtom);
102
102
  atomView.depth = flatAtom.depth;
103
103
  _this.atomViews.push(atomView);
104
104
  }
@@ -111,28 +111,21 @@ var BeatView = (function (_super) {
111
111
  finally { if (e_1) throw e_1.error; }
112
112
  }
113
113
  _this.setStyles(config || {});
114
- _this._bbox = _this.refreshBBox();
115
- _this._width = -1;
116
114
  return _this;
117
115
  }
118
- Object.defineProperty(BeatView.prototype, "width", {
119
- get: function () {
120
- return this._width < 0 ? this.bbox.width : this._width;
121
- },
122
- set: function (value) {
123
- if (this._width != value) {
124
- this._width = value;
125
- this.widthChanged = true;
126
- }
127
- },
128
- enumerable: false,
129
- configurable: true
130
- });
131
- BeatView.prototype.refreshBBox = function () {
132
- return TSU.Geom.Rect.from(this.rootElement.getBBox());
116
+ BeatView.prototype.refreshMinSize = function () {
117
+ var _this = this;
118
+ var totalWidth = 0;
119
+ var maxHeight = 0;
120
+ this.atomViews.forEach(function (av, index) {
121
+ var ms = av.minSize;
122
+ totalWidth += ms.width + _this.atomSpacing;
123
+ maxHeight = Math.max(maxHeight, ms.height);
124
+ });
125
+ return new TSU.Geom.Size(totalWidth, maxHeight);
133
126
  };
134
- BeatView.prototype.updatePosition = function (x, y) {
135
- return [x, y];
127
+ BeatView.prototype.updateBounds = function (x, y, w, h) {
128
+ return [x, y, w, h];
136
129
  };
137
130
  BeatView.prototype.setStyles = function (config) {
138
131
  if ("atomSpacing" in config)
@@ -142,20 +135,14 @@ var BeatView = (function (_super) {
142
135
  BeatView.prototype.refreshLayout = function () {
143
136
  var e_2, _a;
144
137
  var _this = this;
145
- if (this.xChanged) {
146
- this.rootElement.setAttribute("x", this.x + "");
147
- }
148
- if (this.yChanged) {
149
- this.rootElement.setAttribute("y", this.y + "");
150
- }
151
- if (this.widthChanged) {
152
- var currX_1 = this.x;
153
- this.atomViews.forEach(function (av, index) {
154
- av.moveTo(currX_1, _this.y);
155
- currX_1 += _this.atomSpacing + av.minSize.width;
156
- });
157
- this.reset();
158
- }
138
+ this.groupElement.setAttribute("transform", "translate(" + this.x + "," + this.y + ")");
139
+ var currX = 0;
140
+ var currY = 0;
141
+ this.atomViews.forEach(function (av, index) {
142
+ av.setBounds(currX, currY, null, null, true);
143
+ currX += _this.atomSpacing + av.minSize.width;
144
+ });
145
+ this.resetMinSize();
159
146
  try {
160
147
  for (var _b = __values(this.embelishments), _c = _b.next(); !_c.done; _c = _b.next()) {
161
148
  var e = _c.value;
@@ -169,31 +156,14 @@ var BeatView = (function (_super) {
169
156
  }
170
157
  finally { if (e_2) throw e_2.error; }
171
158
  }
172
- this.xChanged = this.yChanged = false;
173
- this.widthChanged = this.heightChanged = false;
174
159
  this.needsLayout = false;
175
160
  };
176
- Object.defineProperty(BeatView.prototype, "minSize", {
177
- get: function () {
178
- var _this = this;
179
- var totalWidth = 0;
180
- var maxHeight = 0;
181
- this.atomViews.forEach(function (av, index) {
182
- var ms = av.minSize;
183
- totalWidth += ms.width + _this.atomSpacing;
184
- maxHeight = Math.max(maxHeight, ms.height);
185
- });
186
- return new TSU.Geom.Size(totalWidth, maxHeight);
187
- },
188
- enumerable: false,
189
- configurable: true
190
- });
191
161
  Object.defineProperty(BeatView.prototype, "embelishments", {
192
162
  get: function () {
193
163
  if (!this._embelishments) {
194
164
  this._embelishments = [];
195
165
  var beat = this.beat;
196
- var rootElement = this.rootElement.parentElement;
166
+ var rootElement = this.textElement.parentElement;
197
167
  if (beat.beatIndex == 0 && beat.barIndex == 0 && beat.instance == 0) {
198
168
  var emb = new embelishments_1.BeatStartLines(this, rootElement);
199
169
  this._embelishments = [emb];
@@ -1 +1 @@
1
- {"version":3,"file":"beatviews.js","sourceRoot":"","sources":["../../../src/carnatic/beatviews.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAuC;AACvC,gCAAmE;AAEnE,oCAA0D;AAC1D,yCAA6C;AAC7C,iDAA+D;AAE/D;IAA8B,4BAAK;IAOjC,kBAA4B,IAAU,EAAE,WAAoB,EAAkB,KAAY,EAAE,MAAY;;QAAxG,YACE,iBAAO,SAkDR;QAnD2B,UAAI,GAAJ,IAAI,CAAM;QAAwC,WAAK,GAAL,KAAK,CAAO;QAL1F,iBAAW,GAAG,IAAI,CAAC;QAEX,eAAS,GAAe,EAAE,CAAC;QAKjC,KAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,KAAI,CAAC,YAAY,GAAG,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE;YAC7C,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC,IAAI;gBAC3B,QAAQ,EAAE,IAAI,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G,CAAC,GAAG,CAAC,CAAC;yBAC7B;qBACF;iBACF;aACF;YACD,OAAO,IAAI,CAAC,cAAc,CAAC;QAC7B,CAAC;;;OAAA;IACH,eAAC;AAAD,CAAC,AApID,CAA8B,cAAK,GAoIlC;AApIY,4BAAQ","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { Cycle, AtomType, Syllable, Note, Literal } from \"../core\";\nimport { BeatView as BeatViewBase, Beat } from \"../layouts\";\nimport { AtomView, Embelishment, Shape } from \"../shapes\";\nimport { createAtomView } from \"./atomviews\";\nimport { BeatStartLines, BeatEndLines } from \"./embelishments\";\n\nexport class BeatView extends Shape implements BeatViewBase {\n protected atomSpacing: number;\n needsLayout = true;\n private _embelishments: Embelishment[];\n private atomViews: AtomView[] = [];\n groupElement: SVGGElement;\n textElement: SVGTextElement;\n constructor(public readonly beat: Beat, rootElement: Element, public readonly cycle: Cycle, config?: any) {\n super();\n this.atomSpacing = 5;\n this.groupElement = TSU.DOM.createSVGNode(\"g\", {\n parent: rootElement,\n attrs: {\n beatId: beat.uuid,\n id: \"beatGroup\" + beat.uuid,\n roleName: beat.role.name,\n layoutLine: beat.layoutLine,\n layoutColumn: beat.layoutColumn,\n beatIndex: beat.index,\n },\n });\n this.textElement = TSU.DOM.createSVGNode(\"text\", {\n parent: this.groupElement,\n attrs: {\n class: \"roleAtomsText\",\n // y: \"0%\",\n style: \"dominant-baseline: hanging\",\n beatId: beat.uuid,\n id: \"beatText\" + beat.uuid,\n roleName: beat.role.name,\n layoutLine: beat.layoutLine,\n layoutColumn: beat.layoutColumn,\n beatIndex: beat.index,\n },\n }) as SVGTextElement;\n\n // create the children\n for (const flatAtom of beat.atoms) {\n if (flatAtom.atom.type == AtomType.LITERAL) {\n const lit = flatAtom.atom as Literal;\n // convert to note or syllable here\n if (beat.role.defaultToNotes) {\n flatAtom.atom = Note.fromLit(lit);\n } else {\n flatAtom.atom = Syllable.fromLit(lit);\n }\n // carry over rest info\n flatAtom.atom.beforeRest = lit.beforeRest;\n }\n const atomView = createAtomView(this.textElement, flatAtom);\n atomView.depth = flatAtom.depth;\n this.atomViews.push(atomView);\n }\n\n this.setStyles(config || {});\n }\n\n // protected refreshMinSize(): TSU.Geom.Size { return TSU.DOM.svgBBox(this.groupElement); }\n protected refreshMinSize(): TSU.Geom.Size {\n let totalWidth = 0;\n let maxHeight = 0;\n this.atomViews.forEach((av, index) => {\n const ms = av.minSize;\n totalWidth += ms.width + this.atomSpacing;\n maxHeight = Math.max(maxHeight, ms.height);\n });\n return new TSU.Geom.Size(totalWidth, maxHeight);\n }\n\n protected updateBounds(\n x: null | number,\n y: null | number,\n w: null | number,\n h: null | number,\n ): [number | null, number | null, number | null, number | null] {\n return [x, y, w, h];\n }\n\n setStyles(config: any): void {\n if (\"atomSpacing\" in config) this.atomSpacing = config.atomSpacing;\n this.needsLayout = true;\n }\n\n refreshLayout(): void {\n this.groupElement.setAttribute(\"transform\", \"translate(\" + this.x + \",\" + this.y + \")\");\n // if (this.widthChanged) {\n // All our atoms have to be laid out between startX and endX\n // old way of doing where we just set dx between atom views\n // this worked when atomviews were single glyphs. But\n // as atomViews can be complex (eg with accents and pre/post\n // spaces etc) explicitly setting x/y may be important\n let currX = 0;\n const currY = 0; // null; // this.y; // + 10;\n this.atomViews.forEach((av, index) => {\n av.setBounds(currX, currY, null, null, true);\n currX += this.atomSpacing + av.minSize.width;\n });\n this.resetMinSize();\n for (const e of this.embelishments) e.refreshLayout();\n this.needsLayout = false;\n }\n\n get embelishments(): Embelishment[] {\n if (!this._embelishments) {\n this._embelishments = [];\n const beat = this.beat;\n // TODO - Should this be the group's parent element?\n const rootElement = this.textElement.parentElement as any as SVGGraphicsElement;\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 this._embelishments = [emb];\n } else {\n const cycle = this.cycle;\n const bar = cycle.bars[beat.barIndex];\n // TODO - ensure that we are in the last instance of this beat\n // since for now we dont have a way of specifying kalai this wont fail\n if (beat.beatIndex == bar.beatCount - 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 this._embelishments = [emb];\n } else {\n // end of a bar so single line end\n const emb = new BeatEndLines(this, rootElement);\n this._embelishments = [emb];\n }\n }\n }\n }\n return this._embelishments;\n }\n}\n"]}
@@ -14,16 +14,18 @@ export declare class OctaveIndicator extends AtomViewEmbelishment {
14
14
  dotSpacing: number;
15
15
  dotsElem: SVGGElement;
16
16
  constructor(noteView: AtomView, note: Note);
17
- refreshBBox(): TSU.Geom.Rect;
18
- protected updatePosition(x: null | number, y: null | number): [number | null, number | null];
17
+ protected refreshMinSize(): TSU.Geom.Size;
18
+ protected updateBounds(x: null | number, y: null | number, w: null | number, h: null | number): [number | null, number | null, number | null, number | null];
19
+ refreshLayout(): void;
19
20
  }
20
21
  export declare class LabelEmbelishment extends AtomViewEmbelishment {
21
22
  readonly label: string;
22
23
  readonly atomView: AtomView;
23
24
  labelElem: SVGTextElement;
24
25
  constructor(label: string, atomView: AtomView);
25
- refreshBBox(): TSU.Geom.Rect;
26
- protected updatePosition(x: null | number, y: null | number): [number | null, number | null];
26
+ protected refreshMinSize(): TSU.Geom.Size;
27
+ protected updateBounds(x: null | number, y: null | number, w: null | number, h: null | number): [number | null, number | null, number | null, number | null];
28
+ refreshLayout(): void;
27
29
  }
28
30
  export declare class BeatStartLines extends Embelishment {
29
31
  readonly source: BeatView;
@@ -31,9 +33,9 @@ export declare class BeatStartLines extends Embelishment {
31
33
  barSpacing: number;
32
34
  protected line: SVGLineElement;
33
35
  constructor(source: BeatView, rootElement: SVGGraphicsElement);
36
+ protected refreshMinSize(): TSU.Geom.Size;
34
37
  refreshLayout(): void;
35
- protected refreshBBox(): TSU.Geom.Rect;
36
- protected updatePosition(x: null | number, y: null | number): [number | null, number | null];
38
+ protected updateBounds(x: null | number, y: null | number, w: null | number, h: null | number): [number | null, number | null, number | null, number | null];
37
39
  }
38
40
  export declare class BeatEndLines extends Embelishment {
39
41
  readonly source: BeatView;
@@ -41,10 +43,11 @@ export declare class BeatEndLines extends Embelishment {
41
43
  lineSpacing: number;
42
44
  protected lines: SVGLineElement[];
43
45
  constructor(source: BeatView, rootElement: SVGGraphicsElement, nLines?: number);
44
- protected refreshBBox(): TSU.Geom.Rect;
46
+ protected refreshMinSize(): TSU.Geom.Size;
45
47
  protected updatePosition(x: null | number, y: null | number): [number | null, number | null];
46
48
  barSpacing: number;
47
49
  refreshLayout(): void;
50
+ protected updateBounds(x: null | number, y: null | number, w: null | number, h: null | number): [number | null, number | null, number | null, number | null];
48
51
  }
49
52
  export declare class Kampitham extends LabelEmbelishment {
50
53
  readonly atomView: AtomView;
@@ -88,6 +91,7 @@ export declare class Jaaru extends AtomViewEmbelishment {
88
91
  pathElem: SVGPathElement;
89
92
  constructor(jaaru: JaaruGamaka, atomView: AtomView);
90
93
  pathAttribute(x?: number): string;
91
- protected refreshBBox(): TSU.Geom.Rect;
92
- protected updatePosition(x: null | number, y: null | number): [number | null, number | null];
94
+ protected refreshMinSize(): TSU.Geom.Size;
95
+ protected updateBounds(x: null | number, y: null | number, w: null | number, h: null | number): [number | null, number | null, number | null, number | null];
96
+ refreshLayout(): void;
93
97
  }