@cere/cere-design-system 0.1.0 → 0.2.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/README.md +76 -0
- package/dist/buttons.d.mts +27 -22
- package/dist/buttons.d.ts +27 -22
- package/dist/buttons.js +5 -5
- package/dist/buttons.mjs +4 -4
- package/dist/charts.d.mts +1 -23
- package/dist/charts.d.ts +1 -23
- package/dist/charts.js +2 -9
- package/dist/charts.js.map +1 -1
- package/dist/charts.mjs +1 -8
- package/dist/{chunk-THQKYTQE.js → chunk-2KDN37PQ.js} +28 -32
- package/dist/chunk-2KDN37PQ.js.map +1 -0
- package/dist/{chunk-3WCMINE5.mjs → chunk-34LFXT6C.mjs} +25 -29
- package/dist/chunk-34LFXT6C.mjs.map +1 -0
- package/dist/chunk-3KCXCVOX.mjs +411 -0
- package/dist/chunk-3KCXCVOX.mjs.map +1 -0
- package/dist/{chunk-NXTVJ6PY.js → chunk-4OKTICU5.js} +10 -10
- package/dist/chunk-4OKTICU5.js.map +1 -0
- package/dist/{chunk-FN5YL4BK.js → chunk-72TQ56EP.js} +47 -45
- package/dist/chunk-72TQ56EP.js.map +1 -0
- package/dist/{chunk-QYYQYZHV.js → chunk-7KXKK2RE.js} +3 -5
- package/dist/chunk-7KXKK2RE.js.map +1 -0
- package/dist/{chunk-CCN6M4LI.js → chunk-ARSCL4ZZ.js} +18 -10
- package/dist/chunk-ARSCL4ZZ.js.map +1 -0
- package/dist/chunk-AWVNEU6R.mjs +1478 -0
- package/dist/chunk-AWVNEU6R.mjs.map +1 -0
- package/dist/{chunk-CUCKULYC.mjs → chunk-BH4FNZKK.mjs} +74 -1260
- package/dist/chunk-BH4FNZKK.mjs.map +1 -0
- package/dist/{chunk-FFZ5S7PQ.mjs → chunk-BOQPWZIB.mjs} +6 -5
- package/dist/chunk-BOQPWZIB.mjs.map +1 -0
- package/dist/chunk-BT7XUTT5.mjs +392 -0
- package/dist/chunk-BT7XUTT5.mjs.map +1 -0
- package/dist/{chunk-ATIFLPH6.mjs → chunk-D7D25O6E.mjs} +4 -2
- package/dist/{chunk-ATIFLPH6.mjs.map → chunk-D7D25O6E.mjs.map} +1 -1
- package/dist/{chunk-JS4IB5IU.mjs → chunk-DRGMEIPT.mjs} +2 -2
- package/dist/chunk-DRGMEIPT.mjs.map +1 -0
- package/dist/{chunk-KF2Y7HO3.js → chunk-DZXNYLVG.js} +43 -246
- package/dist/chunk-DZXNYLVG.js.map +1 -0
- package/dist/{chunk-IE6GCHDI.mjs → chunk-GR52ENYI.mjs} +26 -29
- package/dist/chunk-GR52ENYI.mjs.map +1 -0
- package/dist/chunk-GTBKQXXI.js +1472 -0
- package/dist/chunk-GTBKQXXI.js.map +1 -0
- package/dist/{chunk-463SRKKD.js → chunk-HJ24WKU4.js} +14 -5
- package/dist/chunk-HJ24WKU4.js.map +1 -0
- package/dist/{chunk-EOF3QNPF.js → chunk-KKIKOIMP.js} +140 -1028
- package/dist/chunk-KKIKOIMP.js.map +1 -0
- package/dist/{chunk-MNM6HE72.js → chunk-LVJSKRX3.js} +16 -15
- package/dist/chunk-LVJSKRX3.js.map +1 -0
- package/dist/{chunk-KPDYKK3V.js → chunk-PFZZJZ64.js} +8 -8
- package/dist/{chunk-KPDYKK3V.js.map → chunk-PFZZJZ64.js.map} +1 -1
- package/dist/{chunk-KVBMZNWT.mjs → chunk-POCAW2G4.mjs} +18 -10
- package/dist/chunk-POCAW2G4.mjs.map +1 -0
- package/dist/{chunk-L2TIGA7I.js → chunk-QCFLZ7X3.js} +39 -42
- package/dist/chunk-QCFLZ7X3.js.map +1 -0
- package/dist/{chunk-6EUAU67C.mjs → chunk-SG2TD7FQ.mjs} +8 -8
- package/dist/chunk-SG2TD7FQ.mjs.map +1 -0
- package/dist/{chunk-QY65OUAC.mjs → chunk-SSFALO6S.mjs} +13 -4
- package/dist/chunk-SSFALO6S.mjs.map +1 -0
- package/dist/{chunk-PWF2NJDB.mjs → chunk-WC2TCWXK.mjs} +82 -14
- package/dist/chunk-WC2TCWXK.mjs.map +1 -0
- package/dist/{chunk-ZGCN5WCG.js → chunk-XZZZ4MZV.js} +83 -15
- package/dist/chunk-XZZZ4MZV.js.map +1 -0
- package/dist/chunk-YCDCQSYH.js +411 -0
- package/dist/chunk-YCDCQSYH.js.map +1 -0
- package/dist/{chunk-CWJ4OU6W.mjs → chunk-ZDAZYIXB.mjs} +2 -4
- package/dist/chunk-ZDAZYIXB.mjs.map +1 -0
- package/dist/feedback.d.mts +20 -8
- package/dist/feedback.d.ts +20 -8
- package/dist/feedback.js +5 -5
- package/dist/feedback.mjs +4 -4
- package/dist/fonts/HumanSans-BlackOblique.otf +0 -0
- package/dist/fonts/HumanSans-Thin.otf +0 -0
- package/dist/fonts/HumanSans-ThinOblique.otf +0 -0
- package/dist/fonts/human-sans-font.css +88 -0
- package/dist/fonts/human-sans.css +3 -0
- package/dist/fonts/inter.css +3 -0
- package/dist/icons.d.mts +2 -3
- package/dist/icons.d.ts +2 -3
- package/dist/icons.js +2 -2
- package/dist/icons.mjs +1 -1
- package/dist/index.d.mts +37 -8
- package/dist/index.d.ts +37 -8
- package/dist/index.js +23 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -113
- package/dist/index.mjs.map +1 -1
- package/dist/inputs.d.mts +23 -3
- package/dist/inputs.d.ts +23 -3
- package/dist/inputs.js +5 -5
- package/dist/inputs.js.map +1 -1
- package/dist/inputs.mjs +15 -15
- package/dist/layout.d.mts +37 -283
- package/dist/layout.d.ts +37 -283
- package/dist/layout.js +8 -32
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +16 -40
- package/dist/navigation.d.mts +9 -114
- package/dist/navigation.d.ts +9 -114
- package/dist/navigation.js +5 -9
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +6 -10
- package/dist/third-party.d.mts +3 -527
- package/dist/third-party.d.ts +3 -527
- package/dist/third-party.js +2 -40
- package/dist/third-party.js.map +1 -1
- package/dist/third-party.mjs +3 -41
- package/dist/tokens.css +45 -71
- package/dist/utilities.js +2 -4
- package/dist/utilities.js.map +1 -1
- package/dist/utilities.mjs +2 -4
- package/package.json +23 -9
- package/dist/WorkflowNode-BnxXO6t_.d.mts +0 -46
- package/dist/WorkflowNode-BnxXO6t_.d.ts +0 -46
- package/dist/chunk-27JEWSWA.mjs +0 -233
- package/dist/chunk-27JEWSWA.mjs.map +0 -1
- package/dist/chunk-3WCMINE5.mjs.map +0 -1
- package/dist/chunk-463SRKKD.js.map +0 -1
- package/dist/chunk-6EUAU67C.mjs.map +0 -1
- package/dist/chunk-AIY6222Q.js +0 -11
- package/dist/chunk-AIY6222Q.js.map +0 -1
- package/dist/chunk-AJBM7IE6.mjs +0 -2366
- package/dist/chunk-AJBM7IE6.mjs.map +0 -1
- package/dist/chunk-CCN6M4LI.js.map +0 -1
- package/dist/chunk-CUCKULYC.mjs.map +0 -1
- package/dist/chunk-CWJ4OU6W.mjs.map +0 -1
- package/dist/chunk-EOF3QNPF.js.map +0 -1
- package/dist/chunk-FFZ5S7PQ.mjs.map +0 -1
- package/dist/chunk-FN5YL4BK.js.map +0 -1
- package/dist/chunk-HLH2VWXL.js +0 -2658
- package/dist/chunk-HLH2VWXL.js.map +0 -1
- package/dist/chunk-IE6GCHDI.mjs.map +0 -1
- package/dist/chunk-JS4IB5IU.mjs.map +0 -1
- package/dist/chunk-KF2Y7HO3.js.map +0 -1
- package/dist/chunk-KVBMZNWT.mjs.map +0 -1
- package/dist/chunk-L2TIGA7I.js.map +0 -1
- package/dist/chunk-MNM6HE72.js.map +0 -1
- package/dist/chunk-NXTVJ6PY.js.map +0 -1
- package/dist/chunk-PWF2NJDB.mjs.map +0 -1
- package/dist/chunk-QD6RLAO2.mjs +0 -11
- package/dist/chunk-QD6RLAO2.mjs.map +0 -1
- package/dist/chunk-QY65OUAC.mjs.map +0 -1
- package/dist/chunk-QYYQYZHV.js.map +0 -1
- package/dist/chunk-T7LPABOL.mjs +0 -595
- package/dist/chunk-T7LPABOL.mjs.map +0 -1
- package/dist/chunk-THQKYTQE.js.map +0 -1
- package/dist/chunk-X7E6GMFL.js +0 -233
- package/dist/chunk-X7E6GMFL.js.map +0 -1
- package/dist/chunk-XF66WQZE.mjs +0 -1535
- package/dist/chunk-XF66WQZE.mjs.map +0 -1
- package/dist/chunk-YQOZPLTY.js +0 -1535
- package/dist/chunk-YQOZPLTY.js.map +0 -1
- package/dist/chunk-ZGCN5WCG.js.map +0 -1
- package/dist/index.css +0 -79
- package/dist/index.css.map +0 -1
- /package/dist/{HumanSans-Black-C4YJONK7.otf → fonts/HumanSans-Black.otf} +0 -0
- /package/dist/{HumanSans-Bold-4EAJ3L3T.otf → fonts/HumanSans-Bold.otf} +0 -0
- /package/dist/{HumanSans-BoldOblique-4D325T4F.otf → fonts/HumanSans-BoldOblique.otf} +0 -0
- /package/dist/{HumanSans-ExtraLight-VL7DEKQ4.otf → fonts/HumanSans-ExtraLight.otf} +0 -0
- /package/dist/{HumanSans-ExtraLightOblique-VK2JTUXF.otf → fonts/HumanSans-ExtraLightOblique.otf} +0 -0
- /package/dist/{HumanSans-Light-YV7AFKRB.otf → fonts/HumanSans-Light.otf} +0 -0
- /package/dist/{HumanSans-LightOblique-VIXV7QA6.otf → fonts/HumanSans-LightOblique.otf} +0 -0
- /package/dist/{HumanSans-Medium-UULJ3PIR.otf → fonts/HumanSans-Medium.otf} +0 -0
- /package/dist/{HumanSans-MediumOblique-M7FHDZRS.otf → fonts/HumanSans-MediumOblique.otf} +0 -0
- /package/dist/{HumanSans-Regular-QMFEP3F6.otf → fonts/HumanSans-Regular.otf} +0 -0
- /package/dist/{HumanSans-RegularOblique-YPKQJAAM.otf → fonts/HumanSans-RegularOblique.otf} +0 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/components/third-party/CodeEditor.tsx
|
|
2
|
+
var _react = require('react');
|
|
3
|
+
var _react3 = require('@monaco-editor/react'); var _react4 = _interopRequireDefault(_react3);
|
|
4
|
+
var _Box = require('@mui/material/Box'); var _Box2 = _interopRequireDefault(_Box);
|
|
5
|
+
var _IconButton = require('@mui/material/IconButton'); var _IconButton2 = _interopRequireDefault(_IconButton);
|
|
6
|
+
var _Tooltip = require('@mui/material/Tooltip'); var _Tooltip2 = _interopRequireDefault(_Tooltip);
|
|
7
|
+
var _Fullscreen = require('@mui/icons-material/Fullscreen'); var _Fullscreen2 = _interopRequireDefault(_Fullscreen);
|
|
8
|
+
var _FullscreenExit = require('@mui/icons-material/FullscreenExit'); var _FullscreenExit2 = _interopRequireDefault(_FullscreenExit);
|
|
9
|
+
var _ErrorOutline = require('@mui/icons-material/ErrorOutline'); var _ErrorOutline2 = _interopRequireDefault(_ErrorOutline);
|
|
10
|
+
var _ExpandMore = require('@mui/icons-material/ExpandMore'); var _ExpandMore2 = _interopRequireDefault(_ExpandMore);
|
|
11
|
+
var _ExpandLess = require('@mui/icons-material/ExpandLess'); var _ExpandLess2 = _interopRequireDefault(_ExpandLess);
|
|
12
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
13
|
+
var configureTypeScript = (monaco) => {
|
|
14
|
+
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
15
|
+
target: monaco.languages.typescript.ScriptTarget.ES2020,
|
|
16
|
+
allowNonTsExtensions: true,
|
|
17
|
+
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
|
|
18
|
+
module: monaco.languages.typescript.ModuleKind.ESNext,
|
|
19
|
+
noEmit: false,
|
|
20
|
+
lib: ["es2020", "dom"],
|
|
21
|
+
noUnusedLocals: false,
|
|
22
|
+
noUnusedParameters: false,
|
|
23
|
+
noImplicitAny: false,
|
|
24
|
+
noImplicitReturns: false,
|
|
25
|
+
noFallthroughCasesInSwitch: false,
|
|
26
|
+
// Treat every file as a module so top-level declarations don't clash
|
|
27
|
+
// across files in the workspace (prevents false "Cannot redeclare" errors).
|
|
28
|
+
moduleDetection: 3
|
|
29
|
+
// ts.ModuleDetectionKind.Force
|
|
30
|
+
});
|
|
31
|
+
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
32
|
+
noSemanticValidation: false,
|
|
33
|
+
noSyntaxValidation: false,
|
|
34
|
+
noSuggestionDiagnostics: true,
|
|
35
|
+
diagnosticCodesToIgnore: [
|
|
36
|
+
6133,
|
|
37
|
+
// 'x' is declared but its value is never read
|
|
38
|
+
6196
|
|
39
|
+
// 'x' is declared but its value is never read (different variant)
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var CodeEditor = ({
|
|
44
|
+
value,
|
|
45
|
+
onChange,
|
|
46
|
+
language = "typescript",
|
|
47
|
+
height = "400px",
|
|
48
|
+
minHeight,
|
|
49
|
+
theme: themeProp,
|
|
50
|
+
lineNumbers = "on",
|
|
51
|
+
options,
|
|
52
|
+
onMount,
|
|
53
|
+
onValidate,
|
|
54
|
+
editorRef,
|
|
55
|
+
monacoRef,
|
|
56
|
+
onFullscreenChange,
|
|
57
|
+
containerProps,
|
|
58
|
+
typeDefinitions,
|
|
59
|
+
externalModelManagement = false
|
|
60
|
+
}) => {
|
|
61
|
+
const [isEditorReady, setIsEditorReady] = _react.useState.call(void 0, false);
|
|
62
|
+
const [validationErrors, setValidationErrors] = _react.useState.call(void 0, []);
|
|
63
|
+
const [isFullscreen, setIsFullscreen] = _react.useState.call(void 0, false);
|
|
64
|
+
const [tsCode, setTsCode] = _react.useState.call(void 0, value);
|
|
65
|
+
const [actualHeight, setActualHeight] = _react.useState.call(void 0,
|
|
66
|
+
typeof height === "number" ? `${height}px` : height
|
|
67
|
+
);
|
|
68
|
+
const [showProblems, setShowProblems] = _react.useState.call(void 0, false);
|
|
69
|
+
const [hasUserToggledProblems, setHasUserToggledProblems] = _react.useState.call(void 0, false);
|
|
70
|
+
_react.useEffect.call(void 0, () => {
|
|
71
|
+
if (hasUserToggledProblems) return;
|
|
72
|
+
if (validationErrors.length > 0) {
|
|
73
|
+
setShowProblems(true);
|
|
74
|
+
} else {
|
|
75
|
+
setShowProblems(false);
|
|
76
|
+
}
|
|
77
|
+
}, [validationErrors, hasUserToggledProblems]);
|
|
78
|
+
const internalEditorRef = _react.useRef.call(void 0, null);
|
|
79
|
+
const internalMonacoRef = _react.useRef.call(void 0, null);
|
|
80
|
+
const finalEditorRef = editorRef || internalEditorRef;
|
|
81
|
+
const finalMonacoRef = monacoRef || internalMonacoRef;
|
|
82
|
+
_react.useEffect.call(void 0, () => {
|
|
83
|
+
if (isFullscreen) {
|
|
84
|
+
setActualHeight("calc(100vh - 80px)");
|
|
85
|
+
} else {
|
|
86
|
+
setActualHeight(typeof height === "number" ? `${height}px` : height);
|
|
87
|
+
}
|
|
88
|
+
}, [height, isFullscreen]);
|
|
89
|
+
const toggleFullscreen = _react.useCallback.call(void 0, () => {
|
|
90
|
+
const newFullscreenState = !isFullscreen;
|
|
91
|
+
setIsFullscreen(newFullscreenState);
|
|
92
|
+
if (onFullscreenChange) {
|
|
93
|
+
onFullscreenChange(newFullscreenState);
|
|
94
|
+
}
|
|
95
|
+
}, [isFullscreen, onFullscreenChange]);
|
|
96
|
+
const gotoMarker = _react.useCallback.call(void 0,
|
|
97
|
+
(marker) => {
|
|
98
|
+
const ed = _optionalChain([finalEditorRef, 'optionalAccess', _ => _.current]);
|
|
99
|
+
if (!ed) return;
|
|
100
|
+
const position = { lineNumber: marker.startLineNumber, column: marker.startColumn || 1 };
|
|
101
|
+
try {
|
|
102
|
+
ed.revealPositionInCenter(position);
|
|
103
|
+
ed.setPosition(position);
|
|
104
|
+
ed.focus();
|
|
105
|
+
} catch (e) {
|
|
106
|
+
console.error("CodeEditor: Failed to navigate to marker", e);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
[finalEditorRef]
|
|
110
|
+
);
|
|
111
|
+
_react.useEffect.call(void 0, () => {
|
|
112
|
+
if (!isFullscreen) return;
|
|
113
|
+
function escapeHandler(event) {
|
|
114
|
+
if (event.key === "Escape") {
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
setIsFullscreen(false);
|
|
118
|
+
if (onFullscreenChange) {
|
|
119
|
+
onFullscreenChange(false);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
window.addEventListener("keydown", escapeHandler, { capture: true });
|
|
124
|
+
return () => {
|
|
125
|
+
window.removeEventListener("keydown", escapeHandler, { capture: true });
|
|
126
|
+
};
|
|
127
|
+
}, [isFullscreen, onFullscreenChange]);
|
|
128
|
+
const handleEditorDidMount = _react.useCallback.call(void 0,
|
|
129
|
+
(editor, monaco) => {
|
|
130
|
+
console.log("CodeEditor: onMount called", { editor: !!editor, monaco: !!monaco });
|
|
131
|
+
try {
|
|
132
|
+
configureTypeScript(monaco);
|
|
133
|
+
} catch (e) {
|
|
134
|
+
console.error("CodeEditor: Failed to configure TypeScript", e);
|
|
135
|
+
}
|
|
136
|
+
if (finalEditorRef) {
|
|
137
|
+
finalEditorRef.current = editor;
|
|
138
|
+
}
|
|
139
|
+
if (finalMonacoRef) {
|
|
140
|
+
finalMonacoRef.current = monaco;
|
|
141
|
+
}
|
|
142
|
+
setIsEditorReady(true);
|
|
143
|
+
console.log("CodeEditor: Editor ready");
|
|
144
|
+
try {
|
|
145
|
+
editor.addCommand(monaco.KeyCode.Escape, () => {
|
|
146
|
+
if (isFullscreen) {
|
|
147
|
+
setIsFullscreen(false);
|
|
148
|
+
if (onFullscreenChange) {
|
|
149
|
+
onFullscreenChange(false);
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
return false;
|
|
154
|
+
});
|
|
155
|
+
editor.onDidChangeModelDecorations(() => {
|
|
156
|
+
const model2 = editor.getModel();
|
|
157
|
+
if (model2 && onValidate) {
|
|
158
|
+
const markers = monaco.editor.getModelMarkers({ resource: model2.uri });
|
|
159
|
+
onValidate(markers);
|
|
160
|
+
setValidationErrors(markers);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const model = editor.getModel();
|
|
164
|
+
if (model && onValidate) {
|
|
165
|
+
const markers = monaco.editor.getModelMarkers({ resource: model.uri });
|
|
166
|
+
onValidate(markers);
|
|
167
|
+
setValidationErrors(markers);
|
|
168
|
+
}
|
|
169
|
+
} catch (e) {
|
|
170
|
+
console.error("CodeEditor: Error setting up editor callbacks", e);
|
|
171
|
+
}
|
|
172
|
+
if (onMount) {
|
|
173
|
+
try {
|
|
174
|
+
onMount(editor, monaco);
|
|
175
|
+
} catch (e) {
|
|
176
|
+
console.error("CodeEditor: Error in custom onMount", e);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
[isFullscreen, onFullscreenChange, onValidate, onMount, finalEditorRef, finalMonacoRef]
|
|
181
|
+
);
|
|
182
|
+
_react.useEffect.call(void 0, () => {
|
|
183
|
+
if (!isEditorReady || !_optionalChain([finalMonacoRef, 'optionalAccess', _2 => _2.current]) || !typeDefinitions) return;
|
|
184
|
+
const monaco = finalMonacoRef.current;
|
|
185
|
+
const definitions = Array.isArray(typeDefinitions) ? typeDefinitions : [typeDefinitions];
|
|
186
|
+
const uris = [];
|
|
187
|
+
try {
|
|
188
|
+
definitions.forEach((def, index) => {
|
|
189
|
+
if (def && def.trim()) {
|
|
190
|
+
const uri = `ts:filename/custom-types-${index}.d.ts`;
|
|
191
|
+
uris.push(uri);
|
|
192
|
+
monaco.languages.typescript.typescriptDefaults.addExtraLib(def, uri);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
} catch (error) {
|
|
196
|
+
console.error("CodeEditor: Error adding type definitions:", error);
|
|
197
|
+
}
|
|
198
|
+
}, [isEditorReady, finalMonacoRef, typeDefinitions]);
|
|
199
|
+
const handleCodeChange = (newValue) => {
|
|
200
|
+
const valueStr = newValue || "";
|
|
201
|
+
setTsCode(valueStr);
|
|
202
|
+
onChange(valueStr);
|
|
203
|
+
};
|
|
204
|
+
_react.useEffect.call(void 0, () => {
|
|
205
|
+
if (externalModelManagement) return;
|
|
206
|
+
if (value !== tsCode) {
|
|
207
|
+
setTsCode(value);
|
|
208
|
+
if (isEditorReady && _optionalChain([finalEditorRef, 'optionalAccess', _3 => _3.current])) {
|
|
209
|
+
const editor = finalEditorRef.current;
|
|
210
|
+
const currentValue = editor.getValue();
|
|
211
|
+
if (currentValue !== value) {
|
|
212
|
+
editor.setValue(value);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}, [value, tsCode, isEditorReady, finalEditorRef, externalModelManagement]);
|
|
217
|
+
const editorMinHeight = minHeight ? typeof minHeight === "number" ? `${minHeight}px` : minHeight : "400px";
|
|
218
|
+
const defaultOptions = {
|
|
219
|
+
lineNumbers,
|
|
220
|
+
minimap: { enabled: false },
|
|
221
|
+
readOnly: false,
|
|
222
|
+
wordWrap: "on",
|
|
223
|
+
fontSize: 14,
|
|
224
|
+
fontFamily: 'Monaco, Menlo, "Ubuntu Mono", Consolas, "source-code-pro", monospace',
|
|
225
|
+
automaticLayout: true,
|
|
226
|
+
scrollBeyondLastLine: false,
|
|
227
|
+
theme: themeProp || "vs",
|
|
228
|
+
...options
|
|
229
|
+
};
|
|
230
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
231
|
+
_Box2.default,
|
|
232
|
+
{
|
|
233
|
+
sx: {
|
|
234
|
+
display: "flex",
|
|
235
|
+
flexDirection: "column",
|
|
236
|
+
height: isFullscreen ? "100vh" : "100%",
|
|
237
|
+
minHeight: isFullscreen ? "100vh" : editorMinHeight,
|
|
238
|
+
position: isFullscreen ? "fixed" : "relative",
|
|
239
|
+
top: isFullscreen ? 0 : "auto",
|
|
240
|
+
left: isFullscreen ? 0 : "auto",
|
|
241
|
+
right: isFullscreen ? 0 : "auto",
|
|
242
|
+
bottom: isFullscreen ? 0 : "auto",
|
|
243
|
+
zIndex: isFullscreen ? 9999 : "auto",
|
|
244
|
+
bgcolor: "background.paper",
|
|
245
|
+
pt: isFullscreen ? "80px" : 0,
|
|
246
|
+
// Add padding top in fullscreen to account for header (64px) + spacing (16px)
|
|
247
|
+
px: isFullscreen ? 2 : 0,
|
|
248
|
+
pb: isFullscreen ? 2 : 0,
|
|
249
|
+
overflow: isFullscreen ? "hidden" : "visible"
|
|
250
|
+
},
|
|
251
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
252
|
+
_Box2.default,
|
|
253
|
+
{
|
|
254
|
+
sx: {
|
|
255
|
+
flex: 1,
|
|
256
|
+
border: 1,
|
|
257
|
+
borderColor: validationErrors.length > 0 ? "error.main" : "divider",
|
|
258
|
+
borderRadius: 1,
|
|
259
|
+
minHeight: editorMinHeight,
|
|
260
|
+
overflow: "hidden",
|
|
261
|
+
position: "relative",
|
|
262
|
+
display: "flex",
|
|
263
|
+
flexDirection: "column"
|
|
264
|
+
},
|
|
265
|
+
...containerProps,
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Tooltip2.default, { title: isFullscreen ? "Exit Fullscreen" : "Fullscreen", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
268
|
+
_IconButton2.default,
|
|
269
|
+
{
|
|
270
|
+
onClick: toggleFullscreen,
|
|
271
|
+
size: "small",
|
|
272
|
+
sx: {
|
|
273
|
+
position: isFullscreen ? "fixed" : "absolute",
|
|
274
|
+
top: isFullscreen ? 72 : 8,
|
|
275
|
+
// Position below header in fullscreen mode (header is ~64px)
|
|
276
|
+
right: isFullscreen ? 16 : 8,
|
|
277
|
+
zIndex: 1e4,
|
|
278
|
+
// Ensure it's above other elements
|
|
279
|
+
bgcolor: "rgba(255, 255, 255, 0.7)",
|
|
280
|
+
"&:hover": {
|
|
281
|
+
bgcolor: "rgba(255, 255, 255, 0.9)"
|
|
282
|
+
},
|
|
283
|
+
boxShadow: 1
|
|
284
|
+
},
|
|
285
|
+
children: isFullscreen ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FullscreenExit2.default, { fontSize: "small" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Fullscreen2.default, { fontSize: "small" })
|
|
286
|
+
}
|
|
287
|
+
) }),
|
|
288
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
289
|
+
_Box2.default,
|
|
290
|
+
{
|
|
291
|
+
sx: {
|
|
292
|
+
flex: 1,
|
|
293
|
+
display: "flex",
|
|
294
|
+
flexDirection: "column",
|
|
295
|
+
overflow: "hidden",
|
|
296
|
+
minHeight: editorMinHeight,
|
|
297
|
+
position: "relative",
|
|
298
|
+
height: isFullscreen ? "100%" : actualHeight
|
|
299
|
+
},
|
|
300
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
301
|
+
_react4.default,
|
|
302
|
+
{
|
|
303
|
+
height: "100%",
|
|
304
|
+
defaultLanguage: language,
|
|
305
|
+
defaultValue: value,
|
|
306
|
+
value: tsCode,
|
|
307
|
+
onChange: handleCodeChange,
|
|
308
|
+
onMount: handleEditorDidMount,
|
|
309
|
+
theme: themeProp || "vs",
|
|
310
|
+
options: defaultOptions,
|
|
311
|
+
loading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Box2.default, { sx: { p: 2, textAlign: "center" }, children: "Loading Monaco Editor..." }),
|
|
312
|
+
beforeMount: (monaco) => {
|
|
313
|
+
console.log("CodeEditor: beforeMount called", { monaco: !!monaco });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
)
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
validationErrors.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
320
|
+
_Box2.default,
|
|
321
|
+
{
|
|
322
|
+
sx: {
|
|
323
|
+
borderTop: 1,
|
|
324
|
+
borderColor: "divider",
|
|
325
|
+
bgcolor: "background.default",
|
|
326
|
+
display: "flex",
|
|
327
|
+
flexDirection: "column",
|
|
328
|
+
maxHeight: showProblems ? 180 : 40,
|
|
329
|
+
minHeight: 40,
|
|
330
|
+
transition: "max-height 0.2s ease"
|
|
331
|
+
},
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
334
|
+
_Box2.default,
|
|
335
|
+
{
|
|
336
|
+
sx: {
|
|
337
|
+
display: "flex",
|
|
338
|
+
alignItems: "center",
|
|
339
|
+
px: 1,
|
|
340
|
+
py: 0.5,
|
|
341
|
+
gap: 1,
|
|
342
|
+
borderBottom: showProblems ? "1px solid" : "none",
|
|
343
|
+
borderColor: "divider",
|
|
344
|
+
fontSize: "0.875rem",
|
|
345
|
+
color: "text.secondary"
|
|
346
|
+
},
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ErrorOutline2.default, { color: "error", fontSize: "small" }),
|
|
349
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Box2.default, { sx: { fontWeight: 600, color: "text.primary" }, children: "Problems" }),
|
|
350
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _Box2.default, { sx: { ml: 1 }, children: [
|
|
351
|
+
validationErrors.length,
|
|
352
|
+
" error",
|
|
353
|
+
validationErrors.length > 1 ? "s" : ""
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Box2.default, { sx: { flex: 1 } }),
|
|
356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
357
|
+
_IconButton2.default,
|
|
358
|
+
{
|
|
359
|
+
size: "small",
|
|
360
|
+
"aria-label": "Toggle problems panel",
|
|
361
|
+
onClick: () => {
|
|
362
|
+
setHasUserToggledProblems(true);
|
|
363
|
+
setShowProblems((s) => !s);
|
|
364
|
+
},
|
|
365
|
+
children: showProblems ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ExpandMore2.default, { fontSize: "small" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ExpandLess2.default, { fontSize: "small" })
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
showProblems && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Box2.default, { sx: { overflow: "auto" }, children: validationErrors.map((error, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
372
|
+
_Box2.default,
|
|
373
|
+
{
|
|
374
|
+
onClick: () => gotoMarker(error),
|
|
375
|
+
sx: {
|
|
376
|
+
display: "flex",
|
|
377
|
+
alignItems: "center",
|
|
378
|
+
px: 1.5,
|
|
379
|
+
py: 0.75,
|
|
380
|
+
gap: 1,
|
|
381
|
+
cursor: "pointer",
|
|
382
|
+
"&:hover": { bgcolor: "action.hover" },
|
|
383
|
+
borderBottom: "1px dashed",
|
|
384
|
+
borderColor: "divider",
|
|
385
|
+
fontSize: "0.85rem"
|
|
386
|
+
},
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ErrorOutline2.default, { color: "error", sx: { fontSize: 18 } }),
|
|
389
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _Box2.default, { sx: { color: "text.secondary", width: 64 }, children: [
|
|
390
|
+
"Line ",
|
|
391
|
+
error.startLineNumber
|
|
392
|
+
] }),
|
|
393
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Box2.default, { sx: { color: "text.primary", flex: 1, minWidth: 0 }, children: error.message })
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
`${error.startLineNumber}-${error.startColumn}-${index}`
|
|
397
|
+
)) })
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
)
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
)
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
exports.CodeEditor = CodeEditor;
|
|
411
|
+
//# sourceMappingURL=chunk-YCDCQSYH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cere-design-system/cere-design-system/dist/chunk-YCDCQSYH.js","../src/components/third-party/CodeEditor.tsx"],"names":[],"mappings":"AAAA;ACAA,8BAAgE;AAChE,6FAA+B;AAC/B,kFAAgB;AAEhB,8GAAuB;AACvB,kGAAoB;AACpB,oHAA2B;AAC3B,oIAA+B;AAC/B,4HAA6B;AAC7B,oHAA2B;AAC3B,oHAA2B;AA2bb,+CAAA;AA5UP,IAAM,oBAAA,EAAsB,CAAC,MAAA,EAAA,GAAmB;AAErD,EAAA,MAAA,CAAO,SAAA,CAAU,UAAA,CAAW,kBAAA,CAAmB,kBAAA,CAAmB;AAAA,IAChE,MAAA,EAAQ,MAAA,CAAO,SAAA,CAAU,UAAA,CAAW,YAAA,CAAa,MAAA;AAAA,IACjD,oBAAA,EAAsB,IAAA;AAAA,IACtB,gBAAA,EAAkB,MAAA,CAAO,SAAA,CAAU,UAAA,CAAW,oBAAA,CAAqB,MAAA;AAAA,IACnE,MAAA,EAAQ,MAAA,CAAO,SAAA,CAAU,UAAA,CAAW,UAAA,CAAW,MAAA;AAAA,IAC/C,MAAA,EAAQ,KAAA;AAAA,IACR,GAAA,EAAK,CAAC,QAAA,EAAU,KAAK,CAAA;AAAA,IACrB,cAAA,EAAgB,KAAA;AAAA,IAChB,kBAAA,EAAoB,KAAA;AAAA,IACpB,aAAA,EAAe,KAAA;AAAA,IACf,iBAAA,E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wBAAA;AACA,wBAAA;AACA,wBAAA;AACU,wBAAA;AACZ,sBAAA;AAEA,sBAAA;AAAA,wCAAA;AACA,wCAAA;AAAiD,0BAAA;AAAY,0BAAA;AAAgB,wBAAA;AAC7E,wCAAA;AAEA,sBAAA;AAAA,oBAAA;AAnBc,oBAAA;AAsBpB,kBAAA;AAAA,gBAAA;AAAA,cAAA;AAEJ,YAAA;AAAA,UAAA;AAAA,QAAA;AAEJ,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;ADpKkC;AACA;AACA;AACA","file":"/home/runner/work/cere-design-system/cere-design-system/dist/chunk-YCDCQSYH.js","sourcesContent":[null,"import React, { useCallback, useEffect, useState, useRef } from 'react';\nimport Editor, { Monaco } from '@monaco-editor/react';\nimport Box from '@mui/material/Box';\nimport type { BoxProps } from '@mui/material/Box';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport FullscreenIcon from '@mui/icons-material/Fullscreen';\nimport FullscreenExitIcon from '@mui/icons-material/FullscreenExit';\nimport ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\nimport ExpandLessIcon from '@mui/icons-material/ExpandLess';\nimport type { editor } from 'monaco-editor';\n\nexport type CodeEditorLanguage =\n | 'typescript'\n | 'javascript'\n | 'json'\n | 'html'\n | 'css'\n | 'python'\n | 'yaml'\n | 'markdown'\n | 'sql'\n | 'xml'\n | 'plaintext';\n\nexport interface CodeEditorProps {\n /**\n * Current value of the editor\n */\n value: string;\n /**\n * Callback when value changes\n */\n onChange: (value: string) => void;\n /**\n * Programming language\n * @default 'typescript'\n */\n language?: CodeEditorLanguage;\n /**\n * Height of the editor\n * @default '400px'\n */\n height?: string | number;\n /**\n * Minimum height\n */\n minHeight?: string | number;\n /**\n * Theme ('light' | 'dark' | 'vs-dark' | 'hc-black')\n * If not provided, will use theme from design system\n */\n theme?: string;\n /**\n * Show line numbers\n * @default 'on'\n */\n lineNumbers?: 'on' | 'off' | 'relative' | 'interval';\n /**\n * Editor options (monaco editor options)\n */\n options?: editor.IStandaloneEditorConstructionOptions;\n /**\n * Callback when editor is mounted\n */\n onMount?: (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void;\n /**\n * Callback for validation errors\n */\n onValidate?: (markers: editor.IMarker[]) => void;\n /**\n * Ref to editor instance\n */\n editorRef?: React.MutableRefObject<editor.IStandaloneCodeEditor | null>;\n /**\n * Ref to Monaco instance\n */\n monacoRef?: React.MutableRefObject<Monaco | null>;\n /**\n * Callback when fullscreen state changes\n */\n onFullscreenChange?: (isFullscreen: boolean) => void;\n /**\n * Props for the container Box.\n */\n containerProps?: BoxProps;\n /**\n * Additional TypeScript type definitions to add to the editor context.\n * Can be a string with type definitions or an array of type definition strings.\n * Each string will be added as a separate extra lib to Monaco.\n *\n * @example\n * ```tsx\n * <CodeEditor\n * value={code}\n * onChange={setCode}\n * typeDefinitions={`\n * declare interface MyCustomType {\n * id: string;\n * name: string;\n * }\n * `}\n * />\n * ```\n */\n typeDefinitions?: string | string[];\n /**\n * When true, the editor skips internal value syncing and lets an external\n * source (e.g. useCodeEditorWorkspace) manage Monaco models directly.\n * The `value` prop is still used as the initial/display value but won't\n * be force-synced to the editor.\n * @default false\n */\n externalModelManagement?: boolean;\n}\n\n// Monaco Editor will use the local version from node_modules automatically\n// No need to configure loader.config() - @monaco-editor/react handles it\n\n// Configure TypeScript settings when Monaco is loaded\nexport const configureTypeScript = (monaco: Monaco) => {\n // Configure TypeScript settings\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n target: monaco.languages.typescript.ScriptTarget.ES2020,\n allowNonTsExtensions: true,\n moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,\n module: monaco.languages.typescript.ModuleKind.ESNext,\n noEmit: false,\n lib: ['es2020', 'dom'],\n noUnusedLocals: false,\n noUnusedParameters: false,\n noImplicitAny: false,\n noImplicitReturns: false,\n noFallthroughCasesInSwitch: false,\n // Treat every file as a module so top-level declarations don't clash\n // across files in the workspace (prevents false \"Cannot redeclare\" errors).\n moduleDetection: 3, // ts.ModuleDetectionKind.Force\n });\n\n monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: false,\n noSyntaxValidation: false,\n noSuggestionDiagnostics: true,\n diagnosticCodesToIgnore: [\n 6133, // 'x' is declared but its value is never read\n 6196, // 'x' is declared but its value is never read (different variant)\n ],\n });\n};\n\n/**\n * CodeEditor component - wrapper around Monaco Editor matching dynamic-indexer-client implementation\n *\n * @example\n * ```tsx\n * <CodeEditor\n * value={code}\n * onChange={setCode}\n * language=\"typescript\"\n * height=\"500px\"\n * onValidate={(markers) => console.log('Errors:', markers)}\n * />\n * ```\n */\nexport const CodeEditor: React.FC<CodeEditorProps> = ({\n value,\n onChange,\n language = 'typescript',\n height = '400px',\n minHeight,\n theme: themeProp,\n lineNumbers = 'on',\n options,\n onMount,\n onValidate,\n editorRef,\n monacoRef,\n onFullscreenChange,\n containerProps,\n typeDefinitions,\n externalModelManagement = false,\n}) => {\n const [isEditorReady, setIsEditorReady] = useState(false);\n const [validationErrors, setValidationErrors] = useState<editor.IMarker[]>([]);\n const [isFullscreen, setIsFullscreen] = useState(false);\n const [tsCode, setTsCode] = useState<string>(value);\n const [actualHeight, setActualHeight] = useState<string>(\n typeof height === 'number' ? `${height}px` : height\n );\n const [showProblems, setShowProblems] = useState(false);\n const [hasUserToggledProblems, setHasUserToggledProblems] = useState(false);\n\n // Auto-open the Problems panel only until the user manually toggles it.\n useEffect(() => {\n if (hasUserToggledProblems) return; // respect user's choice after first toggle\n if (validationErrors.length > 0) {\n setShowProblems(true);\n } else {\n setShowProblems(false);\n }\n }, [validationErrors, hasUserToggledProblems]);\n\n const internalEditorRef = useRef<editor.IStandaloneCodeEditor | null>(null);\n const internalMonacoRef = useRef<Monaco | null>(null);\n\n // Use provided refs or internal refs\n const finalEditorRef = editorRef || internalEditorRef;\n const finalMonacoRef = monacoRef || internalMonacoRef;\n\n useEffect(() => {\n if (isFullscreen) {\n // Account for header height (64px) + padding (16px) = 80px\n setActualHeight('calc(100vh - 80px)');\n } else {\n setActualHeight(typeof height === 'number' ? `${height}px` : height);\n }\n }, [height, isFullscreen]);\n\n // Toggle fullscreen\n const toggleFullscreen = useCallback(() => {\n const newFullscreenState = !isFullscreen;\n setIsFullscreen(newFullscreenState);\n if (onFullscreenChange) {\n onFullscreenChange(newFullscreenState);\n }\n }, [isFullscreen, onFullscreenChange]);\n\n // Jump to a marker position in the editor\n const gotoMarker = useCallback(\n (marker: editor.IMarker) => {\n const ed = finalEditorRef?.current;\n if (!ed) return;\n const position = { lineNumber: marker.startLineNumber, column: marker.startColumn || 1 };\n try {\n ed.revealPositionInCenter(position);\n ed.setPosition(position);\n ed.focus();\n } catch (e) {\n console.error('CodeEditor: Failed to navigate to marker', e);\n }\n },\n [finalEditorRef]\n );\n\n // Handle ESC key for fullscreen exit\n useEffect(() => {\n if (!isFullscreen) return;\n\n function escapeHandler(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n\n setIsFullscreen(false);\n if (onFullscreenChange) {\n onFullscreenChange(false);\n }\n }\n }\n\n window.addEventListener('keydown', escapeHandler, { capture: true });\n\n return () => {\n window.removeEventListener('keydown', escapeHandler, { capture: true });\n };\n }, [isFullscreen, onFullscreenChange]);\n\n const handleEditorDidMount = useCallback(\n (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => {\n console.log('CodeEditor: onMount called', { editor: !!editor, monaco: !!monaco });\n\n try {\n // Configure TypeScript settings when Monaco is loaded\n configureTypeScript(monaco);\n } catch (e) {\n console.error('CodeEditor: Failed to configure TypeScript', e);\n }\n\n if (finalEditorRef) {\n finalEditorRef.current = editor;\n }\n if (finalMonacoRef) {\n finalMonacoRef.current = monaco;\n }\n\n setIsEditorReady(true);\n console.log('CodeEditor: Editor ready');\n\n try {\n // Add ESC key binding directly in editor\n editor.addCommand(monaco.KeyCode.Escape, () => {\n if (isFullscreen) {\n setIsFullscreen(false);\n if (onFullscreenChange) {\n onFullscreenChange(false);\n }\n return true; // Command handled\n }\n return false; // Let default behavior work when not fullscreen\n });\n\n // Add validation callback\n editor.onDidChangeModelDecorations(() => {\n const model = editor.getModel();\n if (model && onValidate) {\n const markers = monaco.editor.getModelMarkers({ resource: model.uri });\n onValidate(markers);\n setValidationErrors(markers);\n }\n });\n\n // Also check initial markers\n const model = editor.getModel();\n if (model && onValidate) {\n const markers = monaco.editor.getModelMarkers({ resource: model.uri });\n onValidate(markers);\n setValidationErrors(markers);\n }\n } catch (e) {\n console.error('CodeEditor: Error setting up editor callbacks', e);\n }\n\n // Call custom onMount if provided\n if (onMount) {\n try {\n onMount(editor, monaco);\n } catch (e) {\n console.error('CodeEditor: Error in custom onMount', e);\n }\n }\n },\n [isFullscreen, onFullscreenChange, onValidate, onMount, finalEditorRef, finalMonacoRef]\n );\n\n // Add custom type definitions when Monaco is ready and typeDefinitions change\n useEffect(() => {\n if (!isEditorReady || !finalMonacoRef?.current || !typeDefinitions) return;\n\n const monaco = finalMonacoRef.current;\n const definitions = Array.isArray(typeDefinitions) ? typeDefinitions : [typeDefinitions];\n const uris: string[] = [];\n\n try {\n // Add each type definition as a separate extra lib\n definitions.forEach((def: string, index: number) => {\n if (def && def.trim()) {\n const uri = `ts:filename/custom-types-${index}.d.ts`;\n uris.push(uri);\n monaco.languages.typescript.typescriptDefaults.addExtraLib(def, uri);\n }\n });\n } catch (error) {\n console.error('CodeEditor: Error adding type definitions:', error);\n }\n\n // Note: Monaco doesn't have a direct removeExtraLib method\n // The definitions will be replaced when the component updates with new definitions\n // This is acceptable as extra libs are additive and don't cause conflicts\n }, [isEditorReady, finalMonacoRef, typeDefinitions]);\n\n const handleCodeChange = (newValue: string | undefined) => {\n const valueStr = newValue || '';\n setTsCode(valueStr);\n onChange(valueStr);\n };\n\n // Sync external value prop with internal state\n // Skip when externalModelManagement is true (workspace hook manages models)\n useEffect(() => {\n if (externalModelManagement) return;\n if (value !== tsCode) {\n setTsCode(value);\n if (isEditorReady && finalEditorRef?.current) {\n const editor = finalEditorRef.current;\n const currentValue = editor.getValue();\n if (currentValue !== value) {\n editor.setValue(value);\n }\n }\n }\n }, [value, tsCode, isEditorReady, finalEditorRef, externalModelManagement]);\n\n const editorMinHeight = minHeight\n ? typeof minHeight === 'number'\n ? `${minHeight}px`\n : minHeight\n : '400px';\n\n const defaultOptions: editor.IStandaloneEditorConstructionOptions = {\n lineNumbers,\n minimap: { enabled: false },\n readOnly: false,\n wordWrap: 'on',\n fontSize: 14,\n fontFamily: 'Monaco, Menlo, \"Ubuntu Mono\", Consolas, \"source-code-pro\", monospace',\n automaticLayout: true,\n scrollBeyondLastLine: false,\n theme: themeProp || 'vs',\n ...options,\n };\n\n return (\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n height: isFullscreen ? '100vh' : '100%',\n minHeight: isFullscreen ? '100vh' : editorMinHeight,\n position: isFullscreen ? 'fixed' : 'relative',\n top: isFullscreen ? 0 : 'auto',\n left: isFullscreen ? 0 : 'auto',\n right: isFullscreen ? 0 : 'auto',\n bottom: isFullscreen ? 0 : 'auto',\n zIndex: isFullscreen ? 9999 : 'auto',\n bgcolor: 'background.paper',\n pt: isFullscreen ? '80px' : 0, // Add padding top in fullscreen to account for header (64px) + spacing (16px)\n px: isFullscreen ? 2 : 0,\n pb: isFullscreen ? 2 : 0,\n overflow: isFullscreen ? 'hidden' : 'visible',\n }}\n >\n <Box\n sx={{\n flex: 1,\n border: 1,\n borderColor: validationErrors.length > 0 ? 'error.main' : 'divider',\n borderRadius: 1,\n minHeight: editorMinHeight,\n overflow: 'hidden',\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n }}\n {...containerProps}\n >\n <Tooltip title={isFullscreen ? 'Exit Fullscreen' : 'Fullscreen'}>\n <IconButton\n onClick={toggleFullscreen}\n size=\"small\"\n sx={{\n position: isFullscreen ? 'fixed' : 'absolute',\n top: isFullscreen ? 72 : 8, // Position below header in fullscreen mode (header is ~64px)\n right: isFullscreen ? 16 : 8,\n zIndex: 10000, // Ensure it's above other elements\n bgcolor: 'rgba(255, 255, 255, 0.7)',\n '&:hover': {\n bgcolor: 'rgba(255, 255, 255, 0.9)',\n },\n boxShadow: 1,\n }}\n >\n {isFullscreen ? (\n <FullscreenExitIcon fontSize=\"small\" />\n ) : (\n <FullscreenIcon fontSize=\"small\" />\n )}\n </IconButton>\n </Tooltip>\n\n <Box\n sx={{\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n minHeight: editorMinHeight,\n position: 'relative',\n height: isFullscreen ? '100%' : actualHeight,\n }}\n >\n <Editor\n height=\"100%\"\n defaultLanguage={language}\n defaultValue={value}\n value={tsCode}\n onChange={handleCodeChange}\n onMount={handleEditorDidMount}\n theme={themeProp || 'vs'}\n options={defaultOptions}\n loading={\n <Box sx={{ p: 2, textAlign: 'center' }}>\n Loading Monaco Editor...\n </Box>\n }\n beforeMount={(monaco) => {\n console.log('CodeEditor: beforeMount called', { monaco: !!monaco });\n }}\n />\n </Box>\n\n {/* Problems panel at the bottom (Monaco-style) */}\n {validationErrors.length > 0 && (\n <Box\n sx={{\n borderTop: 1,\n borderColor: 'divider',\n bgcolor: 'background.default',\n display: 'flex',\n flexDirection: 'column',\n maxHeight: showProblems ? 180 : 40,\n minHeight: 40,\n transition: 'max-height 0.2s ease',\n }}\n >\n {/* Panel header */}\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n px: 1,\n py: 0.5,\n gap: 1,\n borderBottom: showProblems ? '1px solid' : 'none',\n borderColor: 'divider',\n fontSize: '0.875rem',\n color: 'text.secondary',\n }}\n >\n <ErrorOutlineIcon color=\"error\" fontSize=\"small\" />\n <Box sx={{ fontWeight: 600, color: 'text.primary' }}>Problems</Box>\n <Box sx={{ ml: 1 }}>\n {validationErrors.length} error{validationErrors.length > 1 ? 's' : ''}\n </Box>\n <Box sx={{ flex: 1 }} />\n <IconButton\n size=\"small\"\n aria-label=\"Toggle problems panel\"\n onClick={() => {\n setHasUserToggledProblems(true);\n setShowProblems((s) => !s);\n }}\n >\n {showProblems ? <ExpandMoreIcon fontSize=\"small\" /> : <ExpandLessIcon fontSize=\"small\" />}\n </IconButton>\n </Box>\n {/* Problems list */}\n {showProblems && (\n <Box sx={{ overflow: 'auto' }}>\n {validationErrors.map((error, index) => (\n <Box\n key={`${error.startLineNumber}-${error.startColumn}-${index}`}\n onClick={() => gotoMarker(error)}\n sx={{\n display: 'flex',\n alignItems: 'center',\n px: 1.5,\n py: 0.75,\n gap: 1,\n cursor: 'pointer',\n '&:hover': { bgcolor: 'action.hover' },\n borderBottom: '1px dashed',\n borderColor: 'divider',\n fontSize: '0.85rem',\n }}\n >\n <ErrorOutlineIcon color=\"error\" sx={{ fontSize: 18 }} />\n <Box sx={{ color: 'text.secondary', width: 64 }}>Line {error.startLineNumber}</Box>\n <Box sx={{ color: 'text.primary', flex: 1, minWidth: 0 }}>\n {error.message}\n </Box>\n </Box>\n ))}\n </Box>\n )}\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n\nexport default CodeEditor;\n"]}
|
|
@@ -17,9 +17,7 @@ var LoadingButton = React.forwardRef(
|
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
// src/components/buttons/ButtonGroup.tsx
|
|
20
|
-
import
|
|
21
|
-
ButtonGroup as MuiButtonGroup
|
|
22
|
-
} from "@mui/material";
|
|
20
|
+
import MuiButtonGroup from "@mui/material/ButtonGroup";
|
|
23
21
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
24
22
|
var ButtonGroup = ({
|
|
25
23
|
orientation = "horizontal",
|
|
@@ -42,4 +40,4 @@ export {
|
|
|
42
40
|
LoadingButton,
|
|
43
41
|
ButtonGroup
|
|
44
42
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-ZDAZYIXB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/buttons/LoadingButton.tsx","../src/components/buttons/ButtonGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { LoadingButton as MuiLoadingButton, LoadingButtonProps as MuiLoadingButtonProps } from '@mui/lab';\n\nexport interface LoadingButtonProps extends MuiLoadingButtonProps {\n /**\n * If `true`, the button will show a loading indicator\n */\n loading?: boolean;\n /**\n * The loading indicator can be positioned inside the button or in the center\n */\n loadingPosition?: 'start' | 'end' | 'center';\n}\n\n/**\n * LoadingButton component - Button with loading state from MUI Lab\n * \n * @example\n * ```tsx\n * <LoadingButton\n * variant=\"contained\"\n * loading={isLoading}\n * onClick={handleSubmit}\n * >\n * Submit\n * </LoadingButton>\n * ```\n */\nexport const LoadingButton = React.forwardRef<HTMLButtonElement, LoadingButtonProps>(\n function LoadingButton({ loading = false, loadingPosition = 'center', ...props }, ref) {\n return (\n <MuiLoadingButton\n ref={ref}\n loading={loading}\n loadingPosition={loadingPosition}\n {...props}\n />\n );\n },\n);\n\nexport default LoadingButton;\n\n","import React from 'react';\nimport MuiButtonGroup from '@mui/material/ButtonGroup';\nimport type { ButtonGroupProps as MuiButtonGroupProps } from '@mui/material/ButtonGroup';\n\nexport interface ButtonGroupProps extends MuiButtonGroupProps {\n /**\n * The content of the button group\n */\n children?: React.ReactNode;\n /**\n * If `true`, the buttons will be disabled\n */\n disabled?: boolean;\n /**\n * If `true`, the button group will take full width\n */\n fullWidth?: boolean;\n /**\n * The orientation of the button group\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * The size of the buttons\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * The variant to use\n * @default 'outlined'\n */\n variant?: 'text' | 'outlined' | 'contained';\n}\n\n/**\n * ButtonGroup component - groups related buttons together\n * \n * @example\n * ```tsx\n * <ButtonGroup variant=\"contained\">\n * <Button>One</Button>\n * <Button>Two</Button>\n * <Button>Three</Button>\n * </ButtonGroup>\n * ```\n */\nexport const ButtonGroup: React.FC<ButtonGroupProps> = ({\n orientation = 'horizontal',\n size = 'medium',\n variant = 'outlined',\n ...props\n}) => {\n return (\n <MuiButtonGroup\n orientation={orientation}\n size={size}\n variant={variant}\n {...props}\n />\n );\n};\n\nexport default ButtonGroup;\n\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,SAAS,iBAAiB,wBAAqE;AA8BzF;AAHC,IAAM,gBAAgB,MAAM;AAAA,EACjC,SAASA,eAAc,EAAE,UAAU,OAAO,kBAAkB,UAAU,GAAG,MAAM,GAAG,KAAK;AACrF,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;;;ACtCA,OAAO,oBAAoB;AAoDvB,gBAAAC,YAAA;AAPG,IAAM,cAA0C,CAAC;AAAA,EACtD,cAAc;AAAA,EACd,OAAO;AAAA,EACP,UAAU;AAAA,EACV,GAAG;AACL,MAAM;AACJ,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["LoadingButton","jsx"]}
|
package/dist/feedback.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ import { Theme } from '@mui/material/styles';
|
|
|
6
6
|
import { TooltipProps as TooltipProps$1 } from '@mui/material/Tooltip';
|
|
7
7
|
import { AlertProps as AlertProps$1 } from '@mui/material/Alert';
|
|
8
8
|
import { SnackbarProps as SnackbarProps$1 } from '@mui/material/Snackbar';
|
|
9
|
-
import { CircularProgressProps as CircularProgressProps$1 } from '@mui/material';
|
|
9
|
+
import { CircularProgressProps as CircularProgressProps$1 } from '@mui/material/CircularProgress';
|
|
10
10
|
|
|
11
11
|
type BadgeVariant = 'default' | 'primary' | 'success' | 'error';
|
|
12
12
|
interface BadgeProps extends Omit<BadgeProps$1, 'color' | 'variant'> {
|
|
@@ -31,17 +31,29 @@ interface ChipVariantStyles {
|
|
|
31
31
|
declare function getChipVariantStyles(variant: ChipVariant, theme: Theme): ChipVariantStyles;
|
|
32
32
|
|
|
33
33
|
type ChipTone = 'default' | 'onGradient';
|
|
34
|
-
|
|
34
|
+
type ChipBaseProps = Omit<ChipProps$1, 'color' | 'variant'>;
|
|
35
|
+
/**
|
|
36
|
+
* Default tone: `variant` controls the visual style of the chip.
|
|
37
|
+
*/
|
|
38
|
+
interface ChipDefaultProps extends ChipBaseProps {
|
|
39
|
+
tone?: 'default';
|
|
35
40
|
variant?: ChipVariant;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* onGradient tone: white text, monospace caps, translucent border.
|
|
44
|
+
* Renders on dark gradient surfaces. `variant` must be omitted.
|
|
45
|
+
*/
|
|
46
|
+
interface ChipOnGradientProps extends ChipBaseProps {
|
|
47
|
+
tone: 'onGradient';
|
|
36
48
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* Positioning is the consumer's job.
|
|
40
|
-
* @default 'default'
|
|
49
|
+
* Not applicable when tone='onGradient'.
|
|
50
|
+
* @deprecated Passing variant with tone='onGradient' is a type error.
|
|
41
51
|
*/
|
|
42
|
-
|
|
52
|
+
variant?: never;
|
|
43
53
|
}
|
|
44
|
-
|
|
54
|
+
/** ChipProps is a discriminated union on `tone`. */
|
|
55
|
+
type ChipProps = ChipDefaultProps | ChipOnGradientProps;
|
|
56
|
+
declare const Chip: React__default.ForwardRefExoticComponent<(Omit<ChipDefaultProps, "ref"> | Omit<ChipOnGradientProps, "ref">) & React__default.RefAttributes<HTMLDivElement>>;
|
|
45
57
|
|
|
46
58
|
type StatusDotStatus = 'success' | 'error' | 'warning' | 'info' | 'primary' | 'neutral';
|
|
47
59
|
interface StatusDotProps extends Omit<React__default.HTMLAttributes<HTMLSpanElement>, 'role'> {
|
package/dist/feedback.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Theme } from '@mui/material/styles';
|
|
|
6
6
|
import { TooltipProps as TooltipProps$1 } from '@mui/material/Tooltip';
|
|
7
7
|
import { AlertProps as AlertProps$1 } from '@mui/material/Alert';
|
|
8
8
|
import { SnackbarProps as SnackbarProps$1 } from '@mui/material/Snackbar';
|
|
9
|
-
import { CircularProgressProps as CircularProgressProps$1 } from '@mui/material';
|
|
9
|
+
import { CircularProgressProps as CircularProgressProps$1 } from '@mui/material/CircularProgress';
|
|
10
10
|
|
|
11
11
|
type BadgeVariant = 'default' | 'primary' | 'success' | 'error';
|
|
12
12
|
interface BadgeProps extends Omit<BadgeProps$1, 'color' | 'variant'> {
|
|
@@ -31,17 +31,29 @@ interface ChipVariantStyles {
|
|
|
31
31
|
declare function getChipVariantStyles(variant: ChipVariant, theme: Theme): ChipVariantStyles;
|
|
32
32
|
|
|
33
33
|
type ChipTone = 'default' | 'onGradient';
|
|
34
|
-
|
|
34
|
+
type ChipBaseProps = Omit<ChipProps$1, 'color' | 'variant'>;
|
|
35
|
+
/**
|
|
36
|
+
* Default tone: `variant` controls the visual style of the chip.
|
|
37
|
+
*/
|
|
38
|
+
interface ChipDefaultProps extends ChipBaseProps {
|
|
39
|
+
tone?: 'default';
|
|
35
40
|
variant?: ChipVariant;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* onGradient tone: white text, monospace caps, translucent border.
|
|
44
|
+
* Renders on dark gradient surfaces. `variant` must be omitted.
|
|
45
|
+
*/
|
|
46
|
+
interface ChipOnGradientProps extends ChipBaseProps {
|
|
47
|
+
tone: 'onGradient';
|
|
36
48
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* Positioning is the consumer's job.
|
|
40
|
-
* @default 'default'
|
|
49
|
+
* Not applicable when tone='onGradient'.
|
|
50
|
+
* @deprecated Passing variant with tone='onGradient' is a type error.
|
|
41
51
|
*/
|
|
42
|
-
|
|
52
|
+
variant?: never;
|
|
43
53
|
}
|
|
44
|
-
|
|
54
|
+
/** ChipProps is a discriminated union on `tone`. */
|
|
55
|
+
type ChipProps = ChipDefaultProps | ChipOnGradientProps;
|
|
56
|
+
declare const Chip: React__default.ForwardRefExoticComponent<(Omit<ChipDefaultProps, "ref"> | Omit<ChipOnGradientProps, "ref">) & React__default.RefAttributes<HTMLDivElement>>;
|
|
45
57
|
|
|
46
58
|
type StatusDotStatus = 'success' | 'error' | 'warning' | 'info' | 'primary' | 'neutral';
|
|
47
59
|
interface StatusDotProps extends Omit<React__default.HTMLAttributes<HTMLSpanElement>, 'role'> {
|
package/dist/feedback.js
CHANGED
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkQCFLZ7X3js = require('./chunk-QCFLZ7X3.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkPFZZJZ64js = require('./chunk-PFZZJZ64.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkBIZK6FUDjs = require('./chunk-BIZK6FUD.js');
|
|
23
|
-
require('./chunk-
|
|
24
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-72TQ56EP.js');
|
|
24
|
+
require('./chunk-XZZZ4MZV.js');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -39,5 +39,5 @@ require('./chunk-ZGCN5WCG.js');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.Alert =
|
|
42
|
+
exports.Alert = _chunkQCFLZ7X3js.Alert; exports.AppLoading = _chunkQCFLZ7X3js.AppLoading; exports.Badge = _chunkBIZK6FUDjs.Badge; exports.Chip = _chunkQCFLZ7X3js.Chip; exports.CircularProgress = _chunkQCFLZ7X3js.CircularProgress; exports.CopyChip = _chunkQCFLZ7X3js.CopyChip; exports.EmptyState = _chunkQCFLZ7X3js.EmptyState; exports.IDBlock = _chunkPFZZJZ64js.IDBlock; exports.Loading = _chunkQCFLZ7X3js.Loading; exports.Progress = _chunkQCFLZ7X3js.Progress; exports.RoleBadge = _chunkPFZZJZ64js.RoleBadge; exports.Snackbar = _chunkQCFLZ7X3js.Snackbar; exports.StatusDot = _chunkQCFLZ7X3js.StatusDot; exports.StatusLabel = _chunkQCFLZ7X3js.StatusLabel; exports.Tooltip = _chunkQCFLZ7X3js.Tooltip; exports.getChipVariantStyles = _chunkQCFLZ7X3js.getChipVariantStyles;
|
|
43
43
|
//# sourceMappingURL=feedback.js.map
|
package/dist/feedback.mjs
CHANGED
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
StatusLabel,
|
|
13
13
|
Tooltip,
|
|
14
14
|
getChipVariantStyles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GR52ENYI.mjs";
|
|
16
16
|
import {
|
|
17
17
|
IDBlock,
|
|
18
18
|
RoleBadge
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DRGMEIPT.mjs";
|
|
20
20
|
import {
|
|
21
21
|
Badge
|
|
22
22
|
} from "./chunk-QBCRH7YF.mjs";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-D7D25O6E.mjs";
|
|
24
|
+
import "./chunk-WC2TCWXK.mjs";
|
|
25
25
|
export {
|
|
26
26
|
Alert,
|
|
27
27
|
AppLoading,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|