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-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";
|
2024-01-04 19:08:12 +00:00
|
|
|
import { frontmatterPlugin } from "./frontmatter.ts";
|
2022-11-18 15:04:37 +00:00
|
|
|
|
2024-01-04 19:08:12 +00:00
|
|
|
export function cleanModePlugins(client: Client) {
|
2022-11-18 15:04:37 +00:00
|
|
|
return [
|
2024-01-04 19:08:12 +00:00
|
|
|
linkPlugin(client),
|
2022-12-09 15:09:53 +00:00
|
|
|
blockquotePlugin(),
|
2024-01-04 19:08:12 +00:00
|
|
|
admonitionPlugin(client),
|
2022-12-09 15:09:53 +00:00
|
|
|
hideMarksPlugin(),
|
|
|
|
hideHeaderMarkPlugin(),
|
|
|
|
cleanBlockPlugin(),
|
2024-01-04 19:08:12 +00:00
|
|
|
frontmatterPlugin(client),
|
|
|
|
fencedCodePlugin(client),
|
2022-11-18 15:04:37 +00:00
|
|
|
taskListPlugin({
|
|
|
|
// TODO: Move this logic elsewhere?
|
|
|
|
onCheckboxClick: (pos) => {
|
|
|
|
const clickEvent: ClickEvent = {
|
2024-01-04 19:08:12 +00:00
|
|
|
page: client.currentPage!,
|
2022-11-18 15:04:37 +00:00
|
|
|
altKey: false,
|
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
pos: pos,
|
|
|
|
};
|
|
|
|
// Propagate click event from checkbox
|
2024-01-04 19:08:12 +00:00
|
|
|
client.dispatchAppEvent("page:click", clickEvent);
|
2022-11-18 15:04:37 +00:00
|
|
|
},
|
|
|
|
}),
|
2022-12-09 15:09:53 +00:00
|
|
|
listBulletPlugin(),
|
2024-01-04 19:08:12 +00:00
|
|
|
tablePlugin(client),
|
|
|
|
cleanWikiLinkPlugin(client),
|
|
|
|
cleanCommandLinkPlugin(client),
|
2022-11-18 15:04:37 +00:00
|
|
|
] as Extension[];
|
|
|
|
}
|