@eightyfourthousand/lib-editing 2026.3.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/.babelrc +12 -0
- package/.eslintrc.json +18 -0
- package/README.md +7 -0
- package/jest.config.ts +10 -0
- package/package.json +35 -0
- package/postcss.config.mjs +9 -0
- package/project.json +29 -0
- package/src/fixtures/basic/json.ts +396 -0
- package/src/fixtures/toh251/json.ts +4913 -0
- package/src/fixtures/toh251/passages.ts +2814 -0
- package/src/fixtures/types.ts +8 -0
- package/src/index.ts +4 -0
- package/src/lib/block.ts +226 -0
- package/src/lib/components/editor/BlockEditor.tsx +38 -0
- package/src/lib/components/editor/EditorBackMatterPage.tsx +95 -0
- package/src/lib/components/editor/EditorBodyPage.tsx +87 -0
- package/src/lib/components/editor/EditorHeader.tsx +22 -0
- package/src/lib/components/editor/EditorLayout.tsx +62 -0
- package/src/lib/components/editor/EditorLeftPanelPage.tsx +27 -0
- package/src/lib/components/editor/EditorProvider.tsx +399 -0
- package/src/lib/components/editor/PaginationProvider.tsx +472 -0
- package/src/lib/components/editor/TitlesBuilder.tsx +40 -0
- package/src/lib/components/editor/TranslationBuilder.tsx +171 -0
- package/src/lib/components/editor/TranslationEditor.tsx +32 -0
- package/src/lib/components/editor/extensions/Abbreviation/Abbreviation.ts +133 -0
- package/src/lib/components/editor/extensions/Audio/Audio.ts +69 -0
- package/src/lib/components/editor/extensions/Bold.ts +43 -0
- package/src/lib/components/editor/extensions/Document.ts +8 -0
- package/src/lib/components/editor/extensions/DragHandle/DragHandle.ts +429 -0
- package/src/lib/components/editor/extensions/EndNoteLink/EndNoteLink.tsx +39 -0
- package/src/lib/components/editor/extensions/EndNoteLink/EndNoteLinkHoverContent.tsx +139 -0
- package/src/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.ts +236 -0
- package/src/lib/components/editor/extensions/EndNoteLink/endnote-utils.ts +412 -0
- package/src/lib/components/editor/extensions/GlobalConfig.ts +52 -0
- package/src/lib/components/editor/extensions/GlossaryInstance/GlossaryInput.tsx +54 -0
- package/src/lib/components/editor/extensions/GlossaryInstance/GlossaryInstance.tsx +129 -0
- package/src/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.ts +148 -0
- package/src/lib/components/editor/extensions/Heading/Heading.ts +71 -0
- package/src/lib/components/editor/extensions/HoverInputField.tsx +54 -0
- package/src/lib/components/editor/extensions/Image.ts +18 -0
- package/src/lib/components/editor/extensions/Indent.ts +103 -0
- package/src/lib/components/editor/extensions/InternalLink/InternalLink.ts +173 -0
- package/src/lib/components/editor/extensions/InternalLink/InternalLinkHoverContent.tsx +137 -0
- package/src/lib/components/editor/extensions/InternalLink/InternalLinkInput.tsx +71 -0
- package/src/lib/components/editor/extensions/InternalLink/index.ts +1 -0
- package/src/lib/components/editor/extensions/Italic.ts +50 -0
- package/src/lib/components/editor/extensions/LeadingSpace.ts +106 -0
- package/src/lib/components/editor/extensions/Line/LineNode.ts +41 -0
- package/src/lib/components/editor/extensions/LineGroup/LineGroupNode.ts +124 -0
- package/src/lib/components/editor/extensions/Link/Link.ts +65 -0
- package/src/lib/components/editor/extensions/Link/LinkHoverContent.tsx +124 -0
- package/src/lib/components/editor/extensions/Link/index.ts +1 -0
- package/src/lib/components/editor/extensions/List.ts +74 -0
- package/src/lib/components/editor/extensions/Mantra/Mantra.ts +88 -0
- package/src/lib/components/editor/extensions/Mention/Mention.ts +184 -0
- package/src/lib/components/editor/extensions/Mention/MentionHoverContent.tsx +158 -0
- package/src/lib/components/editor/extensions/NodeWrapper.tsx +57 -0
- package/src/lib/components/editor/extensions/Paragraph/Paragraph.ts +25 -0
- package/src/lib/components/editor/extensions/ParagraphIndent.ts +87 -0
- package/src/lib/components/editor/extensions/Passage/EditLabel.tsx +57 -0
- package/src/lib/components/editor/extensions/Passage/EditorOptions.tsx +29 -0
- package/src/lib/components/editor/extensions/Passage/Passage.tsx +238 -0
- package/src/lib/components/editor/extensions/Passage/PassageNode.ts +223 -0
- package/src/lib/components/editor/extensions/Passage/ReaderOptions.tsx +55 -0
- package/src/lib/components/editor/extensions/Passage/ShowAnnotations.tsx +92 -0
- package/src/lib/components/editor/extensions/Passage/index.ts +1 -0
- package/src/lib/components/editor/extensions/Passage/label.spec.ts +118 -0
- package/src/lib/components/editor/extensions/Passage/label.ts +39 -0
- package/src/lib/components/editor/extensions/Placeholder.ts +9 -0
- package/src/lib/components/editor/extensions/SlashCommand/SlashCommand.ts +65 -0
- package/src/lib/components/editor/extensions/SlashCommand/SuggestionList.tsx +109 -0
- package/src/lib/components/editor/extensions/SlashCommand/Suggestions.ts +185 -0
- package/src/lib/components/editor/extensions/SmallCaps.ts +110 -0
- package/src/lib/components/editor/extensions/StarterKit.ts +36 -0
- package/src/lib/components/editor/extensions/Subscript.ts +43 -0
- package/src/lib/components/editor/extensions/Superscript.ts +43 -0
- package/src/lib/components/editor/extensions/Table.ts +32 -0
- package/src/lib/components/editor/extensions/TextAlign.ts +5 -0
- package/src/lib/components/editor/extensions/TitleMetadata.ts +40 -0
- package/src/lib/components/editor/extensions/TitleNode.ts +133 -0
- package/src/lib/components/editor/extensions/TitlesNode.ts +102 -0
- package/src/lib/components/editor/extensions/Trailer.ts +57 -0
- package/src/lib/components/editor/extensions/TranslationDocument.ts +7 -0
- package/src/lib/components/editor/extensions/TranslationMetadata.ts +58 -0
- package/src/lib/components/editor/extensions/Underline.ts +43 -0
- package/src/lib/components/editor/hooks/index.ts +4 -0
- package/src/lib/components/editor/hooks/useBlockEditor.ts +53 -0
- package/src/lib/components/editor/hooks/useDefaultExtensions.ts +39 -0
- package/src/lib/components/editor/hooks/useDirtyStore.ts +33 -0
- package/src/lib/components/editor/hooks/useTranslationExtensions.ts +148 -0
- package/src/lib/components/editor/index.ts +10 -0
- package/src/lib/components/editor/menus/EmptyBubbleMenu.tsx +42 -0
- package/src/lib/components/editor/menus/MainBubbleMenu.tsx +51 -0
- package/src/lib/components/editor/menus/TranslationBubbleMenu.tsx +57 -0
- package/src/lib/components/editor/menus/index.ts +3 -0
- package/src/lib/components/editor/menus/selectors/EndNoteSelector.tsx +388 -0
- package/src/lib/components/editor/menus/selectors/GlossarySelector.tsx +63 -0
- package/src/lib/components/editor/menus/selectors/LinkSelector.tsx +68 -0
- package/src/lib/components/editor/menus/selectors/MantraSelector.tsx +119 -0
- package/src/lib/components/editor/menus/selectors/NodeSelector.tsx +144 -0
- package/src/lib/components/editor/menus/selectors/ParagraphButtons.tsx +68 -0
- package/src/lib/components/editor/menus/selectors/SelectorInputField.tsx +68 -0
- package/src/lib/components/editor/menus/selectors/TextAlignSelector.tsx +89 -0
- package/src/lib/components/editor/menus/selectors/TextButtons.tsx +89 -0
- package/src/lib/components/editor/menus/selectors/TranslationNodeSelector.tsx +143 -0
- package/src/lib/components/editor/menus/selectors/TranslationTextButtons.tsx +125 -0
- package/src/lib/components/editor/menus/selectors/index.ts +5 -0
- package/src/lib/components/editor/save-filter.spec.ts +94 -0
- package/src/lib/components/editor/save-filter.ts +27 -0
- package/src/lib/components/editor/util.ts +304 -0
- package/src/lib/components/index.ts +3 -0
- package/src/lib/components/reader/ReaderBackMatterPage.tsx +62 -0
- package/src/lib/components/reader/ReaderBackMatterPanel.tsx +53 -0
- package/src/lib/components/reader/ReaderBodyPage.tsx +46 -0
- package/src/lib/components/reader/ReaderBodyPanel.tsx +68 -0
- package/src/lib/components/reader/ReaderLayout.tsx +39 -0
- package/src/lib/components/reader/ReaderLeftPanel.tsx +8 -0
- package/src/lib/components/reader/ReaderLeftPanelPage.tsx +31 -0
- package/src/lib/components/reader/TranslationReader.tsx +28 -0
- package/src/lib/components/reader/index.ts +2 -0
- package/src/lib/components/reader/ssr.ts +3 -0
- package/src/lib/components/shared/AiSummarizerPage.tsx +12 -0
- package/src/lib/components/shared/BackMatterPanel.tsx +143 -0
- package/src/lib/components/shared/BodyPanel.tsx +214 -0
- package/src/lib/components/shared/HoverCardProvider.tsx +407 -0
- package/src/lib/components/shared/Imprint.tsx +24 -0
- package/src/lib/components/shared/LabeledElement.tsx +133 -0
- package/src/lib/components/shared/LeftPanel.tsx +65 -0
- package/src/lib/components/shared/NavigationContext.ts +64 -0
- package/src/lib/components/shared/NavigationProvider.tsx +368 -0
- package/src/lib/components/shared/OpenGraphImage.tsx +75 -0
- package/src/lib/components/shared/PassageSkeleton.tsx +10 -0
- package/src/lib/components/shared/RestrictionWarning.tsx +177 -0
- package/src/lib/components/shared/SourceReader.tsx +83 -0
- package/src/lib/components/shared/SuggestRevisionForm.tsx +99 -0
- package/src/lib/components/shared/TableOfContents.tsx +280 -0
- package/src/lib/components/shared/ThreeColumnRenderer.tsx +54 -0
- package/src/lib/components/shared/TranslationHeader.tsx +86 -0
- package/src/lib/components/shared/TranslationHoverCard.tsx +84 -0
- package/src/lib/components/shared/TranslationSkeleton.tsx +16 -0
- package/src/lib/components/shared/TranslationTable.tsx +155 -0
- package/src/lib/components/shared/bibliography/BibliographyBody.tsx +28 -0
- package/src/lib/components/shared/bibliography/BibliographyList.tsx +63 -0
- package/src/lib/components/shared/bibliography/index.ts +1 -0
- package/src/lib/components/shared/generate-metadata.ts +44 -0
- package/src/lib/components/shared/glossary/GlossaryInstanceBody.tsx +144 -0
- package/src/lib/components/shared/glossary/GlossaryPaginationProvider.tsx +317 -0
- package/src/lib/components/shared/glossary/GlossarySkeleton.tsx +19 -0
- package/src/lib/components/shared/glossary/GlossaryTermList.tsx +58 -0
- package/src/lib/components/shared/glossary/index.ts +3 -0
- package/src/lib/components/shared/hooks/useGlossaryInstanceListener.tsx +42 -0
- package/src/lib/components/shared/hooks/useScrollInTab.tsx +43 -0
- package/src/lib/components/shared/hooks/useScrollPositionRestore.ts +274 -0
- package/src/lib/components/shared/hooks/useTohToggle.tsx +52 -0
- package/src/lib/components/shared/index.ts +11 -0
- package/src/lib/components/shared/ssr.ts +2 -0
- package/src/lib/components/shared/titles/FramedCard.tsx +132 -0
- package/src/lib/components/shared/titles/LongTitle.tsx +20 -0
- package/src/lib/components/shared/titles/LongTitles.tsx +28 -0
- package/src/lib/components/shared/titles/Title.tsx +54 -0
- package/src/lib/components/shared/titles/TitleDetails.tsx +47 -0
- package/src/lib/components/shared/titles/TitleForm.tsx +37 -0
- package/src/lib/components/shared/titles/Titles.tsx +114 -0
- package/src/lib/components/shared/titles/TitlesCard.tsx +113 -0
- package/src/lib/components/shared/titles/index.ts +8 -0
- package/src/lib/components/shared/types.ts +79 -0
- package/src/lib/components/ssr.ts +2 -0
- package/src/lib/exporters/abbreviation.spec.ts +31 -0
- package/src/lib/exporters/abbreviation.ts +22 -0
- package/src/lib/exporters/annotation.ts +193 -0
- package/src/lib/exporters/audio.spec.ts +77 -0
- package/src/lib/exporters/audio.ts +27 -0
- package/src/lib/exporters/blockquote.spec.ts +48 -0
- package/src/lib/exporters/blockquote.ts +24 -0
- package/src/lib/exporters/code.spec.ts +93 -0
- package/src/lib/exporters/code.ts +26 -0
- package/src/lib/exporters/end-note-link.spec.ts +104 -0
- package/src/lib/exporters/end-note-link.ts +35 -0
- package/src/lib/exporters/export.ts +12 -0
- package/src/lib/exporters/glossary-instance.spec.ts +85 -0
- package/src/lib/exporters/glossary-instance.ts +31 -0
- package/src/lib/exporters/has-abbreviation.spec.ts +31 -0
- package/src/lib/exporters/has-abbreviation.ts +21 -0
- package/src/lib/exporters/heading.spec.ts +80 -0
- package/src/lib/exporters/heading.ts +28 -0
- package/src/lib/exporters/image.spec.ts +48 -0
- package/src/lib/exporters/image.ts +25 -0
- package/src/lib/exporters/indent.spec.ts +58 -0
- package/src/lib/exporters/indent.ts +18 -0
- package/src/lib/exporters/index.ts +1 -0
- package/src/lib/exporters/internal-link.spec.ts +90 -0
- package/src/lib/exporters/internal-link.ts +35 -0
- package/src/lib/exporters/italic.spec.ts +84 -0
- package/src/lib/exporters/italic.ts +55 -0
- package/src/lib/exporters/leading-space.spec.ts +28 -0
- package/src/lib/exporters/leading-space.ts +16 -0
- package/src/lib/exporters/line-group.spec.ts +48 -0
- package/src/lib/exporters/line-group.ts +24 -0
- package/src/lib/exporters/line.spec.ts +48 -0
- package/src/lib/exporters/line.ts +24 -0
- package/src/lib/exporters/link.spec.ts +123 -0
- package/src/lib/exporters/link.ts +67 -0
- package/src/lib/exporters/list-item.spec.ts +48 -0
- package/src/lib/exporters/list-item.ts +24 -0
- package/src/lib/exporters/list.spec.ts +82 -0
- package/src/lib/exporters/list.ts +31 -0
- package/src/lib/exporters/mantra.spec.ts +51 -0
- package/src/lib/exporters/mantra.ts +25 -0
- package/src/lib/exporters/mention.ts +41 -0
- package/src/lib/exporters/paragraph.spec.ts +173 -0
- package/src/lib/exporters/paragraph.ts +32 -0
- package/src/lib/exporters/quote.spec.ts +56 -0
- package/src/lib/exporters/quote.ts +25 -0
- package/src/lib/exporters/span.spec.ts +118 -0
- package/src/lib/exporters/span.ts +44 -0
- package/src/lib/exporters/table-body-data.spec.ts +48 -0
- package/src/lib/exporters/table-body-data.ts +24 -0
- package/src/lib/exporters/table-body-header.spec.ts +48 -0
- package/src/lib/exporters/table-body-header.ts +24 -0
- package/src/lib/exporters/table-body-row.spec.ts +48 -0
- package/src/lib/exporters/table-body-row.ts +24 -0
- package/src/lib/exporters/table.spec.ts +48 -0
- package/src/lib/exporters/table.ts +24 -0
- package/src/lib/exporters/trailer.spec.ts +48 -0
- package/src/lib/exporters/trailer.ts +24 -0
- package/src/lib/exporters/util.ts +62 -0
- package/src/lib/passage.ts +182 -0
- package/src/lib/titles.ts +80 -0
- package/src/lib/transformers/abbreviation.spec.ts +87 -0
- package/src/lib/transformers/abbreviation.ts +30 -0
- package/src/lib/transformers/annotate.ts +146 -0
- package/src/lib/transformers/audio.spec.ts +55 -0
- package/src/lib/transformers/audio.ts +29 -0
- package/src/lib/transformers/blockquote.spec.ts +48 -0
- package/src/lib/transformers/blockquote.ts +41 -0
- package/src/lib/transformers/code.spec.ts +52 -0
- package/src/lib/transformers/code.ts +22 -0
- package/src/lib/transformers/deprecated.ts +7 -0
- package/src/lib/transformers/end-note-link.spec.ts +56 -0
- package/src/lib/transformers/end-note-link.ts +76 -0
- package/src/lib/transformers/glossary-instance.spec.ts +55 -0
- package/src/lib/transformers/glossary-instance.ts +40 -0
- package/src/lib/transformers/has-abbreviation.spec.ts +50 -0
- package/src/lib/transformers/has-abbreviation.ts +30 -0
- package/src/lib/transformers/heading.spec.ts +62 -0
- package/src/lib/transformers/heading.ts +30 -0
- package/src/lib/transformers/image.spec.ts +51 -0
- package/src/lib/transformers/image.ts +28 -0
- package/src/lib/transformers/indent.spec.ts +53 -0
- package/src/lib/transformers/indent.ts +17 -0
- package/src/lib/transformers/index.ts +33 -0
- package/src/lib/transformers/inline-title.spec.ts +59 -0
- package/src/lib/transformers/inline-title.ts +34 -0
- package/src/lib/transformers/internal-link.spec.ts +67 -0
- package/src/lib/transformers/internal-link.ts +65 -0
- package/src/lib/transformers/italic.ts +22 -0
- package/src/lib/transformers/leading-space.spec.ts +55 -0
- package/src/lib/transformers/leading-space.ts +17 -0
- package/src/lib/transformers/line-group.spec.ts +48 -0
- package/src/lib/transformers/line-group.ts +37 -0
- package/src/lib/transformers/line.spec.ts +54 -0
- package/src/lib/transformers/line.ts +27 -0
- package/src/lib/transformers/link.spec.ts +61 -0
- package/src/lib/transformers/link.ts +27 -0
- package/src/lib/transformers/list-item.spec.ts +48 -0
- package/src/lib/transformers/list-item.ts +37 -0
- package/src/lib/transformers/list.spec.ts +58 -0
- package/src/lib/transformers/list.ts +42 -0
- package/src/lib/transformers/mantra.spec.ts +58 -0
- package/src/lib/transformers/mantra.ts +28 -0
- package/src/lib/transformers/mention.ts +70 -0
- package/src/lib/transformers/paragraph.spec.ts +46 -0
- package/src/lib/transformers/paragraph.ts +26 -0
- package/src/lib/transformers/quote.spec.ts +42 -0
- package/src/lib/transformers/quote.ts +3 -0
- package/src/lib/transformers/quoted.ts +3 -0
- package/src/lib/transformers/recurse.ts +76 -0
- package/src/lib/transformers/reference.ts +3 -0
- package/src/lib/transformers/span.spec.ts +68 -0
- package/src/lib/transformers/span.ts +78 -0
- package/src/lib/transformers/split-at.ts +58 -0
- package/src/lib/transformers/split-block.ts +110 -0
- package/src/lib/transformers/split-content.ts +67 -0
- package/src/lib/transformers/split-insert.ts +76 -0
- package/src/lib/transformers/split-marks.ts +42 -0
- package/src/lib/transformers/split-node.ts +138 -0
- package/src/lib/transformers/table-body-data.spec.ts +44 -0
- package/src/lib/transformers/table-body-data.ts +29 -0
- package/src/lib/transformers/table-body-header.spec.ts +44 -0
- package/src/lib/transformers/table-body-header.ts +29 -0
- package/src/lib/transformers/table-body-row.spec.ts +44 -0
- package/src/lib/transformers/table-body-row.ts +29 -0
- package/src/lib/transformers/table.spec.ts +47 -0
- package/src/lib/transformers/table.ts +29 -0
- package/src/lib/transformers/trailer.spec.ts +43 -0
- package/src/lib/transformers/trailer.ts +26 -0
- package/src/lib/transformers/transformer.ts +25 -0
- package/src/lib/transformers/unknown.ts +8 -0
- package/src/lib/transformers/util.ts +20 -0
- package/src/lib/types.ts +10 -0
- package/src/ssr.ts +1 -0
- package/tsconfig.json +20 -0
- package/tsconfig.lib.json +29 -0
- package/tsconfig.spec.json +22 -0
package/.babelrc
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*", "storybook-static"],
|
|
4
|
+
"overrides": [
|
|
5
|
+
{
|
|
6
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
+
"rules": {}
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"files": ["*.ts", "*.tsx"],
|
|
11
|
+
"rules": {}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"files": ["*.js", "*.jsx"],
|
|
15
|
+
"rules": {}
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/README.md
ADDED
package/jest.config.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
displayName: 'lib-editing',
|
|
3
|
+
preset: '../../jest.preset.js',
|
|
4
|
+
transform: {
|
|
5
|
+
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
|
|
6
|
+
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
|
|
7
|
+
},
|
|
8
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
9
|
+
coverageDirectory: '../../coverage/libs/lib-editing',
|
|
10
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eightyfourthousand/lib-editing",
|
|
3
|
+
"version": "2026.3.0",
|
|
4
|
+
"description": "Shared editing and reader components for 84000 translation workflows.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/84000/84000-apps.git",
|
|
9
|
+
"directory": "libs/lib-editing"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/84000/84000-apps",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/84000/84000-apps/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@eightyfourthousand/client-graphql": "^2026.3.0",
|
|
21
|
+
"@eightyfourthousand/data-access": "^2026.3.0",
|
|
22
|
+
"@eightyfourthousand/design-system": "^2026.3.0",
|
|
23
|
+
"@eightyfourthousand/lib-instr": "^2026.3.0",
|
|
24
|
+
"@eightyfourthousand/lib-search": "^2026.3.0",
|
|
25
|
+
"@eightyfourthousand/lib-utils": "^2026.3.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"next": "^16.0.0",
|
|
29
|
+
"react": "^19.0.0",
|
|
30
|
+
"react-dom": "^19.0.0"
|
|
31
|
+
},
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"keywords": [],
|
|
34
|
+
"author": ""
|
|
35
|
+
}
|
package/project.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lib-editing",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "libs/lib-editing/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@nx/js:tsc",
|
|
10
|
+
"outputs": ["{options.outputPath}"],
|
|
11
|
+
"options": {
|
|
12
|
+
"outputPath": "dist/libs/lib-editing",
|
|
13
|
+
"main": "libs/lib-editing/src/index.ts",
|
|
14
|
+
"tsConfig": "libs/lib-editing/tsconfig.lib.json",
|
|
15
|
+
"rootDir": "libs/lib-editing/src",
|
|
16
|
+
"generateExportsField": true,
|
|
17
|
+
"additionalEntryPoints": ["libs/lib-editing/src/ssr.ts"]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"test": {
|
|
21
|
+
"executor": "@nx/jest:jest",
|
|
22
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
23
|
+
"options": {
|
|
24
|
+
"jestConfig": "libs/lib-editing/jest.config.ts",
|
|
25
|
+
"passWithNoTests": true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { TranslationEditorContent } from '../../lib/components';
|
|
2
|
+
import { EditorType } from '../types';
|
|
3
|
+
|
|
4
|
+
export const type: EditorType = 'translation';
|
|
5
|
+
|
|
6
|
+
export const content: TranslationEditorContent = [
|
|
7
|
+
{
|
|
8
|
+
attrs: {
|
|
9
|
+
uuid: '54a251d8-e074-4516-973b-b353bfe385ed',
|
|
10
|
+
class: 'passage',
|
|
11
|
+
type: 'translationHeader',
|
|
12
|
+
sort: 136,
|
|
13
|
+
label: '1.',
|
|
14
|
+
},
|
|
15
|
+
type: 'passage',
|
|
16
|
+
content: [
|
|
17
|
+
{
|
|
18
|
+
attrs: {
|
|
19
|
+
level: 2,
|
|
20
|
+
class: 'section-title',
|
|
21
|
+
},
|
|
22
|
+
type: 'heading',
|
|
23
|
+
content: [
|
|
24
|
+
{
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: 'The Translation',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
attrs: {
|
|
34
|
+
uuid: '31a821e6-9a69-4950-a32d-52645ef0fbe5',
|
|
35
|
+
class: 'passage',
|
|
36
|
+
type: 'translation',
|
|
37
|
+
sort: 141,
|
|
38
|
+
label: '1.1',
|
|
39
|
+
},
|
|
40
|
+
type: 'passage',
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: 'trailer',
|
|
44
|
+
attrs: {
|
|
45
|
+
uuid: 'some-uuid-for-trailer',
|
|
46
|
+
},
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: 'text',
|
|
50
|
+
text: 'Homage to all the buddhas and bodhisattvas!',
|
|
51
|
+
marks: [
|
|
52
|
+
{
|
|
53
|
+
type: 'endNoteLink',
|
|
54
|
+
attrs: {
|
|
55
|
+
notes: [
|
|
56
|
+
{
|
|
57
|
+
endNote: 'some-uuid-2',
|
|
58
|
+
label: '1',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
attrs: {
|
|
71
|
+
uuid: '09d19c19-a9da-450b-be90-c517f106469b',
|
|
72
|
+
class: 'passage',
|
|
73
|
+
type: 'translation',
|
|
74
|
+
sort: 146,
|
|
75
|
+
label: '1.2',
|
|
76
|
+
},
|
|
77
|
+
type: 'passage',
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: 'paragraph',
|
|
81
|
+
attrs: {
|
|
82
|
+
start: 0,
|
|
83
|
+
end: 640,
|
|
84
|
+
uuid: 'f5faeec0-ad74-4c36-aab7-a1f492694460',
|
|
85
|
+
},
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: 'text',
|
|
89
|
+
text: 'Of the other sūtras in this set, ',
|
|
90
|
+
attrs: {
|
|
91
|
+
start: 0,
|
|
92
|
+
end: 33,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: 'text',
|
|
97
|
+
text: 'The Sūtra Teaching the Four Factors ',
|
|
98
|
+
attrs: {
|
|
99
|
+
start: 33,
|
|
100
|
+
end: 69,
|
|
101
|
+
},
|
|
102
|
+
marks: [
|
|
103
|
+
{
|
|
104
|
+
type: 'italic',
|
|
105
|
+
attrs: {
|
|
106
|
+
uuid: '6e26360d-627d-4a9e-91e6-a81e2b38432a',
|
|
107
|
+
lang: 'en',
|
|
108
|
+
type: 'inlineTitle',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'text',
|
|
115
|
+
text: '(Toh 249)',
|
|
116
|
+
attrs: {
|
|
117
|
+
start: 69,
|
|
118
|
+
end: 78,
|
|
119
|
+
},
|
|
120
|
+
marks: [
|
|
121
|
+
{
|
|
122
|
+
type: 'endNoteLink',
|
|
123
|
+
attrs: {
|
|
124
|
+
notes: [
|
|
125
|
+
{
|
|
126
|
+
endNote: '2cb57e37-0798-4d57-81ae-eb25b4822a16',
|
|
127
|
+
label: '2',
|
|
128
|
+
uuid: '1b1d26bc-4f47-44c3-a6e0-f2ff94f38116',
|
|
129
|
+
start: 78,
|
|
130
|
+
end: 78,
|
|
131
|
+
location: 'end',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: 'text',
|
|
140
|
+
text: ' is concerned with the four factors necessary for the practice of confession, while ',
|
|
141
|
+
attrs: {
|
|
142
|
+
start: 78,
|
|
143
|
+
end: 162,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: 'text',
|
|
148
|
+
text: 'The Four Factors ',
|
|
149
|
+
attrs: {
|
|
150
|
+
start: 162,
|
|
151
|
+
end: 179,
|
|
152
|
+
},
|
|
153
|
+
marks: [
|
|
154
|
+
{
|
|
155
|
+
type: 'italic',
|
|
156
|
+
attrs: {
|
|
157
|
+
uuid: '159a9e7f-d8fb-46ae-8a2c-7ea20a831291',
|
|
158
|
+
lang: 'en',
|
|
159
|
+
type: 'inlineTitle',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'text',
|
|
166
|
+
text: '(Toh 250)',
|
|
167
|
+
attrs: {
|
|
168
|
+
start: 179,
|
|
169
|
+
end: 188,
|
|
170
|
+
},
|
|
171
|
+
marks: [
|
|
172
|
+
{
|
|
173
|
+
type: 'endNoteLink',
|
|
174
|
+
attrs: {
|
|
175
|
+
notes: [
|
|
176
|
+
{
|
|
177
|
+
endNote: '24ee6eb1-a9ce-4447-b1f4-b38fb8e4a426',
|
|
178
|
+
label: '3',
|
|
179
|
+
uuid: '30d3420e-b3f8-4b41-97e7-94242c6ad9a2',
|
|
180
|
+
start: 188,
|
|
181
|
+
end: 188,
|
|
182
|
+
location: 'end',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
type: 'text',
|
|
191
|
+
text: ' identifies four beliefs that a wise son of a good family should not accept as true. Two further works, ',
|
|
192
|
+
attrs: {
|
|
193
|
+
start: 188,
|
|
194
|
+
end: 292,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
type: 'text',
|
|
199
|
+
text: 'The Accomplishment of the Sets of Four Qualities: The Bodhisattvas’ Prātimokṣa ',
|
|
200
|
+
attrs: {
|
|
201
|
+
start: 292,
|
|
202
|
+
end: 371,
|
|
203
|
+
},
|
|
204
|
+
marks: [
|
|
205
|
+
{
|
|
206
|
+
type: 'italic',
|
|
207
|
+
attrs: {
|
|
208
|
+
uuid: '4681e4c3-f07f-49c2-b061-9fec15722cb2',
|
|
209
|
+
lang: 'en',
|
|
210
|
+
type: 'inlineTitle',
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
type: 'text',
|
|
217
|
+
text: '(Toh 248)',
|
|
218
|
+
attrs: {
|
|
219
|
+
start: 371,
|
|
220
|
+
end: 380,
|
|
221
|
+
},
|
|
222
|
+
marks: [
|
|
223
|
+
{
|
|
224
|
+
type: 'endNoteLink',
|
|
225
|
+
attrs: {
|
|
226
|
+
notes: [
|
|
227
|
+
{
|
|
228
|
+
endNote: '5c383b48-6d8b-4976-b8bd-1bab3f5a16d4',
|
|
229
|
+
label: '4',
|
|
230
|
+
uuid: 'badbdb97-b3e8-4dca-b31c-0a28c8432e6f',
|
|
231
|
+
start: 380,
|
|
232
|
+
end: 380,
|
|
233
|
+
location: 'end',
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
type: 'text',
|
|
242
|
+
text: ' and ',
|
|
243
|
+
attrs: {
|
|
244
|
+
start: 380,
|
|
245
|
+
end: 385,
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: 'text',
|
|
250
|
+
text: 'The Fourfold Accomplishment ',
|
|
251
|
+
attrs: {
|
|
252
|
+
start: 385,
|
|
253
|
+
end: 413,
|
|
254
|
+
},
|
|
255
|
+
marks: [
|
|
256
|
+
{
|
|
257
|
+
type: 'italic',
|
|
258
|
+
attrs: {
|
|
259
|
+
uuid: 'e085cc9f-637c-4c8c-bcb1-f62d6d47c3f3',
|
|
260
|
+
lang: 'en',
|
|
261
|
+
type: 'inlineTitle',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
type: 'text',
|
|
268
|
+
text: '(Toh 252)',
|
|
269
|
+
attrs: {
|
|
270
|
+
start: 413,
|
|
271
|
+
end: 422,
|
|
272
|
+
},
|
|
273
|
+
marks: [
|
|
274
|
+
{
|
|
275
|
+
type: 'endNoteLink',
|
|
276
|
+
attrs: {
|
|
277
|
+
notes: [
|
|
278
|
+
{
|
|
279
|
+
endNote: 'd4bb4496-9915-45e9-9b41-6f4744056d34',
|
|
280
|
+
label: '5',
|
|
281
|
+
uuid: '54c51c32-4597-4174-9e23-184521c456e3',
|
|
282
|
+
start: 422,
|
|
283
|
+
end: 422,
|
|
284
|
+
location: 'end',
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
type: 'text',
|
|
293
|
+
text: ' also concern themselves with “sets of four” (',
|
|
294
|
+
attrs: {
|
|
295
|
+
start: 422,
|
|
296
|
+
end: 468,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
type: 'text',
|
|
301
|
+
text: 'catuṣka',
|
|
302
|
+
attrs: {
|
|
303
|
+
start: 468,
|
|
304
|
+
end: 475,
|
|
305
|
+
},
|
|
306
|
+
marks: [
|
|
307
|
+
{
|
|
308
|
+
type: 'italic',
|
|
309
|
+
attrs: {
|
|
310
|
+
start: 468,
|
|
311
|
+
end: 475,
|
|
312
|
+
uuid: '66346061-42b1-46ae-844d-a04f5bb9378b',
|
|
313
|
+
type: 'span',
|
|
314
|
+
lang: 'Sa-Ltn',
|
|
315
|
+
textStyle: 'foreign',
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
type: 'text',
|
|
322
|
+
text: ', ',
|
|
323
|
+
attrs: {
|
|
324
|
+
start: 475,
|
|
325
|
+
end: 477,
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
type: 'text',
|
|
330
|
+
text: 'bzhi pa',
|
|
331
|
+
attrs: {
|
|
332
|
+
start: 477,
|
|
333
|
+
end: 484,
|
|
334
|
+
},
|
|
335
|
+
marks: [
|
|
336
|
+
{
|
|
337
|
+
type: 'italic',
|
|
338
|
+
attrs: {
|
|
339
|
+
start: 477,
|
|
340
|
+
end: 484,
|
|
341
|
+
uuid: '108a6129-2c82-4b66-8b61-8f1fd21b4986',
|
|
342
|
+
type: 'span',
|
|
343
|
+
lang: 'Bo-Ltn',
|
|
344
|
+
textStyle: 'foreign',
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
type: 'text',
|
|
351
|
+
text: '), thereby forming a larger group of five sūtras in the Degé Kangyur that lay out key elements of the practice of the path in discrete sets of four factors.',
|
|
352
|
+
attrs: {
|
|
353
|
+
start: 484,
|
|
354
|
+
end: 640,
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
],
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
type: 'paragraph',
|
|
363
|
+
attrs: {
|
|
364
|
+
hasLeadingSpace: true,
|
|
365
|
+
},
|
|
366
|
+
content: [
|
|
367
|
+
{
|
|
368
|
+
type: 'text',
|
|
369
|
+
text: '“Monks, for as long as they live, bodhisattvas, great beings, should not abandon four factors even at the cost of their lives. What are these four?',
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
type: 'lineGroup',
|
|
375
|
+
content: [
|
|
376
|
+
{
|
|
377
|
+
type: 'line',
|
|
378
|
+
content: [
|
|
379
|
+
{
|
|
380
|
+
type: 'text',
|
|
381
|
+
text: 'kiṃcij jīrṇe tu pāṣāṇe khapattraṃ sakalaṃ graset.',
|
|
382
|
+
},
|
|
383
|
+
],
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
type: 'line',
|
|
387
|
+
content: [
|
|
388
|
+
{
|
|
389
|
+
type: 'text',
|
|
390
|
+
text: 'āśīviṣaṃ ca bhūtāni sarvāṇi na viśeṣayet.',
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
},
|
|
396
|
+
];
|