@octaviaflow/core 3.0.13 → 3.0.17-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2AWVQFSC.js +2456 -0
- package/dist/chunk-2AWVQFSC.js.map +1 -0
- package/dist/chunk-2K7IQR2F.js +2432 -0
- package/dist/chunk-2K7IQR2F.js.map +1 -0
- package/dist/chunk-2YUWZPIT.js +2483 -0
- package/dist/chunk-2YUWZPIT.js.map +1 -0
- package/dist/chunk-4VCRGPYQ.js +2452 -0
- package/dist/chunk-4VCRGPYQ.js.map +1 -0
- package/dist/chunk-4WU5YAL2.js +2470 -0
- package/dist/chunk-4WU5YAL2.js.map +1 -0
- package/dist/chunk-5L4TGL74.js +2448 -0
- package/dist/chunk-5L4TGL74.js.map +1 -0
- package/dist/chunk-7M5HFY2J.js +2483 -0
- package/dist/chunk-7M5HFY2J.js.map +1 -0
- package/dist/chunk-AJ4556EH.js +2490 -0
- package/dist/chunk-AJ4556EH.js.map +1 -0
- package/dist/chunk-AOL365B3.js +2448 -0
- package/dist/chunk-AOL365B3.js.map +1 -0
- package/dist/chunk-D4X7RMGF.js +2481 -0
- package/dist/chunk-D4X7RMGF.js.map +1 -0
- package/dist/chunk-DCGXCPD4.js +2389 -0
- package/dist/chunk-DCGXCPD4.js.map +1 -0
- package/dist/chunk-DG35MIV3.js +2480 -0
- package/dist/chunk-DG35MIV3.js.map +1 -0
- package/dist/chunk-DRZ73Q5X.js +2503 -0
- package/dist/chunk-DRZ73Q5X.js.map +1 -0
- package/dist/chunk-DRZMET2G.js +2458 -0
- package/dist/chunk-DRZMET2G.js.map +1 -0
- package/dist/chunk-DYCW4TYB.js +2546 -0
- package/dist/chunk-DYCW4TYB.js.map +1 -0
- package/dist/chunk-E7WR7DMP.js +2451 -0
- package/dist/chunk-E7WR7DMP.js.map +1 -0
- package/dist/chunk-ELNQQAHD.js +2454 -0
- package/dist/chunk-ELNQQAHD.js.map +1 -0
- package/dist/chunk-FN3MFN6C.js +2389 -0
- package/dist/chunk-FN3MFN6C.js.map +1 -0
- package/dist/chunk-IBTEGHFT.js +10 -0
- package/dist/chunk-IBTEGHFT.js.map +1 -0
- package/dist/chunk-JCPM7YF2.js +2474 -0
- package/dist/chunk-JCPM7YF2.js.map +1 -0
- package/dist/chunk-JLPCCZKG.js +2459 -0
- package/dist/chunk-JLPCCZKG.js.map +1 -0
- package/dist/chunk-KY4JHPIE.js +2546 -0
- package/dist/chunk-KY4JHPIE.js.map +1 -0
- package/dist/chunk-LCQMQAWJ.js +2461 -0
- package/dist/chunk-LCQMQAWJ.js.map +1 -0
- package/dist/chunk-LSDAQCUJ.js +2546 -0
- package/dist/chunk-LSDAQCUJ.js.map +1 -0
- package/dist/chunk-LW4ZHQKL.js +2432 -0
- package/dist/chunk-LW4ZHQKL.js.map +1 -0
- package/dist/chunk-MMZW3Q26.js +2442 -0
- package/dist/chunk-MMZW3Q26.js.map +1 -0
- package/dist/chunk-MXJR2WHG.js +2470 -0
- package/dist/chunk-MXJR2WHG.js.map +1 -0
- package/dist/chunk-OK2CUIKQ.js +2447 -0
- package/dist/chunk-OK2CUIKQ.js.map +1 -0
- package/dist/chunk-OSOP2WPT.js +2456 -0
- package/dist/chunk-OSOP2WPT.js.map +1 -0
- package/dist/chunk-PNBZLLWT.js +2529 -0
- package/dist/chunk-PNBZLLWT.js.map +1 -0
- package/dist/chunk-PULX2GK5.js +2447 -0
- package/dist/chunk-PULX2GK5.js.map +1 -0
- package/dist/chunk-QDT45KF4.js +2480 -0
- package/dist/chunk-QDT45KF4.js.map +1 -0
- package/dist/chunk-QI3ITHAZ.js +2450 -0
- package/dist/chunk-QI3ITHAZ.js.map +1 -0
- package/dist/chunk-QSGJ3DNA.js +2475 -0
- package/dist/chunk-QSGJ3DNA.js.map +1 -0
- package/dist/chunk-RDGJWRHM.js +2490 -0
- package/dist/chunk-RDGJWRHM.js.map +1 -0
- package/dist/chunk-SDE3ARKY.js +2451 -0
- package/dist/chunk-SDE3ARKY.js.map +1 -0
- package/dist/chunk-SX7WRJGD.js +2441 -0
- package/dist/chunk-SX7WRJGD.js.map +1 -0
- package/dist/chunk-TZ56MSYM.js +2452 -0
- package/dist/chunk-TZ56MSYM.js.map +1 -0
- package/dist/chunk-UEQLKS2B.js +2445 -0
- package/dist/chunk-UEQLKS2B.js.map +1 -0
- package/dist/chunk-UNU6YNTL.js +2452 -0
- package/dist/chunk-UNU6YNTL.js.map +1 -0
- package/dist/chunk-UUG6XYUC.js +2482 -0
- package/dist/chunk-UUG6XYUC.js.map +1 -0
- package/dist/chunk-VEY3BP5E.js +2447 -0
- package/dist/chunk-VEY3BP5E.js.map +1 -0
- package/dist/chunk-WBTXV3Q2.js +2482 -0
- package/dist/chunk-WBTXV3Q2.js.map +1 -0
- package/dist/chunk-WILVB7XA.js +2512 -0
- package/dist/chunk-WILVB7XA.js.map +1 -0
- package/dist/chunk-WQCHABP3.js +2441 -0
- package/dist/chunk-WQCHABP3.js.map +1 -0
- package/dist/chunk-WUFAW3TB.js +2512 -0
- package/dist/chunk-WUFAW3TB.js.map +1 -0
- package/dist/chunk-WYBJKALZ.js +2458 -0
- package/dist/chunk-WYBJKALZ.js.map +1 -0
- package/dist/chunk-XZ7FELMT.js +2448 -0
- package/dist/chunk-XZ7FELMT.js.map +1 -0
- package/dist/chunk-YATCRJVF.js +2458 -0
- package/dist/chunk-YATCRJVF.js.map +1 -0
- package/dist/chunk-YSSD2T4M.js +2451 -0
- package/dist/chunk-YSSD2T4M.js.map +1 -0
- package/dist/chunk-YW6ZOYCG.js +2451 -0
- package/dist/chunk-YW6ZOYCG.js.map +1 -0
- package/dist/components/ActionsDrawer/ActionsDrawer.d.ts +89 -0
- package/dist/components/ActionsDrawer/ActionsDrawer.d.ts.map +1 -0
- package/dist/components/ActionsDrawer/index.d.ts +2 -0
- package/dist/components/ActionsDrawer/index.d.ts.map +1 -0
- package/dist/components/AgentCard/AgentCard.d.ts +1 -1
- package/dist/components/AgentCard/AgentCard.d.ts.map +1 -1
- package/dist/components/AuthCard/AuthCard.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/components/CodeEditor/index.d.ts +1 -1
- package/dist/components/CodeEditor/index.d.ts.map +1 -1
- package/dist/components/DataMapper/DataMapper.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/ExecutionConsole/ExecutionConsole.d.ts +29 -3
- package/dist/components/ExecutionConsole/ExecutionConsole.d.ts.map +1 -1
- package/dist/components/FileDropzone/FileDropzone.d.ts.map +1 -1
- package/dist/components/FlowEdge/FlowEdge.d.ts +15 -14
- package/dist/components/FlowEdge/FlowEdge.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/MonacoEditor/MonacoDiffEditor.d.ts.map +1 -1
- package/dist/components/MonacoEditor/MonacoEditor.d.ts.map +1 -1
- package/dist/components/MonacoEditor/index.d.ts +1 -1
- package/dist/components/MonacoEditor/index.d.ts.map +1 -1
- package/dist/components/PromptInput/PromptInput.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Resizable/Resizable.d.ts.map +1 -1
- package/dist/components/Resizable/index.d.ts +1 -1
- package/dist/components/Resizable/index.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +16 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Sortable/Sortable.d.ts.map +1 -1
- package/dist/components/Sortable/index.d.ts +1 -1
- package/dist/components/Sortable/index.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/ToolCard/ToolCard.d.ts +1 -1
- package/dist/components/ToolCard/ToolCard.d.ts.map +1 -1
- package/dist/components/TopBar/TopBar.d.ts +22 -1
- package/dist/components/TopBar/TopBar.d.ts.map +1 -1
- package/dist/components/TraceStep/TraceStep.d.ts.map +1 -1
- package/dist/components/TraceStep/index.d.ts +1 -1
- package/dist/components/TraceStep/index.d.ts.map +1 -1
- package/dist/components/WorkflowEditor/WorkflowEditor.d.ts +10 -2
- package/dist/components/WorkflowEditor/WorkflowEditor.d.ts.map +1 -1
- package/dist/components/XmlViewer/XmlViewer.d.ts.map +1 -1
- package/dist/components/YamlViewer/YamlViewer.d.ts.map +1 -1
- package/dist/index.cjs +6875 -3288
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3296 -2147
- package/dist/index.js.map +1 -1
- package/dist/monaco.cjs +344 -201
- package/dist/monaco.cjs.map +1 -1
- package/dist/monaco.js +348 -205
- package/dist/monaco.js.map +1 -1
- package/dist/stories/state-matrix.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/a11y.d.ts.map +1 -1
- package/dist/utils/sanitizeUrl.d.ts.map +1 -1
- package/dist/workflow/components/ConfigPanel/ConfigPanel.d.ts +64 -0
- package/dist/workflow/components/ConfigPanel/ConfigPanel.d.ts.map +1 -0
- package/dist/workflow/components/FlowCanvas/FlowCanvas.d.ts +111 -0
- package/dist/workflow/components/FlowCanvas/FlowCanvas.d.ts.map +1 -0
- package/dist/workflow/components/FlowCanvas/FlowCanvasContext.d.ts +47 -0
- package/dist/workflow/components/FlowCanvas/FlowCanvasContext.d.ts.map +1 -0
- package/dist/workflow/components/FlowEdge/FlowEdge.d.ts +26 -0
- package/dist/workflow/components/FlowEdge/FlowEdge.d.ts.map +1 -0
- package/dist/workflow/components/FlowNode/FlowNode.d.ts +13 -0
- package/dist/workflow/components/FlowNode/FlowNode.d.ts.map +1 -0
- package/dist/workflow/components/FlowNode/FlowNodeContext.d.ts +9 -0
- package/dist/workflow/components/FlowNode/FlowNodeContext.d.ts.map +1 -0
- package/dist/workflow/components/FlowNode/nodeKinds.d.ts +25 -0
- package/dist/workflow/components/FlowNode/nodeKinds.d.ts.map +1 -0
- package/dist/workflow/components/Handle/Handle.d.ts +26 -0
- package/dist/workflow/components/Handle/Handle.d.ts.map +1 -0
- package/dist/workflow/components/Handle/handleRegistry.d.ts +32 -0
- package/dist/workflow/components/Handle/handleRegistry.d.ts.map +1 -0
- package/dist/workflow/components/NodeResizer/NodeResizer.d.ts +27 -0
- package/dist/workflow/components/NodeResizer/NodeResizer.d.ts.map +1 -0
- package/dist/workflow/components/NodeToolbar/NodeToolbar.d.ts +19 -0
- package/dist/workflow/components/NodeToolbar/NodeToolbar.d.ts.map +1 -0
- package/dist/workflow/components/kinds/BaseNode.d.ts +40 -0
- package/dist/workflow/components/kinds/BaseNode.d.ts.map +1 -0
- package/dist/workflow/components/kinds/index.d.ts +55 -0
- package/dist/workflow/components/kinds/index.d.ts.map +1 -0
- package/dist/workflow/editor.d.ts +181 -0
- package/dist/workflow/editor.d.ts.map +1 -0
- package/dist/workflow/hooks/useAutoLayout.d.ts +35 -0
- package/dist/workflow/hooks/useAutoLayout.d.ts.map +1 -0
- package/dist/workflow/hooks/useFlow.d.ts +61 -0
- package/dist/workflow/hooks/useFlow.d.ts.map +1 -0
- package/dist/workflow/hooks/useFlowState.d.ts +33 -0
- package/dist/workflow/hooks/useFlowState.d.ts.map +1 -0
- package/dist/workflow/index.d.ts +25 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/layout/dagre.d.ts +24 -0
- package/dist/workflow/layout/dagre.d.ts.map +1 -0
- package/dist/workflow/layout/elk.d.ts +22 -0
- package/dist/workflow/layout/elk.d.ts.map +1 -0
- package/dist/workflow/layout/types.d.ts +55 -0
- package/dist/workflow/layout/types.d.ts.map +1 -0
- package/dist/workflow/store/changes.d.ts +34 -0
- package/dist/workflow/store/changes.d.ts.map +1 -0
- package/dist/workflow/store/context.d.ts +4 -0
- package/dist/workflow/store/context.d.ts.map +1 -0
- package/dist/workflow/store/createFlowStore.d.ts +27 -0
- package/dist/workflow/store/createFlowStore.d.ts.map +1 -0
- package/dist/workflow/store/selectors.d.ts +33 -0
- package/dist/workflow/store/selectors.d.ts.map +1 -0
- package/dist/workflow/types/index.d.ts +181 -0
- package/dist/workflow/types/index.d.ts.map +1 -0
- package/dist/workflow/utils/collapse.d.ts +26 -0
- package/dist/workflow/utils/collapse.d.ts.map +1 -0
- package/dist/workflow/utils/collision.d.ts +37 -0
- package/dist/workflow/utils/collision.d.ts.map +1 -0
- package/dist/workflow/utils/geometry.d.ts +46 -0
- package/dist/workflow/utils/geometry.d.ts.map +1 -0
- package/dist/workflow/utils/parenting.d.ts +28 -0
- package/dist/workflow/utils/parenting.d.ts.map +1 -0
- package/dist/workflow/utils/paths.d.ts +19 -0
- package/dist/workflow/utils/paths.d.ts.map +1 -0
- package/dist/workflow.cjs +3562 -0
- package/dist/workflow.cjs.map +1 -0
- package/dist/workflow.js +1029 -0
- package/dist/workflow.js.map +1 -0
- package/package.json +6 -1
package/dist/monaco.js
CHANGED
|
@@ -2,15 +2,8 @@ import {
|
|
|
2
2
|
cn
|
|
3
3
|
} from "./chunk-ZAUUGK2Y.js";
|
|
4
4
|
|
|
5
|
-
// src/components/MonacoEditor/
|
|
6
|
-
import {
|
|
7
|
-
Suspense,
|
|
8
|
-
lazy,
|
|
9
|
-
useCallback,
|
|
10
|
-
useEffect,
|
|
11
|
-
useRef,
|
|
12
|
-
useState
|
|
13
|
-
} from "react";
|
|
5
|
+
// src/components/MonacoEditor/MonacoDiffEditor.tsx
|
|
6
|
+
import { lazy, Suspense, useRef, useState } from "react";
|
|
14
7
|
|
|
15
8
|
// src/components/MonacoEditor/octaviaflowTheme.ts
|
|
16
9
|
var OCTAVIAFLOW_LIGHT = {
|
|
@@ -96,16 +89,206 @@ var OCTAVIAFLOW_LIGHT = {
|
|
|
96
89
|
"input.foreground": "#161616",
|
|
97
90
|
"input.border": "#C6C6C6",
|
|
98
91
|
"inputOption.activeBorder": "#0F62FE",
|
|
99
|
-
|
|
92
|
+
focusBorder: "#0F62FE"
|
|
100
93
|
}
|
|
101
94
|
};
|
|
102
95
|
var OCTAVIAFLOW_THEME_ID = "octaviaflow-light";
|
|
103
96
|
|
|
104
|
-
// src/components/MonacoEditor/
|
|
105
|
-
import {
|
|
106
|
-
var
|
|
107
|
-
() => import("@monaco-editor/react").then((mod) => ({ default: mod.
|
|
97
|
+
// src/components/MonacoEditor/MonacoDiffEditor.tsx
|
|
98
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
99
|
+
var DiffEditor = lazy(
|
|
100
|
+
() => import("@monaco-editor/react").then((mod) => ({ default: mod.DiffEditor }))
|
|
108
101
|
);
|
|
102
|
+
function MonacoDiffEditor({
|
|
103
|
+
original,
|
|
104
|
+
modified,
|
|
105
|
+
onModifiedChange,
|
|
106
|
+
language = "plaintext",
|
|
107
|
+
renderSideBySide = true,
|
|
108
|
+
readOnly = false,
|
|
109
|
+
hideUnchangedRegions = false,
|
|
110
|
+
height = 360,
|
|
111
|
+
minHeight = 200,
|
|
112
|
+
originalLabel = "Original",
|
|
113
|
+
modifiedLabel = "Modified",
|
|
114
|
+
toolbar,
|
|
115
|
+
options,
|
|
116
|
+
onMount,
|
|
117
|
+
style,
|
|
118
|
+
className,
|
|
119
|
+
theme,
|
|
120
|
+
hideToolbar = false
|
|
121
|
+
}) {
|
|
122
|
+
const editorRef = useRef(null);
|
|
123
|
+
const [sideBySide, setSideBySide] = useState(renderSideBySide);
|
|
124
|
+
const handleMount = (diffEditor, monaco) => {
|
|
125
|
+
editorRef.current = diffEditor;
|
|
126
|
+
monaco.editor.defineTheme(OCTAVIAFLOW_THEME_ID, OCTAVIAFLOW_LIGHT);
|
|
127
|
+
monaco.editor.setTheme(theme ?? OCTAVIAFLOW_THEME_ID);
|
|
128
|
+
const modifiedEditor = diffEditor.getModifiedEditor();
|
|
129
|
+
modifiedEditor.onDidChangeModelContent(() => {
|
|
130
|
+
onModifiedChange?.(modifiedEditor.getValue());
|
|
131
|
+
});
|
|
132
|
+
onMount?.(diffEditor, monaco);
|
|
133
|
+
};
|
|
134
|
+
const mergedOptions = {
|
|
135
|
+
readOnly,
|
|
136
|
+
originalEditable: false,
|
|
137
|
+
renderSideBySide: sideBySide,
|
|
138
|
+
fontFamily: "ui-monospace, SFMono-Regular, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace",
|
|
139
|
+
fontSize: 13,
|
|
140
|
+
lineHeight: 20,
|
|
141
|
+
automaticLayout: true,
|
|
142
|
+
lineNumbersMinChars: 3,
|
|
143
|
+
lineDecorationsWidth: 6,
|
|
144
|
+
folding: true,
|
|
145
|
+
glyphMargin: false,
|
|
146
|
+
minimap: { enabled: false },
|
|
147
|
+
scrollBeyondLastLine: false,
|
|
148
|
+
smoothScrolling: true,
|
|
149
|
+
renderOverviewRuler: true,
|
|
150
|
+
diffWordWrap: "off",
|
|
151
|
+
padding: { top: 8, bottom: 8 },
|
|
152
|
+
hideUnchangedRegions: {
|
|
153
|
+
enabled: hideUnchangedRegions,
|
|
154
|
+
revealLineCount: 20,
|
|
155
|
+
minimumLineCount: 3,
|
|
156
|
+
contextLineCount: 3
|
|
157
|
+
},
|
|
158
|
+
scrollbar: {
|
|
159
|
+
verticalScrollbarSize: 8,
|
|
160
|
+
horizontalScrollbarSize: 8,
|
|
161
|
+
useShadows: false
|
|
162
|
+
},
|
|
163
|
+
...options
|
|
164
|
+
};
|
|
165
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ods-monaco-diff", `ods-monaco-diff--${language}`, className), style, children: [
|
|
166
|
+
!hideToolbar && /* @__PURE__ */ jsxs("div", { className: "ods-monaco__toolbar", children: [
|
|
167
|
+
/* @__PURE__ */ jsxs("div", { className: "ods-monaco__toolbar-left", children: [
|
|
168
|
+
/* @__PURE__ */ jsxs("span", { className: "ods-monaco__lang", children: [
|
|
169
|
+
"DIFF \xB7 ",
|
|
170
|
+
language.toUpperCase()
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ jsxs("span", { className: "ods-monaco-diff__labels", children: [
|
|
173
|
+
/* @__PURE__ */ jsx("span", { className: "ods-monaco-diff__label ods-monaco-diff__label--orig", children: originalLabel }),
|
|
174
|
+
/* @__PURE__ */ jsx("span", { className: "ods-monaco-diff__arrow", "aria-hidden": "true", children: "\u2192" }),
|
|
175
|
+
/* @__PURE__ */ jsx("span", { className: "ods-monaco-diff__label ods-monaco-diff__label--mod", children: modifiedLabel })
|
|
176
|
+
] }),
|
|
177
|
+
toolbar
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ jsx("div", { className: "ods-monaco__toolbar-right", children: /* @__PURE__ */ jsx(
|
|
180
|
+
"button",
|
|
181
|
+
{
|
|
182
|
+
type: "button",
|
|
183
|
+
className: cn("ods-monaco__btn", sideBySide && "ods-monaco__btn--active"),
|
|
184
|
+
onClick: () => setSideBySide((s) => !s),
|
|
185
|
+
"aria-pressed": sideBySide,
|
|
186
|
+
"aria-label": "Toggle side-by-side",
|
|
187
|
+
title: sideBySide ? "Inline" : "Side-by-side",
|
|
188
|
+
children: sideBySide ? /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
|
|
189
|
+
/* @__PURE__ */ jsx(
|
|
190
|
+
"rect",
|
|
191
|
+
{
|
|
192
|
+
x: "1.5",
|
|
193
|
+
y: "2",
|
|
194
|
+
width: "5",
|
|
195
|
+
height: "10",
|
|
196
|
+
rx: "0.5",
|
|
197
|
+
stroke: "currentColor",
|
|
198
|
+
strokeWidth: "1.3"
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
"rect",
|
|
203
|
+
{
|
|
204
|
+
x: "7.5",
|
|
205
|
+
y: "2",
|
|
206
|
+
width: "5",
|
|
207
|
+
height: "10",
|
|
208
|
+
rx: "0.5",
|
|
209
|
+
stroke: "currentColor",
|
|
210
|
+
strokeWidth: "1.3"
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] }) : /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
"rect",
|
|
216
|
+
{
|
|
217
|
+
x: "1.5",
|
|
218
|
+
y: "2",
|
|
219
|
+
width: "11",
|
|
220
|
+
height: "10",
|
|
221
|
+
rx: "0.5",
|
|
222
|
+
stroke: "currentColor",
|
|
223
|
+
strokeWidth: "1.3"
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
/* @__PURE__ */ jsx("path", { d: "M1.5 7h11", stroke: "currentColor", strokeWidth: "1.3" })
|
|
227
|
+
] })
|
|
228
|
+
}
|
|
229
|
+
) })
|
|
230
|
+
] }),
|
|
231
|
+
/* @__PURE__ */ jsx("div", { className: "ods-monaco__body", style: { minHeight }, children: /* @__PURE__ */ jsx(
|
|
232
|
+
Suspense,
|
|
233
|
+
{
|
|
234
|
+
fallback: /* @__PURE__ */ jsxs("div", { className: "ods-monaco__loading", children: [
|
|
235
|
+
/* @__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(
|
|
236
|
+
"circle",
|
|
237
|
+
{
|
|
238
|
+
cx: "7",
|
|
239
|
+
cy: "7",
|
|
240
|
+
r: "5",
|
|
241
|
+
stroke: "currentColor",
|
|
242
|
+
strokeWidth: "1.4",
|
|
243
|
+
strokeDasharray: "4 18",
|
|
244
|
+
strokeLinecap: "round"
|
|
245
|
+
}
|
|
246
|
+
) }) }),
|
|
247
|
+
/* @__PURE__ */ jsx("span", { children: "Loading diff\u2026" })
|
|
248
|
+
] }),
|
|
249
|
+
children: /* @__PURE__ */ jsx(
|
|
250
|
+
DiffEditor,
|
|
251
|
+
{
|
|
252
|
+
original,
|
|
253
|
+
modified,
|
|
254
|
+
language,
|
|
255
|
+
height,
|
|
256
|
+
theme: theme ?? OCTAVIAFLOW_THEME_ID,
|
|
257
|
+
options: mergedOptions,
|
|
258
|
+
onMount: handleMount,
|
|
259
|
+
loading: /* @__PURE__ */ jsxs("div", { className: "ods-monaco__loading", children: [
|
|
260
|
+
/* @__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(
|
|
261
|
+
"circle",
|
|
262
|
+
{
|
|
263
|
+
cx: "7",
|
|
264
|
+
cy: "7",
|
|
265
|
+
r: "5",
|
|
266
|
+
stroke: "currentColor",
|
|
267
|
+
strokeWidth: "1.4",
|
|
268
|
+
strokeDasharray: "4 18",
|
|
269
|
+
strokeLinecap: "round"
|
|
270
|
+
}
|
|
271
|
+
) }) }),
|
|
272
|
+
/* @__PURE__ */ jsx("span", { children: "Loading diff\u2026" })
|
|
273
|
+
] })
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
}
|
|
277
|
+
) })
|
|
278
|
+
] });
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/components/MonacoEditor/MonacoEditor.tsx
|
|
282
|
+
import {
|
|
283
|
+
lazy as lazy2,
|
|
284
|
+
Suspense as Suspense2,
|
|
285
|
+
useCallback,
|
|
286
|
+
useEffect,
|
|
287
|
+
useRef as useRef2,
|
|
288
|
+
useState as useState2
|
|
289
|
+
} from "react";
|
|
290
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
291
|
+
var Editor = lazy2(() => import("@monaco-editor/react").then((mod) => ({ default: mod.Editor })));
|
|
109
292
|
var MARKER_SEVERITY = {
|
|
110
293
|
hint: 1,
|
|
111
294
|
info: 2,
|
|
@@ -138,14 +321,14 @@ function MonacoEditor({
|
|
|
138
321
|
ariaLabel = "Code editor",
|
|
139
322
|
theme
|
|
140
323
|
}) {
|
|
141
|
-
const editorRef =
|
|
142
|
-
const monacoRef =
|
|
143
|
-
const [wordWrap, setWordWrap] =
|
|
144
|
-
const [minimap, setMinimap] =
|
|
145
|
-
const [copied, setCopied] =
|
|
146
|
-
const [cursor, setCursor] =
|
|
147
|
-
const [selection, setSelection] =
|
|
148
|
-
const [lineCount, setLineCount] =
|
|
324
|
+
const editorRef = useRef2(null);
|
|
325
|
+
const monacoRef = useRef2(null);
|
|
326
|
+
const [wordWrap, setWordWrap] = useState2(wordWrapProp ?? false);
|
|
327
|
+
const [minimap, setMinimap] = useState2(minimapProp ?? false);
|
|
328
|
+
const [copied, setCopied] = useState2(false);
|
|
329
|
+
const [cursor, setCursor] = useState2({ line: 1, column: 1 });
|
|
330
|
+
const [selection, setSelection] = useState2({ chars: 0, lines: 0 });
|
|
331
|
+
const [lineCount, setLineCount] = useState2(value.split("\n").length);
|
|
149
332
|
useEffect(() => {
|
|
150
333
|
if (wordWrapProp !== void 0) setWordWrap(wordWrapProp);
|
|
151
334
|
}, [wordWrapProp]);
|
|
@@ -262,7 +445,7 @@ function MonacoEditor({
|
|
|
262
445
|
};
|
|
263
446
|
const showWrapBtn = showWordWrapToggle && wordWrapProp === void 0;
|
|
264
447
|
const showMinimapBtn = showMinimapToggle && minimapProp === void 0;
|
|
265
|
-
return /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ jsxs2(
|
|
266
449
|
"div",
|
|
267
450
|
{
|
|
268
451
|
className: cn(
|
|
@@ -273,19 +456,19 @@ function MonacoEditor({
|
|
|
273
456
|
),
|
|
274
457
|
style,
|
|
275
458
|
children: [
|
|
276
|
-
!hideToolbar && /* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
459
|
+
!hideToolbar && /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__toolbar", children: [
|
|
460
|
+
/* @__PURE__ */ jsxs2("div", { className: "ods-monaco__toolbar-left", children: [
|
|
461
|
+
/* @__PURE__ */ jsx2("span", { className: "ods-monaco__lang", children: language.toUpperCase() }),
|
|
279
462
|
toolbar
|
|
280
463
|
] }),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ jsxs2("div", { className: "ods-monaco__toolbar-right", children: [
|
|
465
|
+
/* @__PURE__ */ jsxs2("span", { className: "ods-monaco__lines", children: [
|
|
283
466
|
lineCount,
|
|
284
467
|
" line",
|
|
285
468
|
lineCount === 1 ? "" : "s"
|
|
286
469
|
] }),
|
|
287
|
-
status && /* @__PURE__ */
|
|
288
|
-
showWrapBtn && /* @__PURE__ */
|
|
470
|
+
status && /* @__PURE__ */ jsx2("span", { className: "ods-monaco__status", children: status }),
|
|
471
|
+
showWrapBtn && /* @__PURE__ */ jsx2(
|
|
289
472
|
"button",
|
|
290
473
|
{
|
|
291
474
|
type: "button",
|
|
@@ -294,7 +477,7 @@ function MonacoEditor({
|
|
|
294
477
|
"aria-pressed": wordWrap,
|
|
295
478
|
"aria-label": "Toggle word wrap",
|
|
296
479
|
title: "Word wrap",
|
|
297
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ jsx2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(
|
|
298
481
|
"path",
|
|
299
482
|
{
|
|
300
483
|
d: "M2 3.5h10M2 7h7.5a2 2 0 1 1 0 4H8m0 0 1.5-1.5M8 11l1.5 1.5M2 10.5h3",
|
|
@@ -306,7 +489,7 @@ function MonacoEditor({
|
|
|
306
489
|
) })
|
|
307
490
|
}
|
|
308
491
|
),
|
|
309
|
-
showMinimapBtn && /* @__PURE__ */
|
|
492
|
+
showMinimapBtn && /* @__PURE__ */ jsx2(
|
|
310
493
|
"button",
|
|
311
494
|
{
|
|
312
495
|
type: "button",
|
|
@@ -315,14 +498,44 @@ function MonacoEditor({
|
|
|
315
498
|
"aria-pressed": minimap,
|
|
316
499
|
"aria-label": "Toggle minimap",
|
|
317
500
|
title: "Minimap",
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
|
|
321
|
-
|
|
501
|
+
children: /* @__PURE__ */ jsxs2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
|
|
502
|
+
/* @__PURE__ */ jsx2(
|
|
503
|
+
"rect",
|
|
504
|
+
{
|
|
505
|
+
x: "2",
|
|
506
|
+
y: "2.5",
|
|
507
|
+
width: "6",
|
|
508
|
+
height: "9",
|
|
509
|
+
rx: "0.5",
|
|
510
|
+
stroke: "currentColor",
|
|
511
|
+
strokeWidth: "1.2"
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
/* @__PURE__ */ jsx2(
|
|
515
|
+
"rect",
|
|
516
|
+
{
|
|
517
|
+
x: "9",
|
|
518
|
+
y: "2.5",
|
|
519
|
+
width: "3",
|
|
520
|
+
height: "9",
|
|
521
|
+
rx: "0.5",
|
|
522
|
+
fill: "currentColor",
|
|
523
|
+
opacity: "0.25"
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
/* @__PURE__ */ jsx2(
|
|
527
|
+
"path",
|
|
528
|
+
{
|
|
529
|
+
d: "M3.5 4.5h3M3.5 6.5h3M3.5 8.5h2",
|
|
530
|
+
stroke: "currentColor",
|
|
531
|
+
strokeWidth: "1",
|
|
532
|
+
strokeLinecap: "round"
|
|
533
|
+
}
|
|
534
|
+
)
|
|
322
535
|
] })
|
|
323
536
|
}
|
|
324
537
|
),
|
|
325
|
-
showFormat && !readOnly && /* @__PURE__ */
|
|
538
|
+
showFormat && !readOnly && /* @__PURE__ */ jsx2(
|
|
326
539
|
"button",
|
|
327
540
|
{
|
|
328
541
|
type: "button",
|
|
@@ -330,13 +543,30 @@ function MonacoEditor({
|
|
|
330
543
|
onClick: handleFormat,
|
|
331
544
|
"aria-label": "Format document",
|
|
332
545
|
title: "Format (Shift+Alt+F)",
|
|
333
|
-
children: /* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
|
|
546
|
+
children: /* @__PURE__ */ jsxs2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
|
|
547
|
+
/* @__PURE__ */ jsx2(
|
|
548
|
+
"path",
|
|
549
|
+
{
|
|
550
|
+
d: "M2.5 4h9M4 7h7.5M5.5 10H11",
|
|
551
|
+
stroke: "currentColor",
|
|
552
|
+
strokeWidth: "1.3",
|
|
553
|
+
strokeLinecap: "round"
|
|
554
|
+
}
|
|
555
|
+
),
|
|
556
|
+
/* @__PURE__ */ jsx2(
|
|
557
|
+
"path",
|
|
558
|
+
{
|
|
559
|
+
d: "M2.5 7 3.5 6 2.5 5",
|
|
560
|
+
stroke: "currentColor",
|
|
561
|
+
strokeWidth: "1.2",
|
|
562
|
+
strokeLinecap: "round",
|
|
563
|
+
strokeLinejoin: "round"
|
|
564
|
+
}
|
|
565
|
+
)
|
|
336
566
|
] })
|
|
337
567
|
}
|
|
338
568
|
),
|
|
339
|
-
showCopy && /* @__PURE__ */
|
|
569
|
+
showCopy && /* @__PURE__ */ jsx2(
|
|
340
570
|
"button",
|
|
341
571
|
{
|
|
342
572
|
type: "button",
|
|
@@ -344,7 +574,7 @@ function MonacoEditor({
|
|
|
344
574
|
onClick: handleCopy,
|
|
345
575
|
"aria-label": "Copy",
|
|
346
576
|
title: "Copy",
|
|
347
|
-
children: copied ? /* @__PURE__ */
|
|
577
|
+
children: copied ? /* @__PURE__ */ jsx2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(
|
|
348
578
|
"path",
|
|
349
579
|
{
|
|
350
580
|
d: "m3 7 3 3 5-6",
|
|
@@ -353,41 +583,88 @@ function MonacoEditor({
|
|
|
353
583
|
strokeLinecap: "round",
|
|
354
584
|
strokeLinejoin: "round"
|
|
355
585
|
}
|
|
356
|
-
) }) : /* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
|
|
586
|
+
) }) : /* @__PURE__ */ jsxs2("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
|
|
587
|
+
/* @__PURE__ */ jsx2(
|
|
588
|
+
"rect",
|
|
589
|
+
{
|
|
590
|
+
x: "3",
|
|
591
|
+
y: "3",
|
|
592
|
+
width: "8",
|
|
593
|
+
height: "8",
|
|
594
|
+
rx: "1",
|
|
595
|
+
stroke: "currentColor",
|
|
596
|
+
strokeWidth: "1.3"
|
|
597
|
+
}
|
|
598
|
+
),
|
|
599
|
+
/* @__PURE__ */ jsx2(
|
|
600
|
+
"path",
|
|
601
|
+
{
|
|
602
|
+
d: "M5 1.5h6V8",
|
|
603
|
+
stroke: "currentColor",
|
|
604
|
+
strokeWidth: "1.3",
|
|
605
|
+
strokeLinecap: "round"
|
|
606
|
+
}
|
|
607
|
+
)
|
|
359
608
|
] })
|
|
360
609
|
}
|
|
361
610
|
)
|
|
362
611
|
] })
|
|
363
612
|
] }),
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
|
|
366
|
-
/* @__PURE__ */ jsx("span", { children: "Loading editor\u2026" })
|
|
367
|
-
] }), children: /* @__PURE__ */ jsx(
|
|
368
|
-
Editor,
|
|
613
|
+
/* @__PURE__ */ jsx2("div", { className: "ods-monaco__body", style: { minHeight }, children: /* @__PURE__ */ jsx2(
|
|
614
|
+
Suspense2,
|
|
369
615
|
{
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
616
|
+
fallback: /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__loading", children: [
|
|
617
|
+
/* @__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(
|
|
618
|
+
"circle",
|
|
619
|
+
{
|
|
620
|
+
cx: "7",
|
|
621
|
+
cy: "7",
|
|
622
|
+
r: "5",
|
|
623
|
+
stroke: "currentColor",
|
|
624
|
+
strokeWidth: "1.4",
|
|
625
|
+
strokeDasharray: "4 18",
|
|
626
|
+
strokeLinecap: "round"
|
|
627
|
+
}
|
|
628
|
+
) }) }),
|
|
629
|
+
/* @__PURE__ */ jsx2("span", { children: "Loading editor\u2026" })
|
|
380
630
|
] }),
|
|
381
|
-
|
|
631
|
+
children: /* @__PURE__ */ jsx2(
|
|
632
|
+
Editor,
|
|
633
|
+
{
|
|
634
|
+
value,
|
|
635
|
+
onChange: (v) => onChange?.(v ?? ""),
|
|
636
|
+
language,
|
|
637
|
+
height,
|
|
638
|
+
theme: theme ?? OCTAVIAFLOW_THEME_ID,
|
|
639
|
+
options: mergedOptions,
|
|
640
|
+
onMount: handleMount,
|
|
641
|
+
loading: /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__loading", children: [
|
|
642
|
+
/* @__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(
|
|
643
|
+
"circle",
|
|
644
|
+
{
|
|
645
|
+
cx: "7",
|
|
646
|
+
cy: "7",
|
|
647
|
+
r: "5",
|
|
648
|
+
stroke: "currentColor",
|
|
649
|
+
strokeWidth: "1.4",
|
|
650
|
+
strokeDasharray: "4 18",
|
|
651
|
+
strokeLinecap: "round"
|
|
652
|
+
}
|
|
653
|
+
) }) }),
|
|
654
|
+
/* @__PURE__ */ jsx2("span", { children: "Loading editor\u2026" })
|
|
655
|
+
] }),
|
|
656
|
+
"aria-label": ariaLabel
|
|
657
|
+
}
|
|
658
|
+
)
|
|
382
659
|
}
|
|
383
|
-
) })
|
|
384
|
-
!hideFooter && /* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
660
|
+
) }),
|
|
661
|
+
!hideFooter && /* @__PURE__ */ jsxs2("div", { className: "ods-monaco__footer", children: [
|
|
662
|
+
/* @__PURE__ */ jsxs2("span", { className: "ods-monaco__pos", children: [
|
|
386
663
|
"Ln ",
|
|
387
664
|
cursor.line,
|
|
388
665
|
", Col ",
|
|
389
666
|
cursor.column,
|
|
390
|
-
selection.chars > 0 && /* @__PURE__ */
|
|
667
|
+
selection.chars > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
391
668
|
" ",
|
|
392
669
|
"\xB7 ",
|
|
393
670
|
selection.chars,
|
|
@@ -396,14 +673,14 @@ function MonacoEditor({
|
|
|
396
673
|
selection.lines > 1 && ` \xB7 ${selection.lines} lines`
|
|
397
674
|
] })
|
|
398
675
|
] }),
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ jsxs2("span", { className: "ods-monaco__shortcut-hint", children: [
|
|
677
|
+
/* @__PURE__ */ jsx2("kbd", { className: "ods-monaco__kbd", children: "\u2318F" }),
|
|
401
678
|
" find",
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ jsx2("span", { className: "ods-monaco__sep", children: "\xB7" }),
|
|
680
|
+
/* @__PURE__ */ jsx2("kbd", { className: "ods-monaco__kbd", children: "\u2318\u21E7F" }),
|
|
404
681
|
" replace",
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ jsx2("span", { className: "ods-monaco__sep", children: "\xB7" }),
|
|
683
|
+
/* @__PURE__ */ jsx2("kbd", { className: "ods-monaco__kbd", children: "F1" }),
|
|
407
684
|
" commands"
|
|
408
685
|
] })
|
|
409
686
|
] })
|
|
@@ -411,140 +688,6 @@ function MonacoEditor({
|
|
|
411
688
|
}
|
|
412
689
|
);
|
|
413
690
|
}
|
|
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
691
|
export {
|
|
549
692
|
MonacoDiffEditor,
|
|
550
693
|
MonacoEditor,
|