svgfusion 1.16.1 → 1.17.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/browser.mjs CHANGED
@@ -108,7 +108,7 @@ ${i}
108
108
  </svg>`}elementToVueTemplate(r,n=0){let s=" ".repeat(n),{tag:i,attributes:o,children:u,content:a}=r,l=[],c=[],f="class"in o;if(Object.entries(o).forEach(([D,h])=>{if(D==="vector-effect"&&h==="non-scaling-stroke")l.push(`:vector-effect="props.isFixedStrokeWidth ? 'non-scaling-stroke' : 'none'"`);else if(D==="style"){let m=this.parseStyleStringForVue(h);l.push(`:style="${m}"`);let g=this.extractClassVarsFromStyle(h);c.push(...g);}else if(h.startsWith("{")&&h.endsWith("}")){let m=h.slice(1,-1);if(l.push(`:${D}="props.${m}"`),D==="fill"||D==="stroke"||D==="stroke-width"){let g=`${m}Class`;c.push(`props.${g}`);}}else l.push(`${D}="${h}"`);}),c.length>0){let D=o.class;D?l.push(`:class="[${c.join(", ")}, '${D}']"`):l.push(`:class="[${c.join(", ")}]"`);}else if(f){let D=o.class;D&&l.push(`class="${D}"`);}let p=l.length>0?" "+l.join(" "):"";if(u.length===0&&!a)return `${s}<${i}${p} />`;let d=`${s}<${i}${p}>`;return a&&(d+=a),u.length>0&&(d+=`
109
109
  `,d+=u.map(D=>this.elementToVueTemplate(D,n+1)).join(`
110
110
  `),d+=`
