@microlee666/dom-to-pptx 1.1.5 → 1.1.6

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.
@@ -5,7 +5,8 @@
5
5
  "mcp__chrome-devtools__take_screenshot",
6
6
  "Bash(python3 -c:*)",
7
7
  "Bash(unzip -l:*)",
8
- "Bash(unzip -p:*)"
8
+ "Bash(unzip -p:*)",
9
+ "Bash(open:*)"
9
10
  ]
10
11
  }
11
12
  }
@@ -64963,16 +64963,36 @@
64963
64963
  const className = (node.className || '').toLowerCase();
64964
64964
 
64965
64965
  // Real badges/pills typically have visible styling (background, border, or large border-radius)
64966
- const hasVisibleBackground = bgColorObj.hex && bgColorObj.opacity > 0.1;
64966
+ const hasVisibleBackground = (bgColorObj.hex && bgColorObj.opacity > 0.1) || hasGradient;
64967
64967
  const hasVisibleBorder = borderWidth > 0;
64968
64968
  const hasLargeBorderRadius = borderRadius >= height / 2;
64969
- const hasBadgeClass = className.includes('badge') || className.includes('pill');
64969
+ const hasBadgeClass = className.includes('badge') || className.includes('pill') || className.includes('tag');
64970
+
64971
+ // Check if it's a small tag/label with rounded corners and short text
64972
+ const paddingLeft = parseFloat(style.paddingLeft) || 0;
64973
+ const paddingRight = parseFloat(style.paddingRight) || 0;
64974
+ const paddingTop = parseFloat(style.paddingTop) || 0;
64975
+ const paddingBottom = parseFloat(style.paddingBottom) || 0;
64976
+ const hasSmallPadding = Math.max(paddingLeft, paddingRight, paddingTop, paddingBottom) <= 12;
64977
+ const hasEvenPadding = Math.abs(paddingTop - paddingBottom) <= 4 && Math.abs(paddingLeft - paddingRight) <= 8;
64978
+ const hasRoundedCorners = borderRadius >= 3;
64979
+ const isInlineBlock = style.display === 'inline-block' || style.display === 'inline-flex';
64980
+
64981
+ // Small tag detection: inline-block with background, rounded corners, small even padding, and short text
64982
+ const isSmallTag =
64983
+ isInlineBlock &&
64984
+ hasVisibleBackground &&
64985
+ hasRoundedCorners &&
64986
+ hasSmallPadding &&
64987
+ hasEvenPadding &&
64988
+ textContent.length <= 10;
64970
64989
 
64971
64990
  // Only consider it a badge if it has visual styling AND short text
64972
64991
  const isLikelyBadge =
64973
- (hasLargeBorderRadius || hasBadgeClass) &&
64974
- textContent.length <= 10 &&
64975
- (hasVisibleBackground || hasVisibleBorder || hasLargeBorderRadius);
64992
+ ((hasLargeBorderRadius || hasBadgeClass) &&
64993
+ textContent.length <= 10 &&
64994
+ (hasVisibleBackground || hasVisibleBorder || hasLargeBorderRadius)) ||
64995
+ isSmallTag;
64976
64996
 
