Giter Club home page Giter Club logo

usfm-editor's People

Contributors

aunger avatar dependabot[bot] avatar joelthe1 avatar kjoslyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ivanmhale

usfm-editor's Issues

Invalid USFM can yield unhelpful errors

In importing usfm-editor into a react app, there is a node path error. Am I missing something?

Imported is as follows in react project at 'C:/projects/react-app/':


function Editor() {
  const usfmString = `\\c 1
  \\v 1 This is the first verse.`;
  const setUsfmString = (editedUsfm) => {console.log(editedUsfm)};
  return (
    <UsfmEditor usfmString={usfmString} onChange={setUsfmString}></UsfmEditor>
  );
}

export default Editor;

Initial part of error message:

point
C:/projects/src/interfaces/editor.ts:903
  900 | const node = Node.get(editor, path)
  901 | 
  902 | if (!Text.isText(node)) {
> 903 |   throw new Error(
      | ^  904 |     `Cannot get the ${edge} point in the node at path [${at}] because it has no ${edge} text node.`
  905 |   )
  906 | }

USFM ID Manipulation

build tool

Next.js

Usfm Editor version

0.8.0

Reproduction repository

https://github.com/friendsofagape/autographa/blob/notification/renderer/src/components/EditorPage/UsfmEditor/UsfmEditor.js#L263

Issue Description

Some time while I navigate through books and get the output of usfm. The output usfm string has an id of the previous book and hence ends up in the wrong usfm output file for that particular book.
Surprisingly the book fetch on navigation works fine without any errors

2021-09-07.13-12-41.mp4

Infinite rendering on state update inside callbacks

build tool

Next.js

Node.js version

14.8.0

Usfm Editor version

0.8.0-SNAPSHOT.5

Reproduction repository

https://github.com/Ashersam/editor-demo/blob/master/src/App.js#L25

Issue Description

We have updated our package to the latest from 0.8.0-SNAPSHOT.2 since we have use cases of single or multiple chapters render based on screen space and toolbar separation.
I have started implementing ChapterSelect based render and wrapped it up with the withToolBar.js component.

Things are working except whenever I update the state on the following callbacks (onChange, onIdentificationChange, onVerseChange) whatever changes I do just rerenders multiple times and comes to the original loaded state, sometimes it ends in an infinite loop. And most of these things works as expected in 0.8.0-SNAPSHOT.2.

Join Verse not showing up inside nextjs application

build tool

Next.js

Usfm Editor version

0.8.0-SNAPSHOT.6

Reproduction repository

https://github.com/Ashersam/UsfmEditorNextJs/blob/main/pages/index.js

Test site

https://ashersam.github.io/UsfmEditorNextJs/

Issue Description

I see there's a joint verse feature for usfm-editor editor and works well in create-react boilerplate. But that's not happening in nextJs based application. Just getting the following prop warning on the console when we click on a verse number.

react_devtools_backend.js:2560 Warning: Failed prop type: The prop `icon` is marked as required in `JoinWithPreviousVerseButton`, but its value is `undefined`.
    at JoinWithPreviousVerseButton (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1624422465897:8531:26)
    at VerseJoinUnjoinSubmenu (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1624422465897:7757:5)
    at ul
react_devtools_backend.js:2560 Warning: Failed prop type: The prop `text` is marked as required in `JoinWithPreviousVerseButton`, but its value is `undefined`.
    at JoinWithPreviousVerseButton (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1624422465897:8531:26)
    at VerseJoinUnjoinSubmenu (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1624422465897:7757:5)
    at ul

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.