1
0
Fork 0

chore(plugin-annotations): Refactor plugin structure

This commit is contained in:
joostdecock 2023-03-11 19:01:40 +01:00
parent 607bc010da
commit 94d8ae4cab
11 changed files with 611 additions and 706 deletions

View file

@ -1,5 +1,3 @@
import { version, name } from '../data.mjs'
// Method that draws the actual bartack
const drawBartack = (pointList, { Path }) => {
let path = new Path().move(pointList.path1[0])
@ -102,33 +100,25 @@ function createBartack(so, props) {
return true
}
// The actual plugin
export const bartack = {
name,
version,
macros: {
bartack: function (so, props) {
return createBartack(so, props)
},
bartackAlong: function (so, props) {
so.bartackFractionAlong = false
so.bartackAlong = true
so.anchor = false
so.from = false
so.to = false
return createBartack(so, props)
},
bartackFractionAlong: function (so, props) {
so.bartackFractionAlong = true
so.bartackAlong = false
so.anchor = false
so.from = false
so.to = false
return createBartack(so, props)
},
// Export macros
export const bartackMacros = {
bartack: function (so, props) {
return createBartack(so, props)
},
bartackAlong: function (so, props) {
so.bartackFractionAlong = false
so.bartackAlong = true
so.anchor = false
so.from = false
so.to = false
return createBartack(so, props)
},
bartackFractionAlong: function (so, props) {
so.bartackFractionAlong = true
so.bartackAlong = false
so.anchor = false
so.from = false
so.to = false
return createBartack(so, props)
},
}
// More specifically named exports
export const bartackPlugin = bartack
export const pluginBartack = bartack