2022-11-18 15:04:37 +00:00
|
|
|
import type { ClickEvent } from "../../plug-api/app_event.ts";
|
|
|
|
import type { Extension } from "../deps.ts";
|
2023-07-14 14:56:20 +00:00
|
|
|
import type { Client } from "../client.ts";
|
2022-11-18 15:04:37 +00:00
|
|
|
import { blockquotePlugin } from "./block_quote.ts";
|
2022-12-12 08:16:14 +00:00
|
|
|
import { admonitionPlugin } from "./admonition.ts";
|
2022-11-18 15:04:37 +00:00
|
|
|
import { directivePlugin } from "./directive.ts";
|
2022-12-09 15:09:53 +00:00
|
|
|
import { hideHeaderMarkPlugin, hideMarksPlugin } from "./hide_mark.ts";
|
2022-11-18 15:04:37 +00:00
|
|
|
import { cleanBlockPlugin } from "./block.ts";
|
2022-11-28 15:42:54 +00:00
|
|
|
import { linkPlugin } from "./link.ts";
|
2022-11-18 15:04:37 +00:00
|
|
|
import { listBulletPlugin } from "./list.ts";
|
|
|
|
import { tablePlugin } from "./table.ts";
|
|
|
|
import { taskListPlugin } from "./task.ts";
|
|
|
|
import { cleanWikiLinkPlugin } from "./wiki_link.ts";
|
2022-11-29 08:11:23 +00:00
|
|
|
import { cleanCommandLinkPlugin } from "./command_link.ts";
|
2022-12-22 15:20:05 +00:00
|
|
|
import { fencedCodePlugin } from "./fenced_code.ts";
|
2022-11-18 15:04:37 +00:00
|
|
|
|
2023-07-14 14:56:20 +00:00
|
|
|
export function cleanModePlugins(editor: Client) {
|
2022-11-18 15:04:37 +00:00
|
|
|
return [
|
2023-12-19 16:55:11 +00:00
|
|
|
linkPlugin(editor),
|
2022-12-19 11:35:58 +00:00
|
|
|
directivePlugin(),
|
2022-12-09 15:09:53 +00:00
|
|
|
blockquotePlugin(),
|
2022-12-12 08:16:14 +00:00
|
|
|
admonitionPlugin(editor),
|
2022-12-09 15:09:53 +00:00
|
|
|
hideMarksPlugin(),
|
|
|
|
hideHeaderMarkPlugin(),
|
|
|
|
cleanBlockPlugin(),
|
2022-12-22 15:20:05 +00:00
|
|
|
fencedCodePlugin(editor),
|
2022-11-18 15:04:37 +00:00
|
|
|
taskListPlugin({
|
|
|
|
// TODO: Move this logic elsewhere?
|
|
|
|
onCheckboxClick: (pos) => {
|
|
|
|
const clickEvent: ClickEvent = {
|
|
|
|
page: editor.currentPage!,
|
|
|
|
altKey: false,
|
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
pos: pos,
|
|
|
|
};
|
|
|
|
// Propagate click event from checkbox
|
|
|
|
editor.dispatchAppEvent("page:click", clickEvent);
|
|
|
|
},
|
|
|
|
}),
|
2022-12-09 15:09:53 +00:00
|
|
|
listBulletPlugin(),
|
|
|
|
tablePlugin(editor),
|
2022-11-28 15:42:54 +00:00
|
|
|
cleanWikiLinkPlugin(editor),
|
2022-11-29 08:11:23 +00:00
|
|
|
cleanCommandLinkPlugin(editor),
|
2022-11-18 15:04:37 +00:00
|
|
|
] as Extension[];
|
|
|
|
}
|