Skip to content

Commit

Permalink
update editor (#1110)
Browse files Browse the repository at this point in the history
- BREAKING renamed `onChange` property to `onUsjChange`
- BREAKING renamed `setScrRef` property to `onScrRefChange`
- no longer fires `onUsjChange` when `setUsj` is called
- add `getSelection` function
- improve README
- remove unused emoji assets
  • Loading branch information
irahopkinson authored Sep 4, 2024
1 parent f6f2c1f commit 850a33e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 17 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

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.5.3",
"@biblionexus-foundation/platform-editor": "^0.6.0",
"@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 @@ -102,7 +102,7 @@ globalThis.webViewComponent = function PlatformScriptureEditor({
const editorUsj = useRef(usj);

// TODO: remove debounce when issue #826 is done.
const onChange = useCallback(
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
Expand Down Expand Up @@ -184,9 +184,9 @@ globalThis.webViewComponent = function PlatformScriptureEditor({
<Editor
ref={editorRef}
scrRef={scrRef}
setScrRef={setScrRef}
onScrRefChange={setScrRef}
options={options}
onChange={isReadOnly ? undefined : onChange}
onUsjChange={isReadOnly ? undefined : onUsjChange}
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 850a33e

Please sign in to comment.