111
- `+s),d+=`</${i}>`,d}generateScript(r){return this.vueOptions.scriptSetup?this.generateScriptSetup(r):this.vueOptions.composition?this.generateCompositionAPI(r):this.generateOptionsAPI(r)}generateScriptSetup(r){let{colorMappings:n,strokeWidthMappings:s,metadata:i}=r,o=[];if(this.vueOptions.typescript&&(o.push('import type { SVGAttributes } from "vue";'),o.push("")),this.vueOptions.typescript){o.push("interface Props extends /* @vue-ignore */ SVGAttributes {"),o.push(" title?: string;"),o.push(" titleId?: string;"),o.push(" desc?: string;"),o.push(" descId?: string;"),o.push(" size?: string;");let u=this.generateColorPropsInterface(n);u&&o.push(u);let a=this.generateStrokeWidthPropsInterface(s);a&&o.push(a),i.features.includes("fixed-stroke-width")&&o.push(" isFixedStrokeWidth?: boolean;"),o.push("}"),o.push(""),o.push("const props = withDefaults(defineProps<Props>(), {");}else o.push("const props = defineProps({"),o.push(" title: { type: String, default: '' },"),o.push(" titleId: { type: String, default: '' },"),o.push(" desc: { type: String, default: '' },"),o.push(" descId: { type: String, default: '' },"),o.push(" class: { type: String, default: '' },"),o.push(" style: { type: Object, default: '' },"),o.push(" width: { type: [String, Number], default: '' },"),o.push(" height: { type: [String, Number], default: '' },"),o.push(' size: { type: String, default: "20" },');return this.vueOptions.typescript&&o.push(' size: "20",'),n.forEach(u=>{let a=u.variableName,l=u.originalColor,c=`${a}Class`;this.vueOptions.typescript?(o.push(` ${a}: '${l}',`),o.push(` ${c}: "",`)):(o.push(` ${a}: { type: String, default: '${l}' },`),o.push(` ${c}: { type: String, default: "" },`));}),s.forEach(u=>{let a=u.variableName,l=u.originalStrokeWidth,c=`${a}Class`;this.vueOptions.typescript?(o.push(` ${a}: '${l}',`),o.push(` ${c}: ""`)):(o.push(` ${a}: { type: [String, Number], default: '${l}' },`),o.push(` ${c}: { type: String, default: "" },`));}),i.features.includes("fixed-stroke-width")&&(this.vueOptions.typescript?o.push(" isFixedStrokeWidth: true,"):o.push(" isFixedStrokeWidth: { type: Boolean, default: true },")),o.push("});"),o.join(`
111
+ `+s),d+=`</${i}>`,d}generateScript(r){return this.vueOptions.scriptSetup?this.generateScriptSetup(r):this.vueOptions.composition?this.generateCompositionAPI(r):this.generateOptionsAPI(r)}generateScriptSetup(r){let{colorMappings:n,strokeWidthMappings:s,metadata:i}=r,o=[];if(this.vueOptions.typescript&&(o.push('import type { SVGAttributes } from "vue";'),o.push("")),this.vueOptions.typescript){o.push("interface Props extends /* @vue-ignore */ SVGAttributes {"),o.push(" title?: string;"),o.push(" titleId?: string;"),o.push(" desc?: string;"),o.push(" descId?: string;"),o.push(" size?: string;");let u=this.generateColorPropsInterface(n);u&&o.push(u);let a=this.generateStrokeWidthPropsInterface(s);a&&o.push(a),i.features.includes("fixed-stroke-width")&&o.push(" isFixedStrokeWidth?: boolean;"),o.push("}"),o.push(""),o.push("const props = withDefaults(defineProps<Props>(), {");}else o.push("const props = defineProps({"),o.push(" title: { type: String, default: '' },"),o.push(" titleId: { type: String, default: '' },"),o.push(" desc: { type: String, default: '' },"),o.push(" descId: { type: String, default: '' },"),o.push(" class: { type: String, default: '' },"),o.push(" style: { type: Object, default: '' },"),o.push(" width: { type: [String, Number], default: '' },"),o.push(" height: { type: [String, Number], default: '' },"),o.push(' size: { type: String, default: "20" },');return this.vueOptions.typescript&&o.push(' size: "20",'),n.forEach(u=>{let a=u.variableName,l=u.originalColor,c=`${a}Class`;this.vueOptions.typescript?(o.push(` ${a}: '${l}',`),o.push(` ${c}: "",`)):(o.push(` ${a}: { type: String, default: '${l}' },`),o.push(` ${c}: { type: String, default: "" },`));}),s.forEach(u=>{let a=u.variableName,l=u.originalStrokeWidth,c=`${a}Class`;this.vueOptions.typescript?(o.push(` ${a}: '${l}',`),o.push(` ${c}: "",`)):(o.push(` ${a}: { type: [String, Number], default: '${l}' },`),o.push(` ${c}: { type: String, default: "" },`));}),i.features.includes("fixed-stroke-width")&&(this.vueOptions.typescript?o.push(" isFixedStrokeWidth: true,"):o.push(" isFixedStrokeWidth: { type: Boolean, default: true },")),o.push("});"),o.join(`
112
112
  `)}generateCompositionAPI(r){let{colorMappings:n,strokeWidthMappings:s,metadata:i}=r,o=this.getComponentName(),u=[];return u.push("import { defineComponent } from 'vue';"),u.push(""),u.push("export default defineComponent({"),u.push(` name: '${o}',`),u.push(" props: {"),u.push(" title: { type: String, default: '' },"),u.push(" titleId: { type: String, default: '' },"),u.push(" desc: { type: String, default: '' },"),u.push(" descId: { type: String, default: '' },"),u.push(" class: { type: String, default: '' },"),u.push(" style: { type: Object, default: '' },"),u.push(" width: { type: [String, Number], default: '' },"),u.push(" height: { type: [String, Number], default: '' },"),n.forEach(a=>{let l=a.variableName,c=a.originalColor,f=`${l}Class`;u.push(` ${l}: { type: String, default: '${c}' },`),u.push(` ${f}: { type: String, default: "" },`);}),s.forEach(a=>{let l=a.variableName,c=a.originalStrokeWidth,f=`${l}Class`;u.push(` ${l}: { type: [String, Number], default: '${c}' },`),u.push(` ${f}: { type: String, default: "" },`);}),i.features.includes("fixed-stroke-width")&&u.push(" isFixedStrokeWidth: { type: Boolean, default: true },"),u.push(" },"),u.push(" setup() {"),u.push(" return {};"),u.push(" },"),u.push("});"),u.join(`
