@fiduswriter/editor 0.1.20 → 0.1.21
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.
- package/dist/bibliography/tools.d.ts +14 -0
- package/dist/bibliography/tools.d.ts.map +1 -0
- package/dist/bibliography/tools.js +1 -1
- package/dist/bibliography/tools.js.map +1 -1
- package/dist/citations/index.d.ts +17 -0
- package/dist/citations/index.d.ts.map +1 -0
- package/dist/citations/index.js +22 -13
- package/dist/citations/index.js.map +1 -1
- package/dist/citations/render.d.ts +29 -0
- package/dist/citations/render.d.ts.map +1 -0
- package/dist/citations/render.js +25 -8
- package/dist/citations/render.js.map +1 -1
- package/dist/clipboard/copy/index.d.ts +2 -0
- package/dist/clipboard/copy/index.d.ts.map +1 -0
- package/dist/clipboard/copy/index.js.map +1 -1
- package/dist/clipboard/copy/schema.d.ts +4 -0
- package/dist/clipboard/copy/schema.d.ts.map +1 -0
- package/dist/clipboard/copy/schema.js +6 -5
- package/dist/clipboard/copy/schema.js.map +1 -1
- package/dist/clipboard/copy/serializers.d.ts +24 -0
- package/dist/clipboard/copy/serializers.d.ts.map +1 -0
- package/dist/clipboard/copy/serializers.js +19 -9
- package/dist/clipboard/copy/serializers.js.map +1 -1
- package/dist/clipboard/paste/fidus_writer.d.ts +7 -0
- package/dist/clipboard/paste/fidus_writer.d.ts.map +1 -0
- package/dist/clipboard/paste/fidus_writer.js +5 -2
- package/dist/clipboard/paste/fidus_writer.js.map +1 -1
- package/dist/clipboard/paste/general.d.ts +18 -0
- package/dist/clipboard/paste/general.d.ts.map +1 -0
- package/dist/clipboard/paste/general.js +18 -6
- package/dist/clipboard/paste/general.js.map +1 -1
- package/dist/clipboard/paste/google_docs.d.ts +6 -0
- package/dist/clipboard/paste/google_docs.d.ts.map +1 -0
- package/dist/clipboard/paste/google_docs.js +3 -2
- package/dist/clipboard/paste/google_docs.js.map +1 -1
- package/dist/clipboard/paste/html.d.ts +22 -0
- package/dist/clipboard/paste/html.d.ts.map +1 -0
- package/dist/clipboard/paste/html.js +15 -0
- package/dist/clipboard/paste/html.js.map +1 -1
- package/dist/clipboard/paste/index.d.ts +3 -0
- package/dist/clipboard/paste/index.d.ts.map +1 -0
- package/dist/clipboard/paste/index.js.map +1 -1
- package/dist/clipboard/paste/libreoffice_writer.d.ts +5 -0
- package/dist/clipboard/paste/libreoffice_writer.d.ts.map +1 -0
- package/dist/clipboard/paste/libreoffice_writer.js +2 -2
- package/dist/clipboard/paste/libreoffice_writer.js.map +1 -1
- package/dist/clipboard/paste/microsoft_word.d.ts +7 -0
- package/dist/clipboard/paste/microsoft_word.d.ts.map +1 -0
- package/dist/clipboard/paste/microsoft_word.js +13 -14
- package/dist/clipboard/paste/microsoft_word.js.map +1 -1
- package/dist/clipboard/paste/text.d.ts +11 -0
- package/dist/clipboard/paste/text.d.ts.map +1 -0
- package/dist/clipboard/paste/text.js +5 -3
- package/dist/clipboard/paste/text.js.map +1 -1
- package/dist/collab/chat.d.ts +24 -0
- package/dist/collab/chat.d.ts.map +1 -0
- package/dist/collab/chat.js +46 -16
- package/dist/collab/chat.js.map +1 -1
- package/dist/collab/colors.d.ts +16 -0
- package/dist/collab/colors.d.ts.map +1 -0
- package/dist/collab/colors.js +6 -0
- package/dist/collab/colors.js.map +1 -1
- package/dist/collab/doc.d.ts +147 -0
- package/dist/collab/doc.d.ts.map +1 -0
- package/dist/collab/doc.js +77 -42
- package/dist/collab/doc.js.map +1 -1
- package/dist/collab/index.d.ts +23 -0
- package/dist/collab/index.d.ts.map +1 -0
- package/dist/collab/index.js +14 -3
- package/dist/collab/index.js.map +1 -1
- package/dist/collab/merge/changeset.d.ts +23 -0
- package/dist/collab/merge/changeset.d.ts.map +1 -0
- package/dist/collab/merge/changeset.js +5 -4
- package/dist/collab/merge/changeset.js.map +1 -1
- package/dist/collab/merge/editor.d.ts +53 -0
- package/dist/collab/merge/editor.d.ts.map +1 -0
- package/dist/collab/merge/editor.js +62 -35
- package/dist/collab/merge/editor.js.map +1 -1
- package/dist/collab/merge/footnotes.d.ts +26 -0
- package/dist/collab/merge/footnotes.d.ts.map +1 -0
- package/dist/collab/merge/footnotes.js +14 -5
- package/dist/collab/merge/footnotes.js.map +1 -1
- package/dist/collab/merge/index.d.ts +32 -0
- package/dist/collab/merge/index.d.ts.map +1 -0
- package/dist/collab/merge/index.js +38 -26
- package/dist/collab/merge/index.js.map +1 -1
- package/dist/collab/merge/recreate_transform.d.ts +4 -0
- package/dist/collab/merge/recreate_transform.d.ts.map +1 -0
- package/dist/collab/merge/recreate_transform.js +25 -5
- package/dist/collab/merge/recreate_transform.js.map +1 -1
- package/dist/collab/merge/schema.d.ts +4 -0
- package/dist/collab/merge/schema.d.ts.map +1 -0
- package/dist/collab/merge/schema.js +35 -26
- package/dist/collab/merge/schema.js.map +1 -1
- package/dist/collab/merge/state_plugins/action.d.ts +16 -0
- package/dist/collab/merge/state_plugins/action.d.ts.map +1 -0
- package/dist/collab/merge/state_plugins/action.js +4 -5
- package/dist/collab/merge/state_plugins/action.js.map +1 -1
- package/dist/collab/merge/state_plugins/clipboard.d.ts +6 -0
- package/dist/collab/merge/state_plugins/clipboard.d.ts.map +1 -0
- package/dist/collab/merge/state_plugins/clipboard.js +1 -1
- package/dist/collab/merge/state_plugins/clipboard.js.map +1 -1
- package/dist/collab/merge/state_plugins/diff.d.ts +32 -0
- package/dist/collab/merge/state_plugins/diff.d.ts.map +1 -0
- package/dist/collab/merge/state_plugins/diff.js +108 -84
- package/dist/collab/merge/state_plugins/diff.js.map +1 -1
- package/dist/collab/merge/state_plugins/index.d.ts +3 -0
- package/dist/collab/merge/state_plugins/index.d.ts.map +1 -0
- package/dist/collab/merge/state_plugins/index.js.map +1 -1
- package/dist/collab/merge/tools.d.ts +11 -0
- package/dist/collab/merge/tools.d.ts.map +1 -0
- package/dist/collab/merge/tools.js +16 -14
- package/dist/collab/merge/tools.js.map +1 -1
- package/dist/collab/templates.d.ts +14 -0
- package/dist/collab/templates.d.ts.map +1 -0
- package/dist/collab/templates.js +1 -1
- package/dist/collab/templates.js.map +1 -1
- package/dist/comments/comment.d.ts +29 -0
- package/dist/comments/comment.d.ts.map +1 -0
- package/dist/comments/comment.js +12 -0
- package/dist/comments/comment.js.map +1 -1
- package/dist/comments/editors/answer.d.ts +14 -0
- package/dist/comments/editors/answer.d.ts.map +1 -0
- package/dist/comments/editors/answer.js +5 -3
- package/dist/comments/editors/answer.js.map +1 -1
- package/dist/comments/editors/comment.d.ts +65 -0
- package/dist/comments/editors/comment.d.ts.map +1 -0
- package/dist/comments/editors/comment.js +43 -14
- package/dist/comments/editors/comment.js.map +1 -1
- package/dist/comments/editors/index.d.ts +4 -0
- package/dist/comments/editors/index.d.ts.map +1 -0
- package/dist/comments/editors/index.js.map +1 -1
- package/dist/comments/editors/notify.d.ts +3 -0
- package/dist/comments/editors/notify.d.ts.map +1 -0
- package/dist/comments/editors/notify.js.map +1 -1
- package/dist/comments/editors/schema.d.ts +12 -0
- package/dist/comments/editors/schema.d.ts.map +1 -0
- package/dist/comments/editors/schema.js +5 -5
- package/dist/comments/editors/schema.js.map +1 -1
- package/dist/comments/index.d.ts +10 -0
- package/dist/comments/index.d.ts.map +1 -0
- package/dist/comments/index.js +5 -2
- package/dist/comments/index.js.map +1 -1
- package/dist/comments/interactions.d.ts +49 -0
- package/dist/comments/interactions.d.ts.map +1 -0
- package/dist/comments/interactions.js +33 -18
- package/dist/comments/interactions.js.map +1 -1
- package/dist/comments/store.d.ts +59 -0
- package/dist/comments/store.d.ts.map +1 -0
- package/dist/comments/store.js +36 -16
- package/dist/comments/store.js.map +1 -1
- package/dist/contacts/add_dialog.d.ts +7 -0
- package/dist/contacts/add_dialog.d.ts.map +1 -0
- package/dist/contacts/add_dialog.js +25 -26
- package/dist/contacts/add_dialog.js.map +1 -1
- package/dist/contacts/templates.d.ts +12 -0
- package/dist/contacts/templates.d.ts.map +1 -0
- package/dist/contacts/templates.js +3 -2
- package/dist/contacts/templates.js.map +1 -1
- package/dist/copyright_dialog/index.d.ts +25 -0
- package/dist/copyright_dialog/index.d.ts.map +1 -0
- package/dist/copyright_dialog/index.js +34 -26
- package/dist/copyright_dialog/index.js.map +1 -1
- package/dist/copyright_dialog/templates.d.ts +17 -0
- package/dist/copyright_dialog/templates.d.ts.map +1 -0
- package/dist/copyright_dialog/templates.js.map +1 -1
- package/dist/databases/bibliography.d.ts +42 -0
- package/dist/databases/bibliography.d.ts.map +1 -0
- package/dist/databases/bibliography.js +24 -9
- package/dist/databases/bibliography.js.map +1 -1
- package/dist/databases/images.d.ts +66 -0
- package/dist/databases/images.d.ts.map +1 -0
- package/dist/databases/images.js +19 -9
- package/dist/databases/images.js.map +1 -1
- package/dist/databases/index.d.ts +26 -0
- package/dist/databases/index.d.ts.map +1 -0
- package/dist/databases/index.js +9 -8
- package/dist/databases/index.js.map +1 -1
- package/dist/dialogs/citation.d.ts +58 -0
- package/dist/dialogs/citation.d.ts.map +1 -0
- package/dist/dialogs/citation.js +43 -22
- package/dist/dialogs/citation.js.map +1 -1
- package/dist/dialogs/code_block.d.ts +25 -0
- package/dist/dialogs/code_block.d.ts.map +1 -0
- package/dist/dialogs/code_block.js +32 -11
- package/dist/dialogs/code_block.js.map +1 -1
- package/dist/dialogs/contributor.d.ts +13 -0
- package/dist/dialogs/contributor.d.ts.map +1 -0
- package/dist/dialogs/contributor.js +17 -20
- package/dist/dialogs/contributor.js.map +1 -1
- package/dist/dialogs/figure.d.ts +51 -0
- package/dist/dialogs/figure.d.ts.map +1 -0
- package/dist/dialogs/figure.js +123 -81
- package/dist/dialogs/figure.js.map +1 -1
- package/dist/dialogs/index.d.ts +11 -0
- package/dist/dialogs/index.d.ts.map +1 -0
- package/dist/dialogs/index.js.map +1 -1
- package/dist/dialogs/language.d.ts +10 -0
- package/dist/dialogs/language.d.ts.map +1 -0
- package/dist/dialogs/language.js +4 -1
- package/dist/dialogs/language.js.map +1 -1
- package/dist/dialogs/link.d.ts +30 -0
- package/dist/dialogs/link.d.ts.map +1 -0
- package/dist/dialogs/link.js +27 -15
- package/dist/dialogs/link.js.map +1 -1
- package/dist/dialogs/math.d.ts +22 -0
- package/dist/dialogs/math.d.ts.map +1 -0
- package/dist/dialogs/math.js +27 -14
- package/dist/dialogs/math.js.map +1 -1
- package/dist/dialogs/ordered_list.d.ts +22 -0
- package/dist/dialogs/ordered_list.d.ts.map +1 -0
- package/dist/dialogs/ordered_list.js +12 -5
- package/dist/dialogs/ordered_list.js.map +1 -1
- package/dist/dialogs/revision.d.ts +8 -0
- package/dist/dialogs/revision.d.ts.map +1 -0
- package/dist/dialogs/revision.js +2 -0
- package/dist/dialogs/revision.js.map +1 -1
- package/dist/dialogs/subsup.d.ts +5 -0
- package/dist/dialogs/subsup.d.ts.map +1 -0
- package/dist/dialogs/subsup.js +3 -3
- package/dist/dialogs/subsup.js.map +1 -1
- package/dist/dialogs/table.d.ts +33 -0
- package/dist/dialogs/table.d.ts.map +1 -0
- package/dist/dialogs/table.js +43 -21
- package/dist/dialogs/table.js.map +1 -1
- package/dist/dialogs/templates.d.ts +85 -0
- package/dist/dialogs/templates.d.ts.map +1 -0
- package/dist/dialogs/templates.js +8 -8
- package/dist/dialogs/templates.js.map +1 -1
- package/dist/document_template/exporter.d.ts +23 -0
- package/dist/document_template/exporter.d.ts.map +1 -0
- package/dist/document_template/exporter.js +14 -5
- package/dist/document_template/exporter.js.map +1 -1
- package/dist/document_template/index.d.ts +35 -0
- package/dist/document_template/index.d.ts.map +1 -0
- package/dist/document_template/index.js +61 -53
- package/dist/document_template/index.js.map +1 -1
- package/dist/document_template/schema.d.ts +13 -0
- package/dist/document_template/schema.d.ts.map +1 -0
- package/dist/document_template/schema.js +2 -2
- package/dist/document_template/schema.js.map +1 -1
- package/dist/documents/access_rights/index.d.ts +85 -0
- package/dist/documents/access_rights/index.d.ts.map +1 -0
- package/dist/documents/access_rights/index.js +96 -60
- package/dist/documents/access_rights/index.js.map +1 -1
- package/dist/documents/access_rights/templates.d.ts +47 -0
- package/dist/documents/access_rights/templates.d.ts.map +1 -0
- package/dist/documents/access_rights/templates.js.map +1 -1
- package/dist/e2ee/snapshot-manager.d.ts +120 -0
- package/dist/e2ee/snapshot-manager.d.ts.map +1 -0
- package/dist/e2ee/snapshot-manager.js +27 -38
- package/dist/e2ee/snapshot-manager.js.map +1 -1
- package/dist/exporter/native/copy.d.ts +16 -0
- package/dist/exporter/native/copy.d.ts.map +1 -0
- package/dist/exporter/native/copy.js +51 -35
- package/dist/exporter/native/copy.js.map +1 -1
- package/dist/exporter/native/file.d.ts +6 -0
- package/dist/exporter/native/file.d.ts.map +1 -0
- package/dist/exporter/native/file.js +1 -1
- package/dist/exporter/native/file.js.map +1 -1
- package/dist/exporter/native/index.d.ts +4 -0
- package/dist/exporter/native/index.d.ts.map +1 -0
- package/dist/exporter/native/index.js.map +1 -1
- package/dist/exporter/native/revision.d.ts +8 -0
- package/dist/exporter/native/revision.d.ts.map +1 -0
- package/dist/exporter/native/revision.js +2 -2
- package/dist/exporter/native/revision.js.map +1 -1
- package/dist/exporter/native/zip.d.ts +2 -0
- package/dist/exporter/native/zip.d.ts.map +1 -0
- package/dist/exporter/native/zip.js.map +1 -1
- package/dist/footnotes/editor.d.ts +25 -0
- package/dist/footnotes/editor.d.ts.map +1 -0
- package/dist/footnotes/editor.js +5 -3
- package/dist/footnotes/editor.js.map +1 -1
- package/dist/footnotes/index.d.ts +11 -0
- package/dist/footnotes/index.d.ts.map +1 -0
- package/dist/footnotes/index.js +5 -2
- package/dist/footnotes/index.js.map +1 -1
- package/dist/footnotes/layout.d.ts +15 -0
- package/dist/footnotes/layout.d.ts.map +1 -0
- package/dist/footnotes/layout.js +26 -17
- package/dist/footnotes/layout.js.map +1 -1
- package/dist/footnotes/state_plugins/access_rights.d.ts +6 -0
- package/dist/footnotes/state_plugins/access_rights.d.ts.map +1 -0
- package/dist/footnotes/state_plugins/access_rights.js +1 -1
- package/dist/footnotes/state_plugins/access_rights.js.map +1 -1
- package/dist/footnotes/state_plugins/index.d.ts +2 -0
- package/dist/footnotes/state_plugins/index.d.ts.map +1 -0
- package/dist/footnotes/state_plugins/index.js.map +1 -1
- package/dist/images/edit_dialog/model.d.ts +4 -0
- package/dist/images/edit_dialog/model.d.ts.map +1 -0
- package/dist/images/edit_dialog/model.js.map +1 -1
- package/dist/index.d.ts +74 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -59
- package/dist/index.js.map +1 -1
- package/dist/keymap.d.ts +5 -0
- package/dist/keymap.d.ts.map +1 -0
- package/dist/keymap.js +1 -1
- package/dist/keymap.js.map +1 -1
- package/dist/marginboxes/index.d.ts +107 -0
- package/dist/marginboxes/index.d.ts.map +1 -0
- package/dist/marginboxes/index.js +165 -88
- package/dist/marginboxes/index.js.map +1 -1
- package/dist/marginboxes/templates.d.ts +118 -0
- package/dist/marginboxes/templates.d.ts.map +1 -0
- package/dist/marginboxes/templates.js +25 -24
- package/dist/marginboxes/templates.js.map +1 -1
- package/dist/menus/code_block/index.d.ts +2 -0
- package/dist/menus/code_block/index.d.ts.map +1 -0
- package/dist/menus/code_block/index.js.map +1 -1
- package/dist/menus/code_block/model.d.ts +14 -0
- package/dist/menus/code_block/model.d.ts.map +1 -0
- package/dist/menus/code_block/model.js +5 -4
- package/dist/menus/code_block/model.js.map +1 -1
- package/dist/menus/figure/index.d.ts +3 -0
- package/dist/menus/figure/index.d.ts.map +1 -0
- package/dist/menus/figure/index.js.map +1 -1
- package/dist/menus/figure/model.d.ts +32 -0
- package/dist/menus/figure/model.d.ts.map +1 -0
- package/dist/menus/figure/model.js +11 -12
- package/dist/menus/figure/model.js.map +1 -1
- package/dist/menus/figure/utils.d.ts +3 -0
- package/dist/menus/figure/utils.d.ts.map +1 -0
- package/dist/menus/figure/utils.js +4 -1
- package/dist/menus/figure/utils.js.map +1 -1
- package/dist/menus/headerbar/index.d.ts +3 -0
- package/dist/menus/headerbar/index.d.ts.map +1 -0
- package/dist/menus/headerbar/index.js.map +1 -1
- package/dist/menus/headerbar/model.d.ts +192 -0
- package/dist/menus/headerbar/model.d.ts.map +1 -0
- package/dist/menus/headerbar/model.js +141 -110
- package/dist/menus/headerbar/model.js.map +1 -1
- package/dist/menus/headerbar/view.d.ts +89 -0
- package/dist/menus/headerbar/view.d.ts.map +1 -0
- package/dist/menus/headerbar/view.js +76 -45
- package/dist/menus/headerbar/view.js.map +1 -1
- package/dist/menus/image/index.d.ts +2 -0
- package/dist/menus/image/index.d.ts.map +1 -0
- package/dist/menus/image/index.js.map +1 -1
- package/dist/menus/image/model.d.ts +18 -0
- package/dist/menus/image/model.d.ts.map +1 -0
- package/dist/menus/image/model.js +2 -2
- package/dist/menus/image/model.js.map +1 -1
- package/dist/menus/index.d.ts +10 -0
- package/dist/menus/index.d.ts.map +1 -0
- package/dist/menus/index.js.map +1 -1
- package/dist/menus/navigator/index.d.ts +2 -0
- package/dist/menus/navigator/index.d.ts.map +1 -0
- package/dist/menus/navigator/index.js.map +1 -1
- package/dist/menus/navigator/model.d.ts +9 -0
- package/dist/menus/navigator/model.d.ts.map +1 -0
- package/dist/menus/navigator/model.js.map +1 -1
- package/dist/menus/ordered_list/index.d.ts +2 -0
- package/dist/menus/ordered_list/index.d.ts.map +1 -0
- package/dist/menus/ordered_list/index.js.map +1 -1
- package/dist/menus/ordered_list/model.d.ts +11 -0
- package/dist/menus/ordered_list/model.d.ts.map +1 -0
- package/dist/menus/ordered_list/model.js +1 -1
- package/dist/menus/ordered_list/model.js.map +1 -1
- package/dist/menus/selection/index.d.ts +3 -0
- package/dist/menus/selection/index.d.ts.map +1 -0
- package/dist/menus/selection/index.js.map +1 -1
- package/dist/menus/selection/model.d.ts +16 -0
- package/dist/menus/selection/model.d.ts.map +1 -0
- package/dist/menus/selection/model.js +18 -16
- package/dist/menus/selection/model.js.map +1 -1
- package/dist/menus/selection/view.d.ts +49 -0
- package/dist/menus/selection/view.d.ts.map +1 -0
- package/dist/menus/selection/view.js +33 -18
- package/dist/menus/selection/view.js.map +1 -1
- package/dist/menus/table/index.d.ts +2 -0
- package/dist/menus/table/index.d.ts.map +1 -0
- package/dist/menus/table/index.js.map +1 -1
- package/dist/menus/table/model.d.ts +39 -0
- package/dist/menus/table/model.d.ts.map +1 -0
- package/dist/menus/table/model.js +53 -50
- package/dist/menus/table/model.js.map +1 -1
- package/dist/menus/toolbar/index.d.ts +3 -0
- package/dist/menus/toolbar/index.d.ts.map +1 -0
- package/dist/menus/toolbar/index.js.map +1 -1
- package/dist/menus/toolbar/model.d.ts +125 -0
- package/dist/menus/toolbar/model.d.ts.map +1 -0
- package/dist/menus/toolbar/model.js +160 -140
- package/dist/menus/toolbar/model.js.map +1 -1
- package/dist/menus/toolbar/view.d.ts +72 -0
- package/dist/menus/toolbar/view.d.ts.map +1 -0
- package/dist/menus/toolbar/view.js +61 -36
- package/dist/menus/toolbar/view.js.map +1 -1
- package/dist/navigator/index.d.ts +38 -0
- package/dist/navigator/index.d.ts.map +1 -0
- package/dist/navigator/index.js +42 -21
- package/dist/navigator/index.js.map +1 -1
- package/dist/no_collab_save/index.d.ts +20 -0
- package/dist/no_collab_save/index.d.ts.map +1 -0
- package/dist/no_collab_save/index.js +20 -11
- package/dist/no_collab_save/index.js.map +1 -1
- package/dist/plugins/citation_dialog/index.d.ts +2 -0
- package/dist/plugins/citation_dialog/index.d.ts.map +1 -0
- package/dist/plugins/citation_dialog/index.js.map +1 -1
- package/dist/plugins/editor/index.d.ts +2 -0
- package/dist/plugins/editor/index.d.ts.map +1 -0
- package/dist/plugins/editor/index.js.map +1 -1
- package/dist/state_plugins/access_rights.d.ts +6 -0
- package/dist/state_plugins/access_rights.d.ts.map +1 -0
- package/dist/state_plugins/access_rights.js +5 -3
- package/dist/state_plugins/access_rights.js.map +1 -1
- package/dist/state_plugins/citation_render.d.ts +9 -0
- package/dist/state_plugins/citation_render.d.ts.map +1 -0
- package/dist/state_plugins/citation_render.js +12 -43
- package/dist/state_plugins/citation_render.js.map +1 -1
- package/dist/state_plugins/clipboard.d.ts +12 -0
- package/dist/state_plugins/clipboard.d.ts.map +1 -0
- package/dist/state_plugins/clipboard.js +13 -11
- package/dist/state_plugins/clipboard.js.map +1 -1
- package/dist/state_plugins/code_block.d.ts +6 -0
- package/dist/state_plugins/code_block.d.ts.map +1 -0
- package/dist/state_plugins/code_block.js +23 -9
- package/dist/state_plugins/code_block.js.map +1 -1
- package/dist/state_plugins/collab_carets.d.ts +26 -0
- package/dist/state_plugins/collab_carets.d.ts.map +1 -0
- package/dist/state_plugins/collab_carets.js +24 -16
- package/dist/state_plugins/collab_carets.js.map +1 -1
- package/dist/state_plugins/comments.d.ts +15 -0
- package/dist/state_plugins/comments.d.ts.map +1 -0
- package/dist/state_plugins/comments.js +26 -21
- package/dist/state_plugins/comments.js.map +1 -1
- package/dist/state_plugins/contributor_input/dropup.d.ts +17 -0
- package/dist/state_plugins/contributor_input/dropup.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/dropup.js +19 -20
- package/dist/state_plugins/contributor_input/dropup.js.map +1 -1
- package/dist/state_plugins/contributor_input/index.d.ts +3 -0
- package/dist/state_plugins/contributor_input/index.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/index.js.map +1 -1
- package/dist/state_plugins/contributor_input/node_view.d.ts +7 -0
- package/dist/state_plugins/contributor_input/node_view.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/node_view.js.map +1 -1
- package/dist/state_plugins/contributor_input/plugin.d.ts +19 -0
- package/dist/state_plugins/contributor_input/plugin.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/plugin.js +14 -45
- package/dist/state_plugins/contributor_input/plugin.js.map +1 -1
- package/dist/state_plugins/document_template.d.ts +33 -0
- package/dist/state_plugins/document_template.d.ts.map +1 -0
- package/dist/state_plugins/document_template.js +34 -15
- package/dist/state_plugins/document_template.js.map +1 -1
- package/dist/state_plugins/figure.d.ts +6 -0
- package/dist/state_plugins/figure.d.ts.map +1 -0
- package/dist/state_plugins/figure.js +26 -8
- package/dist/state_plugins/figure.js.map +1 -1
- package/dist/state_plugins/footnote_markers.d.ts +15 -0
- package/dist/state_plugins/footnote_markers.d.ts.map +1 -0
- package/dist/state_plugins/footnote_markers.js +72 -153
- package/dist/state_plugins/footnote_markers.js.map +1 -1
- package/dist/state_plugins/headerbar.d.ts +6 -0
- package/dist/state_plugins/headerbar.d.ts.map +1 -0
- package/dist/state_plugins/headerbar.js +1 -1
- package/dist/state_plugins/headerbar.js.map +1 -1
- package/dist/state_plugins/index.d.ts +28 -0
- package/dist/state_plugins/index.d.ts.map +1 -0
- package/dist/state_plugins/index.js +13 -12
- package/dist/state_plugins/index.js.map +1 -1
- package/dist/state_plugins/inline_math.d.ts +6 -0
- package/dist/state_plugins/inline_math.d.ts.map +1 -0
- package/dist/state_plugins/inline_math.js +28 -19
- package/dist/state_plugins/inline_math.js.map +1 -1
- package/dist/state_plugins/inline_reference/dropup.d.ts +62 -0
- package/dist/state_plugins/inline_reference/dropup.d.ts.map +1 -0
- package/dist/state_plugins/inline_reference/dropup.js +17 -17
- package/dist/state_plugins/inline_reference/dropup.js.map +1 -1
- package/dist/state_plugins/inline_reference/index.d.ts +2 -0
- package/dist/state_plugins/inline_reference/index.d.ts.map +1 -0
- package/dist/state_plugins/inline_reference/index.js.map +1 -1
- package/dist/state_plugins/inline_reference/plugin.d.ts +35 -0
- package/dist/state_plugins/inline_reference/plugin.d.ts.map +1 -0
- package/dist/state_plugins/inline_reference/plugin.js +68 -55
- package/dist/state_plugins/inline_reference/plugin.js.map +1 -1
- package/dist/state_plugins/jump_hidden_nodes.d.ts +5 -0
- package/dist/state_plugins/jump_hidden_nodes.d.ts.map +1 -0
- package/dist/state_plugins/jump_hidden_nodes.js +35 -22
- package/dist/state_plugins/jump_hidden_nodes.js.map +1 -1
- package/dist/state_plugins/links.d.ts +11 -0
- package/dist/state_plugins/links.d.ts.map +1 -0
- package/dist/state_plugins/links.js +39 -25
- package/dist/state_plugins/links.js.map +1 -1
- package/dist/state_plugins/marginboxes.d.ts +6 -0
- package/dist/state_plugins/marginboxes.d.ts.map +1 -0
- package/dist/state_plugins/marginboxes.js +2 -1
- package/dist/state_plugins/marginboxes.js.map +1 -1
- package/dist/state_plugins/ordered_list_menu.d.ts +6 -0
- package/dist/state_plugins/ordered_list_menu.d.ts.map +1 -0
- package/dist/state_plugins/ordered_list_menu.js +20 -6
- package/dist/state_plugins/ordered_list_menu.js.map +1 -1
- package/dist/state_plugins/placeholders.d.ts +6 -0
- package/dist/state_plugins/placeholders.d.ts.map +1 -0
- package/dist/state_plugins/placeholders.js +18 -54
- package/dist/state_plugins/placeholders.js.map +1 -1
- package/dist/state_plugins/search.d.ts +34 -0
- package/dist/state_plugins/search.d.ts.map +1 -0
- package/dist/state_plugins/search.js +31 -27
- package/dist/state_plugins/search.js.map +1 -1
- package/dist/state_plugins/selection_menu.d.ts +6 -0
- package/dist/state_plugins/selection_menu.d.ts.map +1 -0
- package/dist/state_plugins/selection_menu.js +1 -1
- package/dist/state_plugins/selection_menu.js.map +1 -1
- package/dist/state_plugins/settings.d.ts +8 -0
- package/dist/state_plugins/settings.d.ts.map +1 -0
- package/dist/state_plugins/settings.js +31 -21
- package/dist/state_plugins/settings.js.map +1 -1
- package/dist/state_plugins/table.d.ts +6 -0
- package/dist/state_plugins/table.d.ts.map +1 -0
- package/dist/state_plugins/table.js +33 -13
- package/dist/state_plugins/table.js.map +1 -1
- package/dist/state_plugins/tag_input/index.d.ts +3 -0
- package/dist/state_plugins/tag_input/index.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/index.js.map +1 -1
- package/dist/state_plugins/tag_input/node_view.d.ts +7 -0
- package/dist/state_plugins/tag_input/node_view.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/node_view.js.map +1 -1
- package/dist/state_plugins/tag_input/plugin.d.ts +14 -0
- package/dist/state_plugins/tag_input/plugin.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/plugin.js +7 -6
- package/dist/state_plugins/tag_input/plugin.js.map +1 -1
- package/dist/state_plugins/toc_render.d.ts +6 -0
- package/dist/state_plugins/toc_render.d.ts.map +1 -0
- package/dist/state_plugins/toc_render.js +59 -96
- package/dist/state_plugins/toc_render.js.map +1 -1
- package/dist/state_plugins/toolbar.d.ts +6 -0
- package/dist/state_plugins/toolbar.d.ts.map +1 -0
- package/dist/state_plugins/toolbar.js +1 -1
- package/dist/state_plugins/toolbar.js.map +1 -1
- package/dist/state_plugins/track/find_selected_changes.d.ts +13 -0
- package/dist/state_plugins/track/find_selected_changes.d.ts.map +1 -0
- package/dist/state_plugins/track/find_selected_changes.js +4 -3
- package/dist/state_plugins/track/find_selected_changes.js.map +1 -1
- package/dist/state_plugins/track/helpers.d.ts +29 -0
- package/dist/state_plugins/track/helpers.d.ts.map +1 -0
- package/dist/state_plugins/track/helpers.js +9 -3
- package/dist/state_plugins/track/helpers.js.map +1 -1
- package/dist/state_plugins/track/index.d.ts +3 -0
- package/dist/state_plugins/track/index.d.ts.map +1 -0
- package/dist/state_plugins/track/index.js.map +1 -1
- package/dist/state_plugins/track/plugin.d.ts +14 -0
- package/dist/state_plugins/track/plugin.d.ts.map +1 -0
- package/dist/state_plugins/track/plugin.js +10 -6
- package/dist/state_plugins/track/plugin.js.map +1 -1
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/key_bindings/index.d.ts +7 -0
- package/dist/tools/key_bindings/index.d.ts.map +1 -0
- package/dist/tools/key_bindings/index.js +1 -3
- package/dist/tools/key_bindings/index.js.map +1 -1
- package/dist/tools/key_bindings/templates.d.ts +2 -0
- package/dist/tools/key_bindings/templates.d.ts.map +1 -0
- package/dist/tools/key_bindings/templates.js.map +1 -1
- package/dist/tools/search_replace/index.d.ts +28 -0
- package/dist/tools/search_replace/index.d.ts.map +1 -0
- package/dist/tools/search_replace/index.js +53 -27
- package/dist/tools/search_replace/index.js.map +1 -1
- package/dist/tools/search_replace/templates.d.ts +6 -0
- package/dist/tools/search_replace/templates.d.ts.map +1 -0
- package/dist/tools/search_replace/templates.js.map +1 -1
- package/dist/tools/word_count/index.d.ts +15 -0
- package/dist/tools/word_count/index.d.ts.map +1 -0
- package/dist/tools/word_count/index.js +2 -1
- package/dist/tools/word_count/index.js.map +1 -1
- package/dist/tools/word_count/templates.d.ts +11 -0
- package/dist/tools/word_count/templates.d.ts.map +1 -0
- package/dist/tools/word_count/templates.js.map +1 -1
- package/dist/track/accept.d.ts +3 -0
- package/dist/track/accept.d.ts.map +1 -0
- package/dist/track/accept.js +10 -5
- package/dist/track/accept.js.map +1 -1
- package/dist/track/accept_all.d.ts +3 -0
- package/dist/track/accept_all.d.ts.map +1 -0
- package/dist/track/accept_all.js +2 -2
- package/dist/track/accept_all.js.map +1 -1
- package/dist/track/accept_all_no_insertions.d.ts +3 -0
- package/dist/track/accept_all_no_insertions.d.ts.map +1 -0
- package/dist/track/accept_all_no_insertions.js +2 -2
- package/dist/track/accept_all_no_insertions.js.map +1 -1
- package/dist/track/amend_transaction.d.ts +5 -0
- package/dist/track/amend_transaction.d.ts.map +1 -0
- package/dist/track/amend_transaction.js +55 -32
- package/dist/track/amend_transaction.js.map +1 -1
- package/dist/track/delete.d.ts +3 -0
- package/dist/track/delete.d.ts.map +1 -0
- package/dist/track/delete.js +4 -3
- package/dist/track/delete.js.map +1 -1
- package/dist/track/index.d.ts +6 -0
- package/dist/track/index.d.ts.map +1 -0
- package/dist/track/index.js.map +1 -1
- package/dist/track/mod.d.ts +10 -0
- package/dist/track/mod.d.ts.map +1 -0
- package/dist/track/mod.js +9 -5
- package/dist/track/mod.js.map +1 -1
- package/dist/track/reject.d.ts +3 -0
- package/dist/track/reject.d.ts.map +1 -0
- package/dist/track/reject.js +14 -5
- package/dist/track/reject.js.map +1 -1
- package/dist/track/reject_all.d.ts +3 -0
- package/dist/track/reject_all.d.ts.map +1 -0
- package/dist/track/reject_all.js +6 -2
- package/dist/track/reject_all.js.map +1 -1
- package/dist/types.d.ts +182 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/package.json +38 -3
- package/src/bibliography/{tools.js → tools.ts} +16 -5
- package/src/citations/{index.js → index.ts} +100 -80
- package/src/citations/{render.js → render.ts} +43 -15
- package/src/clipboard/copy/{schema.js → schema.ts} +19 -8
- package/src/clipboard/copy/{serializers.js → serializers.ts} +44 -32
- package/src/clipboard/paste/{fidus_writer.js → fidus_writer.ts} +28 -8
- package/src/clipboard/paste/{general.js → general.ts} +28 -13
- package/src/clipboard/paste/{google_docs.js → google_docs.ts} +7 -4
- package/src/clipboard/paste/{html.js → html.ts} +35 -8
- package/src/clipboard/paste/{libreoffice_writer.js → libreoffice_writer.ts} +4 -4
- package/src/clipboard/paste/{microsoft_word.js → microsoft_word.ts} +22 -21
- package/src/clipboard/paste/{text.js → text.ts} +11 -7
- package/src/collab/{chat.js → chat.ts} +78 -27
- package/src/collab/{colors.js → colors.ts} +21 -5
- package/src/collab/{doc.js → doc.ts} +290 -184
- package/src/collab/{index.js → index.ts} +47 -13
- package/src/collab/merge/{changeset.js → changeset.ts} +33 -20
- package/src/collab/merge/{editor.js → editor.ts} +211 -107
- package/src/collab/merge/{footnotes.js → footnotes.ts} +43 -22
- package/src/collab/merge/{index.js → index.ts} +147 -70
- package/src/collab/merge/{recreate_transform.js → recreate_transform.ts} +60 -29
- package/src/collab/merge/{schema.js → schema.ts} +55 -35
- package/src/collab/merge/state_plugins/{action.js → action.ts} +65 -27
- package/src/collab/merge/state_plugins/{clipboard.js → clipboard.ts} +13 -3
- package/src/collab/merge/state_plugins/{diff.js → diff.ts} +279 -168
- package/src/collab/merge/{tools.js → tools.ts} +57 -27
- package/src/collab/{templates.js → templates.ts} +17 -2
- package/src/comments/{comment.js → comment.ts} +26 -0
- package/src/comments/editors/{answer.js → answer.ts} +27 -12
- package/src/comments/editors/{comment.js → comment.ts} +112 -36
- package/src/comments/editors/{notify.js → notify.ts} +6 -1
- package/src/comments/editors/{schema.js → schema.ts} +9 -8
- package/src/comments/index.ts +16 -0
- package/src/comments/{interactions.js → interactions.ts} +150 -89
- package/src/comments/{store.js → store.ts} +149 -73
- package/src/contacts/{add_dialog.js → add_dialog.ts} +50 -37
- package/src/contacts/{templates.js → templates.ts} +9 -3
- package/src/copyright_dialog/{index.js → index.ts} +92 -57
- package/src/copyright_dialog/{templates.js → templates.ts} +18 -3
- package/src/databases/{bibliography.js → bibliography.ts} +62 -36
- package/src/databases/{images.js → images.ts} +146 -96
- package/src/databases/index.ts +116 -0
- package/src/dialogs/{citation.js → citation.ts} +187 -106
- package/src/dialogs/{code_block.js → code_block.ts} +75 -33
- package/src/dialogs/{contributor.js → contributor.ts} +74 -49
- package/src/dialogs/{figure.js → figure.ts} +250 -149
- package/src/dialogs/{language.js → language.ts} +11 -6
- package/src/dialogs/{link.js → link.ts} +105 -60
- package/src/dialogs/{math.js → math.ts} +56 -28
- package/src/dialogs/{ordered_list.js → ordered_list.ts} +25 -12
- package/src/dialogs/{revision.js → revision.ts} +13 -9
- package/src/dialogs/{subsup.js → subsup.ts} +9 -7
- package/src/dialogs/{table.js → table.ts} +129 -70
- package/src/dialogs/{templates.js → templates.ts} +102 -22
- package/src/document_template/exporter.ts +158 -0
- package/src/document_template/{index.js → index.ts} +158 -117
- package/src/document_template/{schema.js → schema.ts} +31 -28
- package/src/documents/access_rights/{index.js → index.ts} +240 -123
- package/src/documents/access_rights/{templates.js → templates.ts} +41 -5
- package/src/e2ee/{snapshot-manager.js → snapshot-manager.ts} +80 -49
- package/src/exporter/native/copy.ts +302 -0
- package/src/exporter/native/{file.js → file.ts} +12 -5
- package/src/exporter/native/{revision.js → revision.ts} +17 -9
- package/src/footnotes/{editor.js → editor.ts} +37 -18
- package/src/footnotes/index.ts +21 -0
- package/src/footnotes/{layout.js → layout.ts} +53 -36
- package/src/footnotes/state_plugins/{access_rights.js → access_rights.ts} +6 -4
- package/src/global.d.ts +29 -0
- package/src/images/edit_dialog/{model.js → model.ts} +1 -1
- package/src/{index.js → index.ts} +193 -132
- package/src/{keymap.js → keymap.ts} +36 -16
- package/src/marginboxes/{index.js → index.ts} +341 -171
- package/src/marginboxes/{templates.js → templates.ts} +236 -38
- package/src/menus/code_block/{model.js → model.ts} +16 -5
- package/src/menus/figure/{model.js → model.ts} +21 -16
- package/src/menus/figure/utils.ts +13 -0
- package/src/menus/headerbar/{model.js → model.ts} +243 -153
- package/src/menus/headerbar/{view.js → view.ts} +189 -92
- package/src/menus/image/{model.js → model.ts} +13 -4
- package/src/menus/navigator/{model.js → model.ts} +6 -1
- package/src/menus/ordered_list/{model.js → model.ts} +2 -1
- package/src/menus/selection/{model.js → model.ts} +38 -20
- package/src/menus/selection/{view.js → view.ts} +88 -35
- package/src/menus/table/{model.js → model.ts} +84 -63
- package/src/menus/toolbar/{model.js → model.ts} +267 -215
- package/src/menus/toolbar/{view.js → view.ts} +135 -65
- package/src/modules.d.ts +84 -0
- package/src/navigator/{index.js → index.ts} +90 -56
- package/src/no_collab_save/{index.js → index.ts} +54 -31
- package/src/state_plugins/{access_rights.js → access_rights.ts} +12 -7
- package/src/state_plugins/citation_render.ts +63 -0
- package/src/state_plugins/{clipboard.js → clipboard.ts} +38 -23
- package/src/state_plugins/{code_block.js → code_block.ts} +62 -28
- package/src/state_plugins/{collab_carets.js → collab_carets.ts} +56 -25
- package/src/state_plugins/{comments.js → comments.ts} +70 -40
- package/src/state_plugins/contributor_input/{dropup.js → dropup.ts} +70 -38
- package/src/state_plugins/contributor_input/{node_view.js → node_view.ts} +13 -4
- package/src/state_plugins/contributor_input/{plugin.js → plugin.ts} +74 -75
- package/src/state_plugins/{document_template.js → document_template.ts} +108 -49
- package/src/state_plugins/{figure.js → figure.ts} +61 -23
- package/src/state_plugins/footnote_markers.ts +142 -0
- package/src/state_plugins/{headerbar.js → headerbar.ts} +4 -2
- package/src/state_plugins/{index.js → index.ts} +23 -56
- package/src/state_plugins/{inline_math.js → inline_math.ts} +151 -65
- package/src/state_plugins/inline_reference/{dropup.js → dropup.ts} +68 -34
- package/src/state_plugins/inline_reference/{plugin.js → plugin.ts} +221 -101
- package/src/state_plugins/jump_hidden_nodes.ts +67 -0
- package/src/state_plugins/{links.js → links.ts} +153 -99
- package/src/state_plugins/marginboxes.ts +17 -0
- package/src/state_plugins/{ordered_list_menu.js → ordered_list_menu.ts} +43 -17
- package/src/state_plugins/placeholders.ts +78 -0
- package/src/state_plugins/{search.js → search.ts} +110 -48
- package/src/state_plugins/{selection_menu.js → selection_menu.ts} +4 -2
- package/src/state_plugins/{settings.js → settings.ts} +68 -39
- package/src/state_plugins/table.ts +169 -0
- package/src/state_plugins/tag_input/{node_view.js → node_view.ts} +12 -3
- package/src/state_plugins/tag_input/plugin.ts +292 -0
- package/src/state_plugins/toc_render.ts +133 -0
- package/src/state_plugins/{toolbar.js → toolbar.ts} +4 -2
- package/src/state_plugins/track/{find_selected_changes.js → find_selected_changes.ts} +34 -19
- package/src/state_plugins/track/{helpers.js → helpers.ts} +36 -10
- package/src/state_plugins/track/{plugin.js → plugin.ts} +38 -14
- package/src/tools/key_bindings/{index.js → index.ts} +7 -3
- package/src/tools/key_bindings/{templates.js → templates.ts} +1 -1
- package/src/tools/search_replace/{index.js → index.ts} +115 -69
- package/src/tools/search_replace/{templates.js → templates.ts} +6 -1
- package/src/tools/word_count/{index.js → index.ts} +16 -6
- package/src/tools/word_count/{templates.js → templates.ts} +10 -1
- package/src/track/{accept.js → accept.ts} +20 -9
- package/src/track/{accept_all.js → accept_all.ts} +27 -17
- package/src/track/{accept_all_no_insertions.js → accept_all_no_insertions.ts} +16 -10
- package/src/track/{amend_transaction.js → amend_transaction.ts} +130 -70
- package/src/track/{delete.js → delete.ts} +15 -12
- package/src/track/{mod.js → mod.ts} +51 -32
- package/src/track/{reject.js → reject.ts} +34 -19
- package/src/track/{reject_all.js → reject_all.ts} +44 -24
- package/src/types.ts +214 -0
- package/src/comments/index.js +0 -11
- package/src/databases/index.js +0 -69
- package/src/document_template/exporter.js +0 -97
- package/src/exporter/native/copy.js +0 -191
- package/src/footnotes/index.js +0 -16
- package/src/menus/figure/utils.js +0 -5
- package/src/state_plugins/citation_render.js +0 -88
- package/src/state_plugins/footnote_markers.js +0 -238
- package/src/state_plugins/jump_hidden_nodes.js +0 -58
- package/src/state_plugins/marginboxes.js +0 -14
- package/src/state_plugins/placeholders.js +0 -123
- package/src/state_plugins/table.js +0 -127
- package/src/state_plugins/tag_input/plugin.js +0 -278
- package/src/state_plugins/toc_render.js +0 -160
- /package/src/clipboard/copy/{index.js → index.ts} +0 -0
- /package/src/clipboard/paste/{index.js → index.ts} +0 -0
- /package/src/collab/merge/state_plugins/{index.js → index.ts} +0 -0
- /package/src/comments/editors/{index.js → index.ts} +0 -0
- /package/src/dialogs/{index.js → index.ts} +0 -0
- /package/src/exporter/native/{index.js → index.ts} +0 -0
- /package/src/exporter/native/{zip.js → zip.ts} +0 -0
- /package/src/footnotes/state_plugins/{index.js → index.ts} +0 -0
- /package/src/menus/code_block/{index.js → index.ts} +0 -0
- /package/src/menus/figure/{index.js → index.ts} +0 -0
- /package/src/menus/headerbar/{index.js → index.ts} +0 -0
- /package/src/menus/image/{index.js → index.ts} +0 -0
- /package/src/menus/{index.js → index.ts} +0 -0
- /package/src/menus/navigator/{index.js → index.ts} +0 -0
- /package/src/menus/ordered_list/{index.js → index.ts} +0 -0
- /package/src/menus/selection/{index.js → index.ts} +0 -0
- /package/src/menus/table/{index.js → index.ts} +0 -0
- /package/src/menus/toolbar/{index.js → index.ts} +0 -0
- /package/src/plugins/citation_dialog/{index.js → index.ts} +0 -0
- /package/src/plugins/editor/{index.js → index.ts} +0 -0
- /package/src/state_plugins/contributor_input/{index.js → index.ts} +0 -0
- /package/src/state_plugins/inline_reference/{index.js → index.ts} +0 -0
- /package/src/state_plugins/tag_input/{index.js → index.ts} +0 -0
- /package/src/state_plugins/track/{index.js → index.ts} +0 -0
- /package/src/tools/{index.js → index.ts} +0 -0
- /package/src/track/{index.js → index.ts} +0 -0
|
@@ -2,21 +2,34 @@ import {
|
|
|
2
2
|
NodeSelection,
|
|
3
3
|
Plugin,
|
|
4
4
|
PluginKey,
|
|
5
|
-
TextSelection
|
|
5
|
+
TextSelection,
|
|
6
|
+
type EditorState
|
|
6
7
|
} from "prosemirror-state"
|
|
7
|
-
import {Decoration, DecorationSet} from "prosemirror-view"
|
|
8
|
+
import {Decoration, DecorationSet, type EditorView} from "prosemirror-view"
|
|
9
|
+
import type {Node as ProseMirrorNode} from "prosemirror-model"
|
|
8
10
|
|
|
9
11
|
import {COMMENT_ONLY_ROLES, READ_ONLY_ROLES} from "../index.js"
|
|
10
12
|
import {MathDialog} from "../dialogs/index.js"
|
|
11
13
|
import {elementDisabled} from "../menus/toolbar/model.js"
|
|
14
|
+
import type {Editor} from "../types.js"
|
|
12
15
|
|
|
13
16
|
const key = new PluginKey("inlineMath")
|
|
14
17
|
|
|
18
|
+
interface MathDialogLike {
|
|
19
|
+
new (editor: Editor): {init(): void}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const MathDialogCtor = MathDialog as MathDialogLike
|
|
23
|
+
|
|
15
24
|
/**
|
|
16
25
|
* Check if an inline equation can be activated at the current position.
|
|
17
26
|
* Mirrors the toolbar equation-button disabled check.
|
|
18
27
|
*/
|
|
19
|
-
function canActivateInlineMath(
|
|
28
|
+
function canActivateInlineMath(
|
|
29
|
+
_state: EditorState,
|
|
30
|
+
_$pos: unknown,
|
|
31
|
+
editor: Editor
|
|
32
|
+
): boolean {
|
|
20
33
|
if (editor && elementDisabled(editor, "equation")) {
|
|
21
34
|
return false
|
|
22
35
|
}
|
|
@@ -27,7 +40,7 @@ function canActivateInlineMath(_state, _$pos, editor) {
|
|
|
27
40
|
/* Helpers shared by the inline-editor widget */
|
|
28
41
|
/* ────────────────────────────────────────────────────────── */
|
|
29
42
|
|
|
30
|
-
function getInputCursorPos(input) {
|
|
43
|
+
function getInputCursorPos(input: HTMLElement): number {
|
|
31
44
|
const sel = window.getSelection()
|
|
32
45
|
if (!sel || sel.rangeCount === 0) {
|
|
33
46
|
return (input.textContent || "").length
|
|
@@ -35,7 +48,7 @@ function getInputCursorPos(input) {
|
|
|
35
48
|
return sel.getRangeAt(0).startOffset
|
|
36
49
|
}
|
|
37
50
|
|
|
38
|
-
function setInputCursorPos(input, pos) {
|
|
51
|
+
function setInputCursorPos(input: HTMLElement, pos: number): void {
|
|
39
52
|
const textNode = input.firstChild
|
|
40
53
|
if (!textNode) {
|
|
41
54
|
return
|
|
@@ -51,12 +64,27 @@ function setInputCursorPos(input, pos) {
|
|
|
51
64
|
}
|
|
52
65
|
}
|
|
53
66
|
|
|
67
|
+
interface InlineEditorState {
|
|
68
|
+
active: boolean
|
|
69
|
+
from: number
|
|
70
|
+
query: string
|
|
71
|
+
isEdit: boolean
|
|
72
|
+
mathNodePos: number
|
|
73
|
+
widgetId: string | undefined
|
|
74
|
+
cursorAtStart: boolean | undefined
|
|
75
|
+
decos: DecorationSet
|
|
76
|
+
}
|
|
77
|
+
|
|
54
78
|
/**
|
|
55
79
|
* Build the contenteditable widget that lets the user type raw LaTeX.
|
|
56
80
|
* The query includes the leading "$", which is shown in the widget so the
|
|
57
|
-
* user always sees "$…latex
|
|
81
|
+
* user always sees "$…latex…”.
|
|
58
82
|
*/
|
|
59
|
-
function createInlineMathWidget(
|
|
83
|
+
function createInlineMathWidget(
|
|
84
|
+
editor: Editor,
|
|
85
|
+
pluginState: InlineEditorState,
|
|
86
|
+
pluginKey: PluginKey
|
|
87
|
+
): HTMLElement {
|
|
60
88
|
const view = editor.currentView || editor.view
|
|
61
89
|
const container = document.createElement("span")
|
|
62
90
|
container.className = "inline-math-widget"
|
|
@@ -67,8 +95,7 @@ function createInlineMathWidget(editor, pluginState, pluginKey) {
|
|
|
67
95
|
input.className = "inline-math-input"
|
|
68
96
|
input.textContent = pluginState.query
|
|
69
97
|
|
|
70
|
-
input.addEventListener("input",
|
|
71
|
-
event.stopPropagation()
|
|
98
|
+
input.addEventListener("input", () => {
|
|
72
99
|
const text = input.textContent || ""
|
|
73
100
|
if (!text) {
|
|
74
101
|
// Everything including `$` was deleted — remove the node.
|
|
@@ -99,7 +126,9 @@ function createInlineMathWidget(editor, pluginState, pluginKey) {
|
|
|
99
126
|
|
|
100
127
|
input.addEventListener("keydown", event => {
|
|
101
128
|
event.stopPropagation()
|
|
102
|
-
const currentState = pluginKey.getState(view.state)
|
|
129
|
+
const currentState = pluginKey.getState(view.state) as
|
|
130
|
+
| InlineEditorState
|
|
131
|
+
| undefined
|
|
103
132
|
if (!currentState?.active) {
|
|
104
133
|
return
|
|
105
134
|
}
|
|
@@ -173,14 +202,16 @@ function createInlineMathWidget(editor, pluginState, pluginKey) {
|
|
|
173
202
|
|
|
174
203
|
input.addEventListener("focusout", event => {
|
|
175
204
|
const related = event.relatedTarget
|
|
176
|
-
if (container.contains(related)) {
|
|
205
|
+
if (container.contains(related as globalThis.Node | null)) {
|
|
177
206
|
return
|
|
178
207
|
}
|
|
179
208
|
const myWidgetId = pluginState.widgetId
|
|
180
209
|
// Use a tiny timeout so that a click on the container itself
|
|
181
210
|
// (e.g. scrollbar) does not accidentally commit.
|
|
182
211
|
setTimeout(() => {
|
|
183
|
-
const currentState = pluginKey.getState(view.state)
|
|
212
|
+
const currentState = pluginKey.getState(view.state) as
|
|
213
|
+
| InlineEditorState
|
|
214
|
+
| undefined
|
|
184
215
|
if (currentState?.active && currentState.widgetId === myWidgetId) {
|
|
185
216
|
view.dispatch(
|
|
186
217
|
view.state.tr.setMeta(pluginKey, {action: "commit"})
|
|
@@ -212,26 +243,35 @@ function createInlineMathWidget(editor, pluginState, pluginKey) {
|
|
|
212
243
|
/* Dropup plugin (inline_math preference OFF) */
|
|
213
244
|
/* ────────────────────────────────────────────────────────── */
|
|
214
245
|
|
|
215
|
-
|
|
246
|
+
interface DropupState {
|
|
247
|
+
equationNode: ProseMirrorNode | undefined
|
|
248
|
+
decos: DecorationSet
|
|
249
|
+
selectedIndex: number
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function dropupPlugin(options: {editor: Editor}): Plugin {
|
|
216
253
|
const editor = options.editor
|
|
217
|
-
let currentDropUpActions = []
|
|
254
|
+
let currentDropUpActions: Array<() => void> = []
|
|
218
255
|
|
|
219
256
|
const editAccess = ["write", "write-tracked", "review-tracked"].includes(
|
|
220
|
-
editor.docInfo.access_rights
|
|
257
|
+
editor.docInfo.access_rights as string
|
|
221
258
|
)
|
|
222
259
|
|
|
223
|
-
function getEquationNode(state) {
|
|
260
|
+
function getEquationNode(state: EditorState): ProseMirrorNode | undefined {
|
|
224
261
|
return state.selection instanceof NodeSelection &&
|
|
225
262
|
state.selection.node.type.name === "equation"
|
|
226
263
|
? state.selection.node
|
|
227
264
|
: undefined
|
|
228
265
|
}
|
|
229
266
|
|
|
230
|
-
function createEquationDropUp(
|
|
267
|
+
function createEquationDropUp(
|
|
268
|
+
equationNode: ProseMirrorNode,
|
|
269
|
+
selectedIndex = -1
|
|
270
|
+
): HTMLElement {
|
|
231
271
|
const dropUp = document.createElement("span")
|
|
232
272
|
dropUp.classList.add("drop-up-outer")
|
|
233
273
|
|
|
234
|
-
const _latex = equationNode.attrs.equation
|
|
274
|
+
const _latex = equationNode.attrs.equation as string
|
|
235
275
|
const requiredPx = editAccess ? 92 : 50
|
|
236
276
|
|
|
237
277
|
dropUp.innerHTML = `
|
|
@@ -254,7 +294,10 @@ function dropupPlugin(options) {
|
|
|
254
294
|
</div>`
|
|
255
295
|
|
|
256
296
|
currentDropUpActions = []
|
|
257
|
-
const setupAction = (
|
|
297
|
+
const setupAction = (
|
|
298
|
+
selector: string,
|
|
299
|
+
action: () => void
|
|
300
|
+
): void => {
|
|
258
301
|
const el = dropUp.querySelector(selector)
|
|
259
302
|
if (!el) {
|
|
260
303
|
return
|
|
@@ -271,7 +314,7 @@ function dropupPlugin(options) {
|
|
|
271
314
|
// MathDialog reads the NodeSelection from the view, so we rely on
|
|
272
315
|
// the equation node already being NodeSelected when the button is
|
|
273
316
|
// activated.
|
|
274
|
-
const dialog = new
|
|
317
|
+
const dialog = new MathDialogCtor(editor)
|
|
275
318
|
dialog.init()
|
|
276
319
|
})
|
|
277
320
|
|
|
@@ -295,7 +338,7 @@ function dropupPlugin(options) {
|
|
|
295
338
|
return dropUp
|
|
296
339
|
}
|
|
297
340
|
|
|
298
|
-
function getDecos(state, selectedIndex = -1) {
|
|
341
|
+
function getDecos(state: EditorState, selectedIndex = -1): DecorationSet {
|
|
299
342
|
const equationNode = getEquationNode(state)
|
|
300
343
|
if (!equationNode) {
|
|
301
344
|
return DecorationSet.empty
|
|
@@ -311,20 +354,20 @@ function dropupPlugin(options) {
|
|
|
311
354
|
return new Plugin({
|
|
312
355
|
key,
|
|
313
356
|
state: {
|
|
314
|
-
init() {
|
|
357
|
+
init(): DropupState {
|
|
315
358
|
return {
|
|
316
359
|
equationNode: undefined,
|
|
317
360
|
decos: DecorationSet.empty,
|
|
318
361
|
selectedIndex: -1
|
|
319
362
|
}
|
|
320
363
|
},
|
|
321
|
-
apply(tr, prev, _oldState, state) {
|
|
364
|
+
apply(tr, prev, _oldState, state): DropupState {
|
|
322
365
|
const newEquationNode = getEquationNode(state)
|
|
323
366
|
const meta = tr.getMeta(key)
|
|
324
|
-
let {selectedIndex} = prev
|
|
367
|
+
let {selectedIndex} = prev as DropupState
|
|
325
368
|
|
|
326
369
|
if (meta?.action === "navigate") {
|
|
327
|
-
selectedIndex = meta.index
|
|
370
|
+
selectedIndex = meta.index as number
|
|
328
371
|
return {
|
|
329
372
|
equationNode: newEquationNode,
|
|
330
373
|
decos: getDecos(state, selectedIndex),
|
|
@@ -332,10 +375,13 @@ function dropupPlugin(options) {
|
|
|
332
375
|
}
|
|
333
376
|
}
|
|
334
377
|
|
|
335
|
-
if (newEquationNode === prev.equationNode) {
|
|
378
|
+
if (newEquationNode === (prev as DropupState).equationNode) {
|
|
336
379
|
return {
|
|
337
380
|
equationNode: newEquationNode,
|
|
338
|
-
decos: prev.decos.map(
|
|
381
|
+
decos: (prev as DropupState).decos.map(
|
|
382
|
+
tr.mapping,
|
|
383
|
+
tr.doc
|
|
384
|
+
),
|
|
339
385
|
selectedIndex
|
|
340
386
|
}
|
|
341
387
|
}
|
|
@@ -350,8 +396,10 @@ function dropupPlugin(options) {
|
|
|
350
396
|
}
|
|
351
397
|
},
|
|
352
398
|
props: {
|
|
353
|
-
handleKeyDown(view, event) {
|
|
354
|
-
const pluginState = key.getState(view.state)
|
|
399
|
+
handleKeyDown(view: EditorView, event: KeyboardEvent) {
|
|
400
|
+
const pluginState = key.getState(view.state) as
|
|
401
|
+
| DropupState
|
|
402
|
+
| undefined
|
|
355
403
|
if (!pluginState?.equationNode) {
|
|
356
404
|
return false
|
|
357
405
|
}
|
|
@@ -396,8 +444,10 @@ function dropupPlugin(options) {
|
|
|
396
444
|
}
|
|
397
445
|
return false
|
|
398
446
|
},
|
|
399
|
-
decorations(state) {
|
|
400
|
-
const pluginState = key.getState(state)
|
|
447
|
+
decorations(state: EditorState) {
|
|
448
|
+
const pluginState = key.getState(state) as
|
|
449
|
+
| DropupState
|
|
450
|
+
| undefined
|
|
401
451
|
return pluginState?.decos || DecorationSet.empty
|
|
402
452
|
}
|
|
403
453
|
}
|
|
@@ -408,13 +458,13 @@ function dropupPlugin(options) {
|
|
|
408
458
|
/* Inline editor plugin (inline_math preference ON) */
|
|
409
459
|
/* ────────────────────────────────────────────────────────── */
|
|
410
460
|
|
|
411
|
-
function inlineEditorPlugin(options) {
|
|
461
|
+
function inlineEditorPlugin(options: {editor: Editor}): Plugin {
|
|
412
462
|
const editor = options.editor
|
|
413
463
|
|
|
414
464
|
return new Plugin({
|
|
415
465
|
key,
|
|
416
466
|
state: {
|
|
417
|
-
init() {
|
|
467
|
+
init(): InlineEditorState {
|
|
418
468
|
return {
|
|
419
469
|
active: false,
|
|
420
470
|
from: 0,
|
|
@@ -426,19 +476,21 @@ function inlineEditorPlugin(options) {
|
|
|
426
476
|
decos: DecorationSet.empty
|
|
427
477
|
}
|
|
428
478
|
},
|
|
429
|
-
apply(tr, prev, _oldState, _newState) {
|
|
430
|
-
let next = {...prev}
|
|
479
|
+
apply(tr, prev, _oldState, _newState): InlineEditorState {
|
|
480
|
+
let next = {...prev} as InlineEditorState
|
|
431
481
|
const meta = tr.getMeta(key)
|
|
432
482
|
|
|
433
483
|
if (meta?.action === "activate") {
|
|
434
484
|
next = {
|
|
435
485
|
active: true,
|
|
436
|
-
from: meta.from,
|
|
437
|
-
query: meta.query || "$",
|
|
438
|
-
isEdit: meta.isEdit || false,
|
|
439
|
-
mathNodePos: meta.mathNodePos || 0,
|
|
486
|
+
from: meta.from as number,
|
|
487
|
+
query: (meta.query as string) || "$",
|
|
488
|
+
isEdit: (meta.isEdit as boolean) || false,
|
|
489
|
+
mathNodePos: (meta.mathNodePos as number) || 0,
|
|
440
490
|
widgetId: Math.random().toString(36).slice(2),
|
|
441
|
-
cursorAtStart: meta.cursorAtStart
|
|
491
|
+
cursorAtStart: meta.cursorAtStart as
|
|
492
|
+
| boolean
|
|
493
|
+
| undefined,
|
|
442
494
|
decos: DecorationSet.empty
|
|
443
495
|
}
|
|
444
496
|
} else if (meta?.action === "deactivate") {
|
|
@@ -453,7 +505,7 @@ function inlineEditorPlugin(options) {
|
|
|
453
505
|
decos: DecorationSet.empty
|
|
454
506
|
}
|
|
455
507
|
} else if (meta?.action === "updateQuery") {
|
|
456
|
-
next.query = meta.query
|
|
508
|
+
next.query = meta.query as string
|
|
457
509
|
}
|
|
458
510
|
|
|
459
511
|
if (next.active) {
|
|
@@ -494,7 +546,9 @@ function inlineEditorPlugin(options) {
|
|
|
494
546
|
},
|
|
495
547
|
|
|
496
548
|
appendTransaction: (trs, oldState, newState) => {
|
|
497
|
-
const oldPluginState = key.getState(oldState)
|
|
549
|
+
const oldPluginState = key.getState(oldState) as
|
|
550
|
+
| InlineEditorState
|
|
551
|
+
| undefined
|
|
498
552
|
const meta = trs.find(tr => tr.getMeta(key))?.getMeta(key)
|
|
499
553
|
|
|
500
554
|
/* ── commit / commitAndRight ── */
|
|
@@ -502,7 +556,7 @@ function inlineEditorPlugin(options) {
|
|
|
502
556
|
meta?.action === "commit" ||
|
|
503
557
|
meta?.action === "commitAndRight"
|
|
504
558
|
) {
|
|
505
|
-
if (!oldPluginState
|
|
559
|
+
if (!oldPluginState?.active) {
|
|
506
560
|
return null
|
|
507
561
|
}
|
|
508
562
|
const query = oldPluginState.query
|
|
@@ -580,7 +634,10 @@ function inlineEditorPlugin(options) {
|
|
|
580
634
|
|
|
581
635
|
/* ── cancel ── */
|
|
582
636
|
if (meta?.action === "cancel") {
|
|
583
|
-
if (oldPluginState
|
|
637
|
+
if (!oldPluginState) {
|
|
638
|
+
return null
|
|
639
|
+
}
|
|
640
|
+
if (oldPluginState?.isEdit) {
|
|
584
641
|
// Leave the equation node unchanged; move cursor after it.
|
|
585
642
|
const node = newState.doc.nodeAt(oldPluginState.mathNodePos)
|
|
586
643
|
const tr = newState.tr.setSelection(
|
|
@@ -602,7 +659,10 @@ function inlineEditorPlugin(options) {
|
|
|
602
659
|
|
|
603
660
|
/* ── cancelDelete ── */
|
|
604
661
|
if (meta?.action === "cancelDelete") {
|
|
605
|
-
if (oldPluginState
|
|
662
|
+
if (!oldPluginState) {
|
|
663
|
+
return null
|
|
664
|
+
}
|
|
665
|
+
if (oldPluginState?.isEdit) {
|
|
606
666
|
// Delete the equation node entirely.
|
|
607
667
|
const existingNode = newState.doc.nodeAt(
|
|
608
668
|
oldPluginState.mathNodePos
|
|
@@ -624,7 +684,10 @@ function inlineEditorPlugin(options) {
|
|
|
624
684
|
|
|
625
685
|
/* ── cancelLeft ── */
|
|
626
686
|
if (meta?.action === "cancelLeft") {
|
|
627
|
-
if (oldPluginState
|
|
687
|
+
if (!oldPluginState) {
|
|
688
|
+
return null
|
|
689
|
+
}
|
|
690
|
+
if (oldPluginState?.isEdit) {
|
|
628
691
|
const tr = newState.tr.setSelection(
|
|
629
692
|
TextSelection.create(
|
|
630
693
|
newState.doc,
|
|
@@ -633,7 +696,10 @@ function inlineEditorPlugin(options) {
|
|
|
633
696
|
)
|
|
634
697
|
return tr.setMeta(key, {action: "deactivate"})
|
|
635
698
|
} else {
|
|
636
|
-
const tr = newState.tr.insertText(
|
|
699
|
+
const tr = newState.tr.insertText(
|
|
700
|
+
"$",
|
|
701
|
+
oldPluginState.from
|
|
702
|
+
)
|
|
637
703
|
tr.setSelection(
|
|
638
704
|
TextSelection.create(tr.doc, oldPluginState.from)
|
|
639
705
|
)
|
|
@@ -642,7 +708,7 @@ function inlineEditorPlugin(options) {
|
|
|
642
708
|
}
|
|
643
709
|
|
|
644
710
|
/* ── implicit commit when selection moves away ── */
|
|
645
|
-
if (oldPluginState
|
|
711
|
+
if (oldPluginState?.active) {
|
|
646
712
|
if (
|
|
647
713
|
trs.some(tr => tr.selectionSet) &&
|
|
648
714
|
(newState.selection.from !== oldPluginState.from ||
|
|
@@ -724,12 +790,21 @@ function inlineEditorPlugin(options) {
|
|
|
724
790
|
},
|
|
725
791
|
|
|
726
792
|
props: {
|
|
727
|
-
decorations(state) {
|
|
728
|
-
const pluginState = key.getState(state)
|
|
793
|
+
decorations(state: EditorState) {
|
|
794
|
+
const pluginState = key.getState(state) as
|
|
795
|
+
| InlineEditorState
|
|
796
|
+
| undefined
|
|
729
797
|
return pluginState?.decos || DecorationSet.empty
|
|
730
798
|
},
|
|
731
799
|
|
|
732
|
-
handleClickOn(
|
|
800
|
+
handleClickOn(
|
|
801
|
+
_view: EditorView,
|
|
802
|
+
_pos: number,
|
|
803
|
+
node: ProseMirrorNode,
|
|
804
|
+
nodePos: number,
|
|
805
|
+
_event: MouseEvent,
|
|
806
|
+
_direct: boolean
|
|
807
|
+
) {
|
|
733
808
|
if (node.type.name === "equation") {
|
|
734
809
|
const tr = _view.state.tr.setSelection(
|
|
735
810
|
TextSelection.create(
|
|
@@ -751,24 +826,27 @@ function inlineEditorPlugin(options) {
|
|
|
751
826
|
},
|
|
752
827
|
|
|
753
828
|
handleDOMEvents: {
|
|
754
|
-
mousedown(view, event) {
|
|
829
|
+
mousedown(view: EditorView, event: MouseEvent) {
|
|
755
830
|
if (event.ctrlKey || event.metaKey || event.shiftKey) {
|
|
756
831
|
return false
|
|
757
832
|
}
|
|
758
833
|
if (event.button !== 0) {
|
|
759
834
|
return false
|
|
760
835
|
}
|
|
761
|
-
const target = event.target
|
|
762
|
-
|
|
836
|
+
const target = event.target as HTMLElement | null
|
|
837
|
+
const closest = target?.closest(".equation")
|
|
838
|
+
if (!closest) {
|
|
763
839
|
return false
|
|
764
840
|
}
|
|
765
|
-
let pos = view.posAtDOM(
|
|
841
|
+
let pos = view.posAtDOM(closest, 0)
|
|
766
842
|
let node = view.state.doc.nodeAt(pos)
|
|
767
843
|
if (!node || node.type.name !== "equation") {
|
|
768
844
|
return false
|
|
769
845
|
}
|
|
770
846
|
|
|
771
|
-
const pluginState = key.getState(view.state)
|
|
847
|
+
const pluginState = key.getState(view.state) as
|
|
848
|
+
| InlineEditorState
|
|
849
|
+
| undefined
|
|
772
850
|
if (pluginState?.active) {
|
|
773
851
|
// Commit the current widget before opening a new one.
|
|
774
852
|
const commitTr = view.state.tr.setMeta(key, {
|
|
@@ -801,10 +879,13 @@ function inlineEditorPlugin(options) {
|
|
|
801
879
|
return true
|
|
802
880
|
},
|
|
803
881
|
|
|
804
|
-
click(view, event) {
|
|
805
|
-
const pluginState = key.getState(view.state)
|
|
882
|
+
click(view: EditorView, event: MouseEvent) {
|
|
883
|
+
const pluginState = key.getState(view.state) as
|
|
884
|
+
| InlineEditorState
|
|
885
|
+
| undefined
|
|
806
886
|
if (pluginState?.active) {
|
|
807
|
-
|
|
887
|
+
const target = event.target as HTMLElement | null
|
|
888
|
+
if (target?.closest(".inline-math-widget")) {
|
|
808
889
|
// Click inside the widget: let the widget handle it.
|
|
809
890
|
return false
|
|
810
891
|
}
|
|
@@ -819,8 +900,10 @@ function inlineEditorPlugin(options) {
|
|
|
819
900
|
}
|
|
820
901
|
},
|
|
821
902
|
|
|
822
|
-
handleKeyDown(view, event) {
|
|
823
|
-
const pluginState = key.getState(view.state)
|
|
903
|
+
handleKeyDown(view: EditorView, event: KeyboardEvent) {
|
|
904
|
+
const pluginState = key.getState(view.state) as
|
|
905
|
+
| InlineEditorState
|
|
906
|
+
| undefined
|
|
824
907
|
if (!pluginState?.active) {
|
|
825
908
|
/* ── "$" keypress → activate inline editor ── */
|
|
826
909
|
if (event.key === "$") {
|
|
@@ -906,13 +989,16 @@ function inlineEditorPlugin(options) {
|
|
|
906
989
|
/* Public plugin factory */
|
|
907
990
|
/* ────────────────────────────────────────────────────────── */
|
|
908
991
|
|
|
909
|
-
export const inlineMathPlugin = options => {
|
|
992
|
+
export const inlineMathPlugin = (options: {editor: Editor}): Plugin => {
|
|
910
993
|
const editor = options.editor
|
|
911
994
|
|
|
995
|
+
const appConfig = editor.app as {
|
|
996
|
+
config?: {user?: {preferences?: {inline_math?: boolean}}}
|
|
997
|
+
}
|
|
912
998
|
const enabled =
|
|
913
|
-
|
|
914
|
-
!READ_ONLY_ROLES.includes(editor.docInfo.access_rights) &&
|
|
915
|
-
!COMMENT_ONLY_ROLES.includes(editor.docInfo.access_rights)
|
|
999
|
+
appConfig.config?.user?.preferences?.inline_math === true &&
|
|
1000
|
+
!READ_ONLY_ROLES.includes(editor.docInfo.access_rights as string) &&
|
|
1001
|
+
!COMMENT_ONLY_ROLES.includes(editor.docInfo.access_rights as string)
|
|
916
1002
|
|
|
917
1003
|
return enabled ? inlineEditorPlugin(options) : dropupPlugin(options)
|
|
918
1004
|
}
|
|
@@ -1,21 +1,47 @@
|
|
|
1
1
|
import {escapeText} from "fwtoolkit"
|
|
2
2
|
import {dateToYear, litToText, nameToText} from "@fiduswriter/bibliography-manager/tools"
|
|
3
|
+
import type {EditorState} from "prosemirror-state"
|
|
4
|
+
|
|
3
5
|
import {getInternalTargets} from "../links.js"
|
|
6
|
+
import type {Editor} from "../../types.js"
|
|
7
|
+
|
|
8
|
+
interface CitationMatch {
|
|
9
|
+
id: number
|
|
10
|
+
entry_key: string
|
|
11
|
+
author?: string
|
|
12
|
+
title?: string
|
|
13
|
+
year?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface CrossRefTarget {
|
|
17
|
+
id: string
|
|
18
|
+
text: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface BibliographyEntry {
|
|
22
|
+
id: number
|
|
23
|
+
entry_key: string
|
|
24
|
+
author: string
|
|
25
|
+
title: string
|
|
26
|
+
year: string
|
|
27
|
+
source: string
|
|
28
|
+
entry: any
|
|
29
|
+
}
|
|
4
30
|
|
|
5
31
|
/**
|
|
6
32
|
* Create a drop-up widget for the inline reference editor.
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
33
|
+
* @param citationMatches - Array of {id, entry_key, author, title, year} objects
|
|
34
|
+
* @param selectedIndex - Currently selected index
|
|
35
|
+
* @param onSelect - Callback when an item is selected
|
|
36
|
+
* @param crossRefMatches - Array of {id, text} cross-reference objects
|
|
37
|
+
* @returns The drop-up DOM element
|
|
12
38
|
*/
|
|
13
39
|
export function createInlineReferenceDropUp(
|
|
14
|
-
citationMatches,
|
|
15
|
-
selectedIndex,
|
|
16
|
-
onSelect,
|
|
17
|
-
crossRefMatches = []
|
|
18
|
-
) {
|
|
40
|
+
citationMatches: CitationMatch[],
|
|
41
|
+
selectedIndex: number,
|
|
42
|
+
onSelect: (index: number) => void,
|
|
43
|
+
crossRefMatches: CrossRefTarget[] = []
|
|
44
|
+
): HTMLElement {
|
|
19
45
|
const container = document.createElement("span")
|
|
20
46
|
container.classList.add("drop-up-outer", "inline-reference-drop-up")
|
|
21
47
|
|
|
@@ -91,16 +117,16 @@ export function createInlineReferenceDropUp(
|
|
|
91
117
|
/**
|
|
92
118
|
* Build a flat list of bibliography entries for matching.
|
|
93
119
|
* Searches both document bibDB and user bibDB.
|
|
94
|
-
* @param
|
|
95
|
-
* @returns
|
|
120
|
+
* @param editor - The Editor instance
|
|
121
|
+
* @returns Array of {id, entry_key, author, title, year, source, entry}
|
|
96
122
|
* where `entry` is the raw DB object (needed when importing a user entry
|
|
97
123
|
* into the document bibDB via addReference).
|
|
98
124
|
*/
|
|
99
|
-
export function buildBibliographyList(editor) {
|
|
100
|
-
const entries = []
|
|
101
|
-
const seenKeys = new Set()
|
|
125
|
+
export function buildBibliographyList(editor: Editor): BibliographyEntry[] {
|
|
126
|
+
const entries: BibliographyEntry[] = []
|
|
127
|
+
const seenKeys = new Set<string>()
|
|
102
128
|
|
|
103
|
-
const addEntries = (db, source) => {
|
|
129
|
+
const addEntries = (db: Record<number, any>, source: string): void => {
|
|
104
130
|
if (!db) {
|
|
105
131
|
return
|
|
106
132
|
}
|
|
@@ -128,10 +154,10 @@ export function buildBibliographyList(editor) {
|
|
|
128
154
|
}
|
|
129
155
|
|
|
130
156
|
if (editor.mod?.db?.bibDB?.db) {
|
|
131
|
-
addEntries(editor.mod.db.bibDB.db, "doc")
|
|
157
|
+
addEntries(editor.mod.db.bibDB.db as Record<number, any>, "doc")
|
|
132
158
|
}
|
|
133
|
-
if (editor.app
|
|
134
|
-
addEntries(editor.app.bibDB.db, "user")
|
|
159
|
+
if ((editor.app as any).bibDB?.db) {
|
|
160
|
+
addEntries((editor.app as any).bibDB.db as Record<number, any>, "user")
|
|
135
161
|
}
|
|
136
162
|
|
|
137
163
|
return entries
|
|
@@ -139,11 +165,14 @@ export function buildBibliographyList(editor) {
|
|
|
139
165
|
|
|
140
166
|
/**
|
|
141
167
|
* Filter bibliography entries by query string (prefix match on entry_key).
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
144
|
-
* @returns
|
|
168
|
+
* @param entries - Full bibliography list
|
|
169
|
+
* @param query - Search query
|
|
170
|
+
* @returns Filtered entries
|
|
145
171
|
*/
|
|
146
|
-
export function filterBibliography(
|
|
172
|
+
export function filterBibliography(
|
|
173
|
+
entries: BibliographyEntry[],
|
|
174
|
+
query: string
|
|
175
|
+
): BibliographyEntry[] {
|
|
147
176
|
if (!query) {
|
|
148
177
|
return entries.slice(0, 50)
|
|
149
178
|
}
|
|
@@ -168,17 +197,19 @@ export function filterBibliography(entries, query) {
|
|
|
168
197
|
/**
|
|
169
198
|
* Build a list of cross-reference targets (headings, figures, tables,
|
|
170
199
|
* code blocks, anchors) from the main document and footnotes.
|
|
171
|
-
* @param
|
|
172
|
-
* @returns
|
|
200
|
+
* @param editor - The Editor instance
|
|
201
|
+
* @returns Array of {id, text} objects
|
|
173
202
|
*/
|
|
174
|
-
export function buildCrossRefList(editor) {
|
|
175
|
-
const mainState = editor.view.state
|
|
176
|
-
const language = mainState.doc.attrs.language
|
|
203
|
+
export function buildCrossRefList(editor: Editor): CrossRefTarget[] {
|
|
204
|
+
const mainState = editor.view.state as EditorState
|
|
205
|
+
const language = mainState.doc.attrs.language as string
|
|
177
206
|
const targets = getInternalTargets(mainState, language, "main")
|
|
178
|
-
if (
|
|
207
|
+
if (
|
|
208
|
+
(editor.mod as any).footnotes?.fnEditor?.view?.state
|
|
209
|
+
) {
|
|
179
210
|
targets.push(
|
|
180
211
|
...getInternalTargets(
|
|
181
|
-
editor.mod.footnotes.fnEditor.view.state,
|
|
212
|
+
(editor.mod as any).footnotes.fnEditor.view.state,
|
|
182
213
|
language,
|
|
183
214
|
"foot"
|
|
184
215
|
)
|
|
@@ -189,11 +220,14 @@ export function buildCrossRefList(editor) {
|
|
|
189
220
|
|
|
190
221
|
/**
|
|
191
222
|
* Filter cross-reference targets by query string (substring match on text).
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
194
|
-
* @returns
|
|
223
|
+
* @param targets - Full cross-reference list
|
|
224
|
+
* @param query - Search query (without leading @)
|
|
225
|
+
* @returns Filtered targets (max 50)
|
|
195
226
|
*/
|
|
196
|
-
export function filterCrossRefs(
|
|
227
|
+
export function filterCrossRefs(
|
|
228
|
+
targets: CrossRefTarget[],
|
|
229
|
+
query: string
|
|
230
|
+
): CrossRefTarget[] {
|
|
197
231
|
if (!query) {
|
|
198
232
|
return targets.slice(0, 50)
|
|
199
233
|
}
|