{"version":3,"file":"components/base/DiffViewer/utils.mjs","sources":["../../../../src/components/base/DiffViewer/utils.ts"],"sourcesContent":["import { editor } from 'monaco-editor';\nimport { DefaultEditorConfig } from '../CodeViewer/utils';\nconst OptimizedDiffEditorConfig: editor.IDiffEditorConstructionOptions = {\n  ...structuredClone(DefaultEditorConfig),\n  readOnly: true,\n  originalEditable: false,\n  // Enable side-by-side view mode, displaying comparison content left and right\n  renderSideBySide: true,\n  // Set the automatic switching breakpoint for side-by-side display to 1,\n  // disabling auto-switching\n  renderSideBySideInlineBreakpoint: 1,\n  renderIndicators: true,\n  definitionLinkOpensInPeek: false,\n  // Set DOM elements to read-only, enhancing security\n  domReadOnly: true,\n  // Disable the code minimap on the right to improve performance\n  minimap: { enabled: false },\n  // Enable word wrap to display long lines of text completely in the view\n  diffWordWrap: 'on',\n\n  // Performance optimization items\n  // Disable code folding to reduce unnecessary calculations\n  folding: false,\n  // Disable line number margin hover effects to improve rendering performance\n  lineNumbersMinChars: 3,\n  // Reduce rendering of external decorations to improve performance\n  renderLineHighlight: 'none',\n  // Disable bracket matching highlighting to reduce computation\n  matchBrackets: 'never',\n\n  // Display effect optimizations\n  // Enable advanced configuration for the difference algorithm to improve accuracy of difference display\n  diffAlgorithm: 'advanced',\n  // Ignore whitespace changes to focus on content differences\n  ignoreTrimWhitespace: true,\n  // Enable connecting lines between different code blocks to improve readability\n  renderOverviewRuler: true,\n  // Highlight the current line to enhance readability\n  renderLineHighlightOnlyWhenFocus: true,\n  // Enable smooth scrolling effect\n  smoothScrolling: true,\n  // Set appropriate letter spacing to improve readability\n  letterSpacing: 0.5,\n};\n\n/**\n * get monaco options, it'll combine default config\n * @param options\n * @returns target options\n */\nexport function defineMonacoDiffOptions(\n  options?: editor.IDiffEditorConstructionOptions,\n): editor.IDiffEditorConstructionOptions {\n  return {\n    ...structuredClone(OptimizedDiffEditorConfig),\n    ...options,\n  };\n}\n"],"names":["OptimizedDiffEditorConfig","structuredClone","DefaultEditorConfig","defineMonacoDiffOptions","options"],"mappings":";AAEA,MAAMA,4BAAmE;IACvE,GAAGC,gBAAgBC,oBAAoB;IACvC,UAAU;IACV,kBAAkB;IAElB,kBAAkB;IAGlB,kCAAkC;IAClC,kBAAkB;IAClB,2BAA2B;IAE3B,aAAa;IAEb,SAAS;QAAE,SAAS;IAAM;IAE1B,cAAc;IAId,SAAS;IAET,qBAAqB;IAErB,qBAAqB;IAErB,eAAe;IAIf,eAAe;IAEf,sBAAsB;IAEtB,qBAAqB;IAErB,kCAAkC;IAElC,iBAAiB;IAEjB,eAAe;AACjB;AAOO,SAASC,wBACdC,OAA+C;IAE/C,OAAO;QACL,GAAGH,gBAAgBD,0BAA0B;QAC7C,GAAGI,OAAO;IACZ;AACF"}