@fiduswriter/editor 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/copyright_dialog/templates.d.ts.map +1 -1
  2. package/dist/copyright_dialog/templates.js +11 -31
  3. package/dist/copyright_dialog/templates.js.map +1 -1
  4. package/dist/dialogs/epub_export.d.ts +15 -0
  5. package/dist/dialogs/epub_export.d.ts.map +1 -0
  6. package/dist/dialogs/epub_export.js +43 -0
  7. package/dist/dialogs/epub_export.js.map +1 -0
  8. package/dist/dialogs/html_export.d.ts +3 -0
  9. package/dist/dialogs/html_export.d.ts.map +1 -1
  10. package/dist/dialogs/html_export.js +4 -3
  11. package/dist/dialogs/html_export.js.map +1 -1
  12. package/dist/dialogs/index.d.ts +2 -0
  13. package/dist/dialogs/index.d.ts.map +1 -1
  14. package/dist/dialogs/index.js +2 -0
  15. package/dist/dialogs/index.js.map +1 -1
  16. package/dist/dialogs/template_export.d.ts +13 -0
  17. package/dist/dialogs/template_export.d.ts.map +1 -0
  18. package/dist/dialogs/template_export.js +46 -0
  19. package/dist/dialogs/template_export.js.map +1 -0
  20. package/dist/dialogs/templates.d.ts +9 -0
  21. package/dist/dialogs/templates.d.ts.map +1 -1
  22. package/dist/dialogs/templates.js +54 -12
  23. package/dist/dialogs/templates.js.map +1 -1
  24. package/dist/document_template/index.d.ts.map +1 -1
  25. package/dist/document_template/index.js +23 -4
  26. package/dist/document_template/index.js.map +1 -1
  27. package/dist/menus/headerbar/model.d.ts +1 -1
  28. package/dist/menus/headerbar/model.d.ts.map +1 -1
  29. package/dist/menus/headerbar/model.js +33 -12
  30. package/dist/menus/headerbar/model.js.map +1 -1
  31. package/dist/menus/toolbar/model.d.ts +7 -7
  32. package/dist/menus/toolbar/model.d.ts.map +1 -1
  33. package/locale/ar/messages.json +0 -1
  34. package/locale/bg/messages.json +0 -1
  35. package/locale/cs/messages.json +0 -1
  36. package/locale/da/messages.json +0 -1
  37. package/locale/de/messages.json +0 -1
  38. package/locale/en/messages.json +590 -574
  39. package/locale/en_US/messages.json +590 -574
  40. package/locale/es/messages.json +0 -1
  41. package/locale/fr/messages.json +0 -1
  42. package/locale/it/messages.json +0 -1
  43. package/locale/ja/messages.json +0 -1
  44. package/locale/ko/messages.json +0 -1
  45. package/locale/nb/messages.json +0 -1
  46. package/locale/nl/messages.json +0 -1
  47. package/locale/pl/messages.json +0 -1
  48. package/locale/pt_BR/messages.json +0 -1
  49. package/locale/pt_PT/messages.json +0 -1
  50. package/locale/ru/messages.json +0 -1
  51. package/locale/sv/messages.json +0 -1
  52. package/locale/tr/messages.json +0 -1
  53. package/locale/zh_Hans/messages.json +0 -1
  54. package/package.json +8 -5
  55. package/src/copyright_dialog/templates.ts +35 -31
  56. package/src/dialogs/epub_export.ts +66 -0
  57. package/src/dialogs/html_export.ts +11 -3
  58. package/src/dialogs/index.ts +2 -0
  59. package/src/dialogs/template_export.ts +66 -0
  60. package/src/dialogs/templates.ts +117 -14
  61. package/src/document_template/index.ts +23 -4
  62. package/src/menus/headerbar/model.ts +41 -12
