@fiduswriter/editor 0.1.0
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/LICENSE +661 -0
- package/README.md +22 -0
- package/dist/bibliography/tools.js +53 -0
- package/dist/bibliography/tools.js.map +1 -0
- package/dist/citations/index.js +339 -0
- package/dist/citations/index.js.map +1 -0
- package/dist/citations/render.js +47 -0
- package/dist/citations/render.js.map +1 -0
- package/dist/clipboard/copy/index.js +2 -0
- package/dist/clipboard/copy/index.js.map +1 -0
- package/dist/clipboard/copy/schema.js +54 -0
- package/dist/clipboard/copy/schema.js.map +1 -0
- package/dist/clipboard/copy/serializers.js +132 -0
- package/dist/clipboard/copy/serializers.js.map +1 -0
- package/dist/clipboard/paste/fidus_writer.js +45 -0
- package/dist/clipboard/paste/fidus_writer.js.map +1 -0
- package/dist/clipboard/paste/general.js +76 -0
- package/dist/clipboard/paste/general.js.map +1 -0
- package/dist/clipboard/paste/google_docs.js +24 -0
- package/dist/clipboard/paste/google_docs.js.map +1 -0
- package/dist/clipboard/paste/html.js +68 -0
- package/dist/clipboard/paste/html.js.map +1 -0
- package/dist/clipboard/paste/index.js +3 -0
- package/dist/clipboard/paste/index.js.map +1 -0
- package/dist/clipboard/paste/libreoffice_writer.js +27 -0
- package/dist/clipboard/paste/libreoffice_writer.js.map +1 -0
- package/dist/clipboard/paste/microsoft_word.js +79 -0
- package/dist/clipboard/paste/microsoft_word.js.map +1 -0
- package/dist/clipboard/paste/text.js +41 -0
- package/dist/clipboard/paste/text.js.map +1 -0
- package/dist/collab/chat.js +154 -0
- package/dist/collab/chat.js.map +1 -0
- package/dist/collab/colors.js +62 -0
- package/dist/collab/colors.js.map +1 -0
- package/dist/collab/doc.js +1090 -0
- package/dist/collab/doc.js.map +1 -0
- package/dist/collab/index.js +75 -0
- package/dist/collab/index.js.map +1 -0
- package/dist/collab/merge/changeset.js +90 -0
- package/dist/collab/merge/changeset.js.map +1 -0
- package/dist/collab/merge/editor.js +708 -0
- package/dist/collab/merge/editor.js.map +1 -0
- package/dist/collab/merge/footnotes.js +149 -0
- package/dist/collab/merge/footnotes.js.map +1 -0
- package/dist/collab/merge/index.js +270 -0
- package/dist/collab/merge/index.js.map +1 -0
- package/dist/collab/merge/recreate_transform.js +259 -0
- package/dist/collab/merge/recreate_transform.js.map +1 -0
- package/dist/collab/merge/schema.js +117 -0
- package/dist/collab/merge/schema.js.map +1 -0
- package/dist/collab/merge/state_plugins/action.js +138 -0
- package/dist/collab/merge/state_plugins/action.js.map +1 -0
- package/dist/collab/merge/state_plugins/clipboard.js +32 -0
- package/dist/collab/merge/state_plugins/clipboard.js.map +1 -0
- package/dist/collab/merge/state_plugins/diff.js +541 -0
- package/dist/collab/merge/state_plugins/diff.js.map +1 -0
- package/dist/collab/merge/state_plugins/index.js +3 -0
- package/dist/collab/merge/state_plugins/index.js.map +1 -0
- package/dist/collab/merge/tools.js +175 -0
- package/dist/collab/merge/tools.js.map +1 -0
- package/dist/collab/templates.js +10 -0
- package/dist/collab/templates.js.map +1 -0
- package/dist/comments/comment.js +17 -0
- package/dist/comments/comment.js.map +1 -0
- package/dist/comments/editors/answer.js +43 -0
- package/dist/comments/editors/answer.js.map +1 -0
- package/dist/comments/editors/comment.js +278 -0
- package/dist/comments/editors/comment.js.map +1 -0
- package/dist/comments/editors/index.js +4 -0
- package/dist/comments/editors/index.js.map +1 -0
- package/dist/comments/editors/notify.js +13 -0
- package/dist/comments/editors/notify.js.map +1 -0
- package/dist/comments/editors/schema.js +60 -0
- package/dist/comments/editors/schema.js.map +1 -0
- package/dist/comments/index.js +11 -0
- package/dist/comments/index.js.map +1 -0
- package/dist/comments/interactions.js +379 -0
- package/dist/comments/interactions.js.map +1 -0
- package/dist/comments/store.js +438 -0
- package/dist/comments/store.js.map +1 -0
- package/dist/contacts/add_dialog.js +88 -0
- package/dist/contacts/add_dialog.js.map +1 -0
- package/dist/contacts/templates.js +23 -0
- package/dist/contacts/templates.js.map +1 -0
- package/dist/copyright_dialog/index.js +148 -0
- package/dist/copyright_dialog/index.js.map +1 -0
- package/dist/copyright_dialog/templates.js +48 -0
- package/dist/copyright_dialog/templates.js.map +1 -0
- package/dist/databases/bibliography.js +162 -0
- package/dist/databases/bibliography.js.map +1 -0
- package/dist/databases/images.js +260 -0
- package/dist/databases/images.js.map +1 -0
- package/dist/databases/index.js +55 -0
- package/dist/databases/index.js.map +1 -0
- package/dist/dialogs/citation.js +321 -0
- package/dist/dialogs/citation.js.map +1 -0
- package/dist/dialogs/code_block.js +192 -0
- package/dist/dialogs/code_block.js.map +1 -0
- package/dist/dialogs/contributor.js +132 -0
- package/dist/dialogs/contributor.js.map +1 -0
- package/dist/dialogs/figure.js +378 -0
- package/dist/dialogs/figure.js.map +1 -0
- package/dist/dialogs/index.js +11 -0
- package/dist/dialogs/index.js.map +1 -0
- package/dist/dialogs/language.js +47 -0
- package/dist/dialogs/language.js.map +1 -0
- package/dist/dialogs/link.js +243 -0
- package/dist/dialogs/link.js.map +1 -0
- package/dist/dialogs/math.js +121 -0
- package/dist/dialogs/math.js.map +1 -0
- package/dist/dialogs/ordered_list.js +67 -0
- package/dist/dialogs/ordered_list.js.map +1 -0
- package/dist/dialogs/revision.js +36 -0
- package/dist/dialogs/revision.js.map +1 -0
- package/dist/dialogs/subsup.js +109 -0
- package/dist/dialogs/subsup.js.map +1 -0
- package/dist/dialogs/table.js +217 -0
- package/dist/dialogs/table.js.map +1 -0
- package/dist/dialogs/templates.js +366 -0
- package/dist/dialogs/templates.js.map +1 -0
- package/dist/document_template/exporter.js +83 -0
- package/dist/document_template/exporter.js.map +1 -0
- package/dist/document_template/index.js +327 -0
- package/dist/document_template/index.js.map +1 -0
- package/dist/documents/access_rights/index.js +532 -0
- package/dist/documents/access_rights/index.js.map +1 -0
- package/dist/documents/access_rights/templates.js +150 -0
- package/dist/documents/access_rights/templates.js.map +1 -0
- package/dist/e2ee/encryptor.js +201 -0
- package/dist/e2ee/encryptor.js.map +1 -0
- package/dist/e2ee/key-manager.js +171 -0
- package/dist/e2ee/key-manager.js.map +1 -0
- package/dist/e2ee/passphrase-crypto.js +365 -0
- package/dist/e2ee/passphrase-crypto.js.map +1 -0
- package/dist/e2ee/passphrase-dialog.js +548 -0
- package/dist/e2ee/passphrase-dialog.js.map +1 -0
- package/dist/e2ee/passphrase-manager.js +350 -0
- package/dist/e2ee/passphrase-manager.js.map +1 -0
- package/dist/e2ee/password-dialog.js +552 -0
- package/dist/e2ee/password-dialog.js.map +1 -0
- package/dist/e2ee/snapshot-manager.js +238 -0
- package/dist/e2ee/snapshot-manager.js.map +1 -0
- package/dist/exporter/native/copy.js +29 -0
- package/dist/exporter/native/copy.js.map +1 -0
- package/dist/exporter/native/file.js +19 -0
- package/dist/exporter/native/file.js.map +1 -0
- package/dist/exporter/native/index.js +4 -0
- package/dist/exporter/native/index.js.map +1 -0
- package/dist/exporter/native/revision.js +54 -0
- package/dist/exporter/native/revision.js.map +1 -0
- package/dist/exporter/native/zip.js +2 -0
- package/dist/exporter/native/zip.js.map +1 -0
- package/dist/footnotes/editor.js +180 -0
- package/dist/footnotes/editor.js.map +1 -0
- package/dist/footnotes/index.js +15 -0
- package/dist/footnotes/index.js.map +1 -0
- package/dist/footnotes/layout.js +125 -0
- package/dist/footnotes/layout.js.map +1 -0
- package/dist/footnotes/state_plugins/access_rights.js +25 -0
- package/dist/footnotes/state_plugins/access_rights.js.map +1 -0
- package/dist/footnotes/state_plugins/index.js +2 -0
- package/dist/footnotes/state_plugins/index.js.map +1 -0
- package/dist/images/edit_dialog/edit_dialog/index.js +186 -0
- package/dist/images/edit_dialog/edit_dialog/index.js.map +1 -0
- package/dist/images/edit_dialog/edit_dialog/model.js +152 -0
- package/dist/images/edit_dialog/edit_dialog/model.js.map +1 -0
- package/dist/images/edit_dialog/edit_dialog/templates.js +33 -0
- package/dist/images/edit_dialog/edit_dialog/templates.js.map +1 -0
- package/dist/images/edit_dialog/model.js +6 -0
- package/dist/images/edit_dialog/model.js.map +1 -0
- package/dist/images/selection_dialog/index.js +149 -0
- package/dist/images/selection_dialog/index.js.map +1 -0
- package/dist/index.js +1002 -0
- package/dist/index.js.map +1 -0
- package/dist/keymap.js +73 -0
- package/dist/keymap.js.map +1 -0
- package/dist/marginboxes/index.js +674 -0
- package/dist/marginboxes/index.js.map +1 -0
- package/dist/marginboxes/templates.js +447 -0
- package/dist/marginboxes/templates.js.map +1 -0
- package/dist/menus/code_block/index.js +2 -0
- package/dist/menus/code_block/index.js.map +1 -0
- package/dist/menus/code_block/model.js +49 -0
- package/dist/menus/code_block/model.js.map +1 -0
- package/dist/menus/figure/index.js +3 -0
- package/dist/menus/figure/index.js.map +1 -0
- package/dist/menus/figure/model.js +80 -0
- package/dist/menus/figure/model.js.map +1 -0
- package/dist/menus/figure/utils.js +6 -0
- package/dist/menus/figure/utils.js.map +1 -0
- package/dist/menus/headerbar/index.js +3 -0
- package/dist/menus/headerbar/index.js.map +1 -0
- package/dist/menus/headerbar/model.js +743 -0
- package/dist/menus/headerbar/model.js.map +1 -0
- package/dist/menus/headerbar/view.js +579 -0
- package/dist/menus/headerbar/view.js.map +1 -0
- package/dist/menus/image/index.js +2 -0
- package/dist/menus/image/index.js.map +1 -0
- package/dist/menus/image/model.js +32 -0
- package/dist/menus/image/model.js.map +1 -0
- package/dist/menus/index.js +10 -0
- package/dist/menus/index.js.map +1 -0
- package/dist/menus/navigator/index.js +2 -0
- package/dist/menus/navigator/index.js.map +1 -0
- package/dist/menus/navigator/model.js +29 -0
- package/dist/menus/navigator/model.js.map +1 -0
- package/dist/menus/ordered_list/index.js +2 -0
- package/dist/menus/ordered_list/index.js.map +1 -0
- package/dist/menus/ordered_list/model.js +17 -0
- package/dist/menus/ordered_list/model.js.map +1 -0
- package/dist/menus/selection/index.js +3 -0
- package/dist/menus/selection/index.js.map +1 -0
- package/dist/menus/selection/model.js +108 -0
- package/dist/menus/selection/model.js.map +1 -0
- package/dist/menus/selection/view.js +125 -0
- package/dist/menus/selection/view.js.map +1 -0
- package/dist/menus/table/index.js +2 -0
- package/dist/menus/table/index.js.map +1 -0
- package/dist/menus/table/model.js +319 -0
- package/dist/menus/table/model.js.map +1 -0
- package/dist/menus/toolbar/index.js +3 -0
- package/dist/menus/toolbar/index.js.map +1 -0
- package/dist/menus/toolbar/model.js +747 -0
- package/dist/menus/toolbar/model.js.map +1 -0
- package/dist/menus/toolbar/view.js +314 -0
- package/dist/menus/toolbar/view.js.map +1 -0
- package/dist/navigator/index.js +435 -0
- package/dist/navigator/index.js.map +1 -0
- package/dist/no_collab_save/index.js +169 -0
- package/dist/no_collab_save/index.js.map +1 -0
- package/dist/plugins/citation_dialog/index.js +2 -0
- package/dist/plugins/citation_dialog/index.js.map +1 -0
- package/dist/plugins/editor/index.js +2 -0
- package/dist/plugins/editor/index.js.map +1 -0
- package/dist/state_plugins/access_rights.js +30 -0
- package/dist/state_plugins/access_rights.js.map +1 -0
- package/dist/state_plugins/citation_render.js +78 -0
- package/dist/state_plugins/citation_render.js.map +1 -0
- package/dist/state_plugins/clipboard.js +217 -0
- package/dist/state_plugins/clipboard.js.map +1 -0
- package/dist/state_plugins/code_block.js +165 -0
- package/dist/state_plugins/code_block.js.map +1 -0
- package/dist/state_plugins/collab_carets.js +115 -0
- package/dist/state_plugins/collab_carets.js.map +1 -0
- package/dist/state_plugins/comments.js +197 -0
- package/dist/state_plugins/comments.js.map +1 -0
- package/dist/state_plugins/contributor_input/add_button.js +101 -0
- package/dist/state_plugins/contributor_input/add_button.js.map +1 -0
- package/dist/state_plugins/contributor_input/dropup.js +273 -0
- package/dist/state_plugins/contributor_input/dropup.js.map +1 -0
- package/dist/state_plugins/contributor_input/helpers.js +23 -0
- package/dist/state_plugins/contributor_input/helpers.js.map +1 -0
- package/dist/state_plugins/contributor_input/index.js +3 -0
- package/dist/state_plugins/contributor_input/index.js.map +1 -0
- package/dist/state_plugins/contributor_input/node_view.js +76 -0
- package/dist/state_plugins/contributor_input/node_view.js.map +1 -0
- package/dist/state_plugins/contributor_input/plugin.js +236 -0
- package/dist/state_plugins/contributor_input/plugin.js.map +1 -0
- package/dist/state_plugins/document_template.js +213 -0
- package/dist/state_plugins/document_template.js.map +1 -0
- package/dist/state_plugins/figure.js +90 -0
- package/dist/state_plugins/figure.js.map +1 -0
- package/dist/state_plugins/footnote_markers.js +187 -0
- package/dist/state_plugins/footnote_markers.js.map +1 -0
- package/dist/state_plugins/headerbar.js +10 -0
- package/dist/state_plugins/headerbar.js.map +1 -0
- package/dist/state_plugins/index.js +27 -0
- package/dist/state_plugins/index.js.map +1 -0
- package/dist/state_plugins/inline_math.js +719 -0
- package/dist/state_plugins/inline_math.js.map +1 -0
- package/dist/state_plugins/inline_reference/dropup.js +182 -0
- package/dist/state_plugins/inline_reference/dropup.js.map +1 -0
- package/dist/state_plugins/inline_reference/index.js +2 -0
- package/dist/state_plugins/inline_reference/index.js.map +1 -0
- package/dist/state_plugins/inline_reference/plugin.js +1134 -0
- package/dist/state_plugins/inline_reference/plugin.js.map +1 -0
- package/dist/state_plugins/jump_hidden_nodes.js +47 -0
- package/dist/state_plugins/jump_hidden_nodes.js.map +1 -0
- package/dist/state_plugins/links.js +622 -0
- package/dist/state_plugins/links.js.map +1 -0
- package/dist/state_plugins/marginboxes.js +13 -0
- package/dist/state_plugins/marginboxes.js.map +1 -0
- package/dist/state_plugins/ordered_list_menu.js +72 -0
- package/dist/state_plugins/ordered_list_menu.js.map +1 -0
- package/dist/state_plugins/placeholders.js +98 -0
- package/dist/state_plugins/placeholders.js.map +1 -0
- package/dist/state_plugins/search.js +212 -0
- package/dist/state_plugins/search.js.map +1 -0
- package/dist/state_plugins/selection_menu.js +10 -0
- package/dist/state_plugins/selection_menu.js.map +1 -0
- package/dist/state_plugins/settings.js +191 -0
- package/dist/state_plugins/settings.js.map +1 -0
- package/dist/state_plugins/table.js +104 -0
- package/dist/state_plugins/table.js.map +1 -0
- package/dist/state_plugins/tag_input/helpers.js +55 -0
- package/dist/state_plugins/tag_input/helpers.js.map +1 -0
- package/dist/state_plugins/tag_input/index.js +3 -0
- package/dist/state_plugins/tag_input/index.js.map +1 -0
- package/dist/state_plugins/tag_input/node_view.js +77 -0
- package/dist/state_plugins/tag_input/node_view.js.map +1 -0
- package/dist/state_plugins/tag_input/plugin.js +199 -0
- package/dist/state_plugins/tag_input/plugin.js.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor.js +159 -0
- package/dist/state_plugins/tag_input/tag_editor.js.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.js +61 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.js.map +1 -0
- package/dist/state_plugins/toc_render.js +142 -0
- package/dist/state_plugins/toc_render.js.map +1 -0
- package/dist/state_plugins/toolbar.js +10 -0
- package/dist/state_plugins/toolbar.js.map +1 -0
- package/dist/state_plugins/track/find_selected_changes.js +82 -0
- package/dist/state_plugins/track/find_selected_changes.js.map +1 -0
- package/dist/state_plugins/track/helpers.js +67 -0
- package/dist/state_plugins/track/helpers.js.map +1 -0
- package/dist/state_plugins/track/index.js +3 -0
- package/dist/state_plugins/track/index.js.map +1 -0
- package/dist/state_plugins/track/plugin.js +114 -0
- package/dist/state_plugins/track/plugin.js.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/key_bindings/index.js +20 -0
- package/dist/tools/key_bindings/index.js.map +1 -0
- package/dist/tools/key_bindings/templates.js +68 -0
- package/dist/tools/key_bindings/templates.js.map +1 -0
- package/dist/tools/search_replace/index.js +275 -0
- package/dist/tools/search_replace/index.js.map +1 -0
- package/dist/tools/search_replace/templates.js +18 -0
- package/dist/tools/search_replace/templates.js.map +1 -0
- package/dist/tools/word_count/index.js +40 -0
- package/dist/tools/word_count/index.js.map +1 -0
- package/dist/tools/word_count/templates.js +27 -0
- package/dist/tools/word_count/templates.js.map +1 -0
- package/dist/track/accept.js +66 -0
- package/dist/track/accept.js.map +1 -0
- package/dist/track/accept_all.js +51 -0
- package/dist/track/accept_all.js.map +1 -0
- package/dist/track/accept_all_no_insertions.js +63 -0
- package/dist/track/accept_all_no_insertions.js.map +1 -0
- package/dist/track/amend_transaction.js +390 -0
- package/dist/track/amend_transaction.js.map +1 -0
- package/dist/track/delete.js +62 -0
- package/dist/track/delete.js.map +1 -0
- package/dist/track/index.js +6 -0
- package/dist/track/index.js.map +1 -0
- package/dist/track/mod.js +86 -0
- package/dist/track/mod.js.map +1 -0
- package/dist/track/reject.js +67 -0
- package/dist/track/reject.js.map +1 -0
- package/dist/track/reject_all.js +56 -0
- package/dist/track/reject_all.js.map +1 -0
- package/package.json +80 -0
- package/src/bibliography/tools.js +58 -0
- package/src/citations/index.js +443 -0
- package/src/citations/render.js +68 -0
- package/src/clipboard/copy/index.js +1 -0
- package/src/clipboard/copy/schema.js +62 -0
- package/src/clipboard/copy/serializers.js +179 -0
- package/src/clipboard/paste/fidus_writer.js +55 -0
- package/src/clipboard/paste/general.js +80 -0
- package/src/clipboard/paste/google_docs.js +26 -0
- package/src/clipboard/paste/html.js +76 -0
- package/src/clipboard/paste/index.js +2 -0
- package/src/clipboard/paste/libreoffice_writer.js +32 -0
- package/src/clipboard/paste/microsoft_word.js +87 -0
- package/src/clipboard/paste/text.js +58 -0
- package/src/collab/chat.js +195 -0
- package/src/collab/colors.js +67 -0
- package/src/collab/doc.js +1436 -0
- package/src/collab/index.js +81 -0
- package/src/collab/merge/changeset.js +103 -0
- package/src/collab/merge/editor.js +1065 -0
- package/src/collab/merge/footnotes.js +175 -0
- package/src/collab/merge/index.js +401 -0
- package/src/collab/merge/recreate_transform.js +326 -0
- package/src/collab/merge/schema.js +135 -0
- package/src/collab/merge/state_plugins/action.js +171 -0
- package/src/collab/merge/state_plugins/clipboard.js +32 -0
- package/src/collab/merge/state_plugins/diff.js +780 -0
- package/src/collab/merge/state_plugins/index.js +2 -0
- package/src/collab/merge/tools.js +217 -0
- package/src/collab/templates.js +10 -0
- package/src/comments/comment.js +29 -0
- package/src/comments/editors/answer.js +55 -0
- package/src/comments/editors/comment.js +318 -0
- package/src/comments/editors/index.js +4 -0
- package/src/comments/editors/notify.js +13 -0
- package/src/comments/editors/schema.js +65 -0
- package/src/comments/index.js +11 -0
- package/src/comments/interactions.js +465 -0
- package/src/comments/store.js +513 -0
- package/src/contacts/add_dialog.js +110 -0
- package/src/contacts/templates.js +28 -0
- package/src/copyright_dialog/index.js +179 -0
- package/src/copyright_dialog/templates.js +56 -0
- package/src/databases/bibliography.js +179 -0
- package/src/databases/images.js +320 -0
- package/src/databases/index.js +69 -0
- package/src/dialogs/citation.js +428 -0
- package/src/dialogs/code_block.js +242 -0
- package/src/dialogs/contributor.js +173 -0
- package/src/dialogs/figure.js +479 -0
- package/src/dialogs/index.js +10 -0
- package/src/dialogs/language.js +58 -0
- package/src/dialogs/link.js +358 -0
- package/src/dialogs/math.js +148 -0
- package/src/dialogs/ordered_list.js +84 -0
- package/src/dialogs/revision.js +43 -0
- package/src/dialogs/subsup.js +116 -0
- package/src/dialogs/table.js +258 -0
- package/src/dialogs/templates.js +426 -0
- package/src/document_template/exporter.js +97 -0
- package/src/document_template/index.js +483 -0
- package/src/documents/access_rights/index.js +693 -0
- package/src/documents/access_rights/templates.js +178 -0
- package/src/e2ee/encryptor.js +228 -0
- package/src/e2ee/key-manager.js +202 -0
- package/src/e2ee/passphrase-crypto.js +606 -0
- package/src/e2ee/passphrase-dialog.js +655 -0
- package/src/e2ee/passphrase-manager.js +502 -0
- package/src/e2ee/password-dialog.js +652 -0
- package/src/e2ee/snapshot-manager.js +305 -0
- package/src/exporter/native/copy.js +54 -0
- package/src/exporter/native/file.js +37 -0
- package/src/exporter/native/index.js +3 -0
- package/src/exporter/native/revision.js +86 -0
- package/src/exporter/native/zip.js +1 -0
- package/src/footnotes/editor.js +227 -0
- package/src/footnotes/index.js +16 -0
- package/src/footnotes/layout.js +190 -0
- package/src/footnotes/state_plugins/access_rights.js +39 -0
- package/src/footnotes/state_plugins/index.js +1 -0
- package/src/images/edit_dialog/edit_dialog/index.js +222 -0
- package/src/images/edit_dialog/edit_dialog/model.js +183 -0
- package/src/images/edit_dialog/edit_dialog/templates.js +41 -0
- package/src/images/edit_dialog/model.js +5 -0
- package/src/images/selection_dialog/index.js +176 -0
- package/src/index.js +1252 -0
- package/src/keymap.js +102 -0
- package/src/marginboxes/index.js +946 -0
- package/src/marginboxes/templates.js +573 -0
- package/src/menus/code_block/index.js +1 -0
- package/src/menus/code_block/model.js +52 -0
- package/src/menus/figure/index.js +2 -0
- package/src/menus/figure/model.js +91 -0
- package/src/menus/figure/utils.js +5 -0
- package/src/menus/headerbar/index.js +2 -0
- package/src/menus/headerbar/model.js +1077 -0
- package/src/menus/headerbar/view.js +675 -0
- package/src/menus/image/index.js +1 -0
- package/src/menus/image/model.js +32 -0
- package/src/menus/index.js +9 -0
- package/src/menus/navigator/index.js +1 -0
- package/src/menus/navigator/model.js +28 -0
- package/src/menus/ordered_list/index.js +1 -0
- package/src/menus/ordered_list/model.js +19 -0
- package/src/menus/selection/index.js +2 -0
- package/src/menus/selection/model.js +134 -0
- package/src/menus/selection/view.js +154 -0
- package/src/menus/table/index.js +1 -0
- package/src/menus/table/model.js +414 -0
- package/src/menus/toolbar/index.js +2 -0
- package/src/menus/toolbar/model.js +920 -0
- package/src/menus/toolbar/view.js +354 -0
- package/src/navigator/index.js +515 -0
- package/src/no_collab_save/index.js +209 -0
- package/src/plugins/citation_dialog/index.js +1 -0
- package/src/plugins/editor/index.js +1 -0
- package/src/state_plugins/access_rights.js +47 -0
- package/src/state_plugins/citation_render.js +88 -0
- package/src/state_plugins/clipboard.js +289 -0
- package/src/state_plugins/code_block.js +201 -0
- package/src/state_plugins/collab_carets.js +152 -0
- package/src/state_plugins/comments.js +259 -0
- package/src/state_plugins/contributor_input/add_button.js +134 -0
- package/src/state_plugins/contributor_input/dropup.js +318 -0
- package/src/state_plugins/contributor_input/helpers.js +24 -0
- package/src/state_plugins/contributor_input/index.js +2 -0
- package/src/state_plugins/contributor_input/node_view.js +86 -0
- package/src/state_plugins/contributor_input/plugin.js +318 -0
- package/src/state_plugins/document_template.js +315 -0
- package/src/state_plugins/figure.js +108 -0
- package/src/state_plugins/footnote_markers.js +238 -0
- package/src/state_plugins/headerbar.js +12 -0
- package/src/state_plugins/index.js +73 -0
- package/src/state_plugins/inline_math.js +918 -0
- package/src/state_plugins/inline_reference/dropup.js +208 -0
- package/src/state_plugins/inline_reference/index.js +5 -0
- package/src/state_plugins/inline_reference/plugin.js +1429 -0
- package/src/state_plugins/jump_hidden_nodes.js +58 -0
- package/src/state_plugins/links.js +830 -0
- package/src/state_plugins/marginboxes.js +14 -0
- package/src/state_plugins/ordered_list_menu.js +84 -0
- package/src/state_plugins/placeholders.js +123 -0
- package/src/state_plugins/search.js +251 -0
- package/src/state_plugins/selection_menu.js +12 -0
- package/src/state_plugins/settings.js +223 -0
- package/src/state_plugins/table.js +127 -0
- package/src/state_plugins/tag_input/helpers.js +69 -0
- package/src/state_plugins/tag_input/index.js +2 -0
- package/src/state_plugins/tag_input/node_view.js +85 -0
- package/src/state_plugins/tag_input/plugin.js +278 -0
- package/src/state_plugins/tag_input/tag_editor.js +202 -0
- package/src/state_plugins/tag_input/tag_editor_plugins.js +74 -0
- package/src/state_plugins/toc_render.js +160 -0
- package/src/state_plugins/toolbar.js +12 -0
- package/src/state_plugins/track/find_selected_changes.js +107 -0
- package/src/state_plugins/track/helpers.js +108 -0
- package/src/state_plugins/track/index.js +6 -0
- package/src/state_plugins/track/plugin.js +140 -0
- package/src/tools/index.js +3 -0
- package/src/tools/key_bindings/index.js +21 -0
- package/src/tools/key_bindings/templates.js +68 -0
- package/src/tools/search_replace/index.js +421 -0
- package/src/tools/search_replace/templates.js +19 -0
- package/src/tools/word_count/index.js +59 -0
- package/src/tools/word_count/templates.js +34 -0
- package/src/track/accept.js +102 -0
- package/src/track/accept_all.js +103 -0
- package/src/track/accept_all_no_insertions.js +102 -0
- package/src/track/amend_transaction.js +562 -0
- package/src/track/delete.js +92 -0
- package/src/track/index.js +8 -0
- package/src/track/mod.js +116 -0
- package/src/track/reject.js +116 -0
- package/src/track/reject_all.js +121 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
import {avatarTemplate, escapeText, localizeDate} from "fwtoolkit"
|
|
2
|
+
import {READ_ONLY_ROLES} from "../"
|
|
3
|
+
import {serializeHelp} from "../../document_template"
|
|
4
|
+
import {serializeComment} from "../comments/editors"
|
|
5
|
+
|
|
6
|
+
/** A template for an answer to a comment */
|
|
7
|
+
const answerCommentTemplate = ({
|
|
8
|
+
answer,
|
|
9
|
+
author,
|
|
10
|
+
commentId,
|
|
11
|
+
activeCommentAnswerId,
|
|
12
|
+
active,
|
|
13
|
+
user
|
|
14
|
+
}) =>
|
|
15
|
+
`<div class="comment-item comment-answer collapse ${active ? "show" : ""}" id="comment-answer-${answer.id}">
|
|
16
|
+
<div class="comment-user">
|
|
17
|
+
${author ? avatarTemplate({user: author}) : '<span class="fw-string-avatar"></span>'}
|
|
18
|
+
<h5 class="comment-user-name">${escapeText(author ? author.name : answer.username)}</h5>
|
|
19
|
+
<p class="comment-date">${localizeDate(answer.date)}</p>
|
|
20
|
+
</div>
|
|
21
|
+
${
|
|
22
|
+
active && answer.id === activeCommentAnswerId
|
|
23
|
+
? `<div class="comment-text-wrapper">
|
|
24
|
+
<div class="comment-answer-form">
|
|
25
|
+
<div id="answer-editor"></div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>`
|
|
28
|
+
: `<div class="comment-text-wrapper">
|
|
29
|
+
<div class="comment-p">${serializeComment(answer.answer).html}</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="comment-collapsible-buttons">
|
|
32
|
+
${
|
|
33
|
+
serializeComment(answer.answer).text.length > 68
|
|
34
|
+
? `<a type="button" class="comment-expand-compress show-more-less">${gettext("show more")}</a>`
|
|
35
|
+
: ""
|
|
36
|
+
}
|
|
37
|
+
</div>
|
|
38
|
+
${
|
|
39
|
+
answer.user === user.id
|
|
40
|
+
? `<span class="show-marginbox-options fa-solid fa-ellipsis-v" data-id="${answer.id}" data-commentId="${commentId}" data-answer=${true}></span>`
|
|
41
|
+
: ""
|
|
42
|
+
}`
|
|
43
|
+
}
|
|
44
|
+
</div>`
|
|
45
|
+
|
|
46
|
+
/** A template to show one individual comment */
|
|
47
|
+
const singleCommentTemplate = ({comment, author, active, editComment}) =>
|
|
48
|
+
`<div class="comment-item">
|
|
49
|
+
<div class="comment-user">
|
|
50
|
+
${author ? avatarTemplate({user: author}) : '<span class="fw-string-avatar"></span>'}
|
|
51
|
+
<h5 class="comment-user-name">${escapeText(author ? author.name : comment.username)}</h5>
|
|
52
|
+
<p class="comment-date">${localizeDate(comment.date)}</p>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="comment-text-wrapper">
|
|
55
|
+
${
|
|
56
|
+
active && editComment
|
|
57
|
+
? '<div id="comment-editor"></div>'
|
|
58
|
+
: `<p class="comment-p">${serializeComment(comment.comment).html}</p>`
|
|
59
|
+
}
|
|
60
|
+
</div>
|
|
61
|
+
<div class="comment-collapsible-buttons">
|
|
62
|
+
${
|
|
63
|
+
!editComment &&
|
|
64
|
+
serializeComment(comment.comment).text.length > 68
|
|
65
|
+
? `<a type="button" class="comment-expand-compress show-more-less">${gettext("show more")}</a>`
|
|
66
|
+
: ""
|
|
67
|
+
}
|
|
68
|
+
${
|
|
69
|
+
!active && comment.answers.length > 0
|
|
70
|
+
? `<a type="button" class="comment-expand-compress replies">+${comment.answers.length} ${gettext("replies")}</a>`
|
|
71
|
+
: ""
|
|
72
|
+
}
|
|
73
|
+
</div>
|
|
74
|
+
</div>`
|
|
75
|
+
|
|
76
|
+
/** A template for the editor of a first comment before it has been saved (not an answer to a comment). */
|
|
77
|
+
const firstCommentTemplate = ({comment, author}) =>
|
|
78
|
+
`<div class="comment-item">
|
|
79
|
+
<div class="comment-user">
|
|
80
|
+
${author ? avatarTemplate({user: author}) : '<span class="fw-string-avatar"></span>'}
|
|
81
|
+
<h5 class="comment-user-name">${escapeText(author ? author.name : comment.username)}</h5>
|
|
82
|
+
<p class="comment-date">${localizeDate(comment.date)}</p>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="comment-text-wrapper">
|
|
85
|
+
<div id="comment-editor"></div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>`
|
|
88
|
+
|
|
89
|
+
const helpTemplate = ({help, filterOptions}) => {
|
|
90
|
+
if (!filterOptions.help || !filterOptions.info) {
|
|
91
|
+
return '<div class="margin-box help hidden"></div>'
|
|
92
|
+
} else {
|
|
93
|
+
return `<div class="margin-box help ${help.active ? "fw-active" : ""}"><div class="help-text-wrapper">${serializeHelp(help.help)}</div></div>`
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const warningTemplate = ({warning, filterOptions}) => {
|
|
98
|
+
if (!filterOptions.warning || !filterOptions.info) {
|
|
99
|
+
return '<div class="margin-box fw-warning hidden"></div>'
|
|
100
|
+
} else {
|
|
101
|
+
return `<div class="margin-box fw-warning ${warning.active ? "fw-active" : ""}"><div class="help-text-wrapper">${warning.warning}</div></div>`
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const commentTemplate = ({
|
|
106
|
+
comment,
|
|
107
|
+
view,
|
|
108
|
+
active,
|
|
109
|
+
editComment,
|
|
110
|
+
activeCommentAnswerId,
|
|
111
|
+
user,
|
|
112
|
+
docInfo,
|
|
113
|
+
filterOptions
|
|
114
|
+
}) => {
|
|
115
|
+
if (
|
|
116
|
+
!filterOptions.comments ||
|
|
117
|
+
(filterOptions.commentsOnlyMajor && !comment.isMajor) ||
|
|
118
|
+
(!filterOptions.commentsResolved && comment.resolved) ||
|
|
119
|
+
(filterOptions.commentsAuthor &&
|
|
120
|
+
comment.user !== filterOptions.commentsAuthor) ||
|
|
121
|
+
(filterOptions.assigned &&
|
|
122
|
+
comment.assignedUser !== filterOptions.assigned) ||
|
|
123
|
+
comment.hidden
|
|
124
|
+
) {
|
|
125
|
+
return '<div class="margin-box comment hidden"></div>'
|
|
126
|
+
}
|
|
127
|
+
const author =
|
|
128
|
+
comment.user === docInfo.owner.id
|
|
129
|
+
? docInfo.owner
|
|
130
|
+
: docInfo.owner.contacts.find(
|
|
131
|
+
contact =>
|
|
132
|
+
contact.id === comment.user && contact.type === "user"
|
|
133
|
+
),
|
|
134
|
+
assignedUser = comment.assignedUser
|
|
135
|
+
? comment.assignedUser === docInfo.owner.id
|
|
136
|
+
? docInfo.owner
|
|
137
|
+
: docInfo.owner.contacts.find(
|
|
138
|
+
contact =>
|
|
139
|
+
contact.id === comment.assignedUser &&
|
|
140
|
+
contact.type === "user"
|
|
141
|
+
) || {
|
|
142
|
+
name: comment.assignedUsername || ""
|
|
143
|
+
}
|
|
144
|
+
: false,
|
|
145
|
+
assignedUsername = assignedUser ? assignedUser.name : false
|
|
146
|
+
return `
|
|
147
|
+
<div id="margin-box-${comment.id}" data-view="${view}" data-id="${comment.id}" data-user-id="${comment.user}"
|
|
148
|
+
class="margin-box comment ${active ? "fw-active" : "inactive"} ${comment.resolved ? "resolved" : ""} ${comment.isMajor === true ? "comment-is-major-bgc" : ""} ${comment.isGlobal ? "global-comment" : ""}">
|
|
149
|
+
${
|
|
150
|
+
comment.isGlobal
|
|
151
|
+
? `<div class="global-comment-label">${gettext("Document comment")}</div>`
|
|
152
|
+
: ""
|
|
153
|
+
}
|
|
154
|
+
<div class="comment-answer-container">
|
|
155
|
+
${
|
|
156
|
+
comment.comment.length === 0
|
|
157
|
+
? firstCommentTemplate({comment, author})
|
|
158
|
+
: singleCommentTemplate({comment, user, author, active, editComment})
|
|
159
|
+
}
|
|
160
|
+
${
|
|
161
|
+
assignedUsername
|
|
162
|
+
? `<div class="assigned-user">${gettext("Assigned to")} <em>${escapeText(assignedUsername)}</em></div>`
|
|
163
|
+
: ""
|
|
164
|
+
}
|
|
165
|
+
${
|
|
166
|
+
comment.answers
|
|
167
|
+
? comment.answers
|
|
168
|
+
.map(answer =>
|
|
169
|
+
answerCommentTemplate({
|
|
170
|
+
answer,
|
|
171
|
+
author:
|
|
172
|
+
answer.user === docInfo.owner.id
|
|
173
|
+
? docInfo.owner
|
|
174
|
+
: docInfo.owner.contacts.find(
|
|
175
|
+
contact =>
|
|
176
|
+
contact.id === answer.user &&
|
|
177
|
+
contact.type === "user"
|
|
178
|
+
),
|
|
179
|
+
commentId: comment.id,
|
|
180
|
+
active,
|
|
181
|
+
activeCommentAnswerId,
|
|
182
|
+
user,
|
|
183
|
+
docInfo
|
|
184
|
+
})
|
|
185
|
+
)
|
|
186
|
+
.join("")
|
|
187
|
+
: ""
|
|
188
|
+
}
|
|
189
|
+
${
|
|
190
|
+
comment.id > 0 &&
|
|
191
|
+
((comment.user === user.id &&
|
|
192
|
+
!READ_ONLY_ROLES.includes(docInfo.access_rights)) ||
|
|
193
|
+
docInfo.access_rights === "write") &&
|
|
194
|
+
!editComment
|
|
195
|
+
? `<span class="show-marginbox-options comment-option fa-solid fa-ellipsis-v" data-id="${comment.id}" data-commentUser="${comment.user}"
|
|
196
|
+
></span>`
|
|
197
|
+
: ""
|
|
198
|
+
}
|
|
199
|
+
</div>
|
|
200
|
+
${
|
|
201
|
+
active &&
|
|
202
|
+
!activeCommentAnswerId &&
|
|
203
|
+
!editComment &&
|
|
204
|
+
0 < comment.comment.length &&
|
|
205
|
+
!READ_ONLY_ROLES.includes(docInfo.access_rights)
|
|
206
|
+
? `<div class="comment-item comment-answer comment-answer-editor">
|
|
207
|
+
<div id="answer-editor"></div>
|
|
208
|
+
</div>`
|
|
209
|
+
: ""
|
|
210
|
+
}
|
|
211
|
+
</div>
|
|
212
|
+
`
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const ACTIONS = {
|
|
216
|
+
insertion: gettext("Insertion"),
|
|
217
|
+
deletion: gettext("Deletion"),
|
|
218
|
+
format_change: gettext("Format change"),
|
|
219
|
+
block_change: gettext("Block change"),
|
|
220
|
+
insertion_paragraph: gettext("New paragraph"),
|
|
221
|
+
insertion_heading: gettext("New heading"),
|
|
222
|
+
insertion_citation: gettext("Inserted citation"),
|
|
223
|
+
insertion_blockquote: gettext("Wrapped into blockquote"),
|
|
224
|
+
insertion_code_block: gettext("Added code block"),
|
|
225
|
+
insertion_figure: gettext("Inserted figure"),
|
|
226
|
+
insertion_list_item: gettext("New list item"),
|
|
227
|
+
insertion_table: gettext("Inserted table"),
|
|
228
|
+
insertion_keyword: gettext("New keyword: %(keyword)s"),
|
|
229
|
+
deletion_paragraph: gettext("Merged paragraph"),
|
|
230
|
+
deletion_heading: gettext("Merged heading"),
|
|
231
|
+
deletion_citation: gettext("Deleted citation"),
|
|
232
|
+
deletion_blockquote: gettext("Unwrapped blockquote"),
|
|
233
|
+
deletion_code_block: gettext("Removed code block"),
|
|
234
|
+
deletion_figure: gettext("Deleted figure"),
|
|
235
|
+
deletion_list_item: gettext("Lifted list item"),
|
|
236
|
+
deletion_table: gettext("Delete table"),
|
|
237
|
+
deletion_keyword: gettext("Deleted keyword: %(keyword)s"),
|
|
238
|
+
block_change_paragraph: gettext("Changed into paragraph"),
|
|
239
|
+
block_change_heading: gettext("Changed into heading %(level)s"),
|
|
240
|
+
block_change_code_block: gettext("Changed into code block")
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const FORMAT_MARK_NAMES = {
|
|
244
|
+
em: gettext("Emphasis"),
|
|
245
|
+
strong: gettext("Strong"),
|
|
246
|
+
underline: gettext("Underline")
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const formatChangeTemplate = ({before, after}) => {
|
|
250
|
+
let returnText = ""
|
|
251
|
+
if (before.length) {
|
|
252
|
+
returnText += `<div class="format-change-info"><b>${gettext("Removed")}:</b> ${before.map(markName => FORMAT_MARK_NAMES[markName]).join(", ")}</div>`
|
|
253
|
+
}
|
|
254
|
+
if (after.length) {
|
|
255
|
+
returnText += `<div class="format-change-info"><b>${gettext("Added")}:</b> ${after.map(markName => FORMAT_MARK_NAMES[markName]).join(", ")}</div>`
|
|
256
|
+
}
|
|
257
|
+
return returnText
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const BLOCK_NAMES = {
|
|
261
|
+
paragraph: gettext("Paragraph"),
|
|
262
|
+
heading1: gettext("Heading 1"),
|
|
263
|
+
heading2: gettext("Heading 2"),
|
|
264
|
+
heading3: gettext("Heading 3"),
|
|
265
|
+
heading4: gettext("Heading 4"),
|
|
266
|
+
heading5: gettext("Heading 5"),
|
|
267
|
+
heading6: gettext("Heading 6"),
|
|
268
|
+
code_block: gettext("Code block"),
|
|
269
|
+
ordered_list: gettext("Ordered list"),
|
|
270
|
+
bullet_list: gettext("Bullet list")
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const blockChangeTemplate = ({before}, node) =>
|
|
274
|
+
`<div class="format-change-info"><b>${gettext("Was")}:</b> ${BLOCK_NAMES[before.type]}${before.type === "ordered_list" && node.type.name === "ordered_list" ? `, ${gettext("start")}: ${before.attrs.order}` : ""}</div>`
|
|
275
|
+
|
|
276
|
+
const trackTemplate = ({type, data, node, active, docInfo, filterOptions}) => {
|
|
277
|
+
if (
|
|
278
|
+
!filterOptions.track ||
|
|
279
|
+
(filterOptions.trackAuthor && data.user !== filterOptions.trackAuthor)
|
|
280
|
+
) {
|
|
281
|
+
return '<div class="margin-box track hidden"></div>'
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const author =
|
|
285
|
+
data.user === docInfo.owner.id
|
|
286
|
+
? docInfo.owner
|
|
287
|
+
: docInfo.owner.contacts.find(
|
|
288
|
+
contact =>
|
|
289
|
+
contact.id === data.user && contact.type === "user"
|
|
290
|
+
),
|
|
291
|
+
nodeActionType = `${type}_${node.type.name}`
|
|
292
|
+
|
|
293
|
+
return `
|
|
294
|
+
<div class="margin-box track ${active ? "fw-active" : "inactive"}" data-type="${type}">
|
|
295
|
+
<div class="track-${type}">
|
|
296
|
+
<div class="comment-user">
|
|
297
|
+
${author ? avatarTemplate({user: author}) : '<span class="fw-string-avatar"></span>'}
|
|
298
|
+
<h5 class="comment-user-name">${escapeText(author ? author.name : data.username)}</h5>
|
|
299
|
+
<p class="comment-date">${node.type.name === "text" ? `${gettext("ca.")} ` : ""}${localizeDate(data.date * 60000, "minutes")}</p>
|
|
300
|
+
</div>
|
|
301
|
+
<div class="track-title">
|
|
302
|
+
${interpolate(ACTIONS[nodeActionType] ? ACTIONS[nodeActionType] : ACTIONS[type], node.attrs, true)}
|
|
303
|
+
</div>
|
|
304
|
+
${type === "format_change" ? formatChangeTemplate(data) : type === "block_change" ? blockChangeTemplate(data, node) : ""}
|
|
305
|
+
</div>
|
|
306
|
+
${
|
|
307
|
+
docInfo.access_rights === "write"
|
|
308
|
+
? `<div class="track-ctas">
|
|
309
|
+
<button class="track-accept fw-button fw-dark" type="submit" data-type="${type}">${gettext("Accept")}</button>
|
|
310
|
+
<button class="track-reject fw-button fw-orange" type="submit" data-type="${type}">${gettext("Reject")}</button>
|
|
311
|
+
</div>`
|
|
312
|
+
: ""
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
</div>`
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export const marginboxFilterTemplate = ({
|
|
319
|
+
marginBoxes,
|
|
320
|
+
filterOptions,
|
|
321
|
+
pastParticipants
|
|
322
|
+
}) => {
|
|
323
|
+
const comments = marginBoxes.find(box => box.type === "comment")
|
|
324
|
+
const tracks = marginBoxes.find(box =>
|
|
325
|
+
["insertion", "deletion", "format_change", "block_change"].includes(
|
|
326
|
+
box.type
|
|
327
|
+
)
|
|
328
|
+
)
|
|
329
|
+
const help = marginBoxes.find(box => box.type === "help")
|
|
330
|
+
const warning = marginBoxes.find(box => box.type === "warning")
|
|
331
|
+
let filterHTML = ""
|
|
332
|
+
if (comments || filterOptions.commentsOnlyMajor) {
|
|
333
|
+
filterHTML += `<div id="margin-box-filter-comments" class="margin-box-filter-button${filterOptions.comments ? "" : " fw-disabled"}">
|
|
334
|
+
<span class="label">${gettext("Comments")}</span>
|
|
335
|
+
<span class="show-marginbox-options fa-solid fa-ellipsis-v"></span>
|
|
336
|
+
<div class="fw-marginbox-options fw-pulldown fw-right"><ul>
|
|
337
|
+
<li>
|
|
338
|
+
<span class="fw-pulldown-item show-marginbox-options-submenu" title="${gettext("Author")}">
|
|
339
|
+
${gettext("Author")}
|
|
340
|
+
<span class="fw-icon-right"><i class="fa-solid fa-caret-right"></i></span>
|
|
341
|
+
</span>
|
|
342
|
+
<div class="fw-pulldown marginbox-options-submenu">
|
|
343
|
+
<ul>
|
|
344
|
+
<li><span class="fw-pulldown-item margin-box-filter-comments-author${filterOptions.commentsAuthor === 0 ? " fw-selected" : ""}" data-id="0" title="${gettext("Show comments from all authors.")}">
|
|
345
|
+
${gettext("Any")}
|
|
346
|
+
</span></li>
|
|
347
|
+
${pastParticipants
|
|
348
|
+
.map(
|
|
349
|
+
user => `<li><span class="fw-pulldown-item margin-box-filter-comments-author${filterOptions.commentsAuthor === user.id ? " fw-selected" : ""}" data-id="${user.id}" title="${gettext("Show comments of ")} ${escapeText(user.name)}">
|
|
350
|
+
${escapeText(user.name)}
|
|
351
|
+
</span></li>`
|
|
352
|
+
)
|
|
353
|
+
.join("")}
|
|
354
|
+
</ul>
|
|
355
|
+
</div>
|
|
356
|
+
</li>
|
|
357
|
+
<li>
|
|
358
|
+
<span class="fw-pulldown-item show-marginbox-options-submenu" title="${gettext("Assignee")}">
|
|
359
|
+
${gettext("Assignee")}
|
|
360
|
+
<span class="fw-icon-right"><i class="fa-solid fa-caret-right"></i></span>
|
|
361
|
+
</span>
|
|
362
|
+
<div class="fw-pulldown marginbox-options-submenu">
|
|
363
|
+
<ul>
|
|
364
|
+
<li><span class="fw-pulldown-item margin-box-filter-comments-assigned${filterOptions.assigned === 0 ? " fw-selected" : ""}" data-id="0" title="${gettext("Show comments from all authors.")}">
|
|
365
|
+
${gettext("Any/None")}
|
|
366
|
+
</span></li>
|
|
367
|
+
${pastParticipants
|
|
368
|
+
.map(
|
|
369
|
+
user => `<li><span class="fw-pulldown-item margin-box-filter-comments-assigned${filterOptions.assigned === user.id ? " fw-selected" : ""}" data-id="${user.id}" title="${gettext("Show comments of ")} ${escapeText(user.name)}">
|
|
370
|
+
${escapeText(user.name)}
|
|
371
|
+
</span></li>`
|
|
372
|
+
)
|
|
373
|
+
.join("")}
|
|
374
|
+
</ul>
|
|
375
|
+
</div>
|
|
376
|
+
</li>
|
|
377
|
+
<li>
|
|
378
|
+
<span class="fw-pulldown-item margin-box-filter-check">
|
|
379
|
+
<input type="checkbox" class="fw-check fw-label-check"${filterOptions.commentsOnlyMajor ? " checked" : ""} id="margin-box-filter-comments-only-major">
|
|
380
|
+
<label for="margin-box-filter-comments-only-major">${gettext("Only major comments")}</label>
|
|
381
|
+
</span>
|
|
382
|
+
</li>
|
|
383
|
+
<li>
|
|
384
|
+
<span class="fw-pulldown-item margin-box-filter-check">
|
|
385
|
+
<input type="checkbox" class="fw-check fw-label-check"${filterOptions.commentsResolved ? " checked" : ""} id="margin-box-filter-comments-resolved">
|
|
386
|
+
<label for="margin-box-filter-comments-resolved">${gettext("Resolved comments")}</label>
|
|
387
|
+
</span>
|
|
388
|
+
</li>
|
|
389
|
+
</ul></div>
|
|
390
|
+
</div>`
|
|
391
|
+
}
|
|
392
|
+
if (tracks) {
|
|
393
|
+
filterHTML += `<div id="margin-box-filter-track" class="margin-box-filter-button${filterOptions.track ? "" : " fw-disabled"}">
|
|
394
|
+
<span class="label">${gettext("Tracking")}</span><span class="show-marginbox-options fa-solid fa-ellipsis-v"></span>
|
|
395
|
+
<div class="fw-marginbox-options fw-pulldown fw-right"><ul>
|
|
396
|
+
<li>
|
|
397
|
+
<span class="fw-pulldown-item show-marginbox-options-submenu" title="${gettext("Author")}">
|
|
398
|
+
${gettext("Author")}
|
|
399
|
+
<span class="fw-icon-right"><i class="fa-solid fa-caret-right"></i></span>
|
|
400
|
+
</span>
|
|
401
|
+
<div class="fw-pulldown marginbox-options-submenu">
|
|
402
|
+
<ul>
|
|
403
|
+
<li><span class="fw-pulldown-item margin-box-filter-track-author${filterOptions.trackAuthor === 0 ? " fw-selected" : ""}" data-id="0" title="${gettext("Show track changes from all authors.")}">
|
|
404
|
+
${gettext("Any")}
|
|
405
|
+
</span></li>
|
|
406
|
+
${pastParticipants
|
|
407
|
+
.map(
|
|
408
|
+
user => `<li><span class="fw-pulldown-item margin-box-filter-track-author${filterOptions.trackAuthor === user.id ? " fw-selected" : ""}" data-id="${user.id}" title="${gettext("Show track changes of ")} ${escapeText(user.name)}">
|
|
409
|
+
${escapeText(user.name)}
|
|
410
|
+
</span></li>`
|
|
411
|
+
)
|
|
412
|
+
.join("")}
|
|
413
|
+
</ul>
|
|
414
|
+
</div>
|
|
415
|
+
</li>
|
|
416
|
+
</ul></div>
|
|
417
|
+
</div>`
|
|
418
|
+
}
|
|
419
|
+
if (help || warning) {
|
|
420
|
+
filterHTML += `<div id="margin-box-filter-info" class="margin-box-filter-button${filterOptions.info ? "" : " fw-disabled"}">
|
|
421
|
+
<span class="label">${gettext("Informational")}</span>
|
|
422
|
+
<span class="show-marginbox-options fa-solid fa-ellipsis-v"></span>
|
|
423
|
+
<div class="fw-marginbox-options fw-pulldown fw-right"><ul>
|
|
424
|
+
<li>
|
|
425
|
+
<span class="fw-pulldown-item margin-box-filter-check">
|
|
426
|
+
<input type="checkbox" class="fw-check fw-label-check"${filterOptions.help ? " checked" : ""} id="margin-box-filter-info-help">
|
|
427
|
+
<label for="margin-box-filter-info-help">${gettext("Instructions")}</label>
|
|
428
|
+
</span>
|
|
429
|
+
</li>
|
|
430
|
+
<li>
|
|
431
|
+
<span class="fw-pulldown-item margin-box-filter-check">
|
|
432
|
+
<input type="checkbox" class="fw-check fw-label-check"${filterOptions.warning ? " checked" : ""} id="margin-box-filter-info-warning">
|
|
433
|
+
<label for="margin-box-filter-info-warning">${gettext("Warnings")}</label>
|
|
434
|
+
</span>
|
|
435
|
+
</li>
|
|
436
|
+
</ul></div>
|
|
437
|
+
</div>`
|
|
438
|
+
}
|
|
439
|
+
return filterHTML
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/** A template to display global document comments in the main column */
|
|
443
|
+
export const globalCommentsTemplate = ({
|
|
444
|
+
globalComments,
|
|
445
|
+
editComment,
|
|
446
|
+
activeCommentAnswerId,
|
|
447
|
+
user,
|
|
448
|
+
docInfo,
|
|
449
|
+
filterOptions
|
|
450
|
+
}) =>
|
|
451
|
+
`<div id="global-comment-container"><div>${globalComments
|
|
452
|
+
.map(mBox =>
|
|
453
|
+
commentTemplate({
|
|
454
|
+
comment: mBox.data,
|
|
455
|
+
view: mBox.view,
|
|
456
|
+
active: mBox.active,
|
|
457
|
+
activeCommentAnswerId,
|
|
458
|
+
editComment,
|
|
459
|
+
user,
|
|
460
|
+
docInfo,
|
|
461
|
+
filterOptions
|
|
462
|
+
})
|
|
463
|
+
)
|
|
464
|
+
.join("")}</div></div>`
|
|
465
|
+
|
|
466
|
+
/** A template to display all the margin boxes (comments, deletion/insertion notifications) */
|
|
467
|
+
export const marginBoxesTemplate = ({
|
|
468
|
+
marginBoxes,
|
|
469
|
+
editComment,
|
|
470
|
+
activeCommentAnswerId,
|
|
471
|
+
user,
|
|
472
|
+
docInfo,
|
|
473
|
+
filterOptions
|
|
474
|
+
}) =>
|
|
475
|
+
`<div id="margin-box-container"><div>${marginBoxes
|
|
476
|
+
.map(mBox => {
|
|
477
|
+
let returnValue = ""
|
|
478
|
+
switch (mBox.type) {
|
|
479
|
+
case "comment":
|
|
480
|
+
returnValue = commentTemplate({
|
|
481
|
+
comment: mBox.data,
|
|
482
|
+
view: mBox.view,
|
|
483
|
+
active: mBox.active,
|
|
484
|
+
activeCommentAnswerId,
|
|
485
|
+
editComment,
|
|
486
|
+
user,
|
|
487
|
+
docInfo,
|
|
488
|
+
filterOptions
|
|
489
|
+
})
|
|
490
|
+
break
|
|
491
|
+
case "insertion":
|
|
492
|
+
case "deletion":
|
|
493
|
+
case "format_change":
|
|
494
|
+
case "block_change":
|
|
495
|
+
returnValue = trackTemplate({
|
|
496
|
+
type: mBox.type,
|
|
497
|
+
node: mBox.node,
|
|
498
|
+
data: mBox.data,
|
|
499
|
+
active: mBox.active,
|
|
500
|
+
docInfo,
|
|
501
|
+
filterOptions
|
|
502
|
+
})
|
|
503
|
+
break
|
|
504
|
+
case "help":
|
|
505
|
+
returnValue = helpTemplate({help: mBox.data, filterOptions})
|
|
506
|
+
break
|
|
507
|
+
case "warning":
|
|
508
|
+
returnValue = warningTemplate({
|
|
509
|
+
warning: mBox.data,
|
|
510
|
+
filterOptions
|
|
511
|
+
})
|
|
512
|
+
break
|
|
513
|
+
default:
|
|
514
|
+
break
|
|
515
|
+
}
|
|
516
|
+
return returnValue
|
|
517
|
+
})
|
|
518
|
+
.join("")}</div></div>`
|
|
519
|
+
|
|
520
|
+
export const marginBoxOptions = (comment, user, docInfo) => {
|
|
521
|
+
return `<div class="comment-answer-options fw-marginbox-options fw-pulldown">
|
|
522
|
+
${
|
|
523
|
+
!comment.answer
|
|
524
|
+
? `<ul>
|
|
525
|
+
${
|
|
526
|
+
comment.user === user.id
|
|
527
|
+
? `<li><span class="fw-pulldown-item edit-comment" data-id="${comment.id}" title="${gettext("Edit")}">
|
|
528
|
+
${gettext("Edit")}
|
|
529
|
+
</span></li>`
|
|
530
|
+
: ""
|
|
531
|
+
}
|
|
532
|
+
<li>
|
|
533
|
+
<span class="fw-pulldown-item show-marginbox-options-submenu" title="${gettext("Assign comment to user")}">
|
|
534
|
+
${gettext("Assign to")}
|
|
535
|
+
<span class="fw-icon-right"><i class="fa-solid fa-caret-right"></i></span>
|
|
536
|
+
</span>
|
|
537
|
+
<div class="fw-pulldown marginbox-options-submenu">
|
|
538
|
+
<ul>
|
|
539
|
+
<li><span class="fw-pulldown-item unassign-comment" data-id="${comment.id}" title="${gettext("Remove user assignment from comment")}">${gettext("No-one")}</span></li>
|
|
540
|
+
${docInfo.owner.contacts
|
|
541
|
+
.concat(docInfo.owner)
|
|
542
|
+
.filter(contact => contact.type !== "userinvite")
|
|
543
|
+
.map(
|
|
544
|
+
user =>
|
|
545
|
+
`<li><span class="fw-pulldown-item assign-comment" data-id="${comment.id}" data-user="${user.id}" data-username="${escapeText(user.name)}" title="${gettext("Assign comment to")} ${escapeText(user.name)}">${escapeText(user.name)}</span></li>`
|
|
546
|
+
)
|
|
547
|
+
.join("")}
|
|
548
|
+
</ul>
|
|
549
|
+
</div>
|
|
550
|
+
</li>
|
|
551
|
+
<li>
|
|
552
|
+
${
|
|
553
|
+
comment.resolved
|
|
554
|
+
? `<span class="fw-pulldown-item recreate-comment" data-id="${comment.id}" title="${gettext("Recreate comment")}">${gettext("Recreate")}</span>`
|
|
555
|
+
: `<span class="fw-pulldown-item resolve-comment" data-id="${comment.id}" title="${gettext("Resolve comment")}">${gettext("Resolve")}</span>`
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
</li>
|
|
559
|
+
<li>
|
|
560
|
+
<span class="fw-pulldown-item fw-delete-comment" data-id="${comment.id}" title="${gettext("Delete comment")}">${gettext("Delete")}</span>
|
|
561
|
+
</li>
|
|
562
|
+
</ul>`
|
|
563
|
+
: `<ul>
|
|
564
|
+
<li><span class="fw-pulldown-item edit-comment-answer" data-id="${comment.commentId}" data-answer="${comment.id}" title="${gettext("Edit")}">
|
|
565
|
+
${gettext("Edit")}
|
|
566
|
+
</span></li>
|
|
567
|
+
<li><span class="fw-pulldown-item delete-comment-answer" data-id="${comment.commentId}" data-answer="${comment.id}" title="${gettext("Delete")}">
|
|
568
|
+
${gettext("Delete")}
|
|
569
|
+
</span></li>
|
|
570
|
+
</ul>`
|
|
571
|
+
}
|
|
572
|
+
</div>`
|
|
573
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {codeBlockMenuModel} from "./model"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {CodeBlockDialog} from "../../dialogs"
|
|
2
|
+
|
|
3
|
+
export const codeBlockMenuModel = () => ({
|
|
4
|
+
content: [
|
|
5
|
+
{
|
|
6
|
+
title: `${gettext("Configure")} ...`,
|
|
7
|
+
type: "action",
|
|
8
|
+
tooltip: gettext("Configure the code block."),
|
|
9
|
+
order: 1,
|
|
10
|
+
action: editor => {
|
|
11
|
+
const dialog = new CodeBlockDialog(editor)
|
|
12
|
+
dialog.init()
|
|
13
|
+
return false
|
|
14
|
+
},
|
|
15
|
+
disabled: editor => {
|
|
16
|
+
const view = editor.currentView
|
|
17
|
+
const {selection} = view.state
|
|
18
|
+
|
|
19
|
+
// Check if we're in a code block
|
|
20
|
+
let inCodeBlock = false
|
|
21
|
+
if (
|
|
22
|
+
selection.node &&
|
|
23
|
+
selection.node.type.name === "code_block"
|
|
24
|
+
) {
|
|
25
|
+
inCodeBlock = true
|
|
26
|
+
} else {
|
|
27
|
+
const $head = selection.$head
|
|
28
|
+
for (let d = $head.depth; d > 0; d--) {
|
|
29
|
+
if ($head.node(d).type.name === "code_block") {
|
|
30
|
+
inCodeBlock = true
|
|
31
|
+
break
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return !inCodeBlock
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: gettext("Remove"),
|
|
41
|
+
type: "action",
|
|
42
|
+
tooltip: gettext("Remove the code block."),
|
|
43
|
+
order: 2,
|
|
44
|
+
action: editor => {
|
|
45
|
+
const view = editor.currentView
|
|
46
|
+
const tr = view.state.tr.deleteSelection()
|
|
47
|
+
view.dispatch(tr)
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|