@jbpark/live-editor 4.5.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.ko.md +4 -1
  2. package/README.md +5 -1
  3. package/dist/{boundary-DnjGgsK6.js → boundary-BLB80tyw.js} +2 -2
  4. package/dist/boundary-BLB80tyw.js.map +1 -0
  5. package/dist/cache-B0-XcIxJ.js.map +1 -1
  6. package/dist/{compile-DDfk5P25.js → compile-Dxas-D05.js} +3 -3
  7. package/dist/compile-Dxas-D05.js.map +1 -0
  8. package/dist/{constants-h1JAgOeW.js → constants-DU17Tdwo.js} +3 -3
  9. package/dist/constants-DU17Tdwo.js.map +1 -0
  10. package/dist/{context-DsEXJl4h.js → context-B8MzP7_p.js} +3 -3
  11. package/dist/context-B8MzP7_p.js.map +1 -0
  12. package/dist/{core-CRsAGpei.js → core-Bgfek364.js} +2 -2
  13. package/dist/core-Bgfek364.js.map +1 -0
  14. package/dist/{detect-typescript-CCj9ALXc.js → detect-typescript-Dr_oLniM.js} +2 -2
  15. package/dist/detect-typescript-Dr_oLniM.js.map +1 -0
  16. package/dist/dnd/index.d.ts +1 -1
  17. package/dist/dnd/index.js +1 -1
  18. package/dist/{dnd-DGNp20Nk.js → dnd-UoJILA75.js} +431 -408
  19. package/dist/dnd-UoJILA75.js.map +1 -0
  20. package/dist/{document-DGHTfrda.js → document-CGbe6bSV.js} +2 -2
  21. package/dist/{document-DGHTfrda.js.map → document-CGbe6bSV.js.map} +1 -1
  22. package/dist/editor/index.js +2 -2
  23. package/dist/{editor-DQ8Q--qR.js → editor-CMElfHer.js} +2 -2
  24. package/dist/editor-CMElfHer.js.map +1 -0
  25. package/dist/editor-caches-ClMvdcQF.js.map +1 -1
  26. package/dist/error/index.d.ts +1 -1
  27. package/dist/error/index.js +2 -2
  28. package/dist/{error-DwqwjJ2C.js → error-CN_GCnXB.js} +3 -3
  29. package/dist/{error-DwqwjJ2C.js.map → error-CN_GCnXB.js.map} +1 -1
  30. package/dist/{index-P9Aifaui.d.ts → index-C69Lv-jR.d.ts} +71 -69
  31. package/dist/{index-vtyggWy0.d.ts → index-CRwEhJ7w.d.ts} +2 -2
  32. package/dist/{index-CHknA6k1.d.ts → index-DKYUxi-E.d.ts} +10 -4
  33. package/dist/{index-WQgFy510.d.ts → index-DrWtSKXu.d.ts} +2 -2
  34. package/dist/index.d.ts +4 -4
  35. package/dist/index.js +6 -6
  36. package/dist/{items-DdrwGxJw.js → items-B6OXxcLG.js} +178 -259
  37. package/dist/items-B6OXxcLG.js.map +1 -0
  38. package/dist/{messages-CzUPVnzH.js → messages-CSrMI4Rm.js} +2 -1
  39. package/dist/messages-CSrMI4Rm.js.map +1 -0
  40. package/dist/{messages-Cp3g1mn1.d.ts → messages-IBPs4TkZ.d.ts} +2 -1
  41. package/dist/preview/index.js +2 -2
  42. package/dist/{preview-BKFgq_5u.js → preview-CtyG5UbH.js} +4 -4
  43. package/dist/{preview-BKFgq_5u.js.map → preview-CtyG5UbH.js.map} +1 -1
  44. package/dist/provider/index.d.ts +2 -2
  45. package/dist/provider/index.js +2 -2
  46. package/dist/{sections-BRH3KHYc.js → sections-BYWOBISr.js} +3 -3
  47. package/dist/sections-BYWOBISr.js.map +1 -0
  48. package/dist/states-Ci1AvoQ9.js.map +1 -1
  49. package/dist/{use-dynamic-tailwind-T9r9ExbR.js → use-dynamic-tailwind-BP1toJkW.js} +59 -39
  50. package/dist/use-dynamic-tailwind-BP1toJkW.js.map +1 -0
  51. package/dist/utils/ast/index.d.ts +1 -1
  52. package/dist/utils/ast/index.js +86 -2
  53. package/dist/utils/ast/index.js.map +1 -1
  54. package/dist/utils/index.js +4 -4
  55. package/dist/utils/index.js.map +1 -1
  56. package/dist/utils/tailwind/index.js.map +1 -1
  57. package/dist/validate-iLo8IONY.js.map +1 -1
  58. package/package.json +1 -1
  59. package/dist/boundary-DnjGgsK6.js.map +0 -1
  60. package/dist/compile-DDfk5P25.js.map +0 -1
  61. package/dist/constants-h1JAgOeW.js.map +0 -1
  62. package/dist/context-DsEXJl4h.js.map +0 -1
  63. package/dist/core-CRsAGpei.js.map +0 -1
  64. package/dist/detect-typescript-CCj9ALXc.js.map +0 -1
  65. package/dist/dnd-DGNp20Nk.js.map +0 -1
  66. package/dist/editor-DQ8Q--qR.js.map +0 -1
  67. package/dist/items-DdrwGxJw.js.map +0 -1
  68. package/dist/messages-CzUPVnzH.js.map +0 -1
  69. package/dist/sections-BRH3KHYc.js.map +0 -1
  70. package/dist/use-dynamic-tailwind-T9r9ExbR.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeCSS"],"sources":["../../../src/utils/tailwind/theme-css.ts","../../../src/utils/tailwind/index.ts"],"sourcesContent":["// Generated from `tailwindcss/theme.css` (v4.3.3) — do NOT hand-edit.\n//\n// generateTailwindCSS() below compiles arbitrary utility classes typed at\n// runtime (see ~/utils/tailwind), and needs Tailwind's default theme tokens\n// (colors, spacing, font sizes, ...) in scope to resolve anything beyond\n// keyword-only utilities like `text-center`. Importing `tailwindcss/theme.css`\n// directly would need a `?raw`-style loader, which is a Vite convention that\n// tsdown's bundler (used for the published package) doesn't understand —\n// baking the text in as a plain string works with any consumer bundler.\n// Regenerate by re-running the snippet in the commit that added this file\n// after bumping the `tailwindcss` version.\n\nexport default \"@theme default {\\n --font-sans:\\n -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial,\\n sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\\n --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;\\n --font-mono:\\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\\n monospace;\\n\\n --color-red-50: oklch(97.1% 0.013 17.38);\\n --color-red-100: oklch(93.6% 0.032 17.717);\\n --color-red-200: oklch(88.5% 0.062 18.334);\\n --color-red-300: oklch(80.8% 0.114 19.571);\\n --color-red-400: oklch(70.4% 0.191 22.216);\\n --color-red-500: oklch(63.7% 0.237 25.331);\\n --color-red-600: oklch(57.7% 0.245 27.325);\\n --color-red-700: oklch(50.5% 0.213 27.518);\\n --color-red-800: oklch(44.4% 0.177 26.899);\\n --color-red-900: oklch(39.6% 0.141 25.723);\\n --color-red-950: oklch(25.8% 0.092 26.042);\\n\\n --color-orange-50: oklch(98% 0.016 73.684);\\n --color-orange-100: oklch(95.4% 0.038 75.164);\\n --color-orange-200: oklch(90.1% 0.076 70.697);\\n --color-orange-300: oklch(83.7% 0.128 66.29);\\n --color-orange-400: oklch(75% 0.183 55.934);\\n --color-orange-500: oklch(70.5% 0.213 47.604);\\n --color-orange-600: oklch(64.6% 0.222 41.116);\\n --color-orange-700: oklch(55.3% 0.195 38.402);\\n --color-orange-800: oklch(47% 0.157 37.304);\\n --color-orange-900: oklch(40.8% 0.123 38.172);\\n --color-orange-950: oklch(26.6% 0.079 36.259);\\n\\n --color-amber-50: oklch(98.7% 0.022 95.277);\\n --color-amber-100: oklch(96.2% 0.059 95.617);\\n --color-amber-200: oklch(92.4% 0.12 95.746);\\n --color-amber-300: oklch(87.9% 0.169 91.605);\\n --color-amber-400: oklch(82.8% 0.189 84.429);\\n --color-amber-500: oklch(76.9% 0.188 70.08);\\n --color-amber-600: oklch(66.6% 0.179 58.318);\\n --color-amber-700: oklch(55.5% 0.163 48.998);\\n --color-amber-800: oklch(47.3% 0.137 46.201);\\n --color-amber-900: oklch(41.4% 0.112 45.904);\\n --color-amber-950: oklch(27.9% 0.077 45.635);\\n\\n --color-yellow-50: oklch(98.7% 0.026 102.212);\\n --color-yellow-100: oklch(97.3% 0.071 103.193);\\n --color-yellow-200: oklch(94.5% 0.129 101.54);\\n --color-yellow-300: oklch(90.5% 0.182 98.111);\\n --color-yellow-400: oklch(85.2% 0.199 91.936);\\n --color-yellow-500: oklch(79.5% 0.184 86.047);\\n --color-yellow-600: oklch(68.1% 0.162 75.834);\\n --color-yellow-700: oklch(55.4% 0.135 66.442);\\n --color-yellow-800: oklch(47.6% 0.114 61.907);\\n --color-yellow-900: oklch(42.1% 0.095 57.708);\\n --color-yellow-950: oklch(28.6% 0.066 53.813);\\n\\n --color-lime-50: oklch(98.6% 0.031 120.757);\\n --color-lime-100: oklch(96.7% 0.067 122.328);\\n --color-lime-200: oklch(93.8% 0.127 124.321);\\n --color-lime-300: oklch(89.7% 0.196 126.665);\\n --color-lime-400: oklch(84.1% 0.238 128.85);\\n --color-lime-500: oklch(76.8% 0.233 130.85);\\n --color-lime-600: oklch(64.8% 0.2 131.684);\\n --color-lime-700: oklch(53.2% 0.157 131.589);\\n --color-lime-800: oklch(45.3% 0.124 130.933);\\n --color-lime-900: oklch(40.5% 0.101 131.063);\\n --color-lime-950: oklch(27.4% 0.072 132.109);\\n\\n --color-green-50: oklch(98.2% 0.018 155.826);\\n --color-green-100: oklch(96.2% 0.044 156.743);\\n --color-green-200: oklch(92.5% 0.084 155.995);\\n --color-green-300: oklch(87.1% 0.15 154.449);\\n --color-green-400: oklch(79.2% 0.209 151.711);\\n --color-green-500: oklch(72.3% 0.219 149.579);\\n --color-green-600: oklch(62.7% 0.194 149.214);\\n --color-green-700: oklch(52.7% 0.154 150.069);\\n --color-green-800: oklch(44.8% 0.119 151.328);\\n --color-green-900: oklch(39.3% 0.095 152.535);\\n --color-green-950: oklch(26.6% 0.065 152.934);\\n\\n --color-emerald-50: oklch(97.9% 0.021 166.113);\\n --color-emerald-100: oklch(95% 0.052 163.051);\\n --color-emerald-200: oklch(90.5% 0.093 164.15);\\n --color-emerald-300: oklch(84.5% 0.143 164.978);\\n --color-emerald-400: oklch(76.5% 0.177 163.223);\\n --color-emerald-500: oklch(69.6% 0.17 162.48);\\n --color-emerald-600: oklch(59.6% 0.145 163.225);\\n --color-emerald-700: oklch(50.8% 0.118 165.612);\\n --color-emerald-800: oklch(43.2% 0.095 166.913);\\n --color-emerald-900: oklch(37.8% 0.077 168.94);\\n --color-emerald-950: oklch(26.2% 0.051 172.552);\\n\\n --color-teal-50: oklch(98.4% 0.014 180.72);\\n --color-teal-100: oklch(95.3% 0.051 180.801);\\n --color-teal-200: oklch(91% 0.096 180.426);\\n --color-teal-300: oklch(85.5% 0.138 181.071);\\n --color-teal-400: oklch(77.7% 0.152 181.912);\\n --color-teal-500: oklch(70.4% 0.14 182.503);\\n --color-teal-600: oklch(60% 0.118 184.704);\\n --color-teal-700: oklch(51.1% 0.096 186.391);\\n --color-teal-800: oklch(43.7% 0.078 188.216);\\n --color-teal-900: oklch(38.6% 0.063 188.416);\\n --color-teal-950: oklch(27.7% 0.046 192.524);\\n\\n --color-cyan-50: oklch(98.4% 0.019 200.873);\\n --color-cyan-100: oklch(95.6% 0.045 203.388);\\n --color-cyan-200: oklch(91.7% 0.08 205.041);\\n --color-cyan-300: oklch(86.5% 0.127 207.078);\\n --color-cyan-400: oklch(78.9% 0.154 211.53);\\n --color-cyan-500: oklch(71.5% 0.143 215.221);\\n --color-cyan-600: oklch(60.9% 0.126 221.723);\\n --color-cyan-700: oklch(52% 0.105 223.128);\\n --color-cyan-800: oklch(45% 0.085 224.283);\\n --color-cyan-900: oklch(39.8% 0.07 227.392);\\n --color-cyan-950: oklch(30.2% 0.056 229.695);\\n\\n --color-sky-50: oklch(97.7% 0.013 236.62);\\n --color-sky-100: oklch(95.1% 0.026 236.824);\\n --color-sky-200: oklch(90.1% 0.058 230.902);\\n --color-sky-300: oklch(82.8% 0.111 230.318);\\n --color-sky-400: oklch(74.6% 0.16 232.661);\\n --color-sky-500: oklch(68.5% 0.169 237.323);\\n --color-sky-600: oklch(58.8% 0.158 241.966);\\n --color-sky-700: oklch(50% 0.134 242.749);\\n --color-sky-800: oklch(44.3% 0.11 240.79);\\n --color-sky-900: oklch(39.1% 0.09 240.876);\\n --color-sky-950: oklch(29.3% 0.066 243.157);\\n\\n --color-blue-50: oklch(97% 0.014 254.604);\\n --color-blue-100: oklch(93.2% 0.032 255.585);\\n --color-blue-200: oklch(88.2% 0.059 254.128);\\n --color-blue-300: oklch(80.9% 0.105 251.813);\\n --color-blue-400: oklch(70.7% 0.165 254.624);\\n --color-blue-500: oklch(62.3% 0.214 259.815);\\n --color-blue-600: oklch(54.6% 0.245 262.881);\\n --color-blue-700: oklch(48.8% 0.243 264.376);\\n --color-blue-800: oklch(42.4% 0.199 265.638);\\n --color-blue-900: oklch(37.9% 0.146 265.522);\\n --color-blue-950: oklch(28.2% 0.091 267.935);\\n\\n --color-indigo-50: oklch(96.2% 0.018 272.314);\\n --color-indigo-100: oklch(93% 0.034 272.788);\\n --color-indigo-200: oklch(87% 0.065 274.039);\\n --color-indigo-300: oklch(78.5% 0.115 274.713);\\n --color-indigo-400: oklch(67.3% 0.182 276.935);\\n --color-indigo-500: oklch(58.5% 0.233 277.117);\\n --color-indigo-600: oklch(51.1% 0.262 276.966);\\n --color-indigo-700: oklch(45.7% 0.24 277.023);\\n --color-indigo-800: oklch(39.8% 0.195 277.366);\\n --color-indigo-900: oklch(35.9% 0.144 278.697);\\n --color-indigo-950: oklch(25.7% 0.09 281.288);\\n\\n --color-violet-50: oklch(96.9% 0.016 293.756);\\n --color-violet-100: oklch(94.3% 0.029 294.588);\\n --color-violet-200: oklch(89.4% 0.057 293.283);\\n --color-violet-300: oklch(81.1% 0.111 293.571);\\n --color-violet-400: oklch(70.2% 0.183 293.541);\\n --color-violet-500: oklch(60.6% 0.25 292.717);\\n --color-violet-600: oklch(54.1% 0.281 293.009);\\n --color-violet-700: oklch(49.1% 0.27 292.581);\\n --color-violet-800: oklch(43.2% 0.232 292.759);\\n --color-violet-900: oklch(38% 0.189 293.745);\\n --color-violet-950: oklch(28.3% 0.141 291.089);\\n\\n --color-purple-50: oklch(97.7% 0.014 308.299);\\n --color-purple-100: oklch(94.6% 0.033 307.174);\\n --color-purple-200: oklch(90.2% 0.063 306.703);\\n --color-purple-300: oklch(82.7% 0.119 306.383);\\n --color-purple-400: oklch(71.4% 0.203 305.504);\\n --color-purple-500: oklch(62.7% 0.265 303.9);\\n --color-purple-600: oklch(55.8% 0.288 302.321);\\n --color-purple-700: oklch(49.6% 0.265 301.924);\\n --color-purple-800: oklch(43.8% 0.218 303.724);\\n --color-purple-900: oklch(38.1% 0.176 304.987);\\n --color-purple-950: oklch(29.1% 0.149 302.717);\\n\\n --color-fuchsia-50: oklch(97.7% 0.017 320.058);\\n --color-fuchsia-100: oklch(95.2% 0.037 318.852);\\n --color-fuchsia-200: oklch(90.3% 0.076 319.62);\\n --color-fuchsia-300: oklch(83.3% 0.145 321.434);\\n --color-fuchsia-400: oklch(74% 0.238 322.16);\\n --color-fuchsia-500: oklch(66.7% 0.295 322.15);\\n --color-fuchsia-600: oklch(59.1% 0.293 322.896);\\n --color-fuchsia-700: oklch(51.8% 0.253 323.949);\\n --color-fuchsia-800: oklch(45.2% 0.211 324.591);\\n --color-fuchsia-900: oklch(40.1% 0.17 325.612);\\n --color-fuchsia-950: oklch(29.3% 0.136 325.661);\\n\\n --color-pink-50: oklch(97.1% 0.014 343.198);\\n --color-pink-100: oklch(94.8% 0.028 342.258);\\n --color-pink-200: oklch(89.9% 0.061 343.231);\\n --color-pink-300: oklch(82.3% 0.12 346.018);\\n --color-pink-400: oklch(71.8% 0.202 349.761);\\n --color-pink-500: oklch(65.6% 0.241 354.308);\\n --color-pink-600: oklch(59.2% 0.249 0.584);\\n --color-pink-700: oklch(52.5% 0.223 3.958);\\n --color-pink-800: oklch(45.9% 0.187 3.815);\\n --color-pink-900: oklch(40.8% 0.153 2.432);\\n --color-pink-950: oklch(28.4% 0.109 3.907);\\n\\n --color-rose-50: oklch(96.9% 0.015 12.422);\\n --color-rose-100: oklch(94.1% 0.03 12.58);\\n --color-rose-200: oklch(89.2% 0.058 10.001);\\n --color-rose-300: oklch(81% 0.117 11.638);\\n --color-rose-400: oklch(71.2% 0.194 13.428);\\n --color-rose-500: oklch(64.5% 0.246 16.439);\\n --color-rose-600: oklch(58.6% 0.253 17.585);\\n --color-rose-700: oklch(51.4% 0.222 16.935);\\n --color-rose-800: oklch(45.5% 0.188 13.697);\\n --color-rose-900: oklch(41% 0.159 10.272);\\n --color-rose-950: oklch(27.1% 0.105 12.094);\\n\\n --color-slate-50: oklch(98.4% 0.003 247.858);\\n --color-slate-100: oklch(96.8% 0.007 247.896);\\n --color-slate-200: oklch(92.9% 0.013 255.508);\\n --color-slate-300: oklch(86.9% 0.022 252.894);\\n --color-slate-400: oklch(70.4% 0.04 256.788);\\n --color-slate-500: oklch(55.4% 0.046 257.417);\\n --color-slate-600: oklch(44.6% 0.043 257.281);\\n --color-slate-700: oklch(37.2% 0.044 257.287);\\n --color-slate-800: oklch(27.9% 0.041 260.031);\\n --color-slate-900: oklch(20.8% 0.042 265.755);\\n --color-slate-950: oklch(12.9% 0.042 264.695);\\n\\n --color-gray-50: oklch(98.5% 0.002 247.839);\\n --color-gray-100: oklch(96.7% 0.003 264.542);\\n --color-gray-200: oklch(92.8% 0.006 264.531);\\n --color-gray-300: oklch(87.2% 0.01 258.338);\\n --color-gray-400: oklch(70.7% 0.022 261.325);\\n --color-gray-500: oklch(55.1% 0.027 264.364);\\n --color-gray-600: oklch(44.6% 0.03 256.802);\\n --color-gray-700: oklch(37.3% 0.034 259.733);\\n --color-gray-800: oklch(27.8% 0.033 256.848);\\n --color-gray-900: oklch(21% 0.034 264.665);\\n --color-gray-950: oklch(13% 0.028 261.692);\\n\\n --color-zinc-50: oklch(98.5% 0 none);\\n --color-zinc-100: oklch(96.7% 0.001 286.375);\\n --color-zinc-200: oklch(92% 0.004 286.32);\\n --color-zinc-300: oklch(87.1% 0.006 286.286);\\n --color-zinc-400: oklch(70.5% 0.015 286.067);\\n --color-zinc-500: oklch(55.2% 0.016 285.938);\\n --color-zinc-600: oklch(44.2% 0.017 285.786);\\n --color-zinc-700: oklch(37% 0.013 285.805);\\n --color-zinc-800: oklch(27.4% 0.006 286.033);\\n --color-zinc-900: oklch(21% 0.006 285.885);\\n --color-zinc-950: oklch(14.1% 0.005 285.823);\\n\\n --color-neutral-50: oklch(98.5% 0 none);\\n --color-neutral-100: oklch(97% 0 none);\\n --color-neutral-200: oklch(92.2% 0 none);\\n --color-neutral-300: oklch(87% 0 none);\\n --color-neutral-400: oklch(70.8% 0 none);\\n --color-neutral-500: oklch(55.6% 0 none);\\n --color-neutral-600: oklch(43.9% 0 none);\\n --color-neutral-700: oklch(37.1% 0 none);\\n --color-neutral-800: oklch(26.9% 0 none);\\n --color-neutral-900: oklch(20.5% 0 none);\\n --color-neutral-950: oklch(14.5% 0 none);\\n\\n --color-stone-50: oklch(98.5% 0.001 106.423);\\n --color-stone-100: oklch(97% 0.001 106.424);\\n --color-stone-200: oklch(92.3% 0.003 48.717);\\n --color-stone-300: oklch(86.9% 0.005 56.366);\\n --color-stone-400: oklch(70.9% 0.01 56.259);\\n --color-stone-500: oklch(55.3% 0.013 58.071);\\n --color-stone-600: oklch(44.4% 0.011 73.639);\\n --color-stone-700: oklch(37.4% 0.01 67.558);\\n --color-stone-800: oklch(26.8% 0.007 34.298);\\n --color-stone-900: oklch(21.6% 0.006 56.043);\\n --color-stone-950: oklch(14.7% 0.004 49.25);\\n\\n --color-mauve-50: oklch(98.5% 0 none);\\n --color-mauve-100: oklch(96% 0.003 325.6);\\n --color-mauve-200: oklch(92.2% 0.005 325.62);\\n --color-mauve-300: oklch(86.5% 0.012 325.68);\\n --color-mauve-400: oklch(71.1% 0.019 323.02);\\n --color-mauve-500: oklch(54.2% 0.034 322.5);\\n --color-mauve-600: oklch(43.5% 0.029 321.78);\\n --color-mauve-700: oklch(36.4% 0.029 323.89);\\n --color-mauve-800: oklch(26.3% 0.024 320.12);\\n --color-mauve-900: oklch(21.2% 0.019 322.12);\\n --color-mauve-950: oklch(14.5% 0.008 326);\\n\\n --color-olive-50: oklch(98.8% 0.003 106.5);\\n --color-olive-100: oklch(96.6% 0.005 106.5);\\n --color-olive-200: oklch(93% 0.007 106.5);\\n --color-olive-300: oklch(88% 0.011 106.6);\\n --color-olive-400: oklch(73.7% 0.021 106.9);\\n --color-olive-500: oklch(58% 0.031 107.3);\\n --color-olive-600: oklch(46.6% 0.025 107.3);\\n --color-olive-700: oklch(39.4% 0.023 107.4);\\n --color-olive-800: oklch(28.6% 0.016 107.4);\\n --color-olive-900: oklch(22.8% 0.013 107.4);\\n --color-olive-950: oklch(15.3% 0.006 107.1);\\n\\n --color-mist-50: oklch(98.7% 0.002 197.1);\\n --color-mist-100: oklch(96.3% 0.002 197.1);\\n --color-mist-200: oklch(92.5% 0.005 214.3);\\n --color-mist-300: oklch(87.2% 0.007 219.6);\\n --color-mist-400: oklch(72.3% 0.014 214.4);\\n --color-mist-500: oklch(56% 0.021 213.5);\\n --color-mist-600: oklch(45% 0.017 213.2);\\n --color-mist-700: oklch(37.8% 0.015 216);\\n --color-mist-800: oklch(27.5% 0.011 216.9);\\n --color-mist-900: oklch(21.8% 0.008 223.9);\\n --color-mist-950: oklch(14.8% 0.004 228.8);\\n\\n --color-taupe-50: oklch(98.6% 0.002 67.8);\\n --color-taupe-100: oklch(96% 0.002 17.2);\\n --color-taupe-200: oklch(92.2% 0.005 34.3);\\n --color-taupe-300: oklch(86.8% 0.007 39.5);\\n --color-taupe-400: oklch(71.4% 0.014 41.2);\\n --color-taupe-500: oklch(54.7% 0.021 43.1);\\n --color-taupe-600: oklch(43.8% 0.017 39.3);\\n --color-taupe-700: oklch(36.7% 0.016 35.7);\\n --color-taupe-800: oklch(26.8% 0.011 36.5);\\n --color-taupe-900: oklch(21.4% 0.009 43.1);\\n --color-taupe-950: oklch(14.7% 0.004 49.3);\\n\\n --color-black: #000;\\n --color-white: #fff;\\n\\n --spacing: 0.25rem;\\n\\n --breakpoint-sm: 40rem;\\n --breakpoint-md: 48rem;\\n --breakpoint-lg: 64rem;\\n --breakpoint-xl: 80rem;\\n --breakpoint-2xl: 96rem;\\n\\n --container-3xs: 16rem;\\n --container-2xs: 18rem;\\n --container-xs: 20rem;\\n --container-sm: 24rem;\\n --container-md: 28rem;\\n --container-lg: 32rem;\\n --container-xl: 36rem;\\n --container-2xl: 42rem;\\n --container-3xl: 48rem;\\n --container-4xl: 56rem;\\n --container-5xl: 64rem;\\n --container-6xl: 72rem;\\n --container-7xl: 80rem;\\n\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\n --text-sm: 0.875rem;\\n --text-sm--line-height: calc(1.25 / 0.875);\\n --text-base: 1rem;\\n --text-base--line-height: calc(1.5 / 1);\\n --text-lg: 1.125rem;\\n --text-lg--line-height: calc(1.75 / 1.125);\\n --text-xl: 1.25rem;\\n --text-xl--line-height: calc(1.75 / 1.25);\\n --text-2xl: 1.5rem;\\n --text-2xl--line-height: calc(2 / 1.5);\\n --text-3xl: 1.875rem;\\n --text-3xl--line-height: calc(2.25 / 1.875);\\n --text-4xl: 2.25rem;\\n --text-4xl--line-height: calc(2.5 / 2.25);\\n --text-5xl: 3rem;\\n --text-5xl--line-height: 1;\\n --text-6xl: 3.75rem;\\n --text-6xl--line-height: 1;\\n --text-7xl: 4.5rem;\\n --text-7xl--line-height: 1;\\n --text-8xl: 6rem;\\n --text-8xl--line-height: 1;\\n --text-9xl: 8rem;\\n --text-9xl--line-height: 1;\\n\\n --font-weight-thin: 100;\\n --font-weight-extralight: 200;\\n --font-weight-light: 300;\\n --font-weight-normal: 400;\\n --font-weight-medium: 500;\\n --font-weight-semibold: 600;\\n --font-weight-bold: 700;\\n --font-weight-extrabold: 800;\\n --font-weight-black: 900;\\n\\n --tracking-tighter: -0.05em;\\n --tracking-tight: -0.025em;\\n --tracking-normal: 0em;\\n --tracking-wide: 0.025em;\\n --tracking-wider: 0.05em;\\n --tracking-widest: 0.1em;\\n\\n --leading-tight: 1.25;\\n --leading-snug: 1.375;\\n --leading-normal: 1.5;\\n --leading-relaxed: 1.625;\\n --leading-loose: 2;\\n\\n --radius-xs: 0.125rem;\\n --radius-sm: 0.25rem;\\n --radius-md: 0.375rem;\\n --radius-lg: 0.5rem;\\n --radius-xl: 0.75rem;\\n --radius-2xl: 1rem;\\n --radius-3xl: 1.5rem;\\n --radius-4xl: 2rem;\\n\\n --shadow-2xs: 0 1px rgb(0 0 0 / 0.05);\\n --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);\\n --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\\n --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\\n --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\\n --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\\n --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);\\n\\n --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05);\\n --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05);\\n --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05);\\n\\n --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);\\n --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);\\n --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12);\\n --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15);\\n --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);\\n --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);\\n\\n --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15);\\n --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2);\\n --text-shadow-sm:\\n 0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075);\\n --text-shadow-md:\\n 0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1);\\n --text-shadow-lg:\\n 0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1);\\n\\n --ease-in: cubic-bezier(0.4, 0, 1, 1);\\n --ease-out: cubic-bezier(0, 0, 0.2, 1);\\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\\n\\n --animate-spin: spin 1s linear infinite;\\n --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;\\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\\n --animate-bounce: bounce 1s infinite;\\n\\n @keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n }\\n\\n @keyframes ping {\\n 75%,\\n 100% {\\n transform: scale(2);\\n opacity: 0;\\n }\\n }\\n\\n @keyframes pulse {\\n 50% {\\n opacity: 0.5;\\n }\\n }\\n\\n @keyframes bounce {\\n 0%,\\n 100% {\\n transform: translateY(-25%);\\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\\n }\\n\\n 50% {\\n transform: none;\\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\\n }\\n }\\n\\n --blur-xs: 4px;\\n --blur-sm: 8px;\\n --blur-md: 12px;\\n --blur-lg: 16px;\\n --blur-xl: 24px;\\n --blur-2xl: 40px;\\n --blur-3xl: 64px;\\n\\n --perspective-dramatic: 100px;\\n --perspective-near: 300px;\\n --perspective-normal: 500px;\\n --perspective-midrange: 800px;\\n --perspective-distant: 1200px;\\n\\n --aspect-video: 16 / 9;\\n\\n --default-transition-duration: 150ms;\\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\\n --default-font-family: --theme(--font-sans, initial);\\n --default-font-feature-settings: --theme(--font-sans--font-feature-settings, initial);\\n --default-font-variation-settings: --theme(--font-sans--font-variation-settings, initial);\\n --default-mono-font-family: --theme(--font-mono, initial);\\n --default-mono-font-feature-settings: --theme(--font-mono--font-feature-settings, initial);\\n --default-mono-font-variation-settings: --theme(--font-mono--font-variation-settings, initial);\\n}\\n\\n/* Deprecated */\\n@theme default inline reference {\\n --blur: 8px;\\n --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\\n --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\\n --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);\\n --radius: 0.25rem;\\n --max-width-prose: 65ch;\\n}\\n\";\n","import { compile } from 'tailwindcss';\n\n// Loaded as `theme(reference)` below so utilities can resolve theme-dependent\n// values (colors, spacing, font sizes, ...) without re-emitting the `@theme`\n// block itself — see https://tailwindcss.com/docs/functions-and-directives#reference-directive.\n// A checked-in copy (not a `?raw` import of the real file) because `?raw` is\n// a Vite convention tsdown's bundler doesn't resolve, which would otherwise\n// ship an unresolved specifier in dist/ that breaks for non-Vite consumers.\nimport themeCSS from './theme-css';\n\nconst compileClasses = async (classes: string[]): Promise<string> => {\n if (classes.length === 0) {\n return '';\n }\n\n const compiler = await compile(\n `@import \"tailwindcss/theme.css\" theme(reference); @tailwind utilities;`,\n {\n loadStylesheet: async () => ({\n content: themeCSS,\n base: '',\n path: 'tailwindcss/theme.css',\n }),\n },\n );\n\n return compiler.build(classes);\n};\n\n// Scans an already-rendered DOM subtree for `class` attributes, rather than\n// regex-scanning the compiled source text. Source-text scanning can only see\n// classes the reader typed literally (e.g. `className=\"p-6\"`) — it has no\n// way to know what classes an imported component (e.g. ui-kit's `Button`,\n// `Typography.Title`) renders internally, since those live in that\n// component's own compiled output, not the previewed source. Scanning the\n// real DOM after mount catches both, because by then every class — reader-\n// authored or contributed by a component — is actually present as an\n// attribute.\nexport const generateTailwindCSSFromDOM = async (\n root: Element,\n): Promise<string> => {\n const classes = new Set<string>();\n\n const collect = (el: Element) => {\n el.getAttribute('class')\n ?.split(/\\s+/)\n .forEach(cls => {\n if (cls.trim()) {\n classes.add(cls.trim());\n }\n });\n };\n\n collect(root);\n root.querySelectorAll('[class]').forEach(collect);\n\n return compileClasses(Array.from(classes));\n};\n"],"mappings":";;AAYA,IAAA,oBAAe;;;ACFf,MAAM,iBAAiB,OAAO,YAAuC;CACnE,IAAI,QAAQ,WAAW,GACrB,OAAO;CAcT,QAAO,MAXgB,QACrB,0EACA,EACE,gBAAgB,aAAa;EAC3B,SAASA;EACT,MAAM;EACN,MAAM;CACR,GACF,CACF,EAAA,CAEgB,MAAM,OAAO;AAC/B;AAWA,MAAa,6BAA6B,OACxC,SACoB;CACpB,MAAM,0BAAU,IAAI,IAAY;CAEhC,MAAM,WAAW,OAAgB;EAC/B,GAAG,aAAa,OAAO,CAAC,EACpB,MAAM,KAAK,CAAC,CACb,SAAQ,QAAO;GACd,IAAI,IAAI,KAAK,GACX,QAAQ,IAAI,IAAI,KAAK,CAAC;EAE1B,CAAC;CACL;CAEA,QAAQ,IAAI;CACZ,KAAK,iBAAiB,SAAS,CAAC,CAAC,QAAQ,OAAO;CAEhD,OAAO,eAAe,MAAM,KAAK,OAAO,CAAC;AAC3C"}
