Download frontend/src/hooks/useTextFormatPainter.ts from CatPtain/web_ppt: direct link, hf CLI and curl.
- Browser
- Download file 873 Bytes
-
https://huggingface.co/spaces/CatPtain/web_ppt/resolve/main/frontend/src/hooks/useTextFormatPainter.ts
- Command line
-
hf download hf://spaces/CatPtain/web_ppt/frontend/src/hooks/useTextFormatPainter.ts
-
curl -L -o useTextFormatPainter.ts https://huggingface.co/spaces/CatPtain/web_ppt/resolve/main/frontend/src/hooks/useTextFormatPainter.ts
873 Bytes
| import { storeToRefs } from 'pinia' | |
| import { useMainStore } from '@/store' | |
| export default () => { | |
| const mainStore = useMainStore() | |
| const { richTextAttrs, textFormatPainter } = storeToRefs(mainStore) | |
| const toggleTextFormatPainter = (keep = false) => { | |
| if (textFormatPainter.value) mainStore.setTextFormatPainter(null) | |
| else { | |
| mainStore.setTextFormatPainter({ | |
| keep, | |
| bold: richTextAttrs.value.bold, | |
| em: richTextAttrs.value.em, | |
| underline: richTextAttrs.value.underline, | |
| strikethrough: richTextAttrs.value.strikethrough, | |
| color: richTextAttrs.value.color, | |
| backcolor: richTextAttrs.value.backcolor, | |
| fontname: richTextAttrs.value.fontname, | |
| fontsize: richTextAttrs.value.fontsize, | |
| align: richTextAttrs.value.align, | |
| }) | |
| } | |
| } | |
| return { | |
| toggleTextFormatPainter, | |
| } | |
| } | |