chordsheetjs 15.2.0 → 15.3.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/lib/bundle.js CHANGED
@@ -5531,6 +5531,7 @@ ${error.stack}`);
5531
5531
  key: null,
5532
5532
  metadata: $287d3e472e1fbd90$export$a014e67b549cbef4,
5533
5533
  normalizeChords: true,
5534
+ normalizeChordSuffix: true,
5534
5535
  useUnicodeModifiers: false,
5535
5536
  user: null
5536
5537
  };
@@ -6414,6 +6415,12 @@ ${error.stack}`);
6414
6415
  };
6415
6416
  var $15f1d40e3d1ed3a0$export$2e2bcd8739ae039 = $15f1d40e3d1ed3a0$var$Ternary;
6416
6417
  var $244a67400187e14e$var$ChordProFormatter = class extends (0, $ed0d9ddbbe7224cd$export$2e2bcd8739ae039) {
6418
+ getDefaultConfiguration() {
6419
+ return {
6420
+ ...(0, $fe1d3ba9df1ecad5$export$cb4529290f33d264)(),
6421
+ normalizeChordSuffix: false
6422
+ };
6423
+ }
6417
6424
  /**
6418
6425
  * Formats a song into a ChordPro chord sheet.
6419
6426
  * @param {Song} song The song to be formatted
@@ -6539,7 +6546,9 @@ ${formattedContentLines}`;
6539
6546
  if (chordLyricsPair.chords) {
6540
6547
  const chordObj = chordLyricsPair.chord;
6541
6548
  if (!chordObj) return `[${chordLyricsPair.chords}]`;
6542
- const finalChord = this.configuration.normalizeChords ? chordObj.normalize() : chordObj;
6549
+ const finalChord = this.configuration.normalizeChords ? chordObj.normalize(null, {
6550
+ normalizeSuffix: this.configuration.normalizeChordSuffix
6551
+ }) : chordObj;
6543
6552
  return `[${finalChord}]`;
6544
6553
  }
6545
6554
  if (chordLyricsPair.annotation) return `[*${chordLyricsPair.annotation}]`;
@@ -7399,6 +7408,7 @@ ${formattedContentLines}`;
7399
7408
  contextKey: null,
7400
7409
  decapo: false,
7401
7410
  normalizeChords: true,
7411
+ normalizeChordSuffix: true,
7402
7412
  renderKey: null,
7403
7413
  songKey: null,
7404
7414
  style: null,
@@ -7414,6 +7424,7 @@ ${formattedContentLines}`;
7414
7424
  this.capo = config.decapo ? config.capo : 0;
7415
7425
  this.contextKey = config.contextKey;
7416
7426
  this.normalizeChords = config.normalizeChords;
7427
+ this.normalizeChordSuffix = config.normalizeChordSuffix;
7417
7428
  this.renderKey = config.renderKey;
7418
7429
  this.songKey = config.songKey;
7419
7430
  this.style = config.style;
@@ -7426,7 +7437,9 @@ ${formattedContentLines}`;
7426
7437
  return (0, $28a2fcb6fb95a147$export$79570e60478bce41)(chord, [
7427
7438
  (c) => c.transpose(this.effectiveTransposeDistance),
7428
7439
  (c) => this.accidental ? c.useAccidental(this.accidental) : c,
7429
- (c) => this.normalizeChords ? c.normalize(this.effectiveKey) : c,
7440
+ (c) => this.normalizeChords ? c.normalize(this.effectiveKey, {
7441
+ normalizeSuffix: this.normalizeChordSuffix
7442
+ }) : c,
7430
7443
  (c) => this.changeChordType(c)
7431
7444
  ]).toString({
7432
7445
  useUnicodeModifier: this.useUnicodeModifier
@@ -7820,13 +7833,25 @@ ${formattedContentLines}`;
7820
7833
  if (/^\d+$/.test(transposeKey)) return parseInt(transposeKey, 10);
7821
7834
  return (0, $c2d6ab25ad00308f$export$2e2bcd8739ae039).distance(songKey, transposeKey);
7822
7835
  }
7823
- function $2ce1086ce25c9ac0$export$596ec52955da9472(chordString, line, song, { renderKey = null, useUnicodeModifier = false, normalizeChords = true, decapo = false } = {}) {
7836
+ var $2ce1086ce25c9ac0$var$renderChordDefaults = {
7837
+ renderKey: null,
7838
+ useUnicodeModifier: false,
7839
+ normalizeChords: true,
7840
+ normalizeChordSuffix: true,
7841
+ decapo: false
7842
+ };
7843
+ function $2ce1086ce25c9ac0$export$596ec52955da9472(chordString, line, song, options = {}) {
7844
+ const { renderKey, useUnicodeModifier, normalizeChords, normalizeChordSuffix, decapo } = {
7845
+ ...$2ce1086ce25c9ac0$var$renderChordDefaults,
7846
+ ...options
7847
+ };
7824
7848
  const capoString = song.metadata.getSingle((0, $d21c5c7a462f3c34$export$866f445d49bad88e));
7825
7849
  return new (0, $e02a17f5a26edf19$export$2e2bcd8739ae039)({
7826
7850
  capo: capoString ? parseInt(capoString, 10) : 0,
7827
7851
  contextKey: (0, $c2d6ab25ad00308f$export$2e2bcd8739ae039).wrap(line.key || song.key),
7828
7852
  decapo,
7829
7853
  normalizeChords,
7854
+ normalizeChordSuffix,
7830
7855
  renderKey,
7831
7856
  songKey: (0, $c2d6ab25ad00308f$export$2e2bcd8739ae039).wrap(song.key),
7832
7857
  style: song.metadata.getSingle((0, $d21c5c7a462f3c34$export$d8cbdf44b1f66df1)),
@@ -13170,7 +13195,7 @@ Or set the song key before changing key:
13170
13195
  ];
13171
13196
  }
13172
13197
  var $e136d63bbe28a4e0$var$WHITE_SPACE = /\s/;
13173
- var $e136d63bbe28a4e0$var$CHORD_LINE_REGEX = /^\s*((([A-G|Do|Re|Mi|Fa|Sol|La|Si])(#|b)?([^/\s]*)(\/([A-G|Do|Re|Mi|Fa|Sol|La|Si])(#|b)?)?)(\s|$)+)+(\s|$)+/;
13198
+ var $e136d63bbe28a4e0$var$CHORD_LINE_REGEX = /^\s*(((?:[A-G]|Do|Re|Mi|Fa|Sol|La|Si)(#|b)?([^/\s]*)(\/(?:[A-G]|Do|Re|Mi|Fa|Sol|La|Si)(#|b)?)?)(\s|$)+)+(\s|$)+/;
13174
13199
  var $e136d63bbe28a4e0$var$ChordSheetParser = class {
13175
13200
  /**
13176
13201
  * Instantiate a chord sheet parser
@@ -13698,6 +13723,7 @@ Or set the song key before changing key:
13698
13723
  return (0, $2ce1086ce25c9ac0$export$596ec52955da9472)(item.chords, line, this.song, {
13699
13724
  renderKey: this.configuration.key,
13700
13725
  normalizeChords: this.configuration.normalizeChords,
13726
+ normalizeChordSuffix: this.configuration.normalizeChordSuffix,
13701
13727
  decapo: this.configuration.decapo
13702
13728
  });
13703
13729
  }
@@ -26184,6 +26210,7 @@ Or set the song key before changing key:
26184
26210
  renderKey: key,
26185
26211
  useUnicodeModifier: configuration.useUnicodeModifiers,
26186
26212
  normalizeChords: configuration.normalizeChords,
26213
+ normalizeChordSuffix: configuration.normalizeChordSuffix,
26187
26214
  decapo: configuration.decapo
26188
26215
  })}
26189
26216
  </div>
@@ -26350,6 +26377,7 @@ Or set the song key before changing key:
26350
26377
  renderKey: key,
26351
26378
  useUnicodeModifier: configuration.useUnicodeModifiers,
26352
26379
  normalizeChords: configuration.normalizeChords,
26380
+ normalizeChordSuffix: configuration.normalizeChordSuffix,
26353
26381
  decapo: configuration.decapo
26354
26382
  })}</td>
26355
26383
  `;
@@ -27188,6 +27216,7 @@ Or set the song key before changing key:
27188
27216
  renderKey: this.configuration.key,
27189
27217
  useUnicodeModifier: this.configuration.useUnicodeModifiers,
27190
27218
  normalizeChords: this.configuration.normalizeChords,
27219
+ normalizeChordSuffix: this.configuration.normalizeChordSuffix,
27191
27220
  decapo: this.configuration.decapo
27192
27221
  });
27193
27222
  return chords;
@@ -28338,6 +28367,7 @@ ${template}
28338
28367
  renderKey: null,
28339
28368
  useUnicodeModifier: this.config.useUnicodeModifiers,
28340
28369
  normalizeChords: this.config.normalizeChords,
28370
+ normalizeChordSuffix: this.config.normalizeChordSuffix,
28341
28371
  decapo: this.config.decapo
28342
28372
  });
28343
28373
  }
@@ -29336,6 +29366,7 @@ ${template}
29336
29366
  linePadding: this.configuration.layout.sections.global.linePadding,
29337
29367
  useUnicodeModifiers: this.configuration.useUnicodeModifiers,
29338
29368
  normalizeChords: this.configuration.normalizeChords,
29369
+ normalizeChordSuffix: this.configuration.normalizeChordSuffix,
29339
29370
  // Column and page layout information
29340
29371
  minY: dimensions.minY,
29341
29372
  columnWidth: dimensions.columnWidth,
@@ -29383,7 +29414,7 @@ ${template}
29383
29414
  var $a5a21ced491ea51f$var$UG_METADATA_REGEX = /^(\w+):\s*(.+)$/;
29384
29415
  var $a5a21ced491ea51f$var$OTHER_METADATA_LINE_REGEX = /^\[([^\]]+)]/;
29385
29416
  var $a5a21ced491ea51f$var$REPEAT_NOTATION_REGEX = /\s+(x\d+)\s*$/i;
29386
- var $a5a21ced491ea51f$var$CHORD_LINE_REGEX = /^\s*((([A-G|Do|Re|Mi|Fa|Sol|La|Si])(#|b)?([^/\s]*)(\/([A-G|Do|Re|Mi|Fa|Sol|La|Si])(#|b)?)?)(\s|$)+)+(\s|$)+/;
29417
+ var $a5a21ced491ea51f$var$CHORD_LINE_REGEX = /^\s*(((?:[A-G]|Do|Re|Mi|Fa|Sol|La|Si)(#|b)?([^/\s]*)(\/(?:[A-G]|Do|Re|Mi|Fa|Sol|La|Si)(#|b)?)?)(\s|$)+)+(\s|$)+/;
29387
29418
  var $a5a21ced491ea51f$var$startSectionTags = {
29388
29419
  [(0, $dce48cb70c4120bb$export$4b194284baed1659)]: (0, $d21c5c7a462f3c34$export$deca399f8cd9b7dc),
29389
29420
  [(0, $dce48cb70c4120bb$export$8db6c706fc9142b2)]: (0, $d21c5c7a462f3c34$export$4f5168acae064e01),
@@ -29584,7 +29615,7 @@ ${template}
29584
29615
  }
29585
29616
  };
29586
29617
  var $a5a21ced491ea51f$export$2e2bcd8739ae039 = $a5a21ced491ea51f$var$UltimateGuitarParser;
29587
- var $ae92e002ce14f11a$export$2e2bcd8739ae039 = "15.2.0";
29618
+ var $ae92e002ce14f11a$export$2e2bcd8739ae039 = "15.3.0";
29588
29619
  var $2a7926da41d163b3$export$191a710ad3c9a989 = {
29589
29620
  configure: $181068e44290b873$export$8d21e34596265fa2,
29590
29621
  getDefaultConfig: $fe1d3ba9df1ecad5$export$ed30944e0fe6ae5c,