appleple / appleple/smartblock

Using the image block with standard Javascript

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
318
Forks
26
Avg merge
3m
Merged PRs (30d)
11

Description

HI I'm trying to use smart block app with image upload capabilities.

I've tried the following

`

SmartBlock.Extensions.push(new SmartBlock.Image({
    imgClassName: 'img'
}));

SmartBlock.Editor('#app', {
    html: '<h2>Hello World</h2><p>hello</p>',
    extensions: SmartBlock.Extensions,
    onChange: function (result) {
        console.log(result.json, result.html);
    }
});

`

but get the following error.

RangeError: Adding different instances of a keyed plugin (plugin$1)

I can't work out what I'm doing wrong. Sorry, I can't work out the react way of doing it, so stuck with standard js.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported SmartBlock.Extensions.push and SmartBlock.Editor('#app', ...) calls, then compare this standard-JavaScript setup with the project's extension initialization guidance. Done means the Image extension initializes without the keyed-plugin RangeError and image upload works as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.