chordsheetjs 7.11.0 → 7.12.0
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/README.md +1 -0
- package/lib/bundle.js +40 -23
- package/lib/index.js +40 -23
- package/lib/index.js.map +1 -1
- package/lib/main.d.ts +8 -2
- package/lib/main.d.ts.map +1 -1
- package/lib/module.js +40 -23
- package/lib/module.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1114,6 +1114,7 @@ https://chordpro.org/chordpro/directives-env_bridge/, https://chordpro.org/chord
|
|
|
1114
1114
|
| [configuration.evaluate] | <code>boolean</code> | <code>false</code> | <p>Whether or not to evaluate meta expressions. For more info about meta expressions, see: https://bit.ly/2SC9c2u</p> |
|
|
1115
1115
|
| [configuration.metadata] | <code>object</code> | <code>{}</code> | |
|
|
1116
1116
|
| [configuration.metadata.separator] | <code>string</code> | <code>"\", \""</code> | <p>The separator to be used when rendering a metadata value that has multiple values. See: https://bit.ly/2SC9c2u</p> |
|
|
1117
|
+
| [configuration.key] | [<code>Key</code>](#Key) \| <code>string</code> | <code></code> | <p>The key to use for rendering. The chord sheet will be transposed from the song's original key (as indicated by the <code>{key}</code> directive) to the specified key. Note that transposing will only work if the original song key is set.</p> |
|
|
1117
1118
|
|
|
1118
1119
|
<a name="HtmlDivFormatter"></a>
|
|
1119
1120
|
|
package/lib/bundle.js
CHANGED
|
@@ -1064,10 +1064,18 @@ const $6ebb068142750218$var$enharmonics = {
|
|
|
1064
1064
|
"A#": "Bb",
|
|
1065
1065
|
"Gb": "F#"
|
|
1066
1066
|
},
|
|
1067
|
+
"Eb": {
|
|
1068
|
+
"D#": "Eb",
|
|
1069
|
+
"F#": "Gb",
|
|
1070
|
+
"G#": "Ab",
|
|
1071
|
+
"A#": "Bb"
|
|
1072
|
+
},
|
|
1067
1073
|
"E": {
|
|
1068
1074
|
"Ab": "G#",
|
|
1069
1075
|
"A#": "Bb",
|
|
1070
|
-
"D#": "Eb"
|
|
1076
|
+
"D#": "Eb",
|
|
1077
|
+
"Db": "C#",
|
|
1078
|
+
"Eb": "D#"
|
|
1071
1079
|
},
|
|
1072
1080
|
"F": {
|
|
1073
1081
|
"A#": "Bb",
|
|
@@ -1162,6 +1170,9 @@ const $6ebb068142750218$var$enharmonics = {
|
|
|
1162
1170
|
"G#m": {
|
|
1163
1171
|
"A#": "Bb",
|
|
1164
1172
|
"D#": "Eb"
|
|
1173
|
+
},
|
|
1174
|
+
"B": {
|
|
1175
|
+
"Eb": "D#"
|
|
1165
1176
|
}
|
|
1166
1177
|
};
|
|
1167
1178
|
var $6ebb068142750218$export$2e2bcd8739ae039 = $6ebb068142750218$var$enharmonics;
|
|
@@ -2544,7 +2555,7 @@ function $26f57998457eb2d4$var$normalizeChordSuffix(suffix) {
|
|
|
2544
2555
|
* @returns {Chord} the normalized chord
|
|
2545
2556
|
*/ normalize(key = null, { normalizeSuffix: normalizeSuffix = true } = {}) {
|
|
2546
2557
|
const suffix = normalizeSuffix ? $26f57998457eb2d4$var$normalizeChordSuffix(this.suffix) : this.suffix;
|
|
2547
|
-
let bassRootKey = this.root.normalize();
|
|
2558
|
+
let bassRootKey = this.root.normalize().normalizeEnharmonics(key);
|
|
2548
2559
|
if (this.root.isMinor() && this.bass) bassRootKey = this.root.transpose(3).removeMinor().normalize();
|
|
2549
2560
|
return this.set({
|
|
2550
2561
|
suffix: suffix,
|
|
@@ -7839,17 +7850,20 @@ class $71c330be198ce421$var$MetadataConfiguration {
|
|
|
7839
7850
|
var $71c330be198ce421$export$2e2bcd8739ae039 = $71c330be198ce421$var$MetadataConfiguration;
|
|
7840
7851
|
|
|
7841
7852
|
|
|
7853
|
+
|
|
7842
7854
|
const $bbcfd2c49e8e9957$export$78c0028a34264234 = {
|
|
7843
7855
|
evaluate: false,
|
|
7844
7856
|
metadata: {
|
|
7845
7857
|
separator: ","
|
|
7846
|
-
}
|
|
7858
|
+
},
|
|
7859
|
+
key: null
|
|
7847
7860
|
};
|
|
7848
7861
|
class $bbcfd2c49e8e9957$var$Configuration {
|
|
7849
7862
|
constructor(configuration = $bbcfd2c49e8e9957$export$78c0028a34264234){
|
|
7850
7863
|
if ("evaluate" in configuration) this.evaluate = !!configuration.evaluate;
|
|
7851
7864
|
else this.evaluate = !!$bbcfd2c49e8e9957$export$78c0028a34264234.evaluate;
|
|
7852
7865
|
this.metadata = new (0, $71c330be198ce421$export$2e2bcd8739ae039)(configuration.metadata);
|
|
7866
|
+
this.key = configuration.key ? (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(configuration.key) : null;
|
|
7853
7867
|
this.configuration = configuration;
|
|
7854
7868
|
}
|
|
7855
7869
|
get(key) {
|
|
@@ -7870,6 +7884,10 @@ var $bbcfd2c49e8e9957$export$2e2bcd8739ae039 = $bbcfd2c49e8e9957$var$Configurati
|
|
|
7870
7884
|
* @param {object} [configuration.metadata={}]
|
|
7871
7885
|
* @param {string} [configuration.metadata.separator=", "] The separator to be used when rendering a metadata value
|
|
7872
7886
|
* that has multiple values. See: https://bit.ly/2SC9c2u
|
|
7887
|
+
* @param {Key|string} [configuration.key=null] The key to use for rendering. The chord sheet will be transposed
|
|
7888
|
+
* from the song's original key (as indicated by the `{key}` directive) to the specified key.
|
|
7889
|
+
* Note that transposing will only work
|
|
7890
|
+
* if the original song key is set.
|
|
7873
7891
|
*/ constructor(configuration = null){
|
|
7874
7892
|
this.configuration = new (0, $bbcfd2c49e8e9957$export$2e2bcd8739ae039)(configuration || {});
|
|
7875
7893
|
}
|
|
@@ -7881,7 +7899,6 @@ var $0055ecb09272ba2d$export$2e2bcd8739ae039 = $0055ecb09272ba2d$var$Formatter;
|
|
|
7881
7899
|
|
|
7882
7900
|
|
|
7883
7901
|
|
|
7884
|
-
|
|
7885
7902
|
const $427b789bcf346e61$export$1e6f8e38ccd793b = [
|
|
7886
7903
|
"A",
|
|
7887
7904
|
"Bb",
|
|
@@ -8057,27 +8074,27 @@ const $427b789bcf346e61$export$1ba61c6fa2f892a9 = {
|
|
|
8057
8074
|
};
|
|
8058
8075
|
|
|
8059
8076
|
|
|
8077
|
+
|
|
8060
8078
|
function $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey) {
|
|
8061
8079
|
if (/^\d+$/.test(transposeKey)) return parseInt(transposeKey, 10);
|
|
8062
8080
|
return (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).distance(songKey, transposeKey);
|
|
8063
8081
|
}
|
|
8064
|
-
function $dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey) {
|
|
8082
|
+
function $dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey, renderKey) {
|
|
8065
8083
|
let transpose = -1 * (capo || 0);
|
|
8066
|
-
if (
|
|
8084
|
+
if (songKey) {
|
|
8085
|
+
if (transposeKey) transpose += $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey);
|
|
8086
|
+
if (renderKey) transpose += (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).distance(songKey, renderKey);
|
|
8087
|
+
}
|
|
8067
8088
|
return transpose;
|
|
8068
8089
|
}
|
|
8069
|
-
function $dfecd32049fa58e9$export$596ec52955da9472(
|
|
8070
|
-
|
|
8090
|
+
function $dfecd32049fa58e9$export$596ec52955da9472(chordString, line, song, renderKey = null) {
|
|
8091
|
+
const chord = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(chordString);
|
|
8071
8092
|
const songKey = song.key;
|
|
8072
|
-
const capo = parseInt(song.metadata.getSingle(
|
|
8073
|
-
if (!
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
// chordObj = chordObj.useModifier(transposeKey.modifier);
|
|
8078
|
-
// }
|
|
8079
|
-
if (lineKey) chordObj = chordObj.normalize(lineKey);
|
|
8080
|
-
return chordObj.toString();
|
|
8093
|
+
const capo = parseInt(song.metadata.getSingle((0, $5e9ede69210ec54a$export$866f445d49bad88e)), 10);
|
|
8094
|
+
if (!chord) return chordString;
|
|
8095
|
+
const effectiveTransposeDistance = $dfecd32049fa58e9$var$chordTransposeDistance(capo, line.transposeKey, songKey, renderKey);
|
|
8096
|
+
const effectiveKey = renderKey || (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(line.key || song.key)?.transpose(effectiveTransposeDistance) || null;
|
|
8097
|
+
return chord.transpose(effectiveTransposeDistance).normalize(effectiveKey).toString();
|
|
8081
8098
|
}
|
|
8082
8099
|
function $dfecd32049fa58e9$export$b07b16221c14aaa(key) {
|
|
8083
8100
|
return (0, $427b789bcf346e61$export$1ba61c6fa2f892a9)[(0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).toString(key)];
|
|
@@ -8188,7 +8205,7 @@ function $376e205ced98486b$export$ca030c9435779e4b(font) {
|
|
|
8188
8205
|
return null;
|
|
8189
8206
|
}
|
|
8190
8207
|
chordLyricsPairLength(chordLyricsPair, line) {
|
|
8191
|
-
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chords, line
|
|
8208
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chords, line, this.song, this.configuration.key);
|
|
8192
8209
|
const { lyrics: lyrics } = chordLyricsPair;
|
|
8193
8210
|
const chordsLength = (chords || "").length;
|
|
8194
8211
|
const lyricsLength = (lyrics || "").length;
|
|
@@ -8198,7 +8215,7 @@ function $376e205ced98486b$export$ca030c9435779e4b(font) {
|
|
|
8198
8215
|
formatItemTop(item, _metadata, line) {
|
|
8199
8216
|
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable()) return item.value || "";
|
|
8200
8217
|
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) {
|
|
8201
|
-
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line
|
|
8218
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, this.song, this.configuration.key);
|
|
8202
8219
|
return (0, $21a34a464e7bc609$export$bc3bea8325045070)(chords, this.chordLyricsPairLength(item, line));
|
|
8203
8220
|
}
|
|
8204
8221
|
return "";
|
|
@@ -8282,7 +8299,7 @@ var $d834af97c9a2e4df$export$2e2bcd8739ae039 = $d834af97c9a2e4df$var$HtmlFormatt
|
|
|
8282
8299
|
|
|
8283
8300
|
|
|
8284
8301
|
|
|
8285
|
-
var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , bodyLines: bodyLines , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8302
|
+
var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration , configuration: { key: key } , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , bodyLines: bodyLines , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8286
8303
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(title, ()=>`<h1>${title}</h1>`)}
|
|
8287
8304
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(subtitle, ()=>`<h2>${subtitle}</h2>`)}
|
|
8288
8305
|
|
|
@@ -8297,7 +8314,7 @@ var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration ,
|
|
|
8297
8314
|
<tr>
|
|
8298
8315
|
${(0, $376e205ced98486b$export$79b2f7037acddd43)(line.items, (item)=>`
|
|
8299
8316
|
${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$17c9e635b932873b)(item), ()=>`
|
|
8300
|
-
<td class="chord">${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line
|
|
8317
|
+
<td class="chord">${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, song, key)}</td>
|
|
8301
8318
|
`)}
|
|
8302
8319
|
`)}
|
|
8303
8320
|
</tr>
|
|
@@ -8378,7 +8395,7 @@ var $5b02ea769c63fd56$export$2e2bcd8739ae039 = $5b02ea769c63fd56$var$HtmlTableFo
|
|
|
8378
8395
|
|
|
8379
8396
|
|
|
8380
8397
|
|
|
8381
|
-
var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8398
|
+
var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration , configuration: { key: key } , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8382
8399
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(title, ()=>`<h1>${title}</h1>`)}
|
|
8383
8400
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(subtitle, ()=>`<h2>${subtitle}</h2>`)}
|
|
8384
8401
|
|
|
@@ -8392,7 +8409,7 @@ var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration ,
|
|
|
8392
8409
|
${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$17c9e635b932873b)(item), ()=>`
|
|
8393
8410
|
<div class="column">
|
|
8394
8411
|
${(0, $376e205ced98486b$export$fae3166c418e0471)([
|
|
8395
|
-
(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line
|
|
8412
|
+
(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, song, key)
|
|
8396
8413
|
], ([renderedChord])=>`
|
|
8397
8414
|
<div class="chord"${renderedChord ? (0, $376e205ced98486b$export$ca030c9435779e4b)(line.chordFont) : ""}>${renderedChord}</div>
|
|
8398
8415
|
`)}
|
package/lib/index.js
CHANGED
|
@@ -1063,10 +1063,18 @@ const $6ebb068142750218$var$enharmonics = {
|
|
|
1063
1063
|
"A#": "Bb",
|
|
1064
1064
|
"Gb": "F#"
|
|
1065
1065
|
},
|
|
1066
|
+
"Eb": {
|
|
1067
|
+
"D#": "Eb",
|
|
1068
|
+
"F#": "Gb",
|
|
1069
|
+
"G#": "Ab",
|
|
1070
|
+
"A#": "Bb"
|
|
1071
|
+
},
|
|
1066
1072
|
"E": {
|
|
1067
1073
|
"Ab": "G#",
|
|
1068
1074
|
"A#": "Bb",
|
|
1069
|
-
"D#": "Eb"
|
|
1075
|
+
"D#": "Eb",
|
|
1076
|
+
"Db": "C#",
|
|
1077
|
+
"Eb": "D#"
|
|
1070
1078
|
},
|
|
1071
1079
|
"F": {
|
|
1072
1080
|
"A#": "Bb",
|
|
@@ -1161,6 +1169,9 @@ const $6ebb068142750218$var$enharmonics = {
|
|
|
1161
1169
|
"G#m": {
|
|
1162
1170
|
"A#": "Bb",
|
|
1163
1171
|
"D#": "Eb"
|
|
1172
|
+
},
|
|
1173
|
+
"B": {
|
|
1174
|
+
"Eb": "D#"
|
|
1164
1175
|
}
|
|
1165
1176
|
};
|
|
1166
1177
|
var $6ebb068142750218$export$2e2bcd8739ae039 = $6ebb068142750218$var$enharmonics;
|
|
@@ -2543,7 +2554,7 @@ function $26f57998457eb2d4$var$normalizeChordSuffix(suffix) {
|
|
|
2543
2554
|
* @returns {Chord} the normalized chord
|
|
2544
2555
|
*/ normalize(key = null, { normalizeSuffix: normalizeSuffix = true } = {}) {
|
|
2545
2556
|
const suffix = normalizeSuffix ? $26f57998457eb2d4$var$normalizeChordSuffix(this.suffix) : this.suffix;
|
|
2546
|
-
let bassRootKey = this.root.normalize();
|
|
2557
|
+
let bassRootKey = this.root.normalize().normalizeEnharmonics(key);
|
|
2547
2558
|
if (this.root.isMinor() && this.bass) bassRootKey = this.root.transpose(3).removeMinor().normalize();
|
|
2548
2559
|
return this.set({
|
|
2549
2560
|
suffix: suffix,
|
|
@@ -7838,17 +7849,20 @@ class $71c330be198ce421$var$MetadataConfiguration {
|
|
|
7838
7849
|
var $71c330be198ce421$export$2e2bcd8739ae039 = $71c330be198ce421$var$MetadataConfiguration;
|
|
7839
7850
|
|
|
7840
7851
|
|
|
7852
|
+
|
|
7841
7853
|
const $bbcfd2c49e8e9957$export$78c0028a34264234 = {
|
|
7842
7854
|
evaluate: false,
|
|
7843
7855
|
metadata: {
|
|
7844
7856
|
separator: ","
|
|
7845
|
-
}
|
|
7857
|
+
},
|
|
7858
|
+
key: null
|
|
7846
7859
|
};
|
|
7847
7860
|
class $bbcfd2c49e8e9957$var$Configuration {
|
|
7848
7861
|
constructor(configuration = $bbcfd2c49e8e9957$export$78c0028a34264234){
|
|
7849
7862
|
if ("evaluate" in configuration) this.evaluate = !!configuration.evaluate;
|
|
7850
7863
|
else this.evaluate = !!$bbcfd2c49e8e9957$export$78c0028a34264234.evaluate;
|
|
7851
7864
|
this.metadata = new (0, $71c330be198ce421$export$2e2bcd8739ae039)(configuration.metadata);
|
|
7865
|
+
this.key = configuration.key ? (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(configuration.key) : null;
|
|
7852
7866
|
this.configuration = configuration;
|
|
7853
7867
|
}
|
|
7854
7868
|
get(key) {
|
|
@@ -7869,6 +7883,10 @@ var $bbcfd2c49e8e9957$export$2e2bcd8739ae039 = $bbcfd2c49e8e9957$var$Configurati
|
|
|
7869
7883
|
* @param {object} [configuration.metadata={}]
|
|
7870
7884
|
* @param {string} [configuration.metadata.separator=", "] The separator to be used when rendering a metadata value
|
|
7871
7885
|
* that has multiple values. See: https://bit.ly/2SC9c2u
|
|
7886
|
+
* @param {Key|string} [configuration.key=null] The key to use for rendering. The chord sheet will be transposed
|
|
7887
|
+
* from the song's original key (as indicated by the `{key}` directive) to the specified key.
|
|
7888
|
+
* Note that transposing will only work
|
|
7889
|
+
* if the original song key is set.
|
|
7872
7890
|
*/ constructor(configuration = null){
|
|
7873
7891
|
this.configuration = new (0, $bbcfd2c49e8e9957$export$2e2bcd8739ae039)(configuration || {});
|
|
7874
7892
|
}
|
|
@@ -7880,7 +7898,6 @@ var $0055ecb09272ba2d$export$2e2bcd8739ae039 = $0055ecb09272ba2d$var$Formatter;
|
|
|
7880
7898
|
|
|
7881
7899
|
|
|
7882
7900
|
|
|
7883
|
-
|
|
7884
7901
|
const $427b789bcf346e61$export$1e6f8e38ccd793b = [
|
|
7885
7902
|
"A",
|
|
7886
7903
|
"Bb",
|
|
@@ -8056,27 +8073,27 @@ const $427b789bcf346e61$export$1ba61c6fa2f892a9 = {
|
|
|
8056
8073
|
};
|
|
8057
8074
|
|
|
8058
8075
|
|
|
8076
|
+
|
|
8059
8077
|
function $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey) {
|
|
8060
8078
|
if (/^\d+$/.test(transposeKey)) return parseInt(transposeKey, 10);
|
|
8061
8079
|
return (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).distance(songKey, transposeKey);
|
|
8062
8080
|
}
|
|
8063
|
-
function $dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey) {
|
|
8081
|
+
function $dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey, renderKey) {
|
|
8064
8082
|
let transpose = -1 * (capo || 0);
|
|
8065
|
-
if (
|
|
8083
|
+
if (songKey) {
|
|
8084
|
+
if (transposeKey) transpose += $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey);
|
|
8085
|
+
if (renderKey) transpose += (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).distance(songKey, renderKey);
|
|
8086
|
+
}
|
|
8066
8087
|
return transpose;
|
|
8067
8088
|
}
|
|
8068
|
-
function $dfecd32049fa58e9$export$596ec52955da9472(
|
|
8069
|
-
|
|
8089
|
+
function $dfecd32049fa58e9$export$596ec52955da9472(chordString, line, song, renderKey = null) {
|
|
8090
|
+
const chord = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(chordString);
|
|
8070
8091
|
const songKey = song.key;
|
|
8071
|
-
const capo = parseInt(song.metadata.getSingle(
|
|
8072
|
-
if (!
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
// chordObj = chordObj.useModifier(transposeKey.modifier);
|
|
8077
|
-
// }
|
|
8078
|
-
if (lineKey) chordObj = chordObj.normalize(lineKey);
|
|
8079
|
-
return chordObj.toString();
|
|
8092
|
+
const capo = parseInt(song.metadata.getSingle((0, $5e9ede69210ec54a$export$866f445d49bad88e)), 10);
|
|
8093
|
+
if (!chord) return chordString;
|
|
8094
|
+
const effectiveTransposeDistance = $dfecd32049fa58e9$var$chordTransposeDistance(capo, line.transposeKey, songKey, renderKey);
|
|
8095
|
+
const effectiveKey = renderKey || (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(line.key || song.key)?.transpose(effectiveTransposeDistance) || null;
|
|
8096
|
+
return chord.transpose(effectiveTransposeDistance).normalize(effectiveKey).toString();
|
|
8080
8097
|
}
|
|
8081
8098
|
function $dfecd32049fa58e9$export$b07b16221c14aaa(key) {
|
|
8082
8099
|
return (0, $427b789bcf346e61$export$1ba61c6fa2f892a9)[(0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).toString(key)];
|
|
@@ -8187,7 +8204,7 @@ function $376e205ced98486b$export$ca030c9435779e4b(font) {
|
|
|
8187
8204
|
return null;
|
|
8188
8205
|
}
|
|
8189
8206
|
chordLyricsPairLength(chordLyricsPair, line) {
|
|
8190
|
-
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chords, line
|
|
8207
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chords, line, this.song, this.configuration.key);
|
|
8191
8208
|
const { lyrics: lyrics } = chordLyricsPair;
|
|
8192
8209
|
const chordsLength = (chords || "").length;
|
|
8193
8210
|
const lyricsLength = (lyrics || "").length;
|
|
@@ -8197,7 +8214,7 @@ function $376e205ced98486b$export$ca030c9435779e4b(font) {
|
|
|
8197
8214
|
formatItemTop(item, _metadata, line) {
|
|
8198
8215
|
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable()) return item.value || "";
|
|
8199
8216
|
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) {
|
|
8200
|
-
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line
|
|
8217
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, this.song, this.configuration.key);
|
|
8201
8218
|
return (0, $21a34a464e7bc609$export$bc3bea8325045070)(chords, this.chordLyricsPairLength(item, line));
|
|
8202
8219
|
}
|
|
8203
8220
|
return "";
|
|
@@ -8281,7 +8298,7 @@ var $d834af97c9a2e4df$export$2e2bcd8739ae039 = $d834af97c9a2e4df$var$HtmlFormatt
|
|
|
8281
8298
|
|
|
8282
8299
|
|
|
8283
8300
|
|
|
8284
|
-
var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , bodyLines: bodyLines , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8301
|
+
var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration , configuration: { key: key } , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , bodyLines: bodyLines , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8285
8302
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(title, ()=>`<h1>${title}</h1>`)}
|
|
8286
8303
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(subtitle, ()=>`<h2>${subtitle}</h2>`)}
|
|
8287
8304
|
|
|
@@ -8296,7 +8313,7 @@ var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration ,
|
|
|
8296
8313
|
<tr>
|
|
8297
8314
|
${(0, $376e205ced98486b$export$79b2f7037acddd43)(line.items, (item)=>`
|
|
8298
8315
|
${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$17c9e635b932873b)(item), ()=>`
|
|
8299
|
-
<td class="chord">${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line
|
|
8316
|
+
<td class="chord">${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, song, key)}</td>
|
|
8300
8317
|
`)}
|
|
8301
8318
|
`)}
|
|
8302
8319
|
</tr>
|
|
@@ -8377,7 +8394,7 @@ var $5b02ea769c63fd56$export$2e2bcd8739ae039 = $5b02ea769c63fd56$var$HtmlTableFo
|
|
|
8377
8394
|
|
|
8378
8395
|
|
|
8379
8396
|
|
|
8380
|
-
var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8397
|
+
var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration , configuration: { key: key } , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , metadata: metadata } })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
|
|
8381
8398
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(title, ()=>`<h1>${title}</h1>`)}
|
|
8382
8399
|
${(0, $376e205ced98486b$export$a55877ca9db47377)(subtitle, ()=>`<h2>${subtitle}</h2>`)}
|
|
8383
8400
|
|
|
@@ -8391,7 +8408,7 @@ var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration ,
|
|
|
8391
8408
|
${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$17c9e635b932873b)(item), ()=>`
|
|
8392
8409
|
<div class="column">
|
|
8393
8410
|
${(0, $376e205ced98486b$export$fae3166c418e0471)([
|
|
8394
|
-
(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line
|
|
8411
|
+
(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line, song, key)
|
|
8395
8412
|
], ([renderedChord])=>`
|
|
8396
8413
|
<div class="chord"${renderedChord ? (0, $376e205ced98486b$export$ca030c9435779e4b)(line.chordFont) : ""}>${renderedChord}</div>
|
|
8397
8414
|
`)}
|