1
+ {"version":3,"file":"index.js","names":["themeCSS"],"sources":["../../../src/utils/tailwind/theme-css.ts","../../../src/utils/tailwind/index.ts"],"sourcesContent":["// Generated from `tailwindcss/theme.css` (v4.3.3). Don't edit by hand.\n//\n// Tailwind's default theme, which `generateTailwindCSS()` needs to resolve\n// most utilities. Inlined as a string because a `?raw` import works only in\n// Vite. Regenerate after updating `tailwindcss`, with the snippet in the\n// commit that added this file.\n\nexport default \"@theme default {\\n --font-sans:\\n -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial,\\n sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\\n --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;\\n --font-mono:\\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\\n monospace;\\n\\n --color-red-50: oklch(97.1% 0.013 17.38);\\n --color-red-100: oklch(93.6% 0.032 17.717);\\n --color-red-200: oklch(88.5% 0.062 18.334);\\n --color-red-300: oklch(80.8% 0.114 19.571);\\n --color-red-400: oklch(70.4% 0.191 22.216);\\n --color-red-500: oklch(63.7% 0.237 25.331);\\n --color-red-600: oklch(57.7% 0.245 27.325);\\n --color-red-700: oklch(50.5% 0.213 27.518);\\n --color-red-800: oklch(44.4% 0.177 26.899);\\n --color-red-900: oklch(39.6% 0.141 25.723);\\n --color-red-950: oklch(25.8% 0.092 26.042);\\n\\n --color-orange-50: oklch(98% 0.016 73.684);\\n --color-orange-100: oklch(95.4% 0.038 75.164);\\n --color-orange-200: oklch(90.1% 0.076 70.697);\\n --color-orange-300: oklch(83.7% 0.128 66.29);\\n --color-orange-400: oklch(75% 0.183 55.934);\\n --color-orange-500: oklch(70.5% 0.213 47.604);\\n --color-orange-600: oklch(64.6% 0.222 41.116);\\n --color-orange-700: oklch(55.3% 0.195 38.402);\\n --color-orange-800: oklch(47% 0.157 37.304);\\n --color-orange-900: oklch(40.8% 0.123 38.172);\\n --color-orange-950: oklch(26.6% 0.079 36.259);\\n\\n --color-amber-50: oklch(98.7% 0.022 95.277);\\n --color-amber-100: oklch(96.2% 0.059 95.617);\\n --color-amber-200: oklch(92.4% 0.12 95.746);\\n --color-amber-300: oklch(87.9% 0.169 91.605);\\n --color-amber-400: oklch(82.8% 0.189 84.429);\\n --color-amber-500: oklch(76.9% 0.188 70.08);\\n --color-amber-600: oklch(66.6% 0.179 58.318);\\n --color-amber-700: oklch(55.5% 0.163 48.998);\\n --color-amber-800: oklch(47.3% 0.137 46.201);\\n --color-amber-900: oklch(41.4% 0.112 45.904);\\n --color-amber-950: oklch(27.9% 0.077 45.635);\\n\\n --color-yellow-50: oklch(98.7% 0.026 102.212);\\n --color-yellow-100: oklch(97.3% 0.071 103.193);\\n --color-yellow-200: oklch(94.5% 0.129 101.54);\\n --color-yellow-300: oklch(90.5% 0.182 98.111);\\n --color-yellow-400: oklch(85.2% 0.199 91.936);\\n --color-yellow-500: oklch(79.5% 0.184 86.047);\\n --color-yellow-600: oklch(68.1% 0.162 75.834);\\n --color-yellow-700: oklch(55.4% 0.135 66.442);\\n --color-yellow-800: oklch(47.6% 0.114 61.907);\\n --color-yellow-900: oklch(42.1% 0.095 57.708);\\n --color-yellow-950: oklch(28.6% 0.066 53.813);\\n\\n --color-lime-50: oklch(98.6% 0.031 120.757);\\n --color-lime-100: oklch(96.7% 0.067 122.328);\\n --color-lime-200: oklch(93.8% 0.127 124.321);\\n --color-lime-300: oklch(89.7% 0.196 126.665);\\n --color-lime-400: oklch(84.1% 0.238 128.85);\\n --color-lime-500: oklch(76.8% 0.233 130.85);\\n --color-lime-600: oklch(64.8% 0.2 131.684);\\n --color-lime-700: oklch(53.2% 0.157 131.589);\\n --color-lime-800: oklch(45.3% 0.124 130.933);\\n --color-lime-900: oklch(40.5% 0.101 131.063);\\n --color-lime-950: oklch(27.4% 0.072 132.109);\\n\\n --color-green-50: oklch(98.2% 0.018 155.826);\\n --color-green-100: oklch(96.2% 0.044 156.743);\\n --color-green-200: oklch(92.5% 0.084 155.995);\\n --color-green-300: oklch(87.1% 0.15 154.449);\\n --color-green-400: oklch(79.2% 0.209 151.711);\\n --color-green-500: oklch(72.3% 0.219 149.579);\\n --color-green-600: oklch(62.7% 0.194 149.214);\\n --color-green-700: oklch(52.7% 0.154 150.069);\\n --color-green-800: oklch(44.8% 0.119 151.328);\\n --color-green-900: oklch(39.3% 0.095 152.535);\\n --color-green-950: oklch(26.6% 0.065 152.934);\\n\\n --color-emerald-50: oklch(97.9% 0.021 166.113);\\n --color-emerald-100: oklch(95% 0.052 163.051);\\n --color-emerald-200: oklch(90.5% 0.093 164.15);\\n --color-emerald-300: oklch(84.5% 0.143 164.978);\\n --color-emerald-400: oklch(76.5% 0.177 163.223);\\n --color-emerald-500: oklch(69.6% 0.17 162.48);\\n --color-emerald-600: oklch(59.6% 0.145 163.225);\\n --color-emerald-700: oklch(50.8% 0.118 165.612);\\n --color-emerald-800: oklch(43.2% 0.095 166.913);\\n --color-emerald-900: oklch(37.8% 0.077 168.94);\\n --color-emerald-950: oklch(26.2% 0.051 172.552);\\n\\n --color-teal-50: oklch(98.4% 0.014 180.72);\\n --color-teal-100: oklch(95.3% 0.051 180.801);\\n --color-teal-200: oklch(91% 0.096 180.426);\\n --color-teal-300: oklch(85.5% 0.138 181.071);\\n --color-teal-400: oklch(77.7% 0.152 181.912);\\n --color-teal-500: oklch(70.4% 0.14 182.503);\\n --color-teal-600: oklch(60% 0.118 184.704);\\n --color-teal-700: oklch(51.1% 0.096 186.391);\\n --color-teal-800: oklch(43.7% 0.078 188.216);\\n --color-teal-900: oklch(38.6% 0.063 188.416);\\n --color-teal-950: oklch(27.7% 0.046 192.524);\\n\\n --color-cyan-50: oklch(98.4% 0.019 200.873);\\n --color-cyan-100: oklch(95.6% 0.045 203.388);\\n --color-cyan-200: oklch(91.7% 0.08 205.041);\\n --color-cyan-300: oklch(86.5% 0.127 207.078);\\n --color-cyan-400: oklch(78.9% 0.154 211.53);\\n --color-cyan-500: oklch(71.5% 0.143 215.221);\\n --color-cyan-600: oklch(60.9% 0.126 221.723);\\n --color-cyan-700: oklch(52% 0.105 223.128);\\n --color-cyan-800: oklch(45% 0.085 224.283);\\n --color-cyan-900: oklch(39.8% 0.07 227.392);\\n --color-cyan-950: oklch(30.2% 0.056 229.695);\\n\\n --color-sky-50: oklch(97.7% 0.013 236.62);\\n --color-sky-100: oklch(95.1% 0.026 236.824);\\n --color-sky-200: oklch(90.1% 0.058 230.902);\\n --color-sky-300: oklch(82.8% 0.111 230.318);\\n --color-sky-400: oklch(74.6% 0.16 232.661);\\n --color-sky-500: oklch(68.5% 0.169 237.323);\\n --color-sky-600: oklch(58.8% 0.158 241.966);\\n --color-sky-700: oklch(50% 0.134 242.749);\\n --color-sky-800: oklch(44.3% 0.11 240.79);\\n --color-sky-900: oklch(39.1% 0.09 240.876);\\n --color-sky-950: oklch(29.3% 0.066 243.157);\\n\\n --color-blue-50: oklch(97% 0.014 254.604);\\n --color-blue-100: oklch(93.2% 0.032 255.585);\\n --color-blue-200: oklch(88.2% 0.059 254.128);\\n --color-blue-300: oklch(80.9% 0.105 251.813);\\n --color-blue-400: oklch(70.7% 0.165 254.624);\\n --color-blue-500: oklch(62.3% 0.214 259.815);\\n --color-blue-600: oklch(54.6% 0.245 262.881);\\n --color-blue-700: oklch(48.8% 0.243 264.376);\\n --color-blue-800: oklch(42.4% 0.199 265.638);\\n --color-blue-900: oklch(37.9% 0.146 265.522);\\n --color-blue-950: oklch(28.2% 0.091 267.935);\\n\\n --color-indigo-50: oklch(96.2% 0.018 272.314);\\n --color-indigo-100: oklch(93% 0.034 272.788);\\n --color-indigo-200: oklch(87% 0.065 274.039);\\n --color-indigo-300: oklch(78.5% 0.115 274.713);\\n --color-indigo-400: oklch(67.3% 0.182 276.935);\\n --color-indigo-500: oklch(58.5% 0.233 277.117);\\n --color-indigo-600: oklch(51.1% 0.262 276.966);\\n --color-indigo-700: oklch(45.7% 0.24 277.023);\\n --color-indigo-800: oklch(39.8% 0.195 277.366);\\n --color-indigo-900: oklch(35.9% 0.144 278.697);\\n --color-indigo-950: oklch(25.7% 0.09 281.288);\\n\\n --color-violet-50: oklch(96.9% 0.016 293.756);\\n --color-violet-100: oklch(94.3% 0.029 294.588);\\n --color-violet-200: oklch(89.4% 0.057 293.283);\\n --color-violet-300: oklch(81.1% 0.111 293.571);\\n --color-violet-400: oklch(70.2% 0.183 293.541);\\n --color-violet-500: oklch(60.6% 0.25 292.717);\\n --color-violet-600: oklch(54.1% 0.281 293.009);\\n --color-violet-700: oklch(49.1% 0.27 292.581);\\n --color-violet-800: oklch(43.2% 0.232 292.759);\\n --color-violet-900: oklch(38% 0.189 293.745);\\n --color-violet-950: oklch(28.3% 0.141 291.089);\\n\\n --color-purple-50: oklch(97.7% 0.014 308.299);\\n --color-purple-100: oklch(94.6% 0.033 307.174);\\n --color-purple-200: oklch(90.2% 0.063 306.703);\\n --color-purple-300: oklch(82.7% 0.119 306.383);\\n --color-purple-400: oklch(71.4% 0.203 305.504);\\n --color-purple-500: oklch(62.7% 0.265 303.9);\\n --color-purple-600: oklch(55.8% 0.288 302.321);\\n --color-purple-700: oklch(49.6% 0.265 301.924);\\n --color-purple-800: oklch(43.8% 0.218 303.724);\\n --color-purple-900: oklch(38.1% 0.176 304.987);\\n --color-purple-950: oklch(29.1% 0.149 302.717);\\n\\n --color-fuchsia-50: oklch(97.7% 0.017 320.058);\\n --color-fuchsia-100: oklch(95.2% 0.037 318.852);\\n --color-fuchsia-200: oklch(90.3% 0.076 319.62);\\n --color-fuchsia-300: oklch(83.3% 0.145 321.434);\\n --color-fuchsia-400: oklch(74% 0.238 322.16);\\n --color-fuchsia-500: oklch(66.7% 0.295 322.15);\\n --color-fuchsia-600: oklch(59.1% 0.293 322.896);\\n --color-fuchsia-700: oklch(51.8% 0.253 323.949);\\n --color-fuchsia-800: oklch(45.2% 0.211 324.591);\\n --color-fuchsia-900: oklch(40.1% 0.17 325.612);\\n --color-fuchsia-950: oklch(29.3% 0.136 325.661);\\n\\n --color-pink-50: oklch(97.1% 0.014 343.198);\\n --color-pink-100: oklch(94.8% 0.028 342.258);\\n --color-pink-200: oklch(89.9% 0.061 343.231);\\n --color-pink-300: oklch(82.3% 0.12 346.018);\\n --color-pink-400: oklch(71.8% 0.202 349.761);\\n --color-pink-500: oklch(65.6% 0.241 354.308);\\n --color-pink-600: oklch(59.2% 0.249 0.584);\\n --color-pink-700: oklch(52.5% 0.223 3.958);\\n --color-pink-800: oklch(45.9% 0.187 3.815);\\n --color-pink-900: oklch(40.8% 0.153 2.432);\\n --color-pink-950: oklch(28.4% 0.109 3.907);\\n\\n --color-rose-50: oklch(96.9% 0.015 12.422);\\n --color-rose-100: oklch(94.1% 0.03 12.58);\\n --color-rose-200: oklch(89.2% 0.058 10.001);\\n --color-rose-300: oklch(81% 0.117 11.638);\\n --color-rose-400: oklch(71.2% 0.194 13.428);\\n --color-rose-500: oklch(64.5% 0.246 16.439);\\n --color-rose-600: oklch(58.6% 0.253 17.585);\\n --color-rose-700: oklch(51.4% 0.222 16.935);\\n --color-rose-800: oklch(45.5% 0.188 13.697);\\n --color-rose-900: oklch(41% 0.159 10.272);\\n --color-rose-950: oklch(27.1% 0.105 12.094);\\n\\n --color-slate-50: oklch(98.4% 0.003 247.858);\\n --color-slate-100: oklch(96.8% 0.007 247.896);\\n --color-slate-200: oklch(92.9% 0.013 255.508);\\n --color-slate-300: oklch(86.9% 0.022 252.894);\\n --color-slate-400: oklch(70.4% 0.04 256.788);\\n --color-slate-500: oklch(55.4% 0.046 257.417);\\n --color-slate-600: oklch(44.6% 0.043 257.281);\\n --color-slate-700: oklch(37.2% 0.044 257.287);\\n --color-slate-800: oklch(27.9% 0.041 260.031);\\n --color-slate-900: oklch(20.8% 0.042 265.755);\\n --color-slate-950: oklch(12.9% 0.042 264.695);\\n\\n --color-gray-50: oklch(98.5% 0.002 247.839);\\n --color-gray-100: oklch(96.7% 0.003 264.542);\\n --color-gray-200: oklch(92.8% 0.006 264.531);\\n --color-gray-300: oklch(87.2% 0.01 258.338);\\n --color-gray-400: oklch(70.7% 0.022 261.325);\\n --color-gray-500: oklch(55.1% 0.027 264.364);\\n --color-gray-600: oklch(44.6% 0.03 256.802);\\n --color-gray-700: oklch(37.3% 0.034 259.733);\\n --color-gray-800: oklch(27.8% 0.033 256.848);\\n --color-gray-900: oklch(21% 0.034 264.665);\\n --color-gray-950: oklch(13% 0.028 261.692);\\n\\n --color-zinc-50: oklch(98.5% 0 none);\\n --color-zinc-100: oklch(96.7% 0.001 286.375);\\n --color-zinc-200: oklch(92% 0.004 286.32);\\n --color-zinc-300: oklch(87.1% 0.006 286.286);\\n --color-zinc-400: oklch(70.5% 0.015 286.067);\\n --color-zinc-500: oklch(55.2% 0.016 285.938);\\n --color-zinc-600: oklch(44.2% 0.017 285.786);\\n --color-zinc-700: oklch(37% 0.013 285.805);\\n --color-zinc-800: oklch(27.4% 0.006 286.033);\\n --color-zinc-900: oklch(21% 0.006 285.885);\\n --color-zinc-950: oklch(14.1% 0.005 285.823);\\n\\n --color-neutral-50: oklch(98.5% 0 none);\\n --color-neutral-100: oklch(97% 0 none);\\n --color-neutral-200: oklch(92.2% 0 none);\\n --color-neutral-300: oklch(87% 0 none);\\n --color-neutral-400: oklch(70.8% 0 none);\\n --color-neutral-500: oklch(55.6% 0 none);\\n --color-neutral-600: oklch(43.9% 0 none);\\n --color-neutral-700: oklch(37.1% 0 none);\\n --color-neutral-800: oklch(26.9% 0 none);\\n --color-neutral-900: oklch(20.5% 0 none);\\n --color-neutral-950: oklch(14.5% 0 none);\\n\\n --color-stone-50: oklch(98.5% 0.001 106.423);\\n --color-stone-100: oklch(97% 0.001 106.424);\\n --color-stone-200: oklch(92.3% 0.003 48.717);\\n --color-stone-300: oklch(86.9% 0.005 56.366);\\n --color-stone-400: oklch(70.9% 0.01 56.259);\\n --color-stone-500: oklch(55.3% 0.013 58.071);\\n --color-stone-600: oklch(44.4% 0.011 73.639);\\n --color-stone-700: oklch(37.4% 0.01 67.558);\\n --color-stone-800: oklch(26.8% 0.007 34.298);\\n --color-stone-900: oklch(21.6% 0.006 56.043);\\n --color-stone-950: oklch(14.7% 0.004 49.25);\\n\\n --color-mauve-50: oklch(98.5% 0 none);\\n --color-mauve-100: oklch(96% 0.003 325.6);\\n --color-mauve-200: oklch(92.2% 0.005 325.62);\\n --color-mauve-300: oklch(86.5% 0.012 325.68);\\n --color-mauve-400: oklch(71.1% 0.019 323.02);\\n --color-mauve-500: oklch(54.2% 0.034 322.5);\\n --color-mauve-600: oklch(43.5% 0.029 321.78);\\n --color-mauve-700: oklch(36.4% 0.029 323.89);\\n --color-mauve-800: oklch(26.3% 0.024 320.12);\\n --color-mauve-900: oklch(21.2% 0.019 322.12);\\n --color-mauve-950: oklch(14.5% 0.008 326);\\n\\n --color-olive-50: oklch(98.8% 0.003 106.5);\\n --color-olive-100: oklch(96.6% 0.005 106.5);\\n --color-olive-200: oklch(93% 0.007 106.5);\\n --color-olive-300: oklch(88% 0.011 106.6);\\n --color-olive-400: oklch(73.7% 0.021 106.9);\\n --color-olive-500: oklch(58% 0.031 107.3);\\n --color-olive-600: oklch(46.6% 0.025 107.3);\\n --color-olive-700: oklch(39.4% 0.023 107.4);\\n --color-olive-800: oklch(28.6% 0.016 107.4);\\n --color-olive-900: oklch(22.8% 0.013 107.4);\\n --color-olive-950: oklch(15.3% 0.006 107.1);\\n\\n --color-mist-50: oklch(98.7% 0.002 197.1);\\n --color-mist-100: oklch(96.3% 0.002 197.1);\\n --color-mist-200: oklch(92.5% 0.005 214.3);\\n --color-mist-300: oklch(87.2% 0.007 219.6);\\n --color-mist-400: oklch(72.3% 0.014 214.4);\\n --color-mist-500: oklch(56% 0.021 213.5);\\n --color-mist-600: oklch(45% 0.017 213.2);\\n --color-mist-700: oklch(37.8% 0.015 216);\\n --color-mist-800: oklch(27.5% 0.011 216.9);\\n --color-mist-900: oklch(21.8% 0.008 223.9);\\n --color-mist-950: oklch(14.8% 0.004 228.8);\\n\\n --color-taupe-50: oklch(98.6% 0.002 67.8);\\n --color-taupe-100: oklch(96% 0.002 17.2);\\n --color-taupe-200: oklch(92.2% 0.005 34.3);\\n --color-taupe-300: oklch(86.8% 0.007 39.5);\\n --color-taupe-400: oklch(71.4% 0.014 41.2);\\n --color-taupe-500: oklch(54.7% 0.021 43.1);\\n --color-taupe-600: oklch(43.8% 0.017 39.3);\\n --color-taupe-700: oklch(36.7% 0.016 35.7);\\n --color-taupe-800: oklch(26.8% 0.011 36.5);\\n --color-taupe-900: oklch(21.4% 0.009 43.1);\\n --color-taupe-950: oklch(14.7% 0.004 49.3);\\n\\n --color-black: #000;\\n --color-white: #fff;\\n\\n --spacing: 0.25rem;\\n\\n --breakpoint-sm: 40rem;\\n --breakpoint-md: 48rem;\\n --breakpoint-lg: 64rem;\\n --breakpoint-xl: 80rem;\\n --breakpoint-2xl: 96rem;\\n\\n --container-3xs: 16rem;\\n --container-2xs: 18rem;\\n --container-xs: 20rem;\\n --container-sm: 24rem;\\n --container-md: 28rem;\\n --container-lg: 32rem;\\n --container-xl: 36rem;\\n --container-2xl: 42rem;\\n --container-3xl: 48rem;\\n --container-4xl: 56rem;\\n --container-5xl: 64rem;\\n --container-6xl: 72rem;\\n --container-7xl: 80rem;\\n\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\n --text-sm: 0.875rem;\\n --text-sm--line-height: calc(1.25 / 0.875);\\n --text-base: 1rem;\\n --text-base--line-height: calc(1.5 / 1);\\n --text-lg: 1.125rem;\\n --text-lg--line-height: calc(1.75 / 1.125);\\n --text-xl: 1.25rem;\\n --text-xl--line-height: calc(1.75 / 1.25);\\n --text-2xl: 1.5rem;\\n --text-2xl--line-height: calc(2 / 1.5);\\n --text-3xl: 1.875rem;\\n --text-3xl--line-height: calc(2.25 / 1.875);\\n --text-4xl: 2.25rem;\\n --text-4xl--line-height: calc(2.5 / 2.25);\\n --text-5xl: 3rem;\\n --text-5xl--line-height: 1;\\n --text-6xl: 3.75rem;\\n --text-6xl--line-height: 1;\\n --text-7xl: 4.5rem;\\n --text-7xl--line-height: 1;\\n --text-8xl: 6rem;\\n --text-8xl--line-height: 1;\\n --text-9xl: 8rem;\\n --text-9xl--line-height: 1;\\n\\n --font-weight-thin: 100;\\n --font-weight-extralight: 200;\\n --font-weight-light: 300;\\n --font-weight-normal: 400;\\n --font-weight-medium: 500;\\n --font-weight-semibold: 600;\\n --font-weight-bold: 700;\\n --font-weight-extrabold: 800;\\n --font-weight-black: 900;\\n\\n --tracking-tighter: -0.05em;\\n --tracking-tight: -0.025em;\\n --tracking-normal: 0em;\\n --tracking-wide: 0.025em;\\n --tracking-wider: 0.05em;\\n --tracking-widest: 0.1em;\\n\\n --leading-tight: 1.25;\\n --leading-snug: 1.375;\\n --leading-normal: 1.5;\\n --leading-relaxed: 1.625;\\n --leading-loose: 2;\\n\\n --radius-xs: 0.125rem;\\n --radius-sm: 0.25rem;\\n --radius-md: 0.375rem;\\n --radius-lg: 0.5rem;\\n --radius-xl: 0.75rem;\\n --radius-2xl: 1rem;\\n --radius-3xl: 1.5rem;\\n --radius-4xl: 2rem;\\n\\n --shadow-2xs: 0 1px rgb(0 0 0 / 0.05);\\n --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);\\n --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\\n --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\\n --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\\n --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\\n --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);\\n\\n --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05);\\n --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05);\\n --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05);\\n\\n --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);\\n --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);\\n --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12);\\n --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15);\\n --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);\\n --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);\\n\\n --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15);\\n --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2);\\n --text-shadow-sm:\\n 0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075);\\n --text-shadow-md:\\n 0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1);\\n --text-shadow-lg:\\n 0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1);\\n\\n --ease-in: cubic-bezier(0.4, 0, 1, 1);\\n --ease-out: cubic-bezier(0, 0, 0.2, 1);\\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\\n\\n --animate-spin: spin 1s linear infinite;\\n --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;\\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\\n --animate-bounce: bounce 1s infinite;\\n\\n @keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n }\\n\\n @keyframes ping {\\n 75%,\\n 100% {\\n transform: scale(2);\\n opacity: 0;\\n }\\n }\\n\\n @keyframes pulse {\\n 50% {\\n opacity: 0.5;\\n }\\n }\\n\\n @keyframes bounce {\\n 0%,\\n 100% {\\n transform: translateY(-25%);\\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\\n }\\n\\n 50% {\\n transform: none;\\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\\n }\\n }\\n\\n --blur-xs: 4px;\\n --blur-sm: 8px;\\n --blur-md: 12px;\\n --blur-lg: 16px;\\n --blur-xl: 24px;\\n --blur-2xl: 40px;\\n --blur-3xl: 64px;\\n\\n --perspective-dramatic: 100px;\\n --perspective-near: 300px;\\n --perspective-normal: 500px;\\n --perspective-midrange: 800px;\\n --perspective-distant: 1200px;\\n\\n --aspect-video: 16 / 9;\\n\\n --default-transition-duration: 150ms;\\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\\n --default-font-family: --theme(--font-sans, initial);\\n --default-font-feature-settings: --theme(--font-sans--font-feature-settings, initial);\\n --default-font-variation-settings: --theme(--font-sans--font-variation-settings, initial);\\n --default-mono-font-family: --theme(--font-mono, initial);\\n --default-mono-font-feature-settings: --theme(--font-mono--font-feature-settings, initial);\\n --default-mono-font-variation-settings: --theme(--font-mono--font-variation-settings, initial);\\n}\\n\\n/* Deprecated */\\n@theme default inline reference {\\n --blur: 8px;\\n --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\\n --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\\n --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);\\n --radius: 0.25rem;\\n --max-width-prose: 65ch;\\n}\\n\";\n","import { compile } from 'tailwindcss';\n\n// Loaded with `reference`, so utilities can use theme values without\n// emitting the `@theme` block (https://tailwindcss.com/docs/functions-and-directives#reference-directive).\n// A copied file, not a `?raw` import, which only Vite understands.\nimport themeCSS from './theme-css';\n\nconst compileClasses = async (classes: string[]): Promise<string> => {\n if (classes.length === 0) {\n return '';\n }\n\n const compiler = await compile(\n `@import \"tailwindcss/theme.css\" theme(reference); @tailwind utilities;`,\n {\n loadStylesheet: async () => ({\n content: themeCSS,\n base: '',\n path: 'tailwindcss/theme.css',\n }),\n },\n );\n\n return compiler.build(classes);\n};\n\n// Collects the classes in a rendered DOM subtree. Reading the DOM, not the\n// source, finds classes that imported components (such as ui-kit's\n// `Button`) render too.\nexport const generateTailwindCSSFromDOM = async (\n root: Element,\n): Promise<string> => {\n const classes = new Set<string>();\n\n const collect = (el: Element) => {\n el.getAttribute('class')\n ?.split(/\\s+/)\n .forEach(cls => {\n if (cls.trim()) {\n classes.add(cls.trim());\n }\n });\n };\n\n collect(root);\n root.querySelectorAll('[class]').forEach(collect);\n\n return compileClasses(Array.from(classes));\n};\n"],"mappings":";;AAOA,IAAA,oBAAe;;;ACAf,MAAM,iBAAiB,OAAO,YAAuC;CACnE,IAAI,QAAQ,WAAW,GACrB,OAAO;CAcT,QAAO,MAXgB,QACrB,0EACA,EACE,gBAAgB,aAAa;EAC3B,SAASA;EACT,MAAM;EACN,MAAM;CACR,GACF,CACF,EAAA,CAEgB,MAAM,OAAO;AAC/B;AAKA,MAAa,6BAA6B,OACxC,SACoB;CACpB,MAAM,0BAAU,IAAI,IAAY;CAEhC,MAAM,WAAW,OAAgB;EAC/B,GAAG,aAAa,OAAO,CAAC,EACpB,MAAM,KAAK,CAAC,CACb,SAAQ,QAAO;GACd,IAAI,IAAI,KAAK,GACX,QAAQ,IAAI,IAAI,KAAK,CAAC;EAE1B,CAAC;CACL;CAEA,QAAQ,IAAI;CACZ,KAAK,iBAAiB,SAAS,CAAC,CAAC,QAAQ,OAAO;CAEhD,OAAO,eAAe,MAAM,KAAK,OAAO,CAAC;AAC3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate-iLo8IONY.js","names":[],"sources":["../src/utils/ast/validate.ts"],"sourcesContent":["import type { BindingItem } from './types';\n\nexport interface ValidationResult {\n valid: boolean;\n message?: string;\n}\n\n// The messages a failed check returns. Pass your own through `options` to\n// translate them; the built-in panel passes the provider's `validation`\n// messages (#524).\nexport interface ValidationMessages {\n required: string;\n min: (min: number) => string;\n max: (max: number) => string;\n pattern: string;\n url: string;\n date: string;\n}\n\nexport const defaultValidationMessages: ValidationMessages = {\n required: 'This field is required.',\n min: min => `Must be at least ${min}.`,\n max: max => `Must be at most ${max}.`,\n pattern: 'Value does not match the required format.',\n url: 'Must be a valid URL.',\n date: 'Must be a valid date.',\n};\n\nexport interface ValidationOptions {\n messages?: Partial<ValidationMessages>;\n}\n\nconst VALID: ValidationResult = { valid: true };\n\nexport const validateBindingValue = (\n binding: BindingItem,\n value: unknown,\n options: ValidationOptions = {},\n): ValidationResult => {\n const messages = { ...defaultValidationMessages, ...options.messages };\n const isEmpty = value === '' || value === null || value === undefined;\n\n if (isEmpty) {\n if (binding.required) {\n return { valid: false, message: messages.required };\n }\n return VALID;\n }\n\n // `min`/`max` compare against a real number. Since #238, a `type:\n // 'number'` binding delivers an actual number across the panel boundary,\n // so callers pass one here directly — no string coercion to re-derive the\n // type. A non-number value simply isn't range-checked.\n if (typeof value === 'number') {\n if (binding.min !== undefined && value < binding.min) {\n return { valid: false, message: messages.min(binding.min) };\n }\n if (binding.max !== undefined && value > binding.max) {\n return { valid: false, message: messages.max(binding.max) };\n }\n }\n\n if (typeof value === 'string' && binding.pattern) {\n let regex: RegExp;\n\n try {\n regex = new RegExp(binding.pattern);\n } catch {\n // Malformed pattern authored on the binding itself — don't block the\n // user's input for an authoring mistake that isn't theirs to fix.\n return VALID;\n }\n\n if (!regex.test(value)) {\n return {\n valid: false,\n message: messages.pattern,\n };\n }\n }\n\n if (typeof value === 'string' && binding.type === 'url') {\n try {\n new URL(value);\n } catch {\n return { valid: false, message: messages.url };\n }\n }\n\n if (typeof value === 'string' && binding.type === 'date') {\n if (Number.isNaN(Date.parse(value))) {\n return { valid: false, message: messages.date };\n }\n }\n\n return VALID;\n};\n"],"mappings":";AAmBA,MAAa,4BAAgD;CAC3D,UAAU;CACV,MAAK,QAAO,oBAAoB,IAAI;CACpC,MAAK,QAAO,mBAAmB,IAAI;CACnC,SAAS;CACT,KAAK;CACL,MAAM;AACR;AAMA,MAAM,QAA0B,EAAE,OAAO,KAAK;AAE9C,MAAa,wBACX,SACA,OACA,UAA6B,CAAC,MACT;CACrB,MAAM,WAAW;EAAE,GAAG;EAA2B,GAAG,QAAQ;CAAS;CAGrE,IAFgB,UAAU,MAAM,UAAU,QAAQ,UAAU,KAAA,GAE/C;EACX,IAAI,QAAQ,UACV,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS;EAAS;EAEpD,OAAO;CACT;CAMA,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,QAAQ,QAAQ,KAAA,KAAa,QAAQ,QAAQ,KAC/C,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS,IAAI,QAAQ,GAAG;EAAE;EAE5D,IAAI,QAAQ,QAAQ,KAAA,KAAa,QAAQ,QAAQ,KAC/C,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS,IAAI,QAAQ,GAAG;EAAE;CAE9D;CAEA,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS;EAChD,IAAI;EAEJ,IAAI;GACF,QAAQ,IAAI,OAAO,QAAQ,OAAO;EACpC,QAAQ;GAGN,OAAO;EACT;EAEA,IAAI,CAAC,MAAM,KAAK,KAAK,GACnB,OAAO;GACL,OAAO;GACP,SAAS,SAAS;EACpB;CAEJ;CAEA,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS,OAChD,IAAI;EACF,IAAI,IAAI,KAAK;CACf,QAAQ;EACN,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS;EAAI;CAC/C;CAGF,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS,QAC5C;MAAA,OAAO,MAAM,KAAK,MAAM,KAAK,CAAC,GAChC,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS;EAAK;CAAA;CAIlD,OAAO;AACT"}
1
+ {"version":3,"file":"validate-iLo8IONY.js","names":[],"sources":["../src/utils/ast/validate.ts"],"sourcesContent":["import type { BindingItem } from './types';\n\nexport interface ValidationResult {\n valid: boolean;\n message?: string;\n}\n\n// The messages a failed check returns. Pass your own through `options` to\n// translate them; the built-in panel passes the provider's `validation`\n// messages (#524).\nexport interface ValidationMessages {\n required: string;\n min: (min: number) => string;\n max: (max: number) => string;\n pattern: string;\n url: string;\n date: string;\n}\n\nexport const defaultValidationMessages: ValidationMessages = {\n required: 'This field is required.',\n min: min => `Must be at least ${min}.`,\n max: max => `Must be at most ${max}.`,\n pattern: 'Value does not match the required format.',\n url: 'Must be a valid URL.',\n date: 'Must be a valid date.',\n};\n\nexport interface ValidationOptions {\n messages?: Partial<ValidationMessages>;\n}\n\nconst VALID: ValidationResult = { valid: true };\n\nexport const validateBindingValue = (\n binding: BindingItem,\n value: unknown,\n options: ValidationOptions = {},\n): ValidationResult => {\n const messages = { ...defaultValidationMessages, ...options.messages };\n const isEmpty = value === '' || value === null || value === undefined;\n\n if (isEmpty) {\n if (binding.required) {\n return { valid: false, message: messages.required };\n }\n return VALID;\n }\n\n // `min` and `max` apply to numbers only; a `type: 'number'` field passes\n // a number (#238). Other values aren't range-checked.\n if (typeof value === 'number') {\n if (binding.min !== undefined && value < binding.min) {\n return { valid: false, message: messages.min(binding.min) };\n }\n if (binding.max !== undefined && value > binding.max) {\n return { valid: false, message: messages.max(binding.max) };\n }\n }\n\n if (typeof value === 'string' && binding.pattern) {\n let regex: RegExp;\n\n try {\n regex = new RegExp(binding.pattern);\n } catch {\n // An invalid `pattern` is the binding's mistake, so don't block the\n // input.\n return VALID;\n }\n\n if (!regex.test(value)) {\n return {\n valid: false,\n message: messages.pattern,\n };\n }\n }\n\n if (typeof value === 'string' && binding.type === 'url') {\n try {\n new URL(value);\n } catch {\n return { valid: false, message: messages.url };\n }\n }\n\n if (typeof value === 'string' && binding.type === 'date') {\n if (Number.isNaN(Date.parse(value))) {\n return { valid: false, message: messages.date };\n }\n }\n\n return VALID;\n};\n"],"mappings":";AAmBA,MAAa,4BAAgD;CAC3D,UAAU;CACV,MAAK,QAAO,oBAAoB,IAAI;CACpC,MAAK,QAAO,mBAAmB,IAAI;CACnC,SAAS;CACT,KAAK;CACL,MAAM;AACR;AAMA,MAAM,QAA0B,EAAE,OAAO,KAAK;AAE9C,MAAa,wBACX,SACA,OACA,UAA6B,CAAC,MACT;CACrB,MAAM,WAAW;EAAE,GAAG;EAA2B,GAAG,QAAQ;CAAS;CAGrE,IAFgB,UAAU,MAAM,UAAU,QAAQ,UAAU,KAAA,GAE/C;EACX,IAAI,QAAQ,UACV,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS;EAAS;EAEpD,OAAO;CACT;CAIA,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,QAAQ,QAAQ,KAAA,KAAa,QAAQ,QAAQ,KAC/C,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS,IAAI,QAAQ,GAAG;EAAE;EAE5D,IAAI,QAAQ,QAAQ,KAAA,KAAa,QAAQ,QAAQ,KAC/C,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS,IAAI,QAAQ,GAAG;EAAE;CAE9D;CAEA,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS;EAChD,IAAI;EAEJ,IAAI;GACF,QAAQ,IAAI,OAAO,QAAQ,OAAO;EACpC,QAAQ;GAGN,OAAO;EACT;EAEA,IAAI,CAAC,MAAM,KAAK,KAAK,GACnB,OAAO;GACL,OAAO;GACP,SAAS,SAAS;EACpB;CAEJ;CAEA,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS,OAChD,IAAI;EACF,IAAI,IAAI,KAAK;CACf,QAAQ;EACN,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS;EAAI;CAC/C;CAGF,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS,QAC5C;MAAA,OAAO,MAAM,KAAK,MAAM,KAAK,CAAC,GAChC,OAAO;GAAE,OAAO;GAAO,SAAS,SAAS;EAAK;CAAA;CAIlD,OAAO;AACT"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "4.5.0",
7
+ "version": "4.6.0",
8
8
  "type": "module",
9
9
  "module": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",
@@ -1 +0,0 @@
1
- {"version":3,"file":"boundary-DnjGgsK6.js","names":[],"sources":["../src/components/error/error.tsx","../src/components/error/boundary.tsx"],"sourcesContent":["import { useLiveMessages } from '~/components/context/messages';\nimport { cn } from '~/utils/cn';\n\nexport interface Props extends React.ComponentPropsWithRef<'div'> {\n message?: string | null;\n title?: string;\n onReset?: () => void;\n}\n\nconst Error = ({ message, title, className, onReset }: Props) => {\n const messages = useLiveMessages();\n\n if (!message) {\n return null;\n }\n\n return (\n <div\n className={cn(className)}\n style={{\n padding: '16px',\n backgroundColor: '#fee2e2',\n border: '1px solid #fca5a5',\n borderRadius: '6px',\n color: '#7f1d1d',\n }}\n >\n <h3 style={{ fontSize: '14px', fontWeight: 'bold', margin: 0 }}>\n {title ?? messages.errors.default}\n </h3>\n <pre\n style={{\n marginTop: '8px',\n fontSize: '12px',\n whiteSpace: 'pre-wrap',\n margin: '8px 0 0 0',\n }}\n >\n {message}\n </pre>\n {onReset && (\n <button\n style={{\n marginTop: '8px',\n padding: '4px 12px',\n fontSize: '12px',\n color: 'white',\n backgroundColor: '#dc2626',\n border: 'none',\n borderRadius: '4px',\n cursor: 'pointer',\n }}\n onClick={onReset}\n >\n {messages.errors.tryAgain}\n </button>\n )}\n </div>\n );\n};\n\nexport default Error;\n","import React from 'react';\n\nimport {\n type LiveMessages,\n MessagesContext,\n} from '~/components/context/messages';\n\nimport Error from './error';\n\ninterface Props {\n children: React.ReactNode;\n // `reset` clears the caught error and renders `children` again, the same\n // thing the built-in error's reset button does.\n fallback?: (message?: string, reset?: () => void) => React.ReactNode;\n onError?: (e: Error, info: React.ErrorInfo) => void;\n // Values whose identity changing (typically the code/module that produced\n // `children`) should auto-recover a caught error without needing a\n // remount — compared shallowly, one entry at a time, same idea as\n // react-error-boundary's resetKeys. Without this, once tripped, render()\n // never even attempts `children` again (see below), so a fix to the\n // underlying code has no way to reach the screen until this array changes\n // or something remounts the boundary via `key`.\n resetKeys?: readonly unknown[];\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n // The resetKeys the last render saw, so getDerivedStateFromProps can tell\n // when they change.\n resetKeys?: readonly unknown[];\n}\n\nconst keysChanged = (\n prev: readonly unknown[] = [],\n next: readonly unknown[] = [],\n) => prev.length !== next.length || next.some((key, i) => key !== prev[i]);\n\nclass ErrorBoundary extends React.Component<Props, State> {\n static contextType = MessagesContext;\n declare context: LiveMessages;\n\n constructor(props: Props) {\n super(props);\n this.state = { hasError: false, resetKeys: props.resetKeys };\n }\n\n static getDerivedStateFromError(error: Error): Partial<State> {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error('🚨 [Boundary] Rendering error:', error, errorInfo);\n this.props.onError?.(error, errorInfo);\n }\n\n // Clears a caught error in the same render that sees new resetKeys, so\n // `children` get their next chance right away and the fallback doesn't\n // render (and run its effects) once more first (#442). If `children` throw\n // again with the new keys, getDerivedStateFromError catches that in this\n // same render pass.\n static getDerivedStateFromProps(\n props: Props,\n state: State,\n ): Partial<State> | null {\n if (!keysChanged(state.resetKeys, props.resetKeys)) {\n return null;\n }\n\n return state.hasError\n ? { hasError: false, error: undefined, resetKeys: props.resetKeys }\n : { resetKeys: props.resetKeys };\n }\n\n reset = () => this.setState({ hasError: false, error: undefined });\n\n render() {\n if (this.state.hasError) {\n return this.props.fallback ? (\n <>{this.props.fallback(this.state.error?.message, this.reset)}</>\n ) : (\n <Error\n message={this.state.error?.message}\n onReset={this.reset}\n title={this.context.errors.rendering}\n />\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;AASA,MAAM,SAAS,EAAE,SAAS,OAAO,WAAW,cAAqB;CAC/D,MAAM,WAAW,gBAAgB;CAEjC,IAAI,CAAC,SACH,OAAO;CAGT,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,SAAS;EACvB,OAAO;GACL,SAAS;GACT,iBAAiB;GACjB,QAAQ;GACR,cAAc;GACd,OAAO;EACT;EARF,UAAA;GAUE,oBAAC,MAAD;IAAI,OAAO;KAAE,UAAU;KAAQ,YAAY;KAAQ,QAAQ;IAAE;IAC1D,UAAA,SAAS,SAAS,OAAO;GACxB,CAAA;GACJ,oBAAC,OAAD;IACE,OAAO;KACL,WAAW;KACX,UAAU;KACV,YAAY;KACZ,QAAQ;IACV;IAEC,UAAA;GACE,CAAA;GACJ,WACC,oBAAC,UAAD;IACE,OAAO;KACL,WAAW;KACX,SAAS;KACT,UAAU;KACV,OAAO;KACP,iBAAiB;KACjB,QAAQ;KACR,cAAc;KACd,QAAQ;IACV;IACA,SAAS;IAER,UAAA,SAAS,OAAO;GACX,CAAA;EAEP;;AAET;;;AC1BA,MAAM,eACJ,OAA2B,CAAC,GAC5B,OAA2B,CAAC,MACzB,KAAK,WAAW,KAAK,UAAU,KAAK,MAAM,KAAK,MAAM,QAAQ,KAAK,EAAE;AAEzE,IAAM,gBAAN,cAA4B,MAAM,UAAwB;CACxD,OAAO,cAAc;CAGrB,YAAY,OAAc;EACxB,MAAM,KAAK;EACX,KAAK,QAAQ;GAAE,UAAU;GAAO,WAAW,MAAM;EAAU;CAC7D;CAEA,OAAO,yBAAyB,OAA8B;EAC5D,OAAO;GAAE,UAAU;GAAM;EAAM;CACjC;CAEA,kBAAkB,OAAc,WAA4B;EAC1D,QAAQ,MAAM,kCAAkC,OAAO,SAAS;EAChE,KAAK,MAAM,UAAU,OAAO,SAAS;CACvC;CAOA,OAAO,yBACL,OACA,OACuB;EACvB,IAAI,CAAC,YAAY,MAAM,WAAW,MAAM,SAAS,GAC/C,OAAO;EAGT,OAAO,MAAM,WACT;GAAE,UAAU;GAAO,OAAO,KAAA;GAAW,WAAW,MAAM;EAAU,IAChE,EAAE,WAAW,MAAM,UAAU;CACnC;CAEA,cAAc,KAAK,SAAS;EAAE,UAAU;EAAO,OAAO,KAAA;CAAU,CAAC;CAEjE,SAAS;EACP,IAAI,KAAK,MAAM,UACb,OAAO,KAAK,MAAM,WAChB,oBAAA,UAAA,EAAA,UAAG,KAAK,MAAM,SAAS,KAAK,MAAM,OAAO,SAAS,KAAK,KAAK,EAAI,CAAA,IAEhE,oBAAC,OAAD;GACE,SAAS,KAAK,MAAM,OAAO;GAC3B,SAAS,KAAK;GACd,OAAO,KAAK,QAAQ,OAAO;EAC5B,CAAA;EAIL,OAAO,KAAK,MAAM;CACpB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compile-DDfk5P25.js","names":[],"sources":["../src/utils/scripts.ts","../src/utils/compile.ts"],"sourcesContent":["import { CONFIG } from '../constants';\nimport { createBoundedCache } from './cache';\nimport { registerEditorCache } from './editor-caches';\n\n// How many callers are between requesting a script and injecting it, per\n// source. A blob URL evicted in that window can't be revoked yet: the caller\n// already holds it and is about to hand it to a <script>, which then fails to\n// load without any error (#443). The LRU still drops the entry on schedule;\n// only the revocation waits, in `deferredRevocations`, until the last pin on\n// that source is released.\nconst pins = new Map<string, number>();\nconst deferredRevocations = new Map<string, string[]>();\n\nconst revoke = (src: string, blobUrl: string) => {\n if (!pins.has(src)) {\n URL.revokeObjectURL(blobUrl);\n return;\n }\n\n deferredRevocations.set(src, [\n ...(deferredRevocations.get(src) ?? []),\n blobUrl,\n ]);\n};\n\nconst pin = (src: string) => {\n pins.set(src, (pins.get(src) ?? 0) + 1);\n};\n\nconst unpin = (src: string) => {\n const count = (pins.get(src) ?? 0) - 1;\n\n if (count > 0) {\n pins.set(src, count);\n return;\n }\n\n pins.delete(src);\n deferredRevocations.get(src)?.forEach(blobUrl => {\n URL.revokeObjectURL(blobUrl);\n });\n deferredRevocations.delete(src);\n};\n\nconst scriptCache = createBoundedCache<string, string>(\n CONFIG.SCRIPT_CACHE_LIMIT,\n revoke,\n);\nconst loadingScriptCache = new Map<string, Promise<string>>();\n\nexport const getCachedScriptBlob = async (src: string): Promise<string> => {\n const cached = scriptCache.get(src);\n\n if (cached) {\n return cached;\n }\n\n const existing = loadingScriptCache.get(src);\n\n if (existing) {\n return existing;\n }\n\n const promise = fetch(src)\n .then(res => res.text())\n .then(text => {\n const blob = new Blob([text], { type: 'application/javascript' });\n const blobUrl = URL.createObjectURL(blob);\n\n scriptCache.set(src, blobUrl);\n\n return blobUrl;\n })\n // Cleanup belongs on both paths, not just the successful one. A rejected\n // promise left in this map is adopted by every later caller, so a single\n // failed fetch made that script unloadable for the rest of the session\n // even after the network recovered.\n .finally(() => {\n loadingScriptCache.delete(src);\n });\n\n loadingScriptCache.set(src, promise);\n\n return promise;\n};\n\n// Resolves every script to a blob URL and hands them to `inject` while none of\n// them can be revoked. `inject` has to consume them synchronously, which\n// appending the <script> elements does: the browser resolves a blob URL when\n// the element is inserted, so revoking it afterwards is safe.\n//\n// Needed because the URLs resolve at different times. A frame waiting on\n// several scripts, or several frames loading at once, can push more distinct\n// scripts through the cache than it holds before the last one arrives, and\n// the LRU used to revoke the first URLs while they were still waiting to be\n// injected (#443).\nexport const withScriptBlobs = async (\n scripts: string[],\n inject: (blobUrls: string[]) => void,\n): Promise<void> => {\n scripts.forEach(pin);\n\n try {\n inject(await Promise.all(scripts.map(getCachedScriptBlob)));\n } finally {\n scripts.forEach(unpin);\n }\n};\n\nexport const preloadScripts = (scripts: string[]): void => {\n scripts.forEach(src => {\n // Fire-and-forget by design, so the rejection is absorbed here rather\n // than surfacing as an unhandled one. The retry now works (see above),\n // and the real load path reports the failure to whoever awaits it.\n getCachedScriptBlob(src).catch(() => {});\n });\n};\n\n// Blob URLs are browser resources, not just memory, so dropping the entries\n// is not enough — they have to be revoked. `clear()` runs the same `onEvict`\n// the LRU does, so the `URL.revokeObjectURL` above covers this path too.\n//\n// `loadingScriptCache` goes with it: a promise from a session that no longer\n// exists should not be adopted by the next one, which would otherwise hand\n// back a blob URL created before the revocation.\nexport const clearScriptCache = () => {\n scriptCache.clear();\n loadingScriptCache.clear();\n};\n\nregisterEditorCache(clearScriptCache);\n","import React from 'react';\n\nimport * as Babel from '@babel/standalone';\n\nimport type { Module } from '~/types';\n\nimport { CONFIG } from '../constants';\nimport { createBoundedCache } from './cache';\nimport { detectTypeScript } from './detect-typescript';\nimport { registerEditorCache } from './editor-caches';\n\ninterface CompilationKey {\n code: string;\n modules: [string, unknown][];\n}\n\n// The index holds only the keys still in the bounded LRU. Comparing at most\n// CACHE_LIMIT snapshots avoids an unbounded identity registry for symbols\n// or serializing module objects/functions (which may be cyclic or closures).\nconst compilationKeys = new Set<CompilationKey>();\nconst compilationCache = createBoundedCache<CompilationKey, Module>(\n CONFIG.CACHE_LIMIT,\n key => compilationKeys.delete(key),\n);\n\nconst createCacheKey = (\n code: string,\n modules: Record<string, unknown>,\n): CompilationKey => ({\n code,\n modules: Object.keys(modules)\n .sort()\n .map(name => [name, modules[name]]),\n});\n\n// Objects/functions compare by reference; primitives compare by value.\n// Replace a module object when its implementation changes. In-place edits\n// inside an existing module are intentionally not observed by this cache.\nexport const compile = (\n code: string,\n modules: Record<string, unknown>,\n): Module => {\n const candidate = createCacheKey(code, modules);\n\n for (const key of compilationKeys) {\n if (\n key.code === candidate.code &&\n key.modules.length === candidate.modules.length &&\n key.modules.every(\n ([name, value], index) =>\n name === candidate.modules[index]![0] &&\n Object.is(value, candidate.modules[index]![1]),\n )\n ) {\n return compilationCache.get(key)!;\n }\n }\n\n const result = compileModule(code, Object.fromEntries(candidate.modules));\n\n compilationCache.set(candidate, result);\n compilationKeys.add(candidate);\n\n return result;\n};\n\n// `compilationKeys` needs no separate pass: it is drained by the `onEvict`\n// the cache was built with, which `clear()` runs for every entry.\nexport const clearCompilationCache = () => {\n compilationCache.clear();\n};\n\n// TypeScript source used to go through `ts.transpileModule` and then this\n// same Babel pass — a double transpile, and one that required an eagerly\n// awaited top-level `import('typescript')` (a 3.4 MB chunk with none of the\n// laziness a dynamic import would normally buy, since it was awaited at\n// module scope). `@babel/standalone` already ships `preset-typescript` and\n// already runs this exact pass for the non-TS case, so folding TS in here\n// removes the `typescript` dependency entirely — see #192. Babel transpiles\n// per-file with no type information, so `const enum` comes out as a real\n// enum object and legacy decorators aren't supported; neither matters for\n// previewing React components, and errors here already fall back to\n// returning the input unchanged, same as compileTypeScript did.\nexport const transformCode = (code: string, isTypeScript = false): string => {\n try {\n const result = Babel.transform(code, {\n filename: isTypeScript ? 'preview.tsx' : 'preview.jsx',\n presets: isTypeScript ? ['typescript', 'env', 'react'] : ['env', 'react'],\n sourceType: 'module',\n plugins: [Babel.availablePlugins['transform-modules-commonjs']],\n }).code;\n\n return result || '';\n } catch (e) {\n console.error('❌ Babel transformation error:', e);\n return code;\n }\n};\n\nconst compileModule = (\n code: string,\n modules: Record<string, unknown>,\n): Module => {\n const isTypeScript = detectTypeScript(code);\n\n type RenderFunction = (\n exports: Module['exports'],\n require: (name: string) => unknown,\n module: Module,\n React: typeof import('react'),\n ) => void;\n\n let render: RenderFunction;\n\n // Runs in this window's own JS realm, not inside the preview iframe — the iframe only\n // renders the resulting React elements via portal. See README \"Security Notes\".\n try {\n render = new Function(\n 'exports',\n 'require',\n 'module',\n 'React',\n transformCode(code, isTypeScript),\n ) as RenderFunction;\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : 'Syntax error';\n return { exports: {}, error: errorMessage };\n }\n\n const module: Module = { exports: {} };\n\n const customRequire = (name: string) => {\n if (name === 'react') {\n return React;\n }\n\n // Presence, not truthiness: a module may legitimately *be* a falsy\n // primitive (`0`, `''`, `false`, `null`), which compile() supports and\n // compares by value. A truthiness check reported those as missing.\n if (name in modules) {\n return modules[name];\n }\n\n throw new Error(`Module not found: ${name}`);\n };\n\n try {\n render(module.exports, customRequire, module, React);\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : 'Runtime error';\n return { exports: {}, error: errorMessage };\n }\n\n return module;\n};\n\nregisterEditorCache(clearCompilationCache);\n"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-h1JAgOeW.js","names":[],"sources":["../src/constants/index.ts"],"sourcesContent":["import { type Section } from '../types';\n\nexport const STORAGE_KEY = 'live-editor-code';\n\nexport const CONFIG = {\n CACHE_LIMIT: 50,\n // Separate, much smaller limit for document.ts's parsed-AST cache — its\n // entries are full Babel Files (~10-20x source size), not the compiled\n // Module/string entries CACHE_LIMIT was sized for, and real hits only ever\n // land on the document being actively edited (current + previous\n // version), so keeping up to CACHE_LIMIT of them resident just wastes\n // memory. See #106 (measured ~0.66MB/document, ~2.6MB at this limit).\n DOCUMENT_CACHE_LIMIT: 4,\n // Separate limit for utils/index.ts's scriptCache — those entries are\n // live blob URLs handed to <script src>, and its onEvict immediately\n // revokes the URL, unlike compilationCache's evictions which just discard\n // a cheap-to-recompute Module. Sharing CACHE_LIMIT with compilationCache\n // was coincidental, not a sizing decision for scriptCache's actual usage\n // (a handful of distinct external preview scripts). See #104.\n SCRIPT_CACHE_LIMIT: 10,\n} as const;\n\nexport const DATA_ATTR = {\n ID: 'data-id',\n BINDING: 'data-binding',\n // Names an entry of `Live.Dnd`'s `bindingKeys` instead of declaring the\n // bindings inline (#513).\n BINDING_KEY: 'data-binding-key',\n ITEM: 'data-item',\n} as const;\n\n// Attributes the editor owns. `data-id` is the key between the canvas and the\n// source, `data-name` is a section's name in the palette and panel, and\n// `data-binding` and `data-binding-key` say which schema every edit is\n// checked against. A binding can't\n// target them: rewriting one from the panel would break the mapping or the\n// declaration the edit itself depends on (#429).\nexport const RESERVED_BINDING_PROPERTIES: readonly string[] = [\n DATA_ATTR.ID,\n 'data-name',\n DATA_ATTR.BINDING,\n DATA_ATTR.BINDING_KEY,\n];\n\nexport const REGEX = {\n NUMBER: /^\\d+(\\.\\d+)?$/,\n BOOLEAN_OR_NULL: /^(true|false|null|undefined)$/,\n MODULE_IMPORT_EXPORT_LINE:\n /^\\s*(?:import|export)\\b[^\\n]*\\bfrom\\s+['\"][^'\"]*['\"];?\\s*$/gm,\n} as const;\n\nexport const TS_PATTERNS = [\n /interface\\s+\\w+/,\n /type\\s+\\w+\\s*=/,\n /:\\s*\\w+(\\[\\])?(\\s*\\||\\s*&|\\s*=|\\s*;|\\s*,|\\s*\\))/,\n /as\\s+\\w+/,\n /<[A-Z]\\w*>/,\n /enum\\s+\\w+/,\n /public\\s+|private\\s+|protected\\s+/,\n /readonly\\s+/,\n /\\?\\s*:/,\n] as const;\n\nexport const BINDING_PROP = {\n CHILDREN: 'children',\n INNER_TEXT: 'innerText',\n INNER_HTML: 'innerHTML',\n ITEMS: 'items',\n} as const;\n\n// The element whose `<section>` children are a document's sections, unless\n// `Live.Dnd`'s `containerId` says otherwise (#449).\nexport const DEFAULT_CONTAINER_ID = 'app-container';\n\n// A new, empty document built around `containerId`. `createDocument()` in\n// `@jbpark/live-editor/utils` is the public way in; this is the template\n// behind it and behind `DEFAULT_TEMPLATE`.\nexport const documentTemplate = (containerId: string) => `\nimport * as ui from 'ui-kit';\nimport { cn } from 'ui-kit/utils';\n\nconst App = () => {\n return (\n <main id=\"${containerId}\"></main>\n )\n}\n\nexport default App;\n`;\n\nexport const DEFAULT_TEMPLATE = documentTemplate(DEFAULT_CONTAINER_ID);\n\nexport const DRAGGABLE_ITEMS: Section[] = [\n {\n id: 'hero',\n name: 'Hero',\n code: `\n <section\n data-name=\"Hero\"\n className={cn(\n 'text-center text-white',\n //\n )}\n >\n <ui.Space\n data-id=\"\"\n data-binding={[\n {\n label: 'Background Style',\n property: 'style',\n type: 'object',\n // Types the keys inside the object value; a leaf takes the same\n // fields as a top-level binding.\n render: {\n backgroundColor: { type: 'color', label: 'Background Color' },\n },\n // Not a library field, so it arrives as meta.group.\n group: 'layout',\n },\n {\n label: 'Content Spacing',\n property: 'size',\n type: 'number',\n // Constraints the library validates with or without a widget.\n min: 0,\n max: 40,\n // Presentation only: the built-in panel ignores it and shows a\n // number input; a custom panel can switch on widget.type.\n widget: { type: 'slider', step: 4, unit: 'px' },\n group: 'layout',\n },\n ]}\n style={{\n backgroundColor: '#6366f1',\n }}\n orientation=\"vertical\"\n size={16}\n align=\"center\"\n className={cn(\n 'px-5 py-15',\n //\n )}\n >\n <h1\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n type: 'string',\n required: true,\n },\n ]}\n className={cn(\n 'text-5xl font-bold',\n //\n )}\n >\n Welcome to Live Editor\n </h1>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n type: 'richtext',\n },\n ]}\n className={cn(\n 'text-xl',\n //\n )}\n >\n Build <strong>dynamic components</strong> with drag & drop\n </p>\n <ui.Button\n data-id=\"\"\n data-binding={[\n {\n label: 'Button Text',\n property: 'innerText',\n },\n {\n label: 'Button Icon',\n property: 'icon',\n type: 'jsx',\n },\n {\n label: 'Button Size',\n property: 'size',\n options: [\n { label: 'Small', value: 'small' },\n { label: 'Middle', value: 'middle' },\n { label: 'Large', value: 'large' },\n ],\n },\n {\n label: 'Button Variant',\n property: 'variant',\n options: [\n { label: 'Solid', value: 'solid' },\n { label: 'Outlined', value: 'outlined' },\n { label: 'Filled', value: 'filled' },\n ],\n },\n ]}\n icon={<span>🚀</span>}\n size=\"large\"\n variant=\"solid\"\n className={cn(\n 'bg-white text-indigo-500',\n 'hover:bg-gray-50',\n //\n )}\n >\n Get Started\n </ui.Button>\n </ui.Space>\n </section>\n `,\n },\n {\n id: 'features',\n name: 'Features',\n code: `\n <section\n data-name=\"Features\"\n className={cn(\n 'px-5 py-10',\n //\n )}\n >\n <ui.Space\n data-id=\"\"\n data-binding={[\n {\n label: 'Feature Cards',\n property: 'children',\n },\n ]}\n className={cn(\n 'mx-auto max-w-7xl',\n //\n )}\n size=\"large\"\n wrap\n >\n <ui.Card\n className={cn(\n 'min-w-70 flex-1 text-center',\n //\n )}\n >\n <ui.Space orientation=\"vertical\" size=\"middle\" align=\"center\">\n <div\n data-id=\"\"\n data-binding={[\n {\n label: 'Icon',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-5xl',\n //\n )}\n >\n 🚀\n </div>\n <h3\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-2xl text-gray-800',\n //\n )}\n >\n Feature 1\n </h3>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-gray-600',\n //\n )}\n >\n Amazing feature description\n </p>\n </ui.Space>\n </ui.Card>\n <ui.Card\n className={cn(\n 'min-w-70 flex-1 text-center',\n //\n )}\n >\n <ui.Space orientation=\"vertical\" size=\"middle\" align=\"center\">\n <div\n data-id=\"\"\n data-binding={[\n {\n label: 'Icon',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-5xl',\n //\n )}\n >\n ⚡\n </div>\n <h3\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-2xl text-gray-800',\n //\n )}\n >\n Feature 2\n </h3>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-gray-600',\n //\n )}\n >\n Another great feature\n </p>\n </ui.Space>\n </ui.Card>\n <ui.Card\n className={cn(\n 'min-w-70 flex-1 text-center',\n //\n )}\n >\n <ui.Space orientation=\"vertical\" size=\"middle\" align=\"center\">\n <div\n data-id=\"\"\n data-binding={[\n {\n label: 'Icon',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-5xl',\n //\n )}\n >\n ✨\n </div>\n <h3\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-2xl text-gray-800',\n //\n )}\n >\n Feature 3\n </h3>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-gray-600',\n //\n )}\n >\n One more awesome thing\n </p>\n </ui.Space>\n </ui.Card>\n </ui.Space>\n </section>\n `,\n },\n {\n id: 'about',\n name: 'About',\n code: `\n <section\n data-name=\"About\"\n className={cn(\n 'mx-auto max-w-3xl px-5 py-10',\n //\n )}\n >\n <ui.Typography.Title\n data-id=\"\"\n data-binding={[{ label: 'Title', property: 'innerText' }]}\n level={2}\n className={cn(\n 'mb-5 text-4xl text-gray-800',\n //\n )}\n >\n About Live Editor\n </ui.Typography.Title>\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Description 1',\n type: 'richtext',\n },\n ]}\n className={cn(\n 'mb-4 text-lg leading-relaxed text-gray-600',\n //\n )}\n >\n Live Editor is a powerful visual development tool that enables you to\n create stunning web interfaces through an intuitive drag-and-drop\n experience. Built with modern web technologies, it streamlines your\n workflow and accelerates development cycles.\n </ui.Typography.Paragraph>\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Description 2',\n type: 'richtext',\n },\n ]}\n className={cn(\n 'text-lg leading-relaxed text-gray-600',\n //\n )}\n >\n Whether you&apos;re a seasoned developer or just starting out, Live\n Editor provides the flexibility and control you need to bring your\n creative vision to life. Focus on what matters most - building great\n products.\n </ui.Typography.Paragraph>\n </section>\n `,\n },\n {\n id: 'cta',\n name: 'CTA',\n code: `\n <section\n data-name=\"CTA\"\n className={cn(\n 'bg-gray-50 px-5 py-12 text-center',\n //\n )}\n >\n <div\n className={cn(\n 'mx-auto max-w-xl',\n //\n )}\n >\n <ui.Typography.Title\n data-id=\"\"\n data-binding={[{ label: 'Title', property: 'innerText' }]}\n level={2}\n className={cn(\n 'mb-4 text-3xl text-gray-800',\n //\n )}\n >\n Ready to get started?\n </ui.Typography.Title>\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-6 text-lg text-gray-600',\n //\n )}\n >\n Start exploring what Live Editor can do for your projects\n </ui.Typography.Paragraph>\n <ui.Space\n data-id=\"\"\n data-binding={[{ label: 'Buttons', property: 'children' }]}\n className={cn(\n 'flex flex-wrap justify-center gap-4',\n //\n )}\n >\n <ui.Button\n data-id=\"\"\n data-binding={[\n {\n label: 'Button 1 Text',\n property: 'innerText',\n },\n ]}\n size=\"large\"\n className={cn(\n 'bg-indigo-500 px-8 text-base text-white',\n 'hover:bg-indigo-600',\n //\n )}\n >\n View Documentation\n </ui.Button>\n <ui.Button\n data-id=\"\"\n data-binding={[\n {\n label: 'Button 2 Text',\n property: 'innerText',\n },\n ]}\n variant=\"outlined\"\n size=\"large\"\n className={cn(\n 'border-2 border-indigo-500 px-8 text-base text-indigo-500',\n 'hover:bg-indigo-50',\n //\n )}\n >\n View Examples\n </ui.Button>\n </ui.Space>\n </div>\n </section>\n `,\n },\n {\n id: 'getting-started',\n name: 'Getting Started',\n code: `\n <section\n data-name=\"Getting Started\"\n className={cn(\n 'px-5 py-16',\n //\n )}\n >\n <div\n className={cn(\n 'mx-auto max-w-5xl',\n //\n )}\n >\n <ui.Typography.Title\n data-id=\"\"\n data-binding={[{ label: 'Title', property: 'innerText' }]}\n level={2}\n className={cn(\n 'mb-12 text-center text-4xl font-bold text-gray-800',\n //\n )}\n >\n How to Get Started\n </ui.Typography.Title>\n <div\n className={cn(\n 'grid gap-8 md:grid-cols-3',\n //\n )}\n >\n <ui.Card\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 1 Content',\n property: 'children',\n },\n ]}\n className={cn(\n 'rounded-lg border-2 border-gray-200 bg-white p-8',\n //\n )}\n >\n <ui.Typography.Title\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 1 Title',\n property: 'innerText',\n },\n ]}\n level={3}\n className={cn(\n 'mb-2 text-2xl font-bold text-gray-800',\n //\n )}\n >\n Explore\n </ui.Typography.Title>\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 1 Icon',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-6 text-4xl font-bold text-indigo-600',\n //\n )}\n >\n 📚\n </ui.Typography.Paragraph>\n <ul\n className={cn(\n 'mb-8 space-y-3 text-gray-600',\n //\n )}\n >\n <li>✓ Read documentation</li>\n <li>✓ Browse examples</li>\n <li>✓ Try the demo</li>\n </ul>\n <ui.Button\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 1 Button',\n property: 'innerText',\n },\n ]}\n variant=\"outlined\"\n size=\"large\"\n block\n className={cn(\n 'border-2 border-indigo-500 text-indigo-500',\n 'hover:bg-indigo-50',\n //\n )}\n >\n View Docs\n </ui.Button>\n </ui.Card>\n <ui.Card\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 2 Content',\n property: 'children',\n },\n ]}\n className={cn(\n 'relative rounded-lg border-2 border-indigo-500 bg-white p-8',\n //\n )}\n >\n <div\n className={cn(\n 'absolute -top-4 left-1/2 -translate-x-1/2',\n 'rounded-full bg-indigo-500 px-4 py-1 text-sm text-white',\n //\n )}\n >\n Recommended\n </div>\n <ui.Typography.Title\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 2 Title',\n property: 'innerText',\n },\n ]}\n level={3}\n className={cn(\n 'mb-2 text-2xl font-bold text-gray-800',\n //\n )}\n >\n Practice\n </ui.Typography.Title>\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 2 Icon',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-6 text-4xl font-bold text-indigo-600',\n //\n )}\n >\n 💻\n </ui.Typography.Paragraph>\n <ul\n className={cn(\n 'mb-8 space-y-3 text-gray-600',\n //\n )}\n >\n <li>✓ Interactive playground</li>\n <li>✓ Experiment freely</li>\n <li>✓ Build your own</li>\n </ul>\n <ui.Button\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 2 Button',\n property: 'innerText',\n },\n ]}\n size=\"large\"\n block\n className={cn(\n 'bg-indigo-500 text-white',\n 'hover:bg-indigo-600',\n //\n )}\n >\n Start Building\n </ui.Button>\n </ui.Card>\n <ui.Card\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 3 Content',\n property: 'children',\n },\n ]}\n className={cn(\n 'rounded-lg border-2 border-gray-200 bg-white p-8',\n //\n )}\n >\n <ui.Typography.Title\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 3 Title',\n property: 'innerText',\n },\n ]}\n level={3}\n className={cn(\n 'mb-2 text-2xl font-bold text-gray-800',\n //\n )}\n >\n Contribute\n </ui.Typography.Title>\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 3 Icon',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-6 text-4xl font-bold text-indigo-600',\n //\n )}\n >\n 🤝\n </ui.Typography.Paragraph>\n <ul\n className={cn(\n 'mb-8 space-y-3 text-gray-600',\n //\n )}\n >\n <li>✓ Report issues</li>\n <li>✓ Suggest features</li>\n <li>✓ Submit pull requests</li>\n </ul>\n <ui.Button\n data-id=\"\"\n data-binding={[\n {\n label: 'Card 3 Button',\n property: 'innerText',\n },\n ]}\n variant=\"outlined\"\n size=\"large\"\n block\n className={cn(\n 'border-2 border-indigo-500 text-indigo-500',\n 'hover:bg-indigo-50',\n //\n )}\n >\n View on GitHub\n </ui.Button>\n </ui.Card>\n </div>\n </div>\n </section>\n `,\n },\n {\n id: 'key-features',\n name: 'Key Features',\n code: `\n <section\n data-name=\"Key Features\"\n className={cn(\n 'bg-indigo-50 px-5 py-16',\n //\n )}\n >\n <div\n className={cn(\n 'mx-auto max-w-6xl',\n //\n )}\n >\n <h2\n data-id=\"\"\n data-binding={[{ label: 'Title', property: 'innerText' }]}\n className={cn(\n 'mb-12 text-center text-4xl font-bold text-gray-800',\n //\n )}\n >\n Key Features\n </h2>\n <div\n className={cn(\n 'grid gap-8 md:grid-cols-2',\n //\n )}\n >\n <div\n className={cn(\n 'rounded-lg bg-white p-8 shadow-md',\n //\n )}\n >\n <div\n className={cn(\n 'mb-4 text-4xl',\n //\n )}\n >\n 🎨\n </div>\n <h3\n className={cn(\n 'mb-4 text-2xl font-bold text-gray-800',\n //\n )}\n >\n Visual Editing\n </h3>\n <p\n className={cn(\n 'text-gray-600',\n //\n )}\n >\n See your changes in real-time as you build. Live Editor provides\n instant visual feedback, making it easier to understand how code\n affects your interface.\n </p>\n </div>\n <div\n className={cn(\n 'rounded-lg bg-white p-8 shadow-md',\n //\n )}\n >\n <div\n className={cn(\n 'mb-4 text-4xl',\n //\n )}\n >\n 🧩\n </div>\n <h3\n className={cn(\n 'mb-4 text-2xl font-bold text-gray-800',\n //\n )}\n >\n Component-Based\n </h3>\n <p\n className={cn(\n 'text-gray-600',\n //\n )}\n >\n Build with reusable components that you can drag, drop, and\n customize. Learn modern development patterns while creating your\n interface.\n </p>\n </div>\n </div>\n </div>\n </section>\n `,\n },\n {\n id: 'stats',\n name: 'Stats',\n code: `\n <section\n data-name=\"Stats\"\n className={cn(\n 'bg-indigo-600 text-white',\n //\n )}\n >\n <ui.Marquees\n data-id=\"\"\n data-binding={[\n { label: 'Stats Items', property: 'items' },\n {\n label: 'Scroll Speed',\n property: 'speed',\n type: 'number',\n min: 20,\n max: 300,\n // The bare-string form; it arrives as { type: 'slider' }.\n widget: 'slider',\n },\n { label: 'Pause On Hover', property: 'pauseOnHover', type: 'boolean' },\n ]}\n speed={100}\n pauseOnHover={true}\n autoFill={true}\n className=\"px-5 py-16\"\n items={[\n {\n key: 'stats-row',\n children: (\n <div\n data-id=\"\"\n data-binding={[\n {\n label: 'Stats Cards',\n property: 'children',\n },\n ]}\n className={cn('flex gap-20')}\n >\n <div\n className={cn(\n 'min-w-60 text-center',\n //\n )}\n >\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-2 text-5xl font-bold',\n //\n )}\n >\n Open\n </p>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-indigo-200',\n //\n )}\n >\n Source Project\n </p>\n </div>\n <div\n className={cn(\n 'min-w-60 text-center',\n //\n )}\n >\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-2 text-5xl font-bold',\n //\n )}\n >\n Free\n </p>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-indigo-200',\n //\n )}\n >\n For Everyone\n </p>\n </div>\n <div\n className={cn(\n 'min-w-60 text-center',\n //\n )}\n >\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-2 text-5xl font-bold',\n //\n )}\n >\n Active\n </p>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-indigo-200',\n //\n )}\n >\n Community\n </p>\n </div>\n <div\n className={cn(\n 'min-w-60 text-center',\n //\n )}\n >\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Title',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'mb-2 text-5xl font-bold',\n //\n )}\n >\n Learn\n </p>\n <p\n data-id=\"\"\n data-binding={[\n {\n label: 'Description',\n property: 'innerText',\n },\n ]}\n className={cn(\n 'text-indigo-200',\n //\n )}\n >\n By Doing\n </p>\n </div>\n </div>\n ),\n },\n ]}\n />\n </section>\n `,\n },\n {\n id: 'roadmap',\n name: 'Roadmap',\n code: `\n <section\n data-name=\"Roadmap\"\n className={cn(\n 'px-5 py-16',\n //\n )}\n >\n <div\n className={cn(\n 'mx-auto max-w-3xl',\n //\n )}\n >\n <h2\n data-id=\"\"\n data-binding={[\n { label: 'Title', property: 'innerText', required: true },\n ]}\n className={cn(\n 'mb-8 text-center text-4xl font-bold text-gray-800',\n //\n )}\n >\n Roadmap\n </h2>\n <ui.List\n data-id=\"\"\n data-binding={[\n {\n label: 'Milestones',\n property: 'data',\n type: 'array',\n // One leaf per item key. Each leaf takes the same fields as a\n // top-level binding, and label falls back to the key.\n render: {\n title: {\n type: 'string',\n label: 'Title',\n required: true,\n },\n date: { type: 'date', label: 'Release Date', required: true },\n status: {\n type: 'string',\n label: 'Status',\n options: [\n { label: 'Planned', value: 'planned' },\n { label: 'In Progress', value: 'in-progress' },\n { label: 'Shipped', value: 'shipped' },\n ],\n },\n progress: {\n type: 'number',\n label: 'Progress',\n min: 0,\n max: 100,\n widget: { type: 'slider', step: 10, unit: '%' },\n },\n color: { type: 'color', label: 'Accent Color' },\n highlight: { type: 'boolean', label: 'Highlight' },\n // An object-valued key: its own render map types the keys\n // inside it, one level further down.\n link: {\n type: 'object',\n label: 'Link',\n render: {\n text: { type: 'string', label: 'Link Text' },\n href: {\n type: 'url',\n label: 'Link URL',\n pattern: '^https://',\n // Not a library field, so it arrives as meta.hint.\n hint: 'Must use https',\n },\n },\n },\n },\n },\n ]}\n data={[\n {\n title: 'Visual editing',\n date: '2026-03-02',\n status: 'shipped',\n progress: 100,\n color: '#22c55e',\n highlight: false,\n link: { text: 'Release notes', href: 'https://github.com' },\n },\n {\n title: 'Custom panels',\n date: '2026-09-26',\n status: 'in-progress',\n progress: 60,\n color: '#6366f1',\n highlight: true,\n link: { text: 'Guide', href: 'https://github.com' },\n },\n {\n title: 'Collaboration',\n date: '2027-01-15',\n status: 'planned',\n progress: 0,\n color: '#f59e0b',\n highlight: false,\n link: { text: 'Discussion', href: 'https://github.com' },\n },\n ]}\n itemKey={item => item.title}\n renderItem={item => (\n <div\n className={cn(\n 'flex items-center gap-4 border-b border-gray-100 py-4',\n item.highlight && 'rounded-lg bg-indigo-50 px-4',\n )}\n >\n <span\n className=\"size-3 shrink-0 rounded-full\"\n style={{ backgroundColor: item.color }}\n />\n <div className=\"min-w-0 flex-1\">\n <p className=\"font-semibold text-gray-800\">{item.title}</p>\n <p className=\"text-sm text-gray-500\">\n {item.date} · {item.status}\n </p>\n <ui.Progress value={item.progress} className=\"mt-2\" />\n </div>\n <a\n href={item.link.href}\n className=\"text-sm text-indigo-500 hover:underline\"\n >\n {item.link.text}\n </a>\n </div>\n )}\n />\n <p\n className={cn(\n 'mt-6 text-center text-sm text-gray-500',\n //\n )}\n >\n Last updated{' '}\n <time\n data-id=\"\"\n data-binding={[\n {\n label: 'Updated On',\n property: 'dateTime',\n type: 'date',\n required: true,\n },\n { label: 'Updated Text', property: 'innerText' },\n ]}\n dateTime=\"2026-09-26\"\n >\n September 26, 2026\n </time>\n {' · '}\n <a\n data-id=\"\"\n data-binding={[\n { label: 'Link Text', property: 'innerText' },\n {\n label: 'Link URL',\n property: 'href',\n type: 'url',\n required: true,\n pattern: '^https://',\n },\n ]}\n href=\"https://github.com/pjb0811/live-editor/releases\"\n className=\"text-indigo-500 hover:underline\"\n >\n All releases\n </a>\n </p>\n </div>\n </section>\n `,\n },\n {\n id: 'faq',\n name: 'FAQ',\n code: `\n <section\n data-name=\"FAQ\"\n className={cn(\n 'px-5 py-16',\n //\n )}\n >\n <div\n className={cn(\n 'mx-auto max-w-3xl',\n //\n )}\n >\n <ui.Typography.Title\n data-id=\"\"\n data-binding={[{ label: 'Title', property: 'innerText' }]}\n level={2}\n className={cn(\n 'mb-12 text-center text-4xl font-bold text-gray-800',\n //\n )}\n >\n Frequently Asked Questions\n </ui.Typography.Title>\n <ui.Collapse\n data-id=\"\"\n data-binding={[{ label: 'FAQ Items', property: 'items' }]}\n items={[\n {\n key: '1',\n label: (\n <ui.Typography.Text\n data-id=\"\"\n data-binding={[\n {\n label: 'Question 1',\n property: 'innerText',\n },\n ]}\n className={cn('text-lg font-semibold text-gray-800')}\n >\n What is Live Editor?\n </ui.Typography.Text>\n ),\n children: (\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Answer 1',\n type: 'richtext',\n },\n ]}\n className={cn('text-gray-600')}\n >\n Live Editor is an open-source tool for building web\n interfaces visually. It helps you learn web development by\n providing instant feedback as you build components.\n </ui.Typography.Paragraph>\n ),\n },\n {\n key: '2',\n label: (\n <ui.Typography.Text\n data-id=\"\"\n data-binding={[\n {\n label: 'Question 2',\n property: 'innerText',\n },\n ]}\n className={cn('text-lg font-semibold text-gray-800')}\n >\n Do I need coding experience?\n </ui.Typography.Text>\n ),\n children: (\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Answer 2',\n type: 'richtext',\n },\n ]}\n className={cn('text-gray-600')}\n >\n No! Live Editor is designed for all skill levels. Beginners\n can learn through visual editing, while experienced\n developers can work directly with code.\n </ui.Typography.Paragraph>\n ),\n },\n {\n key: '3',\n label: (\n <ui.Typography.Text\n data-id=\"\"\n data-binding={[\n {\n label: 'Question 3',\n property: 'innerText',\n },\n ]}\n className={cn('text-lg font-semibold text-gray-800')}\n >\n Is it really free?\n </ui.Typography.Text>\n ),\n children: (\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Answer 3',\n type: 'richtext',\n },\n ]}\n className={cn('text-gray-600')}\n >\n Yes, completely free! Live Editor is an open-source project\n with no hidden costs or premium tiers. All features are\n available to everyone.\n </ui.Typography.Paragraph>\n ),\n },\n {\n key: '4',\n label: (\n <ui.Typography.Text\n data-id=\"\"\n data-binding={[\n {\n label: 'Question 4',\n property: 'innerText',\n },\n ]}\n className={cn('text-lg font-semibold text-gray-800')}\n >\n How can I contribute?\n </ui.Typography.Text>\n ),\n children: (\n <ui.Typography.Paragraph\n data-id=\"\"\n data-binding={[\n {\n label: 'Answer 4',\n type: 'richtext',\n },\n ]}\n className={cn('text-gray-600')}\n >\n You can contribute by reporting bugs, suggesting features,\n sharing your projects, or contributing code. Check our\n GitHub repository for more details.\n </ui.Typography.Paragraph>\n ),\n },\n ]}\n />\n </div>\n </section>\n `,\n },\n];\n"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"context-DsEXJl4h.js","names":[],"sources":["../src/components/context/context.tsx"],"sourcesContent":["'use client';\n\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { DEFAULT_TEMPLATE } from '~/constants';\nimport { registerEditorSession } from '~/utils/editor-caches';\n\nimport {\n type LiveMessagesInput,\n MessagesContext,\n mergeMessages,\n} from './messages';\nimport type { ErrorContextType, PreviewContextType } from './states';\nimport { ErrorContext, PreviewContext } from './states';\n\nexport interface Props {\n children?: React.ReactNode;\n // Replaces any of the editor's built-in text, group by group: the rest\n // stays English, or the enclosing `Live`'s. Define it once outside render, or memoize it, since a\n // new object re-renders every component that shows text (#524).\n messages?: LiveMessagesInput;\n}\n\nconst ContextProvider = ({ children, messages }: Props) => {\n const [code, setCodeState] = useState(DEFAULT_TEMPLATE);\n const [error, setError] = useState<ErrorContextType['error']>(null);\n\n // Clears any stale runtime/compile error in the same update batch that\n // changes `code`, rather than in a separate useEffect — a useEffect here\n // would race with componentDidCatch/Guard's onError firing for the *new*\n // code's own errors within the same commit (layout effects run before\n // passive effects, so a passive-effect reset could wipe out an error the\n // new code just threw). Batching setError(null) into the same update as\n // setCode guarantees stale errors are gone by the time the new code even\n // renders, with nothing left afterward that could clobber a fresh one.\n const setCode = useCallback<PreviewContextType['setCode']>(next => {\n setError(null);\n setCodeState(next);\n }, []);\n\n // The provider is the ownership boundary for every editor-owned cache, not\n // just the compilation one it used to clear here: parsed documents,\n // extracted bindings and the blob URLs generated for external scripts all\n // outlive an editing session otherwise, released only when the LRU happens\n // to evict them. registerEditorSession both counts this session and hands\n // back the release, so the caches go when the last provider does.\n useEffect(() => registerEditorSession(), []);\n\n // Without this, a new object identity on every ContextProvider render\n // (even ones that don't touch code/error at all, e.g. a parent\n // re-rendering) meant every usePreview()/useError() consumer re-rendered\n // too, regardless of whether the values they care about actually changed.\n const previewValue = useMemo<PreviewContextType>(\n () => ({ code, setCode }),\n [code, setCode],\n );\n\n const errorValue = useMemo<ErrorContextType>(\n () => ({ error, setError }),\n [error, setError],\n );\n\n // A provider inside another one starts from the outer one's messages, so\n // a page can set them once around several editors.\n const inherited = useContext(MessagesContext);\n const messagesValue = useMemo(\n () => mergeMessages(messages, inherited),\n [messages, inherited],\n );\n\n return (\n <PreviewContext.Provider value={previewValue}>\n <ErrorContext.Provider value={errorValue}>\n <MessagesContext.Provider value={messagesValue}>\n {children}\n </MessagesContext.Provider>\n </ErrorContext.Provider>\n </PreviewContext.Provider>\n );\n};\n\nexport default ContextProvider;\n"],"mappings":";;;;;;;AA6BA,MAAM,mBAAmB,EAAE,UAAU,eAAsB;CACzD,MAAM,CAAC,MAAM,gBAAgB,SAAS,gBAAgB;CACtD,MAAM,CAAC,OAAO,YAAY,SAAoC,IAAI;CAUlE,MAAM,UAAU,aAA2C,SAAQ;EACjE,SAAS,IAAI;EACb,aAAa,IAAI;CACnB,GAAG,CAAC,CAAC;CAQL,gBAAgB,sBAAsB,GAAG,CAAC,CAAC;CAM3C,MAAM,eAAe,eACZ;EAAE;EAAM;CAAQ,IACvB,CAAC,MAAM,OAAO,CAChB;CAEA,MAAM,aAAa,eACV;EAAE;EAAO;CAAS,IACzB,CAAC,OAAO,QAAQ,CAClB;CAIA,MAAM,YAAY,WAAW,eAAe;CAC5C,MAAM,gBAAgB,cACd,cAAc,UAAU,SAAS,GACvC,CAAC,UAAU,SAAS,CACtB;CAEA,OACE,oBAAC,eAAe,UAAhB;EAAyB,OAAO;EAC9B,UAAA,oBAAC,aAAa,UAAd;GAAuB,OAAO;GAC5B,UAAA,oBAAC,gBAAgB,UAAjB;IAA0B,OAAO;IAC9B;GACuB,CAAA;EACL,CAAA;CACA,CAAA;AAE7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-CRsAGpei.js","names":[],"sources":["../src/components/editor/use-format-code.ts","../src/components/editor/core.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react';\n\nimport { detectTypeScript } from '~/utils/detect-typescript';\n\n// prettier is an optional peer dependency (#282): the editor subpath is the\n// only thing that needs it, so consumers who don't use format-on-save\n// shouldn't have to install ~9.6 MB. It's loaded lazily below and its absence\n// degrades gracefully (the code is returned unformatted) instead of throwing.\nconst loadPrettier = async () => {\n const [prettier, babel, estree, typescript] = await Promise.all([\n import('prettier'),\n import('prettier/plugins/babel'),\n import('prettier/plugins/estree'),\n import('prettier/plugins/typescript'),\n ]);\n\n return {\n format: prettier.format,\n plugins: [babel.default, estree.default, typescript.default],\n };\n};\n\nconst DEFAULT_PRETTIER_OPTIONS: Record<string, unknown> = {\n tabWidth: 2,\n singleQuote: true,\n trailingComma: 'all',\n htmlWhitespaceSensitivity: 'ignore',\n arrowParens: 'avoid',\n printWidth: 60,\n};\n\nexport interface UseFormatCodeOptions {\n fragment?: boolean;\n prettierOptions?: Record<string, unknown>;\n}\n\n// Extracted out of Core so a custom renderEditor (see editor.tsx's\n// renderEditor prop) can reuse the exact same formatting behavior instead\n// of reimplementing prettier wiring from scratch.\nexport const useFormatCode = ({\n fragment,\n prettierOptions,\n}: UseFormatCodeOptions = {}) => {\n const prettierConfig = useMemo(\n () => ({\n ...DEFAULT_PRETTIER_OPTIONS,\n ...prettierOptions,\n }),\n [prettierOptions],\n );\n\n return useCallback(\n async (code: string) => {\n const isTypeScript = detectTypeScript(code);\n const source = fragment ? `<>${code}</>` : code;\n\n // Only a missing prettier is swallowed here; a genuine format error\n // (prettier present, but the code is unparseable) still propagates so\n // the editor's Cmd+S path can surface it via onError.\n let prettier: Awaited<ReturnType<typeof loadPrettier>>;\n try {\n prettier = await loadPrettier();\n } catch {\n return code;\n }\n\n const formatted = await prettier.format(source, {\n parser: isTypeScript ? 'typescript' : 'babel',\n plugins: prettier.plugins,\n ...prettierConfig,\n });\n\n if (fragment) {\n return formatted\n .replace(/^<>\\n?/, '')\n .replace(/\\n?<\\/>;?\\s*$/, '')\n .replace(/^ {2}/gm, '')\n .trim();\n }\n\n return formatted;\n },\n [prettierConfig, fragment],\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport CodeEditor from '@jbpark/ui-kit/CodeEditor';\nimport { vscodeLight } from '@uiw/codemirror-theme-vscode';\nimport { type Extension } from '@uiw/react-codemirror';\n\nimport { cn } from '~/utils/cn';\n\nimport { useFormatCode } from './use-format-code';\n\nexport interface Props {\n value: string;\n height?: string;\n theme?: Extension | 'light' | 'dark' | 'none';\n prettierOptions?: Record<string, unknown>;\n fragment?: boolean;\n raw?: boolean;\n className?: string;\n onChange?: (value: string) => void;\n onSave?: (value: string) => void;\n onError?: (error: string | null) => void;\n onCreateEditor?: ComponentProps<typeof CodeEditor>['onCreateEditor'];\n onUpdate?: ComponentProps<typeof CodeEditor>['onUpdate'];\n}\n\n// The CodeMirror surface, the Cmd+S save transaction and the JS/TS + line-wrap\n// extensions now live in `@jbpark/ui-kit`'s CodeEditor (#346/#309). This stays\n// only to keep live-editor's own vocabulary: `raw`/`fragment`/`prettierOptions`\n// shape the injected prettier formatter, and `onError` maps to the component's\n// `onFormatError`.\nconst Core = ({\n value,\n theme,\n height,\n className,\n prettierOptions,\n fragment,\n raw,\n onChange,\n onSave,\n onError,\n ...props\n}: Props) => {\n const formatCode = useFormatCode({ fragment, prettierOptions });\n\n return (\n <CodeEditor\n value={value}\n theme={theme ?? vscodeLight}\n height={height || '100%'}\n className={cn(className)}\n // `raw` (e.g. innerHTML) skips prettier; otherwise reuse the shared\n // prettier wiring as the Cmd+S formatter rather than reimplementing it.\n formatCode={raw ? undefined : formatCode}\n onChange={onChange}\n onSave={onSave}\n onFormatError={onError}\n {...props}\n />\n );\n};\n\nexport default Core;\n"],"mappings":";;;;;;;;AAQA,MAAM,eAAe,YAAY;CAC/B,MAAM,CAAC,UAAU,OAAO,QAAQ,cAAc,MAAM,QAAQ,IAAI;EAC9D,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;CACT,CAAC;CAED,OAAO;EACL,QAAQ,SAAS;EACjB,SAAS;GAAC,MAAM;GAAS,OAAO;GAAS,WAAW;EAAO;CAC7D;AACF;AAEA,MAAM,2BAAoD;CACxD,UAAU;CACV,aAAa;CACb,eAAe;CACf,2BAA2B;CAC3B,aAAa;CACb,YAAY;AACd;AAUA,MAAa,iBAAiB,EAC5B,UACA,oBACwB,CAAC,MAAM;CAC/B,MAAM,iBAAiB,eACd;EACL,GAAG;EACH,GAAG;CACL,IACA,CAAC,eAAe,CAClB;CAEA,OAAO,YACL,OAAO,SAAiB;EACtB,MAAM,eAAe,iBAAiB,IAAI;EAC1C,MAAM,SAAS,WAAW,KAAK,KAAK,OAAO;EAK3C,IAAI;EACJ,IAAI;GACF,WAAW,MAAM,aAAa;EAChC,QAAQ;GACN,OAAO;EACT;EAEA,MAAM,YAAY,MAAM,SAAS,OAAO,QAAQ;GAC9C,QAAQ,eAAe,eAAe;GACtC,SAAS,SAAS;GAClB,GAAG;EACL,CAAC;EAED,IAAI,UACF,OAAO,UACJ,QAAQ,UAAU,EAAE,CAAC,CACrB,QAAQ,iBAAiB,EAAE,CAAC,CAC5B,QAAQ,WAAW,EAAE,CAAC,CACtB,KAAK;EAGV,OAAO;CACT,GACA,CAAC,gBAAgB,QAAQ,CAC3B;AACF;;;ACtDA,MAAM,QAAQ,EACZ,OACA,OACA,QACA,WACA,iBACA,UACA,KACA,UACA,QACA,SACA,GAAG,YACQ;CACX,MAAM,aAAa,cAAc;EAAE;EAAU;CAAgB,CAAC;CAE9D,OACE,oBAAC,YAAD;EACS;EACP,OAAO,SAAS;EAChB,QAAQ,UAAU;EAClB,WAAW,GAAG,SAAS;EAGvB,YAAY,MAAM,KAAA,IAAY;EACpB;EACF;EACR,eAAe;EACf,GAAI;CACL,CAAA;AAEL"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"detect-typescript-CCj9ALXc.js","names":[],"sources":["../src/utils/detect-typescript.ts"],"sourcesContent":["import { REGEX, TS_PATTERNS } from '../constants';\n\nexport const detectTypeScript = (code: string): boolean => {\n // Strip `import`/`export ... from '...'` lines first — aliasing via `as`\n // (`import * as ui from 'ui-kit'`, `import { Foo as Bar } from '...'`) is\n // plain ES module syntax, not a TypeScript signal, but it otherwise\n // matches the `as\\s+\\w+` pattern below and made every piece of code look\n // like TypeScript.\n const withoutModuleLines = code.replace(REGEX.MODULE_IMPORT_EXPORT_LINE, '');\n\n return TS_PATTERNS.some(pattern => pattern.test(withoutModuleLines));\n};\n"],"mappings":";;AAEA,MAAa,oBAAoB,SAA0B;CAMzD,MAAM,qBAAqB,KAAK,QAAQ,MAAM,2BAA2B,EAAE;CAE3E,OAAO,YAAY,MAAK,YAAW,QAAQ,KAAK,kBAAkB,CAAC;AACrE"}