├── .github └── workflows │ └── main.yaml ├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── package.json ├── pnpm-lock.yaml ├── public ├── favicons │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ ├── apple-touch-icon.png │ ├── browserconfig.xml │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── icon-192x192.png │ ├── icon-256x256.png │ ├── icon-384x384.png │ ├── icon-512x512.png │ └── mstile-150x150.png ├── fonts │ ├── .DS_Store │ └── Gordita │ │ ├── Gordita-Black-Italic.otf │ │ ├── Gordita-Black-Italic.woff │ │ ├── Gordita-Black-Italic.woff2 │ │ ├── Gordita-Black.otf │ │ ├── Gordita-Black.woff │ │ ├── Gordita-Black.woff2 │ │ ├── Gordita-Bold-Italic.woff │ │ ├── Gordita-Bold-italic.otf │ │ ├── Gordita-Bold-italic.woff2 │ │ ├── Gordita-Bold.eot │ │ ├── Gordita-Bold.otf │ │ ├── Gordita-Bold.ttf │ │ ├── Gordita-Bold.woff │ │ ├── Gordita-Bold.woff2 │ │ ├── Gordita-Light-Italic.otf │ │ ├── Gordita-Light-Italic.woff │ │ ├── Gordita-Light-Italic.woff2 │ │ ├── Gordita-Light.otf │ │ ├── Gordita-Light.woff │ │ ├── Gordita-Light.woff2 │ │ ├── Gordita-Medium-Italic.otf │ │ ├── Gordita-Medium-Italic.woff │ │ ├── Gordita-Medium-Italic.woff2 │ │ ├── Gordita-Medium.eot │ │ ├── Gordita-Medium.otf │ │ ├── Gordita-Medium.ttf │ │ ├── Gordita-Medium.woff │ │ ├── Gordita-Medium.woff2 │ │ ├── Gordita-Regular-Italic.otf │ │ ├── Gordita-Regular-Italic.woff │ │ ├── Gordita-Regular-Italic.woff2 │ │ ├── Gordita-Regular.eot │ │ ├── Gordita-Regular.otf │ │ ├── Gordita-Regular.ttf │ │ ├── Gordita-Regular.woff │ │ ├── Gordita-Regular.woff2 │ │ ├── Gordita-Thin-Italic.otf │ │ ├── Gordita-Thin-Italic.woff │ │ ├── Gordita-Thin-Italic.woff2 │ │ ├── Gordita-Thin.eot │ │ ├── Gordita-Thin.otf │ │ ├── Gordita-Thin.ttf │ │ ├── Gordita-Thin.woff │ │ ├── Gordita-Thin.woff2 │ │ ├── Gordita-Ultra-Italic.otf │ │ ├── Gordita-Ultra-Italic.woff │ │ ├── Gordita-Ultra-Italic.woff2 │ │ ├── Gordita-Ultra.otf │ │ ├── Gordita-Ultra.woff │ │ └── Gordita-Ultra.woff2 └── og.png ├── src ├── components │ ├── ActionsPanel │ │ ├── ActionsPanel.tsx │ │ └── TogglePanelButton.tsx │ ├── ConfigPanel │ │ ├── ConfigPanel.tsx │ │ ├── Input.tsx │ │ ├── Select.tsx │ │ └── Toggle.tsx │ ├── CopyJSXButton.tsx │ ├── Editors │ │ ├── HTMLEditor.tsx │ │ ├── JSXEditor.tsx │ │ └── SplitEditor.tsx │ ├── Header │ │ ├── Header.tsx │ │ └── ThemeBtn.tsx │ ├── Icons │ │ ├── ArrowLeftIcon.tsx │ │ ├── ChevronDownIcon.tsx │ │ ├── CopyIcon.tsx │ │ ├── GithubIcon.tsx │ │ ├── HalfSun.tsx │ │ ├── SettingsIcon.tsx │ │ ├── SplitPanelColumns.tsx │ │ ├── SplitPanelRows.tsx │ │ ├── TrashIcon.tsx │ │ └── XIcon.tsx │ ├── MobileScrollDVH.tsx │ ├── SettingsPanel │ │ ├── SettingsPanel.tsx │ │ └── TogglePanelButton.tsx │ └── SolidLogo.tsx ├── editor │ ├── defineEditorTheme.ts │ ├── editorBaseTheme.ts │ ├── plugins │ │ ├── autocomplete-style.ts │ │ ├── cursor-style.ts │ │ ├── highlight-style.ts │ │ ├── line-numbers-style.ts │ │ └── selection-style.ts │ └── theme │ │ ├── dark.ts │ │ └── light.ts ├── entry-client.tsx ├── entry-server.tsx ├── lib │ └── html-to-jsx.ts ├── root.css ├── root.tsx ├── routes │ └── index.tsx ├── store.ts └── utils │ ├── hasNonOverlayScrollbarY.ts │ ├── onTransitionend.ts │ └── reflow.ts ├── tsconfig.json ├── unocss.config.ts └── vite.config.ts /.github/workflows/main.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy site 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - uses: pnpm/action-setup@v2.2.4 16 | 17 | - name: Setup Node.js environment 18 | 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: 18 22 | cache: pnpm 23 | 24 | - name: Install dependencies 25 | run: pnpm install 26 | 27 | - name: Build 28 | run: pnpm build 29 | 30 | - name: deploy pages 31 | uses: JamesIves/github-pages-deploy-action@v4.4.1 32 | with: 33 | branch: gh-pages 34 | folder: dist/public 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # solid-start 2 | .solid 3 | 4 | .output 5 | 6 | # Mac 7 | .DS_Store 8 | 9 | # Logs 10 | logs 11 | *.log 12 | npm-debug.log* 13 | yarn-debug.log* 14 | yarn-error.log* 15 | lerna-debug.log* 16 | 17 | # Diagnostic reports (https://nodejs.org/api/report.html) 18 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 19 | 20 | # Runtime data 21 | pids 22 | *.pid 23 | *.seed 24 | *.pid.lock 25 | 26 | # Directory for instrumented libs generated by jscoverage/JSCover 27 | lib-cov 28 | 29 | # Coverage directory used by tools like istanbul 30 | coverage 31 | *.lcov 32 | 33 | # nyc test coverage 34 | .nyc_output 35 | 36 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 37 | .grunt 38 | 39 | # Bower dependency directory (https://bower.io/) 40 | bower_components 41 | 42 | # node-waf configuration 43 | .lock-wscript 44 | 45 | # Compiled binary addons (https://nodejs.org/api/addons.html) 46 | build/Release 47 | 48 | # Dependency directories 49 | node_modules/ 50 | jspm_packages/ 51 | 52 | # TypeScript v1 declaration files 53 | typings/ 54 | 55 | # TypeScript cache 56 | *.tsbuildinfo 57 | 58 | # Optional npm cache directory 59 | .npm 60 | 61 | # Optional eslint cache 62 | .eslintcache 63 | 64 | # Microbundle cache 65 | .rpt2_cache/ 66 | .rts2_cache_cjs/ 67 | .rts2_cache_es/ 68 | .rts2_cache_umd/ 69 | 70 | # Optional REPL history 71 | .node_repl_history 72 | 73 | # Output of 'npm pack' 74 | *.tgz 75 | 76 | # Yarn Integrity file 77 | .yarn-integrity 78 | 79 | # dotenv environment variables file 80 | .env 81 | .env.test 82 | 83 | # parcel-bundler cache (https://parceljs.org/) 84 | .cache 85 | 86 | # Next.js build output 87 | .next 88 | 89 | # Nuxt.js build / generate output 90 | .nuxt 91 | dist 92 | 93 | # Gatsby files 94 | .cache/ 95 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 96 | # https://nextjs.org/blog/next-9-1#public-directory-support 97 | # public 98 | 99 | # vuepress build output 100 | .vuepress/dist 101 | 102 | # Serverless directories 103 | .serverless/ 104 | 105 | # FuseBox cache 106 | .fusebox/ 107 | 108 | # DynamoDB Local files 109 | .dynamodb/ 110 | 111 | # TernJS port file 112 | .tern-port 113 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "tabWidth": 2, 4 | "printWidth": 100, 5 | "semi": true, 6 | "singleQuote": false, 7 | "useTabs": false, 8 | "arrowParens": "always", 9 | "bracketSpacing": true, 10 | "endOfLine": "lf" 11 | } 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 SolidJS Community 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
tag use template literals", 67 | value: store.config.preTagWrapTemplateLiterals!, 68 | }, 69 | stripStyleTag: { 70 | type: "checkbox", 71 | name: "Remove 56 | `; 57 | } 58 | 59 | function getJSXText() { 60 | return ` 61 | {/* Solid is solid */} 62 |SolidJSX
63 | 64 |
65 | 73 | 80 | `; 81 | } 82 | -------------------------------------------------------------------------------- /src/utils/hasNonOverlayScrollbarY.ts: -------------------------------------------------------------------------------- 1 | export const hasNonOverlayScrollbarY = (el: HTMLElement) => { 2 | const { offsetWidth, clientWidth } = el; 3 | if (clientWidth === 0) return false; 4 | 5 | return clientWidth !== offsetWidth; 6 | }; 7 | -------------------------------------------------------------------------------- /src/utils/onTransitionend.ts: -------------------------------------------------------------------------------- 1 | export const onTransitionend = (el: HTMLElement, cb: () => void) => { 2 | el.addEventListener( 3 | "transitionend", 4 | (e) => { 5 | if (e.currentTarget !== e.target) return; 6 | cb(); 7 | }, 8 | { once: true } 9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /src/utils/reflow.ts: -------------------------------------------------------------------------------- 1 | export const reflow = () => document.body.clientWidth; 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "esModuleInterop": true, 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "jsxImportSource": "solid-js", 9 | "jsx": "preserve", 10 | "strict": true, 11 | "types": ["solid-start/env"], 12 | "baseUrl": "./", 13 | "paths": { 14 | "~/*": ["./src/*"] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /unocss.config.ts: -------------------------------------------------------------------------------- 1 | import { presetWind, theme } from "@unocss/preset-wind"; 2 | import { 3 | transformerDirectives, 4 | defineConfig, 5 | transformerVariantGroup, 6 | } from "unocss"; 7 | 8 | const parseValue = (value: string) => { 9 | return value.replace(/_/g, " "); 10 | }; 11 | // mask-image-[linear-gradient(135deg,#000_calc(50%_-_1px),transparent_calc(50%_-_1px))] 12 | export default defineConfig({ 13 | rules: [ 14 | [ 15 | /^bg-image-\[(.+)\]$/, 16 | ([_, d]) => ({ "background-image": parseValue(d) }), 17 | ], 18 | [/^transition-prop-\[(.+)\]$/, ([_, d]) => ({ transition: parseValue(d) })], 19 | [ 20 | /^mask-image-\[(.+)\]$/, 21 | ([_, d]) => ({ 22 | "-webkit-mask-image": parseValue(d), 23 | "mask-image": parseValue(d), 24 | }), 25 | ], 26 | ], 27 | theme: { 28 | breakpoints: { 29 | ...theme.breakpoints, 30 | md: "850px", 31 | }, 32 | colors: { 33 | brand: { 34 | default: "#2c4f7c", 35 | dark: "#335d92", 36 | medium: "#446b9e", 37 | light: "#4f88c6", 38 | }, 39 | solid: { 40 | default: "#2c4f7c", 41 | darkbg: "#222222", 42 | darkLighterBg: "#444444", 43 | darkdefault: "#b8d7ff", 44 | darkgray: "#252525", 45 | gray: "#414042", 46 | mediumgray: "#9d9d9d", 47 | lightgray: "#f3f5f7", 48 | dark: "#07254A", 49 | medium: "#446b9e", 50 | light: "#4f88c6", 51 | accent: "#0cdc73", 52 | secondaccent: "#0dfc85", 53 | }, 54 | other: "#1e1e1e", 55 | }, 56 | fontFamily: { 57 | sans: "Gordita, " + theme.fontFamily!.sans, 58 | }, 59 | }, 60 | presets: [presetWind()], 61 | transformers: [transformerDirectives(), transformerVariantGroup()], 62 | }); 63 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import solid from "solid-start/vite"; 2 | import { defineConfig } from "vite"; 3 | import UnoCss from "unocss/vite"; 4 | 5 | export default defineConfig({ 6 | base: "/html-to-solidjsx/", 7 | optimizeDeps: { 8 | // Add both @codemirror/state and @codemirror/view to included deps to optimize 9 | include: ["@codemirror/state", "@codemirror/view"], 10 | }, 11 | plugins: [ 12 | solid({ 13 | adapter: "solid-start-static", 14 | }), 15 | UnoCss(), 16 | ], 17 | }); 18 | --------------------------------------------------------------------------------