UNPKG

ll-package

Version:

5 lines (4 loc) 2.18 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../../remark-gfm/index.js"),s={Strikethrough:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M5 24h38M24 24c16 6 10 20 0 20s-12-8-12-8M36 12s-3-8-12-8-12.564 7.6-8.39 14"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M12 36s4 8 12 8 12.564-7.6 8.39-14"/></svg>',CheckCorrect:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" clip-path="url(#a)"><path d="M42 20v19a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h21"/><path d="m16 20 10 8L41 7"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h48v48H0z"/></clipPath></defs></svg>',InsertTable:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-width="4" d="M39.3 6H8.7A2.7 2.7 0 0 0 6 8.7v30.6A2.7 2.7 0 0 0 8.7 42h30.6a2.7 2.7 0 0 0 2.7-2.7V8.7A2.7 2.7 0 0 0 39.3 6Z"/><path stroke="currentColor" stroke-linecap="round" stroke-width="4" d="M18 6v36M30 6v36M6 18h36M6 30h36"/></svg>'},c="Strikethrough",h="text",d="Table",k="Heading",u="Task list",g="todo",w={strike:c,strikeText:h,table:d,tableHeading:k,task:u,taskText:g};function p({locale:i,...l}={}){const e={...w,...i};return{remark:t=>t.use(a.default,l),actions:[{title:e.strike,icon:s.Strikethrough,cheatsheet:`~~${e.strikeText}~~`,handler:{type:"action",click({wrapText:t,editor:o}){t("~~"),o.focus()}}},{title:e.task,icon:s.CheckCorrect,cheatsheet:`- [ ] ${e.taskText}`,handler:{type:"action",click({replaceLines:t,editor:o}){t(r=>"- [ ] "+r),o.focus()}}},{title:e.table,icon:s.InsertTable,handler:{type:"action",click({editor:t,appendBlock:o,codemirror:r}){const{line:n}=o(`| ${e.tableHeading} | | | --- | --- | | | | `);t.setSelection(r.Pos(n,2),r.Pos(n,2+e.tableHeading.length)),t.focus()}}}]}}exports.default=p;