Skip to content

Commit

Permalink
security updatescripture-utilities (#1332)
Browse files Browse the repository at this point in the history
- also use USJ `const`s in editor extension
  • Loading branch information
irahopkinson authored Nov 25, 2024
1 parent b114439 commit 830cca4
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 344 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
4 changes: 2 additions & 2 deletions extensions/src/platform-scripture-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"platform-bible-utils": "file:../../../lib/platform-bible-utils"
},
"devDependencies": {
"@biblionexus-foundation/platform-editor": "^0.6.5",
"@biblionexus-foundation/scripture-utilities": "^0.0.4",
"@biblionexus-foundation/platform-editor": "~0.6.6",
"@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 @@ -39,7 +39,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/jest": "^29.5.14",
Expand Down
Loading

0 comments on commit 830cca4

Please sign in to comment.