1
0
Fork 0
freesewing/packages/plugin-title/src/index.js
2019-04-19 08:23:00 +02:00

28 lines
785 B
JavaScript

import style from "./lib/style";
import { version } from "../package.json";
export default {
hooks: {
preRenderSvg: function(next) {
this.attributes.add("freesewing:plugin-title", version);
this.style += style;
next();
}
},
macros: {
title: function(so) {
so.at.attr("data-text", so.nr).attr("data-text-class", "title-nr note");
this.points.titleName = so.at
.shift(-90, 13)
.attr("data-text", so.title || this.id)
.attr("data-text-class", "title-name");
this.points.titlePattern = so.at
.shift(-90, 20)
.attr(
"data-text",
this.context.config.name + " v" + this.context.config.version
)
.attr("data-text-class", "title-pattern fill-note");
}
}
};