1
0
Fork 0
freesewing/packages/core/tests/fixtures/render.js

352 lines
10 KiB
JavaScript
Raw Normal View History

2021-04-22 19:29:37 +02:00
var version = require('../../package.json').version
2018-08-12 16:19:04 +02:00
var render = {
boilerplate: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="0mm" height="0mm" viewBox="0 0 0 0"
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
<defs>
</defs>
<!-- Start of group #fs-container -->
<g id="fs-container">
</g>
<!-- end of group #fs-container -->
</svg>`,
boilerplateNl: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="0mm" height="0mm" viewBox="0 0 0 0"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
embed: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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 0 0"
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
part: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="4mm" height="4mm" viewBox="0 0 4 4"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform="translate(2, 2)">
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
path: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
2021-04-22 19:29:37 +02:00
xmlns="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.451075975520425"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
2021-04-22 19:29:37 +02:00
<g id="fs-part-test" transform="translate(2, 2)">
2018-08-12 16:19:04 +02:00
<path id="something" class="freesewing" d="M 0,0 L 40,20 C 12,34 56,78 21,32 z" />
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
text: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="4mm" height="4mm" viewBox="0 0 4 4"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform="translate(2, 2)">
2018-08-12 16:19:04 +02:00
<text class="text-lg" x="20" y="20"><tspan>This is a test</tspan>
</text>
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
circle: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="104mm" height="104mm" viewBox="0 0 104 104"
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
<defs>
</defs>
<!-- Start of group #fs-container -->
<g id="fs-container">
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform="translate(32, 32)"><circle
cx="20"
cy="20"
r="50"
></circle>
</g>
<!-- end of group #fs-part-test -->
</g>
<!-- end of group #fs-container -->
</svg>`,
multiText: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="4mm" height="4mm" viewBox="0 0 4 4"
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform=" translate(2, 2)">
2018-08-16 11:58:20 +02:00
<text class="text-lg" x="20" y="20"><tspan>This is a test</tspan><tspan x="20" dy="8">with text on</tspan><tspan x="20" dy="8">multiple lines</tspan>
</text>
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-16 11:58:20 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
multiTextDflt: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="4mm" height="4mm" viewBox="0 0 4 4"
2018-08-16 11:58:20 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-16 11:58:20 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-16 11:58:20 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform=" translate(2, 2)">
2018-08-16 11:58:20 +02:00
<text class="text-lg" x="20" y="20"><tspan>This is a test</tspan><tspan x="20" dy="12">with text on</tspan><tspan x="20" dy="12">multiple lines</tspan>
</text>
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
textOnPath: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
2021-04-22 19:29:37 +02:00
xmlns="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.451075975520425"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
2021-04-22 19:29:37 +02:00
<g id="fs-part-test" transform="translate(2, 2)">
2018-08-16 15:44:01 +02:00
<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>
2018-08-12 16:19:04 +02:00
</text>
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
textOnPathCenter: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
2021-04-22 19:29:37 +02:00
xmlns="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.451075975520425"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform="translate(2, 2)">
2018-08-16 15:44:01 +02:00
<path data-text="This is another test" data-text-class="center" 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" startOffset="50%" ><tspan class="center">This is another test</tspan></textPath>
2018-08-12 16:19:04 +02:00
</text>
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
textOnPathRight: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
2021-04-22 19:29:37 +02:00
xmlns="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.451075975520425"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform="translate(2, 2)">
2018-08-16 15:44:01 +02:00
<path data-text="This is another test" data-text-class="right" 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" startOffset="100%" ><tspan class="right">This is another test</tspan></textPath>
2018-08-12 16:19:04 +02:00
</text>
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`,
snippet: `<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
xmlns="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="4mm" height="4mm" viewBox="0 0 4 4"
2018-08-12 16:19:04 +02:00
>
<style type="text/css"> <![CDATA[
]]>
</style>
<script type="text/javascript"> <![CDATA[
]]>
</script>
2018-08-16 15:44:01 +02:00
<defs>
2018-08-12 16:19:04 +02:00
</defs>
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-container -->
<g id="fs-container">
2018-08-12 16:19:04 +02:00
2018-08-16 15:44:01 +02:00
<!-- Start of group #fs-part-test -->
<g id="fs-part-test" transform="translate(2, 2)">
<use x="20" y="20" xlink:href="#test" ></use>
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-part-test -->
2018-08-12 16:19:04 +02:00
</g>
2018-08-16 15:44:01 +02:00
<!-- end of group #fs-container -->
</svg>`
2021-04-22 19:29:37 +02:00
}
2018-08-12 16:19:04 +02:00
2021-04-22 19:29:37 +02:00
module.exports = render