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 { name, version } from '../data.mjs'
const defs = [
// button
`
@ -65,18 +63,13 @@ const defs = [
</g>`,
]
export const buttons = {
name,
version,
hooks: {
preRender: function (svg) {
// Export hooks
export const buttonsHooks = {
preRender: [
function (svg) {
for (const def of defs) {
if (svg.defs.indexOf(def) === -1) svg.defs += def
}
},
},
],
}
// More specifically named exports
export const buttonsPlugin = buttons
export const pluginButtons = buttons