logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

font_control.js (1290B)


  1. import Select from '../select/select.vue'
  2. import Checkbox from 'src/components/checkbox/checkbox.vue'
  3. import Popover from 'src/components/popover/popover.vue'
  4. import { useInterfaceStore } from 'src/stores/interface'
  5. import { library } from '@fortawesome/fontawesome-svg-core'
  6. import {
  7. faExclamationTriangle,
  8. faKeyboard,
  9. faFont
  10. } from '@fortawesome/free-solid-svg-icons'
  11. library.add(
  12. faExclamationTriangle,
  13. faKeyboard,
  14. faFont
  15. )
  16. export default {
  17. components: {
  18. Select,
  19. Checkbox,
  20. Popover
  21. },
  22. props: [
  23. 'name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit'
  24. ],
  25. mounted () {
  26. useInterfaceStore().queryLocalFonts()
  27. },
  28. emits: ['update:modelValue'],
  29. data () {
  30. return {
  31. manualEntry: false,
  32. availableOptions: [
  33. this.noInherit ? '' : 'inherit',
  34. 'serif',
  35. 'sans-serif',
  36. 'monospace',
  37. ...(this.options || [])
  38. ].filter(_ => _)
  39. }
  40. },
  41. methods: {
  42. toggleManualEntry () {
  43. this.manualEntry = !this.manualEntry
  44. }
  45. },
  46. computed: {
  47. present () {
  48. return typeof this.modelValue !== 'undefined'
  49. },
  50. localFontsList () {
  51. return useInterfaceStore().localFonts
  52. },
  53. localFontsSize () {
  54. return useInterfaceStore().localFonts?.length
  55. }
  56. }
  57. }