From 3935d38835ae90f8aaedbfe861443c2eac27d765 Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Mon, 31 Jul 2023 19:21:08 +0530 Subject: [PATCH 01/10] v5.5.4-beta.0 --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cc920c2..3fb6dc1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "scripture-resources-rcl", "description": "A React Component Library for Rendering Scripture Resources.", - "version": "5.5.3", + "version": "5.5.4-beta.0", "homepage": "https://scripture-resources-rcl.netlify.com/", "repository": { "type": "git", @@ -35,6 +35,7 @@ "not op_mini all" ], "dependencies": { + "array-move": "^4.0.0", "bible-reference-range": "^1.1.0", "deep-freeze": "^0.0.1", "gitea-react-toolkit": "2.2.1", @@ -49,7 +50,7 @@ "use-deep-compare-effect": "^1.3.1", "usfm-js": "^3.4.2", "uw-quote-helpers": "^1.0.0", - "word-aligner": "^1.0.0", + "word-aligner": "^1.0.0", "xregexp": "^4.1.1" }, "devDependencies": { From e65bbd6eb02e4c9b6dcb4e1b8d23b04fd1cd3fef Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Tue, 1 Aug 2023 14:22:42 +0530 Subject: [PATCH 02/10] moved orginal language to 3rd position of Scripture pane --- src/components/parallel-scripture/ParallelScripture.js | 7 ++++--- src/components/parallel-scripture/ScriptureTable.js | 2 +- yarn.lock | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/parallel-scripture/ParallelScripture.js b/src/components/parallel-scripture/ParallelScripture.js index e3fe13d..a6f233d 100644 --- a/src/components/parallel-scripture/ParallelScripture.js +++ b/src/components/parallel-scripture/ParallelScripture.js @@ -7,6 +7,7 @@ import { ResourcesContext } from '../resources/Resources.context'; import { ScriptureTable } from '../../'; import { License } from '../license'; import { localString } from '../../core/localStrings'; +import {arrayMoveImmutable} from 'array-move'; function ParallelScripture({ reference, @@ -23,7 +24,7 @@ function ParallelScripture({ const { state } = React.useContext(ResourcesContext); const { resources, books } = state; - + useEffect(() => { setOpen(_open); }, [_open]); @@ -103,8 +104,8 @@ function ParallelScripture({ return ( (title && titles && books && ( Date: Mon, 28 Aug 2023 19:03:40 +0530 Subject: [PATCH 03/10] solved the highlight issue --- .../parallel-scripture/ParallelScripture.js | 10 +++++++--- .../parallel-scripture/ParallelScripture.md | 18 ++++++++++++++++-- .../parallel-scripture/ScriptureTable.js | 7 ++++--- .../parallel-scripture/ScriptureTable.md | 9 +++++++-- src/components/parallel-scripture/helpers.js | 4 ++-- src/components/resources/Resources.context.js | 2 ++ src/components/resources/useResources.js | 3 ++- 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/components/parallel-scripture/ParallelScripture.js b/src/components/parallel-scripture/ParallelScripture.js index a6f233d..eb7faaa 100644 --- a/src/components/parallel-scripture/ParallelScripture.js +++ b/src/components/parallel-scripture/ParallelScripture.js @@ -23,8 +23,11 @@ function ParallelScripture({ const [open, setOpen] = useState(_open); const { state } = React.useContext(ResourcesContext); - const { resources, books } = state; + const { resources, books, resourceLinks, ORIGINAL_LANG_POSITION } = state; + const defaultOriginalLangPostion = ORIGINAL_LANG_POSITION == true? ORIGINAL_LANG_POSITION - 1 : resourceLinks?.length - 1 // ("-1" becoz array starts from 0) + console.log({defaultOriginalLangPostion, ORIGINAL_LANG_POSITION, resourceLinks}) + useEffect(() => { setOpen(_open); }, [_open]); @@ -104,8 +107,8 @@ function ParallelScripture({ return ( (title && titles && books && ( )) || <> ); diff --git a/src/components/parallel-scripture/ParallelScripture.md b/src/components/parallel-scripture/ParallelScripture.md index 9c1f378..913bd03 100644 --- a/src/components/parallel-scripture/ParallelScripture.md +++ b/src/components/parallel-scripture/ParallelScripture.md @@ -24,6 +24,11 @@ const bookId = "tit"; const occurrence = -1; const defaultQuote = "ἐφανέρωσεν & τὸν λόγον αὐτοῦ" +// for changing the postion of resource in scripture RCL +// to display the orginal language to first ORIGINAL_LANG_POSITION to first = 1 also read line no 46 +// default "0" - orignal language will be displayed last +const ORIGINAL_LANG_POSITION = 0; + const bcvQuery = { book: { [bookId]: { @@ -38,10 +43,12 @@ const bcvQuery = { }, } const path = { ot: "hbo/uhb", nt: "el-x-koine/ugnt" }; +// To change the position of scripture resource in the panel, move the elements in different index in allResourceLinks +// eg move "originalLink" to the last index to move hebrew / greek to last const defaultResourceLinks = [ - `unfoldingWord/${path.nt}/master/${bookId}`, `unfoldingWord/en/ult/master/${bookId}`, `https://git.door43.org/unfoldingWord/en_ust/src/branch/master`, + `unfoldingWord/${path.nt}/master/${bookId}`, ]; // Usage @@ -61,6 +68,7 @@ function Component() { resources={resources} onResources={setResources} config={config} + ORIGINAL_LANG_POSITION = {ORIGINAL_LANG_POSITION} >

Quote: {quote}

Occurrence: {occurrence}

@@ -119,6 +127,11 @@ function Component({ }) { return v },{}), [verse]) + // for changing the postion of resource in scripture RCL + // to display the orginal language to first ORIGINAL_LANG_POSITION to first = 1 also read line no 46 + // default "0" - orignal language will be displayed last + const ORIGINAL_LANG_POSITION = 0; + const bcvQuery = React.useMemo(() => ({ book: { [bookId]: { @@ -134,9 +147,9 @@ function Component({ }) { const reference = React.useMemo(() => ({ bookId, chapter: Number(chapter), verse, bcvQuery }), [bookId, bcvQuery, chapter, verse]); const defaultResourceLinks = React.useMemo(() => [ - `unfoldingWord/${path[lang]}/master/${bookId}`, `unfoldingWord/en/ult/master/${bookId}`, `https://git.door43.org/unfoldingWord/en_ust/src/branch/master`, + `unfoldingWord/${path[lang]}/master/${bookId}`, ],[bookId,lang,path]); const [resourceLinks, setResourceLinks] = React.useState(defaultResourceLinks); @@ -151,6 +164,7 @@ function Component({ }) { resources={resources} onResources={setResources} config={config} + ORIGINAL_LANG_POSITION = {ORIGINAL_LANG_POSITION} > () => - _referenceIds.map((referenceId) => { - const verses = versesFromReferenceIdAndBooks({ referenceId, books }); + _referenceIds.map((referenceId) => { + const verses = versesFromReferenceIdAndBooks({ referenceId, books, defaultOriginalLangPostion}); const row = ( @@ -99,18 +102,18 @@ const occurrence=1; import {ScriptureTable} from "scripture-resources-rcl"; import usfmJS from 'usfm-js'; -import ugnt_tit from '../mocks/ugnt_tit.usfm.js'; import en_aligned_tit from '../mocks/en_aligned_tit.usfm.js'; import hi_aligned_tit from '../mocks/hi_aligned_tit.usfm.js'; import hi_tit from '../mocks/hi_tit.usfm.js'; import bhd_tit from '../mocks/bhd_tit.usfm.js'; +import ugnt_tit from '../mocks/ugnt_tit.usfm.js'; const titles = [ - 'UGNT - Greek', 'English - ULT (aligned)', 'Hindi - IRV (aligned)', 'Hindi - ULB', 'Bhadrawahi - ULB', + 'UGNT - Greek', ]; const books = [ @@ -126,6 +129,7 @@ const reference = { chapter: 1, verse: 3, }; +const defaultOriginalLangPostion = 0; const [component, setComponent] = React.useState(<>) const [quote, setQuote] = React.useState("τοῦ σωτῆρος ἡμῶν θεοῦ"); @@ -142,6 +146,7 @@ React.useEffect(() => { onQuote={setQuote} occurrence={occurrence} height='250px' + defaultOriginalLangPostion={defaultOriginalLangPostion} /> ); }, []); diff --git a/src/components/parallel-scripture/helpers.js b/src/components/parallel-scripture/helpers.js index dd575ed..918a90d 100644 --- a/src/components/parallel-scripture/helpers.js +++ b/src/components/parallel-scripture/helpers.js @@ -45,7 +45,7 @@ export const rangeFromVerseAndVerseKeys = (({ verseKeys, verseKey }) => { return range; }); -export const versesFromReferenceIdAndBooks = ({ referenceId, books }) => { +export const versesFromReferenceIdAndBooks = ({ referenceId, books, defaultOriginalLangPostion }) => { // console.log("versesFromReferenceIdAndBooks() referenceId,books=", referenceId,books) const versesData = books.map((book, index) => { const reference = referenceFromReferenceId(referenceId); @@ -89,7 +89,7 @@ export const versesFromReferenceIdAndBooks = ({ referenceId, books }) => { verseData = chapterData[range]; } - if (index === 0 && verseData && verseData.verseObjects && verseData.verseObjects.length) { + if (index === defaultOriginalLangPostion && verseData && verseData.verseObjects && verseData.verseObjects.length) { const _verseData = { ...verseData }; _verseData.verseObjects = occurrenceInjectVerseObjects(_verseData.verseObjects); verseData = _verseData; diff --git a/src/components/resources/Resources.context.js b/src/components/resources/Resources.context.js index 7ac03f3..af193e5 100644 --- a/src/components/resources/Resources.context.js +++ b/src/components/resources/Resources.context.js @@ -15,6 +15,7 @@ export function ResourcesContextProvider({ config, onResources, children, + ORIGINAL_LANG_POSITION }) { const val = useResources({ resources: resources || [], @@ -25,6 +26,7 @@ export function ResourcesContextProvider({ reference, config, onResources, + ORIGINAL_LANG_POSITION }); return ( diff --git a/src/components/resources/useResources.js b/src/components/resources/useResources.js index ea026c5..ccc9862 100644 --- a/src/components/resources/useResources.js +++ b/src/components/resources/useResources.js @@ -14,6 +14,7 @@ function useResources({ config, onResources, onResourceLinks = () => { }, + ORIGINAL_LANG_POSITION, }) { const [projectIdentifier, setProjectIdentifier] = useState(); const [usfmJsonArray, setUsfmJsonArray] = useState(); @@ -99,7 +100,7 @@ function useResources({ }, [parseUsfm, projectIdentifier]); return { - state: { resources, books }, + state: { resources, books, resourceLinks, ORIGINAL_LANG_POSITION}, actions: { addResourceLink, isDefaultResourceLink, From 6486906675e29d65aae0df1ff69927abd43d80ef Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Mon, 28 Aug 2023 19:05:11 +0530 Subject: [PATCH 04/10] v5.5.5-beta.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3fb6dc1..d86e39d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "scripture-resources-rcl", "description": "A React Component Library for Rendering Scripture Resources.", - "version": "5.5.4-beta.0", + "version": "5.5.5-beta.0", "homepage": "https://scripture-resources-rcl.netlify.com/", "repository": { "type": "git", From 153a2b2dc6de6d1ccf30eb5699407f29fb4e251a Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Mon, 28 Aug 2023 19:17:45 +0530 Subject: [PATCH 05/10] v5.5.5-beta.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d86e39d..f89fa32 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "scripture-resources-rcl", "description": "A React Component Library for Rendering Scripture Resources.", - "version": "5.5.5-beta.0", + "version": "5.5.5-beta.1", "homepage": "https://scripture-resources-rcl.netlify.com/", "repository": { "type": "git", From e3b8a440d736a119b64756c737854b5da20eccee Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Mon, 28 Aug 2023 19:25:25 +0530 Subject: [PATCH 06/10] v5.5.5-beta.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f89fa32..d83ec6d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "scripture-resources-rcl", "description": "A React Component Library for Rendering Scripture Resources.", - "version": "5.5.5-beta.1", + "version": "5.5.5-beta.2", "homepage": "https://scripture-resources-rcl.netlify.com/", "repository": { "type": "git", From f24ddd6b814f2c3ec0126c66666ffe7f388ec097 Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Mon, 28 Aug 2023 19:48:29 +0530 Subject: [PATCH 07/10] changed the codtion statement --- src/components/parallel-scripture/ParallelScripture.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/parallel-scripture/ParallelScripture.js b/src/components/parallel-scripture/ParallelScripture.js index eb7faaa..684818a 100644 --- a/src/components/parallel-scripture/ParallelScripture.js +++ b/src/components/parallel-scripture/ParallelScripture.js @@ -24,7 +24,7 @@ function ParallelScripture({ const { state } = React.useContext(ResourcesContext); const { resources, books, resourceLinks, ORIGINAL_LANG_POSITION } = state; - const defaultOriginalLangPostion = ORIGINAL_LANG_POSITION == true? ORIGINAL_LANG_POSITION - 1 : resourceLinks?.length - 1 // ("-1" becoz array starts from 0) + const defaultOriginalLangPostion = ORIGINAL_LANG_POSITION == 0 ? resourceLinks?.length - 1 : ORIGINAL_LANG_POSITION - 1 // ("-1" becoz array starts from 0) console.log({defaultOriginalLangPostion, ORIGINAL_LANG_POSITION, resourceLinks}) From 7dbc1204631c2786a4dba8bcb6b5f1ab470e5b7a Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Mon, 28 Aug 2023 20:45:29 +0530 Subject: [PATCH 08/10] cleared unwanted codes --- package.json | 1 - src/components/parallel-scripture/ParallelScripture.js | 5 ++--- src/components/parallel-scripture/ParallelScripture.md | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d83ec6d..81a4477 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "not op_mini all" ], "dependencies": { - "array-move": "^4.0.0", "bible-reference-range": "^1.1.0", "deep-freeze": "^0.0.1", "gitea-react-toolkit": "2.2.1", diff --git a/src/components/parallel-scripture/ParallelScripture.js b/src/components/parallel-scripture/ParallelScripture.js index 684818a..26a93df 100644 --- a/src/components/parallel-scripture/ParallelScripture.js +++ b/src/components/parallel-scripture/ParallelScripture.js @@ -7,7 +7,6 @@ import { ResourcesContext } from '../resources/Resources.context'; import { ScriptureTable } from '../../'; import { License } from '../license'; import { localString } from '../../core/localStrings'; -import {arrayMoveImmutable} from 'array-move'; function ParallelScripture({ reference, @@ -107,8 +106,8 @@ function ParallelScripture({ return ( (title && titles && books && ( Date: Mon, 28 Aug 2023 20:46:26 +0530 Subject: [PATCH 09/10] v5.5.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81a4477..c7c0129 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "scripture-resources-rcl", "description": "A React Component Library for Rendering Scripture Resources.", - "version": "5.5.5-beta.2", + "version": "5.5.5", "homepage": "https://scripture-resources-rcl.netlify.com/", "repository": { "type": "git", From f3d4e35aa58e0cdf31e7296c3024eb3731f5a134 Mon Sep 17 00:00:00 2001 From: Joel C Johnson Date: Mon, 28 Aug 2023 20:48:09 +0530 Subject: [PATCH 10/10] removed arrayMove --- yarn.lock | 5 ----- 1 file changed, 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index c57b4e2..176b7f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2958,11 +2958,6 @@ array-map@~0.0.0: resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.1.tgz#d1bf3cc8813a7daaa335e5c8eb21d9d06230c1a7" integrity sha512-sxHIeJTGEsRC8/hYkZzdJNNPZ41EXHVys7pqMw1iwE/Kx8/hto0UbDuGQsSJ0ujPovj9qUZl6EOY/EiZ2g3d9Q== -array-move@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/array-move/-/array-move-4.0.0.tgz#2c3730f056cc926f62a59769a5a8cda2fb6d8c55" - integrity sha512-+RY54S8OuVvg94THpneQvFRmqWdAHeqtMzgMW6JNurHxe8rsS07cHQdfGkXnTUXiBcyZ0j3SiDIxxj0RPiqCkQ== - array-reduce@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"