64977
64997
  if (isLikelyBadge) {
64978
64998
  align = 'center';
@@ -64963,16 +64963,36 @@
64963
64963
  const className = (node.className || '').toLowerCase();
64964
64964
 
64965
64965
  // Real badges/pills typically have visible styling (background, border, or large border-radius)
64966
- const hasVisibleBackground = bgColorObj.hex && bgColorObj.opacity > 0.1;
64966
+ const hasVisibleBackground = (bgColorObj.hex && bgColorObj.opacity > 0.1) || hasGradient;
64967
64967
  const hasVisibleBorder = borderWidth > 0;
64968
64968
  const hasLargeBorderRadius = borderRadius >= height / 2;
64969
- const hasBadgeClass = className.includes('badge') || className.includes('pill');
64969
+ const hasBadgeClass = className.includes('badge') || className.includes('pill') || className.includes('tag');
64970
+
64971
+ // Check if it's a small tag/label with rounded corners and short text
64972
+ const paddingLeft = parseFloat(style.paddingLeft) || 0;
64973
+ const paddingRight = parseFloat(style.paddingRight) || 0;
64974
+ const paddingTop = parseFloat(style.paddingTop) || 0;
64975
+ const paddingBottom = parseFloat(style.paddingBottom) || 0;
64976
+ const hasSmallPadding = Math.max(paddingLeft, paddingRight, paddingTop, paddingBottom) <= 12;
64977
+ const hasEvenPadding = Math.abs(paddingTop - paddingBottom) <= 4 && Math.abs(paddingLeft - paddingRight) <= 8;
64978
+ const hasRoundedCorners = borderRadius >= 3;
64979
+ const isInlineBlock = style.display === 'inline-block' || style.display === 'inline-flex';
64980
+
64981
+ // Small tag detection: inline-block with background, rounded corners, small even padding, and short text
64982
+ const isSmallTag =
64983
+ isInlineBlock &&
64984
+ hasVisibleBackground &&
64985
+ hasRoundedCorners &&
64986
+ hasSmallPadding &&
64987
+ hasEvenPadding &&
64988
+ textContent.length <= 10;
64970
64989
 
64971
64990
  // Only consider it a badge if it has visual styling AND short text
64972
64991
  const isLikelyBadge =
64973
- (hasLargeBorderRadius || hasBadgeClass) &&
64974
- textContent.length <= 10 &&
64975
- (hasVisibleBackground || hasVisibleBorder || hasLargeBorderRadius);
64992
+ ((hasLargeBorderRadius || hasBadgeClass) &&
64993
+ textContent.length <= 10 &&
64994
+ (hasVisibleBackground || hasVisibleBorder || hasLargeBorderRadius)) ||
64995
+ isSmallTag;
64976
64996
 
64977
64997
  if (isLikelyBadge) {
64978
64998
  align = 'center';
@@ -2781,16 +2781,36 @@ function prepareRenderItem(
2781
2781
  const className = (node.className || '').toLowerCase();
2782
2782
 
2783
2783
  // Real badges/pills typically have visible styling (background, border, or large border-radius)
2784
- const hasVisibleBackground = bgColorObj.hex && bgColorObj.opacity > 0.1;
2784
+ const hasVisibleBackground = (bgColorObj.hex && bgColorObj.opacity > 0.1) || hasGradient;
2785
2785
  const hasVisibleBorder = borderWidth > 0;
2786
2786
  const hasLargeBorderRadius = borderRadius >= height / 2;
2787
- const hasBadgeClass = className.includes('badge') || className.includes('pill');
2787
+ const hasBadgeClass = className.includes('badge') || className.includes('pill') || className.includes('tag');
2788
+
2789
+ // Check if it's a small tag/label with rounded corners and short text
2790
+ const paddingLeft = parseFloat(style.paddingLeft) || 0;
2791
+ const paddingRight = parseFloat(style.paddingRight) || 0;
2792
+ const paddingTop = parseFloat(style.paddingTop) || 0;
2793
+ const paddingBottom = parseFloat(style.paddingBottom) || 0;
2794
+ const hasSmallPadding = Math.max(paddingLeft, paddingRight, paddingTop, paddingBottom) <= 12;
2795
+ const hasEvenPadding = Math.abs(paddingTop - paddingBottom) <= 4 && Math.abs(paddingLeft - paddingRight) <= 8;
2796
+ const hasRoundedCorners = borderRadius >= 3;
2797
+ const isInlineBlock = style.display === 'inline-block' || style.display === 'inline-flex';
2798
+
2799
+ // Small tag detection: inline-block with background, rounded corners, small even padding, and short text
2800
+ const isSmallTag =
2801
+ isInlineBlock &&
2802
+ hasVisibleBackground &&
2803
+ hasRoundedCorners &&
2804
+ hasSmallPadding &&
2805
+ hasEvenPadding &&
2806
+ textContent.length <= 10;
2788
2807
 
2789
2808
  // Only consider it a badge if it has visual styling AND short text
2790
2809
  const isLikelyBadge =
2791
- (hasLargeBorderRadius || hasBadgeClass) &&
2792
- textContent.length <= 10 &&
2793
- (hasVisibleBackground || hasVisibleBorder || hasLargeBorderRadius);
2810
+ ((hasLargeBorderRadius || hasBadgeClass) &&
2811
+ textContent.length <= 10 &&
2812
+ (hasVisibleBackground || hasVisibleBorder || hasLargeBorderRadius)) ||
2813
+ isSmallTag;
2794
2814
 
2795
2815
  if (isLikelyBadge) {
2796
2816
  align = 'center';