|
|
|
|
@ -510,6 +510,8 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|
|
|
|
buildTouchBarCommand(data) {
|
|
|
|
|
const { TouchBar, buildIcon } = data;
|
|
|
|
|
const { TouchBarSegmentedControl, TouchBarGroup, TouchBarButton } = TouchBar;
|
|
|
|
|
const { editor } = this.watchdog;
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
new TouchBarSegmentedControl({
|
|
|
|
|
segments: [
|
|
|
|
|
@ -520,13 +522,13 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|
|
|
|
change(selectedIndex, isSelected) {
|
|
|
|
|
switch (selectedIndex) {
|
|
|
|
|
case 0:
|
|
|
|
|
triggerTextEditorCommand("paragraph")
|
|
|
|
|
editor.execute("paragraph")
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
triggerTextEditorCommand("heading", { value: "heading2" });
|
|
|
|
|
editor.execute("heading", { value: "heading2" });
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
triggerTextEditorCommand("heading", { value: "heading3" });
|
|
|
|
|
editor.execute("heading", { value: "heading3" });
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -536,15 +538,15 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|
|
|
|
items: [
|
|
|
|
|
new TouchBarButton({
|
|
|
|
|
icon: buildIcon("NSTouchBarTextBoldTemplate"),
|
|
|
|
|
click: () => triggerTextEditorCommand("bold")
|
|
|
|
|
click: () => editor.execute("bold")
|
|
|
|
|
}),
|
|
|
|
|
new TouchBarButton({
|
|
|
|
|
icon: buildIcon("NSTouchBarTextItalicTemplate"),
|
|
|
|
|
click: () => triggerTextEditorCommand("italic")
|
|
|
|
|
click: () => editor.execute("italic")
|
|
|
|
|
}),
|
|
|
|
|
new TouchBarButton({
|
|
|
|
|
icon: buildIcon("NSTouchBarTextUnderlineTemplate"),
|
|
|
|
|
click: () => triggerTextEditorCommand("underline")
|
|
|
|
|
click: () => editor.execute("underline")
|
|
|
|
|
})
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
|