chordsheetjs 15.5.0 → 15.5.1

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/pdf/module.js CHANGED
@@ -13999,9 +13999,12 @@ class $f5e27e8faa22bf25$var$ChordRenderer {
13999
13999
  this.transposeKey = config.transposeKey;
14000
14000
  this.useUnicodeModifier = config.useUnicodeModifier;
14001
14001
  }
14002
- render(chordString) {
14003
- const chord = (0, $5e3a0c5a6197f95b$export$2e2bcd8739ae039).parse(chordString);
14004
- if (!chord) return chordString;
14002
+ render(chordOrString) {
14003
+ if (chordOrString instanceof (0, $5e3a0c5a6197f95b$export$2e2bcd8739ae039)) return this.renderChord(chordOrString);
14004
+ const chord = (0, $5e3a0c5a6197f95b$export$2e2bcd8739ae039).parse(chordOrString);
14005
+ return chord ? this.renderChord(chord) : chordOrString;
14006
+ }
14007
+ renderChord(chord) {
14005
14008
  return (0, $974bd1d260bb1d53$export$79570e60478bce41)(chord, [
14006
14009
  (c)=>c.transpose(this.effectiveTransposeDistance),
14007
14010
  (c)=>this.accidental ? c.useAccidental(this.accidental) : c,
@@ -14409,7 +14412,8 @@ function $e2e1ea6dd3b7d2e1$export$fd31a53e6281557e(transposeKey, songKey) {
14409
14412
  }
14410
14413
  /**
14411
14414
  * Renders a chord in the context of a line and song and taking into account some options
14412
- * @param chordString The chord to render
14415
+ * @param chord The chord to render. Accepts either a {@link Chord} object (preferred \u2014 preserves
14416
+ * explicit accidental choices) or a chord string.
14413
14417
  * @param line The line the chord is in
14414
14418
  * @param song The song the line is in
14415
14419
  * @param renderKey The key to render the chord in. If not provided, the line key will be used,
@@ -14427,7 +14431,7 @@ function $e2e1ea6dd3b7d2e1$export$fd31a53e6281557e(transposeKey, songKey) {
14427
14431
  normalizeChordSuffix: true,
14428
14432
  decapo: false
14429
14433
  };
14430
- function $e2e1ea6dd3b7d2e1$export$596ec52955da9472(chordString, line, song, options = {}) {
14434
+ function $e2e1ea6dd3b7d2e1$export$596ec52955da9472(chord, line, song, options = {}) {
14431
14435
  const { renderKey: renderKey, useUnicodeModifier: useUnicodeModifier, normalizeChords: normalizeChords, normalizeChordSuffix: normalizeChordSuffix, decapo: decapo } = {
14432
14436
  ...$e2e1ea6dd3b7d2e1$var$renderChordDefaults,
14433
14437
  ...options
@@ -14444,7 +14448,7 @@ function $e2e1ea6dd3b7d2e1$export$596ec52955da9472(chordString, line, song, opti
14444
14448
  style: song.metadata.getSingle((0, $fc279350ee3ca664$export$d8cbdf44b1f66df1)),
14445
14449
  transposeKey: line.transposeKey,
14446
14450
  useUnicodeModifier: useUnicodeModifier
14447
- }).render(chordString);
14451
+ }).render(chord);
14448
14452
  }
14449
14453
  function $e2e1ea6dd3b7d2e1$export$b07b16221c14aaa(key) {
14450
14454
  const keyObj = (0, $918eb2016ac61e41$export$2e2bcd8739ae039).wrapOrFail(key);
@@ -21683,7 +21687,7 @@ var $9c17b505581d81bb$export$2e2bcd8739ae039 = $9c17b505581d81bb$var$ChordSheetP
21683
21687
  return '';
21684
21688
  }
21685
21689
  renderChord(item, line) {
21686
- return (0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(item.chords, line, this.song, {
21690
+ return (0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(item.chord ?? item.chords, line, this.song, {
21687
21691
  renderKey: this.configuration.key,
21688
21692
  normalizeChords: this.configuration.normalizeChords,
21689
21693
  normalizeChordSuffix: this.configuration.normalizeChordSuffix,
@@ -34228,7 +34232,7 @@ var $d6c38f6287712fb1$export$2e2bcd8739ae039 = ({ configuration: configuration,
34228
34232
  const cls = (0, $a2a605be2775ff64$export$986cf1257ba88b40)(item) ? c.rhythmSymbol : c.chord;
34229
34233
  return `
34230
34234
  <div class="${cls}"${(0, $a2a605be2775ff64$export$ca030c9435779e4b)(line.chordFont)}>
34231
- ${(0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(item.chords, line, song, {
34235
+ ${(0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(item.chord ?? item.chords, line, song, {
34232
34236
  renderKey: key,
34233
34237
  useUnicodeModifier: configuration.useUnicodeModifiers,
34234
34238
  normalizeChords: configuration.normalizeChords,
@@ -34428,7 +34432,7 @@ var $9940e2d1d4d0b0b9$export$2e2bcd8739ae039 = ({ configuration: configuration,
34428
34432
  `).else(()=>{
34429
34433
  const cls = (0, $a2a605be2775ff64$export$986cf1257ba88b40)(item) ? c.rhythmSymbol : c.chord;
34430
34434
  return `
34431
- <td class="${cls}"${(0, $a2a605be2775ff64$export$ca030c9435779e4b)(line.chordFont)}>${(0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(item.chords, line, song, {
34435
+ <td class="${cls}"${(0, $a2a605be2775ff64$export$ca030c9435779e4b)(line.chordFont)}>${(0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(item.chord ?? item.chords, line, song, {
34432
34436
  renderKey: key,
34433
34437
  useUnicodeModifier: configuration.useUnicodeModifiers,
34434
34438
  normalizeChords: configuration.normalizeChords,
@@ -37236,7 +37240,7 @@ const $7c59209366f6488e$var$endSectionTags = {
37236
37240
  var $7c59209366f6488e$export$2e2bcd8739ae039 = $7c59209366f6488e$var$UltimateGuitarParser;
37237
37241
 
37238
37242
 
37239
- var $3e7872a494b653a9$export$2e2bcd8739ae039 = '15.5.0';
37243
+ var $3e7872a494b653a9$export$2e2bcd8739ae039 = '15.5.1';
37240
37244
 
37241
37245
 
37242
37246
 
@@ -37508,7 +37512,7 @@ var $a2a605be2775ff64$export$2e2bcd8739ae039 = {
37508
37512
  return Math.max(contentLength, lyricsLength);
37509
37513
  }
37510
37514
  renderChords(chordLyricsPair, line) {
37511
- const chords = (0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(chordLyricsPair.chords, line, this.song, {
37515
+ const chords = (0, $e2e1ea6dd3b7d2e1$export$596ec52955da9472)(chordLyricsPair.chord ?? chordLyricsPair.chords, line, this.song, {
37512
37516
  renderKey: this.configuration.key,
37513
37517
  useUnicodeModifier: this.configuration.useUnicodeModifiers,
37514
37518
  normalizeChords: this.configuration.normalizeChords,