Skip to content

Commit

Permalink
update editor (#1182)
Browse files Browse the repository at this point in the history
- add `onCommentChange` & `onSelectionChange` props
- remove `onUsjChange` check no longer needed after `platform-editor` v0.6.0
  • Loading branch information
irahopkinson authored Oct 1, 2024
1 parent 9f2756a commit ed11fba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
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 @@ -35,7 +35,7 @@
"platform-bible-utils": "file:../../../lib/platform-bible-utils"
},
"devDependencies": {
"@biblionexus-foundation/platform-editor": "^0.6.2",
"@biblionexus-foundation/platform-editor": "^0.6.3",
"@biblionexus-foundation/scripture-utilities": "^0.0.4",
"@swc/core": "^1.4.11",
"@types/node": "^20.12.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ globalThis.webViewComponent = function PlatformScriptureEditor({
// TODO: remove debounce when issue #826 is done.
const onUsjChange = useCallback(
(newUsj: Usj) => {
// There is a bug where the editor's onChange runs when the state is externally set, so let's
// not run onChange if the change came externally (our tracked editorUsj.current editor state
// will already be up-to-date)
if (deepEqualAcrossIframes(newUsj, editorUsj.current)) return;

editorUsj.current = newUsj;
debouncedSetUsj(newUsj);
},
Expand Down Expand Up @@ -191,8 +186,8 @@ globalThis.webViewComponent = function PlatformScriptureEditor({
ref={editorRef}
scrRef={scrRef}
onScrRefChange={setScrRef}
options={options}
onUsjChange={isReadOnly ? undefined : onUsjChange}
options={options}
logger={logger}
/>
</>
Expand Down
16 changes: 8 additions & 8 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 ed11fba

Please sign in to comment.