113
113
  `)}generateOptionsAPI(r){let{colorMappings:n,strokeWidthMappings:s,metadata:i}=r,o=this.getComponentName(),u=[];return u.push("export default {"),u.push(` name: '${o}',`),u.push(" props: {"),u.push(" title: { type: String, default: '' },"),u.push(" titleId: { type: String, default: '' },"),u.push(" desc: { type: String, default: '' },"),u.push(" descId: { type: String, default: '' },"),u.push(" class: { type: String, default: '' },"),u.push(" style: { type: Object, default: '' },"),u.push(" width: { type: [String, Number], default: '' },"),u.push(" height: { type: [String, Number], default: '' },"),n.forEach(a=>{let l=a.variableName,c=a.originalColor,f=`${l}Class`;u.push(` ${l}: { type: String, default: '${c}' },`),u.push(` ${f}: { type: String, default: "" },`);}),s.forEach(a=>{let l=a.variableName,c=a.originalStrokeWidth,f=`${l}Class`;u.push(` ${l}: { type: [String, Number], default: '${c}' },`),u.push(` ${f}: { type: String, default: "" },`);}),i.features.includes("fixed-stroke-width")&&u.push(" isFixedStrokeWidth: { type: Boolean, default: true },"),u.push(" },"),u.push("};"),u.join(`
114
114
  `)}generateStyle(){return ""}generateColorPropsInterface(r){return r.length===0?"":r.map(n=>{let s=n.variableName,i=`${s}Class`;return ` ${s}?: string;
package/dist/cli.js CHANGED
@@ -102263,7 +102263,7 @@ ${children}
102263
102263
  const className = `${propName}Class`;
