2021-03-30 06:14:00 +02:00
|
|
|
import CommandIconButton from "./CommandIconButton.svelte";
|
2021-04-01 01:22:06 +02:00
|
|
|
|
|
|
|
import { lazyProperties } from "anki/lazy";
|
|
|
|
import * as tr from "anki/i18n";
|
|
|
|
|
2021-03-29 21:05:30 +02:00
|
|
|
import boldIcon from "./type-bold.svg";
|
|
|
|
import italicIcon from "./type-italic.svg";
|
|
|
|
import underlineIcon from "./type-underline.svg";
|
|
|
|
import superscriptIcon from "./format-superscript.svg";
|
|
|
|
import subscriptIcon from "./format-subscript.svg";
|
|
|
|
import eraserIcon from "./eraser.svg";
|
|
|
|
|
2021-04-01 00:45:02 +02:00
|
|
|
const boldButton = {
|
2021-03-29 21:05:30 +02:00
|
|
|
component: CommandIconButton,
|
|
|
|
icon: boldIcon,
|
|
|
|
command: "bold",
|
|
|
|
};
|
|
|
|
|
2021-04-01 01:22:06 +02:00
|
|
|
lazyProperties(boldButton, {
|
|
|
|
title: tr.editingBoldTextCtrlandb,
|
|
|
|
});
|
|
|
|
|
2021-04-01 00:45:02 +02:00
|
|
|
const italicButton = {
|
2021-03-29 21:05:30 +02:00
|
|
|
component: CommandIconButton,
|
|
|
|
icon: italicIcon,
|
|
|
|
command: "italic",
|
|
|
|
};
|
|
|
|
|
2021-04-01 01:22:06 +02:00
|
|
|
lazyProperties(italicButton, {
|
|
|
|
title: tr.editingItalicTextCtrlandi,
|
|
|
|
});
|
|
|
|
|
2021-04-01 00:45:02 +02:00
|
|
|
const underlineButton = {
|
2021-03-29 21:05:30 +02:00
|
|
|
component: CommandIconButton,
|
|
|
|
icon: underlineIcon,
|
|
|
|
command: "underline",
|
|
|
|
};
|
|
|
|
|
2021-04-01 01:22:06 +02:00
|
|
|
lazyProperties(underlineButton, {
|
|
|
|
title: tr.editingUnderlineTextCtrlandu,
|
|
|
|
});
|
|
|
|
|
2021-04-01 00:45:02 +02:00
|
|
|
const superscriptButton = {
|
2021-03-29 21:05:30 +02:00
|
|
|
component: CommandIconButton,
|
|
|
|
icon: superscriptIcon,
|
|
|
|
command: "superscript",
|
|
|
|
};
|
|
|
|
|
2021-04-01 01:22:06 +02:00
|
|
|
lazyProperties(superscriptButton, {
|
|
|
|
title: tr.editingSuperscriptCtrlandand,
|
|
|
|
});
|
|
|
|
|
2021-04-01 00:45:02 +02:00
|
|
|
const subscriptButton = {
|
2021-03-29 21:05:30 +02:00
|
|
|
component: CommandIconButton,
|
|
|
|
icon: subscriptIcon,
|
|
|
|
command: "subscript",
|
|
|
|
};
|
|
|
|
|
2021-04-01 01:22:06 +02:00
|
|
|
lazyProperties(subscriptButton, {
|
|
|
|
title: tr.editingSubscriptCtrland,
|
|
|
|
});
|
|
|
|
|
|
|
|
const removeFormatButton = {
|
2021-03-29 21:05:30 +02:00
|
|
|
component: CommandIconButton,
|
|
|
|
icon: eraserIcon,
|
|
|
|
command: "removeFormat",
|
2021-04-01 01:22:06 +02:00
|
|
|
activatable: false,
|
2021-03-29 21:05:30 +02:00
|
|
|
};
|
2021-04-01 00:45:02 +02:00
|
|
|
|
2021-04-01 01:22:06 +02:00
|
|
|
lazyProperties(removeFormatButton, {
|
|
|
|
title: tr.editingRemoveFormattingCtrlandr,
|
|
|
|
});
|
|
|
|
|
2021-04-01 00:45:02 +02:00
|
|
|
export const formatButtons = [
|
|
|
|
boldButton,
|
|
|
|
italicButton,
|
|
|
|
underlineButton,
|
|
|
|
superscriptButton,
|
|
|
|
subscriptButton,
|
2021-04-01 01:22:06 +02:00
|
|
|
removeFormatButton,
|
2021-04-01 00:45:02 +02:00
|
|
|
];
|