0.2.0 • Published 1 year ago

solid-playground-editor-cm v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Usage

Installation

npm add solid-playground-editor-cm

Component

// create fileName signal
const [fileName, setFileName] = createSignal("index.tsx");
// create fileSystem store
const [files, setFiles] = createStore({
  "index.tsx": "// Start here",
  "index.css": ".selector { display: block; }",
  "test.json": "{ test: 2 }",
  "index.html": "<!doctype html><html><head><title>Test</title></head><body></body></html>"
} as Record<string, string>);

return (
  <Editor
    files={files}
    setFiles={setFiles}
    fileName={fileName()}
    setFileName={setFileName}
    tsOptions={{ strict: false }}
  />
);

Installation and development

# install
npm i --legacy-peer-deps
# build
npm run build
# dev
npm run dev