How do you configure EditorJS in Rails 7 with importmap and Stimulus?

I’m trying to set up EditorJS as my content editor in my Rails 7 application using importmaps but running in to a few errors.

To pin EditorJS I ran ./bin/importmap pin editor-js in my terminal. This gave me the following in my importmap.rb

pin "editor-js", to: "https://ga.jspm.io/npm:[email protected]/src/js/editor.js"
pin "babel-runtime/core-js/weak-map", to: "https://ga.jspm.io/npm:[email protected]/core-js/weak-map.js"
pin "babel-runtime/helpers/classCallCheck", to: "https://ga.jspm.io/npm:[email protected]/helpers/classCallCheck.js"
pin "babel-runtime/helpers/createClass", to: "https://ga.jspm.io/npm:[email protected]/helpers/createClass.js"
pin "browser-split", to: "https://ga.jspm.io/npm:[email protected]/index.js"
pin "class-list", to: "https://ga.jspm.io/npm:[email protected]/index.js"
pin "core-js/library/fn/object/define-property", to: "https://ga.jspm.io/npm:[email protected]/library/fn/object/define-property.js"
pin "core-js/library/fn/weak-map", to: "https://ga.jspm.io/npm:[email protected]/library/fn/weak-map.js"
pin "editable", to: "https://ga.jspm.io/npm:[email protected]/index.js"
pin "es6-event-emitter", to: "https://ga.jspm.io/npm:[email protected]/dist/emitter.js"
pin "events", to: "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/events.js"
pin "html-element", to: "https://ga.jspm.io/npm:[email protected]/index.js"
pin "hyperscript", to: "https://ga.jspm.io/npm:[email protected]/index.js"
pin "indexof", to: "https://ga.jspm.io/npm:[email protected]/index.js"
pin "inherits", to: "https://ga.jspm.io/npm:[email protected]/inherits_browser.js"
pin "jquery", to: "https://ga.jspm.io/npm:[email protected]/dist/jquery.js"
pin "styles", to: "https://ga.jspm.io/npm:[email protected]/Gruntfile.js"
pin "text-content", to: "https://ga.jspm.io/npm:[email protected]/index.js"
pin "toastr", to: "https://ga.jspm.io/npm:[email protected]/toastr.js"

I then tried importing all these dependencies in my stiumulus controller along with editor-js but I am still getting console errors. This also feels like I’m just implementing it wrong.

Does anyone have any experience of configuring EditorJS in Rails 7 with importmaps and Stimulus?