@eightyfourthousand/lib-editing 2026.4.0 → 2026.4.1
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/fixtures/basic/json.d.ts +4 -0
- package/fixtures/basic/json.js +393 -0
- package/fixtures/basic/json.js.map +1 -0
- package/fixtures/toh251/json.d.ts +4 -0
- package/fixtures/toh251/json.js +4898 -0
- package/fixtures/toh251/json.js.map +1 -0
- package/fixtures/toh251/passages.d.ts +4 -0
- package/fixtures/toh251/passages.js +2764 -0
- package/fixtures/toh251/passages.js.map +1 -0
- package/fixtures/types.d.ts +6 -0
- package/fixtures/types.js +4 -0
- package/fixtures/types.js.map +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -0
- package/lib/block.d.ts +3 -0
- package/lib/block.js +175 -0
- package/lib/block.js.map +1 -0
- package/lib/components/editor/BlockEditor.d.ts +7 -0
- package/lib/components/editor/BlockEditor.js +18 -0
- package/lib/components/editor/BlockEditor.js.map +1 -0
- package/lib/components/editor/EditorBackMatterPage.d.ts +1 -0
- package/lib/components/editor/EditorBackMatterPage.js +55 -0
- package/lib/components/editor/EditorBackMatterPage.js.map +1 -0
- package/lib/components/editor/EditorBodyPage.d.ts +1 -0
- package/lib/components/editor/EditorBodyPage.js +47 -0
- package/lib/components/editor/EditorBodyPage.js.map +1 -0
- package/lib/components/editor/EditorHeader.d.ts +1 -0
- package/lib/components/editor/EditorHeader.js +12 -0
- package/lib/components/editor/EditorHeader.js.map +1 -0
- package/lib/components/editor/EditorLayout.d.ts +9 -0
- package/lib/components/editor/EditorLayout.js +30 -0
- package/lib/components/editor/EditorLayout.js.map +1 -0
- package/lib/components/editor/EditorLeftPanelPage.d.ts +1 -0
- package/lib/components/editor/EditorLeftPanelPage.js +24 -0
- package/lib/components/editor/EditorLeftPanelPage.js.map +1 -0
- package/lib/components/editor/EditorProvider.d.ts +31 -0
- package/lib/components/editor/EditorProvider.js +353 -0
- package/lib/components/editor/EditorProvider.js.map +1 -0
- package/lib/components/editor/PaginationProvider.d.ts +27 -0
- package/lib/components/editor/PaginationProvider.js +311 -0
- package/lib/components/editor/PaginationProvider.js.map +1 -0
- package/lib/components/editor/TitlesBuilder.d.ts +5 -0
- package/lib/components/editor/TitlesBuilder.js +25 -0
- package/lib/components/editor/TitlesBuilder.js.map +1 -0
- package/lib/components/editor/TranslationBuilder.d.ts +2 -0
- package/lib/components/editor/TranslationBuilder.js +128 -0
- package/lib/components/editor/TranslationBuilder.js.map +1 -0
- package/lib/components/editor/TranslationEditor.d.ts +6 -0
- package/lib/components/editor/TranslationEditor.js +15 -0
- package/lib/components/editor/TranslationEditor.js.map +1 -0
- package/lib/components/editor/extensions/Abbreviation/Abbreviation.d.ts +16 -0
- package/lib/components/editor/extensions/Abbreviation/Abbreviation.js +106 -0
- package/lib/components/editor/extensions/Abbreviation/Abbreviation.js.map +1 -0
- package/lib/components/editor/extensions/Audio/Audio.d.ts +23 -0
- package/lib/components/editor/extensions/Audio/Audio.js +41 -0
- package/lib/components/editor/extensions/Audio/Audio.js.map +1 -0
- package/lib/components/editor/extensions/Bold.d.ts +1 -0
- package/lib/components/editor/extensions/Bold.js +38 -0
- package/lib/components/editor/extensions/Bold.js.map +1 -0
- package/lib/components/editor/extensions/Document.d.ts +2 -0
- package/lib/components/editor/extensions/Document.js +7 -0
- package/lib/components/editor/extensions/Document.js.map +1 -0
- package/lib/components/editor/extensions/DragHandle/DragHandle.d.ts +25 -0
- package/lib/components/editor/extensions/DragHandle/DragHandle.js +312 -0
- package/lib/components/editor/extensions/DragHandle/DragHandle.js.map +1 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLink.d.ts +6 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLink.js +21 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLink.js.map +1 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkHoverContent.d.ts +7 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkHoverContent.js +76 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkHoverContent.js.map +1 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.d.ts +13 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.js +174 -0
- package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.js.map +1 -0
- package/lib/components/editor/extensions/EndNoteLink/endnote-utils.d.ts +86 -0
- package/lib/components/editor/extensions/EndNoteLink/endnote-utils.js +307 -0
- package/lib/components/editor/extensions/EndNoteLink/endnote-utils.js.map +1 -0
- package/lib/components/editor/extensions/GlobalConfig.d.ts +23 -0
- package/lib/components/editor/extensions/GlobalConfig.js +23 -0
- package/lib/components/editor/extensions/GlobalConfig.js.map +1 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInput.d.ts +4 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInput.js +23 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInput.js.map +1 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstance.d.ts +7 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstance.js +67 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstance.js.map +1 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.d.ts +13 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.js +109 -0
- package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.js.map +1 -0
- package/lib/components/editor/extensions/Heading/Heading.d.ts +2 -0
- package/lib/components/editor/extensions/Heading/Heading.js +52 -0
- package/lib/components/editor/extensions/Heading/Heading.js.map +1 -0
- package/lib/components/editor/extensions/HoverInputField.d.ts +7 -0
- package/lib/components/editor/extensions/HoverInputField.js +20 -0
- package/lib/components/editor/extensions/HoverInputField.js.map +1 -0
- package/lib/components/editor/extensions/Image.d.ts +2 -0
- package/lib/components/editor/extensions/Image.js +16 -0
- package/lib/components/editor/extensions/Image.js.map +1 -0
- package/lib/components/editor/extensions/Indent.d.ts +24 -0
- package/lib/components/editor/extensions/Indent.js +66 -0
- package/lib/components/editor/extensions/Indent.js.map +1 -0
- package/lib/components/editor/extensions/InternalLink/InternalLink.d.ts +13 -0
- package/lib/components/editor/extensions/InternalLink/InternalLink.js +141 -0
- package/lib/components/editor/extensions/InternalLink/InternalLink.js.map +1 -0
- package/lib/components/editor/extensions/InternalLink/InternalLinkHoverContent.d.ts +8 -0
- package/lib/components/editor/extensions/InternalLink/InternalLinkHoverContent.js +66 -0
- package/lib/components/editor/extensions/InternalLink/InternalLinkHoverContent.js.map +1 -0
- package/lib/components/editor/extensions/InternalLink/InternalLinkInput.d.ts +5 -0
- package/lib/components/editor/extensions/InternalLink/InternalLinkInput.js +32 -0
- package/lib/components/editor/extensions/InternalLink/InternalLinkInput.js.map +1 -0
- package/lib/components/editor/extensions/InternalLink/index.js +2 -0
- package/lib/components/editor/extensions/InternalLink/index.js.map +1 -0
- package/lib/components/editor/extensions/Italic.d.ts +1 -0
- package/lib/components/editor/extensions/Italic.js +44 -0
- package/lib/components/editor/extensions/Italic.js.map +1 -0
- package/lib/components/editor/extensions/LeadingSpace.d.ts +24 -0
- package/lib/components/editor/extensions/LeadingSpace.js +69 -0
- package/lib/components/editor/extensions/LeadingSpace.js.map +1 -0
- package/lib/components/editor/extensions/Line/LineNode.d.ts +2 -0
- package/lib/components/editor/extensions/Line/LineNode.js +32 -0
- package/lib/components/editor/extensions/Line/LineNode.js.map +1 -0
- package/lib/components/editor/extensions/LineGroup/LineGroupNode.d.ts +19 -0
- package/lib/components/editor/extensions/LineGroup/LineGroupNode.js +86 -0
- package/lib/components/editor/extensions/LineGroup/LineGroupNode.js.map +1 -0
- package/lib/components/editor/extensions/Link/Link.d.ts +1 -0
- package/lib/components/editor/extensions/Link/Link.js +51 -0
- package/lib/components/editor/extensions/Link/Link.js.map +1 -0
- package/lib/components/editor/extensions/Link/LinkHoverContent.d.ts +7 -0
- package/lib/components/editor/extensions/Link/LinkHoverContent.js +59 -0
- package/lib/components/editor/extensions/Link/LinkHoverContent.js.map +1 -0
- package/lib/components/editor/extensions/Link/index.js +2 -0
- package/lib/components/editor/extensions/Link/index.js.map +1 -0
- package/lib/components/editor/extensions/List.d.ts +3 -0
- package/lib/components/editor/extensions/List.js +59 -0
- package/lib/components/editor/extensions/List.js.map +1 -0
- package/lib/components/editor/extensions/Mantra/Mantra.d.ts +15 -0
- package/lib/components/editor/extensions/Mantra/Mantra.js +63 -0
- package/lib/components/editor/extensions/Mantra/Mantra.js.map +1 -0
- package/lib/components/editor/extensions/Mention/Mention.d.ts +22 -0
- package/lib/components/editor/extensions/Mention/Mention.js +142 -0
- package/lib/components/editor/extensions/Mention/Mention.js.map +1 -0
- package/lib/components/editor/extensions/Mention/MentionHoverContent.d.ts +8 -0
- package/lib/components/editor/extensions/Mention/MentionHoverContent.js +85 -0
- package/lib/components/editor/extensions/Mention/MentionHoverContent.js.map +1 -0
- package/lib/components/editor/extensions/NodeWrapper.d.ts +18 -0
- package/lib/components/editor/extensions/NodeWrapper.js +14 -0
- package/lib/components/editor/extensions/NodeWrapper.js.map +1 -0
- package/lib/components/editor/extensions/Paragraph/Paragraph.d.ts +2 -0
- package/lib/components/editor/extensions/Paragraph/Paragraph.js +23 -0
- package/lib/components/editor/extensions/Paragraph/Paragraph.js.map +1 -0
- package/lib/components/editor/extensions/ParagraphIndent.d.ts +24 -0
- package/lib/components/editor/extensions/ParagraphIndent.js +52 -0
- package/lib/components/editor/extensions/ParagraphIndent.js.map +1 -0
- package/lib/components/editor/extensions/Passage/EditLabel.d.ts +4 -0
- package/lib/components/editor/extensions/Passage/EditLabel.js +19 -0
- package/lib/components/editor/extensions/Passage/EditLabel.js.map +1 -0
- package/lib/components/editor/extensions/Passage/EditorOptions.d.ts +3 -0
- package/lib/components/editor/extensions/Passage/EditorOptions.js +8 -0
- package/lib/components/editor/extensions/Passage/EditorOptions.js.map +1 -0
- package/lib/components/editor/extensions/Passage/Passage.d.ts +3 -0
- package/lib/components/editor/extensions/Passage/Passage.js +76 -0
- package/lib/components/editor/extensions/Passage/Passage.js.map +1 -0
- package/lib/components/editor/extensions/Passage/PassageNode.d.ts +10 -0
- package/lib/components/editor/extensions/Passage/PassageNode.js +180 -0
- package/lib/components/editor/extensions/Passage/PassageNode.js.map +1 -0
- package/lib/components/editor/extensions/Passage/ReaderOptions.d.ts +8 -0
- package/lib/components/editor/extensions/Passage/ReaderOptions.js +25 -0
- package/lib/components/editor/extensions/Passage/ReaderOptions.js.map +1 -0
- package/lib/components/editor/extensions/Passage/ShowAnnotations.d.ts +2 -0
- package/lib/components/editor/extensions/Passage/ShowAnnotations.js +31 -0
- package/lib/components/editor/extensions/Passage/ShowAnnotations.js.map +1 -0
- package/lib/components/editor/extensions/Passage/index.js +2 -0
- package/lib/components/editor/extensions/Passage/index.js.map +1 -0
- package/lib/components/editor/extensions/Passage/label.d.ts +22 -0
- package/lib/components/editor/extensions/Passage/label.js +37 -0
- package/lib/components/editor/extensions/Passage/label.js.map +1 -0
- package/lib/components/editor/extensions/Placeholder.d.ts +2 -0
- package/lib/components/editor/extensions/Placeholder.js +9 -0
- package/lib/components/editor/extensions/Placeholder.js.map +1 -0
- package/lib/components/editor/extensions/SlashCommand/SlashCommand.d.ts +32 -0
- package/lib/components/editor/extensions/SlashCommand/SlashCommand.js +32 -0
- package/lib/components/editor/extensions/SlashCommand/SlashCommand.js.map +1 -0
- package/lib/components/editor/extensions/SlashCommand/SuggestionList.d.ts +12 -0
- package/lib/components/editor/extensions/SlashCommand/SuggestionList.js +49 -0
- package/lib/components/editor/extensions/SlashCommand/SuggestionList.js.map +1 -0
- package/lib/components/editor/extensions/SlashCommand/Suggestions.d.ts +13 -0
- package/lib/components/editor/extensions/SlashCommand/Suggestions.js +151 -0
- package/lib/components/editor/extensions/SlashCommand/Suggestions.js.map +1 -0
- package/lib/components/editor/extensions/SmallCaps.d.ts +34 -0
- package/lib/components/editor/extensions/SmallCaps.js +68 -0
- package/lib/components/editor/extensions/SmallCaps.js.map +1 -0
- package/lib/components/editor/extensions/StarterKit.d.ts +4 -0
- package/lib/components/editor/extensions/StarterKit.js +31 -0
- package/lib/components/editor/extensions/StarterKit.js.map +1 -0
- package/lib/components/editor/extensions/Subscript.d.ts +1 -0
- package/lib/components/editor/extensions/Subscript.js +38 -0
- package/lib/components/editor/extensions/Subscript.js.map +1 -0
- package/lib/components/editor/extensions/Superscript.d.ts +1 -0
- package/lib/components/editor/extensions/Superscript.js +38 -0
- package/lib/components/editor/extensions/Superscript.js.map +1 -0
- package/lib/components/editor/extensions/Table.d.ts +1 -0
- package/lib/components/editor/extensions/Table.js +27 -0
- package/lib/components/editor/extensions/Table.js.map +1 -0
- package/lib/components/editor/extensions/TextAlign.d.ts +2 -0
- package/lib/components/editor/extensions/TextAlign.js +5 -0
- package/lib/components/editor/extensions/TextAlign.js.map +1 -0
- package/lib/components/editor/extensions/TitleMetadata.d.ts +2 -0
- package/lib/components/editor/extensions/TitleMetadata.js +40 -0
- package/lib/components/editor/extensions/TitleMetadata.js.map +1 -0
- package/lib/components/editor/extensions/TitleNode.d.ts +8 -0
- package/lib/components/editor/extensions/TitleNode.js +94 -0
- package/lib/components/editor/extensions/TitleNode.js.map +1 -0
- package/lib/components/editor/extensions/TitlesNode.d.ts +7 -0
- package/lib/components/editor/extensions/TitlesNode.js +89 -0
- package/lib/components/editor/extensions/TitlesNode.js.map +1 -0
- package/lib/components/editor/extensions/Trailer.d.ts +16 -0
- package/lib/components/editor/extensions/Trailer.js +35 -0
- package/lib/components/editor/extensions/Trailer.js.map +1 -0
- package/lib/components/editor/extensions/TranslationDocument.d.ts +3 -0
- package/lib/components/editor/extensions/TranslationDocument.js +7 -0
- package/lib/components/editor/extensions/TranslationDocument.js.map +1 -0
- package/lib/components/editor/extensions/TranslationMetadata.d.ts +3 -0
- package/lib/components/editor/extensions/TranslationMetadata.js +56 -0
- package/lib/components/editor/extensions/TranslationMetadata.js.map +1 -0
- package/lib/components/editor/extensions/Underline.d.ts +1 -0
- package/lib/components/editor/extensions/Underline.js +38 -0
- package/lib/components/editor/extensions/Underline.js.map +1 -0
- package/lib/components/editor/hooks/index.js +5 -0
- package/lib/components/editor/hooks/index.js.map +1 -0
- package/lib/components/editor/hooks/useBlockEditor.d.ts +13 -0
- package/lib/components/editor/hooks/useBlockEditor.js +23 -0
- package/lib/components/editor/hooks/useBlockEditor.js.map +1 -0
- package/lib/components/editor/hooks/useDefaultExtensions.d.ts +3 -0
- package/lib/components/editor/hooks/useDefaultExtensions.js +38 -0
- package/lib/components/editor/hooks/useDefaultExtensions.js.map +1 -0
- package/lib/components/editor/hooks/useDirtyStore.d.ts +8 -0
- package/lib/components/editor/hooks/useDirtyStore.js +23 -0
- package/lib/components/editor/hooks/useDirtyStore.js.map +1 -0
- package/lib/components/editor/hooks/useTranslationExtensions.d.ts +6 -0
- package/lib/components/editor/hooks/useTranslationExtensions.js +113 -0
- package/lib/components/editor/hooks/useTranslationExtensions.js.map +1 -0
- package/lib/components/editor/index.js +11 -0
- package/lib/components/editor/index.js.map +1 -0
- package/lib/components/editor/menus/EmptyBubbleMenu.d.ts +4 -0
- package/lib/components/editor/menus/EmptyBubbleMenu.js +24 -0
- package/lib/components/editor/menus/EmptyBubbleMenu.js.map +1 -0
- package/lib/components/editor/menus/MainBubbleMenu.d.ts +4 -0
- package/lib/components/editor/menus/MainBubbleMenu.js +28 -0
- package/lib/components/editor/menus/MainBubbleMenu.js.map +1 -0
- package/lib/components/editor/menus/TranslationBubbleMenu.d.ts +4 -0
- package/lib/components/editor/menus/TranslationBubbleMenu.js +30 -0
- package/lib/components/editor/menus/TranslationBubbleMenu.js.map +1 -0
- package/lib/components/editor/menus/index.js +4 -0
- package/lib/components/editor/menus/index.js.map +1 -0
- package/lib/components/editor/menus/selectors/EndNoteSelector.d.ts +4 -0
- package/lib/components/editor/menus/selectors/EndNoteSelector.js +256 -0
- package/lib/components/editor/menus/selectors/EndNoteSelector.js.map +1 -0
- package/lib/components/editor/menus/selectors/GlossarySelector.d.ts +4 -0
- package/lib/components/editor/menus/selectors/GlossarySelector.js +26 -0
- package/lib/components/editor/menus/selectors/GlossarySelector.js.map +1 -0
- package/lib/components/editor/menus/selectors/LinkSelector.d.ts +4 -0
- package/lib/components/editor/menus/selectors/LinkSelector.js +31 -0
- package/lib/components/editor/menus/selectors/LinkSelector.js.map +1 -0
- package/lib/components/editor/menus/selectors/MantraSelector.d.ts +4 -0
- package/lib/components/editor/menus/selectors/MantraSelector.js +63 -0
- package/lib/components/editor/menus/selectors/MantraSelector.js.map +1 -0
- package/lib/components/editor/menus/selectors/NodeSelector.d.ts +4 -0
- package/lib/components/editor/menus/selectors/NodeSelector.js +75 -0
- package/lib/components/editor/menus/selectors/NodeSelector.js.map +1 -0
- package/lib/components/editor/menus/selectors/ParagraphButtons.d.ts +4 -0
- package/lib/components/editor/menus/selectors/ParagraphButtons.js +42 -0
- package/lib/components/editor/menus/selectors/ParagraphButtons.js.map +1 -0
- package/lib/components/editor/menus/selectors/SelectorInputField.d.ts +8 -0
- package/lib/components/editor/menus/selectors/SelectorInputField.js +29 -0
- package/lib/components/editor/menus/selectors/SelectorInputField.js.map +1 -0
- package/lib/components/editor/menus/selectors/TextAlignSelector.d.ts +4 -0
- package/lib/components/editor/menus/selectors/TextAlignSelector.js +43 -0
- package/lib/components/editor/menus/selectors/TextAlignSelector.js.map +1 -0
- package/lib/components/editor/menus/selectors/TextButtons.d.ts +4 -0
- package/lib/components/editor/menus/selectors/TextButtons.js +56 -0
- package/lib/components/editor/menus/selectors/TextButtons.js.map +1 -0
- package/lib/components/editor/menus/selectors/TranslationNodeSelector.d.ts +4 -0
- package/lib/components/editor/menus/selectors/TranslationNodeSelector.js +75 -0
- package/lib/components/editor/menus/selectors/TranslationNodeSelector.js.map +1 -0
- package/lib/components/editor/menus/selectors/TranslationTextButtons.d.ts +4 -0
- package/lib/components/editor/menus/selectors/TranslationTextButtons.js +75 -0
- package/lib/components/editor/menus/selectors/TranslationTextButtons.js.map +1 -0
- package/lib/components/editor/menus/selectors/index.js +6 -0
- package/lib/components/editor/menus/selectors/index.js.map +1 -0
- package/lib/components/editor/save-filter.d.ts +13 -0
- package/lib/components/editor/save-filter.js +15 -0
- package/lib/components/editor/save-filter.js.map +1 -0
- package/lib/components/editor/util.d.ts +98 -0
- package/lib/components/editor/util.js +186 -0
- package/lib/components/editor/util.js.map +1 -0
- package/lib/components/index.js +4 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/reader/ReaderBackMatterPage.d.ts +5 -0
- package/lib/components/reader/ReaderBackMatterPage.js +38 -0
- package/lib/components/reader/ReaderBackMatterPage.js.map +1 -0
- package/lib/components/reader/ReaderBackMatterPanel.d.ts +11 -0
- package/lib/components/reader/ReaderBackMatterPanel.js +15 -0
- package/lib/components/reader/ReaderBackMatterPanel.js.map +1 -0
- package/lib/components/reader/ReaderBodyPage.d.ts +5 -0
- package/lib/components/reader/ReaderBodyPage.js +29 -0
- package/lib/components/reader/ReaderBodyPage.js.map +1 -0
- package/lib/components/reader/ReaderBodyPanel.d.ts +8 -0
- package/lib/components/reader/ReaderBodyPanel.js +19 -0
- package/lib/components/reader/ReaderBodyPanel.js.map +1 -0
- package/lib/components/reader/ReaderLayout.d.ts +10 -0
- package/lib/components/reader/ReaderLayout.js +11 -0
- package/lib/components/reader/ReaderLayout.js.map +1 -0
- package/lib/components/reader/ReaderLeftPanel.d.ts +5 -0
- package/lib/components/reader/ReaderLeftPanel.js +7 -0
- package/lib/components/reader/ReaderLeftPanel.js.map +1 -0
- package/lib/components/reader/ReaderLeftPanelPage.d.ts +5 -0
- package/lib/components/reader/ReaderLeftPanelPage.js +20 -0
- package/lib/components/reader/ReaderLeftPanelPage.js.map +1 -0
- package/lib/components/reader/TranslationReader.d.ts +2 -0
- package/lib/components/reader/TranslationReader.js +10 -0
- package/lib/components/reader/TranslationReader.js.map +1 -0
- package/lib/components/reader/index.js +3 -0
- package/lib/components/reader/index.js.map +1 -0
- package/lib/components/reader/ssr.js +4 -0
- package/lib/components/reader/ssr.js.map +1 -0
- package/lib/components/shared/AiSummarizerPage.d.ts +1 -0
- package/lib/components/shared/AiSummarizerPage.js +11 -0
- package/lib/components/shared/AiSummarizerPage.js.map +1 -0
- package/lib/components/shared/BackMatterPanel.d.ts +15 -0
- package/lib/components/shared/BackMatterPanel.js +31 -0
- package/lib/components/shared/BackMatterPanel.js.map +1 -0
- package/lib/components/shared/BodyPanel.d.ts +12 -0
- package/lib/components/shared/BodyPanel.js +81 -0
- package/lib/components/shared/BodyPanel.js.map +1 -0
- package/lib/components/shared/HoverCardProvider.d.ts +23 -0
- package/lib/components/shared/HoverCardProvider.js +261 -0
- package/lib/components/shared/HoverCardProvider.js.map +1 -0
- package/lib/components/shared/Imprint.d.ts +4 -0
- package/lib/components/shared/Imprint.js +11 -0
- package/lib/components/shared/Imprint.js.map +1 -0
- package/lib/components/shared/LabeledElement.d.ts +9 -0
- package/lib/components/shared/LabeledElement.js +41 -0
- package/lib/components/shared/LabeledElement.js.map +1 -0
- package/lib/components/shared/LeftPanel.d.ts +6 -0
- package/lib/components/shared/LeftPanel.js +22 -0
- package/lib/components/shared/LeftPanel.js.map +1 -0
- package/lib/components/shared/NavigationContext.d.ts +25 -0
- package/lib/components/shared/NavigationContext.js +31 -0
- package/lib/components/shared/NavigationContext.js.map +1 -0
- package/lib/components/shared/NavigationProvider.d.ts +7 -0
- package/lib/components/shared/NavigationProvider.js +262 -0
- package/lib/components/shared/NavigationProvider.js.map +1 -0
- package/lib/components/shared/OpenGraphImage.d.ts +13 -0
- package/lib/components/shared/OpenGraphImage.js +47 -0
- package/lib/components/shared/OpenGraphImage.js.map +1 -0
- package/lib/components/shared/PassageSkeleton.d.ts +1 -0
- package/lib/components/shared/PassageSkeleton.js +6 -0
- package/lib/components/shared/PassageSkeleton.js.map +1 -0
- package/lib/components/shared/ReaderSearchButton.d.ts +1 -0
- package/lib/components/shared/ReaderSearchButton.js +72 -0
- package/lib/components/shared/ReaderSearchButton.js.map +1 -0
- package/lib/components/shared/RestrictionWarning.d.ts +13 -0
- package/lib/components/shared/RestrictionWarning.js +61 -0
- package/lib/components/shared/RestrictionWarning.js.map +1 -0
- package/lib/components/shared/SearchReplacePanel.d.ts +9 -0
- package/lib/components/shared/SearchReplacePanel.js +136 -0
- package/lib/components/shared/SearchReplacePanel.js.map +1 -0
- package/lib/components/shared/SourceReader.d.ts +1 -0
- package/lib/components/shared/SourceReader.js +49 -0
- package/lib/components/shared/SourceReader.js.map +1 -0
- package/lib/components/shared/SuggestRevisionForm.d.ts +6 -0
- package/lib/components/shared/SuggestRevisionForm.js +44 -0
- package/lib/components/shared/SuggestRevisionForm.js.map +1 -0
- package/lib/components/shared/TableOfContents.d.ts +13 -0
- package/lib/components/shared/TableOfContents.js +135 -0
- package/lib/components/shared/TableOfContents.js.map +1 -0
- package/lib/components/shared/ThreeColumnRenderer.d.ts +5 -0
- package/lib/components/shared/ThreeColumnRenderer.js +28 -0
- package/lib/components/shared/ThreeColumnRenderer.js.map +1 -0
- package/lib/components/shared/TranslationHeader.d.ts +3 -0
- package/lib/components/shared/TranslationHeader.js +11 -0
- package/lib/components/shared/TranslationHeader.js.map +1 -0
- package/lib/components/shared/TranslationHoverCard.d.ts +7 -0
- package/lib/components/shared/TranslationHoverCard.js +41 -0
- package/lib/components/shared/TranslationHoverCard.js.map +1 -0
- package/lib/components/shared/TranslationSkeleton.d.ts +3 -0
- package/lib/components/shared/TranslationSkeleton.js +7 -0
- package/lib/components/shared/TranslationSkeleton.js.map +1 -0
- package/lib/components/shared/TranslationTable.d.ts +4 -0
- package/lib/components/shared/TranslationTable.js +82 -0
- package/lib/components/shared/TranslationTable.js.map +1 -0
- package/lib/components/shared/bibliography/BibliographyBody.d.ts +5 -0
- package/lib/components/shared/bibliography/BibliographyBody.js +11 -0
- package/lib/components/shared/bibliography/BibliographyBody.js.map +1 -0
- package/lib/components/shared/bibliography/BibliographyList.d.ts +5 -0
- package/lib/components/shared/bibliography/BibliographyList.js +15 -0
- package/lib/components/shared/bibliography/BibliographyList.js.map +1 -0
- package/lib/components/shared/bibliography/index.js +2 -0
- package/lib/components/shared/bibliography/index.js.map +1 -0
- package/lib/components/shared/generate-metadata.d.ts +6 -0
- package/lib/components/shared/generate-metadata.js +32 -0
- package/lib/components/shared/generate-metadata.js.map +1 -0
- package/lib/components/shared/glossary/GlossaryInstanceBody.d.ts +6 -0
- package/lib/components/shared/glossary/GlossaryInstanceBody.js +49 -0
- package/lib/components/shared/glossary/GlossaryInstanceBody.js.map +1 -0
- package/lib/components/shared/glossary/GlossaryPaginationProvider.d.ts +19 -0
- package/lib/components/shared/glossary/GlossaryPaginationProvider.js +182 -0
- package/lib/components/shared/glossary/GlossaryPaginationProvider.js.map +1 -0
- package/lib/components/shared/glossary/GlossarySkeleton.d.ts +5 -0
- package/lib/components/shared/glossary/GlossarySkeleton.js +10 -0
- package/lib/components/shared/glossary/GlossarySkeleton.js.map +1 -0
- package/lib/components/shared/glossary/GlossaryTermList.d.ts +4 -0
- package/lib/components/shared/glossary/GlossaryTermList.js +17 -0
- package/lib/components/shared/glossary/GlossaryTermList.js.map +1 -0
- package/lib/components/shared/glossary/index.js +4 -0
- package/lib/components/shared/glossary/index.js.map +1 -0
- package/lib/components/shared/hooks/useGlossaryInstanceListener.d.ts +4 -0
- package/lib/components/shared/hooks/useGlossaryInstanceListener.js +30 -0
- package/lib/components/shared/hooks/useGlossaryInstanceListener.js.map +1 -0
- package/lib/components/shared/hooks/usePaginationLoadTriggers.d.ts +12 -0
- package/lib/components/shared/hooks/usePaginationLoadTriggers.js +94 -0
- package/lib/components/shared/hooks/usePaginationLoadTriggers.js.map +1 -0
- package/lib/components/shared/hooks/useScrollInTab.d.ts +7 -0
- package/lib/components/shared/hooks/useScrollInTab.js +31 -0
- package/lib/components/shared/hooks/useScrollInTab.js.map +1 -0
- package/lib/components/shared/hooks/useScrollPositionRestore.d.ts +44 -0
- package/lib/components/shared/hooks/useScrollPositionRestore.js +219 -0
- package/lib/components/shared/hooks/useScrollPositionRestore.js.map +1 -0
- package/lib/components/shared/hooks/useTohToggle.d.ts +5 -0
- package/lib/components/shared/hooks/useTohToggle.js +36 -0
- package/lib/components/shared/hooks/useTohToggle.js.map +1 -0
- package/lib/components/shared/index.js +12 -0
- package/lib/components/shared/index.js.map +1 -0
- package/lib/components/shared/ssr.js +3 -0
- package/lib/components/shared/ssr.js.map +1 -0
- package/lib/components/shared/titles/FramedCard.d.ts +7 -0
- package/lib/components/shared/titles/FramedCard.js +21 -0
- package/lib/components/shared/titles/FramedCard.js.map +1 -0
- package/lib/components/shared/titles/LongTitle.d.ts +5 -0
- package/lib/components/shared/titles/LongTitle.js +12 -0
- package/lib/components/shared/titles/LongTitle.js.map +1 -0
- package/lib/components/shared/titles/LongTitles.d.ts +4 -0
- package/lib/components/shared/titles/LongTitles.js +14 -0
- package/lib/components/shared/titles/LongTitles.js.map +1 -0
- package/lib/components/shared/titles/Title.d.ts +20 -0
- package/lib/components/shared/titles/Title.js +39 -0
- package/lib/components/shared/titles/Title.js.map +1 -0
- package/lib/components/shared/titles/TitleDetails.d.ts +4 -0
- package/lib/components/shared/titles/TitleDetails.js +14 -0
- package/lib/components/shared/titles/TitleDetails.js.map +1 -0
- package/lib/components/shared/titles/TitleForm.d.ts +5 -0
- package/lib/components/shared/titles/TitleForm.js +14 -0
- package/lib/components/shared/titles/TitleForm.js.map +1 -0
- package/lib/components/shared/titles/Titles.d.ts +8 -0
- package/lib/components/shared/titles/Titles.js +65 -0
- package/lib/components/shared/titles/Titles.js.map +1 -0
- package/lib/components/shared/titles/TitlesCard.d.ts +12 -0
- package/lib/components/shared/titles/TitlesCard.js +10 -0
- package/lib/components/shared/titles/TitlesCard.js.map +1 -0
- package/lib/components/shared/titles/index.js +9 -0
- package/lib/components/shared/titles/index.js.map +1 -0
- package/lib/components/shared/types.d.ts +30 -0
- package/lib/components/shared/types.js +34 -0
- package/lib/components/shared/types.js.map +1 -0
- package/lib/components/ssr.js +3 -0
- package/lib/components/ssr.js.map +1 -0
- package/lib/exporters/abbreviation.d.ts +3 -0
- package/lib/exporters/abbreviation.js +14 -0
- package/lib/exporters/abbreviation.js.map +1 -0
- package/lib/exporters/annotation.d.ts +5 -0
- package/lib/exporters/annotation.js +158 -0
- package/lib/exporters/annotation.js.map +1 -0
- package/lib/exporters/audio.d.ts +3 -0
- package/lib/exporters/audio.js +19 -0
- package/lib/exporters/audio.js.map +1 -0
- package/lib/exporters/blockquote.d.ts +3 -0
- package/lib/exporters/blockquote.js +16 -0
- package/lib/exporters/blockquote.js.map +1 -0
- package/lib/exporters/code.d.ts +3 -0
- package/lib/exporters/code.js +16 -0
- package/lib/exporters/code.js.map +1 -0
- package/lib/exporters/end-note-link.d.ts +3 -0
- package/lib/exporters/end-note-link.js +23 -0
- package/lib/exporters/end-note-link.js.map +1 -0
- package/lib/exporters/export.d.ts +10 -0
- package/lib/exporters/export.js +2 -0
- package/lib/exporters/export.js.map +1 -0
- package/lib/exporters/glossary-instance.d.ts +3 -0
- package/lib/exporters/glossary-instance.js +20 -0
- package/lib/exporters/glossary-instance.js.map +1 -0
- package/lib/exporters/has-abbreviation.d.ts +3 -0
- package/lib/exporters/has-abbreviation.js +14 -0
- package/lib/exporters/has-abbreviation.js.map +1 -0
- package/lib/exporters/heading.d.ts +3 -0
- package/lib/exporters/heading.js +20 -0
- package/lib/exporters/heading.js.map +1 -0
- package/lib/exporters/image.d.ts +3 -0
- package/lib/exporters/image.js +17 -0
- package/lib/exporters/image.js.map +1 -0
- package/lib/exporters/indent.d.ts +3 -0
- package/lib/exporters/indent.js +11 -0
- package/lib/exporters/indent.js.map +1 -0
- package/lib/exporters/index.js +2 -0
- package/lib/exporters/index.js.map +1 -0
- package/lib/exporters/internal-link.d.ts +3 -0
- package/lib/exporters/internal-link.js +24 -0
- package/lib/exporters/internal-link.js.map +1 -0
- package/lib/exporters/italic.d.ts +3 -0
- package/lib/exporters/italic.js +33 -0
- package/lib/exporters/italic.js.map +1 -0
- package/lib/exporters/leading-space.d.ts +3 -0
- package/lib/exporters/leading-space.js +10 -0
- package/lib/exporters/leading-space.js.map +1 -0
- package/lib/exporters/line-group.d.ts +3 -0
- package/lib/exporters/line-group.js +16 -0
- package/lib/exporters/line-group.js.map +1 -0
- package/lib/exporters/line.d.ts +3 -0
- package/lib/exporters/line.js +16 -0
- package/lib/exporters/line.js.map +1 -0
- package/lib/exporters/link.d.ts +4 -0
- package/lib/exporters/link.js +36 -0
- package/lib/exporters/link.js.map +1 -0
- package/lib/exporters/list-item.d.ts +3 -0
- package/lib/exporters/list-item.js +16 -0
- package/lib/exporters/list-item.js.map +1 -0
- package/lib/exporters/list.d.ts +3 -0
- package/lib/exporters/list.js +22 -0
- package/lib/exporters/list.js.map +1 -0
- package/lib/exporters/mantra.d.ts +3 -0
- package/lib/exporters/mantra.js +17 -0
- package/lib/exporters/mantra.js.map +1 -0
- package/lib/exporters/mention.d.ts +3 -0
- package/lib/exporters/mention.js +11 -0
- package/lib/exporters/mention.js.map +1 -0
- package/lib/exporters/paragraph.d.ts +3 -0
- package/lib/exporters/paragraph.js +22 -0
- package/lib/exporters/paragraph.js.map +1 -0
- package/lib/exporters/quote.d.ts +3 -0
- package/lib/exporters/quote.js +16 -0
- package/lib/exporters/quote.js.map +1 -0
- package/lib/exporters/span.d.ts +3 -0
- package/lib/exporters/span.js +29 -0
- package/lib/exporters/span.js.map +1 -0
- package/lib/exporters/table-body-data.d.ts +3 -0
- package/lib/exporters/table-body-data.js +16 -0
- package/lib/exporters/table-body-data.js.map +1 -0
- package/lib/exporters/table-body-header.d.ts +3 -0
- package/lib/exporters/table-body-header.js +16 -0
- package/lib/exporters/table-body-header.js.map +1 -0
- package/lib/exporters/table-body-row.d.ts +3 -0
- package/lib/exporters/table-body-row.js +16 -0
- package/lib/exporters/table-body-row.js.map +1 -0
- package/lib/exporters/table.d.ts +3 -0
- package/lib/exporters/table.js +16 -0
- package/lib/exporters/table.js.map +1 -0
- package/lib/exporters/trailer.d.ts +3 -0
- package/lib/exporters/trailer.js +16 -0
- package/lib/exporters/trailer.js.map +1 -0
- package/lib/exporters/util.d.ts +3 -0
- package/lib/exporters/util.js +49 -0
- package/lib/exporters/util.js.map +1 -0
- package/lib/passage.d.ts +10 -0
- package/lib/passage.js +153 -0
- package/lib/passage.js.map +1 -0
- package/lib/titles.d.ts +3 -0
- package/lib/titles.js +70 -0
- package/lib/titles.js.map +1 -0
- package/lib/transformers/abbreviation.d.ts +2 -0
- package/lib/transformers/abbreviation.js +17 -0
- package/lib/transformers/abbreviation.js.map +1 -0
- package/lib/transformers/annotate.d.ts +8 -0
- package/lib/transformers/annotate.js +98 -0
- package/lib/transformers/annotate.js.map +1 -0
- package/lib/transformers/audio.d.ts +2 -0
- package/lib/transformers/audio.js +17 -0
- package/lib/transformers/audio.js.map +1 -0
- package/lib/transformers/blockquote.d.ts +2 -0
- package/lib/transformers/blockquote.js +27 -0
- package/lib/transformers/blockquote.js.map +1 -0
- package/lib/transformers/code.d.ts +2 -0
- package/lib/transformers/code.js +13 -0
- package/lib/transformers/code.js.map +1 -0
- package/lib/transformers/deprecated.d.ts +2 -0
- package/lib/transformers/deprecated.js +4 -0
- package/lib/transformers/deprecated.js.map +1 -0
- package/lib/transformers/end-note-link.d.ts +2 -0
- package/lib/transformers/end-note-link.js +54 -0
- package/lib/transformers/end-note-link.js.map +1 -0
- package/lib/transformers/glossary-instance.d.ts +2 -0
- package/lib/transformers/glossary-instance.js +28 -0
- package/lib/transformers/glossary-instance.js.map +1 -0
- package/lib/transformers/has-abbreviation.d.ts +2 -0
- package/lib/transformers/has-abbreviation.js +22 -0
- package/lib/transformers/has-abbreviation.js.map +1 -0
- package/lib/transformers/heading.d.ts +2 -0
- package/lib/transformers/heading.js +19 -0
- package/lib/transformers/heading.js.map +1 -0
- package/lib/transformers/image.d.ts +2 -0
- package/lib/transformers/image.js +16 -0
- package/lib/transformers/image.js.map +1 -0
- package/lib/transformers/indent.d.ts +2 -0
- package/lib/transformers/indent.js +8 -0
- package/lib/transformers/indent.js.map +1 -0
- package/lib/transformers/index.js +34 -0
- package/lib/transformers/index.js.map +1 -0
- package/lib/transformers/inline-title.d.ts +2 -0
- package/lib/transformers/inline-title.js +21 -0
- package/lib/transformers/inline-title.js.map +1 -0
- package/lib/transformers/internal-link.d.ts +2 -0
- package/lib/transformers/internal-link.js +37 -0
- package/lib/transformers/internal-link.js.map +1 -0
- package/lib/transformers/italic.d.ts +2 -0
- package/lib/transformers/italic.js +13 -0
- package/lib/transformers/italic.js.map +1 -0
- package/lib/transformers/leading-space.d.ts +2 -0
- package/lib/transformers/leading-space.js +8 -0
- package/lib/transformers/leading-space.js.map +1 -0
- package/lib/transformers/line-group.d.ts +2 -0
- package/lib/transformers/line-group.js +24 -0
- package/lib/transformers/line-group.js.map +1 -0
- package/lib/transformers/line.d.ts +2 -0
- package/lib/transformers/line.js +15 -0
- package/lib/transformers/line.js.map +1 -0
- package/lib/transformers/link.d.ts +2 -0
- package/lib/transformers/link.js +16 -0
- package/lib/transformers/link.js.map +1 -0
- package/lib/transformers/list-item.d.ts +2 -0
- package/lib/transformers/list-item.js +24 -0
- package/lib/transformers/list-item.js.map +1 -0
- package/lib/transformers/list.d.ts +2 -0
- package/lib/transformers/list.js +27 -0
- package/lib/transformers/list.js.map +1 -0
- package/lib/transformers/mantra.d.ts +2 -0
- package/lib/transformers/mantra.js +16 -0
- package/lib/transformers/mantra.js.map +1 -0
- package/lib/transformers/mention.d.ts +2 -0
- package/lib/transformers/mention.js +45 -0
- package/lib/transformers/mention.js.map +1 -0
- package/lib/transformers/paragraph.d.ts +2 -0
- package/lib/transformers/paragraph.js +13 -0
- package/lib/transformers/paragraph.js.map +1 -0
- package/lib/transformers/quote.d.ts +1 -0
- package/lib/transformers/quote.js +3 -0
- package/lib/transformers/quote.js.map +1 -0
- package/lib/transformers/quoted.d.ts +1 -0
- package/lib/transformers/quoted.js +3 -0
- package/lib/transformers/quoted.js.map +1 -0
- package/lib/transformers/recurse.d.ts +13 -0
- package/lib/transformers/recurse.js +54 -0
- package/lib/transformers/recurse.js.map +1 -0
- package/lib/transformers/reference.d.ts +1 -0
- package/lib/transformers/reference.js +3 -0
- package/lib/transformers/reference.js.map +1 -0
- package/lib/transformers/span.d.ts +2 -0
- package/lib/transformers/span.js +54 -0
- package/lib/transformers/span.js.map +1 -0
- package/lib/transformers/split-at.d.ts +5 -0
- package/lib/transformers/split-at.js +41 -0
- package/lib/transformers/split-at.js.map +1 -0
- package/lib/transformers/split-block.d.ts +2 -0
- package/lib/transformers/split-block.js +55 -0
- package/lib/transformers/split-block.js.map +1 -0
- package/lib/transformers/split-content.d.ts +2 -0
- package/lib/transformers/split-content.js +44 -0
- package/lib/transformers/split-content.js.map +1 -0
- package/lib/transformers/split-insert.d.ts +5 -0
- package/lib/transformers/split-insert.js +54 -0
- package/lib/transformers/split-insert.js.map +1 -0
- package/lib/transformers/split-marks.d.ts +19 -0
- package/lib/transformers/split-marks.js +15 -0
- package/lib/transformers/split-marks.js.map +1 -0
- package/lib/transformers/split-node.d.ts +14 -0
- package/lib/transformers/split-node.js +81 -0
- package/lib/transformers/split-node.js.map +1 -0
- package/lib/transformers/table-body-data.d.ts +2 -0
- package/lib/transformers/table-body-data.js +16 -0
- package/lib/transformers/table-body-data.js.map +1 -0
- package/lib/transformers/table-body-header.d.ts +2 -0
- package/lib/transformers/table-body-header.js +16 -0
- package/lib/transformers/table-body-header.js.map +1 -0
- package/lib/transformers/table-body-row.d.ts +2 -0
- package/lib/transformers/table-body-row.js +16 -0
- package/lib/transformers/table-body-row.js.map +1 -0
- package/lib/transformers/table.d.ts +2 -0
- package/lib/transformers/table.js +16 -0
- package/lib/transformers/table.js.map +1 -0
- package/lib/transformers/trailer.d.ts +2 -0
- package/lib/transformers/trailer.js +13 -0
- package/lib/transformers/trailer.js.map +1 -0
- package/lib/transformers/transformer.d.ts +15 -0
- package/lib/transformers/transformer.js +4 -0
- package/lib/transformers/transformer.js.map +1 -0
- package/lib/transformers/unknown.d.ts +2 -0
- package/lib/transformers/unknown.js +5 -0
- package/lib/transformers/unknown.js.map +1 -0
- package/lib/transformers/util.d.ts +3 -0
- package/lib/transformers/util.js +17 -0
- package/lib/transformers/util.js.map +1 -0
- package/lib/types.d.ts +2 -0
- package/lib/types.js +9 -0
- package/lib/types.js.map +1 -0
- package/package.json +54 -8
- package/ssr.js +2 -0
- package/ssr.js.map +1 -0
- package/.babelrc +0 -12
- package/.eslintrc.json +0 -18
- package/README.md +0 -9
- package/jest.config.ts +0 -10
- package/postcss.config.mjs +0 -9
- package/project.json +0 -29
- package/src/fixtures/basic/json.ts +0 -396
- package/src/fixtures/toh251/json.ts +0 -4913
- package/src/fixtures/toh251/passages.ts +0 -2814
- package/src/fixtures/types.ts +0 -8
- package/src/lib/block.ts +0 -226
- package/src/lib/components/editor/BlockEditor.tsx +0 -38
- package/src/lib/components/editor/EditorBackMatterPage.tsx +0 -97
- package/src/lib/components/editor/EditorBodyPage.tsx +0 -87
- package/src/lib/components/editor/EditorHeader.tsx +0 -22
- package/src/lib/components/editor/EditorLayout.tsx +0 -62
- package/src/lib/components/editor/EditorLeftPanelPage.tsx +0 -27
- package/src/lib/components/editor/EditorProvider.tsx +0 -475
- package/src/lib/components/editor/PaginationProvider.tsx +0 -457
- package/src/lib/components/editor/TitlesBuilder.tsx +0 -40
- package/src/lib/components/editor/TranslationBuilder.tsx +0 -171
- package/src/lib/components/editor/TranslationEditor.tsx +0 -32
- package/src/lib/components/editor/extensions/Abbreviation/Abbreviation.ts +0 -133
- package/src/lib/components/editor/extensions/Audio/Audio.ts +0 -69
- package/src/lib/components/editor/extensions/Bold.ts +0 -43
- package/src/lib/components/editor/extensions/Document.ts +0 -8
- package/src/lib/components/editor/extensions/DragHandle/DragHandle.ts +0 -429
- package/src/lib/components/editor/extensions/EndNoteLink/EndNoteLink.tsx +0 -39
- package/src/lib/components/editor/extensions/EndNoteLink/EndNoteLinkHoverContent.tsx +0 -139
- package/src/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.ts +0 -236
- package/src/lib/components/editor/extensions/EndNoteLink/endnote-utils.ts +0 -412
- package/src/lib/components/editor/extensions/GlobalConfig.ts +0 -52
- package/src/lib/components/editor/extensions/GlossaryInstance/GlossaryInput.tsx +0 -54
- package/src/lib/components/editor/extensions/GlossaryInstance/GlossaryInstance.tsx +0 -129
- package/src/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.ts +0 -148
- package/src/lib/components/editor/extensions/Heading/Heading.ts +0 -72
- package/src/lib/components/editor/extensions/HoverInputField.tsx +0 -54
- package/src/lib/components/editor/extensions/Image.ts +0 -18
- package/src/lib/components/editor/extensions/Indent.ts +0 -103
- package/src/lib/components/editor/extensions/InternalLink/InternalLink.ts +0 -176
- package/src/lib/components/editor/extensions/InternalLink/InternalLinkHoverContent.tsx +0 -137
- package/src/lib/components/editor/extensions/InternalLink/InternalLinkInput.tsx +0 -71
- package/src/lib/components/editor/extensions/Italic.ts +0 -50
- package/src/lib/components/editor/extensions/LeadingSpace.ts +0 -106
- package/src/lib/components/editor/extensions/Line/LineNode.ts +0 -41
- package/src/lib/components/editor/extensions/LineGroup/LineGroupNode.ts +0 -124
- package/src/lib/components/editor/extensions/Link/Link.ts +0 -65
- package/src/lib/components/editor/extensions/Link/LinkHoverContent.tsx +0 -124
- package/src/lib/components/editor/extensions/List.ts +0 -74
- package/src/lib/components/editor/extensions/Mantra/Mantra.ts +0 -88
- package/src/lib/components/editor/extensions/Mention/Mention.ts +0 -187
- package/src/lib/components/editor/extensions/Mention/MentionHoverContent.tsx +0 -158
- package/src/lib/components/editor/extensions/NodeWrapper.tsx +0 -57
- package/src/lib/components/editor/extensions/Paragraph/Paragraph.ts +0 -25
- package/src/lib/components/editor/extensions/ParagraphIndent.ts +0 -87
- package/src/lib/components/editor/extensions/Passage/EditLabel.tsx +0 -57
- package/src/lib/components/editor/extensions/Passage/EditorOptions.tsx +0 -29
- package/src/lib/components/editor/extensions/Passage/Passage.tsx +0 -238
- package/src/lib/components/editor/extensions/Passage/PassageNode.ts +0 -223
- package/src/lib/components/editor/extensions/Passage/ReaderOptions.tsx +0 -55
- package/src/lib/components/editor/extensions/Passage/ShowAnnotations.tsx +0 -92
- package/src/lib/components/editor/extensions/Passage/label.spec.ts +0 -118
- package/src/lib/components/editor/extensions/Passage/label.ts +0 -39
- package/src/lib/components/editor/extensions/Placeholder.ts +0 -9
- package/src/lib/components/editor/extensions/SlashCommand/SlashCommand.ts +0 -65
- package/src/lib/components/editor/extensions/SlashCommand/SuggestionList.tsx +0 -109
- package/src/lib/components/editor/extensions/SlashCommand/Suggestions.ts +0 -185
- package/src/lib/components/editor/extensions/SmallCaps.ts +0 -110
- package/src/lib/components/editor/extensions/StarterKit.ts +0 -36
- package/src/lib/components/editor/extensions/Subscript.ts +0 -43
- package/src/lib/components/editor/extensions/Superscript.ts +0 -43
- package/src/lib/components/editor/extensions/Table.ts +0 -32
- package/src/lib/components/editor/extensions/TextAlign.ts +0 -5
- package/src/lib/components/editor/extensions/TitleMetadata.ts +0 -40
- package/src/lib/components/editor/extensions/TitleNode.ts +0 -133
- package/src/lib/components/editor/extensions/TitlesNode.ts +0 -102
- package/src/lib/components/editor/extensions/Trailer.ts +0 -57
- package/src/lib/components/editor/extensions/TranslationDocument.ts +0 -7
- package/src/lib/components/editor/extensions/TranslationMetadata.ts +0 -58
- package/src/lib/components/editor/extensions/Underline.ts +0 -43
- package/src/lib/components/editor/hooks/useBlockEditor.ts +0 -53
- package/src/lib/components/editor/hooks/useDefaultExtensions.ts +0 -39
- package/src/lib/components/editor/hooks/useDirtyStore.ts +0 -33
- package/src/lib/components/editor/hooks/useTranslationExtensions.ts +0 -148
- package/src/lib/components/editor/menus/EmptyBubbleMenu.tsx +0 -42
- package/src/lib/components/editor/menus/MainBubbleMenu.tsx +0 -51
- package/src/lib/components/editor/menus/TranslationBubbleMenu.tsx +0 -57
- package/src/lib/components/editor/menus/selectors/EndNoteSelector.tsx +0 -388
- package/src/lib/components/editor/menus/selectors/GlossarySelector.tsx +0 -63
- package/src/lib/components/editor/menus/selectors/LinkSelector.tsx +0 -68
- package/src/lib/components/editor/menus/selectors/MantraSelector.tsx +0 -119
- package/src/lib/components/editor/menus/selectors/NodeSelector.tsx +0 -144
- package/src/lib/components/editor/menus/selectors/ParagraphButtons.tsx +0 -68
- package/src/lib/components/editor/menus/selectors/SelectorInputField.tsx +0 -68
- package/src/lib/components/editor/menus/selectors/TextAlignSelector.tsx +0 -89
- package/src/lib/components/editor/menus/selectors/TextButtons.tsx +0 -89
- package/src/lib/components/editor/menus/selectors/TranslationNodeSelector.tsx +0 -143
- package/src/lib/components/editor/menus/selectors/TranslationTextButtons.tsx +0 -125
- package/src/lib/components/editor/save-filter.spec.ts +0 -94
- package/src/lib/components/editor/save-filter.ts +0 -27
- package/src/lib/components/editor/util.ts +0 -304
- package/src/lib/components/reader/ReaderBackMatterPage.tsx +0 -63
- package/src/lib/components/reader/ReaderBackMatterPanel.tsx +0 -56
- package/src/lib/components/reader/ReaderBodyPage.tsx +0 -46
- package/src/lib/components/reader/ReaderBodyPanel.tsx +0 -68
- package/src/lib/components/reader/ReaderLayout.tsx +0 -39
- package/src/lib/components/reader/ReaderLeftPanel.tsx +0 -8
- package/src/lib/components/reader/ReaderLeftPanelPage.tsx +0 -31
- package/src/lib/components/reader/TranslationReader.tsx +0 -28
- package/src/lib/components/shared/AiSummarizerPage.tsx +0 -12
- package/src/lib/components/shared/BackMatterPanel.tsx +0 -150
- package/src/lib/components/shared/BodyPanel.tsx +0 -214
- package/src/lib/components/shared/HoverCardProvider.tsx +0 -407
- package/src/lib/components/shared/Imprint.tsx +0 -24
- package/src/lib/components/shared/LabeledElement.tsx +0 -133
- package/src/lib/components/shared/LeftPanel.tsx +0 -65
- package/src/lib/components/shared/NavigationContext.ts +0 -64
- package/src/lib/components/shared/NavigationProvider.tsx +0 -400
- package/src/lib/components/shared/OpenGraphImage.tsx +0 -75
- package/src/lib/components/shared/PassageSkeleton.tsx +0 -10
- package/src/lib/components/shared/ReaderSearchButton.tsx +0 -110
- package/src/lib/components/shared/RestrictionWarning.tsx +0 -177
- package/src/lib/components/shared/SearchReplacePanel.tsx +0 -259
- package/src/lib/components/shared/SourceReader.tsx +0 -92
- package/src/lib/components/shared/SuggestRevisionForm.tsx +0 -99
- package/src/lib/components/shared/TableOfContents.tsx +0 -293
- package/src/lib/components/shared/ThreeColumnRenderer.tsx +0 -61
- package/src/lib/components/shared/TranslationHeader.tsx +0 -25
- package/src/lib/components/shared/TranslationHoverCard.tsx +0 -84
- package/src/lib/components/shared/TranslationSkeleton.tsx +0 -16
- package/src/lib/components/shared/TranslationTable.tsx +0 -155
- package/src/lib/components/shared/bibliography/BibliographyBody.tsx +0 -28
- package/src/lib/components/shared/bibliography/BibliographyList.tsx +0 -63
- package/src/lib/components/shared/generate-metadata.ts +0 -44
- package/src/lib/components/shared/glossary/GlossaryInstanceBody.tsx +0 -154
- package/src/lib/components/shared/glossary/GlossaryPaginationProvider.tsx +0 -278
- package/src/lib/components/shared/glossary/GlossarySkeleton.tsx +0 -19
- package/src/lib/components/shared/glossary/GlossaryTermList.tsx +0 -57
- package/src/lib/components/shared/hooks/useGlossaryInstanceListener.tsx +0 -42
- package/src/lib/components/shared/hooks/usePaginationLoadTriggers.spec.tsx +0 -158
- package/src/lib/components/shared/hooks/usePaginationLoadTriggers.ts +0 -129
- package/src/lib/components/shared/hooks/useScrollInTab.tsx +0 -43
- package/src/lib/components/shared/hooks/useScrollPositionRestore.ts +0 -274
- package/src/lib/components/shared/hooks/useTohToggle.tsx +0 -52
- package/src/lib/components/shared/titles/FramedCard.tsx +0 -132
- package/src/lib/components/shared/titles/LongTitle.tsx +0 -20
- package/src/lib/components/shared/titles/LongTitles.tsx +0 -28
- package/src/lib/components/shared/titles/Title.tsx +0 -54
- package/src/lib/components/shared/titles/TitleDetails.tsx +0 -47
- package/src/lib/components/shared/titles/TitleForm.tsx +0 -37
- package/src/lib/components/shared/titles/Titles.tsx +0 -125
- package/src/lib/components/shared/titles/TitlesCard.tsx +0 -113
- package/src/lib/components/shared/types.ts +0 -79
- package/src/lib/exporters/abbreviation.spec.ts +0 -31
- package/src/lib/exporters/abbreviation.ts +0 -22
- package/src/lib/exporters/annotation.ts +0 -193
- package/src/lib/exporters/audio.spec.ts +0 -77
- package/src/lib/exporters/audio.ts +0 -27
- package/src/lib/exporters/blockquote.spec.ts +0 -48
- package/src/lib/exporters/blockquote.ts +0 -24
- package/src/lib/exporters/code.spec.ts +0 -93
- package/src/lib/exporters/code.ts +0 -26
- package/src/lib/exporters/end-note-link.spec.ts +0 -104
- package/src/lib/exporters/end-note-link.ts +0 -35
- package/src/lib/exporters/export.ts +0 -12
- package/src/lib/exporters/glossary-instance.spec.ts +0 -85
- package/src/lib/exporters/glossary-instance.ts +0 -31
- package/src/lib/exporters/has-abbreviation.spec.ts +0 -31
- package/src/lib/exporters/has-abbreviation.ts +0 -21
- package/src/lib/exporters/heading.spec.ts +0 -80
- package/src/lib/exporters/heading.ts +0 -28
- package/src/lib/exporters/image.spec.ts +0 -48
- package/src/lib/exporters/image.ts +0 -25
- package/src/lib/exporters/indent.spec.ts +0 -58
- package/src/lib/exporters/indent.ts +0 -18
- package/src/lib/exporters/internal-link.spec.ts +0 -90
- package/src/lib/exporters/internal-link.ts +0 -35
- package/src/lib/exporters/italic.spec.ts +0 -84
- package/src/lib/exporters/italic.ts +0 -55
- package/src/lib/exporters/leading-space.spec.ts +0 -28
- package/src/lib/exporters/leading-space.ts +0 -16
- package/src/lib/exporters/line-group.spec.ts +0 -48
- package/src/lib/exporters/line-group.ts +0 -24
- package/src/lib/exporters/line.spec.ts +0 -48
- package/src/lib/exporters/line.ts +0 -24
- package/src/lib/exporters/link.spec.ts +0 -123
- package/src/lib/exporters/link.ts +0 -67
- package/src/lib/exporters/list-item.spec.ts +0 -48
- package/src/lib/exporters/list-item.ts +0 -24
- package/src/lib/exporters/list.spec.ts +0 -82
- package/src/lib/exporters/list.ts +0 -31
- package/src/lib/exporters/mantra.spec.ts +0 -51
- package/src/lib/exporters/mantra.ts +0 -25
- package/src/lib/exporters/mention.ts +0 -41
- package/src/lib/exporters/paragraph.spec.ts +0 -173
- package/src/lib/exporters/paragraph.ts +0 -32
- package/src/lib/exporters/quote.spec.ts +0 -56
- package/src/lib/exporters/quote.ts +0 -25
- package/src/lib/exporters/span.spec.ts +0 -118
- package/src/lib/exporters/span.ts +0 -44
- package/src/lib/exporters/table-body-data.spec.ts +0 -48
- package/src/lib/exporters/table-body-data.ts +0 -24
- package/src/lib/exporters/table-body-header.spec.ts +0 -48
- package/src/lib/exporters/table-body-header.ts +0 -24
- package/src/lib/exporters/table-body-row.spec.ts +0 -48
- package/src/lib/exporters/table-body-row.ts +0 -24
- package/src/lib/exporters/table.spec.ts +0 -48
- package/src/lib/exporters/table.ts +0 -24
- package/src/lib/exporters/trailer.spec.ts +0 -48
- package/src/lib/exporters/trailer.ts +0 -24
- package/src/lib/exporters/util.ts +0 -62
- package/src/lib/passage.ts +0 -182
- package/src/lib/titles.ts +0 -80
- package/src/lib/transformers/abbreviation.spec.ts +0 -87
- package/src/lib/transformers/abbreviation.ts +0 -30
- package/src/lib/transformers/annotate.ts +0 -146
- package/src/lib/transformers/audio.spec.ts +0 -55
- package/src/lib/transformers/audio.ts +0 -29
- package/src/lib/transformers/blockquote.spec.ts +0 -48
- package/src/lib/transformers/blockquote.ts +0 -41
- package/src/lib/transformers/code.spec.ts +0 -52
- package/src/lib/transformers/code.ts +0 -22
- package/src/lib/transformers/deprecated.ts +0 -7
- package/src/lib/transformers/end-note-link.spec.ts +0 -56
- package/src/lib/transformers/end-note-link.ts +0 -76
- package/src/lib/transformers/glossary-instance.spec.ts +0 -55
- package/src/lib/transformers/glossary-instance.ts +0 -40
- package/src/lib/transformers/has-abbreviation.spec.ts +0 -50
- package/src/lib/transformers/has-abbreviation.ts +0 -35
- package/src/lib/transformers/heading.spec.ts +0 -62
- package/src/lib/transformers/heading.ts +0 -30
- package/src/lib/transformers/image.spec.ts +0 -51
- package/src/lib/transformers/image.ts +0 -28
- package/src/lib/transformers/indent.spec.ts +0 -53
- package/src/lib/transformers/indent.ts +0 -17
- package/src/lib/transformers/inline-title.spec.ts +0 -59
- package/src/lib/transformers/inline-title.ts +0 -34
- package/src/lib/transformers/internal-link.spec.ts +0 -67
- package/src/lib/transformers/internal-link.ts +0 -65
- package/src/lib/transformers/italic.ts +0 -22
- package/src/lib/transformers/leading-space.spec.ts +0 -55
- package/src/lib/transformers/leading-space.ts +0 -17
- package/src/lib/transformers/line-group.spec.ts +0 -48
- package/src/lib/transformers/line-group.ts +0 -37
- package/src/lib/transformers/line.spec.ts +0 -54
- package/src/lib/transformers/line.ts +0 -27
- package/src/lib/transformers/link.spec.ts +0 -61
- package/src/lib/transformers/link.ts +0 -27
- package/src/lib/transformers/list-item.spec.ts +0 -48
- package/src/lib/transformers/list-item.ts +0 -37
- package/src/lib/transformers/list.spec.ts +0 -58
- package/src/lib/transformers/list.ts +0 -42
- package/src/lib/transformers/mantra.spec.ts +0 -58
- package/src/lib/transformers/mantra.ts +0 -28
- package/src/lib/transformers/mention.ts +0 -70
- package/src/lib/transformers/paragraph.spec.ts +0 -46
- package/src/lib/transformers/paragraph.ts +0 -26
- package/src/lib/transformers/quote.spec.ts +0 -42
- package/src/lib/transformers/quote.ts +0 -3
- package/src/lib/transformers/quoted.ts +0 -3
- package/src/lib/transformers/recurse.ts +0 -76
- package/src/lib/transformers/reference.ts +0 -3
- package/src/lib/transformers/span.spec.ts +0 -68
- package/src/lib/transformers/span.ts +0 -78
- package/src/lib/transformers/split-at.ts +0 -58
- package/src/lib/transformers/split-block.ts +0 -110
- package/src/lib/transformers/split-content.ts +0 -67
- package/src/lib/transformers/split-insert.ts +0 -76
- package/src/lib/transformers/split-marks.ts +0 -42
- package/src/lib/transformers/split-node.ts +0 -138
- package/src/lib/transformers/table-body-data.spec.ts +0 -44
- package/src/lib/transformers/table-body-data.ts +0 -29
- package/src/lib/transformers/table-body-header.spec.ts +0 -44
- package/src/lib/transformers/table-body-header.ts +0 -29
- package/src/lib/transformers/table-body-row.spec.ts +0 -44
- package/src/lib/transformers/table-body-row.ts +0 -29
- package/src/lib/transformers/table.spec.ts +0 -47
- package/src/lib/transformers/table.ts +0 -29
- package/src/lib/transformers/trailer.spec.ts +0 -43
- package/src/lib/transformers/trailer.ts +0 -26
- package/src/lib/transformers/transformer.ts +0 -25
- package/src/lib/transformers/unknown.ts +0 -8
- package/src/lib/transformers/util.ts +0 -20
- package/src/lib/types.ts +0 -10
- package/tsconfig.json +0 -20
- package/tsconfig.lib.json +0 -29
- package/tsconfig.spec.json +0 -22
- /package/{src/index.ts → index.d.ts} +0 -0
- /package/{src/lib/components/editor/extensions/InternalLink/index.ts → lib/components/editor/extensions/InternalLink/index.d.ts} +0 -0
- /package/{src/lib/components/editor/extensions/Link/index.ts → lib/components/editor/extensions/Link/index.d.ts} +0 -0
- /package/{src/lib/components/editor/extensions/Passage/index.ts → lib/components/editor/extensions/Passage/index.d.ts} +0 -0
- /package/{src/lib/components/editor/hooks/index.ts → lib/components/editor/hooks/index.d.ts} +0 -0
- /package/{src/lib/components/editor/index.ts → lib/components/editor/index.d.ts} +0 -0
- /package/{src/lib/components/editor/menus/index.ts → lib/components/editor/menus/index.d.ts} +0 -0
- /package/{src/lib/components/editor/menus/selectors/index.ts → lib/components/editor/menus/selectors/index.d.ts} +0 -0
- /package/{src/lib/components/index.ts → lib/components/index.d.ts} +0 -0
- /package/{src/lib/components/reader/index.ts → lib/components/reader/index.d.ts} +0 -0
- /package/{src/lib/components/reader/ssr.ts → lib/components/reader/ssr.d.ts} +0 -0
- /package/{src/lib/components/shared/bibliography/index.ts → lib/components/shared/bibliography/index.d.ts} +0 -0
- /package/{src/lib/components/shared/glossary/index.ts → lib/components/shared/glossary/index.d.ts} +0 -0
- /package/{src/lib/components/shared/index.ts → lib/components/shared/index.d.ts} +0 -0
- /package/{src/lib/components/shared/ssr.ts → lib/components/shared/ssr.d.ts} +0 -0
- /package/{src/lib/components/shared/titles/index.ts → lib/components/shared/titles/index.d.ts} +0 -0
- /package/{src/lib/components/ssr.ts → lib/components/ssr.d.ts} +0 -0
- /package/{src/lib/exporters/index.ts → lib/exporters/index.d.ts} +0 -0
- /package/{src/lib/transformers/index.ts → lib/transformers/index.d.ts} +0 -0
- /package/{src/ssr.ts → ssr.d.ts} +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { AnnotationType } from '@eightyfourthousand/data-access';
|
|
2
|
-
import { TransformationContextWithCallback, Transformer } from './transformer';
|
|
3
|
-
import { TranslationEditorContentItem } from '../components';
|
|
4
|
-
|
|
5
|
-
export const recurse: Transformer = (ctx) => {
|
|
6
|
-
if (trasformOnMatch(ctx)) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { block } = ctx;
|
|
11
|
-
for (const child of block.content || []) {
|
|
12
|
-
if (trasformOnMatch({ ...ctx, parent: block, block: child })) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
recurse({
|
|
17
|
-
...ctx,
|
|
18
|
-
parent: block,
|
|
19
|
-
block: child,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const trasformOnMatch = (ctx: TransformationContextWithCallback) => {
|
|
25
|
-
const { block, annotation, until = [], transform } = ctx;
|
|
26
|
-
const type = block.type || 'unknown';
|
|
27
|
-
if (
|
|
28
|
-
block.attrs?.uuid !== annotation.uuid &&
|
|
29
|
-
block.attrs?.start <= annotation.start &&
|
|
30
|
-
block.attrs?.end >= annotation.end &&
|
|
31
|
-
(!until.length || until.includes(type as AnnotationType))
|
|
32
|
-
) {
|
|
33
|
-
transform?.(ctx);
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return false;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const recurseForType = ({
|
|
41
|
-
block,
|
|
42
|
-
until,
|
|
43
|
-
}: {
|
|
44
|
-
block: TranslationEditorContentItem;
|
|
45
|
-
until: AnnotationType;
|
|
46
|
-
}): TranslationEditorContentItem | undefined => {
|
|
47
|
-
if (block.type === until) {
|
|
48
|
-
return block;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
for (const child of block.content || []) {
|
|
52
|
-
const val = recurseForType({ block: child, until });
|
|
53
|
-
if (val) {
|
|
54
|
-
return val;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Recursively searches a node tree to find the first text node that has marks applied.
|
|
61
|
-
* Used in tests to verify that mark transformers (span, code, link, etc.) are working correctly.
|
|
62
|
-
*/
|
|
63
|
-
export const findTextNodeWithMarks = (
|
|
64
|
-
node: TranslationEditorContentItem,
|
|
65
|
-
): TranslationEditorContentItem | null => {
|
|
66
|
-
if (node.type === 'text' && node.marks && node.marks.length > 0) {
|
|
67
|
-
return node;
|
|
68
|
-
}
|
|
69
|
-
if (node.content) {
|
|
70
|
-
for (const child of node.content) {
|
|
71
|
-
const found = findTextNodeWithMarks(child);
|
|
72
|
-
if (found) return found;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return null;
|
|
76
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Annotation,
|
|
3
|
-
annotationsFromDTO,
|
|
4
|
-
PassageDTO,
|
|
5
|
-
passageFromDTO,
|
|
6
|
-
} from '@eightyfourthousand/data-access';
|
|
7
|
-
import { span } from './span';
|
|
8
|
-
import { blockFromPassage } from '../block';
|
|
9
|
-
import { findTextNodeWithMarks } from './recurse';
|
|
10
|
-
|
|
11
|
-
const dto: PassageDTO = {
|
|
12
|
-
sort: 1,
|
|
13
|
-
type: 'root',
|
|
14
|
-
uuid: 'passage-uuid-1234',
|
|
15
|
-
label: '',
|
|
16
|
-
xmlId: 'test-passage',
|
|
17
|
-
parent: 'test-parent',
|
|
18
|
-
content: 'Some bold text here',
|
|
19
|
-
work_uuid: 'work-uuid-5678',
|
|
20
|
-
annotations: [
|
|
21
|
-
{
|
|
22
|
-
end: 14,
|
|
23
|
-
type: 'span',
|
|
24
|
-
uuid: 'span-uuid-1',
|
|
25
|
-
start: 5,
|
|
26
|
-
content: [
|
|
27
|
-
{
|
|
28
|
-
'text-style': 'text-bold',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
passage_uuid: 'passage-uuid-1234',
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
describe('span transformer', () => {
|
|
37
|
-
const passage = passageFromDTO(
|
|
38
|
-
dto,
|
|
39
|
-
annotationsFromDTO(dto.annotations || [], dto.content.length),
|
|
40
|
-
);
|
|
41
|
-
const block = blockFromPassage(passage);
|
|
42
|
-
|
|
43
|
-
if (!block?.content) {
|
|
44
|
-
throw new Error('Block conversion failed');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
it('should transform span annotation correctly', () => {
|
|
48
|
-
const annotation = passage.annotations.find(
|
|
49
|
-
(a: Annotation) => a.type === 'span',
|
|
50
|
-
) as Annotation;
|
|
51
|
-
span({
|
|
52
|
-
root: block,
|
|
53
|
-
parent: block,
|
|
54
|
-
block,
|
|
55
|
-
annotation,
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const textNode = findTextNodeWithMarks(block);
|
|
59
|
-
expect(textNode).toBeDefined();
|
|
60
|
-
expect(textNode?.type).toBe('text');
|
|
61
|
-
expect(textNode?.marks).toBeDefined();
|
|
62
|
-
const boldMark = textNode?.marks?.find((m: any) => m.type === 'bold');
|
|
63
|
-
expect(boldMark).toBeDefined();
|
|
64
|
-
expect(boldMark?.attrs?.uuid).toBe('span-uuid-1');
|
|
65
|
-
expect(boldMark?.attrs?.textStyle).toBe('text-bold');
|
|
66
|
-
expect(textNode?.text).toBe('bold text');
|
|
67
|
-
});
|
|
68
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { ExtendedTranslationLanguage, SpanAnnotation } from '@eightyfourthousand/data-access';
|
|
2
|
-
import type { Transformer } from './transformer';
|
|
3
|
-
import { type SpanMarkType, MARK_TYPES } from '../types';
|
|
4
|
-
import { splitContent } from './split-content';
|
|
5
|
-
import { ITALIC_LANGUAGES } from './annotate';
|
|
6
|
-
import { recurse } from './recurse';
|
|
7
|
-
|
|
8
|
-
const MARK_TYPE_FOR_SPAN_TYPE: {
|
|
9
|
-
[key: string]: (
|
|
10
|
-
lang?: ExtendedTranslationLanguage,
|
|
11
|
-
) => SpanMarkType | undefined;
|
|
12
|
-
} = {
|
|
13
|
-
distinct: () => 'italic',
|
|
14
|
-
emphasis: () => 'italic',
|
|
15
|
-
foreign: (lang) => {
|
|
16
|
-
if (lang && ITALIC_LANGUAGES.includes(lang)) {
|
|
17
|
-
return 'italic';
|
|
18
|
-
}
|
|
19
|
-
return undefined;
|
|
20
|
-
},
|
|
21
|
-
'small-caps': () => 'smallCaps',
|
|
22
|
-
subscript: () => 'subscript',
|
|
23
|
-
superscript: () => 'superscript',
|
|
24
|
-
'text-bold': () => 'bold',
|
|
25
|
-
underline: () => 'underline',
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const span: Transformer = (ctx) => {
|
|
29
|
-
const { annotation } = ctx;
|
|
30
|
-
const { textStyle, lang, uuid, start, end } = annotation as SpanAnnotation;
|
|
31
|
-
if (!textStyle) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const markType = MARK_TYPES.includes(textStyle)
|
|
36
|
-
? textStyle
|
|
37
|
-
: MARK_TYPE_FOR_SPAN_TYPE[textStyle]?.(lang);
|
|
38
|
-
if (!markType) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
recurse({
|
|
43
|
-
...ctx,
|
|
44
|
-
until: ['text', 'glossaryInstance'],
|
|
45
|
-
transform: (ctx) => {
|
|
46
|
-
splitContent({
|
|
47
|
-
...ctx,
|
|
48
|
-
transform: ({ block }) => {
|
|
49
|
-
// If the block already has the mark, skip it becuase the editor
|
|
50
|
-
// doesn't like multiple marks of the same type on a single block.
|
|
51
|
-
if (block.marks?.some((m) => m.type === markType)) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
block.attrs = {
|
|
56
|
-
...block.attrs,
|
|
57
|
-
start,
|
|
58
|
-
end,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
block.marks = [
|
|
62
|
-
...(block.marks || []),
|
|
63
|
-
{
|
|
64
|
-
type: markType,
|
|
65
|
-
attrs: {
|
|
66
|
-
...block.attrs,
|
|
67
|
-
uuid,
|
|
68
|
-
type: 'span',
|
|
69
|
-
lang,
|
|
70
|
-
textStyle,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Transformer } from './transformer';
|
|
2
|
-
import { splitNode } from './split-node';
|
|
3
|
-
import type { TranslationEditorContentItem } from '../components/editor';
|
|
4
|
-
|
|
5
|
-
export const sort = (nodes: TranslationEditorContentItem[]) => {
|
|
6
|
-
return nodes.sort((a, b) => (a.attrs?.start ?? 0) - (b.attrs?.start ?? 0));
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const insert = (
|
|
10
|
-
node: TranslationEditorContentItem,
|
|
11
|
-
nodes: TranslationEditorContentItem[],
|
|
12
|
-
) => {
|
|
13
|
-
// unshift to prioritize new block when sorting
|
|
14
|
-
nodes.unshift(node);
|
|
15
|
-
return sort(nodes);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const splitContentAt: Transformer = (ctx) => {
|
|
19
|
-
const { root, parent, annotation, transform } = ctx;
|
|
20
|
-
const { start, end } = annotation;
|
|
21
|
-
|
|
22
|
-
if (start !== end) {
|
|
23
|
-
console.warn(
|
|
24
|
-
'splitContentAt: transformer expects to find an annotation with zero-length (insertion point).',
|
|
25
|
-
);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (!parent || !parent.content) {
|
|
30
|
-
console.warn(
|
|
31
|
-
'splitContentAt: transformer expects to find a parent block with content.',
|
|
32
|
-
);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const annotationEnd = end;
|
|
37
|
-
const currentContent = parent.content || [];
|
|
38
|
-
const newContent = [];
|
|
39
|
-
|
|
40
|
-
for (const item of currentContent) {
|
|
41
|
-
const { prefix, middle, suffix } = splitNode(item, start, end);
|
|
42
|
-
|
|
43
|
-
const lastPrefix = prefix.at(-1);
|
|
44
|
-
const firstSuffix = suffix[0];
|
|
45
|
-
|
|
46
|
-
if (annotationEnd === lastPrefix?.attrs?.end) {
|
|
47
|
-
transform?.({ root, parent, block: lastPrefix, annotation });
|
|
48
|
-
} else if (annotationEnd === firstSuffix?.attrs?.end) {
|
|
49
|
-
transform?.({ root, parent, block: firstSuffix, annotation });
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
newContent.push(...prefix);
|
|
53
|
-
newContent.push(...middle);
|
|
54
|
-
newContent.push(...suffix);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
parent.content = newContent;
|
|
58
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { AnnotationType } from '@eightyfourthousand/data-access';
|
|
2
|
-
import { isBlockAnnotation } from './annotate';
|
|
3
|
-
import { splitNode } from './split-node';
|
|
4
|
-
import { Transformer } from './transformer';
|
|
5
|
-
import { TranslationEditorContentItem } from '../components/editor';
|
|
6
|
-
import { filterAttrs } from './util';
|
|
7
|
-
|
|
8
|
-
export const splitBlock: Transformer = ({
|
|
9
|
-
root,
|
|
10
|
-
parent,
|
|
11
|
-
block,
|
|
12
|
-
annotation,
|
|
13
|
-
transform,
|
|
14
|
-
}) => {
|
|
15
|
-
if (!isBlockAnnotation((block.type || 'unknown') as AnnotationType)) {
|
|
16
|
-
console.warn(
|
|
17
|
-
`splitBlock transformer expects to find a block annotation, but found: ${block?.type}`,
|
|
18
|
-
);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (!parent?.content?.length) {
|
|
23
|
-
console.warn(
|
|
24
|
-
'splitBlock transformer expects to find a parent block for the block.',
|
|
25
|
-
);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const blockIndex = parent.content.findIndex(
|
|
30
|
-
(item) => item.attrs?.uuid === block.attrs?.uuid,
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
if (blockIndex === -1) {
|
|
34
|
-
console.warn(
|
|
35
|
-
'splitBlock transformer expects to find the block in its parent.',
|
|
36
|
-
);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const annStart = annotation?.start ?? 0;
|
|
41
|
-
const annEnd = annotation?.end ?? 0;
|
|
42
|
-
|
|
43
|
-
if (annStart === annEnd) {
|
|
44
|
-
console.warn(
|
|
45
|
-
'splitBlock transformer expects to find an annotation with non-zero length.',
|
|
46
|
-
);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const currentContent = block.content || [];
|
|
51
|
-
const prefixContent: typeof currentContent = [];
|
|
52
|
-
const midContent: typeof currentContent = [];
|
|
53
|
-
const suffixContent: typeof currentContent = [];
|
|
54
|
-
|
|
55
|
-
for (const item of currentContent) {
|
|
56
|
-
const { prefix, middle, suffix } = splitNode(item, annStart, annEnd);
|
|
57
|
-
prefixContent.push(...prefix);
|
|
58
|
-
midContent.push(...middle);
|
|
59
|
-
suffixContent.push(...suffix);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const attrs = filterAttrs(block.attrs);
|
|
63
|
-
const newBlocks: TranslationEditorContentItem[] = [];
|
|
64
|
-
if (prefixContent.length) {
|
|
65
|
-
newBlocks.push({
|
|
66
|
-
...block,
|
|
67
|
-
content: prefixContent,
|
|
68
|
-
attrs: {
|
|
69
|
-
...attrs,
|
|
70
|
-
start: prefixContent[0].attrs?.start ?? 0,
|
|
71
|
-
end: prefixContent[prefixContent.length - 1].attrs?.end ?? 0,
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (midContent.length) {
|
|
77
|
-
const newBlock: TranslationEditorContentItem = {
|
|
78
|
-
...block,
|
|
79
|
-
type: annotation.type,
|
|
80
|
-
content: midContent,
|
|
81
|
-
attrs: {
|
|
82
|
-
...attrs,
|
|
83
|
-
start: midContent[0].attrs?.start ?? annStart,
|
|
84
|
-
end: midContent[midContent.length - 1].attrs?.end ?? annEnd,
|
|
85
|
-
uuid: annotation.uuid,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
transform?.({
|
|
89
|
-
root,
|
|
90
|
-
parent,
|
|
91
|
-
block: newBlock,
|
|
92
|
-
annotation,
|
|
93
|
-
});
|
|
94
|
-
newBlocks.push(newBlock);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (suffixContent.length) {
|
|
98
|
-
newBlocks.push({
|
|
99
|
-
...block,
|
|
100
|
-
content: suffixContent,
|
|
101
|
-
attrs: {
|
|
102
|
-
...attrs,
|
|
103
|
-
start: suffixContent[0].attrs?.start ?? 0,
|
|
104
|
-
end: suffixContent[suffixContent.length - 1].attrs?.end ?? 0,
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
parent.content.splice(blockIndex, 1, ...newBlocks);
|
|
110
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { AnnotationType } from '@eightyfourthousand/data-access';
|
|
2
|
-
import { isInlineAnnotation } from './annotate';
|
|
3
|
-
import { Transformer } from './transformer';
|
|
4
|
-
import { splitNode } from './split-node';
|
|
5
|
-
import type { TranslationEditorContentItem } from '../components/editor';
|
|
6
|
-
import { filterAttrs } from './util';
|
|
7
|
-
|
|
8
|
-
export const splitContent: Transformer = ({
|
|
9
|
-
root,
|
|
10
|
-
parent,
|
|
11
|
-
block,
|
|
12
|
-
annotation,
|
|
13
|
-
transform,
|
|
14
|
-
}) => {
|
|
15
|
-
if (!isInlineAnnotation(block.type as AnnotationType)) {
|
|
16
|
-
console.warn(
|
|
17
|
-
`splitContent: block type expects to find an inline annotation, but found: ${block.type}.`,
|
|
18
|
-
);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (!parent || !parent.content) {
|
|
23
|
-
console.warn(
|
|
24
|
-
'splitContent: transformer expects to find a parent block with content.',
|
|
25
|
-
);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const annStartAbs = annotation.start;
|
|
30
|
-
const annEndAbs = annotation.end;
|
|
31
|
-
const currentContent = parent.content || [];
|
|
32
|
-
const newContent = [];
|
|
33
|
-
const attrs = filterAttrs(block.attrs);
|
|
34
|
-
|
|
35
|
-
for (const item of currentContent) {
|
|
36
|
-
const { prefix, middle, suffix } = splitNode(item, annStartAbs, annEndAbs);
|
|
37
|
-
|
|
38
|
-
newContent.push(...prefix);
|
|
39
|
-
// Only transform the middle segments
|
|
40
|
-
for (const midItem of middle) {
|
|
41
|
-
transform?.({
|
|
42
|
-
root,
|
|
43
|
-
parent,
|
|
44
|
-
block: midItem,
|
|
45
|
-
annotation,
|
|
46
|
-
});
|
|
47
|
-
newContent.push(midItem);
|
|
48
|
-
}
|
|
49
|
-
newContent.push(...suffix);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (annStartAbs === annEndAbs && annStartAbs === attrs?.end) {
|
|
53
|
-
const newBlock: TranslationEditorContentItem = {
|
|
54
|
-
type: annotation.type,
|
|
55
|
-
attrs: {
|
|
56
|
-
...attrs,
|
|
57
|
-
start: annStartAbs,
|
|
58
|
-
end: annEndAbs,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
transform?.({ root, parent, block: newBlock, annotation });
|
|
62
|
-
newContent.push(newBlock);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
newContent.sort((a, b) => (a.attrs?.start ?? 0) - (b.attrs?.start ?? 0));
|
|
66
|
-
parent.content = newContent;
|
|
67
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Transformer } from './transformer';
|
|
2
|
-
import { splitNode } from './split-node';
|
|
3
|
-
import type { TranslationEditorContentItem } from '../components/editor';
|
|
4
|
-
import { filterAttrs } from './util';
|
|
5
|
-
|
|
6
|
-
export const sort = (nodes: TranslationEditorContentItem[]) => {
|
|
7
|
-
return nodes.sort((a, b) => (a.attrs?.start ?? 0) - (b.attrs?.start ?? 0));
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const insert = (
|
|
11
|
-
node: TranslationEditorContentItem,
|
|
12
|
-
nodes: TranslationEditorContentItem[],
|
|
13
|
-
) => {
|
|
14
|
-
// unshift to prioritize new block when sorting
|
|
15
|
-
nodes.unshift(node);
|
|
16
|
-
return sort(nodes);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const splitAndInsert: Transformer = (ctx) => {
|
|
20
|
-
const { root, parent, block, annotation, transform } = ctx;
|
|
21
|
-
const { start, end } = annotation;
|
|
22
|
-
|
|
23
|
-
if (start !== end) {
|
|
24
|
-
console.warn(
|
|
25
|
-
'splitAndInsert: transformer expects to find an annotation with zero-length (insertion point).',
|
|
26
|
-
);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (!parent || !parent.content) {
|
|
31
|
-
console.warn(
|
|
32
|
-
'splitAndInsert: transformer expects to find a parent block with content.',
|
|
33
|
-
);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const newBlock: TranslationEditorContentItem = {
|
|
38
|
-
type: annotation.type,
|
|
39
|
-
attrs: {
|
|
40
|
-
...filterAttrs(block.attrs),
|
|
41
|
-
start,
|
|
42
|
-
end,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
transform?.({ root, parent, block: newBlock, annotation });
|
|
46
|
-
|
|
47
|
-
if (start <= block.attrs?.start || start >= block.attrs?.end) {
|
|
48
|
-
parent.content = insert(newBlock, parent.content || []);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const currentContent = parent.content || [];
|
|
53
|
-
const newContent = [];
|
|
54
|
-
|
|
55
|
-
let wasInserted = false;
|
|
56
|
-
for (const item of currentContent) {
|
|
57
|
-
const { prefix, middle, suffix } = splitNode(item, start, end);
|
|
58
|
-
|
|
59
|
-
newContent.push(...prefix);
|
|
60
|
-
for (const midItem of middle) {
|
|
61
|
-
newContent.push(midItem);
|
|
62
|
-
if (!wasInserted && midItem.attrs?.end === start) {
|
|
63
|
-
newContent.push(newBlock);
|
|
64
|
-
wasInserted = true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (!wasInserted) {
|
|
69
|
-
newContent.push(newBlock);
|
|
70
|
-
wasInserted = true;
|
|
71
|
-
}
|
|
72
|
-
newContent.push(...suffix);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
parent.content = sort(newContent);
|
|
76
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export type TranslationMark = {
|
|
2
|
-
type: string;
|
|
3
|
-
attrs?: {
|
|
4
|
-
start?: number;
|
|
5
|
-
end?: number;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const splitMarks = ({
|
|
11
|
-
marks,
|
|
12
|
-
start,
|
|
13
|
-
end,
|
|
14
|
-
}: {
|
|
15
|
-
marks?: TranslationMark[];
|
|
16
|
-
start: number;
|
|
17
|
-
end: number;
|
|
18
|
-
}) => {
|
|
19
|
-
if (!marks) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const nextMarks = marks
|
|
24
|
-
.filter(
|
|
25
|
-
(mark) =>
|
|
26
|
-
(mark.attrs?.end ?? 0) <= end && (mark.attrs?.start ?? 0) <= end,
|
|
27
|
-
)
|
|
28
|
-
.map((mark) => {
|
|
29
|
-
const markStart = Math.max(mark.attrs?.start ?? 0, start);
|
|
30
|
-
const markEnd = Math.min(mark.attrs?.end ?? 0, end);
|
|
31
|
-
return {
|
|
32
|
-
...mark,
|
|
33
|
-
attrs: {
|
|
34
|
-
...mark.attrs,
|
|
35
|
-
start: markStart,
|
|
36
|
-
end: markEnd,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
return nextMarks;
|
|
42
|
-
};
|