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/index.js CHANGED
@@ -7696,9 +7696,12 @@ class $e02a17f5a26edf19$var$ChordRenderer {
7696
7696
  this.transposeKey = config.transposeKey;
7697
7697
  this.useUnicodeModifier = config.useUnicodeModifier;
7698
7698
  }
7699
- render(chordString) {
7700
- const chord = (0, $177a605b8569b31c$export$2e2bcd8739ae039).parse(chordString);
7701
- if (!chord) return chordString;
7699
+ render(chordOrString) {
7700
+ if (chordOrString instanceof (0, $177a605b8569b31c$export$2e2bcd8739ae039)) return this.renderChord(chordOrString);
7701
+ const chord = (0, $177a605b8569b31c$export$2e2bcd8739ae039).parse(chordOrString);
7702
+ return chord ? this.renderChord(chord) : chordOrString;
7703
+ }
7704
+ renderChord(chord) {
7702
7705
  return (0, $28a2fcb6fb95a147$export$79570e60478bce41)(chord, [
7703
7706
  (c)=>c.transpose(this.effectiveTransposeDistance),
7704
7707
  (c)=>this.accidental ? c.useAccidental(this.accidental) : c,
@@ -8106,7 +8109,8 @@ function $2ce1086ce25c9ac0$export$fd31a53e6281557e(transposeKey, songKey) {
8106
8109
  }
8107
8110
  /**
8108
8111
  * Renders a chord in the context of a line and song and taking into account some options
8109
- * @param chordString The chord to render
8112
+ * @param chord The chord to render. Accepts either a {@link Chord} object (preferred \u2014 preserves
8113
+ * explicit accidental choices) or a chord string.
8110
8114
  * @param line The line the chord is in
8111
8115
  * @param song The song the line is in
8112
8116
  * @param renderKey The key to render the chord in. If not provided, the line key will be used,
@@ -8124,7 +8128,7 @@ function $2ce1086ce25c9ac0$export$fd31a53e6281557e(transposeKey, songKey) {
8124
8128
  normalizeChordSuffix: true,
8125
8129
  decapo: false
8126
8130
  };
8127
- function $2ce1086ce25c9ac0$export$596ec52955da9472(chordString, line, song, options = {}) {
8131
+ function $2ce1086ce25c9ac0$export$596ec52955da9472(chord, line, song, options = {}) {
8128
8132
  const { renderKey: renderKey, useUnicodeModifier: useUnicodeModifier, normalizeChords: normalizeChords, normalizeChordSuffix: normalizeChordSuffix, decapo: decapo } = {
8129
8133
  ...$2ce1086ce25c9ac0$var$renderChordDefaults,
8130
8134
  ...options
@@ -8141,7 +8145,7 @@ function $2ce1086ce25c9ac0$export$596ec52955da9472(chordString, line, song, opti
8141
8145
  style: song.metadata.getSingle((0, $d21c5c7a462f3c34$export$d8cbdf44b1f66df1)),
8142
8146
  transposeKey: line.transposeKey,
8143
8147
  useUnicodeModifier: useUnicodeModifier
8144
- }).render(chordString);
8148
+ }).render(chord);
8145
8149
  }
8146
8150
  function $2ce1086ce25c9ac0$export$b07b16221c14aaa(key) {
8147
8151
  const keyObj = (0, $c2d6ab25ad00308f$export$2e2bcd8739ae039).wrapOrFail(key);
@@ -14083,7 +14087,7 @@ var $f9c5006b26957916$export$2e2bcd8739ae039 = {
14083
14087
  return '';
14084
14088
  }
14085
14089
  renderChord(item, line) {
14086
- return (0, $2ce1086ce25c9ac0$export$596ec52955da9472)(item.chords, line, this.song, {
14090
+ return (0, $2ce1086ce25c9ac0$export$596ec52955da9472)(item.chord ?? item.chords, line, this.song, {
14087
14091
  renderKey: this.configuration.key,
14088
14092
  normalizeChords: this.configuration.normalizeChords,
14089
14093
  normalizeChordSuffix: this.configuration.normalizeChordSuffix,
@@ -26628,7 +26632,7 @@ var $1408adfd7317f0b6$export$2e2bcd8739ae039 = ({ configuration: configuration,
26628
26632
  const cls = (0, $f9c5006b26957916$export$986cf1257ba88b40)(item) ? c.rhythmSymbol : c.chord;
26629
26633
  return `
26630
26634
  <div class="${cls}"${(0, $f9c5006b26957916$export$ca030c9435779e4b)(line.chordFont)}>
26631
- ${(0, $2ce1086ce25c9ac0$export$596ec52955da9472)(item.chords, line, song, {
26635
+ ${(0, $2ce1086ce25c9ac0$export$596ec52955da9472)(item.chord ?? item.chords, line, song, {
26632
26636
  renderKey: key,
26633
26637
  useUnicodeModifier: configuration.useUnicodeModifiers,
26634
26638
  normalizeChords: configuration.normalizeChords,
@@ -26828,7 +26832,7 @@ var $396f7048979e89c9$export$2e2bcd8739ae039 = ({ configuration: configuration,
26828
26832
  `).else(()=>{
26829
26833
  const cls = (0, $f9c5006b26957916$export$986cf1257ba88b40)(item) ? c.rhythmSymbol : c.chord;
26830
26834
  return `
26831
- <td class="${cls}"${(0, $f9c5006b26957916$export$ca030c9435779e4b)(line.chordFont)}>${(0, $2ce1086ce25c9ac0$export$596ec52955da9472)(item.chords, line, song, {
26835
+ <td class="${cls}"${(0, $f9c5006b26957916$export$ca030c9435779e4b)(line.chordFont)}>${(0, $2ce1086ce25c9ac0$export$596ec52955da9472)(item.chord ?? item.chords, line, song, {
26832
26836
  renderKey: key,
26833
26837
  useUnicodeModifier: configuration.useUnicodeModifiers,
26834
26838
  normalizeChords: configuration.normalizeChords,
@@ -27757,7 +27761,7 @@ var $bdd8c6196670168a$export$2e2bcd8739ae039 = $bdd8c6196670168a$var$Condition;
27757
27761
  return Math.max(contentLength, lyricsLength);
27758
27762
  }
27759
27763
  renderChords(chordLyricsPair, line) {
27760
- const chords = (0, $2ce1086ce25c9ac0$export$596ec52955da9472)(chordLyricsPair.chords, line, this.song, {
27764
+ const chords = (0, $2ce1086ce25c9ac0$export$596ec52955da9472)(chordLyricsPair.chord ?? chordLyricsPair.chords, line, this.song, {
27761
27765
  renderKey: this.configuration.key,
27762
27766
  useUnicodeModifier: this.configuration.useUnicodeModifiers,
27763
27767
  normalizeChords: this.configuration.normalizeChords,
@@ -30233,7 +30237,7 @@ const $a5a21ced491ea51f$var$endSectionTags = {
30233
30237
  var $a5a21ced491ea51f$export$2e2bcd8739ae039 = $a5a21ced491ea51f$var$UltimateGuitarParser;
30234
30238
 
30235
30239
 
30236
- var $ae92e002ce14f11a$export$2e2bcd8739ae039 = '15.5.0';
30240
+ var $ae92e002ce14f11a$export$2e2bcd8739ae039 = '15.5.1';
30237
30241
 
30238
30242
 
30239
30243