@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
|
@@ -5,6 +5,10 @@ import {
|
|
|
5
5
|
TextSelection
|
|
6
6
|
} from "prosemirror-state"
|
|
7
7
|
import {Decoration, DecorationSet} from "prosemirror-view"
|
|
8
|
+
import type {Node as ProseMirrorNode} from "prosemirror-model"
|
|
9
|
+
import type {EditorState} from "prosemirror-state"
|
|
10
|
+
import type {EditorView} from "prosemirror-view"
|
|
11
|
+
|
|
8
12
|
import {COMMENT_ONLY_ROLES, READ_ONLY_ROLES} from "../../index.js"
|
|
9
13
|
import {elementDisabled} from "../../menus/toolbar/model.js"
|
|
10
14
|
import {
|
|
@@ -15,10 +19,47 @@ import {
|
|
|
15
19
|
filterCrossRefs
|
|
16
20
|
} from "./dropup.js"
|
|
17
21
|
|
|
22
|
+
import type {Editor} from "../../types.js"
|
|
23
|
+
|
|
18
24
|
const key = new PluginKey("inlineReference")
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
interface BibliographyEntry {
|
|
27
|
+
id: number
|
|
28
|
+
entry_key: string
|
|
29
|
+
author: string
|
|
30
|
+
title: string
|
|
31
|
+
year: string
|
|
32
|
+
source: string
|
|
33
|
+
entry: Record<string, unknown>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface CrossRefTarget {
|
|
37
|
+
id: string
|
|
38
|
+
text: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface InlineReferenceState {
|
|
42
|
+
active: boolean
|
|
43
|
+
from: number
|
|
44
|
+
query: string
|
|
45
|
+
selectedIndex: number
|
|
46
|
+
listActive: boolean
|
|
47
|
+
isEdit: boolean
|
|
48
|
+
referenceNodePos: number
|
|
49
|
+
bibList: BibliographyEntry[]
|
|
50
|
+
widgetId: string | undefined
|
|
51
|
+
cursorAtStart: boolean | undefined
|
|
52
|
+
decos: DecorationSet
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const getInlineReferenceState = (state: EditorState) => key.getState(state)
|
|
56
|
+
|
|
57
|
+
export const setInlineReferenceState = (
|
|
58
|
+
tr: {
|
|
59
|
+
setMeta: (key: PluginKey, state: Partial<InlineReferenceState>) => unknown
|
|
60
|
+
},
|
|
61
|
+
state: Partial<InlineReferenceState>
|
|
62
|
+
) => tr.setMeta(key, state)
|
|
22
63
|
|
|
23
64
|
/**
|
|
24
65
|
* Check if citations can be inserted at the given position.
|
|
@@ -26,7 +67,7 @@ export const setInlineReferenceState = (tr, state) => tr.setMeta(key, state)
|
|
|
26
67
|
* (allowed elements per doc part, protected sections) — the same conditions
|
|
27
68
|
* that disable the toolbar citation button.
|
|
28
69
|
*/
|
|
29
|
-
function canActivateInlineReference(editor) {
|
|
70
|
+
function canActivateInlineReference(editor: Editor): boolean {
|
|
30
71
|
// Mirror the template-based restriction check used by the toolbar button.
|
|
31
72
|
if (
|
|
32
73
|
editor &&
|
|
@@ -38,12 +79,25 @@ function canActivateInlineReference(editor) {
|
|
|
38
79
|
return true
|
|
39
80
|
}
|
|
40
81
|
|
|
82
|
+
interface ParsedCitation {
|
|
83
|
+
references: Array<{
|
|
84
|
+
id: number
|
|
85
|
+
prefix?: string
|
|
86
|
+
locator?: string
|
|
87
|
+
}>
|
|
88
|
+
format: string
|
|
89
|
+
}
|
|
90
|
+
|
|
41
91
|
/**
|
|
42
92
|
* Parse inline citation text into references array.
|
|
43
93
|
* Format: @key[prefix][locator];key2[prefix2][locator2]
|
|
44
94
|
* Returns {references, format} or null if any key cannot be resolved.
|
|
45
95
|
*/
|
|
46
|
-
function parseCitationText(
|
|
96
|
+
function parseCitationText(
|
|
97
|
+
text: string,
|
|
98
|
+
bibEntries: BibliographyEntry[],
|
|
99
|
+
bibDB: {addReference(entry: Record<string, unknown>, id: number): number}
|
|
100
|
+
): ParsedCitation | null {
|
|
47
101
|
let format = "autocite"
|
|
48
102
|
let body = text
|
|
49
103
|
if (body.startsWith("@@")) {
|
|
@@ -57,7 +111,7 @@ function parseCitationText(text, bibEntries, bibDB) {
|
|
|
57
111
|
return null
|
|
58
112
|
}
|
|
59
113
|
|
|
60
|
-
const references = []
|
|
114
|
+
const references: ParsedCitation["references"] = []
|
|
61
115
|
const parts = body.split(";")
|
|
62
116
|
|
|
63
117
|
for (const part of parts) {
|
|
@@ -82,7 +136,7 @@ function parseCitationText(text, bibEntries, bibDB) {
|
|
|
82
136
|
// addReference then writes into the document DB, corrupting it.
|
|
83
137
|
id = bibDB.addReference(bibEntry.entry, id)
|
|
84
138
|
}
|
|
85
|
-
const ref = {id}
|
|
139
|
+
const ref: ParsedCitation["references"][number] = {id}
|
|
86
140
|
if (match[2]) {
|
|
87
141
|
ref.prefix = match[2]
|
|
88
142
|
}
|
|
@@ -102,7 +156,7 @@ function parseCitationText(text, bibEntries, bibDB) {
|
|
|
102
156
|
/**
|
|
103
157
|
* Extract the active reference index based on cursor offset.
|
|
104
158
|
*/
|
|
105
|
-
function getActiveRefIndex(text, cursorOffset) {
|
|
159
|
+
function getActiveRefIndex(text: string, cursorOffset: number): number {
|
|
106
160
|
let pos = 0
|
|
107
161
|
const parts = text.split(";")
|
|
108
162
|
for (let i = 0; i < parts.length; i++) {
|
|
@@ -118,7 +172,7 @@ function getActiveRefIndex(text, cursorOffset) {
|
|
|
118
172
|
/**
|
|
119
173
|
* Get the query (key being typed) for the active reference.
|
|
120
174
|
*/
|
|
121
|
-
function getActiveQuery(text, activeIndex) {
|
|
175
|
+
function getActiveQuery(text: string, activeIndex: number): string {
|
|
122
176
|
const parts = text.split(";")
|
|
123
177
|
let part = parts[activeIndex] || ""
|
|
124
178
|
if (part.startsWith("@@")) {
|
|
@@ -133,7 +187,11 @@ function getActiveQuery(text, activeIndex) {
|
|
|
133
187
|
/**
|
|
134
188
|
* Replace the key of the active reference while preserving prefix/locator.
|
|
135
189
|
*/
|
|
136
|
-
function replaceActiveKey(
|
|
190
|
+
function replaceActiveKey(
|
|
191
|
+
text: string,
|
|
192
|
+
activeIndex: number,
|
|
193
|
+
newKey: string
|
|
194
|
+
): string {
|
|
137
195
|
const parts = text.split(";")
|
|
138
196
|
let part = parts[activeIndex] || ""
|
|
139
197
|
let trigger = ""
|
|
@@ -153,9 +211,16 @@ function replaceActiveKey(text, activeIndex, newKey) {
|
|
|
153
211
|
/**
|
|
154
212
|
* Convert a citation node back to its inline text representation.
|
|
155
213
|
*/
|
|
156
|
-
function citationToText(
|
|
157
|
-
|
|
158
|
-
|
|
214
|
+
function citationToText(
|
|
215
|
+
node: ProseMirrorNode,
|
|
216
|
+
bibEntries: BibliographyEntry[]
|
|
217
|
+
): string {
|
|
218
|
+
const format = node.attrs.format as string
|
|
219
|
+
const references = (node.attrs.references || []) as Array<{
|
|
220
|
+
id: number
|
|
221
|
+
prefix?: string
|
|
222
|
+
locator?: string
|
|
223
|
+
}>
|
|
159
224
|
const parts = references.map(ref => {
|
|
160
225
|
const entry = bibEntries.find(e => e.id === ref.id)
|
|
161
226
|
const key = entry ? entry.entry_key : ""
|
|
@@ -175,7 +240,7 @@ function citationToText(node, bibEntries) {
|
|
|
175
240
|
return "@" + body
|
|
176
241
|
}
|
|
177
242
|
|
|
178
|
-
function getInputCursorPos(el) {
|
|
243
|
+
function getInputCursorPos(el: HTMLElement): number {
|
|
179
244
|
const sel = window.getSelection()
|
|
180
245
|
if (!sel || !sel.rangeCount) {
|
|
181
246
|
return (el.textContent || "").length
|
|
@@ -187,13 +252,13 @@ function getInputCursorPos(el) {
|
|
|
187
252
|
return range.startOffset
|
|
188
253
|
}
|
|
189
254
|
|
|
190
|
-
function setInputCursorPos(el, pos) {
|
|
255
|
+
function setInputCursorPos(el: HTMLElement, pos: number): void {
|
|
191
256
|
const textNode = el.firstChild
|
|
192
257
|
if (!textNode) {
|
|
193
258
|
return
|
|
194
259
|
}
|
|
195
260
|
const range = document.createRange()
|
|
196
|
-
const safePos = Math.max(0, Math.min(pos, textNode.length))
|
|
261
|
+
const safePos = Math.max(0, Math.min(pos, (textNode as Text).length))
|
|
197
262
|
range.setStart(textNode, safePos)
|
|
198
263
|
range.collapse(true)
|
|
199
264
|
const sel = window.getSelection()
|
|
@@ -206,7 +271,11 @@ function setInputCursorPos(el, pos) {
|
|
|
206
271
|
/**
|
|
207
272
|
* Create the inline citation widget DOM element.
|
|
208
273
|
*/
|
|
209
|
-
function createInlineReferenceWidget(
|
|
274
|
+
function createInlineReferenceWidget(
|
|
275
|
+
editor: Editor,
|
|
276
|
+
pluginState: InlineReferenceState,
|
|
277
|
+
pluginKey: PluginKey
|
|
278
|
+
): HTMLElement {
|
|
210
279
|
const view = editor.currentView || editor.view
|
|
211
280
|
const container = document.createElement("span")
|
|
212
281
|
container.className = "inline-reference-widget"
|
|
@@ -223,8 +292,10 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
223
292
|
const dropUpWrapper = document.createElement("span")
|
|
224
293
|
dropUpWrapper.className = "drop-up-outer inline-reference-drop-up"
|
|
225
294
|
|
|
226
|
-
function renderDropUp() {
|
|
227
|
-
const currentState =
|
|
295
|
+
function renderDropUp(): void {
|
|
296
|
+
const currentState = pluginKey.getState(view.state) as
|
|
297
|
+
| InlineReferenceState
|
|
298
|
+
| undefined
|
|
228
299
|
if (!currentState?.active) {
|
|
229
300
|
return
|
|
230
301
|
}
|
|
@@ -232,7 +303,9 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
232
303
|
const citDisabled = elementDisabled(editor, "citation")
|
|
233
304
|
const xrefDisabled = elementDisabled(editor, "cross_reference")
|
|
234
305
|
const isXrefMode = !xrefDisabled && rawText.startsWith("@#")
|
|
235
|
-
let citationMatches
|
|
306
|
+
let citationMatches: BibliographyEntry[],
|
|
307
|
+
xrefMatches: CrossRefTarget[],
|
|
308
|
+
activeCitIndex: number
|
|
236
309
|
if (isXrefMode) {
|
|
237
310
|
// Cross-reference mode: only show cross-refs, filter by id/text
|
|
238
311
|
citationMatches = []
|
|
@@ -279,7 +352,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
279
352
|
)
|
|
280
353
|
setInputCursorPos(input, newCursor + entry.entry_key.length)
|
|
281
354
|
view.dispatch(
|
|
282
|
-
view.state.tr.setMeta(
|
|
355
|
+
view.state.tr.setMeta(pluginKey, {
|
|
283
356
|
action: "updateQuery",
|
|
284
357
|
query: input.textContent
|
|
285
358
|
})
|
|
@@ -294,7 +367,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
294
367
|
input.textContent = `@#${target.id}`
|
|
295
368
|
setInputCursorPos(input, input.textContent.length)
|
|
296
369
|
view.dispatch(
|
|
297
|
-
view.state.tr.setMeta(
|
|
370
|
+
view.state.tr.setMeta(pluginKey, {
|
|
298
371
|
action: "updateQuery",
|
|
299
372
|
query: input.textContent
|
|
300
373
|
})
|
|
@@ -314,12 +387,11 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
314
387
|
}
|
|
315
388
|
}
|
|
316
389
|
|
|
317
|
-
input.addEventListener("input",
|
|
318
|
-
event.stopPropagation()
|
|
390
|
+
input.addEventListener("input", () => {
|
|
319
391
|
const text = input.textContent || ""
|
|
320
392
|
if (!text) {
|
|
321
393
|
// Everything including `@` was deleted — remove the node.
|
|
322
|
-
view.dispatch(view.state.tr.setMeta(
|
|
394
|
+
view.dispatch(view.state.tr.setMeta(pluginKey, {action: "cancelDelete"}))
|
|
323
395
|
view.focus()
|
|
324
396
|
return
|
|
325
397
|
}
|
|
@@ -330,7 +402,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
330
402
|
setInputCursorPos(input, cursorPos + 1)
|
|
331
403
|
}
|
|
332
404
|
view.dispatch(
|
|
333
|
-
view.state.tr.setMeta(
|
|
405
|
+
view.state.tr.setMeta(pluginKey, {
|
|
334
406
|
action: "updateQuery",
|
|
335
407
|
query: input.textContent
|
|
336
408
|
})
|
|
@@ -344,7 +416,9 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
344
416
|
|
|
345
417
|
input.addEventListener("keydown", event => {
|
|
346
418
|
event.stopPropagation()
|
|
347
|
-
const currentState =
|
|
419
|
+
const currentState = pluginKey.getState(view.state) as
|
|
420
|
+
| InlineReferenceState
|
|
421
|
+
| undefined
|
|
348
422
|
if (!currentState?.active) {
|
|
349
423
|
return
|
|
350
424
|
}
|
|
@@ -354,7 +428,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
354
428
|
if (getInputCursorPos(input) === 0) {
|
|
355
429
|
event.preventDefault()
|
|
356
430
|
view.dispatch(
|
|
357
|
-
view.state.tr.setMeta(
|
|
431
|
+
view.state.tr.setMeta(pluginKey, {action: "cancelLeft"})
|
|
358
432
|
)
|
|
359
433
|
view.focus()
|
|
360
434
|
}
|
|
@@ -366,7 +440,9 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
366
440
|
) {
|
|
367
441
|
event.preventDefault()
|
|
368
442
|
view.dispatch(
|
|
369
|
-
view.state.tr.setMeta(
|
|
443
|
+
view.state.tr.setMeta(pluginKey, {
|
|
444
|
+
action: "commitAndRight"
|
|
445
|
+
})
|
|
370
446
|
)
|
|
371
447
|
view.focus()
|
|
372
448
|
}
|
|
@@ -374,10 +450,12 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
374
450
|
case "ArrowDown":
|
|
375
451
|
event.preventDefault()
|
|
376
452
|
{
|
|
377
|
-
const
|
|
378
|
-
|
|
453
|
+
const state = pluginKey.getState(view.state) as
|
|
454
|
+
| InlineReferenceState
|
|
455
|
+
| undefined
|
|
456
|
+
if (!state?.listActive) {
|
|
379
457
|
view.dispatch(
|
|
380
|
-
view.state.tr.setMeta(
|
|
458
|
+
view.state.tr.setMeta(pluginKey, {
|
|
381
459
|
action: "select",
|
|
382
460
|
index: 0,
|
|
383
461
|
listActive: true
|
|
@@ -385,9 +463,9 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
385
463
|
)
|
|
386
464
|
} else {
|
|
387
465
|
view.dispatch(
|
|
388
|
-
view.state.tr.setMeta(
|
|
466
|
+
view.state.tr.setMeta(pluginKey, {
|
|
389
467
|
action: "select",
|
|
390
|
-
index:
|
|
468
|
+
index: state.selectedIndex + 1,
|
|
391
469
|
listActive: true
|
|
392
470
|
})
|
|
393
471
|
)
|
|
@@ -398,21 +476,20 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
398
476
|
case "ArrowUp":
|
|
399
477
|
event.preventDefault()
|
|
400
478
|
{
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
) {
|
|
479
|
+
const state = pluginKey.getState(view.state) as
|
|
480
|
+
| InlineReferenceState
|
|
481
|
+
| undefined
|
|
482
|
+
if (state?.listActive && state.selectedIndex > 0) {
|
|
406
483
|
view.dispatch(
|
|
407
|
-
view.state.tr.setMeta(
|
|
484
|
+
view.state.tr.setMeta(pluginKey, {
|
|
408
485
|
action: "select",
|
|
409
|
-
index:
|
|
486
|
+
index: state.selectedIndex - 1,
|
|
410
487
|
listActive: true
|
|
411
488
|
})
|
|
412
489
|
)
|
|
413
490
|
} else {
|
|
414
491
|
view.dispatch(
|
|
415
|
-
view.state.tr.setMeta(
|
|
492
|
+
view.state.tr.setMeta(pluginKey, {
|
|
416
493
|
action: "select",
|
|
417
494
|
index: -1,
|
|
418
495
|
listActive: false
|
|
@@ -425,7 +502,9 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
425
502
|
case "Enter":
|
|
426
503
|
event.preventDefault()
|
|
427
504
|
{
|
|
428
|
-
const
|
|
505
|
+
const state = pluginKey.getState(view.state) as
|
|
506
|
+
| InlineReferenceState
|
|
507
|
+
| undefined
|
|
429
508
|
const rawText = input.textContent || ""
|
|
430
509
|
const citDisabledEnter = elementDisabled(editor, "citation")
|
|
431
510
|
const xrefDisabledEnter = elementDisabled(
|
|
@@ -434,7 +513,9 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
434
513
|
)
|
|
435
514
|
const isXrefMode =
|
|
436
515
|
!xrefDisabledEnter && rawText.startsWith("@#")
|
|
437
|
-
let citMatches
|
|
516
|
+
let citMatches: BibliographyEntry[],
|
|
517
|
+
xrefMatchesEnter: CrossRefTarget[],
|
|
518
|
+
activeIndexEnter: number
|
|
438
519
|
if (isXrefMode) {
|
|
439
520
|
citMatches = []
|
|
440
521
|
xrefMatchesEnter = filterCrossRefs(
|
|
@@ -448,7 +529,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
448
529
|
const query = getActiveQuery(rawText, activeIndexEnter)
|
|
449
530
|
citMatches = citDisabledEnter
|
|
450
531
|
? []
|
|
451
|
-
: filterBibliography(
|
|
532
|
+
: filterBibliography(state?.bibList || [], query)
|
|
452
533
|
xrefMatchesEnter = xrefDisabledEnter
|
|
453
534
|
? []
|
|
454
535
|
: filterCrossRefs(crossRefList, query)
|
|
@@ -457,12 +538,12 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
457
538
|
citMatches.length + xrefMatchesEnter.length
|
|
458
539
|
const selectedIndex = Math.max(
|
|
459
540
|
0,
|
|
460
|
-
Math.min(
|
|
541
|
+
Math.min(state?.selectedIndex ?? -1, totalEnter - 1)
|
|
461
542
|
)
|
|
462
543
|
if (
|
|
463
|
-
|
|
544
|
+
state?.listActive &&
|
|
464
545
|
totalEnter > 0 &&
|
|
465
|
-
|
|
546
|
+
state.selectedIndex >= 0
|
|
466
547
|
) {
|
|
467
548
|
if (selectedIndex < citMatches.length) {
|
|
468
549
|
// Insert selected citation key into input
|
|
@@ -480,7 +561,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
480
561
|
) + entry.entry_key.length
|
|
481
562
|
setInputCursorPos(input, newCursor)
|
|
482
563
|
view.dispatch(
|
|
483
|
-
view.state.tr.setMeta(
|
|
564
|
+
view.state.tr.setMeta(pluginKey, {
|
|
484
565
|
action: "updateQuery",
|
|
485
566
|
query: input.textContent
|
|
486
567
|
})
|
|
@@ -495,7 +576,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
495
576
|
input.textContent = `@#${target.id}`
|
|
496
577
|
setInputCursorPos(input, input.textContent.length)
|
|
497
578
|
view.dispatch(
|
|
498
|
-
view.state.tr.setMeta(
|
|
579
|
+
view.state.tr.setMeta(pluginKey, {
|
|
499
580
|
action: "updateQuery",
|
|
500
581
|
query: input.textContent
|
|
501
582
|
})
|
|
@@ -505,7 +586,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
505
586
|
} else {
|
|
506
587
|
// Not in list mode or no matches: commit what we have
|
|
507
588
|
view.dispatch(
|
|
508
|
-
view.state.tr.setMeta(
|
|
589
|
+
view.state.tr.setMeta(pluginKey, {action: "commit"})
|
|
509
590
|
)
|
|
510
591
|
view.focus()
|
|
511
592
|
}
|
|
@@ -513,7 +594,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
513
594
|
break
|
|
514
595
|
case "Escape":
|
|
515
596
|
event.preventDefault()
|
|
516
|
-
view.dispatch(view.state.tr.setMeta(
|
|
597
|
+
view.dispatch(view.state.tr.setMeta(pluginKey, {action: "cancel"}))
|
|
517
598
|
view.focus()
|
|
518
599
|
break
|
|
519
600
|
case "Home":
|
|
@@ -529,7 +610,7 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
529
610
|
if ((input.textContent || "").length <= 1) {
|
|
530
611
|
event.preventDefault()
|
|
531
612
|
view.dispatch(
|
|
532
|
-
view.state.tr.setMeta(
|
|
613
|
+
view.state.tr.setMeta(pluginKey, {action: "cancelDelete"})
|
|
533
614
|
)
|
|
534
615
|
view.focus()
|
|
535
616
|
}
|
|
@@ -539,14 +620,14 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
539
620
|
if ((input.textContent || "").length <= 1) {
|
|
540
621
|
event.preventDefault()
|
|
541
622
|
view.dispatch(
|
|
542
|
-
view.state.tr.setMeta(
|
|
623
|
+
view.state.tr.setMeta(pluginKey, {action: "cancelDelete"})
|
|
543
624
|
)
|
|
544
625
|
view.focus()
|
|
545
626
|
}
|
|
546
627
|
break
|
|
547
628
|
case "Tab":
|
|
548
629
|
event.preventDefault()
|
|
549
|
-
view.dispatch(view.state.tr.setMeta(
|
|
630
|
+
view.dispatch(view.state.tr.setMeta(pluginKey, {action: "commit"}))
|
|
550
631
|
break
|
|
551
632
|
default:
|
|
552
633
|
break
|
|
@@ -555,14 +636,16 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
555
636
|
|
|
556
637
|
input.addEventListener("focusout", event => {
|
|
557
638
|
const related = event.relatedTarget
|
|
558
|
-
if (container.contains(related)) {
|
|
639
|
+
if (container.contains(related as globalThis.Node | null)) {
|
|
559
640
|
return
|
|
560
641
|
}
|
|
561
642
|
const myWidgetId = pluginState.widgetId
|
|
562
643
|
setTimeout(() => {
|
|
563
|
-
const currentState =
|
|
644
|
+
const currentState = pluginKey.getState(view.state) as
|
|
645
|
+
| InlineReferenceState
|
|
646
|
+
| undefined
|
|
564
647
|
if (currentState?.active && currentState.widgetId === myWidgetId) {
|
|
565
|
-
view.dispatch(view.state.tr.setMeta(
|
|
648
|
+
view.dispatch(view.state.tr.setMeta(pluginKey, {action: "commit"}))
|
|
566
649
|
}
|
|
567
650
|
}, 1)
|
|
568
651
|
})
|
|
@@ -589,14 +672,20 @@ function createInlineReferenceWidget(editor, pluginState, key) {
|
|
|
589
672
|
return container
|
|
590
673
|
}
|
|
591
674
|
|
|
592
|
-
export const inlineReferencePlugin = options => {
|
|
675
|
+
export const inlineReferencePlugin = (options: {editor: Editor}): Plugin => {
|
|
593
676
|
const editor = options.editor
|
|
594
|
-
const bibDB = editor.mod.db
|
|
677
|
+
const bibDB = (editor.mod.db?.bibDB || {}) as {
|
|
678
|
+
addReference(entry: Record<string, unknown>, id: number): number
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
const appConfig = editor.app as {
|
|
682
|
+
config?: {user?: {preferences?: {inline_references?: boolean}}}
|
|
683
|
+
}
|
|
595
684
|
|
|
596
685
|
const enabled =
|
|
597
|
-
|
|
598
|
-
!READ_ONLY_ROLES.includes(editor.docInfo.access_rights) &&
|
|
599
|
-
!COMMENT_ONLY_ROLES.includes(editor.docInfo.access_rights)
|
|
686
|
+
appConfig.config?.user?.preferences?.inline_references === true &&
|
|
687
|
+
!READ_ONLY_ROLES.includes(editor.docInfo.access_rights as string) &&
|
|
688
|
+
!COMMENT_ONLY_ROLES.includes(editor.docInfo.access_rights as string)
|
|
600
689
|
|
|
601
690
|
if (!enabled) {
|
|
602
691
|
return new Plugin({
|
|
@@ -615,7 +704,7 @@ export const inlineReferencePlugin = options => {
|
|
|
615
704
|
return new Plugin({
|
|
616
705
|
key,
|
|
617
706
|
state: {
|
|
618
|
-
init() {
|
|
707
|
+
init(): InlineReferenceState {
|
|
619
708
|
return {
|
|
620
709
|
active: false,
|
|
621
710
|
from: 0,
|
|
@@ -630,22 +719,24 @@ export const inlineReferencePlugin = options => {
|
|
|
630
719
|
decos: DecorationSet.empty
|
|
631
720
|
}
|
|
632
721
|
},
|
|
633
|
-
apply(tr, prev, _oldState, _state) {
|
|
634
|
-
let next = {...prev}
|
|
722
|
+
apply(tr, prev, _oldState, _state): InlineReferenceState {
|
|
723
|
+
let next = {...prev} as InlineReferenceState
|
|
635
724
|
const meta = tr.getMeta(key)
|
|
636
725
|
|
|
637
726
|
if (meta?.action === "activate") {
|
|
638
727
|
next = {
|
|
639
728
|
active: true,
|
|
640
|
-
from: meta.from,
|
|
641
|
-
query: meta.query || "",
|
|
729
|
+
from: meta.from as number,
|
|
730
|
+
query: (meta.query as string) || "",
|
|
642
731
|
selectedIndex: -1,
|
|
643
732
|
listActive: false,
|
|
644
|
-
isEdit: meta.isEdit || false,
|
|
645
|
-
referenceNodePos: meta.referenceNodePos || 0,
|
|
646
|
-
bibList: meta.bibList || [],
|
|
733
|
+
isEdit: (meta.isEdit as boolean) || false,
|
|
734
|
+
referenceNodePos: (meta.referenceNodePos as number) || 0,
|
|
735
|
+
bibList: (meta.bibList as BibliographyEntry[]) || [],
|
|
647
736
|
widgetId: Math.random().toString(36).slice(2),
|
|
648
|
-
cursorAtStart: meta.cursorAtStart
|
|
737
|
+
cursorAtStart: meta.cursorAtStart as
|
|
738
|
+
| boolean
|
|
739
|
+
| undefined,
|
|
649
740
|
decos: DecorationSet.empty
|
|
650
741
|
}
|
|
651
742
|
} else if (meta?.action === "deactivate") {
|
|
@@ -663,12 +754,12 @@ export const inlineReferencePlugin = options => {
|
|
|
663
754
|
decos: DecorationSet.empty
|
|
664
755
|
}
|
|
665
756
|
} else if (meta?.action === "select") {
|
|
666
|
-
next.selectedIndex = meta.index
|
|
757
|
+
next.selectedIndex = meta.index as number
|
|
667
758
|
if (meta.listActive !== undefined) {
|
|
668
|
-
next.listActive = meta.listActive
|
|
759
|
+
next.listActive = meta.listActive as boolean
|
|
669
760
|
}
|
|
670
761
|
} else if (meta?.action === "updateQuery") {
|
|
671
|
-
next.query = meta.query
|
|
762
|
+
next.query = meta.query as string
|
|
672
763
|
next.selectedIndex = -1
|
|
673
764
|
next.listActive = false
|
|
674
765
|
}
|
|
@@ -716,14 +807,16 @@ export const inlineReferencePlugin = options => {
|
|
|
716
807
|
}
|
|
717
808
|
},
|
|
718
809
|
appendTransaction: (trs, oldState, newState) => {
|
|
719
|
-
const oldPluginState = key.getState(oldState)
|
|
810
|
+
const oldPluginState = key.getState(oldState) as
|
|
811
|
+
| InlineReferenceState
|
|
812
|
+
| undefined
|
|
720
813
|
const meta = trs.find(tr => tr.getMeta(key))?.getMeta(key)
|
|
721
814
|
|
|
722
815
|
if (
|
|
723
816
|
meta?.action === "commit" ||
|
|
724
817
|
meta?.action === "commitAndRight"
|
|
725
818
|
) {
|
|
726
|
-
if (!oldPluginState
|
|
819
|
+
if (!oldPluginState?.active) {
|
|
727
820
|
return null
|
|
728
821
|
}
|
|
729
822
|
const query = oldPluginState.query
|
|
@@ -824,6 +917,9 @@ export const inlineReferencePlugin = options => {
|
|
|
824
917
|
}
|
|
825
918
|
|
|
826
919
|
if (meta?.action === "cancel") {
|
|
920
|
+
if (!oldPluginState) {
|
|
921
|
+
return null
|
|
922
|
+
}
|
|
827
923
|
if (oldPluginState.isEdit) {
|
|
828
924
|
// Editing: just deactivate, leave reference unchanged
|
|
829
925
|
const node = newState.doc.nodeAt(
|
|
@@ -849,6 +945,9 @@ export const inlineReferencePlugin = options => {
|
|
|
849
945
|
}
|
|
850
946
|
|
|
851
947
|
if (meta?.action === "cancelDelete") {
|
|
948
|
+
if (!oldPluginState) {
|
|
949
|
+
return null
|
|
950
|
+
}
|
|
852
951
|
if (oldPluginState.isEdit) {
|
|
853
952
|
// Delete the reference node entirely.
|
|
854
953
|
const existingNode = newState.doc.nodeAt(
|
|
@@ -873,6 +972,9 @@ export const inlineReferencePlugin = options => {
|
|
|
873
972
|
}
|
|
874
973
|
|
|
875
974
|
if (meta?.action === "cancelLeft") {
|
|
975
|
+
if (!oldPluginState) {
|
|
976
|
+
return null
|
|
977
|
+
}
|
|
876
978
|
if (oldPluginState.isEdit) {
|
|
877
979
|
const tr = newState.tr.setSelection(
|
|
878
980
|
TextSelection.create(
|
|
@@ -894,7 +996,7 @@ export const inlineReferencePlugin = options => {
|
|
|
894
996
|
}
|
|
895
997
|
|
|
896
998
|
if (meta?.action === "openDialog") {
|
|
897
|
-
if (oldPluginState
|
|
999
|
+
if (oldPluginState?.active && oldPluginState.isEdit) {
|
|
898
1000
|
// Deactivate the inline editor and leave a NodeSelection on
|
|
899
1001
|
// the citation so CitationDialog opens with its content.
|
|
900
1002
|
const node = newState.doc.nodeAt(
|
|
@@ -915,13 +1017,13 @@ export const inlineReferencePlugin = options => {
|
|
|
915
1017
|
}
|
|
916
1018
|
|
|
917
1019
|
if (meta?.action === "insertCrossRef") {
|
|
918
|
-
if (!oldPluginState
|
|
1020
|
+
if (!oldPluginState?.active) {
|
|
919
1021
|
return null
|
|
920
1022
|
}
|
|
921
1023
|
const crossRefNode =
|
|
922
1024
|
newState.schema.nodes.cross_reference.create({
|
|
923
|
-
id: meta.id,
|
|
924
|
-
title: meta.title
|
|
1025
|
+
id: meta.id as string,
|
|
1026
|
+
title: meta.title as string | null
|
|
925
1027
|
})
|
|
926
1028
|
if (oldPluginState.isEdit) {
|
|
927
1029
|
// Replace the existing citation node with a cross_reference.
|
|
@@ -957,7 +1059,7 @@ export const inlineReferencePlugin = options => {
|
|
|
957
1059
|
}
|
|
958
1060
|
}
|
|
959
1061
|
|
|
960
|
-
if (oldPluginState
|
|
1062
|
+
if (oldPluginState?.active) {
|
|
961
1063
|
// If selection moved away from the widget, commit
|
|
962
1064
|
if (
|
|
963
1065
|
trs.some(tr => tr.selectionSet) &&
|
|
@@ -1127,11 +1229,20 @@ export const inlineReferencePlugin = options => {
|
|
|
1127
1229
|
return null
|
|
1128
1230
|
},
|
|
1129
1231
|
props: {
|
|
1130
|
-
decorations(state) {
|
|
1131
|
-
const pluginState = key.getState(state)
|
|
1232
|
+
decorations(state: EditorState) {
|
|
1233
|
+
const pluginState = key.getState(state) as
|
|
1234
|
+
| InlineReferenceState
|
|
1235
|
+
| undefined
|
|
1132
1236
|
return pluginState?.decos || DecorationSet.empty
|
|
1133
1237
|
},
|
|
1134
|
-
handleClickOn(
|
|
1238
|
+
handleClickOn(
|
|
1239
|
+
_view: EditorView,
|
|
1240
|
+
_pos: number,
|
|
1241
|
+
node: ProseMirrorNode,
|
|
1242
|
+
nodePos: number,
|
|
1243
|
+
_event: MouseEvent,
|
|
1244
|
+
_direct: boolean
|
|
1245
|
+
) {
|
|
1135
1246
|
if (node.type.name === "citation") {
|
|
1136
1247
|
const bibList = buildBibliographyList(editor)
|
|
1137
1248
|
const text = citationToText(node, bibList)
|
|
@@ -1173,21 +1284,22 @@ export const inlineReferencePlugin = options => {
|
|
|
1173
1284
|
return false
|
|
1174
1285
|
},
|
|
1175
1286
|
handleDOMEvents: {
|
|
1176
|
-
mousedown(view, event) {
|
|
1287
|
+
mousedown(view: EditorView, event: MouseEvent) {
|
|
1177
1288
|
if (event.ctrlKey || event.metaKey || event.shiftKey) {
|
|
1178
1289
|
return false
|
|
1179
1290
|
}
|
|
1180
1291
|
if (event.button !== 0) {
|
|
1181
1292
|
return false
|
|
1182
1293
|
}
|
|
1183
|
-
const
|
|
1294
|
+
const target = event.target as HTMLElement | null
|
|
1295
|
+
const citTarget = target?.closest(".citation")
|
|
1184
1296
|
const xrefTarget =
|
|
1185
|
-
!citTarget &&
|
|
1186
|
-
const
|
|
1187
|
-
if (!
|
|
1297
|
+
!citTarget && target?.closest(".cross-reference")
|
|
1298
|
+
const closest = citTarget || xrefTarget
|
|
1299
|
+
if (!closest) {
|
|
1188
1300
|
return false
|
|
1189
1301
|
}
|
|
1190
|
-
let pos = view.posAtDOM(
|
|
1302
|
+
let pos = view.posAtDOM(closest, 0)
|
|
1191
1303
|
let node = view.state.doc.nodeAt(pos)
|
|
1192
1304
|
if (
|
|
1193
1305
|
!node ||
|
|
@@ -1196,7 +1308,9 @@ export const inlineReferencePlugin = options => {
|
|
|
1196
1308
|
) {
|
|
1197
1309
|
return false
|
|
1198
1310
|
}
|
|
1199
|
-
const pluginState = key.getState(view.state)
|
|
1311
|
+
const pluginState = key.getState(view.state) as
|
|
1312
|
+
| InlineReferenceState
|
|
1313
|
+
| undefined
|
|
1200
1314
|
if (pluginState?.active) {
|
|
1201
1315
|
// Commit current widget first
|
|
1202
1316
|
const commitTr = view.state.tr.setMeta(key, {
|
|
@@ -1213,7 +1327,7 @@ export const inlineReferencePlugin = options => {
|
|
|
1213
1327
|
return false
|
|
1214
1328
|
}
|
|
1215
1329
|
}
|
|
1216
|
-
let query, bibList
|
|
1330
|
+
let query: string, bibList: BibliographyEntry[]
|
|
1217
1331
|
if (node.type.name === "citation") {
|
|
1218
1332
|
bibList = buildBibliographyList(editor)
|
|
1219
1333
|
query = citationToText(node, bibList)
|
|
@@ -1240,15 +1354,18 @@ export const inlineReferencePlugin = options => {
|
|
|
1240
1354
|
event.preventDefault()
|
|
1241
1355
|
return true
|
|
1242
1356
|
},
|
|
1243
|
-
click(view, event) {
|
|
1357
|
+
click(view: EditorView, event: MouseEvent) {
|
|
1244
1358
|
// Fallback click handler for touch devices and cases where
|
|
1245
1359
|
// mousedown/handleClickOn did not fire.
|
|
1246
|
-
const pluginState = key.getState(view.state)
|
|
1360
|
+
const pluginState = key.getState(view.state) as
|
|
1361
|
+
| InlineReferenceState
|
|
1362
|
+
| undefined
|
|
1247
1363
|
if (pluginState?.active) {
|
|
1248
|
-
const target = event.target
|
|
1364
|
+
const target = event.target as HTMLElement | null
|
|
1365
|
+
const closest = target?.closest(
|
|
1249
1366
|
".inline-reference-widget"
|
|
1250
1367
|
)
|
|
1251
|
-
if (
|
|
1368
|
+
if (closest) {
|
|
1252
1369
|
// Click inside widget: let widget handle it
|
|
1253
1370
|
return false
|
|
1254
1371
|
}
|
|
@@ -1266,11 +1383,12 @@ export const inlineReferencePlugin = options => {
|
|
|
1266
1383
|
if (event.ctrlKey || event.metaKey || event.shiftKey) {
|
|
1267
1384
|
return false
|
|
1268
1385
|
}
|
|
1269
|
-
const target = event.target
|
|
1270
|
-
|
|
1386
|
+
const target = event.target as HTMLElement | null
|
|
1387
|
+
const closest = target?.closest(".citation")
|
|
1388
|
+
if (!closest) {
|
|
1271
1389
|
return false
|
|
1272
1390
|
}
|
|
1273
|
-
const pos = view.posAtDOM(
|
|
1391
|
+
const pos = view.posAtDOM(closest, 0)
|
|
1274
1392
|
const node = view.state.doc.nodeAt(pos)
|
|
1275
1393
|
if (!node || node.type.name !== "citation") {
|
|
1276
1394
|
return false
|
|
@@ -1295,8 +1413,10 @@ export const inlineReferencePlugin = options => {
|
|
|
1295
1413
|
return true
|
|
1296
1414
|
}
|
|
1297
1415
|
},
|
|
1298
|
-
handleKeyDown(view, event) {
|
|
1299
|
-
const pluginState = key.getState(view.state)
|
|
1416
|
+
handleKeyDown(view: EditorView, event: KeyboardEvent) {
|
|
1417
|
+
const pluginState = key.getState(view.state) as
|
|
1418
|
+
| InlineReferenceState
|
|
1419
|
+
| undefined
|
|
1300
1420
|
if (!pluginState?.active) {
|
|
1301
1421
|
if (event.key === "@") {
|
|
1302
1422
|
const $pos = view.state.selection.$head
|