svgfusion 1.11.0 → 1.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/dist/cli.js CHANGED
@@ -80774,6 +80774,16 @@ var ColorSplittingFeature = class {
80774
80774
  newAttributes["stop-color"]
80775
80775
  )}}`;
80776
80776
  }
80777
+ if (this.isDrawableElement(el2.tag)) {
80778
+ const originalHadFill = el2.attributes.fill !== void 0 && el2.attributes.fill !== "";
80779
+ const originalHadStroke = el2.attributes.stroke !== void 0 && el2.attributes.stroke !== "";
80780
+ if (originalHadFill && !originalHadStroke && !newAttributes.stroke) {
80781
+ newAttributes.stroke = "none";
80782
+ }
80783
+ if (originalHadStroke && !originalHadFill && !newAttributes.fill) {
80784
+ newAttributes.fill = "none";
80785
+ }
80786
+ }
80777
80787
  return { ...el2, attributes: newAttributes };
80778
80788
  });
80779
80789
  }
@@ -80819,6 +80829,24 @@ var ColorSplittingFeature = class {
80819
80829
  )
80820
80830
  };
80821
80831
  }
80832
+ /**
80833
+ * Check if an element is a drawable SVG element that can have fill/stroke
80834
+ */
80835
+ isDrawableElement(tag) {
80836
+ const drawableElements = [
80837
+ "path",
80838
+ "circle",
80839
+ "ellipse",
80840
+ "line",
80841
+ "rect",
80842
+ "polygon",
80843
+ "polyline",
80844
+ "text",
80845
+ "tspan",
80846
+ "use"
80847
+ ];
80848
+ return drawableElements.includes(tag);
80849
+ }
80822
80850
  /**
80823
80851
  * Check if a color value is valid and should be replaced
80824
80852
  */
package/dist/index.d.mts CHANGED
@@ -450,6 +450,10 @@ declare class ColorSplittingFeature {
450
450
  * Transform element and all its children
451
451
  */
452
452
  private transformElement;
453
+ /**
454
+ * Check if an element is a drawable SVG element that can have fill/stroke
455
+ */
456
+ private isDrawableElement;
453
457
  /**
454
458
  * Check if a color value is valid and should be replaced
455
459
  */
package/dist/index.d.ts CHANGED
@@ -450,6 +450,10 @@ declare class ColorSplittingFeature {
450
450
  * Transform element and all its children
451
451
  */
452
452
  private transformElement;
453
+ /**
454
+ * Check if an element is a drawable SVG element that can have fill/stroke
455
+ */
456
+ private isDrawableElement;
453
457
  /**
454
458
  * Check if a color value is valid and should be replaced
455
459
  */