{
  "id": "task_libraries:code-editor/react",
  "path": "/exapedia/react-code-editor-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "React code editor libraries",
  "answer": [
    {
      "t": "text",
      "text": "React code editor libraries embed a code editing surface with syntax highlighting in a React application. Most wrap an existing editor engine such as Monaco, CodeMirror, or Ace and expose its instance through props and callbacks. These libraries let developer tools, playgrounds, and admin consoles accept code from users."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "React code editor libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#monaco-react",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-codemirror",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#codesandbox-sandpack-react",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-simple-code-editor",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-ace",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F199"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-live",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-codemirrortwo",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F235"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-monaco-editor",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F254"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F263"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "npm"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#monaco-react",
          "label": [
            {
              "t": "text",
              "text": "@monaco-editor/react"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F129"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Diff editor component",
            "Running code preview",
            "File explorer component"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#monaco-react",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-codemirror",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#codesandbox-sandpack-react",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-simple-code-editor",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-ace",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F199"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-live",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-codemirrortwo",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F235"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-monaco-editor",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F254"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F266"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "monaco-react",
          "name": [
            {
              "t": "fact",
              "fact": "F128"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/suren-atoyan/monaco-react"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@monaco-editor/react"
            },
            {
              "label": "Docs",
              "href": "https://github.com/suren-atoyan/monaco-react/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/suren-atoyan/monaco-react/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F128"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/cloudflare/cloudflare-os",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "export default function CodeEditor({ filename, ytext, isReady, height = '100%' }: CodeEditorProps) {\n  const { resolvedThemeMode } = useTheme()\n  const codeTheme = getGadgetsCodeTheme(resolvedThemeMode)\n  const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null)\n  const monacoRef = useRef<typeof import('monaco-editor') | null>(null)\n  const bindingRef = useRef<MonacoBinding | null>(null)\n  const [editorReady, setEditorReady] = useState(false)\n\n  // Set up Monaco binding when editor and ytext are available.\n  // When ytext is transiently null (e.g., streaming doc rebuild), the binding\n  // is detached but the Monaco editor stays mounted — no blank flash.\n  useEffect(() => {\n    const ed = editorRef.current\n    const monaco = monacoRef.current\n\n    if (!ed || !monaco || !ytext || !editorReady) {\n      return\n    }\n\n    // Get or create a model for this file\n    const model = ed.getModel()\n    if (!model) {\n      return\n    }\n\n    // Create the binding between Y.Text and Monaco\n    // The binding will sync the Y.Text content to the Monaco model\n    const binding = new MonacoBinding(\n      ytext,\n      model,\n      new Set([ed])\n    )\n    bindingRef.current = binding\n\n    return () => {\n      // Clean up binding when component unmounts or ytext changes\n      binding.destroy()\n      bindingRef.current = null\n    }\n  }, [ytext, editorReady])\n\n  // Handle editor mount\n  const handleEditorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: typeof import('monaco-editor')) => {\n    editorRef.current = editor\n    monacoRef.current = monaco\n    setEditorReady(true)\n  }\n\n  if (!filename) {\n    return (\n      <div\n        className=\"flex justify-center items-center bg-kumo-base text-kumo-subtle\"\n        style={{ height }}\n      >\n        Select a file to start editing\n      </div>\n    )\n  }\n\n  return (\n    <div style={{ position: 'relative', height }}>\n      <Editor\n        height=\"100%\"\n        language={getLanguage(filename)}\n        defaultValue=\"\"\n        beforeMount={defineGadgetsCodeTheme}\n        onMount={handleEditorDidMount}\n        theme={codeTheme}\n        options={{\n          automaticLayout: true,\n          fontSize: 13,\n          lineHeight: 20,\n          letterSpacing: 0,\n          fontFamily: monoFont,\n          fontLigatures: false,\n          minimap: { enabled: false },\n          wordWrap: 'on',\n          scrollBeyondLastLine: false,\n          renderLineHighlight: 'none',\n          selectOnLineNumbers: true,\n          roundedSelection: false,\n          readOnly: !isReady,\n          cursorStyle: 'line',\n          autoIndent: 'full',\n          formatOnPaste: true,\n          formatOnType: true,\n          suggest: {\n            snippetsPreventQuickSuggestions: false\n          },\n          tabSize: 2,\n          insertSpaces: true,\n          folding: true,\n          foldingStrategy: 'indentation',\n          showFoldingControls: 'mouseover',\n          unfoldOnClickAfterEndOfLine: false,\n          lineDecorationsWidth: 12,\n          lineNumbersMinChars: 4,\n          overviewRulerLanes: 0,\n          hideCursorInOverviewRuler: true,\n          renderWhitespace: 'none',\n          guides: {\n            indentation: false,\n            highlightActiveIndentation: false,\n          },\n          occurrencesHighlight: 'off',\n          selectionHighlight: false,\n          scrollbar: {\n            verticalScrollbarSize: 10,\n            horizontalScrollbarSize: 10,\n            useShadows: false,\n          },\n          contextmenu: true,\n          mouseWheelZoom: true\n        }}\n      />\n    </div>\n  )\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/cloudflare/cloudflare-os/blob/e1ab8fbd4f609aff7ede9d490bafe1bcf9b2a682/packages/workshop-frontend/src/CodeEditor.tsx#L17-L134",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20%40monaco-editor/react%20for%20controlled%20React%20code%20editing%20with%20editor%20refs%20and%20callbacks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F128"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import Editor from '@monaco-editor/react';\n\nexport default function App() {\n  return <Editor height=\"300px\" defaultLanguage=\"javascript\" defaultValue=\"// hello\" />;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/suren-atoyan/monaco-react/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F133"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-codemirror",
          "name": [
            {
              "t": "fact",
              "fact": "F146"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/uiwjs/react-codemirror"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@uiw/react-codemirror"
            },
            {
              "label": "Docs",
              "href": "https://github.com/uiwjs/react-codemirror/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F38"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/uiwjs/react-codemirror/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F146"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/CherryHQ/cherry-studio",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "const CodeEditor = ({\n  ref,\n  value,\n  placeholder,\n  language,\n  onSave,\n  onChange,\n  onBlur,\n  onHeightChange,\n  height,\n  maxHeight,\n  minHeight,\n  options,\n  extensions,\n  fontSize: customFontSize,\n  style,\n  className,\n  editable = true,\n  readOnly = false,\n  expanded = true,\n  wrapped = true\n}: CodeEditorProps) => {\n  const { fontSize: _fontSize, codeShowLineNumbers: _lineNumbers, codeEditor } = useSettings()\n  const enableKeymap = useMemo(() => options?.keymap ?? codeEditor.keymap, [options?.keymap, codeEditor.keymap])\n\n  // 合并 codeEditor 和 options 的 basicSetup，options 优先\n  const basicSetup = useMemo(() => {\n    return {\n      lineNumbers: _lineNumbers,\n      ...(codeEditor as BasicSetupOptions),\n      ...(options as BasicSetupOptions)\n    }\n  }, [codeEditor, _lineNumbers, options])\n\n  const fontSize = useMemo(() => customFontSize ?? _fontSize - 1, [customFontSize, _fontSize])\n\n  const { activeCmTheme } = useCodeStyle()\n  const initialContent = useRef(options?.stream ? (value ?? '').trimEnd() : (value ?? ''))\n  const editorViewRef = useRef<EditorView | null>(null)\n\n  const langExtensions = useLanguageExtensions(language, options?.lint)\n\n  const handleSave = useCallback(() => {\n    const currentDoc = editorViewRef.current?.state.doc.toString() ?? ''\n    onSave?.(currentDoc)\n  }, [onSave])\n\n  // Get current content from editor\n  const getContent = useCallback(() => {\n    return editorViewRef.current?.state.doc.toString() ?? ''\n  }, [])\n\n  // 流式响应过程中计算 changes 来更新 EditorView\n  // 无法处理用户在流式响应过程中编辑代码的情况（应该也不必处理）\n  useEffect(() => {\n    if (!editorViewRef.current) return\n\n    const newContent = options?.stream ? (value ?? '').trimEnd() : (value ?? '')\n    const currentDoc = editorViewRef.current.state.doc.toString()\n\n    const changes = prepareCodeChanges(currentDoc, newContent)\n\n    if (changes && changes.length > 0) {\n      editorViewRef.current.dispatch({\n        changes,\n        annotations: [External.of(true)]\n      })\n    }\n  }, [options?.stream, value])\n\n  const saveKeymapExtension = useSaveKeymap({ onSave, enabled: enableKeymap })\n  const blurExtension = useBlurHandler({ onBlur })\n  const heightListenerExtension = useHeightListener({ onHeightChange })\n\n  const customExtensions = useMemo(() => {\n    return [\n      ...(extensions ?? []),\n      ...langExtensions,\n      ...(wrapped ? [EditorView.lineWrapping] : []),\n      saveKeymapExtension,\n      blurExtension,\n      heightListenerExtension\n    ].flat()\n  }, [extensions, langExtensions, wrapped, saveKeymapExtension, blurExtension, heightListenerExtension])\n\n  const scrollToLine = useScrollToLine(editorViewRef)\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      save: handleSave,\n      scrollToLine,\n      getContent\n    }),\n    [handleSave, scrollToLine, getContent]\n  )\n\n  return (\n    <CodeMirror\n      // 维持一个稳定值，避免触发 CodeMirror 重置\n      value={initialContent.current}\n      placeholder={placeholder}\n      width=\"100%\"\n      height={expanded ? undefined : height}\n      maxHeight={expanded ? undefined : maxHeight}\n      minHeight={minHeight}\n      editable={editable}\n      readOnly={readOnly}\n      // @ts-ignore 强制使用，见 react-codemirror 的 Example.tsx\n      theme={activeCmTheme}\n      extensions={customExtensions}\n      onCreateEditor={(view: EditorView) => {\n        editorViewRef.current = view\n        onHeightChange?.(view.scrollDOM?.scrollHeight ?? 0)\n      }}\n      onChange={(value, viewUpdate) => {\n        if (onChange && viewUpdate.docChanged) onChange(value)\n      }}\n      basicSetup={{\n        dropCursor: true,\n        allowMultipleSelections: true,\n        indentOnInput: true,\n        bracketMatching: true,\n        closeBrackets: true,\n        rectangularSelection: true,\n        crosshairCursor: true,\n        highlightActiveLineGutter: false,\n        highlightSelectionMatches: true,\n        closeBracketsKeymap: enableKeymap,\n        searchKeymap: enableKeymap,\n        foldKeymap: enableKeymap,\n        completionKeymap: enableKeymap,\n        lintKeymap: enableKeymap,\n        ...basicSetup // override basicSetup\n      }}\n      style={{\n        fontSize,\n        marginTop: 0,\n        borderRadius: 'inherit',\n        ...style\n      }}\n      className={`code-editor ${className ?? ''}`}\n    />\n  )\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/CherryHQ/cherry-studio/blob/101904d03518e601ad2970242b2f29b15219073b/src/renderer/src/components/CodeEditor/index.tsx#L107-L251",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20%40uiw/react-codemirror%20for%20controlled%20React%20code%20editing%20with%20editor%20refs%20and%20callbacks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F146"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { useState } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\n\nexport default function App() {\n  const [code, setCode] = useState('hello');\n  return <CodeMirror value={code} height=\"200px\" onChange={setCode} />;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/uiwjs/react-codemirror/blob/master/core/src/index.tsx",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F151"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "codesandbox-sandpack-react",
          "name": [
            {
              "t": "fact",
              "fact": "F163"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/codesandbox/sandpack"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@codesandbox/sandpack-react"
            },
            {
              "label": "Docs",
              "href": "https://github.com/codesandbox/sandpack/blob/main/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/codesandbox/sandpack/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/slab/quill",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F180"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "jsx",
              "code": "({ files, visibleFiles, activeFile, externalResources }) => {\n    const [overrides] = useState(() => {\n      if (location.hash.startsWith('#code')) {\n        const code = location.hash.replace('#code', '').trim();\n        let userCode;\n        try {\n          userCode = JSON.parse(decompressFromEncodedURIComponent(code));\n        } catch (err) {}\n        return userCode || {};\n      }\n      return {};\n    });\n\n    return (\n      <SandpackProvider\n        options={{\n          visibleFiles,\n          activeFile,\n          externalResources:\n            externalResources && externalResources.map(replaceCDN),\n        }}\n        template=\"static\"\n        files={Object.keys(files).reduce((f, name) => {\n          const fullName = name.startsWith('/') ? name : `/${name}`;\n          return {\n            ...f,\n            [name]: replaceCDN(overrides[fullName] ?? files[name]).trim(),\n          };\n        }, {})}\n      >\n        <LocationOverride filenames={Object.keys(files)} />\n        <div className={styles.standaloneWrapper}>\n          <div className={styles.standaloneFileTree}>\n            <SandpackFileExplorer autoHiddenFiles />\n          </div>\n          <div className={styles.standaloneEditor}>\n            <SandpackCodeEditor\n              showTabs={false}\n              wrapContent\n              showRunButton={false}\n            />\n          </div>\n          <div className={styles.standalonePreview}>\n            <SandpackPreview showOpenInCodeSandbox={false} />\n          </div>\n        </div>\n      </SandpackProvider>\n    );\n  }\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/slab/quill/blob/539cbffd0a13b18e9c65eb84dd35e6596e403158/packages/website/src/components/Sandpack.jsx#L101-L149",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40codesandbox/sandpack-react%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "jsx",
              "code": "import { Sandpack } from '@codesandbox/sandpack-react';\n\nexport default function App() {\n  return <Sandpack template=\"react\" />;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/codesandbox/sandpack/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-simple-code-editor",
          "name": [
            {
              "t": "fact",
              "fact": "F182"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/react-simple-code-editor/react-simple-code-editor"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/react-simple-code-editor"
            },
            {
              "label": "Docs",
              "href": "https://github.com/react-simple-code-editor/react-simple-code-editor/blob/main/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F61"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/react-simple-code-editor/react-simple-code-editor/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F182"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F62"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/styleguidist/react-styleguidist",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "public render() {\n\treturn (\n\t\t<SimpleEditor\n\t\t\tclassName={this.props.classes.root}\n\t\t\tvalue={this.state.code}\n\t\t\tonValueChange={this.handleChange}\n\t\t\thighlight={highlight}\n\t\t\t// Padding should be passed via a prop (not CSS) for a proper\n\t\t\t// cursor position calculation\n\t\t\tpadding={space[2]}\n\t\t/>\n\t);\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/styleguidist/react-styleguidist/blob/c223f9a279f4e872cf6ff925fb21d2a7f6e27a77/src/client/rsg-components/Editor/Editor.tsx#L79-L91",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F196"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20react-simple-code-editor%20for%20controlled%20React%20code%20editing%20with%20editor%20refs%20and%20callbacks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F182"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { useState } from 'react';\nimport Editor from 'react-simple-code-editor';\nimport { highlight, languages } from 'prismjs/components/prism-core';\nimport 'prismjs/components/prism-clike';\nimport 'prismjs/components/prism-javascript';\nimport 'prismjs/themes/prism.css';\n\nexport default function App() {\n  const [code, setCode] = useState('const answer = 42;');\n  return <Editor value={code} onValueChange={setCode}\n    highlight={value => highlight(value, languages.js)} padding={10} />;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/react-simple-code-editor/react-simple-code-editor/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F187"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-ace",
          "name": [
            {
              "t": "fact",
              "fact": "F199"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/securingsincity/react-ace"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/react-ace"
            },
            {
              "label": "Docs",
              "href": "https://github.com/securingsincity/react-ace/blob/main/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F82"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/securingsincity/react-ace/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F199"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F83"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F84"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F85"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F86"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F87"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F88"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/spinnaker/deck",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F214"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "public componentDidMount(): void {\n  if (this.props.autofocus) {\n    const { editor } = this.editorRef.current as any;\n    editor.focus();\n    editor.navigateFileStart();\n  }\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/spinnaker/deck/blob/308a9911678a58d167e16df323a96af0e6e5786b/app/scripts/modules/core/src/presentation/forms/inputs/JsonEditor.tsx#L43-L49",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F213"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20react-ace%20for%20controlled%20React%20code%20editing%20with%20editor%20refs%20and%20callbacks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F199"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import AceEditor from 'react-ace';\nimport 'ace-builds/src-noconflict/mode-java';\nimport 'ace-builds/src-noconflict/theme-github';\n\nexport default function App() {\n  return <AceEditor mode=\"java\" theme=\"github\" name=\"code-input\"\n    defaultValue=\"// hello\" width=\"100%\" height=\"200px\" />;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/securingsincity/react-ace/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F204"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-live",
          "name": [
            {
              "t": "fact",
              "fact": "F216"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/FormidableLabs/react-live"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/react-live"
            },
            {
              "label": "Docs",
              "href": "https://github.com/FormidableLabs/react-live/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F223"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/FormidableLabs/react-live/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F216"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/meta/docusaurus",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F233"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "jsx",
              "code": "function LiveProviderComponent({code, children, ...props}: Props): ReactNode {\n  const prismTheme = usePrismTheme();\n  const noInline = props.metastring?.includes('noInline') ?? false;\n  return (\n    <LiveProvider\n      noInline={noInline}\n      theme={prismTheme}\n      {...props}\n      code={code?.replace(/\\n$/, '')}\n      transformCode={props.transformCode ?? DEFAULT_TRANSFORM_CODE}>\n      {children}\n    </LiveProvider>\n  );\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/meta/docusaurus/blob/2556f711f4c9653bcd6f74ca6acc52eb07b6c6d7/packages/docusaurus-theme-live-codeblock/src/theme/Playground/Provider/index.tsx#L18-L31",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F232"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=react-live%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F216"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "jsx",
              "code": "import { LiveProvider, LiveEditor, LivePreview } from 'react-live';\n\nexport default function App() {\n  return (\n    <LiveProvider code=\"<strong>Hello</strong>\">\n      <LiveEditor />\n      <LivePreview />\n    </LiveProvider>\n  );\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/FormidableLabs/react-live/blob/master/packages/react-live/src/index.ts",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F221"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-codemirrortwo",
          "name": [
            {
              "t": "fact",
              "fact": "F235"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/scniro/react-codemirror2"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/react-codemirror2"
            },
            {
              "label": "Docs",
              "href": "https://github.com/scniro/react-codemirror2/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F242"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/scniro/react-codemirror2/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F235"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F253"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/decaporg/decap-cms",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F252"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "jsx",
              "code": "handleChange(newValue) {\n  const cursor = this.cm.doc.getCursor();\n  const selections = this.cm.doc.listSelections();\n  this.setState({ lastKnownValue: newValue });\n  this.props.onChange(this.toValue('code', newValue), { cursor, selections });\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/decaporg/decap-cms/blob/4589962560fcff888596cce6ee9cf6bcfa339764/packages/decap-cms-widget-code/src/CodeControl.js#L246-L251",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F251"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=react-codemirror2%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F235"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "jsx",
              "code": "import { useState } from 'react';\nimport { Controlled as CodeMirror } from 'react-codemirror2';\nimport 'codemirror/lib/codemirror.css';\n\nexport default function App() {\n  const [code, setCode] = useState('hello');\n  return <CodeMirror value={code}\n    onBeforeChange={(_editor, _change, value) => setCode(value)} />;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/scniro/react-codemirror2/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F240"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-monaco-editor",
          "name": [
            {
              "t": "fact",
              "fact": "F254"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/react-monaco-editor/react-monaco-editor"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/react-monaco-editor"
            },
            {
              "label": "Docs",
              "href": "https://github.com/react-monaco-editor/react-monaco-editor/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F261"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F263"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/react-monaco-editor/react-monaco-editor/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F254"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F272"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F273"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/microsoft/nni",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F272"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "jsx",
              "code": "const MonacoHTML = (props: MonacoEditorProps): any => {\n    const { content, loading, height } = props;\n    return (\n        <React.Fragment>\n            {loading ? (\n                <Spinner\n                    label='Wait, wait...'\n                    ariaLive='assertive'\n                    labelPosition='right'\n                    styles={{ root: { width: '100%', height: height } }}\n                >\n                    <MonacoEditor\n                        width='100%'\n                        height={height}\n                        language='json'\n                        value={content}\n                        options={{\n                            minimap: { enabled: false },\n                            readOnly: true,\n                            automaticLayout: true,\n                            wordWrap: 'on'\n                        }}\n                    />\n                </Spinner>\n            ) : (\n                <MonacoEditor\n                    width='100%'\n                    height={height}\n                    language='json'\n                    value={content}\n                    options={{\n                        minimap: { enabled: false },\n                        readOnly: true,\n                        automaticLayout: true,\n                        wordWrap: 'on'\n                    }}\n                />\n            )}\n        </React.Fragment>\n    );\n};",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/microsoft/nni/blob/767ed7f22e1e588ce76cbbecb6c6a4a76a309805/ts/webui/src/components/common/MonacoEditor.tsx#L11-L51",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F271"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=react-monaco-editor%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F254"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "jsx",
              "code": "import MonacoEditor from 'react-monaco-editor';\n\nexport default function App() {\n  return <MonacoEditor height=\"300\" language=\"javascript\" value=\"// hello\" />;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/react-monaco-editor/react-monaco-editor/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F259"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which React code editor library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#monaco-react",
          "label": [
            {
              "t": "text",
              "text": "@monaco-editor/react"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits multi-file editors that keep a model and view state for each path. "
        },
        {
          "t": "link",
          "href": "#react-codemirror",
          "label": [
            {
              "t": "text",
              "text": "@uiw/react-codemirror"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits CodeMirror editors configured through extensions. "
        },
        {
          "t": "link",
          "href": "#react-simple-code-editor",
          "label": [
            {
              "t": "text",
              "text": "react-simple-code-editor"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits small controlled inputs with an application-supplied highlighter."
        }
      ]
    },
    {
      "q": "What is react-live?",
      "a": [
        {
          "t": "link",
          "href": "#react-live",
          "label": [
            {
              "t": "text",
              "text": "react-live"
            }
          ]
        },
        {
          "t": "text",
          "text": " provides a production-focused playground for live editing React code."
        }
      ]
    },
    {
      "q": "How do I use Ace in React?",
      "a": [
        {
          "t": "link",
          "href": "#react-ace",
          "label": [
            {
              "t": "text",
              "text": "react-ace"
            }
          ]
        },
        {
          "t": "text",
          "text": " embeds Ace with React props for text, editor options, and event callbacks. Autocomplete needs the language_tools extension imported first."
        }
      ]
    },
    {
      "q": "How do I use Monaco Editor in React?",
      "a": [
        {
          "t": "link",
          "href": "#monaco-react",
          "label": [
            {
              "t": "text",
              "text": "@monaco-editor/react"
            }
          ]
        },
        {
          "t": "text",
          "text": " embeds Monaco editors with React props and native editor callbacks. It loads its engine files from a CDN unless local files are configured."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, @monaco-editor/react",
      "display": "Monaco React",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, @monaco-editor/react",
      "display": "37.6M",
      "asOf": "2026-11-15"
    },
    "F3": {
      "label": "License, @monaco-editor/react",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, @monaco-editor/react",
      "display": "4.7.0",
      "asOf": "2026-11-17"
    },
    "F5": {
      "label": "Undated package release, @monaco-editor/react",
      "display": "v4.7.0",
      "asOf": "2026-11-17"
    },
    "F6": {
      "label": "Repository stars, @monaco-editor/react",
      "display": "4.8K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Controlled value, @monaco-editor/react",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Syntax highlighting, @monaco-editor/react",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Read-only mode, @monaco-editor/react",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Editor instance, @monaco-editor/react",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, @monaco-editor/react",
      "display": "npm install @monaco-editor/react",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, @monaco-editor/react",
      "display": "Embeds Monaco editors with React props, model paths, and native editor callbacks.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, @monaco-editor/react",
      "display": "Preserves models between files",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, @monaco-editor/react",
      "display": "Switch path to restore a file’s model and view state.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, @monaco-editor/react",
      "display": "Exposes the native editor",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, @monaco-editor/react",
      "display": "Use onMount to retain the editor instance for later commands.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, @monaco-editor/react",
      "display": "Loads engine files remotely",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, @monaco-editor/react",
      "display": "Configure local Monaco files when the default CDN is unavailable.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, @monaco-editor/react",
      "display": "Hook initialization is asynchronous",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, @monaco-editor/react",
      "display": "Wait for useMonaco to return an instance before calling editor APIs.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, @monaco-editor/react",
      "display": "import React, { useRef } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport Editor from '@monaco-editor/react';\n\nfunction App() {\n  const editorRef = useRef(null);\n\n  function handleEditorDidMount(editor, monaco) {\n    editorRef.current = editor;\n  }\n\n  function showValue() {\n    alert(editorRef.current.getValue());\n  }\n\n  return (\n    <>\n      <button onClick={showValue}>Show value</button>\n      <Editor\n        height=\"90vh\"\n        defaultLanguage=\"javascript\"\n        defaultValue=\"// some comment\"\n        onMount={handleEditorDidMount}\n      />\n    </>\n  );\n}\n\nconst rootElement = document.getElementById('root');\nReactDOM.render(<App />, rootElement);\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, @monaco-editor/react",
      "display": "export default function CodeEditor({ filename, ytext, isReady, height = '100%' }: CodeEditorProps) {\n  const { resolvedThemeMode } = useTheme()\n  const codeTheme = getGadgetsCodeTheme(resolvedThemeMode)\n  const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null)\n  const monacoRef = useRef<typeof import('monaco-editor') | null>(null)\n  const bindingRef = useRef<MonacoBinding | null>(null)\n  const [editorReady, setEditorReady] = useState(false)\n\n  // Set up Monaco binding when editor and ytext are available.\n  // When ytext is transiently null (e.g., streaming doc rebuild), the binding\n  // is detached but the Monaco editor stays mounted — no blank flash.\n  useEffect(() => {\n    const ed = editorRef.current\n    const monaco = monacoRef.current\n\n    if (!ed || !monaco || !ytext || !editorReady) {\n      return\n    }\n\n    // Get or create a model for this file\n    const model = ed.getModel()\n    if (!model) {\n      return\n    }\n\n    // Create the binding between Y.Text and Monaco\n    // The binding will sync the Y.Text content to the Monaco model\n    const binding = new MonacoBinding(\n      ytext,\n      model,\n      new Set([ed])\n    )\n    bindingRef.current = binding\n\n    return () => {\n      // Clean up binding when component unmounts or ytext changes\n      binding.destroy()\n      bindingRef.current = null\n    }\n  }, [ytext, editorReady])\n\n  // Handle editor mount\n  const handleEditorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: typeof import('monaco-editor')) => {\n    editorRef.current = editor\n    monacoRef.current = monaco\n    setEditorReady(true)\n  }\n\n  if (!filename) {\n    return (\n      <div\n        className=\"flex justify-center items-center bg-kumo-base text-kumo-subtle\"\n        style={{ height }}\n      >\n        Select a file to start editing\n      </div>\n    )\n  }\n\n  return (\n    <div style={{ position: 'relative', height }}>\n      <Editor\n        height=\"100%\"\n        language={getLanguage(filename)}\n        defaultValue=\"\"\n        beforeMount={defineGadgetsCodeTheme}\n        onMount={handleEditorDidMount}\n        theme={codeTheme}\n        options={{\n          automaticLayout: true,\n          fontSize: 13,\n          lineHeight: 20,\n          letterSpacing: 0,\n          fontFamily: monoFont,\n          fontLigatures: false,\n          minimap: { enabled: false },\n          wordWrap: 'on',\n          scrollBeyondLastLine: false,\n          renderLineHighlight: 'none',\n          selectOnLineNumbers: true,\n          roundedSelection: false,\n          readOnly: !isReady,\n          cursorStyle: 'line',\n          autoIndent: 'full',\n          formatOnPaste: true,\n          formatOnType: true,\n          suggest: {\n            snippetsPreventQuickSuggestions: false\n          },\n          tabSize: 2,\n          insertSpaces: true,\n          folding: true,\n          foldingStrategy: 'indentation',\n          showFoldingControls: 'mouseover',\n          unfoldOnClickAfterEndOfLine: false,\n          lineDecorationsWidth: 12,\n          lineNumbersMinChars: 4,\n          overviewRulerLanes: 0,\n          hideCursorInOverviewRuler: true,\n          renderWhitespace: 'none',\n          guides: {\n            indentation: false,\n            highlightActiveIndentation: false,\n          },\n          occurrencesHighlight: 'off',\n          selectionHighlight: false,\n          scrollbar: {\n            verticalScrollbarSize: 10,\n            horizontalScrollbarSize: 10,\n            useShadows: false,\n          },\n          contextmenu: true,\n          mouseWheelZoom: true\n        }}\n      />\n    </div>\n  )\n}\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, @monaco-editor/react",
      "display": "CodeEditor.tsx · CodeEditor()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, @monaco-editor/react",
      "display": "cloudflare/cloudflare-os",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, cloudflare/cloudflare-os",
      "display": "11.8K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, cloudflare/cloudflare-os",
      "display": "Nov 2026",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Library name, @uiw/react-codemirror",
      "display": "React CodeMirror",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, @uiw/react-codemirror",
      "display": "26.5M",
      "asOf": "2026-11-15"
    },
    "F29": {
      "label": "License, @uiw/react-codemirror",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, @uiw/react-codemirror",
      "display": "4.25.12",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Undated package release, @uiw/react-codemirror",
      "display": "v4.25.12",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Repository stars, @uiw/react-codemirror",
      "display": "2.3K",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Controlled value, @uiw/react-codemirror",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Syntax highlighting, @uiw/react-codemirror",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Read-only mode, @uiw/react-codemirror",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Editor instance, @uiw/react-codemirror",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Install, @uiw/react-codemirror",
      "display": "npm install @uiw/react-codemirror @codemirror/lang-javascript",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "What it does, @uiw/react-codemirror",
      "display": "Embeds CodeMirror with React state, extension configuration, and native editor callbacks.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, @uiw/react-codemirror",
      "display": "Exposes native editor state",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, @uiw/react-codemirror",
      "display": "Use onCreateEditor to access the editor view and state.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths lead, @uiw/react-codemirror",
      "display": "Restores serialized editor state",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths, @uiw/react-codemirror",
      "display": "Use initialState to restore saved editor state, including configured history fields.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, @uiw/react-codemirror",
      "display": "Changing extensions triggers costly rerenders",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, @uiw/react-codemirror",
      "display": "Memoize dynamic extensions to keep their references stable.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Quickstart, @uiw/react-codemirror",
      "display": "import React from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\nimport { javascript } from '@codemirror/lang-javascript';\n\nfunction App() {\n  const [value, setValue] = React.useState(\"console.log('hello world!');\");\n  const onChange = React.useCallback((val, viewUpdate) => {\n    console.log('val:', val);\n    setValue(val);\n  }, []);\n  return <CodeMirror value={value} height=\"200px\" extensions={[javascript({ jsx: true })]} onChange={onChange} />;\n}\nexport default App;\n",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Project function, @uiw/react-codemirror",
      "display": "const CodeEditor = ({\n  ref,\n  value,\n  placeholder,\n  language,\n  onSave,\n  onChange,\n  onBlur,\n  onHeightChange,\n  height,\n  maxHeight,\n  minHeight,\n  options,\n  extensions,\n  fontSize: customFontSize,\n  style,\n  className,\n  editable = true,\n  readOnly = false,\n  expanded = true,\n  wrapped = true\n}: CodeEditorProps) => {\n  const { fontSize: _fontSize, codeShowLineNumbers: _lineNumbers, codeEditor } = useSettings()\n  const enableKeymap = useMemo(() => options?.keymap ?? codeEditor.keymap, [options?.keymap, codeEditor.keymap])\n\n  // 合并 codeEditor 和 options 的 basicSetup，options 优先\n  const basicSetup = useMemo(() => {\n    return {\n      lineNumbers: _lineNumbers,\n      ...(codeEditor as BasicSetupOptions),\n      ...(options as BasicSetupOptions)\n    }\n  }, [codeEditor, _lineNumbers, options])\n\n  const fontSize = useMemo(() => customFontSize ?? _fontSize - 1, [customFontSize, _fontSize])\n\n  const { activeCmTheme } = useCodeStyle()\n  const initialContent = useRef(options?.stream ? (value ?? '').trimEnd() : (value ?? ''))\n  const editorViewRef = useRef<EditorView | null>(null)\n\n  const langExtensions = useLanguageExtensions(language, options?.lint)\n\n  const handleSave = useCallback(() => {\n    const currentDoc = editorViewRef.current?.state.doc.toString() ?? ''\n    onSave?.(currentDoc)\n  }, [onSave])\n\n  // Get current content from editor\n  const getContent = useCallback(() => {\n    return editorViewRef.current?.state.doc.toString() ?? ''\n  }, [])\n\n  // 流式响应过程中计算 changes 来更新 EditorView\n  // 无法处理用户在流式响应过程中编辑代码的情况（应该也不必处理）\n  useEffect(() => {\n    if (!editorViewRef.current) return\n\n    const newContent = options?.stream ? (value ?? '').trimEnd() : (value ?? '')\n    const currentDoc = editorViewRef.current.state.doc.toString()\n\n    const changes = prepareCodeChanges(currentDoc, newContent)\n\n    if (changes && changes.length > 0) {\n      editorViewRef.current.dispatch({\n        changes,\n        annotations: [External.of(true)]\n      })\n    }\n  }, [options?.stream, value])\n\n  const saveKeymapExtension = useSaveKeymap({ onSave, enabled: enableKeymap })\n  const blurExtension = useBlurHandler({ onBlur })\n  const heightListenerExtension = useHeightListener({ onHeightChange })\n\n  const customExtensions = useMemo(() => {\n    return [\n      ...(extensions ?? []),\n      ...langExtensions,\n      ...(wrapped ? [EditorView.lineWrapping] : []),\n      saveKeymapExtension,\n      blurExtension,\n      heightListenerExtension\n    ].flat()\n  }, [extensions, langExtensions, wrapped, saveKeymapExtension, blurExtension, heightListenerExtension])\n\n  const scrollToLine = useScrollToLine(editorViewRef)\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      save: handleSave,\n      scrollToLine,\n      getContent\n    }),\n    [handleSave, scrollToLine, getContent]\n  )\n\n  return (\n    <CodeMirror\n      // 维持一个稳定值，避免触发 CodeMirror 重置\n      value={initialContent.current}\n      placeholder={placeholder}\n      width=\"100%\"\n      height={expanded ? undefined : height}\n      maxHeight={expanded ? undefined : maxHeight}\n      minHeight={minHeight}\n      editable={editable}\n      readOnly={readOnly}\n      // @ts-ignore 强制使用，见 react-codemirror 的 Example.tsx\n      theme={activeCmTheme}\n      extensions={customExtensions}\n      onCreateEditor={(view: EditorView) => {\n        editorViewRef.current = view\n        onHeightChange?.(view.scrollDOM?.scrollHeight ?? 0)\n      }}\n      onChange={(value, viewUpdate) => {\n        if (onChange && viewUpdate.docChanged) onChange(value)\n      }}\n      basicSetup={{\n        dropCursor: true,\n        allowMultipleSelections: true,\n        indentOnInput: true,\n        bracketMatching: true,\n        closeBrackets: true,\n        rectangularSelection: true,\n        crosshairCursor: true,\n        highlightActiveLineGutter: false,\n        highlightSelectionMatches: true,\n        closeBracketsKeymap: enableKeymap,\n        searchKeymap: enableKeymap,\n        foldKeymap: enableKeymap,\n        completionKeymap: enableKeymap,\n        lintKeymap: enableKeymap,\n        ...basicSetup // override basicSetup\n      }}\n      style={{\n        fontSize,\n        marginTop: 0,\n        borderRadius: 'inherit',\n        ...style\n      }}\n      className={`code-editor ${className ?? ''}`}\n    />\n  )\n}\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function reference, @uiw/react-codemirror",
      "display": "index.tsx · CodeEditor()",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project repository, @uiw/react-codemirror",
      "display": "CherryHQ/cherry-studio",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project stars, CherryHQ/cherry-studio",
      "display": "53.6K",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project push date, CherryHQ/cherry-studio",
      "display": "Nov 2026",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Library name, react-simple-code-editor",
      "display": "React Simple Code Editor",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Monthly downloads, react-simple-code-editor",
      "display": "5.1M",
      "asOf": "2026-11-15"
    },
    "F53": {
      "label": "License, react-simple-code-editor",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Package release, react-simple-code-editor",
      "display": "0.14.1",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Undated package release, react-simple-code-editor",
      "display": "v0.14.1",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Repository stars, react-simple-code-editor",
      "display": "1.7K",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Controlled value, react-simple-code-editor",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Syntax highlighting, react-simple-code-editor",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Read-only mode, react-simple-code-editor",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Install, react-simple-code-editor",
      "display": "npm install react-simple-code-editor prismjs",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "What it does, react-simple-code-editor",
      "display": "Provides a controlled code input with an application-supplied syntax highlighter.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "strengths lead, react-simple-code-editor",
      "display": "Works as a controlled input",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths, react-simple-code-editor",
      "display": "Pass value and update it through onValueChange.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, react-simple-code-editor",
      "display": "Allows keyboard users to escape",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, react-simple-code-editor",
      "display": "Set ignoreTabKey or use the shortcut to stop capturing Tab.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "limitations lead, react-simple-code-editor",
      "display": "Slows down with large documents",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations, react-simple-code-editor",
      "display": "Large documents can reduce typing speed.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, react-simple-code-editor",
      "display": "Mixed font styles misalign text",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, react-simple-code-editor",
      "display": "Keep highlighted text aligned with the underlying textarea.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Quickstart, react-simple-code-editor",
      "display": "import React from 'react';\nimport Editor from 'react-simple-code-editor';\nimport { highlight, languages } from 'prismjs/components/prism-core';\nimport 'prismjs/components/prism-clike';\nimport 'prismjs/components/prism-javascript';\nimport 'prismjs/themes/prism.css'; //Example style, you can use another\n\nfunction App() {\n  const [code, setCode] = React.useState(\n    `function add(a, b) {\\n  return a + b;\\n}`\n  );\n  return (\n    <Editor\n      value={code}\n      onValueChange={code => setCode(code)}\n      highlight={code => highlight(code, languages.js)}\n      padding={10}\n      style={{\n        fontFamily: '\"Fira code\", \"Fira Mono\", monospace',\n        fontSize: 12,\n      }}\n    />\n  );\n}\n",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Library name, react-ace",
      "display": "React Ace",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Monthly downloads, react-ace",
      "display": "3.3M",
      "asOf": "2026-11-15"
    },
    "F73": {
      "label": "License, react-ace",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Package release, react-ace",
      "display": "15.0.0",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Undated package release, react-ace",
      "display": "v15.0.0",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Repository stars, react-ace",
      "display": "4.2K",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Controlled value, react-ace",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Syntax highlighting, react-ace",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Read-only mode, react-ace",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Editor instance, react-ace",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Install, react-ace",
      "display": "npm install react-ace",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "What it does, react-ace",
      "display": "Embeds Ace with React props for text, editor options, and event callbacks.",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "strengths lead, react-ace",
      "display": "Exposes native editor commands",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths, react-ace",
      "display": "Use the component’s editor property to run Ace commands.",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "strengths lead, react-ace",
      "display": "Adds custom keyboard commands",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths, react-ace",
      "display": "Pass commands with key bindings and their event handlers.",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "limitations lead, react-ace",
      "display": "Autocomplete needs an extension",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "limitations, react-ace",
      "display": "Import language_tools before enabling completions or snippets.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Quickstart, react-ace",
      "display": "import React from \"react\";\nimport { render } from \"react-dom\";\nimport AceEditor from \"react-ace\";\n\nimport \"ace-builds/src-noconflict/mode-java\";\nimport \"ace-builds/src-noconflict/theme-github\";\nimport \"ace-builds/src-noconflict/ext-language_tools\";\n\nfunction onChange(newValue) {\n  console.log(\"change\", newValue);\n}\n\n// Render editor\nrender(\n  <AceEditor\n    mode=\"java\"\n    theme=\"github\"\n    onChange={onChange}\n    name=\"UNIQUE_ID_OF_DIV\"\n    editorProps={{ $blockScrolling: true }}\n  />,\n  document.getElementById(\"example\")\n);\n",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Project function, react-ace",
      "display": "public componentDidMount(): void {\n    if (this.props.autofocus) {\n      const { editor } = this.editorRef.current as any;\n      editor.focus();\n      editor.navigateFileStart();\n    }\n  }\n",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "Project function reference, react-ace",
      "display": "JsonEditor.tsx · componentDidMount()",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Project repository, react-ace",
      "display": "spinnaker/deck",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project stars, spinnaker/deck",
      "display": "307",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project push date, spinnaker/deck",
      "display": "Dec 2025",
      "asOf": "2025-12-20"
    },
    "F95": {
      "label": "Developer need",
      "display": "Switching between retained file models",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Why choose @monaco-editor/react",
      "display": "path-based models and retained view state",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need in introduction",
      "display": "switching between retained file models",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "When to consider @uiw/react-codemirror",
      "display": "serialized editor state is the integration requirement",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need",
      "display": "Restoring saved editing sessions",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Why choose @uiw/react-codemirror",
      "display": "serialized editor state with initialState",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need in introduction",
      "display": "restoring saved editing sessions",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "When to consider @monaco-editor/react",
      "display": "switching between retained file models is central",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need",
      "display": "Calling native editor commands",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Why choose react-ace",
      "display": "the wrapped Ace editor property",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need in introduction",
      "display": "calling native editor commands",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need",
      "display": "Embedding a controlled code input",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Why choose react-simple-code-editor",
      "display": "value and onValueChange props",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need in introduction",
      "display": "embedding a controlled code input",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "When to consider react-ace",
      "display": "native editor commands are required",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Page introduction",
      "display": "React code editor libraries let web developers embed source-code editing interfaces.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: How is this different from comparing JavaScript editor engines?",
      "display": "These React wrappers expose editor values, callbacks, and lifecycle access through component APIs.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: How is this different from comparing JavaScript editor engines?",
      "display": "The simple input delegates syntax highlighting to a separate library.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which component preserves models when switching files?",
      "display": "Monaco React uses path to identify models and can restore view state, selection, undo stack and scroll position.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: How can the native editor be accessed?",
      "display": "Monaco React passes the editor instance to onMount.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: How can the native editor be accessed?",
      "display": "React CodeMirror supplies the view and state through onCreateEditor.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: How can the native editor be accessed?",
      "display": "React Ace exposes its wrapped editor through the component editor property.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Does Monaco React need access to a CDN?",
      "display": "The loader downloads Monaco files from a CDN by default; loader.config can point at locally hosted files instead.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Why can useMonaco initially return null?",
      "display": "Monaco initializes asynchronously, so a hook that initiates loading first returns null until the instance is ready.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: How should dynamic CodeMirror extensions be created?",
      "display": "Define fixed extensions outside the component and memoize dynamic extensions to avoid costly reference-driven rerenders.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Can editor state survive a page reload?",
      "display": "React CodeMirror can restore JSON-serialized state with initialState; saving undo history includes the historyField mapping.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: How are language modes and syntax highlighting supplied?",
      "display": "React CodeMirror language support can be added through packages such as the JavaScript language extension.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: How are language modes and syntax highlighting supplied?",
      "display": "React Ace imports language modes, snippets, and language_tools from ace-builds.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: How are language modes and syntax highlighting supplied?",
      "display": "React Simple Code Editor accepts an external syntax-highlighting callback.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Does the current React Ace release support ES modules?",
      "display": "The observed release provides native ESM alongside CommonJS and an import/require exports map.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Is React Simple Code Editor suitable for large documents?",
      "display": "Its own stated limitation is that large documents can affect typing speed.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Can highlighted tokens use different font layouts in React Simple Code Editor?",
      "display": "Changing font family, weight, style, or line height can misalign the highlighted layer with its textarea.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: How can keyboard users move past the simple code input?",
      "display": "Use ignoreTabKey to stop capturing Tab; users can also toggle capture with the provided keyboard shortcut.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "Library name, @monaco-editor/react",
      "display": "@monaco-editor/react",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Monthly downloads, @monaco-editor/react",
      "display": "38.6M",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "License, @monaco-editor/react",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Package release, @monaco-editor/react",
      "display": "4.7.0",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Package release date, @monaco-editor/react",
      "display": "Feb 2025",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Install, @monaco-editor/react",
      "display": "npm install @monaco-editor/react",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Quickstart, @monaco-editor/react",
      "display": "import Editor from '@monaco-editor/react';\n\nexport default function App() {\n  return <Editor height=\"300px\" defaultLanguage=\"javascript\" defaultValue=\"// hello\" />;\n}\n",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Repository stars, @monaco-editor/react",
      "display": "4.8K",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Diff editor component, @monaco-editor/react",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Running code preview, @monaco-editor/react",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "File explorer component, @monaco-editor/react",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "React integration role, @monaco-editor/react",
      "display": "Monaco React binding with lifecycle callbacks, loader configuration, path-based models, and an exported diff editor.",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Host and engine prerequisites, @monaco-editor/react",
      "display": "A browser React application that mounts App. Default loader fetches Monaco from a CDN; configure loader paths/Monaco for self-hosting or restricted-network hosts. TypeScript consumers also need matching monaco-editor types.",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Multiple file models, @monaco-editor/react",
      "display": "Path-based multi-model editor with saved view state; no native file-explorer component claimed.",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project function, @monaco-editor/react",
      "display": "export default function CodeEditor({ filename, ytext, isReady, height = '100%' }: CodeEditorProps) {\n  const { resolvedThemeMode } = useTheme()\n  const codeTheme = getGadgetsCodeTheme(resolvedThemeMode)\n  const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null)\n  const monacoRef = useRef<typeof import('monaco-editor') | null>(null)\n  const bindingRef = useRef<MonacoBinding | null>(null)\n  const [editorReady, setEditorReady] = useState(false)\n\n  // Set up Monaco binding when editor and ytext are available.\n  // When ytext is transiently null (e.g., streaming doc rebuild), the binding\n  // is detached but the Monaco editor stays mounted — no blank flash.\n  useEffect(() => {\n    const ed = editorRef.current\n    const monaco = monacoRef.current\n\n    if (!ed || !monaco || !ytext || !editorReady) {\n      return\n    }\n\n    // Get or create a model for this file\n    const model = ed.getModel()\n    if (!model) {\n      return\n    }\n\n    // Create the binding between Y.Text and Monaco\n    // The binding will sync the Y.Text content to the Monaco model\n    const binding = new MonacoBinding(\n      ytext,\n      model,\n      new Set([ed])\n    )\n    bindingRef.current = binding\n\n    return () => {\n      // Clean up binding when component unmounts or ytext changes\n      binding.destroy()\n      bindingRef.current = null\n    }\n  }, [ytext, editorReady])\n\n  // Handle editor mount\n  const handleEditorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: typeof import('monaco-editor')) => {\n    editorRef.current = editor\n    monacoRef.current = monaco\n    setEditorReady(true)\n  }\n\n  if (!filename) {\n    return (\n      <div\n        className=\"flex justify-center items-center bg-kumo-base text-kumo-subtle\"\n        style={{ height }}\n      >\n        Select a file to start editing\n      </div>\n    )\n  }\n\n  return (\n    <div style={{ position: 'relative', height }}>\n      <Editor\n        height=\"100%\"\n        language={getLanguage(filename)}\n        defaultValue=\"\"\n        beforeMount={defineGadgetsCodeTheme}\n        onMount={handleEditorDidMount}\n        theme={codeTheme}\n        options={{\n          automaticLayout: true,\n          fontSize: 13,\n          lineHeight: 20,\n          letterSpacing: 0,\n          fontFamily: monoFont,\n          fontLigatures: false,\n          minimap: { enabled: false },\n          wordWrap: 'on',\n          scrollBeyondLastLine: false,\n          renderLineHighlight: 'none',\n          selectOnLineNumbers: true,\n          roundedSelection: false,\n          readOnly: !isReady,\n          cursorStyle: 'line',\n          autoIndent: 'full',\n          formatOnPaste: true,\n          formatOnType: true,\n          suggest: {\n            snippetsPreventQuickSuggestions: false\n          },\n          tabSize: 2,\n          insertSpaces: true,\n          folding: true,\n          foldingStrategy: 'indentation',\n          showFoldingControls: 'mouseover',\n          unfoldOnClickAfterEndOfLine: false,\n          lineDecorationsWidth: 12,\n          lineNumbersMinChars: 4,\n          overviewRulerLanes: 0,\n          hideCursorInOverviewRuler: true,\n          renderWhitespace: 'none',\n          guides: {\n            indentation: false,\n            highlightActiveIndentation: false,\n          },\n          occurrencesHighlight: 'off',\n          selectionHighlight: false,\n          scrollbar: {\n            verticalScrollbarSize: 10,\n            horizontalScrollbarSize: 10,\n            useShadows: false,\n          },\n          contextmenu: true,\n          mouseWheelZoom: true\n        }}\n      />\n    </div>\n  )\n}\n",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Project source file, @monaco-editor/react",
      "display": "packages/workshop-frontend/src/CodeEditor.tsx",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project full_name, @monaco-editor/react",
      "display": "cloudflare/cloudflare-os",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project stargazers_count, @monaco-editor/react",
      "display": "11.8K",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Library name, @uiw/react-codemirror",
      "display": "@uiw/react-codemirror",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Monthly downloads, @uiw/react-codemirror",
      "display": "27.3M",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "License, @uiw/react-codemirror",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Package release, @uiw/react-codemirror",
      "display": "4.25.12",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Package release date, @uiw/react-codemirror",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Install, @uiw/react-codemirror",
      "display": "npm install @uiw/react-codemirror",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Quickstart, @uiw/react-codemirror",
      "display": "import { useState } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\n\nexport default function App() {\n  const [code, setCode] = useState('hello');\n  return <CodeMirror value={code} height=\"200px\" onChange={setCode} />;\n}\n",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Repository stars, @uiw/react-codemirror",
      "display": "2.3K",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Diff editor component, @uiw/react-codemirror",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Running code preview, @uiw/react-codemirror",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "File explorer component, @uiw/react-codemirror",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "React integration role, @uiw/react-codemirror",
      "display": "CodeMirror6 React component with extension/state/view access and controlled change callbacks.",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Host and engine prerequisites, @uiw/react-codemirror",
      "display": "A browser React application that mounts App. This first call edits plain text; language syntax/completion uses separate CodeMirror6 language extensions. No CodeMirror5 mode imports.",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project function, @uiw/react-codemirror",
      "display": "const CodeEditor = ({\n  ref,\n  value,\n  placeholder,\n  language,\n  onSave,\n  onChange,\n  onBlur,\n  onHeightChange,\n  height,\n  maxHeight,\n  minHeight,\n  options,\n  extensions,\n  fontSize: customFontSize,\n  style,\n  className,\n  editable = true,\n  readOnly = false,\n  expanded = true,\n  wrapped = true\n}: CodeEditorProps) => {\n  const { fontSize: _fontSize, codeShowLineNumbers: _lineNumbers, codeEditor } = useSettings()\n  const enableKeymap = useMemo(() => options?.keymap ?? codeEditor.keymap, [options?.keymap, codeEditor.keymap])\n\n  // 合并 codeEditor 和 options 的 basicSetup，options 优先\n  const basicSetup = useMemo(() => {\n    return {\n      lineNumbers: _lineNumbers,\n      ...(codeEditor as BasicSetupOptions),\n      ...(options as BasicSetupOptions)\n    }\n  }, [codeEditor, _lineNumbers, options])\n\n  const fontSize = useMemo(() => customFontSize ?? _fontSize - 1, [customFontSize, _fontSize])\n\n  const { activeCmTheme } = useCodeStyle()\n  const initialContent = useRef(options?.stream ? (value ?? '').trimEnd() : (value ?? ''))\n  const editorViewRef = useRef<EditorView | null>(null)\n\n  const langExtensions = useLanguageExtensions(language, options?.lint)\n\n  const handleSave = useCallback(() => {\n    const currentDoc = editorViewRef.current?.state.doc.toString() ?? ''\n    onSave?.(currentDoc)\n  }, [onSave])\n\n  // Get current content from editor\n  const getContent = useCallback(() => {\n    return editorViewRef.current?.state.doc.toString() ?? ''\n  }, [])\n\n  // 流式响应过程中计算 changes 来更新 EditorView\n  // 无法处理用户在流式响应过程中编辑代码的情况（应该也不必处理）\n  useEffect(() => {\n    if (!editorViewRef.current) return\n\n    const newContent = options?.stream ? (value ?? '').trimEnd() : (value ?? '')\n    const currentDoc = editorViewRef.current.state.doc.toString()\n\n    const changes = prepareCodeChanges(currentDoc, newContent)\n\n    if (changes && changes.length > 0) {\n      editorViewRef.current.dispatch({\n        changes,\n        annotations: [External.of(true)]\n      })\n    }\n  }, [options?.stream, value])\n\n  const saveKeymapExtension = useSaveKeymap({ onSave, enabled: enableKeymap })\n  const blurExtension = useBlurHandler({ onBlur })\n  const heightListenerExtension = useHeightListener({ onHeightChange })\n\n  const customExtensions = useMemo(() => {\n    return [\n      ...(extensions ?? []),\n      ...langExtensions,\n      ...(wrapped ? [EditorView.lineWrapping] : []),\n      saveKeymapExtension,\n      blurExtension,\n      heightListenerExtension\n    ].flat()\n  }, [extensions, langExtensions, wrapped, saveKeymapExtension, blurExtension, heightListenerExtension])\n\n  const scrollToLine = useScrollToLine(editorViewRef)\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      save: handleSave,\n      scrollToLine,\n      getContent\n    }),\n    [handleSave, scrollToLine, getContent]\n  )\n\n  return (\n    <CodeMirror\n      // 维持一个稳定值，避免触发 CodeMirror 重置\n      value={initialContent.current}\n      placeholder={placeholder}\n      width=\"100%\"\n      height={expanded ? undefined : height}\n      maxHeight={expanded ? undefined : maxHeight}\n      minHeight={minHeight}\n      editable={editable}\n      readOnly={readOnly}\n      // @ts-ignore 强制使用，见 react-codemirror 的 Example.tsx\n      theme={activeCmTheme}\n      extensions={customExtensions}\n      onCreateEditor={(view: EditorView) => {\n        editorViewRef.current = view\n        onHeightChange?.(view.scrollDOM?.scrollHeight ?? 0)\n      }}\n      onChange={(value, viewUpdate) => {\n        if (onChange && viewUpdate.docChanged) onChange(value)\n      }}\n      basicSetup={{\n        dropCursor: true,\n        allowMultipleSelections: true,\n        indentOnInput: true,\n        bracketMatching: true,\n        closeBrackets: true,\n        rectangularSelection: true,\n        crosshairCursor: true,\n        highlightActiveLineGutter: false,\n        highlightSelectionMatches: true,\n        closeBracketsKeymap: enableKeymap,\n        searchKeymap: enableKeymap,\n        foldKeymap: enableKeymap,\n        completionKeymap: enableKeymap,\n        lintKeymap: enableKeymap,\n        ...basicSetup // override basicSetup\n      }}\n      style={{\n        fontSize,\n        marginTop: 0,\n        borderRadius: 'inherit',\n        ...style\n      }}\n      className={`code-editor ${className ?? ''}`}\n    />\n  )\n}\n",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project source file, @uiw/react-codemirror",
      "display": "src/renderer/src/components/CodeEditor/index.tsx",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project full_name, @uiw/react-codemirror",
      "display": "CherryHQ/cherry-studio",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project stargazers_count, @uiw/react-codemirror",
      "display": "53.6K",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Library name, @codesandbox/sandpack-react",
      "display": "@codesandbox/sandpack-react",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Monthly downloads, @codesandbox/sandpack-react",
      "display": "6.6M",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "License, @codesandbox/sandpack-react",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Package release, @codesandbox/sandpack-react",
      "display": "2.20.0",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Package release date, @codesandbox/sandpack-react",
      "display": "Feb 2025",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Install, @codesandbox/sandpack-react",
      "display": "npm install @codesandbox/sandpack-react",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Quickstart, @codesandbox/sandpack-react",
      "display": "import { Sandpack } from '@codesandbox/sandpack-react';\n\nexport default function App() {\n  return <Sandpack template=\"react\" />;\n}\n",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Official description, @codesandbox/sandpack-react",
      "display": "Provides the Sandpack React components from CodeSandbox.",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Quickstart source file, @codesandbox/sandpack-react",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Repository stars, @codesandbox/sandpack-react",
      "display": "6.3K",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Diff editor component, @codesandbox/sandpack-react",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Running code preview, @codesandbox/sandpack-react",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "File explorer component, @codesandbox/sandpack-react",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "React integration role, @codesandbox/sandpack-react",
      "display": "Editable multi-file code sandboxes with native file explorer and running browser preview components.",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Host and engine prerequisites, @codesandbox/sandpack-react",
      "display": "A browser React application that mounts App, with access to the configured Sandpack bundler/iframe service and template dependencies. This starter uses the composite Sandpack component rather than manually constructing providers.",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project function, @codesandbox/sandpack-react",
      "display": "({ files, visibleFiles, activeFile, externalResources }) => {\n    const [overrides] = useState(() => {\n      if (location.hash.startsWith('#code')) {\n        const code = location.hash.replace('#code', '').trim();\n        let userCode;\n        try {\n          userCode = JSON.parse(decompressFromEncodedURIComponent(code));\n        } catch (err) {}\n        return userCode || {};\n      }\n      return {};\n    });\n\n    return (\n      <SandpackProvider\n        options={{\n          visibleFiles,\n          activeFile,\n          externalResources:\n            externalResources && externalResources.map(replaceCDN),\n        }}\n        template=\"static\"\n        files={Object.keys(files).reduce((f, name) => {\n          const fullName = name.startsWith('/') ? name : `/${name}`;\n          return {\n            ...f,\n            [name]: replaceCDN(overrides[fullName] ?? files[name]).trim(),\n          };\n        }, {})}\n      >\n        <LocationOverride filenames={Object.keys(files)} />\n        <div className={styles.standaloneWrapper}>\n          <div className={styles.standaloneFileTree}>\n            <SandpackFileExplorer autoHiddenFiles />\n          </div>\n          <div className={styles.standaloneEditor}>\n            <SandpackCodeEditor\n              showTabs={false}\n              wrapContent\n              showRunButton={false}\n            />\n          </div>\n          <div className={styles.standalonePreview}>\n            <SandpackPreview showOpenInCodeSandbox={false} />\n          </div>\n        </div>\n      </SandpackProvider>\n    );\n  }\n",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Project source file, @codesandbox/sandpack-react",
      "display": "packages/website/src/components/Sandpack.jsx",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project full_name, @codesandbox/sandpack-react",
      "display": "slab/quill",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project stargazers_count, @codesandbox/sandpack-react",
      "display": "47.4K",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Library name, react-simple-code-editor",
      "display": "react-simple-code-editor",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Monthly downloads, react-simple-code-editor",
      "display": "5.3M",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "License, react-simple-code-editor",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Package release, react-simple-code-editor",
      "display": "0.14.1",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Package release date, react-simple-code-editor",
      "display": "Jul 2024",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Install, react-simple-code-editor",
      "display": "npm install react-simple-code-editor prismjs",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Quickstart, react-simple-code-editor",
      "display": "import { useState } from 'react';\nimport Editor from 'react-simple-code-editor';\nimport { highlight, languages } from 'prismjs/components/prism-core';\nimport 'prismjs/components/prism-clike';\nimport 'prismjs/components/prism-javascript';\nimport 'prismjs/themes/prism.css';\n\nexport default function App() {\n  const [code, setCode] = useState('const answer = 42;');\n  return <Editor value={code} onValueChange={setCode}\n    highlight={value => highlight(value, languages.js)} padding={10} />;\n}\n",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Repository stars, react-simple-code-editor",
      "display": "1.7K",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Diff editor component, react-simple-code-editor",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Running code preview, react-simple-code-editor",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "File explorer component, react-simple-code-editor",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "React integration role, react-simple-code-editor",
      "display": "Controlled textarea-backed code input with a caller-supplied syntax highlighter.",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Host and engine prerequisites, react-simple-code-editor",
      "display": "A browser React app/bundler that handles CSS, with Prism installed and clike/javascript grammars loaded in order. The controlled string and highlighting callback are required; mounting App is host setup.",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Project function, react-simple-code-editor",
      "display": "public render() {\n\treturn (\n\t\t<SimpleEditor\n\t\t\tclassName={this.props.classes.root}\n\t\t\tvalue={this.state.code}\n\t\t\tonValueChange={this.handleChange}\n\t\t\thighlight={highlight}\n\t\t\t// Padding should be passed via a prop (not CSS) for a proper\n\t\t\t// cursor position calculation\n\t\t\tpadding={space[2]}\n\t\t/>\n\t);\n}\n",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Project source file, react-simple-code-editor",
      "display": "src/client/rsg-components/Editor/Editor.tsx",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Project full_name, react-simple-code-editor",
      "display": "styleguidist/react-styleguidist",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Project stargazers_count, react-simple-code-editor",
      "display": "11.0K",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Library name, react-ace",
      "display": "react-ace",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Monthly downloads, react-ace",
      "display": "3.5M",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "License, react-ace",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Package release, react-ace",
      "display": "15.0.0",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Package release date, react-ace",
      "display": "Jul 2026",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Install, react-ace",
      "display": "npm install react-ace ace-builds",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Quickstart, react-ace",
      "display": "import AceEditor from 'react-ace';\nimport 'ace-builds/src-noconflict/mode-java';\nimport 'ace-builds/src-noconflict/theme-github';\n\nexport default function App() {\n  return <AceEditor mode=\"java\" theme=\"github\" name=\"code-input\"\n    defaultValue=\"// hello\" width=\"100%\" height=\"200px\" />;\n}\n",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Repository stars, react-ace",
      "display": "4.2K",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Diff editor component, react-ace",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Running code preview, react-ace",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "File explorer component, react-ace",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "React integration role, react-ace",
      "display": "Ace React components with engine refs, modes/themes, split view, and diff integration.",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Host and engine prerequisites, react-ace",
      "display": "A browser React app/bundler that handles Ace mode/theme assets and mounts App. Any worker assets requested by the selected mode must resolve through Ace asset configuration; name must be unique when rendering multiple editors. This snippet does not supply a browser app shell or silently disable workers.",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Project function, react-ace",
      "display": "public componentDidMount(): void {\n  if (this.props.autofocus) {\n    const { editor } = this.editorRef.current as any;\n    editor.focus();\n    editor.navigateFileStart();\n  }\n}\n",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Project source file, react-ace",
      "display": "app/scripts/modules/core/src/presentation/forms/inputs/JsonEditor.tsx",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Project full_name, react-ace",
      "display": "spinnaker/deck",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Project stargazers_count, react-ace",
      "display": "307",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Library name, react-live",
      "display": "react-live",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Monthly downloads, react-live",
      "display": "2.6M",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "License, react-live",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Package release, react-live",
      "display": "5.0.1",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Package release date, react-live",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Install, react-live",
      "display": "npm install react-live",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Quickstart, react-live",
      "display": "import { LiveProvider, LiveEditor, LivePreview } from 'react-live';\n\nexport default function App() {\n  return (\n    <LiveProvider code=\"<strong>Hello</strong>\">\n      <LiveEditor />\n      <LivePreview />\n    </LiveProvider>\n  );\n}\n",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Official description, react-live",
      "display": "Provides a production-focused playground for live editing React code.",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Quickstart source file, react-live",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Repository stars, react-live",
      "display": "4.6K",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Diff editor component, react-live",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Running code preview, react-live",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "File explorer component, react-live",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "React integration role, react-live",
      "display": "Live React expression/component editing with provider, editor, error, and preview components.",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Host and engine prerequisites, react-live",
      "display": "A browser React application that mounts App. The provider evaluates the editable React expression with its transpilation/scope rules; it is a live preview, not a sandbox security boundary. No captured code was evaluated by this research.",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Project function, react-live",
      "display": "function LiveProviderComponent({code, children, ...props}: Props): ReactNode {\n  const prismTheme = usePrismTheme();\n  const noInline = props.metastring?.includes('noInline') ?? false;\n  return (\n    <LiveProvider\n      noInline={noInline}\n      theme={prismTheme}\n      {...props}\n      code={code?.replace(/\\n$/, '')}\n      transformCode={props.transformCode ?? DEFAULT_TRANSFORM_CODE}>\n      {children}\n    </LiveProvider>\n  );\n}\n",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Project source file, react-live",
      "display": "packages/docusaurus-theme-live-codeblock/src/theme/Playground/Provider/index.tsx",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Project full_name, react-live",
      "display": "meta/docusaurus",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Project stargazers_count, react-live",
      "display": "66.8K",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Library name, react-codemirror2",
      "display": "react-codemirror2",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Monthly downloads, react-codemirror2",
      "display": "1.7M",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "License, react-codemirror2",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Package release, react-codemirror2",
      "display": "9.0.1",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Package release date, react-codemirror2",
      "display": "Oct 2025",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Install, react-codemirror2",
      "display": "npm install react-codemirror2 codemirror@5",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Quickstart, react-codemirror2",
      "display": "import { useState } from 'react';\nimport { Controlled as CodeMirror } from 'react-codemirror2';\nimport 'codemirror/lib/codemirror.css';\n\nexport default function App() {\n  const [code, setCode] = useState('hello');\n  return <CodeMirror value={code}\n    onBeforeChange={(_editor, _change, value) => setCode(value)} />;\n}\n",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Official description, react-codemirror2",
      "display": "Wraps CodeMirror in a small React component.",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Quickstart source file, react-codemirror2",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Repository stars, react-codemirror2",
      "display": "1.7K",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Diff editor component, react-codemirror2",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Running code preview, react-codemirror2",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "File explorer component, react-codemirror2",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "React integration role, react-codemirror2",
      "display": "CodeMirror5 controlled and uncontrolled React bindings with engine callbacks and external mode/theme assets.",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Host and engine prerequisites, react-codemirror2",
      "display": "A browser React application with CodeMirror5 peer installed and its base CSS loaded; additional modes/themes require their own assets. Controlled changes must update value in onBeforeChange. CodeMirror6 is a different engine API.",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Project function, react-codemirror2",
      "display": "handleChange(newValue) {\n  const cursor = this.cm.doc.getCursor();\n  const selections = this.cm.doc.listSelections();\n  this.setState({ lastKnownValue: newValue });\n  this.props.onChange(this.toValue('code', newValue), { cursor, selections });\n}\n",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Project source file, react-codemirror2",
      "display": "packages/decap-cms-widget-code/src/CodeControl.js",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Project full_name, react-codemirror2",
      "display": "decaporg/decap-cms",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Project stargazers_count, react-codemirror2",
      "display": "19.5K",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Library name, react-monaco-editor",
      "display": "react-monaco-editor",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Monthly downloads, react-monaco-editor",
      "display": "1.3M",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "License, react-monaco-editor",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Package release, react-monaco-editor",
      "display": "0.59.0",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Package release date, react-monaco-editor",
      "display": "Jul 2025",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Install, react-monaco-editor",
      "display": "yarn add react-monaco-editor",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Quickstart, react-monaco-editor",
      "display": "import MonacoEditor from 'react-monaco-editor';\n\nexport default function App() {\n  return <MonacoEditor height=\"300\" language=\"javascript\" value=\"// hello\" />;\n}\n",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Official description, react-monaco-editor",
      "display": "Provides Monaco Editor for React.",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Quickstart source file, react-monaco-editor",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Repository stars, react-monaco-editor",
      "display": "4.2K",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Diff editor component, react-monaco-editor",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Running code preview, react-monaco-editor",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "File explorer component, react-monaco-editor",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F267": {
      "label": "React integration role, react-monaco-editor",
      "display": "Monaco React binding with explicit bundler/worker setup and an exported diff component.",
      "asOf": "2026-11-20"
    },
    "F268": {
      "label": "Host and engine prerequisites, react-monaco-editor",
      "display": "A browser React application with Monaco peer resolved to the selected wrapper supported range (^0.52.0), matching worker/CSS bundling, and App mounted. The official Webpack integration uses monaco-editor-webpack-plugin; configure that integration before rendering. This is the React wrapper first call, not a complete Webpack project.",
      "asOf": "2026-11-20"
    },
    "F269": {
      "label": "Current ref shape, react-monaco-editor",
      "display": "Current default export is a forwardRef functional component; older source using the default import as a class type is not admitted without compatible type proof.",
      "asOf": "2026-11-20"
    },
    "F270": {
      "label": "Project function, react-monaco-editor",
      "display": "const MonacoHTML = (props: MonacoEditorProps): any => {\n    const { content, loading, height } = props;\n    return (\n        <React.Fragment>\n            {loading ? (\n                <Spinner\n                    label='Wait, wait...'\n                    ariaLive='assertive'\n                    labelPosition='right'\n                    styles={{ root: { width: '100%', height: height } }}\n                >\n                    <MonacoEditor\n                        width='100%'\n                        height={height}\n                        language='json'\n                        value={content}\n                        options={{\n                            minimap: { enabled: false },\n                            readOnly: true,\n                            automaticLayout: true,\n                            wordWrap: 'on'\n                        }}\n                    />\n                </Spinner>\n            ) : (\n                <MonacoEditor\n                    width='100%'\n                    height={height}\n                    language='json'\n                    value={content}\n                    options={{\n                        minimap: { enabled: false },\n                        readOnly: true,\n                        automaticLayout: true,\n                        wordWrap: 'on'\n                    }}\n                />\n            )}\n        </React.Fragment>\n    );\n};",
      "asOf": "2026-11-20"
    },
    "F271": {
      "label": "Project source file, react-monaco-editor",
      "display": "ts/webui/src/components/common/MonacoEditor.tsx",
      "asOf": "2026-11-20"
    },
    "F272": {
      "label": "Project full_name, react-monaco-editor",
      "display": "microsoft/nni",
      "asOf": "2026-11-20"
    },
    "F273": {
      "label": "Project stargazers_count, react-monaco-editor",
      "display": "14.4K",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best React code editor libraries Monaco React CodeMirror React Ace react-simple-code-editor code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
