@octaviaflow/core 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/monaco.js ADDED
@@ -0,0 +1,554 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-ZAUUGK2Y.js";
4
+
5
+ // src/components/MonacoEditor/MonacoEditor.tsx
6
+ import {
7
+ Suspense,
8
+ lazy,
9
+ useCallback,
10
+ useEffect,
11
+ useRef,
12
+ useState
13
+ } from "react";
14
+
15
+ // src/components/MonacoEditor/octaviaflowTheme.ts
16
+ var OCTAVIAFLOW_LIGHT = {
17
+ base: "vs",
18
+ inherit: true,
19
+ rules: [
20
+ { token: "", foreground: "161616", background: "FFFFFF" },
21
+ { token: "comment", foreground: "6F6F6F", fontStyle: "italic" },
22
+ { token: "string", foreground: "198038" },
23
+ { token: "string.key.json", foreground: "0F62FE" },
24
+ { token: "string.value.json", foreground: "198038" },
25
+ { token: "number", foreground: "0043CE" },
26
+ { token: "keyword", foreground: "8A3FFC" },
27
+ { token: "keyword.sql", foreground: "8A3FFC" },
28
+ { token: "operator", foreground: "393939" },
29
+ { token: "delimiter", foreground: "525252" },
30
+ { token: "type", foreground: "0F62FE" },
31
+ { token: "type.identifier", foreground: "0F62FE" },
32
+ { token: "identifier", foreground: "161616" },
33
+ { token: "constant", foreground: "0043CE" },
34
+ { token: "boolean", foreground: "F1C21B", fontStyle: "bold" },
35
+ { token: "tag", foreground: "DA1E28" },
36
+ { token: "attribute.name", foreground: "8A3FFC" },
37
+ { token: "attribute.value", foreground: "198038" },
38
+ { token: "regexp", foreground: "DA1E28" },
39
+ { token: "function", foreground: "0F62FE" },
40
+ { token: "variable", foreground: "161616" },
41
+ { token: "variable.parameter", foreground: "393939", fontStyle: "italic" },
42
+ { token: "namespace", foreground: "0F62FE" }
43
+ ],
44
+ colors: {
45
+ "editor.background": "#FFFFFF",
46
+ "editor.foreground": "#161616",
47
+ "editor.lineHighlightBackground": "#F4F4F4",
48
+ "editor.lineHighlightBorder": "#00000000",
49
+ "editorLineNumber.foreground": "#A8A8A8",
50
+ "editorLineNumber.activeForeground": "#0F62FE",
51
+ "editorCursor.foreground": "#0F62FE",
52
+ "editor.selectionBackground": "#D0E2FF",
53
+ "editor.selectionHighlightBackground": "#EDF5FF",
54
+ "editor.wordHighlightBackground": "#EDF5FF",
55
+ "editor.wordHighlightStrongBackground": "#D0E2FF",
56
+ "editor.findMatchBackground": "#FFD7D9",
57
+ "editor.findMatchHighlightBackground": "#FFE9EB",
58
+ "editorIndentGuide.background1": "#F4F4F4",
59
+ "editorIndentGuide.activeBackground1": "#E0E0E0",
60
+ "editorWhitespace.foreground": "#E0E0E0",
61
+ "editorBracketMatch.background": "#D0E2FF",
62
+ "editorBracketMatch.border": "#0F62FE",
63
+ "editor.foldBackground": "#F4F4F4",
64
+ "editorGutter.background": "#F4F4F4",
65
+ "editorGutter.modifiedBackground": "#0F62FE",
66
+ "editorGutter.addedBackground": "#198038",
67
+ "editorGutter.deletedBackground": "#DA1E28",
68
+ "editorWidget.background": "#FFFFFF",
69
+ "editorWidget.foreground": "#161616",
70
+ "editorWidget.border": "#E0E0E0",
71
+ "editorSuggestWidget.background": "#FFFFFF",
72
+ "editorSuggestWidget.border": "#E0E0E0",
73
+ "editorSuggestWidget.foreground": "#161616",
74
+ "editorSuggestWidget.selectedBackground": "#EDF5FF",
75
+ "editorSuggestWidget.selectedForeground": "#161616",
76
+ "editorSuggestWidget.highlightForeground": "#0F62FE",
77
+ "editorHoverWidget.background": "#FFFFFF",
78
+ "editorHoverWidget.border": "#E0E0E0",
79
+ "editorError.foreground": "#DA1E28",
80
+ "editorWarning.foreground": "#F1C21B",
81
+ "editorInfo.foreground": "#0F62FE",
82
+ "diffEditor.insertedTextBackground": "#A7F0BA40",
83
+ "diffEditor.removedTextBackground": "#FFB3B840",
84
+ "diffEditor.insertedLineBackground": "#DEFBE640",
85
+ "diffEditor.removedLineBackground": "#FFD7D940",
86
+ "scrollbar.shadow": "#00000000",
87
+ "scrollbarSlider.background": "#0F62FE20",
88
+ "scrollbarSlider.hoverBackground": "#0F62FE40",
89
+ "scrollbarSlider.activeBackground": "#0F62FE60",
90
+ "minimap.background": "#FAFAFA",
91
+ "minimap.selectionHighlight": "#0F62FE",
92
+ "minimapSlider.background": "#0F62FE15",
93
+ "minimapSlider.hoverBackground": "#0F62FE30",
94
+ "minimapSlider.activeBackground": "#0F62FE50",
95
+ "input.background": "#FFFFFF",
96
+ "input.foreground": "#161616",
97
+ "input.border": "#C6C6C6",
98
+ "inputOption.activeBorder": "#0F62FE",
99
+ "focusBorder": "#0F62FE"
100
+ }
101
+ };
102
+ var OCTAVIAFLOW_THEME_ID = "octaviaflow-light";
103
+
104
+ // src/components/MonacoEditor/MonacoEditor.tsx
105
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
106
+ var Editor = lazy(
107
+ () => import("@monaco-editor/react").then((mod) => ({ default: mod.Editor }))
108
+ );
109
+ var MARKER_SEVERITY = {
110
+ hint: 1,
111
+ info: 2,
112
+ warning: 4,
113
+ error: 8
114
+ };
115
+ function MonacoEditor({
116
+ value,
117
+ onChange,
118
+ language = "plaintext",
119
+ readOnly = false,
120
+ height = 320,
121
+ minHeight = 120,
122
+ toolbar,
123
+ status,
124
+ hideToolbar = false,
125
+ hideFooter = false,
126
+ showCopy = true,
127
+ showFormat = true,
128
+ showWordWrapToggle = true,
129
+ showMinimapToggle = true,
130
+ wordWrap: wordWrapProp,
131
+ minimap: minimapProp,
132
+ showLineNumbers = true,
133
+ markers,
134
+ options,
135
+ onMount,
136
+ style,
137
+ className,
138
+ ariaLabel = "Code editor",
139
+ theme
140
+ }) {
141
+ const editorRef = useRef(null);
142
+ const monacoRef = useRef(null);
143
+ const [wordWrap, setWordWrap] = useState(wordWrapProp ?? false);
144
+ const [minimap, setMinimap] = useState(minimapProp ?? false);
145
+ const [copied, setCopied] = useState(false);
146
+ const [cursor, setCursor] = useState({ line: 1, column: 1 });
147
+ const [selection, setSelection] = useState({ chars: 0, lines: 0 });
148
+ const [lineCount, setLineCount] = useState(value.split("\n").length);
149
+ useEffect(() => {
150
+ if (wordWrapProp !== void 0) setWordWrap(wordWrapProp);
151
+ }, [wordWrapProp]);
152
+ useEffect(() => {
153
+ if (minimapProp !== void 0) setMinimap(minimapProp);
154
+ }, [minimapProp]);
155
+ useEffect(() => {
156
+ editorRef.current?.updateOptions({
157
+ wordWrap: wordWrap ? "on" : "off",
158
+ minimap: { enabled: minimap }
159
+ });
160
+ }, [wordWrap, minimap]);
161
+ useEffect(() => {
162
+ const editor = editorRef.current;
163
+ const monaco = monacoRef.current;
164
+ if (!editor || !monaco || !markers) return;
165
+ const model = editor.getModel();
166
+ if (!model) return;
167
+ monaco.editor.setModelMarkers(
168
+ model,
169
+ "octaviaflow",
170
+ markers.map((m) => ({
171
+ severity: MARKER_SEVERITY[m.severity ?? "error"],
172
+ message: m.message,
173
+ startLineNumber: m.line,
174
+ startColumn: m.column ?? 1,
175
+ endLineNumber: m.endLine ?? m.line,
176
+ endColumn: m.endColumn ?? (m.column ?? 1) + 1,
177
+ source: m.source
178
+ }))
179
+ );
180
+ }, [markers]);
181
+ const handleMount = useCallback(
182
+ (editor, monaco) => {
183
+ editorRef.current = editor;
184
+ monacoRef.current = monaco;
185
+ monaco.editor.defineTheme(OCTAVIAFLOW_THEME_ID, OCTAVIAFLOW_LIGHT);
186
+ monaco.editor.setTheme(theme ?? OCTAVIAFLOW_THEME_ID);
187
+ editor.onDidChangeCursorPosition((e) => {
188
+ setCursor({ line: e.position.lineNumber, column: e.position.column });
189
+ });
190
+ editor.onDidChangeCursorSelection((e) => {
191
+ const sel = e.selection;
192
+ if (sel.isEmpty()) {
193
+ setSelection({ chars: 0, lines: 0 });
194
+ return;
195
+ }
196
+ const model2 = editor.getModel();
197
+ if (!model2) return;
198
+ const text = model2.getValueInRange(sel);
199
+ setSelection({
200
+ chars: text.length,
201
+ lines: text.split("\n").length
202
+ });
203
+ });
204
+ const model = editor.getModel();
205
+ if (model) {
206
+ setLineCount(model.getLineCount());
207
+ model.onDidChangeContent(() => setLineCount(model.getLineCount()));
208
+ }
209
+ onMount?.(editor, monaco);
210
+ },
211
+ [onMount, theme]
212
+ );
213
+ const handleCopy = async () => {
214
+ if (typeof navigator === "undefined") return;
215
+ try {
216
+ await navigator.clipboard.writeText(value);
217
+ setCopied(true);
218
+ setTimeout(() => setCopied(false), 1200);
219
+ } catch {
220
+ }
221
+ };
222
+ const handleFormat = () => {
223
+ editorRef.current?.getAction("editor.action.formatDocument")?.run();
224
+ };
225
+ const mergedOptions = {
226
+ readOnly,
227
+ fontFamily: "ui-monospace, SFMono-Regular, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace",
228
+ fontSize: 13,
229
+ fontLigatures: true,
230
+ lineHeight: 20,
231
+ lineNumbers: showLineNumbers ? "on" : "off",
232
+ lineNumbersMinChars: 3,
233
+ lineDecorationsWidth: 6,
234
+ folding: true,
235
+ glyphMargin: false,
236
+ minimap: { enabled: minimap },
237
+ wordWrap: wordWrap ? "on" : "off",
238
+ scrollBeyondLastLine: false,
239
+ smoothScrolling: true,
240
+ cursorBlinking: "smooth",
241
+ cursorSmoothCaretAnimation: "on",
242
+ renderLineHighlight: "line",
243
+ padding: { top: 8, bottom: 8 },
244
+ bracketPairColorization: { enabled: true },
245
+ guides: { bracketPairs: true, indentation: true },
246
+ automaticLayout: true,
247
+ tabSize: 2,
248
+ insertSpaces: true,
249
+ scrollbar: {
250
+ verticalScrollbarSize: 8,
251
+ horizontalScrollbarSize: 8,
252
+ useShadows: false
253
+ },
254
+ fixedOverflowWidgets: true,
255
+ contextmenu: true,
256
+ suggestOnTriggerCharacters: true,
257
+ quickSuggestions: { other: true, comments: false, strings: false },
258
+ formatOnPaste: false,
259
+ formatOnType: false,
260
+ "semanticHighlighting.enabled": true,
261
+ ...options
262
+ };
263
+ const showWrapBtn = showWordWrapToggle && wordWrapProp === void 0;
264
+ const showMinimapBtn = showMinimapToggle && minimapProp === void 0;
265
+ return /* @__PURE__ */ jsxs(
266
+ "div",
267
+ {
268
+ className: cn(
269
+ "ods-monaco",
270
+ `ods-monaco--${language}`,
271
+ readOnly && "ods-monaco--readonly",
272
+ className
273
+ ),
274
+ style,
275
+ children: [
276
+ !hideToolbar && /* @__PURE__ */ jsxs("div", { className: "ods-monaco__toolbar", children: [
277
+ /* @__PURE__ */ jsxs("div", { className: "ods-monaco__toolbar-left", children: [
278
+ /* @__PURE__ */ jsx("span", { className: "ods-monaco__lang", children: language.toUpperCase() }),
279
+ toolbar
280
+ ] }),
281
+ /* @__PURE__ */ jsxs("div", { className: "ods-monaco__toolbar-right", children: [
282
+ /* @__PURE__ */ jsxs("span", { className: "ods-monaco__lines", children: [
283
+ lineCount,
284
+ " line",
285
+ lineCount === 1 ? "" : "s"
286
+ ] }),
287
+ status && /* @__PURE__ */ jsx("span", { className: "ods-monaco__status", children: status }),
288
+ showWrapBtn && /* @__PURE__ */ jsx(
289
+ "button",
290
+ {
291
+ type: "button",
292
+ className: cn("ods-monaco__btn", wordWrap && "ods-monaco__btn--active"),
293
+ onClick: () => setWordWrap((w) => !w),
294
+ "aria-pressed": wordWrap,
295
+ "aria-label": "Toggle word wrap",
296
+ title: "Word wrap",
297
+ children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
298
+ "path",
299
+ {
300
+ d: "M2 3.5h10M2 7h7.5a2 2 0 1 1 0 4H8m0 0 1.5-1.5M8 11l1.5 1.5M2 10.5h3",
301
+ stroke: "currentColor",
302
+ strokeWidth: "1.2",
303
+ strokeLinecap: "round",
304
+ strokeLinejoin: "round"
305
+ }
306
+ ) })
307
+ }
308
+ ),
309
+ showMinimapBtn && /* @__PURE__ */ jsx(
310
+ "button",
311
+ {
312
+ type: "button",
313
+ className: cn("ods-monaco__btn", minimap && "ods-monaco__btn--active"),
314
+ onClick: () => setMinimap((m) => !m),
315
+ "aria-pressed": minimap,
316
+ "aria-label": "Toggle minimap",
317
+ title: "Minimap",
318
+ children: /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
319
+ /* @__PURE__ */ jsx("rect", { x: "2", y: "2.5", width: "6", height: "9", rx: "0.5", stroke: "currentColor", strokeWidth: "1.2" }),
320
+ /* @__PURE__ */ jsx("rect", { x: "9", y: "2.5", width: "3", height: "9", rx: "0.5", fill: "currentColor", opacity: "0.25" }),
321
+ /* @__PURE__ */ jsx("path", { d: "M3.5 4.5h3M3.5 6.5h3M3.5 8.5h2", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round" })
322
+ ] })
323
+ }
324
+ ),
325
+ showFormat && !readOnly && /* @__PURE__ */ jsx(
326
+ "button",
327
+ {
328
+ type: "button",
329
+ className: "ods-monaco__btn",
330
+ onClick: handleFormat,
331
+ "aria-label": "Format document",
332
+ title: "Format (Shift+Alt+F)",
333
+ children: /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
334
+ /* @__PURE__ */ jsx("path", { d: "M2.5 4h9M4 7h7.5M5.5 10H11", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" }),
335
+ /* @__PURE__ */ jsx("path", { d: "M2.5 7 3.5 6 2.5 5", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" })
336
+ ] })
337
+ }
338
+ ),
339
+ showCopy && /* @__PURE__ */ jsx(
340
+ "button",
341
+ {
342
+ type: "button",
343
+ className: cn("ods-monaco__btn", copied && "ods-monaco__btn--success"),
344
+ onClick: handleCopy,
345
+ "aria-label": "Copy",
346
+ title: "Copy",
347
+ children: copied ? /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
348
+ "path",
349
+ {
350
+ d: "m3 7 3 3 5-6",
351
+ stroke: "currentColor",
352
+ strokeWidth: "1.6",
353
+ strokeLinecap: "round",
354
+ strokeLinejoin: "round"
355
+ }
356
+ ) }) : /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
357
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "8", height: "8", rx: "1", stroke: "currentColor", strokeWidth: "1.3" }),
358
+ /* @__PURE__ */ jsx("path", { d: "M5 1.5h6V8", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
359
+ ] })
360
+ }
361
+ )
362
+ ] })
363
+ ] }),
364
+ /* @__PURE__ */ jsx("div", { className: "ods-monaco__body", style: { minHeight }, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsxs("div", { className: "ods-monaco__loading", children: [
365
+ /* @__PURE__ */ jsx("span", { className: "ods-monaco__loading-spin", "aria-hidden": "true", children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "5", stroke: "currentColor", strokeWidth: "1.4", strokeDasharray: "4 18", strokeLinecap: "round" }) }) }),
366
+ /* @__PURE__ */ jsx("span", { children: "Loading editor\u2026" })
367
+ ] }), children: /* @__PURE__ */ jsx(
368
+ Editor,
369
+ {
370
+ value,
371
+ onChange: (v) => onChange?.(v ?? ""),
372
+ language,
373
+ height,
374
+ theme: theme ?? OCTAVIAFLOW_THEME_ID,
375
+ options: mergedOptions,
376
+ onMount: handleMount,
377
+ loading: /* @__PURE__ */ jsxs("div", { className: "ods-monaco__loading", children: [
378
+ /* @__PURE__ */ jsx("span", { className: "ods-monaco__loading-spin", "aria-hidden": "true", children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "5", stroke: "currentColor", strokeWidth: "1.4", strokeDasharray: "4 18", strokeLinecap: "round" }) }) }),
379
+ /* @__PURE__ */ jsx("span", { children: "Loading editor\u2026" })
380
+ ] }),
381
+ "aria-label": ariaLabel
382
+ }
383
+ ) }) }),
384
+ !hideFooter && /* @__PURE__ */ jsxs("div", { className: "ods-monaco__footer", children: [
385
+ /* @__PURE__ */ jsxs("span", { className: "ods-monaco__pos", children: [
386
+ "Ln ",
387
+ cursor.line,
388
+ ", Col ",
389
+ cursor.column,
390
+ selection.chars > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
391
+ " ",
392
+ "\xB7 ",
393
+ selection.chars,
394
+ " char",
395
+ selection.chars === 1 ? "" : "s",
396
+ selection.lines > 1 && ` \xB7 ${selection.lines} lines`
397
+ ] })
398
+ ] }),
399
+ /* @__PURE__ */ jsxs("span", { className: "ods-monaco__shortcut-hint", children: [
400
+ /* @__PURE__ */ jsx("kbd", { className: "ods-monaco__kbd", children: "\u2318F" }),
401
+ " find",
402
+ /* @__PURE__ */ jsx("span", { className: "ods-monaco__sep", children: "\xB7" }),
403
+ /* @__PURE__ */ jsx("kbd", { className: "ods-monaco__kbd", children: "\u2318\u21E7F" }),
404
+ " replace",
405
+ /* @__PURE__ */ jsx("span", { className: "ods-monaco__sep", children: "\xB7" }),
406
+ /* @__PURE__ */ jsx("kbd", { className: "ods-monaco__kbd", children: "F1" }),
407
+ " commands"
408
+ ] })
409
+ ] })
410
+ ]
411
+ }
412
+ );
413
+ }
414
+
415
+ // src/components/MonacoEditor/MonacoDiffEditor.tsx
416
+ import { Suspense as Suspense2, lazy as lazy2, useRef as useRef2, useState as useState2 } from "react";
417
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
418
+ var DiffEditor = lazy2(
419
+ () => import("@monaco-editor/react").then((mod) => ({ default: mod.DiffEditor }))
420
+ );
421
+ function MonacoDiffEditor({
422
+ original,
423
+ modified,
424
+ onModifiedChange,
425
+ language = "plaintext",
426
+ renderSideBySide = true,
427
+ readOnly = false,
428
+ hideUnchangedRegions = false,
429
+ height = 360,
430
+ minHeight = 200,
431
+ originalLabel = "Original",
432
+ modifiedLabel = "Modified",
433
+ toolbar,
434
+ options,
435
+ onMount,
436
+ style,
437
+ className,
438
+ theme,
439
+ hideToolbar = false
440
+ }) {
441
+ const editorRef = useRef2(null);
442
+ const [sideBySide, setSideBySide] = useState2(renderSideBySide);
443
+ const handleMount = (diffEditor, monaco) => {
444
+ editorRef.current = diffEditor;
445
+ monaco.editor.defineTheme(OCTAVIAFLOW_THEME_ID, OCTAVIAFLOW_LIGHT);
446
+ monaco.editor.setTheme(theme ?? OCTAVIAFLOW_THEME_ID);
447
+ const modifiedEditor = diffEditor.getModifiedEditor();
448
+ modifiedEditor.onDidChangeModelContent(() => {
449
+ onModifiedChange?.(modifiedEditor.getValue());
450
+ });
451
+ onMount?.(diffEditor, monaco);
452
+ };
453
+ const mergedOptions = {
454
+ readOnly,
455
+ originalEditable: false,
456
+ renderSideBySide: sideBySide,
457
+ fontFamily: "ui-monospace, SFMono-Regular, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace",
458
+ fontSize: 13,
459
+ lineHeight: 20,
460
+ automaticLayout: true,
461
+ lineNumbersMinChars: 3,
462
+ lineDecorationsWidth: 6,
463
+ folding: true,
464
+ glyphMargin: false,
465
+ minimap: { enabled: false },
466
+ scrollBeyondLastLine: false,
467
+ smoothScrolling: true,
468
+ renderOverviewRuler: true,
469
+ diffWordWrap: "off",
470
+ padding: { top: 8, bottom: 8 },
471
+ hideUnchangedRegions: {
472
+ enabled: hideUnchangedRegions,
473
+ revealLineCount: 20,
474
+ minimumLineCount: 3,
475
+ contextLineCount: 3
476
+ },
477
+ scrollbar: {
478
+ verticalScrollbarSize: 8,
479
+ horizontalScrollbarSize: 8,
480
+ useShadows: false
481
+ },
482
+ ...options
483
+ };
484
+ return /* @__PURE__ */ jsxs2(
485
+ "div",
486
+ {
487
+ className: cn("ods-monaco-diff", `ods-monaco-diff--${language}`, className),
488
+ style,
489
+ children: [
490
+ !hideToolbar && /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__toolbar", children: [
491
+ /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__toolbar-left", children: [
492
+ /* @__PURE__ */ jsxs2("span", { className: "ods-monaco__lang", children: [
493
+ "DIFF \xB7 ",
494
+ language.toUpperCase()
495
+ ] }),
496
+ /* @__PURE__ */ jsxs2("span", { className: "ods-monaco-diff__labels", children: [
497
+ /* @__PURE__ */ jsx2("span", { className: "ods-monaco-diff__label ods-monaco-diff__label--orig", children: originalLabel }),
498
+ /* @__PURE__ */ jsx2("span", { className: "ods-monaco-diff__arrow", "aria-hidden": "true", children: "\u2192" }),
499
+ /* @__PURE__ */ jsx2("span", { className: "ods-monaco-diff__label ods-monaco-diff__label--mod", children: modifiedLabel })
500
+ ] }),
501
+ toolbar
502
+ ] }),
503
+ /* @__PURE__ */ jsx2("div", { className: "ods-monaco__toolbar-right", children: /* @__PURE__ */ jsx2(
504
+ "button",
505
+ {
506
+ type: "button",
507
+ className: cn(
508
+ "ods-monaco__btn",
509
+ sideBySide && "ods-monaco__btn--active"
510
+ ),
511
+ onClick: () => setSideBySide((s) => !s),
512
+ "aria-pressed": sideBySide,
513
+ "aria-label": "Toggle side-by-side",
514
+ title: sideBySide ? "Inline" : "Side-by-side",
515
+ children: sideBySide ? /* @__PURE__ */ jsxs2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
516
+ /* @__PURE__ */ jsx2("rect", { x: "1.5", y: "2", width: "5", height: "10", rx: "0.5", stroke: "currentColor", strokeWidth: "1.3" }),
517
+ /* @__PURE__ */ jsx2("rect", { x: "7.5", y: "2", width: "5", height: "10", rx: "0.5", stroke: "currentColor", strokeWidth: "1.3" })
518
+ ] }) : /* @__PURE__ */ jsxs2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
519
+ /* @__PURE__ */ jsx2("rect", { x: "1.5", y: "2", width: "11", height: "10", rx: "0.5", stroke: "currentColor", strokeWidth: "1.3" }),
520
+ /* @__PURE__ */ jsx2("path", { d: "M1.5 7h11", stroke: "currentColor", strokeWidth: "1.3" })
521
+ ] })
522
+ }
523
+ ) })
524
+ ] }),
525
+ /* @__PURE__ */ jsx2("div", { className: "ods-monaco__body", style: { minHeight }, children: /* @__PURE__ */ jsx2(Suspense2, { fallback: /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__loading", children: [
526
+ /* @__PURE__ */ jsx2("span", { className: "ods-monaco__loading-spin", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx2("circle", { cx: "7", cy: "7", r: "5", stroke: "currentColor", strokeWidth: "1.4", strokeDasharray: "4 18", strokeLinecap: "round" }) }) }),
527
+ /* @__PURE__ */ jsx2("span", { children: "Loading diff\u2026" })
528
+ ] }), children: /* @__PURE__ */ jsx2(
529
+ DiffEditor,
530
+ {
531
+ original,
532
+ modified,
533
+ language,
534
+ height,
535
+ theme: theme ?? OCTAVIAFLOW_THEME_ID,
536
+ options: mergedOptions,
537
+ onMount: handleMount,
538
+ loading: /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__loading", children: [
539
+ /* @__PURE__ */ jsx2("span", { className: "ods-monaco__loading-spin", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx2("circle", { cx: "7", cy: "7", r: "5", stroke: "currentColor", strokeWidth: "1.4", strokeDasharray: "4 18", strokeLinecap: "round" }) }) }),
540
+ /* @__PURE__ */ jsx2("span", { children: "Loading diff\u2026" })
541
+ ] })
542
+ }
543
+ ) }) })
544
+ ]
545
+ }
546
+ );
547
+ }
548
+ export {
549
+ MonacoDiffEditor,
550
+ MonacoEditor,
551
+ OCTAVIAFLOW_LIGHT,
552
+ OCTAVIAFLOW_THEME_ID
553
+ };
554
+ //# sourceMappingURL=monaco.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/MonacoEditor/MonacoEditor.tsx","../src/components/MonacoEditor/octaviaflowTheme.ts","../src/components/MonacoEditor/MonacoDiffEditor.tsx"],"sourcesContent":["\"use client\";\n// IMPORTANT: `@monaco-editor/react` and `monaco-editor` are optional peer deps.\n// Consumers that don't install them must still be able to import the rest of\n// `@octaviaflow/core` without crashing. Using `React.lazy` + dynamic import\n// keeps Monaco out of the synchronous module graph — it only resolves when a\n// MonacoEditor is actually rendered, deferring the require to that moment.\n//\n// Type-only imports for `editor` and `Monaco` are erased at build time, so\n// they impose no runtime dependency.\nimport type { Monaco, OnMount } from \"@monaco-editor/react\";\nimport type { editor } from \"monaco-editor\";\nimport {\n type CSSProperties,\n type ReactNode,\n Suspense,\n lazy,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { OCTAVIAFLOW_LIGHT, OCTAVIAFLOW_THEME_ID } from \"./octaviaflowTheme\";\n\nconst Editor = lazy(() =>\n import(\"@monaco-editor/react\").then((mod) => ({ default: mod.Editor })),\n);\n\nexport type MonacoLanguage =\n | \"sql\"\n | \"json\"\n | \"javascript\"\n | \"typescript\"\n | \"tsx\"\n | \"yaml\"\n | \"xml\"\n | \"html\"\n | \"css\"\n | \"scss\"\n | \"markdown\"\n | \"python\"\n | \"go\"\n | \"rust\"\n | \"java\"\n | \"csharp\"\n | \"shell\"\n | \"plaintext\";\n\nexport interface MonacoMarker {\n /** 1-based line number. */\n line: number;\n /** 1-based column. */\n column?: number;\n /** 1-based end line. Defaults to `line`. */\n endLine?: number;\n /** 1-based end column. */\n endColumn?: number;\n severity?: \"error\" | \"warning\" | \"info\" | \"hint\";\n message: string;\n /** Optional source label, e.g. \"json-schema\". */\n source?: string;\n}\n\nexport interface MonacoEditorProps {\n value: string;\n onChange?: (value: string) => void;\n language?: MonacoLanguage;\n /** Read-only mode. */\n readOnly?: boolean;\n /** Editor height — number (px) or any CSS length. Default 320. */\n height?: number | string;\n /** Min height when auto-sizing is disabled. */\n minHeight?: number;\n /** Custom toolbar slot above the editor. */\n toolbar?: ReactNode;\n /** Status pill on the right side of the toolbar. */\n status?: ReactNode;\n /** Hide the toolbar entirely. */\n hideToolbar?: boolean;\n /** Hide the footer (cursor pos + shortcut hints). */\n hideFooter?: boolean;\n /** Show built-in Copy button. */\n showCopy?: boolean;\n /** Show built-in Format button. Uses Monaco's `editor.action.formatDocument`. */\n showFormat?: boolean;\n /** Show built-in word-wrap toggle. */\n showWordWrapToggle?: boolean;\n /** Show built-in minimap toggle. */\n showMinimapToggle?: boolean;\n /** Initial word wrap. Default false. */\n wordWrap?: boolean;\n /** Initial minimap state. Default false (off — Linear-tight). */\n minimap?: boolean;\n /** Show line numbers. Default true. */\n showLineNumbers?: boolean;\n /** Diagnostic markers (errors, warnings, info, hints). */\n markers?: MonacoMarker[];\n /** Pass-through Monaco editor options. Merged after the defaults. */\n options?: editor.IStandaloneEditorConstructionOptions;\n /** Called once Monaco has mounted with the editor + monaco namespace. */\n onMount?: OnMount;\n /** Style attribute for the wrapper. */\n style?: CSSProperties;\n className?: string;\n ariaLabel?: string;\n /** Theme override. Defaults to \"octaviaflow-light\". */\n theme?: string;\n}\n\nconst MARKER_SEVERITY: Record<\n Required<MonacoMarker>[\"severity\"],\n number\n> = {\n hint: 1,\n info: 2,\n warning: 4,\n error: 8,\n};\n\nexport function MonacoEditor({\n value,\n onChange,\n language = \"plaintext\",\n readOnly = false,\n height = 320,\n minHeight = 120,\n toolbar,\n status,\n hideToolbar = false,\n hideFooter = false,\n showCopy = true,\n showFormat = true,\n showWordWrapToggle = true,\n showMinimapToggle = true,\n wordWrap: wordWrapProp,\n minimap: minimapProp,\n showLineNumbers = true,\n markers,\n options,\n onMount,\n style,\n className,\n ariaLabel = \"Code editor\",\n theme,\n}: MonacoEditorProps) {\n const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null);\n const monacoRef = useRef<Monaco | null>(null);\n\n const [wordWrap, setWordWrap] = useState<boolean>(wordWrapProp ?? false);\n const [minimap, setMinimap] = useState<boolean>(minimapProp ?? false);\n const [copied, setCopied] = useState(false);\n const [cursor, setCursor] = useState({ line: 1, column: 1 });\n const [selection, setSelection] = useState({ chars: 0, lines: 0 });\n const [lineCount, setLineCount] = useState(value.split(\"\\n\").length);\n\n // Keep prop-driven state in sync if controlled\n useEffect(() => {\n if (wordWrapProp !== undefined) setWordWrap(wordWrapProp);\n }, [wordWrapProp]);\n useEffect(() => {\n if (minimapProp !== undefined) setMinimap(minimapProp);\n }, [minimapProp]);\n\n // Apply word wrap / minimap changes to the live editor\n useEffect(() => {\n editorRef.current?.updateOptions({\n wordWrap: wordWrap ? \"on\" : \"off\",\n minimap: { enabled: minimap },\n });\n }, [wordWrap, minimap]);\n\n // Apply markers when they change\n useEffect(() => {\n const editor = editorRef.current;\n const monaco = monacoRef.current;\n if (!editor || !monaco || !markers) return;\n const model = editor.getModel();\n if (!model) return;\n monaco.editor.setModelMarkers(\n model,\n \"octaviaflow\",\n markers.map((m) => ({\n severity: MARKER_SEVERITY[m.severity ?? \"error\"],\n message: m.message,\n startLineNumber: m.line,\n startColumn: m.column ?? 1,\n endLineNumber: m.endLine ?? m.line,\n endColumn: m.endColumn ?? (m.column ?? 1) + 1,\n source: m.source,\n })),\n );\n }, [markers]);\n\n const handleMount: OnMount = useCallback(\n (editor, monaco) => {\n editorRef.current = editor;\n monacoRef.current = monaco;\n monaco.editor.defineTheme(OCTAVIAFLOW_THEME_ID, OCTAVIAFLOW_LIGHT);\n monaco.editor.setTheme(theme ?? OCTAVIAFLOW_THEME_ID);\n\n // Cursor + selection tracking\n editor.onDidChangeCursorPosition((e) => {\n setCursor({ line: e.position.lineNumber, column: e.position.column });\n });\n editor.onDidChangeCursorSelection((e) => {\n const sel = e.selection;\n if (sel.isEmpty()) {\n setSelection({ chars: 0, lines: 0 });\n return;\n }\n const model = editor.getModel();\n if (!model) return;\n const text = model.getValueInRange(sel);\n setSelection({\n chars: text.length,\n lines: text.split(\"\\n\").length,\n });\n });\n // Track line count for footer\n const model = editor.getModel();\n if (model) {\n setLineCount(model.getLineCount());\n model.onDidChangeContent(() => setLineCount(model.getLineCount()));\n }\n\n onMount?.(editor, monaco);\n },\n [onMount, theme],\n );\n\n const handleCopy = async () => {\n if (typeof navigator === \"undefined\") return;\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n setTimeout(() => setCopied(false), 1200);\n } catch {\n /* ignore */\n }\n };\n\n const handleFormat = () => {\n editorRef.current?.getAction(\"editor.action.formatDocument\")?.run();\n };\n\n const mergedOptions: editor.IStandaloneEditorConstructionOptions = {\n readOnly,\n fontFamily:\n \"ui-monospace, SFMono-Regular, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace\",\n fontSize: 13,\n fontLigatures: true,\n lineHeight: 20,\n lineNumbers: showLineNumbers ? \"on\" : \"off\",\n lineNumbersMinChars: 3,\n lineDecorationsWidth: 6,\n folding: true,\n glyphMargin: false,\n minimap: { enabled: minimap },\n wordWrap: wordWrap ? \"on\" : \"off\",\n scrollBeyondLastLine: false,\n smoothScrolling: true,\n cursorBlinking: \"smooth\",\n cursorSmoothCaretAnimation: \"on\",\n renderLineHighlight: \"line\",\n padding: { top: 8, bottom: 8 },\n bracketPairColorization: { enabled: true },\n guides: { bracketPairs: true, indentation: true },\n automaticLayout: true,\n tabSize: 2,\n insertSpaces: true,\n scrollbar: {\n verticalScrollbarSize: 8,\n horizontalScrollbarSize: 8,\n useShadows: false,\n },\n fixedOverflowWidgets: true,\n contextmenu: true,\n suggestOnTriggerCharacters: true,\n quickSuggestions: { other: true, comments: false, strings: false },\n formatOnPaste: false,\n formatOnType: false,\n \"semanticHighlighting.enabled\": true,\n ...options,\n };\n\n const showWrapBtn = showWordWrapToggle && wordWrapProp === undefined;\n const showMinimapBtn = showMinimapToggle && minimapProp === undefined;\n\n return (\n <div\n className={cn(\n \"ods-monaco\",\n `ods-monaco--${language}`,\n readOnly && \"ods-monaco--readonly\",\n className,\n )}\n style={style}\n >\n {!hideToolbar && (\n <div className=\"ods-monaco__toolbar\">\n <div className=\"ods-monaco__toolbar-left\">\n <span className=\"ods-monaco__lang\">{language.toUpperCase()}</span>\n {toolbar}\n </div>\n <div className=\"ods-monaco__toolbar-right\">\n <span className=\"ods-monaco__lines\">\n {lineCount} line{lineCount === 1 ? \"\" : \"s\"}\n </span>\n {status && <span className=\"ods-monaco__status\">{status}</span>}\n {showWrapBtn && (\n <button\n type=\"button\"\n className={cn(\"ods-monaco__btn\", wordWrap && \"ods-monaco__btn--active\")}\n onClick={() => setWordWrap((w) => !w)}\n aria-pressed={wordWrap}\n aria-label=\"Toggle word wrap\"\n title=\"Word wrap\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M2 3.5h10M2 7h7.5a2 2 0 1 1 0 4H8m0 0 1.5-1.5M8 11l1.5 1.5M2 10.5h3\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n )}\n {showMinimapBtn && (\n <button\n type=\"button\"\n className={cn(\"ods-monaco__btn\", minimap && \"ods-monaco__btn--active\")}\n onClick={() => setMinimap((m) => !m)}\n aria-pressed={minimap}\n aria-label=\"Toggle minimap\"\n title=\"Minimap\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"2\" y=\"2.5\" width=\"6\" height=\"9\" rx=\"0.5\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n <rect x=\"9\" y=\"2.5\" width=\"3\" height=\"9\" rx=\"0.5\" fill=\"currentColor\" opacity=\"0.25\" />\n <path d=\"M3.5 4.5h3M3.5 6.5h3M3.5 8.5h2\" stroke=\"currentColor\" strokeWidth=\"1\" strokeLinecap=\"round\" />\n </svg>\n </button>\n )}\n {showFormat && !readOnly && (\n <button\n type=\"button\"\n className=\"ods-monaco__btn\"\n onClick={handleFormat}\n aria-label=\"Format document\"\n title=\"Format (Shift+Alt+F)\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M2.5 4h9M4 7h7.5M5.5 10H11\" stroke=\"currentColor\" strokeWidth=\"1.3\" strokeLinecap=\"round\" />\n <path d=\"M2.5 7 3.5 6 2.5 5\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </button>\n )}\n {showCopy && (\n <button\n type=\"button\"\n className={cn(\"ods-monaco__btn\", copied && \"ods-monaco__btn--success\")}\n onClick={handleCopy}\n aria-label=\"Copy\"\n title=\"Copy\"\n >\n {copied ? (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"m3 7 3 3 5-6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ) : (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"8\" height=\"8\" rx=\"1\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n <path d=\"M5 1.5h6V8\" stroke=\"currentColor\" strokeWidth=\"1.3\" strokeLinecap=\"round\" />\n </svg>\n )}\n </button>\n )}\n </div>\n </div>\n )}\n\n <div className=\"ods-monaco__body\" style={{ minHeight }}>\n <Suspense fallback={\n <div className=\"ods-monaco__loading\">\n <span className=\"ods-monaco__loading-spin\" aria-hidden=\"true\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeDasharray=\"4 18\" strokeLinecap=\"round\" />\n </svg>\n </span>\n <span>Loading editor…</span>\n </div>\n }>\n <Editor\n value={value}\n onChange={(v) => onChange?.(v ?? \"\")}\n language={language}\n height={height}\n theme={theme ?? OCTAVIAFLOW_THEME_ID}\n options={mergedOptions}\n onMount={handleMount}\n loading={\n <div className=\"ods-monaco__loading\">\n <span className=\"ods-monaco__loading-spin\" aria-hidden=\"true\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeDasharray=\"4 18\" strokeLinecap=\"round\" />\n </svg>\n </span>\n <span>Loading editor…</span>\n </div>\n }\n aria-label={ariaLabel}\n />\n </Suspense>\n </div>\n\n {!hideFooter && (\n <div className=\"ods-monaco__footer\">\n <span className=\"ods-monaco__pos\">\n Ln {cursor.line}, Col {cursor.column}\n {selection.chars > 0 && (\n <>\n {\" \"}· {selection.chars} char{selection.chars === 1 ? \"\" : \"s\"}\n {selection.lines > 1 && ` · ${selection.lines} lines`}\n </>\n )}\n </span>\n <span className=\"ods-monaco__shortcut-hint\">\n <kbd className=\"ods-monaco__kbd\">⌘F</kbd> find\n <span className=\"ods-monaco__sep\">·</span>\n <kbd className=\"ods-monaco__kbd\">⌘⇧F</kbd> replace\n <span className=\"ods-monaco__sep\">·</span>\n <kbd className=\"ods-monaco__kbd\">F1</kbd> commands\n </span>\n </div>\n )}\n </div>\n );\n}\n","import type { editor } from \"monaco-editor\";\n\n/**\n * OctaviaFlow v1 Monaco theme — light, Linear-tight, accent-driven.\n * Hex values mirror the canonical v1 tokens (see packages/styles/src/02-tokens/_v1.scss).\n */\nexport const OCTAVIAFLOW_LIGHT: editor.IStandaloneThemeData = {\n base: \"vs\",\n inherit: true,\n rules: [\n { token: \"\", foreground: \"161616\", background: \"FFFFFF\" },\n { token: \"comment\", foreground: \"6F6F6F\", fontStyle: \"italic\" },\n { token: \"string\", foreground: \"198038\" },\n { token: \"string.key.json\", foreground: \"0F62FE\" },\n { token: \"string.value.json\", foreground: \"198038\" },\n { token: \"number\", foreground: \"0043CE\" },\n { token: \"keyword\", foreground: \"8A3FFC\" },\n { token: \"keyword.sql\", foreground: \"8A3FFC\" },\n { token: \"operator\", foreground: \"393939\" },\n { token: \"delimiter\", foreground: \"525252\" },\n { token: \"type\", foreground: \"0F62FE\" },\n { token: \"type.identifier\", foreground: \"0F62FE\" },\n { token: \"identifier\", foreground: \"161616\" },\n { token: \"constant\", foreground: \"0043CE\" },\n { token: \"boolean\", foreground: \"F1C21B\", fontStyle: \"bold\" },\n { token: \"tag\", foreground: \"DA1E28\" },\n { token: \"attribute.name\", foreground: \"8A3FFC\" },\n { token: \"attribute.value\", foreground: \"198038\" },\n { token: \"regexp\", foreground: \"DA1E28\" },\n { token: \"function\", foreground: \"0F62FE\" },\n { token: \"variable\", foreground: \"161616\" },\n { token: \"variable.parameter\", foreground: \"393939\", fontStyle: \"italic\" },\n { token: \"namespace\", foreground: \"0F62FE\" },\n ],\n colors: {\n \"editor.background\": \"#FFFFFF\",\n \"editor.foreground\": \"#161616\",\n \"editor.lineHighlightBackground\": \"#F4F4F4\",\n \"editor.lineHighlightBorder\": \"#00000000\",\n \"editorLineNumber.foreground\": \"#A8A8A8\",\n \"editorLineNumber.activeForeground\": \"#0F62FE\",\n \"editorCursor.foreground\": \"#0F62FE\",\n \"editor.selectionBackground\": \"#D0E2FF\",\n \"editor.selectionHighlightBackground\": \"#EDF5FF\",\n \"editor.wordHighlightBackground\": \"#EDF5FF\",\n \"editor.wordHighlightStrongBackground\": \"#D0E2FF\",\n \"editor.findMatchBackground\": \"#FFD7D9\",\n \"editor.findMatchHighlightBackground\": \"#FFE9EB\",\n \"editorIndentGuide.background1\": \"#F4F4F4\",\n \"editorIndentGuide.activeBackground1\": \"#E0E0E0\",\n \"editorWhitespace.foreground\": \"#E0E0E0\",\n \"editorBracketMatch.background\": \"#D0E2FF\",\n \"editorBracketMatch.border\": \"#0F62FE\",\n \"editor.foldBackground\": \"#F4F4F4\",\n\n \"editorGutter.background\": \"#F4F4F4\",\n \"editorGutter.modifiedBackground\": \"#0F62FE\",\n \"editorGutter.addedBackground\": \"#198038\",\n \"editorGutter.deletedBackground\": \"#DA1E28\",\n\n \"editorWidget.background\": \"#FFFFFF\",\n \"editorWidget.foreground\": \"#161616\",\n \"editorWidget.border\": \"#E0E0E0\",\n \"editorSuggestWidget.background\": \"#FFFFFF\",\n \"editorSuggestWidget.border\": \"#E0E0E0\",\n \"editorSuggestWidget.foreground\": \"#161616\",\n \"editorSuggestWidget.selectedBackground\": \"#EDF5FF\",\n \"editorSuggestWidget.selectedForeground\": \"#161616\",\n \"editorSuggestWidget.highlightForeground\": \"#0F62FE\",\n\n \"editorHoverWidget.background\": \"#FFFFFF\",\n \"editorHoverWidget.border\": \"#E0E0E0\",\n\n \"editorError.foreground\": \"#DA1E28\",\n \"editorWarning.foreground\": \"#F1C21B\",\n \"editorInfo.foreground\": \"#0F62FE\",\n\n \"diffEditor.insertedTextBackground\": \"#A7F0BA40\",\n \"diffEditor.removedTextBackground\": \"#FFB3B840\",\n \"diffEditor.insertedLineBackground\": \"#DEFBE640\",\n \"diffEditor.removedLineBackground\": \"#FFD7D940\",\n\n \"scrollbar.shadow\": \"#00000000\",\n \"scrollbarSlider.background\": \"#0F62FE20\",\n \"scrollbarSlider.hoverBackground\": \"#0F62FE40\",\n \"scrollbarSlider.activeBackground\": \"#0F62FE60\",\n\n \"minimap.background\": \"#FAFAFA\",\n \"minimap.selectionHighlight\": \"#0F62FE\",\n \"minimapSlider.background\": \"#0F62FE15\",\n \"minimapSlider.hoverBackground\": \"#0F62FE30\",\n \"minimapSlider.activeBackground\": \"#0F62FE50\",\n\n \"input.background\": \"#FFFFFF\",\n \"input.foreground\": \"#161616\",\n \"input.border\": \"#C6C6C6\",\n \"inputOption.activeBorder\": \"#0F62FE\",\n\n \"focusBorder\": \"#0F62FE\",\n },\n};\n\nexport const OCTAVIAFLOW_THEME_ID = \"octaviaflow-light\";\n","\"use client\";\n// Same lazy-load rationale as MonacoEditor.tsx — keep Monaco out of the\n// synchronous module graph so consumers without @monaco-editor/react can\n// still import @octaviaflow/core safely.\nimport type { Monaco } from \"@monaco-editor/react\";\nimport type { editor } from \"monaco-editor\";\nimport { type CSSProperties, type ReactNode, Suspense, lazy, useRef, useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { OCTAVIAFLOW_LIGHT, OCTAVIAFLOW_THEME_ID } from \"./octaviaflowTheme\";\nimport type { MonacoLanguage } from \"./MonacoEditor\";\n\nconst DiffEditor = lazy(() =>\n import(\"@monaco-editor/react\").then((mod) => ({ default: mod.DiffEditor })),\n);\n\nexport interface MonacoDiffEditorProps {\n original: string;\n modified: string;\n onModifiedChange?: (value: string) => void;\n language?: MonacoLanguage;\n /** Side-by-side vs inline diff. Default \"side-by-side\". */\n renderSideBySide?: boolean;\n /** Read-only on the right side. Default false. */\n readOnly?: boolean;\n /** Show only changed regions. */\n hideUnchangedRegions?: boolean;\n /** Editor height. Default 360. */\n height?: number | string;\n minHeight?: number;\n /** Labels above each side. */\n originalLabel?: ReactNode;\n modifiedLabel?: ReactNode;\n toolbar?: ReactNode;\n /** Pass-through Monaco diff editor options. */\n options?: editor.IDiffEditorConstructionOptions;\n onMount?: (\n editor: editor.IStandaloneDiffEditor,\n monaco: Monaco,\n ) => void;\n style?: CSSProperties;\n className?: string;\n theme?: string;\n hideToolbar?: boolean;\n}\n\nexport function MonacoDiffEditor({\n original,\n modified,\n onModifiedChange,\n language = \"plaintext\",\n renderSideBySide = true,\n readOnly = false,\n hideUnchangedRegions = false,\n height = 360,\n minHeight = 200,\n originalLabel = \"Original\",\n modifiedLabel = \"Modified\",\n toolbar,\n options,\n onMount,\n style,\n className,\n theme,\n hideToolbar = false,\n}: MonacoDiffEditorProps) {\n const editorRef = useRef<editor.IStandaloneDiffEditor | null>(null);\n const [sideBySide, setSideBySide] = useState(renderSideBySide);\n\n const handleMount = (\n diffEditor: editor.IStandaloneDiffEditor,\n monaco: Monaco,\n ) => {\n editorRef.current = diffEditor;\n monaco.editor.defineTheme(OCTAVIAFLOW_THEME_ID, OCTAVIAFLOW_LIGHT);\n monaco.editor.setTheme(theme ?? OCTAVIAFLOW_THEME_ID);\n\n const modifiedEditor = diffEditor.getModifiedEditor();\n modifiedEditor.onDidChangeModelContent(() => {\n onModifiedChange?.(modifiedEditor.getValue());\n });\n\n onMount?.(diffEditor, monaco);\n };\n\n const mergedOptions: editor.IDiffEditorConstructionOptions = {\n readOnly,\n originalEditable: false,\n renderSideBySide: sideBySide,\n fontFamily:\n \"ui-monospace, SFMono-Regular, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace\",\n fontSize: 13,\n lineHeight: 20,\n automaticLayout: true,\n lineNumbersMinChars: 3,\n lineDecorationsWidth: 6,\n folding: true,\n glyphMargin: false,\n minimap: { enabled: false },\n scrollBeyondLastLine: false,\n smoothScrolling: true,\n renderOverviewRuler: true,\n diffWordWrap: \"off\",\n padding: { top: 8, bottom: 8 },\n hideUnchangedRegions: {\n enabled: hideUnchangedRegions,\n revealLineCount: 20,\n minimumLineCount: 3,\n contextLineCount: 3,\n },\n scrollbar: {\n verticalScrollbarSize: 8,\n horizontalScrollbarSize: 8,\n useShadows: false,\n },\n ...options,\n };\n\n return (\n <div\n className={cn(\"ods-monaco-diff\", `ods-monaco-diff--${language}`, className)}\n style={style}\n >\n {!hideToolbar && (\n <div className=\"ods-monaco__toolbar\">\n <div className=\"ods-monaco__toolbar-left\">\n <span className=\"ods-monaco__lang\">DIFF · {language.toUpperCase()}</span>\n <span className=\"ods-monaco-diff__labels\">\n <span className=\"ods-monaco-diff__label ods-monaco-diff__label--orig\">\n {originalLabel}\n </span>\n <span className=\"ods-monaco-diff__arrow\" aria-hidden=\"true\">→</span>\n <span className=\"ods-monaco-diff__label ods-monaco-diff__label--mod\">\n {modifiedLabel}\n </span>\n </span>\n {toolbar}\n </div>\n <div className=\"ods-monaco__toolbar-right\">\n <button\n type=\"button\"\n className={cn(\n \"ods-monaco__btn\",\n sideBySide && \"ods-monaco__btn--active\",\n )}\n onClick={() => setSideBySide((s) => !s)}\n aria-pressed={sideBySide}\n aria-label=\"Toggle side-by-side\"\n title={sideBySide ? \"Inline\" : \"Side-by-side\"}\n >\n {sideBySide ? (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"1.5\" y=\"2\" width=\"5\" height=\"10\" rx=\"0.5\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n <rect x=\"7.5\" y=\"2\" width=\"5\" height=\"10\" rx=\"0.5\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n </svg>\n ) : (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"1.5\" y=\"2\" width=\"11\" height=\"10\" rx=\"0.5\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n <path d=\"M1.5 7h11\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n </svg>\n )}\n </button>\n </div>\n </div>\n )}\n\n <div className=\"ods-monaco__body\" style={{ minHeight }}>\n <Suspense fallback={\n <div className=\"ods-monaco__loading\">\n <span className=\"ods-monaco__loading-spin\" aria-hidden=\"true\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeDasharray=\"4 18\" strokeLinecap=\"round\" />\n </svg>\n </span>\n <span>Loading diff…</span>\n </div>\n }>\n <DiffEditor\n original={original}\n modified={modified}\n language={language}\n height={height}\n theme={theme ?? OCTAVIAFLOW_THEME_ID}\n options={mergedOptions}\n onMount={handleMount}\n loading={\n <div className=\"ods-monaco__loading\">\n <span className=\"ods-monaco__loading-spin\" aria-hidden=\"true\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeDasharray=\"4 18\" strokeLinecap=\"round\" />\n </svg>\n </span>\n <span>Loading diff…</span>\n </div>\n }\n />\n </Suspense>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAWA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACdA,IAAM,oBAAiD;AAAA,EAC5D,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,IACL,EAAE,OAAO,IAAI,YAAY,UAAU,YAAY,SAAS;AAAA,IACxD,EAAE,OAAO,WAAW,YAAY,UAAU,WAAW,SAAS;AAAA,IAC9D,EAAE,OAAO,UAAU,YAAY,SAAS;AAAA,IACxC,EAAE,OAAO,mBAAmB,YAAY,SAAS;AAAA,IACjD,EAAE,OAAO,qBAAqB,YAAY,SAAS;AAAA,IACnD,EAAE,OAAO,UAAU,YAAY,SAAS;AAAA,IACxC,EAAE,OAAO,WAAW,YAAY,SAAS;AAAA,IACzC,EAAE,OAAO,eAAe,YAAY,SAAS;AAAA,IAC7C,EAAE,OAAO,YAAY,YAAY,SAAS;AAAA,IAC1C,EAAE,OAAO,aAAa,YAAY,SAAS;AAAA,IAC3C,EAAE,OAAO,QAAQ,YAAY,SAAS;AAAA,IACtC,EAAE,OAAO,mBAAmB,YAAY,SAAS;AAAA,IACjD,EAAE,OAAO,cAAc,YAAY,SAAS;AAAA,IAC5C,EAAE,OAAO,YAAY,YAAY,SAAS;AAAA,IAC1C,EAAE,OAAO,WAAW,YAAY,UAAU,WAAW,OAAO;AAAA,IAC5D,EAAE,OAAO,OAAO,YAAY,SAAS;AAAA,IACrC,EAAE,OAAO,kBAAkB,YAAY,SAAS;AAAA,IAChD,EAAE,OAAO,mBAAmB,YAAY,SAAS;AAAA,IACjD,EAAE,OAAO,UAAU,YAAY,SAAS;AAAA,IACxC,EAAE,OAAO,YAAY,YAAY,SAAS;AA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