Skip to content

Commit

Permalink
security updatescripture-utilities
Browse files Browse the repository at this point in the history
- also use USJ `const`s in editor extension
  • Loading branch information
irahopkinson committed Nov 22, 2024
1 parent d59871d commit 3df942a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 13 deletions.
2 changes: 1 addition & 1 deletion extensions/src/legacy-comment-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"react-dom": ">=18.3.1"
},
"dependencies": {
"@biblionexus-foundation/scripture-utilities": "^0.0.4",
"@biblionexus-foundation/scripture-utilities": "^0.0.5",
"@sillsdev/scripture": "^2.0.2",
"platform-bible-utils": "file:../../../lib/platform-bible-utils"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/src/platform-scripture-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@biblionexus-foundation/platform-editor": "^0.6.5",
"@biblionexus-foundation/scripture-utilities": "^0.0.4",
"@biblionexus-foundation/scripture-utilities": "^0.0.5",
"@swc/core": "^1.7.35",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^20.16.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {
Marginal,
MarginalRef,
} from '@biblionexus-foundation/platform-editor';
import { MarkerContent, Usj } from '@biblionexus-foundation/scripture-utilities';
import {
MarkerContent,
USJ_TYPE,
USJ_VERSION,
Usj,
} from '@biblionexus-foundation/scripture-utilities';
import { Canon, VerseRef } from '@sillsdev/scripture';
import { JSX, useCallback, useEffect, useMemo, useRef } from 'react';
import type { WebViewProps } from '@papi/core';
Expand All @@ -32,7 +37,7 @@ const VERSE_NUMBER_SCROLL_OFFSET = 80;
*/
const EDITOR_LOAD_DELAY_TIME = 100;

const usjDocumentDefault: Usj = { type: 'USJ', version: '0.2.1', content: [] };
const defaultUsj: Usj = { type: USJ_TYPE, version: USJ_VERSION, content: [] };

/**
* Check deep equality of two values such that two equal objects or arrays created in two different
Expand Down Expand Up @@ -107,7 +112,7 @@ globalThis.webViewComponent = function PlatformScriptureEditor({
projectId,
).ChapterUSJ(
useMemo(() => new VerseRef(scrRef.bookNum, scrRef.chapterNum, scrRef.verseNum), [scrRef]),
usjDocumentDefault,
defaultUsj,
);

const usjSentToPdp = useRef(usjFromPdp);
Expand Down
2 changes: 1 addition & 1 deletion extensions/src/platform-scripture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"platform-bible-utils": "file:../../../lib/platform-bible-utils"
},
"devDependencies": {
"@biblionexus-foundation/scripture-utilities": "^0.0.4",
"@biblionexus-foundation/scripture-utilities": "^0.0.5",
"@swc/core": "^1.7.35",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^20.16.11",
Expand Down
49 changes: 42 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3df942a

Please sign in to comment.