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/index.js CHANGED
@@ -14006,9 +14006,12 @@ class $c2be399211dfbcbd$var$ChordRenderer {
14006
14006
  this.transposeKey = config.transposeKey;
14007
14007
  this.useUnicodeModifier = config.useUnicodeModifier;
14008
14008
  }
14009
- render(chordString) {
14010
- const chord = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(chordString);
14011
- if (!chord) return chordString;
14009
+ render(chordOrString) {
14010
+ if (chordOrString instanceof (0, $26f57998457eb2d4$export$2e2bcd8739ae039)) return this.renderChord(chordOrString);
14011
+ const chord = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(chordOrString);
14012
+ return chord ? this.renderChord(chord) : chordOrString;
14013
+ }
14014
+ renderChord(chord) {
14012
14015
  return (0, $21a34a464e7bc609$export$79570e60478bce41)(chord, [
14013
14016
  (c)=>c.transpose(this.effectiveTransposeDistance),
14014
14017
  (c)=>this.accidental ? c.useAccidental(this.accidental) : c,
@@ -14416,7 +14419,8 @@ function $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey) {
14416
14419
  }
14417
14420
  /**
14418
14421
  * Renders a chord in the context of a line and song and taking into account some options
14419
- * @param chordString The chord to render
14422
+ * @param chord The chord to render. Accepts either a {@link Chord} object (preferred \u2014 preserves
14423
+ * explicit accidental choices) or a chord string.
14420
14424
  * @param line The line the chord is in
14421
14425
  * @param song The song the line is in
14422
14426
  * @param renderKey The key to render the chord in. If not provided, the line key will be used,
@@ -14434,7 +14438,7 @@ function $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey) {
14434
14438
  normalizeChordSuffix: true,
14435
14439
  decapo: false
14436
14440
  };
14437
- function $dfecd32049fa58e9$export$596ec52955da9472(chordString, line, song, options = {}) {
14441
+ function $dfecd32049fa58e9$export$596ec52955da9472(chord, line, song, options = {}) {
14438
14442
  const { renderKey: renderKey, useUnicodeModifier: useUnicodeModifier, normalizeChords: normalizeChords, normalizeChordSuffix: normalizeChordSuffix, decapo: decapo } = {
14439
14443
  ...$dfecd32049fa58e9$var$renderChordDefaults,
14440
14444
  ...options
@@ -14451,7 +14455,7 @@ function $dfecd32049fa58e9$export$596ec52955da9472(chordString, line, song, opti
14451
14455
  style: song.metadata.getSingle((0, $b8d0f3e3723cd084$export$d8cbdf44b1f66df1)),
14452
14456
  transposeKey: line.transposeKey,
14453
14457
  useUnicodeModifier: useUnicodeModifier
14454
- }).render(chordString);
14458
+ }).render(chord);
14455
14459
  }
14456
14460
  function $dfecd32049fa58e9$export$b07b16221c14aaa(key) {
14457
14461
  const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrapOrFail(key);
@@ -21690,7 +21694,7 @@ var $c049675f48c823b2$export$2e2bcd8739ae039 = $c049675f48c823b2$var$ChordSheetP
21690
21694
  return '';
21691
21695
  }
21692
21696
  renderChord(item, line) {
21693
- return (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, this.song, {
21697
+ return (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chord ?? item.chords, line, this.song, {
21694
21698
  renderKey: this.configuration.key,
21695
21699
  normalizeChords: this.configuration.normalizeChords,
21696
21700
  normalizeChordSuffix: this.configuration.normalizeChordSuffix,
@@ -34235,7 +34239,7 @@ var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration,
34235
34239
  const cls = (0, $376e205ced98486b$export$986cf1257ba88b40)(item) ? c.rhythmSymbol : c.chord;
34236
34240
  return `
34237
34241
  <div class="${cls}"${(0, $376e205ced98486b$export$ca030c9435779e4b)(line.chordFont)}>
34238
- ${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, song, {
34242
+ ${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chord ?? item.chords, line, song, {
34239
34243
  renderKey: key,
34240
34244
  useUnicodeModifier: configuration.useUnicodeModifiers,
34241
34245
  normalizeChords: configuration.normalizeChords,
@@ -34435,7 +34439,7 @@ var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration,
34435
34439
  `).else(()=>{
34436
34440
  const cls = (0, $376e205ced98486b$export$986cf1257ba88b40)(item) ? c.rhythmSymbol : c.chord;
34437
34441
  return `
34438
- <td class="${cls}"${(0, $376e205ced98486b$export$ca030c9435779e4b)(line.chordFont)}>${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, song, {
34442
+ <td class="${cls}"${(0, $376e205ced98486b$export$ca030c9435779e4b)(line.chordFont)}>${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chord ?? item.chords, line, song, {
34439
34443
  renderKey: key,
34440
34444
  useUnicodeModifier: configuration.useUnicodeModifiers,
34441
34445
  normalizeChords: configuration.normalizeChords,
@@ -37243,7 +37247,7 @@ const $db9c80925e255cd2$var$endSectionTags = {
37243
37247
  var $db9c80925e255cd2$export$2e2bcd8739ae039 = $db9c80925e255cd2$var$UltimateGuitarParser;
37244
37248
 
37245
37249
 
37246
- var $7491059d3a8d9eaa$export$2e2bcd8739ae039 = '15.5.0';
37250
+ var $7491059d3a8d9eaa$export$2e2bcd8739ae039 = '15.5.1';
37247
37251
 
37248
37252
 
37249
37253
 
@@ -37515,7 +37519,7 @@ var $376e205ced98486b$export$2e2bcd8739ae039 = {
37515
37519
  return Math.max(contentLength, lyricsLength);
37516
37520
  }
37517
37521
  renderChords(chordLyricsPair, line) {
37518
- const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chords, line, this.song, {
37522
+ const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chord ?? chordLyricsPair.chords, line, this.song, {
37519
37523
  renderKey: this.configuration.key,
37520
37524
  useUnicodeModifier: this.configuration.useUnicodeModifiers,
37521
37525
  normalizeChords: this.configuration.normalizeChords,