102264
102264
  if (this.vueOptions.typescript) {
102265
102265
  lines.push(` ${propName}: '${defaultValue}',`);
102266
- lines.push(` ${className}: ""`);
102266
+ lines.push(` ${className}: "",`);
102267
102267
  } else {
102268
102268
  lines.push(
102269
102269
  ` ${propName}: { type: [String, Number], default: '${defaultValue}' },`
package/dist/index.js CHANGED
@@ -638,7 +638,7 @@ ${a}
638
638
  </svg>`}elementToVueTemplate(t,r=0){let i=" ".repeat(r),{tag:a,attributes:o,children:u,content:c}=t,l=[],h=[],p="class"in o;if(Object.entries(o).forEach(([b,C])=>{if(b==="vector-effect"&&C==="non-scaling-stroke")l.push(`:vector-effect="props.isFixedStrokeWidth ? 'non-scaling-stroke' : 'none'"`);else if(b==="style"){let P=this.parseStyleStringForVue(C);l.push(`:style="${P}"`);let U=this.extractClassVarsFromStyle(C);h.push(...U);}else if(C.startsWith("{")&&C.endsWith("}")){let P=C.slice(1,-1);if(l.push(`:${b}="props.${P}"`),b==="fill"||b==="stroke"||b==="stroke-width"){let U=`${P}Class`;h.push(`props.${U}`);}}else l.push(`${b}="${C}"`);}),h.length>0){let b=o.class;b?l.push(`:class="[${h.join(", ")}, '${b}']"`):l.push(`:class="[${h.join(", ")}]"`);}else if(p){let b=o.class;b&&l.push(`class="${b}"`);}let f=l.length>0?" "+l.join(" "):"";if(u.length===0&&!c)return `${i}<${a}${f} />`;let v=`${i}<${a}${f}>`;return c&&(v+=c),u.length>0&&(v+=`
639
639
  `,v+=u.map(b=>this.elementToVueTemplate(b,r+1)).join(`
640
640
  `),v+=`
641
- `+i),v+=`</${a}>`,v}generateScript(t){return this.vueOptions.scriptSetup?this.generateScriptSetup(t):this.vueOptions.composition?this.generateCompositionAPI(t):this.generateOptionsAPI(t)}generateScriptSetup(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=[];if(this.vueOptions.typescript&&(o.push('import type { SVGAttributes } from "vue";'),o.push("")),this.vueOptions.typescript){o.push("interface Props extends /* @vue-ignore */ SVGAttributes {"),o.push(" title?: string;"),o.push(" titleId?: string;"),o.push(" desc?: string;"),o.push(" descId?: string;"),o.push(" size?: string;");let u=this.generateColorPropsInterface(r);u&&o.push(u);let c=this.generateStrokeWidthPropsInterface(i);c&&o.push(c),a.features.includes("fixed-stroke-width")&&o.push(" isFixedStrokeWidth?: boolean;"),o.push("}"),o.push(""),o.push("const props = withDefaults(defineProps<Props>(), {");}else o.push("const props = defineProps({"),o.push(" title: { type: String, default: '' },"),o.push(" titleId: { type: String, default: '' },"),o.push(" desc: { type: String, default: '' },"),o.push(" descId: { type: String, default: '' },"),o.push(" class: { type: String, default: '' },"),o.push(" style: { type: Object, default: '' },"),o.push(" width: { type: [String, Number], default: '' },"),o.push(" height: { type: [String, Number], default: '' },"),o.push(' size: { type: String, default: "20" },');return this.vueOptions.typescript&&o.push(' size: "20",'),r.forEach(u=>{let c=u.variableName,l=u.originalColor,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: "",`)):(o.push(` ${c}: { type: String, default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),i.forEach(u=>{let c=u.variableName,l=u.originalStrokeWidth,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: ""`)):(o.push(` ${c}: { type: [String, Number], default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),a.features.includes("fixed-stroke-width")&&(this.vueOptions.typescript?o.push(" isFixedStrokeWidth: true,"):o.push(" isFixedStrokeWidth: { type: Boolean, default: true },")),o.push("});"),o.join(`
641
+ `+i),v+=`</${a}>`,v}generateScript(t){return this.vueOptions.scriptSetup?this.generateScriptSetup(t):this.vueOptions.composition?this.generateCompositionAPI(t):this.generateOptionsAPI(t)}generateScriptSetup(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=[];if(this.vueOptions.typescript&&(o.push('import type { SVGAttributes } from "vue";'),o.push("")),this.vueOptions.typescript){o.push("interface Props extends /* @vue-ignore */ SVGAttributes {"),o.push(" title?: string;"),o.push(" titleId?: string;"),o.push(" desc?: string;"),o.push(" descId?: string;"),o.push(" size?: string;");let u=this.generateColorPropsInterface(r);u&&o.push(u);let c=this.generateStrokeWidthPropsInterface(i);c&&o.push(c),a.features.includes("fixed-stroke-width")&&o.push(" isFixedStrokeWidth?: boolean;"),o.push("}"),o.push(""),o.push("const props = withDefaults(defineProps<Props>(), {");}else o.push("const props = defineProps({"),o.push(" title: { type: String, default: '' },"),o.push(" titleId: { type: String, default: '' },"),o.push(" desc: { type: String, default: '' },"),o.push(" descId: { type: String, default: '' },"),o.push(" class: { type: String, default: '' },"),o.push(" style: { type: Object, default: '' },"),o.push(" width: { type: [String, Number], default: '' },"),o.push(" height: { type: [String, Number], default: '' },"),o.push(' size: { type: String, default: "20" },');return this.vueOptions.typescript&&o.push(' size: "20",'),r.forEach(u=>{let c=u.variableName,l=u.originalColor,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: "",`)):(o.push(` ${c}: { type: String, default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),i.forEach(u=>{let c=u.variableName,l=u.originalStrokeWidth,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: "",`)):(o.push(` ${c}: { type: [String, Number], default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),a.features.includes("fixed-stroke-width")&&(this.vueOptions.typescript?o.push(" isFixedStrokeWidth: true,"):o.push(" isFixedStrokeWidth: { type: Boolean, default: true },")),o.push("});"),o.join(`
642
642
  `)}generateCompositionAPI(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=this.getComponentName(),u=[];return u.push("import { defineComponent } from 'vue';"),u.push(""),u.push("export default defineComponent({"),u.push(` name: '${o}',`),u.push(" props: {"),u.push(" title: { type: String, default: '' },"),u.push(" titleId: { type: String, default: '' },"),u.push(" desc: { type: String, default: '' },"),u.push(" descId: { type: String, default: '' },"),u.push(" class: { type: String, default: '' },"),u.push(" style: { type: Object, default: '' },"),u.push(" width: { type: [String, Number], default: '' },"),u.push(" height: { type: [String, Number], default: '' },"),r.forEach(c=>{let l=c.variableName,h=c.originalColor,p=`${l}Class`;u.push(` ${l}: { type: String, default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),i.forEach(c=>{let l=c.variableName,h=c.originalStrokeWidth,p=`${l}Class`;u.push(` ${l}: { type: [String, Number], default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),a.features.includes("fixed-stroke-width")&&u.push(" isFixedStrokeWidth: { type: Boolean, default: true },"),u.push(" },"),u.push(" setup() {"),u.push(" return {};"),u.push(" },"),u.push("});"),u.join(`
643
643
  `)}generateOptionsAPI(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=this.getComponentName(),u=[];return u.push("export default {"),u.push(` name: '${o}',`),u.push(" props: {"),u.push(" title: { type: String, default: '' },"),u.push(" titleId: { type: String, default: '' },"),u.push(" desc: { type: String, default: '' },"),u.push(" descId: { type: String, default: '' },"),u.push(" class: { type: String, default: '' },"),u.push(" style: { type: Object, default: '' },"),u.push(" width: { type: [String, Number], default: '' },"),u.push(" height: { type: [String, Number], default: '' },"),r.forEach(c=>{let l=c.variableName,h=c.originalColor,p=`${l}Class`;u.push(` ${l}: { type: String, default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),i.forEach(c=>{let l=c.variableName,h=c.originalStrokeWidth,p=`${l}Class`;u.push(` ${l}: { type: [String, Number], default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),a.features.includes("fixed-stroke-width")&&u.push(" isFixedStrokeWidth: { type: Boolean, default: true },"),u.push(" },"),u.push("};"),u.join(`
644
644
  `)}generateStyle(){return ""}generateColorPropsInterface(t){return t.length===0?"":t.map(r=>{let i=r.variableName,a=`${i}Class`;return ` ${i}?: string;
package/dist/index.mjs CHANGED
@@ -638,7 +638,7 @@ ${a}
638
638
  </svg>`}elementToVueTemplate(t,r=0){let i=" ".repeat(r),{tag:a,attributes:o,children:u,content:c}=t,l=[],h=[],p="class"in o;if(Object.entries(o).forEach(([b,C])=>{if(b==="vector-effect"&&C==="non-scaling-stroke")l.push(`:vector-effect="props.isFixedStrokeWidth ? 'non-scaling-stroke' : 'none'"`);else if(b==="style"){let P=this.parseStyleStringForVue(C);l.push(`:style="${P}"`);let U=this.extractClassVarsFromStyle(C);h.push(...U);}else if(C.startsWith("{")&&C.endsWith("}")){let P=C.slice(1,-1);if(l.push(`:${b}="props.${P}"`),b==="fill"||b==="stroke"||b==="stroke-width"){let U=`${P}Class`;h.push(`props.${U}`);}}else l.push(`${b}="${C}"`);}),h.length>0){let b=o.class;b?l.push(`:class="[${h.join(", ")}, '${b}']"`):l.push(`:class="[${h.join(", ")}]"`);}else if(p){let b=o.class;b&&l.push(`class="${b}"`);}let f=l.length>0?" "+l.join(" "):"";if(u.length===0&&!c)return `${i}<${a}${f} />`;let v=`${i}<${a}${f}>`;return c&&(v+=c),u.length>0&&(v+=`
639
639
  `,v+=u.map(b=>this.elementToVueTemplate(b,r+1)).join(`
640
640
  `),v+=`
641
- `+i),v+=`</${a}>`,v}generateScript(t){return this.vueOptions.scriptSetup?this.generateScriptSetup(t):this.vueOptions.composition?this.generateCompositionAPI(t):this.generateOptionsAPI(t)}generateScriptSetup(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=[];if(this.vueOptions.typescript&&(o.push('import type { SVGAttributes } from "vue";'),o.push("")),this.vueOptions.typescript){o.push("interface Props extends /* @vue-ignore */ SVGAttributes {"),o.push(" title?: string;"),o.push(" titleId?: string;"),o.push(" desc?: string;"),o.push(" descId?: string;"),o.push(" size?: string;");let u=this.generateColorPropsInterface(r);u&&o.push(u);let c=this.generateStrokeWidthPropsInterface(i);c&&o.push(c),a.features.includes("fixed-stroke-width")&&o.push(" isFixedStrokeWidth?: boolean;"),o.push("}"),o.push(""),o.push("const props = withDefaults(defineProps<Props>(), {");}else o.push("const props = defineProps({"),o.push(" title: { type: String, default: '' },"),o.push(" titleId: { type: String, default: '' },"),o.push(" desc: { type: String, default: '' },"),o.push(" descId: { type: String, default: '' },"),o.push(" class: { type: String, default: '' },"),o.push(" style: { type: Object, default: '' },"),o.push(" width: { type: [String, Number], default: '' },"),o.push(" height: { type: [String, Number], default: '' },"),o.push(' size: { type: String, default: "20" },');return this.vueOptions.typescript&&o.push(' size: "20",'),r.forEach(u=>{let c=u.variableName,l=u.originalColor,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: "",`)):(o.push(` ${c}: { type: String, default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),i.forEach(u=>{let c=u.variableName,l=u.originalStrokeWidth,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: ""`)):(o.push(` ${c}: { type: [String, Number], default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),a.features.includes("fixed-stroke-width")&&(this.vueOptions.typescript?o.push(" isFixedStrokeWidth: true,"):o.push(" isFixedStrokeWidth: { type: Boolean, default: true },")),o.push("});"),o.join(`
641
+ `+i),v+=`</${a}>`,v}generateScript(t){return this.vueOptions.scriptSetup?this.generateScriptSetup(t):this.vueOptions.composition?this.generateCompositionAPI(t):this.generateOptionsAPI(t)}generateScriptSetup(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=[];if(this.vueOptions.typescript&&(o.push('import type { SVGAttributes } from "vue";'),o.push("")),this.vueOptions.typescript){o.push("interface Props extends /* @vue-ignore */ SVGAttributes {"),o.push(" title?: string;"),o.push(" titleId?: string;"),o.push(" desc?: string;"),o.push(" descId?: string;"),o.push(" size?: string;");let u=this.generateColorPropsInterface(r);u&&o.push(u);let c=this.generateStrokeWidthPropsInterface(i);c&&o.push(c),a.features.includes("fixed-stroke-width")&&o.push(" isFixedStrokeWidth?: boolean;"),o.push("}"),o.push(""),o.push("const props = withDefaults(defineProps<Props>(), {");}else o.push("const props = defineProps({"),o.push(" title: { type: String, default: '' },"),o.push(" titleId: { type: String, default: '' },"),o.push(" desc: { type: String, default: '' },"),o.push(" descId: { type: String, default: '' },"),o.push(" class: { type: String, default: '' },"),o.push(" style: { type: Object, default: '' },"),o.push(" width: { type: [String, Number], default: '' },"),o.push(" height: { type: [String, Number], default: '' },"),o.push(' size: { type: String, default: "20" },');return this.vueOptions.typescript&&o.push(' size: "20",'),r.forEach(u=>{let c=u.variableName,l=u.originalColor,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: "",`)):(o.push(` ${c}: { type: String, default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),i.forEach(u=>{let c=u.variableName,l=u.originalStrokeWidth,h=`${c}Class`;this.vueOptions.typescript?(o.push(` ${c}: '${l}',`),o.push(` ${h}: "",`)):(o.push(` ${c}: { type: [String, Number], default: '${l}' },`),o.push(` ${h}: { type: String, default: "" },`));}),a.features.includes("fixed-stroke-width")&&(this.vueOptions.typescript?o.push(" isFixedStrokeWidth: true,"):o.push(" isFixedStrokeWidth: { type: Boolean, default: true },")),o.push("});"),o.join(`
642
642
  `)}generateCompositionAPI(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=this.getComponentName(),u=[];return u.push("import { defineComponent } from 'vue';"),u.push(""),u.push("export default defineComponent({"),u.push(` name: '${o}',`),u.push(" props: {"),u.push(" title: { type: String, default: '' },"),u.push(" titleId: { type: String, default: '' },"),u.push(" desc: { type: String, default: '' },"),u.push(" descId: { type: String, default: '' },"),u.push(" class: { type: String, default: '' },"),u.push(" style: { type: Object, default: '' },"),u.push(" width: { type: [String, Number], default: '' },"),u.push(" height: { type: [String, Number], default: '' },"),r.forEach(c=>{let l=c.variableName,h=c.originalColor,p=`${l}Class`;u.push(` ${l}: { type: String, default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),i.forEach(c=>{let l=c.variableName,h=c.originalStrokeWidth,p=`${l}Class`;u.push(` ${l}: { type: [String, Number], default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),a.features.includes("fixed-stroke-width")&&u.push(" isFixedStrokeWidth: { type: Boolean, default: true },"),u.push(" },"),u.push(" setup() {"),u.push(" return {};"),u.push(" },"),u.push("});"),u.join(`
643
643
  `)}generateOptionsAPI(t){let{colorMappings:r,strokeWidthMappings:i,metadata:a}=t,o=this.getComponentName(),u=[];return u.push("export default {"),u.push(` name: '${o}',`),u.push(" props: {"),u.push(" title: { type: String, default: '' },"),u.push(" titleId: { type: String, default: '' },"),u.push(" desc: { type: String, default: '' },"),u.push(" descId: { type: String, default: '' },"),u.push(" class: { type: String, default: '' },"),u.push(" style: { type: Object, default: '' },"),u.push(" width: { type: [String, Number], default: '' },"),u.push(" height: { type: [String, Number], default: '' },"),r.forEach(c=>{let l=c.variableName,h=c.originalColor,p=`${l}Class`;u.push(` ${l}: { type: String, default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),i.forEach(c=>{let l=c.variableName,h=c.originalStrokeWidth,p=`${l}Class`;u.push(` ${l}: { type: [String, Number], default: '${h}' },`),u.push(` ${p}: { type: String, default: "" },`);}),a.features.includes("fixed-stroke-width")&&u.push(" isFixedStrokeWidth: { type: Boolean, default: true },"),u.push(" },"),u.push("};"),u.join(`
644
644
  `)}generateStyle(){return ""}generateColorPropsInterface(t){return t.length===0?"":t.map(r=>{let i=r.variableName,a=`${i}Class`;return ` ${i}?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svgfusion",
3
- "version": "1.16.1",
3
+ "version": "1.17.0",
4
4
  "description": "A powerful CLI tool and library that converts SVG files into production-ready React and Vue 3 components with native SVG props inheritance, TypeScript support, and custom SVGFusion engine.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",