Code Monkey home page Code Monkey logo

code's People

Contributors

alcarazzam avatar dependabot[bot] avatar gohabereg avatar idebenone avatar khaydarov avatar nespecc avatar polinashneider avatar robonetphy avatar talyguryn avatar tatianafomina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

code's Issues

Improve line wrapping

Don't wrap long lines: use overflow-x instead

white-space: pre;
overflow-x: auto;
word-wrap: normal;

Migrate to TypeScript

Problem

  1. This tool was built in JavaScript to be a simplest example of Editor.js Tools API usage. Right now further enhancements requires more modern stack.
  2. Importing this package in TS project leads a TS error: codex-team/editor.js#2143

Task

We need to migrate this project to TypeScript and provide type declarations. Make sure types for the plugin are available when using it in Typescript project with Editor.js

Cannot delete text with backspace or navigate with arrow keys in Firefox

When you load already saved data into the editor and there is a code-block, you cannot delete characters with backspace (with del you can), neither can you navigate with the arrow-keys inside the code-block. It simply jumps to the block above instantly (in my example a header block).

Example:

const editor = new EditorJS({  
        data: {  
        "time":1700475383740,
        "blocks":[
            {"id":"aRMoZePSTD","type":"header","data":{"text":"My title","level":2}},
            {"id":"fcG8CCR5F8","type":"code","data":{"code":"here is some code"}}
        ],
        "version":"2.28.2"
    },
    tools: {
        code: CodeTool,
        header: Header
    }
});

Versions:

  • editorjs: 2.28.2
  • code: 2.9.0
  • header: 2.8.1
  • esbuild: 0.19.6
  • Firefox: 119.0.1

Bundled with: esbuild, like this: ./node_modules/.bin/esbuild src/index.js --bundle --outfile=dist/index.js
Browser: Latest Firefox, it works in Chrome

Output format: Can the 'code' property be null omitted?

For a valid code block, can the code property under any circumstances (now or in the future) be null or omitted? Or is it guaranteed to always be present and non-null for this block to be valid?

Context: I'm a back-end .NET developer needing to parse Editor.js documents. The readme does not explicitly guarantee that code will always be present and non-null. Back-end deserialization/parsing in strongly typed languages would be easier with some guarantees about which properties can and can not be null/omitted. (Ideally, any such guarantees should be added to the readme to ensure they are formalized and kept in the future.)

Accessing data variable in class wrongly. Use _data instead of data

In class CodeTool:

Current Behaviour:
In getters and setters functions we use this._data.
Whereas in other parts like onPaste function, constructor, drawView , we are using this.data to access the data variable.

Proposed Fix:
Change this.data to this._data everywhere.

Why is this needed?
If we dont do this then when migrating to typescript we get a naming conflict error. As data() getter and data variable are of same name.

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.