PageSourceSearch

https://studiojungle.ai/assets/MonacoEditor-DOseMS1r.js

js studiojungle.ai collected 2026-10-05 14:20:30 UTC 4,747 bytes, 1 lines download raw bytes

1import{j as f}from"./index-TQG2ztjm.js";import{r as p,F as x}from"./vendor-monaco-K2VEKovO.js";import"./vendor-swagger-Bf7V8oR3.js";const j={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",html:"html",htm:"html",css:"css",scss:"scss",less:"less",json:"json",md:"markdown",mdx:"markdown",sql:"sql",py:"python",sh:"shell",bash:"shell",yml:"yaml",yaml:"yaml",toml:"plaintext",xml:"xml",go:"go",rs:"rust",java:"java",rb:"ruby",php:"php"};function v(r){var d;const g=((d=r.split(".").pop())==null?void 0:d.toLowerCase())||"";return j[g]||"plaintext"}function C({filename:r,value:g,onChange:d,readOnly:h=!1}){const b=p.useRef(null),k=p.useRef(null),y=p.useCallback((i,e)=>{b.current=i,k.current=e,e.editor.defineTheme("studiojungle-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"6b7280",fontStyle:"italic"},{token:"keyword",foreground:"34d399"},{token:"string",foreground:"fbbf24"},{token:"number",foreground:"f472b6"},{token:"type",foreground:"60a5fa"},{token:"function",foreground:"a5f3fc"}],colors:{"editor.background":"#0a0a0a","editor.foreground":"#e7e5e4","editor.lineHighlightBackgroun
1d":"#171717","editorLineNumber.foreground":"#525252","editorLineNumber.activeForeground":"#a3a3a3","editorCursor.foreground":"#10b981","editor.selectionBackground":"#10b98133","editor.inactiveSelectionBackground":"#10b98122","editorIndentGuide.background":"#171717","editorIndentGuide.activeBackground":"#262626","editorWhitespace.foreground":"#262626","editorBracketMatch.background":"#10b98133","editorBracketMatch.border":"#10b981","editorWidget.background":"#171717","editorWidget.border":"#262626","editorSuggestWidget.background":"#171717","editorSuggestWidget.border":"#262626","editorSuggestWidget.selectedBackground":"#10b98122","scrollbarSlider.background":"#26262688","scrollbarSlider.hoverBackground":"#404040aa"}}),e.editor.setTheme("studiojungle-dark"),i.addAction({id:"sj-cmd-k-edit",label:"Studio Jungle AI — edit selection",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyK],contextMenuGroupId:"1_modification",contextMenuOrder:1,run:o=>{const n=o.getSelection(),a=o.getModel();if(!n||!a)return;const s=a.getValueInRange(n);if(!s||!s.trim()){window.dispatchEvent(new CustomEvent("sj:cmd-k-trigger"));return}let l={top:0,left:0,width:0,height:0};try{const c=o.getDomNode(),t=o.getScrolledVisiblePosition(n.getStartPosition());if(c&&t){const u=c.getBoundingClientRect();l={top:u.top+t.top+t.height,left:u.left+t.left,width:200,height:t.height}}}catch{}window.dispatchEvent(new CustomEvent("sj:cmd-k-trigger",{detail:{source:"monaco",text:s,filename:r,rect:l}}))}}),e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),e.languages.typescript.typescriptDefaults.setCompilerOptions({target:e.languages.typescript.ScriptTarget.Latest,allowNonTsExtensions:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.NodeJs,module:e.languages.typescript.ModuleKind.ESNext,jsx:e.languages.typescript.JsxEmit.React,allowJs:!0,esModuleInterop:!0,isolatedModules:!0,strict:!1,skipLibCheck:!0});const S=o=>{const n=o.getSelection(),a=o.getModel();if(!n||!a)return;const s=a.getValueInRange(n);if(!s||!s.trim()){window.dispatchEvent(new CustomEvent("sj:cmd-k-no-selection"));return}let l={top:0,left:0,width:0,height:0};try{const c=o.getDomNode(),t=o.getScrolledVisiblePosition(n.getStartPosition());if(c&&t){const u=c.getBoundingClientRect();l={top:u.top+t.top+t.height,left:u.left+t.left,width:200,height:t.height}}}catch{}window.dispatchEvent(new CustomEvent("sj:cmd-k-trigger",{detail:{source:"monaco",text:s,filename:r,rect:l}}))},m=()=>S(i);window.addEventListener("sj:cmd-k-request-selection",m),i.onDidDispose(()=>window.removeEventListener("sj:cmd-k-request-selection",m))},[r]);p.useEffect(()=>()=>{},[]);const w=v(r);return f.jsx(x,{path:r,defaultLanguage:w,defaultValue:g,value:g,onMount:y,onChange:i=>{typeof i=="string"&&(d==null||d(i))},theme:"studiojungle-dark",options:{readOnly:h,fontFamily:'"JetBrains Mono", "Fira Code", Menlo, Monaco, ui-monospace, monospace',fontSize:13,lineHeight:20,minimap:{enabled:!0,scale:1},scrollBeyondLastLine:!1,smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},tabSize:2,insertSpaces:!0,formatOnPaste:!0,wordWrap:"on",wrappingIndent:"indent",stickyScroll:{enabled:!0},padding:{top:12,bottom:12},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10}},loading:f.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground text-xs",children:"Loading editor…"})},r)}export{C as MonacoEditor};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.