mogh_ui 0.7.6 → 1.0.1
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/components/data-table.cjs +21 -5
- package/dist/components/data-table.cjs.map +1 -1
- package/dist/components/data-table.d.ts +25 -7
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +33 -8
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/monaco/common.cjs +52 -0
- package/dist/components/monaco/common.cjs.map +1 -0
- package/dist/components/monaco/common.d.ts +27 -0
- package/dist/components/monaco/common.d.ts.map +1 -0
- package/dist/components/monaco/common.js +28 -0
- package/dist/components/monaco/common.js.map +1 -0
- package/dist/components/monaco/editor.cjs +236 -0
- package/dist/components/monaco/editor.cjs.map +1 -0
- package/dist/components/monaco/editor.d.ts +5 -0
- package/dist/components/monaco/editor.d.ts.map +1 -0
- package/dist/components/monaco/editor.js +201 -0
- package/dist/components/monaco/editor.js.map +1 -0
- package/dist/components/monaco/index.cjs +14 -201
- package/dist/components/monaco/index.cjs.map +1 -1
- package/dist/components/monaco/index.d.ts +4 -29
- package/dist/components/monaco/index.d.ts.map +1 -1
- package/dist/components/monaco/index.js +13 -201
- package/dist/components/monaco/index.js.map +1 -1
- package/package.json +25 -25
|
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
22
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
23
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -29,216 +30,28 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
30
|
var monaco_exports = {};
|
|
30
31
|
__export(monaco_exports, {
|
|
31
32
|
MonacoDiffEditor: () => MonacoDiffEditor,
|
|
32
|
-
MonacoEditor: () => MonacoEditor
|
|
33
|
-
languageFromPath: () => languageFromPath
|
|
33
|
+
MonacoEditor: () => MonacoEditor
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(monaco_exports);
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var import_init = require("./init");
|
|
38
37
|
var import_react = require("react");
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const LANGUAGE_EXTENSIONS = {
|
|
49
|
-
yaml: [".yaml", ".yml"],
|
|
50
|
-
toml: [".toml"],
|
|
51
|
-
fancy_toml: [],
|
|
52
|
-
json: [".json"],
|
|
53
|
-
key_value: [".env", ".conf"],
|
|
54
|
-
ini: [".ini"],
|
|
55
|
-
string_list: [],
|
|
56
|
-
shell: [".sh", ".bash", ".zsh"],
|
|
57
|
-
dockerfile: ["Dockerfile"],
|
|
58
|
-
rust: [".rs"],
|
|
59
|
-
javascript: [".js", ".jsx", ".mjs", ".cjs"],
|
|
60
|
-
typescript: [".ts", ".tsx"]
|
|
61
|
-
};
|
|
62
|
-
function languageFromPath(path) {
|
|
63
|
-
for (const [lang, extensions] of Object.entries(LANGUAGE_EXTENSIONS)) {
|
|
64
|
-
for (const extension of extensions) {
|
|
65
|
-
if (path.endsWith(extension)) {
|
|
66
|
-
return lang;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return void 0;
|
|
71
|
-
}
|
|
72
|
-
function MonacoEditor({
|
|
73
|
-
value,
|
|
74
|
-
onValueChange,
|
|
75
|
-
language: _language,
|
|
76
|
-
enableFancyToml,
|
|
77
|
-
readOnly,
|
|
78
|
-
filename,
|
|
79
|
-
minHeight,
|
|
80
|
-
maxHeightProportion,
|
|
81
|
-
maxHeight,
|
|
82
|
-
id,
|
|
83
|
-
...boxProps
|
|
84
|
-
}) {
|
|
85
|
-
const language = _language === "fancy_toml" && !enableFancyToml ? "toml" : _language;
|
|
86
|
-
const dimensions = (0, import_hooks.useViewportSize)();
|
|
87
|
-
const [editor, setEditor] = (0, import_react.useState)(null);
|
|
88
|
-
(0, import_react.useEffect)(() => {
|
|
89
|
-
if (!editor) return;
|
|
90
|
-
let node = editor.getDomNode();
|
|
91
|
-
if (!node) return;
|
|
92
|
-
const callback = (e) => {
|
|
93
|
-
if (e.key === "Escape") {
|
|
94
|
-
document.activeElement?.blur?.();
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
node.addEventListener("keydown", callback);
|
|
98
|
-
return () => node.removeEventListener("keydown", callback);
|
|
99
|
-
}, [editor]);
|
|
100
|
-
(0, import_react.useEffect)(() => {
|
|
101
|
-
if (language !== "typescript" && language !== "javascript" && language !== "yaml")
|
|
102
|
-
return;
|
|
103
|
-
if (!editor) return;
|
|
104
|
-
editor.addCommand(
|
|
105
|
-
monaco.KeyMod.Alt | monaco.KeyMod.Shift | monaco.KeyCode.KeyF,
|
|
106
|
-
async () => {
|
|
107
|
-
if (!editor) return;
|
|
108
|
-
const model = editor.getModel();
|
|
109
|
-
if (!model) return;
|
|
110
|
-
const position = editor.getPosition();
|
|
111
|
-
let beforeOffset = (position && model.getOffsetAt(position)) ?? 0;
|
|
112
|
-
const curr = editor.getValue();
|
|
113
|
-
const { formatted, cursorOffset } = await prettier.formatWithCursor(
|
|
114
|
-
curr,
|
|
115
|
-
{
|
|
116
|
-
cursorOffset: beforeOffset,
|
|
117
|
-
parser: language === "yaml" ? "yaml" : "typescript",
|
|
118
|
-
plugins: language === "yaml" ? [pluginYaml] : [pluginTypescript, pluginEsTree],
|
|
119
|
-
printWidth: 80
|
|
120
|
-
// Set the desired max line length
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
editor.setValue(formatted);
|
|
124
|
-
editor.setPosition(model.getPositionAt(cursorOffset));
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
}, [editor]);
|
|
128
|
-
const line_count = value?.split(/\r\n|\r|\n/).length ?? 0;
|
|
129
|
-
(0, import_react.useEffect)(() => {
|
|
130
|
-
if (!editor) return;
|
|
131
|
-
const contentHeight = line_count * 18 + 30;
|
|
132
|
-
const containerNode = editor.getContainerDomNode();
|
|
133
|
-
containerNode.style.height = `${Math.max(
|
|
134
|
-
Math.min(
|
|
135
|
-
contentHeight,
|
|
136
|
-
Math.floor(dimensions.height * 0.75),
|
|
137
|
-
maxHeightProportion ? Math.floor(maxHeightProportion * dimensions.height) : 1e4,
|
|
138
|
-
maxHeight ?? 1e4
|
|
139
|
-
),
|
|
140
|
-
minHeight ?? MIN_EDITOR_HEIGHT
|
|
141
|
-
)}px`;
|
|
142
|
-
}, [dimensions.height, editor, line_count]);
|
|
143
|
-
const currentTheme = (0, import_core.useComputedColorScheme)();
|
|
144
|
-
const options = {
|
|
145
|
-
minimap: { enabled: false },
|
|
146
|
-
// scrollbar: { alwaysConsumeMouseWheel: false },
|
|
147
|
-
scrollBeyondLastLine: false,
|
|
148
|
-
folding: false,
|
|
149
|
-
automaticLayout: true,
|
|
150
|
-
renderValidationDecorations: "on",
|
|
151
|
-
renderLineHighlightOnlyWhenFocus: true,
|
|
152
|
-
readOnly,
|
|
153
|
-
tabSize: 2,
|
|
154
|
-
detectIndentation: true,
|
|
155
|
-
quickSuggestions: true,
|
|
156
|
-
padding: {
|
|
157
|
-
top: 15
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Box, { id, onKeyDown: (e) => e.stopPropagation(), ...boxProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
-
import_react2.Editor,
|
|
162
|
-
{
|
|
163
|
-
language,
|
|
164
|
-
value,
|
|
165
|
-
theme: currentTheme,
|
|
166
|
-
defaultPath: defaultPath(filename),
|
|
167
|
-
options,
|
|
168
|
-
onChange: (v) => onValueChange?.(v ?? ""),
|
|
169
|
-
onMount: (editor2) => setEditor(editor2)
|
|
170
|
-
}
|
|
171
|
-
) });
|
|
172
|
-
}
|
|
173
|
-
function defaultPath(filename) {
|
|
174
|
-
if (!filename) return void 0;
|
|
175
|
-
const split = filename.split("/");
|
|
176
|
-
return split[split.length - 1];
|
|
38
|
+
__reExport(monaco_exports, require("./common"), module.exports);
|
|
39
|
+
const MonacoEditorInner = (0, import_react.lazy)(
|
|
40
|
+
() => import("./editor").then((m) => ({ default: m.MonacoEditorImpl }))
|
|
41
|
+
);
|
|
42
|
+
const MonacoDiffEditorInner = (0, import_react.lazy)(
|
|
43
|
+
() => import("./editor").then((m) => ({ default: m.MonacoDiffEditorImpl }))
|
|
44
|
+
);
|
|
45
|
+
function MonacoEditor(props) {
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonacoEditorInner, { ...props }) });
|
|
177
47
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
function MonacoDiffEditor({
|
|
181
|
-
original,
|
|
182
|
-
modified,
|
|
183
|
-
onModifiedValueChange,
|
|
184
|
-
language: _language,
|
|
185
|
-
enableFancyToml,
|
|
186
|
-
readOnly,
|
|
187
|
-
id,
|
|
188
|
-
hideUnchangedRegions = true,
|
|
189
|
-
...boxProps
|
|
190
|
-
}) {
|
|
191
|
-
const language = _language === "fancy_toml" && !enableFancyToml ? "toml" : _language;
|
|
192
|
-
const [editor, setEditor] = (0, import_react.useState)(null);
|
|
193
|
-
const original_line_count = original?.split(/\r\n|\r|\n/).length ?? 0;
|
|
194
|
-
const modified_line_count = modified?.split(/\r\n|\r|\n/).length ?? 0;
|
|
195
|
-
const line_count = Math.max(original_line_count, modified_line_count);
|
|
196
|
-
(0, import_react.useEffect)(() => {
|
|
197
|
-
if (!editor) return;
|
|
198
|
-
const contentHeight = line_count * 18 + 30;
|
|
199
|
-
const node = editor.getContainerDomNode();
|
|
200
|
-
node.style.height = `${Math.max(
|
|
201
|
-
Math.min(contentHeight, MAX_DIFF_HEIGHT),
|
|
202
|
-
MIN_DIFF_HEIGHT
|
|
203
|
-
)}px`;
|
|
204
|
-
}, [editor, line_count]);
|
|
205
|
-
const currentTheme = (0, import_core.useComputedColorScheme)();
|
|
206
|
-
const options = {
|
|
207
|
-
minimap: { enabled: true },
|
|
208
|
-
scrollbar: { alwaysConsumeMouseWheel: false },
|
|
209
|
-
scrollBeyondLastLine: false,
|
|
210
|
-
hideUnchangedRegions: { enabled: hideUnchangedRegions },
|
|
211
|
-
folding: false,
|
|
212
|
-
automaticLayout: true,
|
|
213
|
-
renderValidationDecorations: "on",
|
|
214
|
-
renderLineHighlightOnlyWhenFocus: true,
|
|
215
|
-
readOnly,
|
|
216
|
-
padding: {
|
|
217
|
-
top: 15
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Box, { id, onKeyDown: (e) => e.stopPropagation(), ...boxProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
221
|
-
import_react2.DiffEditor,
|
|
222
|
-
{
|
|
223
|
-
language,
|
|
224
|
-
original,
|
|
225
|
-
modified,
|
|
226
|
-
theme: currentTheme,
|
|
227
|
-
options,
|
|
228
|
-
onMount: (editor2) => {
|
|
229
|
-
const modifiedEditor = editor2.getModifiedEditor();
|
|
230
|
-
modifiedEditor.onDidChangeModelContent((_) => {
|
|
231
|
-
onModifiedValueChange?.(modifiedEditor.getValue());
|
|
232
|
-
});
|
|
233
|
-
setEditor(editor2);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
) });
|
|
48
|
+
function MonacoDiffEditor(props) {
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonacoDiffEditorInner, { ...props }) });
|
|
237
50
|
}
|
|
238
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
239
52
|
0 && (module.exports = {
|
|
240
53
|
MonacoDiffEditor,
|
|
241
54
|
MonacoEditor,
|
|
242
|
-
|
|
55
|
+
...require("./common")
|
|
243
56
|
});
|
|
244
57
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/monaco/index.tsx"],"sourcesContent":["import \"./init\";\n\nimport { useEffect, useState } from \"react\";\nimport { DiffEditor, Editor } from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\nimport * as prettier from \"prettier/standalone\";\nimport * as pluginTypescript from \"prettier/plugins/typescript\";\nimport * as pluginEsTree from \"prettier/plugins/estree\";\nimport * as pluginYaml from \"prettier/plugins/yaml\";\nimport { useViewportSize } from \"@mantine/hooks\";\nimport { Box, BoxProps, useComputedColorScheme } from \"@mantine/core\";\n\nconst MIN_EDITOR_HEIGHT = 56;\n\nexport type MonacoLanguage =\n | \"yaml\"\n | \"toml\"\n | \"fancy_toml\"\n | \"json\"\n | \"key_value\"\n | \"ini\"\n | \"string_list\"\n | \"shell\"\n | \"dockerfile\"\n | \"rust\"\n | \"javascript\"\n | \"typescript\";\n\nconst LANGUAGE_EXTENSIONS: Record<MonacoLanguage, string[]> = {\n yaml: [\".yaml\", \".yml\"],\n toml: [\".toml\"],\n fancy_toml: [],\n json: [\".json\"],\n key_value: [\".env\", \".conf\"],\n ini: [\".ini\"],\n string_list: [],\n shell: [\".sh\", \".bash\", \".zsh\"],\n dockerfile: [\"Dockerfile\"],\n rust: [\".rs\"],\n javascript: [\".js\", \".jsx\", \".mjs\", \".cjs\"],\n typescript: [\".ts\", \".tsx\"],\n};\n\nexport function languageFromPath(path: string) {\n for (const [lang, extensions] of Object.entries(LANGUAGE_EXTENSIONS)) {\n for (const extension of extensions) {\n if (path.endsWith(extension)) {\n return lang as MonacoLanguage;\n }\n }\n }\n return undefined;\n}\n\nexport interface MonacoEditorProps extends BoxProps {\n value: string | undefined;\n onValueChange?: (value: string) => void;\n language: MonacoLanguage | undefined;\n enableFancyToml?: boolean;\n filename?: string;\n readOnly?: boolean;\n minHeight?: number;\n /** Define max height as proportion of dimension height. Should be between 0 and 1. */\n maxHeightProportion?: number;\n maxHeight?: number;\n id?: string;\n}\n\nexport function MonacoEditor({\n value,\n onValueChange,\n language: _language,\n enableFancyToml,\n readOnly,\n filename,\n minHeight,\n maxHeightProportion,\n maxHeight,\n id,\n ...boxProps\n}: MonacoEditorProps) {\n const language = (\n _language === \"fancy_toml\" && !enableFancyToml ? \"toml\" : _language\n ) as MonacoLanguage;\n\n const dimensions = useViewportSize();\n const [editor, setEditor] =\n useState<monaco.editor.IStandaloneCodeEditor | null>(null);\n\n useEffect(() => {\n if (!editor) return;\n\n let node = editor.getDomNode();\n if (!node) return;\n\n const callback = (e: any) => {\n if (e.key === \"Escape\") {\n (document.activeElement as any)?.blur?.();\n }\n };\n\n node.addEventListener(\"keydown\", callback);\n return () => node.removeEventListener(\"keydown\", callback);\n }, [editor]);\n\n useEffect(() => {\n if (\n language !== \"typescript\" &&\n language !== \"javascript\" &&\n language !== \"yaml\"\n )\n return;\n if (!editor) return;\n editor.addCommand(\n monaco.KeyMod.Alt | monaco.KeyMod.Shift | monaco.KeyCode.KeyF,\n async () => {\n if (!editor) return;\n const model = editor.getModel();\n if (!model) return;\n const position = editor.getPosition();\n let beforeOffset = (position && model.getOffsetAt(position)) ?? 0;\n const curr = editor.getValue();\n const { formatted, cursorOffset } = await prettier.formatWithCursor(\n curr,\n {\n cursorOffset: beforeOffset,\n parser: language === \"yaml\" ? \"yaml\" : \"typescript\",\n plugins:\n language === \"yaml\"\n ? [pluginYaml]\n : [pluginTypescript, pluginEsTree as any],\n printWidth: 80, // Set the desired max line length\n },\n );\n editor.setValue(formatted);\n editor.setPosition(model.getPositionAt(cursorOffset));\n },\n );\n }, [editor]);\n\n const line_count = value?.split(/\\r\\n|\\r|\\n/).length ?? 0;\n\n useEffect(() => {\n if (!editor) return;\n const contentHeight = line_count * 18 + 30;\n const containerNode = editor.getContainerDomNode();\n\n containerNode.style.height = `${Math.max(\n Math.min(\n contentHeight,\n Math.floor(dimensions.height * 0.75),\n maxHeightProportion\n ? Math.floor(maxHeightProportion * dimensions.height)\n : 10_000,\n maxHeight ?? 10_000,\n ),\n minHeight ?? MIN_EDITOR_HEIGHT,\n )}px`;\n }, [dimensions.height, editor, line_count]);\n\n const currentTheme = useComputedColorScheme();\n\n const options: monaco.editor.IStandaloneEditorConstructionOptions = {\n minimap: { enabled: false },\n // scrollbar: { alwaysConsumeMouseWheel: false },\n scrollBeyondLastLine: false,\n folding: false,\n automaticLayout: true,\n renderValidationDecorations: \"on\",\n renderLineHighlightOnlyWhenFocus: true,\n readOnly,\n tabSize: 2,\n detectIndentation: true,\n quickSuggestions: true,\n padding: {\n top: 15,\n },\n };\n\n return (\n <Box id={id} onKeyDown={(e) => e.stopPropagation()} {...boxProps}>\n <Editor\n language={language}\n value={value}\n theme={currentTheme}\n defaultPath={defaultPath(filename)}\n options={options}\n onChange={(v) => onValueChange?.(v ?? \"\")}\n onMount={(editor) => setEditor(editor)}\n />\n </Box>\n );\n}\n\nfunction defaultPath(filename?: string) {\n if (!filename) return undefined;\n // Extract only the filename part of path,\n // avoiding critical issue when path starts with '/'\n const split = filename.split(\"/\");\n return split[split.length - 1];\n}\n\nconst MIN_DIFF_HEIGHT = 100;\nconst MAX_DIFF_HEIGHT = 600;\n\nexport interface MonacoDiffEditorProps extends BoxProps {\n original: string | undefined;\n modified: string | undefined;\n onModifiedValueChange?: (value: string) => void;\n language: MonacoLanguage | undefined;\n enableFancyToml?: boolean;\n readOnly?: boolean;\n id?: string;\n hideUnchangedRegions?: boolean;\n}\n\nexport function MonacoDiffEditor({\n original,\n modified,\n onModifiedValueChange,\n language: _language,\n enableFancyToml,\n readOnly,\n id,\n hideUnchangedRegions = true,\n ...boxProps\n}: MonacoDiffEditorProps) {\n const language = (\n _language === \"fancy_toml\" && !enableFancyToml ? \"toml\" : _language\n ) as MonacoLanguage;\n\n const [editor, setEditor] =\n useState<monaco.editor.IStandaloneDiffEditor | null>(null);\n\n const original_line_count = original?.split(/\\r\\n|\\r|\\n/).length ?? 0;\n const modified_line_count = modified?.split(/\\r\\n|\\r|\\n/).length ?? 0;\n const line_count = Math.max(original_line_count, modified_line_count);\n\n useEffect(() => {\n if (!editor) return;\n const contentHeight = line_count * 18 + 30;\n const node = editor.getContainerDomNode();\n\n node.style.height = `${Math.max(\n Math.min(contentHeight, MAX_DIFF_HEIGHT),\n MIN_DIFF_HEIGHT,\n )}px`;\n }, [editor, line_count]);\n\n const currentTheme = useComputedColorScheme();\n\n const options: monaco.editor.IStandaloneDiffEditorConstructionOptions = {\n minimap: { enabled: true },\n scrollbar: { alwaysConsumeMouseWheel: false },\n scrollBeyondLastLine: false,\n hideUnchangedRegions: { enabled: hideUnchangedRegions },\n folding: false,\n automaticLayout: true,\n renderValidationDecorations: \"on\",\n renderLineHighlightOnlyWhenFocus: true,\n readOnly,\n padding: {\n top: 15,\n },\n };\n\n return (\n <Box id={id} onKeyDown={(e) => e.stopPropagation()} {...boxProps}>\n <DiffEditor\n language={language}\n original={original}\n modified={modified}\n theme={currentTheme}\n options={options}\n onMount={(editor) => {\n const modifiedEditor = editor.getModifiedEditor();\n modifiedEditor.onDidChangeModelContent((_) => {\n onModifiedValueChange?.(modifiedEditor.getValue());\n });\n setEditor(editor);\n }}\n />\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqLM;AArLN,kBAAO;AAEP,mBAAoC;AACpC,IAAAA,gBAAmC;AACnC,aAAwB;AACxB,eAA0B;AAC1B,uBAAkC;AAClC,mBAA8B;AAC9B,iBAA4B;AAC5B,mBAAgC;AAChC,kBAAsD;AAEtD,MAA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AI,CAAC,OAAQ;AACb,UAAM,gBAAgB,aAAa,KAAK;AACxC,UAAM,OAAO,OAAO,oBAAoB;AAExC,SAAK,MAAM,SAAS,GAAG,KAAK;AAAA,MAC1B,KAAK,IAAI,eAAe,eAAe;AAAA,MACvC;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAAC,QAAQ,UAAU,CAAC;AAEvB,QAAM,mBAAe,oCAAuB;AAE5C,QAAM,UAAkE;AAAA,IACtE,SAAS,EAAE,SAAS,KAAK;AAAA,IACzB,WAAW,EAAE,yBAAyB,MAAM;AAAA,IAC5C,sBAAsB;AAAA,IACtB,sBAAsB,EAAE,SAAS,qBAAqB;AAAA,IACtD,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,6BAA6B;AAAA,IAC7B,kCAAkC;AAAA,IAClC;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AAEA,SACE,4CAAC,mBAAI,IAAQ,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAI,GAAG,UACtD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,SAAS,CAACA,YAAW;AACnB,cAAM,iBAAiBA,QAAO,kBAAkB;AAChD,uBAAe,wBAAwB,CAAC,MAAM;AAC5C,kCAAwB,eAAe,SAAS,CAAC;AAAA,QACnD,CAAC;AACD,kBAAUA,OAAM;AAAA,MAClB;AAAA;AAAA,EACF,GACF;AAEJ;","names":["import_react","editor"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/monaco/index.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport { MonacoDiffEditorProps, MonacoEditorProps } from \"./common\";\n\nexport * from \"./common\";\n\n// The editor implementation pulls in monaco-editor / @monaco-editor/react,\n// so it is loaded lazily to keep it out of consumers' entry chunks.\nconst MonacoEditorInner = lazy(() =>\n import(\"./editor\").then((m) => ({ default: m.MonacoEditorImpl })),\n);\nconst MonacoDiffEditorInner = lazy(() =>\n import(\"./editor\").then((m) => ({ default: m.MonacoDiffEditorImpl })),\n);\n\nexport function MonacoEditor(props: MonacoEditorProps) {\n return (\n <Suspense fallback={null}>\n <MonacoEditorInner {...props} />\n </Suspense>\n );\n}\n\nexport function MonacoDiffEditor(props: MonacoDiffEditorProps) {\n return (\n <Suspense fallback={null}>\n <MonacoDiffEditorInner {...props} />\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBM;AAjBN,mBAA+B;AAG/B,2BAAc,qBAHd;AAOA,MAAM,wBAAoB;AAAA,EAAK,MAC7B,OAAO,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE;AAClE;AACA,MAAM,4BAAwB;AAAA,EAAK,MACjC,OAAO,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE;AACtE;AAEO,SAAS,aAAa,OAA0B;AACrD,SACE,4CAAC,yBAAS,UAAU,MAClB,sDAAC,qBAAmB,GAAG,OAAO,GAChC;AAEJ;AAEO,SAAS,iBAAiB,OAA8B;AAC7D,SACE,4CAAC,yBAAS,UAAU,MAClB,sDAAC,yBAAuB,GAAG,OAAO,GACpC;AAEJ;","names":[]}
|
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function
|
|
5
|
-
export interface MonacoEditorProps extends BoxProps {
|
|
6
|
-
value: string | undefined;
|
|
7
|
-
onValueChange?: (value: string) => void;
|
|
8
|
-
language: MonacoLanguage | undefined;
|
|
9
|
-
enableFancyToml?: boolean;
|
|
10
|
-
filename?: string;
|
|
11
|
-
readOnly?: boolean;
|
|
12
|
-
minHeight?: number;
|
|
13
|
-
/** Define max height as proportion of dimension height. Should be between 0 and 1. */
|
|
14
|
-
maxHeightProportion?: number;
|
|
15
|
-
maxHeight?: number;
|
|
16
|
-
id?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare function MonacoEditor({ value, onValueChange, language: _language, enableFancyToml, readOnly, filename, minHeight, maxHeightProportion, maxHeight, id, ...boxProps }: MonacoEditorProps): import("react").JSX.Element;
|
|
19
|
-
export interface MonacoDiffEditorProps extends BoxProps {
|
|
20
|
-
original: string | undefined;
|
|
21
|
-
modified: string | undefined;
|
|
22
|
-
onModifiedValueChange?: (value: string) => void;
|
|
23
|
-
language: MonacoLanguage | undefined;
|
|
24
|
-
enableFancyToml?: boolean;
|
|
25
|
-
readOnly?: boolean;
|
|
26
|
-
id?: string;
|
|
27
|
-
hideUnchangedRegions?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare function MonacoDiffEditor({ original, modified, onModifiedValueChange, language: _language, enableFancyToml, readOnly, id, hideUnchangedRegions, ...boxProps }: MonacoDiffEditorProps): import("react").JSX.Element;
|
|
1
|
+
import { MonacoDiffEditorProps, MonacoEditorProps } from "./common";
|
|
2
|
+
export * from "./common";
|
|
3
|
+
export declare function MonacoEditor(props: MonacoEditorProps): import("react").JSX.Element;
|
|
4
|
+
export declare function MonacoDiffEditor(props: MonacoDiffEditorProps): import("react").JSX.Element;
|
|
30
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/monaco/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/monaco/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEpE,cAAc,UAAU,CAAC;AAWzB,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAMpD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BAM5D"}
|
|
@@ -1,208 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const MIN_EDITOR_HEIGHT = 56;
|
|
13
|
-
const LANGUAGE_EXTENSIONS = {
|
|
14
|
-
yaml: [".yaml", ".yml"],
|
|
15
|
-
toml: [".toml"],
|
|
16
|
-
fancy_toml: [],
|
|
17
|
-
json: [".json"],
|
|
18
|
-
key_value: [".env", ".conf"],
|
|
19
|
-
ini: [".ini"],
|
|
20
|
-
string_list: [],
|
|
21
|
-
shell: [".sh", ".bash", ".zsh"],
|
|
22
|
-
dockerfile: ["Dockerfile"],
|
|
23
|
-
rust: [".rs"],
|
|
24
|
-
javascript: [".js", ".jsx", ".mjs", ".cjs"],
|
|
25
|
-
typescript: [".ts", ".tsx"]
|
|
26
|
-
};
|
|
27
|
-
function languageFromPath(path) {
|
|
28
|
-
for (const [lang, extensions] of Object.entries(LANGUAGE_EXTENSIONS)) {
|
|
29
|
-
for (const extension of extensions) {
|
|
30
|
-
if (path.endsWith(extension)) {
|
|
31
|
-
return lang;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return void 0;
|
|
36
|
-
}
|
|
37
|
-
function MonacoEditor({
|
|
38
|
-
value,
|
|
39
|
-
onValueChange,
|
|
40
|
-
language: _language,
|
|
41
|
-
enableFancyToml,
|
|
42
|
-
readOnly,
|
|
43
|
-
filename,
|
|
44
|
-
minHeight,
|
|
45
|
-
maxHeightProportion,
|
|
46
|
-
maxHeight,
|
|
47
|
-
id,
|
|
48
|
-
...boxProps
|
|
49
|
-
}) {
|
|
50
|
-
const language = _language === "fancy_toml" && !enableFancyToml ? "toml" : _language;
|
|
51
|
-
const dimensions = useViewportSize();
|
|
52
|
-
const [editor, setEditor] = useState(null);
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (!editor) return;
|
|
55
|
-
let node = editor.getDomNode();
|
|
56
|
-
if (!node) return;
|
|
57
|
-
const callback = (e) => {
|
|
58
|
-
if (e.key === "Escape") {
|
|
59
|
-
document.activeElement?.blur?.();
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
node.addEventListener("keydown", callback);
|
|
63
|
-
return () => node.removeEventListener("keydown", callback);
|
|
64
|
-
}, [editor]);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
if (language !== "typescript" && language !== "javascript" && language !== "yaml")
|
|
67
|
-
return;
|
|
68
|
-
if (!editor) return;
|
|
69
|
-
editor.addCommand(
|
|
70
|
-
monaco.KeyMod.Alt | monaco.KeyMod.Shift | monaco.KeyCode.KeyF,
|
|
71
|
-
async () => {
|
|
72
|
-
if (!editor) return;
|
|
73
|
-
const model = editor.getModel();
|
|
74
|
-
if (!model) return;
|
|
75
|
-
const position = editor.getPosition();
|
|
76
|
-
let beforeOffset = (position && model.getOffsetAt(position)) ?? 0;
|
|
77
|
-
const curr = editor.getValue();
|
|
78
|
-
const { formatted, cursorOffset } = await prettier.formatWithCursor(
|
|
79
|
-
curr,
|
|
80
|
-
{
|
|
81
|
-
cursorOffset: beforeOffset,
|
|
82
|
-
parser: language === "yaml" ? "yaml" : "typescript",
|
|
83
|
-
plugins: language === "yaml" ? [pluginYaml] : [pluginTypescript, pluginEsTree],
|
|
84
|
-
printWidth: 80
|
|
85
|
-
// Set the desired max line length
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
editor.setValue(formatted);
|
|
89
|
-
editor.setPosition(model.getPositionAt(cursorOffset));
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
}, [editor]);
|
|
93
|
-
const line_count = value?.split(/\r\n|\r|\n/).length ?? 0;
|
|
94
|
-
useEffect(() => {
|
|
95
|
-
if (!editor) return;
|
|
96
|
-
const contentHeight = line_count * 18 + 30;
|
|
97
|
-
const containerNode = editor.getContainerDomNode();
|
|
98
|
-
containerNode.style.height = `${Math.max(
|
|
99
|
-
Math.min(
|
|
100
|
-
contentHeight,
|
|
101
|
-
Math.floor(dimensions.height * 0.75),
|
|
102
|
-
maxHeightProportion ? Math.floor(maxHeightProportion * dimensions.height) : 1e4,
|
|
103
|
-
maxHeight ?? 1e4
|
|
104
|
-
),
|
|
105
|
-
minHeight ?? MIN_EDITOR_HEIGHT
|
|
106
|
-
)}px`;
|
|
107
|
-
}, [dimensions.height, editor, line_count]);
|
|
108
|
-
const currentTheme = useComputedColorScheme();
|
|
109
|
-
const options = {
|
|
110
|
-
minimap: { enabled: false },
|
|
111
|
-
// scrollbar: { alwaysConsumeMouseWheel: false },
|
|
112
|
-
scrollBeyondLastLine: false,
|
|
113
|
-
folding: false,
|
|
114
|
-
automaticLayout: true,
|
|
115
|
-
renderValidationDecorations: "on",
|
|
116
|
-
renderLineHighlightOnlyWhenFocus: true,
|
|
117
|
-
readOnly,
|
|
118
|
-
tabSize: 2,
|
|
119
|
-
detectIndentation: true,
|
|
120
|
-
quickSuggestions: true,
|
|
121
|
-
padding: {
|
|
122
|
-
top: 15
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
return /* @__PURE__ */ jsx(Box, { id, onKeyDown: (e) => e.stopPropagation(), ...boxProps, children: /* @__PURE__ */ jsx(
|
|
126
|
-
Editor,
|
|
127
|
-
{
|
|
128
|
-
language,
|
|
129
|
-
value,
|
|
130
|
-
theme: currentTheme,
|
|
131
|
-
defaultPath: defaultPath(filename),
|
|
132
|
-
options,
|
|
133
|
-
onChange: (v) => onValueChange?.(v ?? ""),
|
|
134
|
-
onMount: (editor2) => setEditor(editor2)
|
|
135
|
-
}
|
|
136
|
-
) });
|
|
137
|
-
}
|
|
138
|
-
function defaultPath(filename) {
|
|
139
|
-
if (!filename) return void 0;
|
|
140
|
-
const split = filename.split("/");
|
|
141
|
-
return split[split.length - 1];
|
|
2
|
+
import { lazy, Suspense } from "react";
|
|
3
|
+
export * from "./common";
|
|
4
|
+
const MonacoEditorInner = lazy(
|
|
5
|
+
() => import("./editor").then((m) => ({ default: m.MonacoEditorImpl }))
|
|
6
|
+
);
|
|
7
|
+
const MonacoDiffEditorInner = lazy(
|
|
8
|
+
() => import("./editor").then((m) => ({ default: m.MonacoDiffEditorImpl }))
|
|
9
|
+
);
|
|
10
|
+
function MonacoEditor(props) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(MonacoEditorInner, { ...props }) });
|
|
142
12
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
function MonacoDiffEditor({
|
|
146
|
-
original,
|
|
147
|
-
modified,
|
|
148
|
-
onModifiedValueChange,
|
|
149
|
-
language: _language,
|
|
150
|
-
enableFancyToml,
|
|
151
|
-
readOnly,
|
|
152
|
-
id,
|
|
153
|
-
hideUnchangedRegions = true,
|
|
154
|
-
...boxProps
|
|
155
|
-
}) {
|
|
156
|
-
const language = _language === "fancy_toml" && !enableFancyToml ? "toml" : _language;
|
|
157
|
-
const [editor, setEditor] = useState(null);
|
|
158
|
-
const original_line_count = original?.split(/\r\n|\r|\n/).length ?? 0;
|
|
159
|
-
const modified_line_count = modified?.split(/\r\n|\r|\n/).length ?? 0;
|
|
160
|
-
const line_count = Math.max(original_line_count, modified_line_count);
|
|
161
|
-
useEffect(() => {
|
|
162
|
-
if (!editor) return;
|
|
163
|
-
const contentHeight = line_count * 18 + 30;
|
|
164
|
-
const node = editor.getContainerDomNode();
|
|
165
|
-
node.style.height = `${Math.max(
|
|
166
|
-
Math.min(contentHeight, MAX_DIFF_HEIGHT),
|
|
167
|
-
MIN_DIFF_HEIGHT
|
|
168
|
-
)}px`;
|
|
169
|
-
}, [editor, line_count]);
|
|
170
|
-
const currentTheme = useComputedColorScheme();
|
|
171
|
-
const options = {
|
|
172
|
-
minimap: { enabled: true },
|
|
173
|
-
scrollbar: { alwaysConsumeMouseWheel: false },
|
|
174
|
-
scrollBeyondLastLine: false,
|
|
175
|
-
hideUnchangedRegions: { enabled: hideUnchangedRegions },
|
|
176
|
-
folding: false,
|
|
177
|
-
automaticLayout: true,
|
|
178
|
-
renderValidationDecorations: "on",
|
|
179
|
-
renderLineHighlightOnlyWhenFocus: true,
|
|
180
|
-
readOnly,
|
|
181
|
-
padding: {
|
|
182
|
-
top: 15
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
return /* @__PURE__ */ jsx(Box, { id, onKeyDown: (e) => e.stopPropagation(), ...boxProps, children: /* @__PURE__ */ jsx(
|
|
186
|
-
DiffEditor,
|
|
187
|
-
{
|
|
188
|
-
language,
|
|
189
|
-
original,
|
|
190
|
-
modified,
|
|
191
|
-
theme: currentTheme,
|
|
192
|
-
options,
|
|
193
|
-
onMount: (editor2) => {
|
|
194
|
-
const modifiedEditor = editor2.getModifiedEditor();
|
|
195
|
-
modifiedEditor.onDidChangeModelContent((_) => {
|
|
196
|
-
onModifiedValueChange?.(modifiedEditor.getValue());
|
|
197
|
-
});
|
|
198
|
-
setEditor(editor2);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
) });
|
|
13
|
+
function MonacoDiffEditor(props) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(MonacoDiffEditorInner, { ...props }) });
|
|
202
15
|
}
|
|
203
16
|
export {
|
|
204
17
|
MonacoDiffEditor,
|
|
205
|
-
MonacoEditor
|
|
206
|
-
languageFromPath
|
|
18
|
+
MonacoEditor
|
|
207
19
|
};
|
|
208
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/monaco/index.tsx"],"sourcesContent":["import \"./init\";\n\nimport { useEffect, useState } from \"react\";\nimport { DiffEditor, Editor } from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\nimport * as prettier from \"prettier/standalone\";\nimport * as pluginTypescript from \"prettier/plugins/typescript\";\nimport * as pluginEsTree from \"prettier/plugins/estree\";\nimport * as pluginYaml from \"prettier/plugins/yaml\";\nimport { useViewportSize } from \"@mantine/hooks\";\nimport { Box, BoxProps, useComputedColorScheme } from \"@mantine/core\";\n\nconst MIN_EDITOR_HEIGHT = 56;\n\nexport type MonacoLanguage =\n | \"yaml\"\n | \"toml\"\n | \"fancy_toml\"\n | \"json\"\n | \"key_value\"\n | \"ini\"\n | \"string_list\"\n | \"shell\"\n | \"dockerfile\"\n | \"rust\"\n | \"javascript\"\n | \"typescript\";\n\nconst LANGUAGE_EXTENSIONS: Record<MonacoLanguage, string[]> = {\n yaml: [\".yaml\", \".yml\"],\n toml: [\".toml\"],\n fancy_toml: [],\n json: [\".json\"],\n key_value: [\".env\", \".conf\"],\n ini: [\".ini\"],\n string_list: [],\n shell: [\".sh\", \".bash\", \".zsh\"],\n dockerfile: [\"Dockerfile\"],\n rust: [\".rs\"],\n javascript: [\".js\", \".jsx\", \".mjs\", \".cjs\"],\n typescript: [\".ts\", \".tsx\"],\n};\n\nexport function languageFromPath(path: string) {\n for (const [lang, extensions] of Object.entries(LANGUAGE_EXTENSIONS)) {\n for (const extension of extensions) {\n if (path.endsWith(extension)) {\n return lang as MonacoLanguage;\n }\n }\n }\n return undefined;\n}\n\nexport interface MonacoEditorProps extends BoxProps {\n value: string | undefined;\n onValueChange?: (value: string) => void;\n language: MonacoLanguage | undefined;\n enableFancyToml?: boolean;\n filename?: string;\n readOnly?: boolean;\n minHeight?: number;\n /** Define max height as proportion of dimension height. Should be between 0 and 1. */\n maxHeightProportion?: number;\n maxHeight?: number;\n id?: string;\n}\n\nexport function MonacoEditor({\n value,\n onValueChange,\n language: _language,\n enableFancyToml,\n readOnly,\n filename,\n minHeight,\n maxHeightProportion,\n maxHeight,\n id,\n ...boxProps\n}: MonacoEditorProps) {\n const language = (\n _language === \"fancy_toml\" && !enableFancyToml ? \"toml\" : _language\n ) as MonacoLanguage;\n\n const dimensions = useViewportSize();\n const [editor, setEditor] =\n useState<monaco.editor.IStandaloneCodeEditor | null>(null);\n\n useEffect(() => {\n if (!editor) return;\n\n let node = editor.getDomNode();\n if (!node) return;\n\n const callback = (e: any) => {\n if (e.key === \"Escape\") {\n (document.activeElement as any)?.blur?.();\n }\n };\n\n node.addEventListener(\"keydown\", callback);\n return () => node.removeEventListener(\"keydown\", callback);\n }, [editor]);\n\n useEffect(() => {\n if (\n language !== \"typescript\" &&\n language !== \"javascript\" &&\n language !== \"yaml\"\n )\n return;\n if (!editor) return;\n editor.addCommand(\n monaco.KeyMod.Alt | monaco.KeyMod.Shift | monaco.KeyCode.KeyF,\n async () => {\n if (!editor) return;\n const model = editor.getModel();\n if (!model) return;\n const position = editor.getPosition();\n let beforeOffset = (position && model.getOffsetAt(position)) ?? 0;\n const curr = editor.getValue();\n const { formatted, cursorOffset } = await prettier.formatWithCursor(\n curr,\n {\n cursorOffset: beforeOffset,\n parser: language === \"yaml\" ? \"yaml\" : \"typescript\",\n plugins:\n language === \"yaml\"\n ? [pluginYaml]\n : [pluginTypescript, pluginEsTree as any],\n printWidth: 80, // Set the desired max line length\n },\n );\n editor.setValue(formatted);\n editor.setPosition(model.getPositionAt(cursorOffset));\n },\n );\n }, [editor]);\n\n const line_count = value?.split(/\\r\\n|\\r|\\n/).length ?? 0;\n\n useEffect(() => {\n if (!editor) return;\n const contentHeight = line_count * 18 + 30;\n const containerNode = editor.getContainerDomNode();\n\n containerNode.style.height = `${Math.max(\n Math.min(\n contentHeight,\n Math.floor(dimensions.height * 0.75),\n maxHeightProportion\n ? Math.floor(maxHeightProportion * dimensions.height)\n : 10_000,\n maxHeight ?? 10_000,\n ),\n minHeight ?? MIN_EDITOR_HEIGHT,\n )}px`;\n }, [dimensions.height, editor, line_count]);\n\n const currentTheme = useComputedColorScheme();\n\n const options: monaco.editor.IStandaloneEditorConstructionOptions = {\n minimap: { enabled: false },\n // scrollbar: { alwaysConsumeMouseWheel: false },\n scrollBeyondLastLine: false,\n folding: false,\n automaticLayout: true,\n renderValidationDecorations: \"on\",\n renderLineHighlightOnlyWhenFocus: true,\n readOnly,\n tabSize: 2,\n detectIndentation: true,\n quickSuggestions: true,\n padding: {\n top: 15,\n },\n };\n\n return (\n <Box id={id} onKeyDown={(e) => e.stopPropagation()} {...boxProps}>\n <Editor\n language={language}\n value={value}\n theme={currentTheme}\n defaultPath={defaultPath(filename)}\n options={options}\n onChange={(v) => onValueChange?.(v ?? \"\")}\n onMount={(editor) => setEditor(editor)}\n />\n </Box>\n );\n}\n\nfunction defaultPath(filename?: string) {\n if (!filename) return undefined;\n // Extract only the filename part of path,\n // avoiding critical issue when path starts with '/'\n const split = filename.split(\"/\");\n return split[split.length - 1];\n}\n\nconst MIN_DIFF_HEIGHT = 100;\nconst MAX_DIFF_HEIGHT = 600;\n\nexport interface MonacoDiffEditorProps extends BoxProps {\n original: string | undefined;\n modified: string | undefined;\n onModifiedValueChange?: (value: string) => void;\n language: MonacoLanguage | undefined;\n enableFancyToml?: boolean;\n readOnly?: boolean;\n id?: string;\n hideUnchangedRegions?: boolean;\n}\n\nexport function MonacoDiffEditor({\n original,\n modified,\n onModifiedValueChange,\n language: _language,\n enableFancyToml,\n readOnly,\n id,\n hideUnchangedRegions = true,\n ...boxProps\n}: MonacoDiffEditorProps) {\n const language = (\n _language === \"fancy_toml\" && !enableFancyToml ? \"toml\" : _language\n ) as MonacoLanguage;\n\n const [editor, setEditor] =\n useState<monaco.editor.IStandaloneDiffEditor | null>(null);\n\n const original_line_count = original?.split(/\\r\\n|\\r|\\n/).length ?? 0;\n const modified_line_count = modified?.split(/\\r\\n|\\r|\\n/).length ?? 0;\n const line_count = Math.max(original_line_count, modified_line_count);\n\n useEffect(() => {\n if (!editor) return;\n const contentHeight = line_count * 18 + 30;\n const node = editor.getContainerDomNode();\n\n node.style.height = `${Math.max(\n Math.min(contentHeight, MAX_DIFF_HEIGHT),\n MIN_DIFF_HEIGHT,\n )}px`;\n }, [editor, line_count]);\n\n const currentTheme = useComputedColorScheme();\n\n const options: monaco.editor.IStandaloneDiffEditorConstructionOptions = {\n minimap: { enabled: true },\n scrollbar: { alwaysConsumeMouseWheel: false },\n scrollBeyondLastLine: false,\n hideUnchangedRegions: { enabled: hideUnchangedRegions },\n folding: false,\n automaticLayout: true,\n renderValidationDecorations: \"on\",\n renderLineHighlightOnlyWhenFocus: true,\n readOnly,\n padding: {\n top: 15,\n },\n };\n\n return (\n <Box id={id} onKeyDown={(e) => e.stopPropagation()} {...boxProps}>\n <DiffEditor\n language={language}\n original={original}\n modified={modified}\n theme={currentTheme}\n options={options}\n onMount={(editor) => {\n const modifiedEditor = editor.getModifiedEditor();\n modifiedEditor.onDidChangeModelContent((_) => {\n onModifiedValueChange?.(modifiedEditor.getValue());\n });\n setEditor(editor);\n }}\n />\n </Box>\n );\n}\n"],"mappings":"AAqLM;AArLN,OAAO;AAEP,SAAS,WAAW,gBAAgB;AACpC,SAAS,YAAY,cAAc;AACnC,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,YAAY,sBAAsB;AAClC,YAAY,kBAAkB;AAC9B,YAAY,gBAAgB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,KAAe,8BAA8B;AAEtD,MAAM,oBAAoB;AAgB1B,MAAM,sBAAwD;AAAA,EAC5D,MAAM,CAAC,SAAS,MAAM;AAAA,EACtB,MAAM,CAAC,OAAO;AAAA,EACd,YAAY,CAAC;AAAA,EACb,MAAM,CAAC,OAAO;AAAA,EACd,WAAW,CAAC,QAAQ,OAAO;AAAA,EAC3B,KAAK,CAAC,MAAM;AAAA,EACZ,aAAa,CAAC;AAAA,EACd,OAAO,CAAC,OAAO,SAAS,MAAM;AAAA,EAC9B,YAAY,CAAC,YAAY;AAAA,EACzB,MAAM,CAAC,KAAK;AAAA,EACZ,YAAY,CAAC,OAAO,QAAQ,QAAQ,MAAM;AAAA,EAC1C,YAAY,CAAC,OAAO,MAAM;AAC5B;AAEO,SAAS,iBAAiB,MAAc;AAC7C,aAAW,CAAC,MAAM,UAAU,KAAK,OAAO,QAAQ,mBAAmB,GAAG;AACpE,eAAW,aA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AEA,SACE,oBAAC,OAAI,IAAQ,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAI,GAAG,UACtD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,SAAS,CAACA,YAAW;AACnB,cAAM,iBAAiBA,QAAO,kBAAkB;AAChD,uBAAe,wBAAwB,CAAC,MAAM;AAC5C,kCAAwB,eAAe,SAAS,CAAC;AAAA,QACnD,CAAC;AACD,kBAAUA,OAAM;AAAA,MAClB;AAAA;AAAA,EACF,GACF;AAEJ;","names":["editor"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/monaco/index.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport { MonacoDiffEditorProps, MonacoEditorProps } from \"./common\";\n\nexport * from \"./common\";\n\n// The editor implementation pulls in monaco-editor / @monaco-editor/react,\n// so it is loaded lazily to keep it out of consumers' entry chunks.\nconst MonacoEditorInner = lazy(() =>\n import(\"./editor\").then((m) => ({ default: m.MonacoEditorImpl })),\n);\nconst MonacoDiffEditorInner = lazy(() =>\n import(\"./editor\").then((m) => ({ default: m.MonacoDiffEditorImpl })),\n);\n\nexport function MonacoEditor(props: MonacoEditorProps) {\n return (\n <Suspense fallback={null}>\n <MonacoEditorInner {...props} />\n </Suspense>\n );\n}\n\nexport function MonacoDiffEditor(props: MonacoDiffEditorProps) {\n return (\n <Suspense fallback={null}>\n <MonacoDiffEditorInner {...props} />\n </Suspense>\n );\n}\n"],"mappings":"AAiBM;AAjBN,SAAS,MAAM,gBAAgB;AAG/B,cAAc;AAId,MAAM,oBAAoB;AAAA,EAAK,MAC7B,OAAO,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE;AAClE;AACA,MAAM,wBAAwB;AAAA,EAAK,MACjC,OAAO,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE;AACtE;AAEO,SAAS,aAAa,OAA0B;AACrD,SACE,oBAAC,YAAS,UAAU,MAClB,8BAAC,qBAAmB,GAAG,OAAO,GAChC;AAEJ;AAEO,SAAS,iBAAiB,OAA8B;AAC7D,SACE,oBAAC,YAAS,UAAU,MAClB,8BAAC,yBAAuB,GAAG,OAAO,GACpC;AAEJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mogh_ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Common UI components and styling used across Mogh apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,38 +29,38 @@
|
|
|
29
29
|
"typecheck": "tsc --noEmit"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@mantine/core": "^9.
|
|
33
|
-
"@mantine/form": "^9.
|
|
34
|
-
"@mantine/hooks": "^9.
|
|
35
|
-
"@mantine/notifications": "^9.
|
|
32
|
+
"@mantine/core": "^9.5.1",
|
|
33
|
+
"@mantine/form": "^9.5.1",
|
|
34
|
+
"@mantine/hooks": "^9.5.1",
|
|
35
|
+
"@mantine/notifications": "^9.5.1",
|
|
36
36
|
"@monaco-editor/react": "^4.7.0",
|
|
37
|
-
"@tanstack/react-table": "^
|
|
38
|
-
"@tanstack/react-query": "^5.101.
|
|
39
|
-
"lucide-react": "^1.
|
|
40
|
-
"mogh_auth_client": "^1.7.
|
|
37
|
+
"@tanstack/react-table": "^9.0.0",
|
|
38
|
+
"@tanstack/react-query": "^5.101.4",
|
|
39
|
+
"lucide-react": "^1.29.0",
|
|
40
|
+
"mogh_auth_client": "^1.7.1",
|
|
41
41
|
"monaco-editor": "^0.56.0",
|
|
42
42
|
"monaco-yaml": "^5.5.1",
|
|
43
|
-
"react": "^19.2.
|
|
44
|
-
"react-dom": "^19.2.
|
|
45
|
-
"react-router-dom": "^7.18.
|
|
43
|
+
"react": "^19.2.8",
|
|
44
|
+
"react-dom": "^19.2.8",
|
|
45
|
+
"react-router-dom": "^7.18.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@mantine/core": "^9.
|
|
49
|
-
"@mantine/form": "^9.
|
|
50
|
-
"@mantine/hooks": "^9.
|
|
51
|
-
"@mantine/notifications": "^9.
|
|
48
|
+
"@mantine/core": "^9.5.1",
|
|
49
|
+
"@mantine/form": "^9.5.1",
|
|
50
|
+
"@mantine/hooks": "^9.5.1",
|
|
51
|
+
"@mantine/notifications": "^9.5.1",
|
|
52
52
|
"@monaco-editor/react": "^4.7.0",
|
|
53
|
-
"@tanstack/react-table": "^
|
|
54
|
-
"@tanstack/react-query": "^5.101.
|
|
55
|
-
"@types/react": "^19.2.
|
|
56
|
-
"@types/react-dom": "^19.2.
|
|
57
|
-
"lucide-react": "^1.
|
|
58
|
-
"mogh_auth_client": "^1.7.
|
|
53
|
+
"@tanstack/react-table": "^9.0.0",
|
|
54
|
+
"@tanstack/react-query": "^5.101.4",
|
|
55
|
+
"@types/react": "^19.2.18",
|
|
56
|
+
"@types/react-dom": "^19.2.4",
|
|
57
|
+
"lucide-react": "^1.29.0",
|
|
58
|
+
"mogh_auth_client": "^1.7.1",
|
|
59
59
|
"monaco-editor": "^0.56.0",
|
|
60
60
|
"monaco-yaml": "^5.5.1",
|
|
61
|
-
"react": "^19.2.
|
|
62
|
-
"react-dom": "^19.2.
|
|
63
|
-
"react-router-dom": "^7.18.
|
|
61
|
+
"react": "^19.2.8",
|
|
62
|
+
"react-dom": "^19.2.8",
|
|
63
|
+
"react-router-dom": "^7.18.2",
|
|
64
64
|
"tsup": "^8.5.1",
|
|
65
65
|
"typescript": "^7.0.2"
|
|
66
66
|
}
|