@@ -14,7 +14,8 @@ import {
14
14
  LanguageDialog,
15
15
  PdfExportDialog,
16
16
  RevisionDialog,
17
- HtmlExportDialog
17
+ HtmlExportDialog,
18
+ EpubExportDialog
18
19
  } from "../../dialogs/index.js"
19
20
  import {E2EEKeyManager} from "fwtoolkit/e2ee/key-manager"
20
21
  import {PassphraseManager} from "fwtoolkit/e2ee/passphrase-manager"
@@ -391,11 +392,11 @@ export const headerbarModel = () => ({
391
392
  disabled: (editor: Editor) => editor.app.isOffline()
392
393
  },
393
394
  {
394
- title: gettext("Print/PDF"),
395
+ title: gettext("Print"),
395
396
  type: "action",
396
397
  //icon: 'print',
397
398
  tooltip: gettext(
398
- "Either print or create a PDF using your browser print dialog."
399
+ "Print the document using your browser print dialog."
399
400
  ),
400
401
  order: 5,
401
402
  keys: "Ctrl-p",
@@ -639,9 +640,20 @@ export const headerbarModel = () => ({
639
640
  if (!options) {
640
641
  return
641
642
  }
642
- const doc = getExportDoc(editor, {
643
- changes: "acceptAllNoInsertions"
644
- })
643
+ const doc = getExportDoc(
644
+ editor,
645
+ options.resolveTrackChanges
646
+ ? {changes: "acceptAllNoInsertions"}
647
+ : undefined
648
+ )
649
+ const converterOptions: Record<string, unknown> = {}
650
+ if (options.svgMath) {
651
+ converterOptions.mathOutput = "svg"
652
+ }
653
+ if (!options.resolveTrackChanges) {
654
+ // Keep the marks and render them in the output.
655
+ converterOptions.trackChanges = true
656
+ }
645
657
  const exporter = new HTMLExporter(
646
658
  doc,
647
659
  db.bibDB,
@@ -649,7 +661,7 @@ export const headerbarModel = () => ({
649
661
  editor.app.csl,
650
662
  editor.docInfo.updated as Date,
651
663
  getDocumentTemplate(editor).documentStyles,
652
- options.svgMath ? {mathOutput: "svg"} : {}
664
+ converterOptions
653
665
  )
654
666
  exporter.progressCallback = exportProgress(doc)
655
667
  exporter.init()
@@ -732,18 +744,35 @@ export const headerbarModel = () => ({
732
744
  action: (editor: Editor) => {
733
745
  import(
734
746
  "@fiduswriter/document/exporter/epub/index"
735
- ).then(({EpubExporter}) => {
747
+ ).then(async ({EpubExporter}) => {
736
748
  const db = getDB(editor)
737
- const doc = getExportDoc(editor, {
738
- changes: "acceptAllNoInsertions"
739
- })
749
+ const dialog = new EpubExportDialog()
750
+ const options = await dialog.init()
751
+ if (!options) {
752
+ return
753
+ }
754
+ const doc = getExportDoc(
755
+ editor,
756
+ options.resolveTrackChanges
757
+ ? {changes: "acceptAllNoInsertions"}
758
+ : undefined
759
+ )
760
+ const converterOptions: Record<string, unknown> = {}
761
+ if (options.svgMath) {
762
+ converterOptions.mathOutput = "svg"
763
+ }
764
+ if (!options.resolveTrackChanges) {
765
+ // Keep the marks and render them in the output.
766
+ converterOptions.trackChanges = true
767
+ }
740
768
  const exporter = new EpubExporter(
741
769
  doc,
742
770
  db.bibDB,
743
771
  db.imageDB,
744
772
  editor.app.csl,
745
773
  editor.docInfo.updated as Date,
746
- getDocumentTemplate(editor).documentStyles
774
+ getDocumentTemplate(editor).documentStyles,
775
+ converterOptions
747
776
  )
748
777
  exporter.progressCallback = exportProgress(doc)
749
778
  exporter.init()