lighteningcards 2.1.2 → 2.1.3

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/dist/index.cjs.js CHANGED
@@ -15124,9 +15124,9 @@ class AbstractBitmapFont extends EventEmitter {
15124
15124
  /**
15125
15125
  * tiny-lru
15126
15126
  *
15127
- * @copyright 2025 Jason Mulligan <jason.mulligan@avoidwork.com>
15127
+ * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
15128
15128
  * @license BSD-3-Clause
15129
- * @version 11.4.5
15129
+ * @version 11.4.7
15130
15130
  */
15131
15131
  /**
15132
15132
  * A high-performance Least Recently Used (LRU) cache implementation with optional TTL support.
@@ -15249,7 +15249,13 @@ class LRU {
15249
15249
  * @since 11.1.0
15250
15250
  */
15251
15251
  entries (keys = this.keys()) {
15252
- return keys.map(key => [key, this.get(key)]);
15252
+ const result = new Array(keys.length);
15253
+ for (let i = 0; i < keys.length; i++) {
15254
+ const key = keys[i];
15255
+ result[i] = [key, this.get(key)];
15256
+ }
15257
+
15258
+ return result;
15253
15259
  }
15254
15260
 
15255
15261
  /**
@@ -15426,11 +15432,12 @@ class LRU {
15426
15432
  * @since 9.0.0
15427
15433
  */
15428
15434
  keys () {
15429
- const result = [];
15435
+ const result = new Array(this.size);
15430
15436
  let x = this.first;
15437
+ let i = 0;
15431
15438
 
15432
15439
  while (x !== null) {
15433
- result.push(x.key);
15440
+ result[i++] = x.key;
15434
15441
  x = x.next;
15435
15442
  }
15436
15443
 
@@ -15559,7 +15566,12 @@ class LRU {
15559
15566
  * @since 11.1.0
15560
15567
  */
15561
15568
  values (keys = this.keys()) {
15562
- return keys.map(key => this.get(key));
15569
+ const result = new Array(keys.length);
15570
+ for (let i = 0; i < keys.length; i++) {
15571
+ result[i] = this.get(keys[i]);
15572
+ }
15573
+
15574
+ return result;
15563
15575
  }
15564
15576
  }
15565
15577
 
@@ -44564,41 +44576,44 @@ const generateBaccaratCardSVG = (rank, suit, width = 200, height = 280) => {
44564
44576
  case "heart":
44565
44577
  return {
44566
44578
  symbol: "♥",
44567
- color: "#DC143C"
44579
+ color: "#7a3030"
44568
44580
  };
44569
44581
  case "diamonds":
44570
44582
  case "diamond":
44571
44583
  return {
44572
44584
  symbol: "♦",
44573
- color: "#DC143C"
44585
+ color: "#7a3030"
44574
44586
  };
44575
44587
  case "clubs":
44576
44588
  case "club":
44577
44589
  return {
44578
44590
  symbol: "♣",
44579
- color: "#000000"
44591
+ color: "#756957"
44580
44592
  };
44581
44593
  case "spades":
44582
44594
  case "spade":
44583
44595
  return {
44584
44596
  symbol: "♠",
44585
- color: "#000000"
44597
+ color: "#756957"
44586
44598
  };
44587
44599
  default:
44588
44600
  return {
44589
44601
  symbol: "♠",
44590
- color: "#000000"
44602
+ color: "#756957"
44591
44603
  };
44592
44604
  }
44593
44605
  };
44594
44606
  const suitInfo = getSuitInfo(suitLower);
44595
44607
  const cornerRadius = 12; // Rounded corners
44596
- const padding = 12; // Padding for corner elements
44608
+ const topBottomPadding = 12; // Top and bottom padding
44609
+ const leftRightPadding = 5; // Left and right padding from border
44597
44610
 
44598
- // Font sizes - set to 86 pixels to match the example size
44599
- const rankFontSize = 86; // Fixed size: 86 pixels
44600
- const suitFontSize = 86; // Fixed size: 86 pixels
44611
+ // Reduced font sizes to keep rank and suit inside the border
44612
+ const rankFontSize = 55; // Smaller rank size
44613
+ const suitFontSize = 55; // Smaller suit size
44601
44614
 
44615
+ // Vertical offset - same for top and bottom
44616
+ const verticalOffset = 10;
44602
44617
  return `
44603
44618
  <svg width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg">
44604
44619
  <defs>
@@ -44613,10 +44628,10 @@ const generateBaccaratCardSVG = (rank, suit, width = 200, height = 280) => {
44613
44628
  </defs>
44614
44629
  <!-- Card background with rounded corners - transparent background -->
44615
44630
  <rect
44616
- x="0"
44617
- y="0"
44618
- width="${width}"
44619
- height="${height}"
44631
+ x="5"
44632
+ y="5"
44633
+ width="${width - 10}"
44634
+ height="${height - 10}"
44620
44635
  rx="${cornerRadius}"
44621
44636
  ry="${cornerRadius}"
44622
44637
  fill="none"
@@ -44627,10 +44642,10 @@ const generateBaccaratCardSVG = (rank, suit, width = 200, height = 280) => {
44627
44642
 
44628
44643
  <!-- Inner border for card frame effect -->
44629
44644
  <rect
44630
- x="2"
44631
- y="2"
44632
- width="${width - 4}"
44633
- height="${height - 4}"
44645
+ x="8"
44646
+ y="8"
44647
+ width="${width - 16}"
44648
+ height="${height - 16}"
44634
44649
  rx="${cornerRadius - 2}"
44635
44650
  ry="${cornerRadius - 2}"
44636
44651
  fill="none"
@@ -44640,12 +44655,12 @@ const generateBaccaratCardSVG = (rank, suit, width = 200, height = 280) => {
44640
44655
 
44641
44656
  <!-- Rank at top left corner -->
44642
44657
  <text
44643
- x="${padding}"
44644
- y="${padding + rankFontSize * 0.8}"
44658
+ x="${topBottomPadding + leftRightPadding}"
44659
+ y="${topBottomPadding + verticalOffset}"
44645
44660
  font-family="Arial, sans-serif"
44646
44661
  font-size="${rankFontSize}"
44647
44662
  font-weight="bold"
44648
- fill="#FFFFFF"
44663
+ fill="${suitInfo.color}"
44649
44664
  text-anchor="start"
44650
44665
  dominant-baseline="hanging"
44651
44666
  stroke="#000000"
@@ -44654,27 +44669,26 @@ const generateBaccaratCardSVG = (rank, suit, width = 200, height = 280) => {
44654
44669
  ${displayRank}
44655
44670
  </text>
44656
44671
 
44657
- <!-- Rank at bottom right corner (inverted) -->
44672
+ <!-- Rank at bottom right corner (not inverted) -->
44658
44673
  <text
44659
- x="${width - padding}"
44660
- y="${height - padding}"
44674
+ x="${width - topBottomPadding - leftRightPadding}"
44675
+ y="${height - topBottomPadding - verticalOffset}"
44661
44676
  font-family="Arial, sans-serif"
44662
44677
  font-size="${rankFontSize}"
44663
44678
  font-weight="bold"
44664
- fill="#FFFFFF"
44679
+ fill="${suitInfo.color}"
44665
44680
  text-anchor="end"
44666
44681
  dominant-baseline="baseline"
44667
44682
  stroke="#000000"
44668
44683
  stroke-width="1.5"
44669
- transform="rotate(180 ${width - padding} ${height - padding})"
44670
44684
  >
44671
44685
  ${displayRank}
44672
44686
  </text>
44673
44687
 
44674
44688
  <!-- Suit at top right corner -->
44675
44689
  <text
44676
- x="${width - padding}"
44677
- y="${padding + suitFontSize * 0.8}"
44690
+ x="${width - topBottomPadding - leftRightPadding}"
44691
+ y="${topBottomPadding + verticalOffset}"
44678
44692
  font-family="Arial, sans-serif"
44679
44693
  font-size="${suitFontSize}"
44680
44694
  font-weight="bold"
@@ -44687,10 +44701,10 @@ const generateBaccaratCardSVG = (rank, suit, width = 200, height = 280) => {
44687
44701
  ${suitInfo.symbol}
44688
44702
  </text>
44689
44703
 
44690
- <!-- Suit at bottom left corner (inverted) -->
44704
+ <!-- Suit at bottom left corner (not inverted) -->
44691
44705
  <text
44692
- x="${padding}"
44693
- y="${height - padding}"
44706
+ x="${topBottomPadding + leftRightPadding}"
44707
+ y="${height - topBottomPadding - verticalOffset}"
44694
44708
  font-family="Arial, sans-serif"
44695
44709
  font-size="${suitFontSize}"
44696
44710
  font-weight="bold"
@@ -44699,7 +44713,6 @@ const generateBaccaratCardSVG = (rank, suit, width = 200, height = 280) => {
44699
44713
  dominant-baseline="baseline"
44700
44714
  stroke="#000000"
44701
44715
  stroke-width="1"
44702
- transform="rotate(180 ${padding} ${height - padding})"
44703
44716
  >
44704
44717
  ${suitInfo.symbol}
44705
44718
  </text>
@@ -44817,10 +44830,10 @@ const useBaccaratCard = () => {
44817
44830
  if (bg_sprite) {
44818
44831
  // Use the sprite's scaled height to position at the very top
44819
44832
  const bgHeight = bg_sprite.height;
44820
- multiplierText.y = -bgHeight / 2 + 8; // Closer to the top edge
44833
+ multiplierText.y = -bgHeight / 2 + 12; // Increased top padding for multiplier
44821
44834
  } else {
44822
44835
  // Fallback if no background
44823
- multiplierText.y = -cardHeight * cardScale / 2 + 5;
44836
+ multiplierText.y = -cardHeight * cardScale / 2 + 8;
44824
44837
  }
44825
44838
  cardContainer.addChild(multiplierText);
44826
44839
  }
@@ -44997,10 +45010,10 @@ const useBaccaratCardStart = () => {
44997
45010
  if (bg_sprite) {
44998
45011
  // Use the sprite's scaled height to position at the very top
44999
45012
  const bgHeight = bg_sprite.height;
45000
- multiplierText.y = -bgHeight / 2 + 8; // Closer to the top edge
45013
+ multiplierText.y = -bgHeight / 2 + 12; // Increased top padding for multiplier
45001
45014
  } else {
45002
45015
  // Fallback if no background
45003
- multiplierText.y = -cardHeight * cardScale / 2 + 5;
45016
+ multiplierText.y = -cardHeight * cardScale / 2 + 8;
45004
45017
  }
45005
45018
  cardContainer.addChild(multiplierText);
45006
45019
  }