The idea is to have https://github.com/facebook/lexical/tree/main/packages/lexical-playground as a separate, lean repo bundlable as a single JS file to be used as a simple client-side markdown editor with usage API similar to https://github.com/quilljs/quill (and usable in vanilla HTML/JS without mandatory usage of package managers/bundlers/react)
Based on the broken release https://github.com/facebook/lexical/releases/tag/v0.12.5: facebook/lexical#5392
Patched files from base:
packages/lexical-playground/package.json
- adds missing dependencies@babel/plugin-transform-flow-strip-types
,@babel/preset-react
,@rollup/plugin-babel
,babel
,@types/react
,@types/react-dom
packages/lexical-playground/vite.prod.config.js
- adds single-file output of main.js/main.csspackages/lexical-playground/index.html
- now usesindexEditorOnly.tsx
instead ofindex.tsx
New files:
packages/lexical-playground/src/indexEditorOnly.tsx
packages/lexical-playground/src/EditorOnly.tsx
- cuts out real-time collaboration functionalityMakefile
- installs dependencies, runs vite and embeds svg/gif/jpg/woff/woff2/ttf resources.github/workflows/build.yml
- runs Makefile and uploads main.js/main.css as artifacts
Full diff: https://github.com/vadimkantorov/lexical-playground-only/compare/base...objectorientededitor
git clone git@github.com:vadimkantorov/lexical-playground-only.git
cd lexical-playground-only
# wget https://github.com/facebook/lexical/archive/refs/tags/v0.12.5.tar.gz
# tar -xf v0.12.5.tar.gz --strip-components=1 lexical-0.12.5/packages/lexical-playground lexical-0.12.5/packages/shared
# sed -i "s@alias: moduleResolution@alias: [ { find: 'shared', replacement: path.resolve('../shared/src') } ]@" packages/lexical-playground/vite.prod.config.js
# sed -i "s@split: new URL('./split/index.html', import.meta.url).pathname,@@" packages/lexical-playground/vite.prod.config.js
# git add -A -f packages
# git commit -a -m 'extracting only packages/lexical-playground and packages/shared'
make assets
# open the browser
open http://localhost:8000
# serve /index.html and /assets
python -m http.server