tiptapjs.go 492 B

123456789101112131415161718192021222324252627282930
  1. package tiptap
  2. // @snippet_begin(TipTapPackrSample)
  3. import (
  4. "embed"
  5. "github.com/qor5/web"
  6. )
  7. //go:embed tiptapjs/dist
  8. var box embed.FS
  9. func JSComponentsPack() web.ComponentsPack {
  10. v, err := box.ReadFile("tiptapjs/dist/tiptap.umd.min.js")
  11. if err != nil {
  12. panic(err)
  13. }
  14. return web.ComponentsPack(v)
  15. }
  16. func CSSComponentsPack() web.ComponentsPack {
  17. v, err := box.ReadFile("tiptapjs/dist/tiptap.css")
  18. if err != nil {
  19. panic(err)
  20. }
  21. return web.ComponentsPack(v)
  22. }
  23. // @snippet_end