1
0
Fork 0
freesewing/packages/core/tests/fixtures/render.mjs
2022-11-12 09:27:27 +01:00

24 lines
6.2 KiB
JavaScript

import pkg from '../../package.json' assert { type: 'json' }
const { version } = pkg
var render = {
boilerplate: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svgxmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.45"><style type="text/css"> <![CDATA[]]></style><defs></defs><!-- Start of group #fs-container --><g id="fs-container"><!-- Start of group #fs-stack-test --><g id="fs-stack-test" transform="translate(2, 2)"><!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" /></g><!-- end of group #fs-stack-test-part-test --></g><!-- end of group #fs-stack-test --></g><!-- end of group #fs-container --></svg>`,
boilerplateNl: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svgxmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="nl" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" width="44mm" height="56.45mm" viewBox="0 0 44 56.45"><style type="text/css"> <![CDATA[]]></style><defs></defs><!-- Start of group #fs-container --><g id="fs-container"><!-- Start of group #fs-stack-test --><g id="fs-stack-test" transform="translate(2, 2)"><!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" /></g><!-- end of group #fs-stack-test-part-test --></g><!-- end of group #fs-stack-test --></g><!-- end of group #fs-container --></svg>`,
embed: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svgxmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" xmlns:freesewing="http://freesewing.org/namespaces/freesewing" freesewing="${version}" viewBox="0 0 44 56.45"><style type="text/css"> <![CDATA[]]></style><defs></defs><!-- Start of group #fs-container --><g id="fs-container"><!-- Start of group #fs-stack-test --><g id="fs-stack-test" transform="translate(2, 2)"><!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" /></g><!-- end of group #fs-stack-test-part-test --></g><!-- end of group #fs-stack-test --></g><!-- end of group #fs-container --></svg>`,
stack: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" /></g><!-- end of group #fs-stack-test-part-test -->`,
part: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" /></g><!-- end of group #fs-stack-test-part-test -->`,
path: `<path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" />`,
text: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><text class="text-lg" x="20" y="20"><tspan>This is a test </tspan></text></g><!-- end of group #fs-stack-test-part-test -->`,
multiText: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><text class="text-lg" x="20" y="20"><tspan>This is a test</tspan><tspan x="20" dy="6">with text on</tspan><tspan x="20" dy="6">multiple lines </tspan></text></g><!-- end of group #fs-stack-test-part-test -->`,
multiTextDflt: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><text class="text-lg" x="20" y="20"><tspan>This is a test</tspan><tspan x="20" dy="6">with text on</tspan><tspan x="20" dy="6">multiple lines </tspan></text></g><!-- end of group #fs-stack-test-part-test -->`,
textOnPath: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path data-text="This is another test" data-text-class="text-sm" class="freesewing" id="fs-1" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" /><text><textPath xlink:href="#fs-1" ><tspan class="text-sm">This is another test</tspan></textPath></text></g><!-- end of group #fs-stack-test-part-test -->`,
textOnPathCenter: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path data-text="This is another test" data-text-class="center" class="freesewing" id="fs-1" d="" /><text><textPath xlink:href="#fs-1" startOffset="50%" ><tspan class="center">This is another test</tspan></textPath></text></g><!-- end of group #fs-stack-test-part-test -->`,
textOnPathRight: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><path data-text="This is another test" data-text-class="right" class="freesewing" id="fs-1" d="" /><text><textPath xlink:href="#fs-1" startOffset="100%" ><tspan class="right">This is another test</tspan></textPath></text></g><!-- end of group #fs-stack-test-part-test -->`,
circle: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><circle cx="20" cy="20" r="50" ></circle></g><!-- end of group #fs-stack-test-part-test -->`,
snippet: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><use x="20" y="20" xlink:href="#test" transform="translate(20, 20) scale(1) translate(-20, -20) translate(20, 20) scale(1) translate(-20, -20)"></use></g><!-- end of group #fs-stack-test-part-test -->`,
rotatedSnippet: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><use x="20" y="20" xlink:href="#test" data-rotate="90" transform="translate(20, 20) scale(1) translate(-20, -20) rotate(90, 20, 20) translate(20, 20) scale(1) translate(-20, -20) rotate(90, 20, 20)"></use></g><!-- end of group #fs-stack-test-part-test -->`,
scaledSnippet: `<!-- Start of group #fs-stack-test-part-test --><g id="fs-stack-test-part-test" ><use x="20" y="20" xlink:href="#test" data-scale="2" transform="translate(20, 20) scale(2) translate(-20, -20) translate(20, 20) scale(2) translate(-20, -20)"></use></g><!-- end of group #fs-stack-test-part-test -->`,
}
export default render