sample-ui-component-library 0.0.53-dev → 0.0.55-dev
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Editor/Editor.scss +1 -1
- package/src/components/Editor/MonacoInstance/MonacoInstance.jsx +16 -17
- package/src/components/Editor/MonacoInstance/MonacoInstance.scss +2 -0
- package/src/stories/Editor.stories.js +3 -1
package/package.json
CHANGED
|
@@ -43,7 +43,6 @@ export const MonacoInstance = forwardRef(({ onSelectAbstraction }, ref) => {
|
|
|
43
43
|
// Dispose all models on unmount to prevent memory leaks.
|
|
44
44
|
modelsRef.current.forEach((model) => model.dispose());
|
|
45
45
|
modelsRef.current.clear();
|
|
46
|
-
editorRef.current = null;
|
|
47
46
|
}
|
|
48
47
|
}, []);
|
|
49
48
|
|
|
@@ -113,23 +112,23 @@ export const MonacoInstance = forwardRef(({ onSelectAbstraction }, ref) => {
|
|
|
113
112
|
|
|
114
113
|
return (
|
|
115
114
|
<div className="editor-container" ref={containerRef}>
|
|
115
|
+
<Editor
|
|
116
|
+
defaultLanguage="python"
|
|
117
|
+
defaultValue={"Loading content..."}
|
|
118
|
+
onMount={handleEditorDidMount}
|
|
119
|
+
theme="vs-dark"
|
|
120
|
+
options={{
|
|
121
|
+
minimap: { enabled: false },
|
|
122
|
+
padding: { top: 10 },
|
|
123
|
+
renderWhitespace: "none",
|
|
124
|
+
wordWrap: "on",
|
|
125
|
+
scrollBeyondLastLine: false,
|
|
126
|
+
automaticLayout: false,
|
|
127
|
+
}}
|
|
128
|
+
/>
|
|
116
129
|
{
|
|
117
|
-
showEditor ?
|
|
118
|
-
<
|
|
119
|
-
defaultLanguage="python"
|
|
120
|
-
defaultValue={"Loading content..."}
|
|
121
|
-
onMount={handleEditorDidMount}
|
|
122
|
-
theme="vs-dark"
|
|
123
|
-
options={{
|
|
124
|
-
minimap: { enabled: false },
|
|
125
|
-
padding: { top: 10 },
|
|
126
|
-
renderWhitespace: "none",
|
|
127
|
-
wordWrap: "on",
|
|
128
|
-
scrollBeyondLastLine: false,
|
|
129
|
-
automaticLayout: false,
|
|
130
|
-
}}
|
|
131
|
-
/>:
|
|
132
|
-
<div className="no-tab">Select file or drag and drop to view.</div>
|
|
130
|
+
!showEditor ?
|
|
131
|
+
<div className="no-tab">Select file or drag and drop to view.</div>:null
|
|
133
132
|
}
|
|
134
133
|
{state.mode === EDITOR_MODES.MAPPING && (
|
|
135
134
|
<div className="overlay-layer" onWheel={handleWheel}>
|
|
@@ -143,7 +143,9 @@ const Template = (args) => {
|
|
|
143
143
|
|
|
144
144
|
const onSelectTool = useCallback((tool) => {
|
|
145
145
|
if (tool === "mapping-mode") {
|
|
146
|
-
editorRef.current.
|
|
146
|
+
editorRef.current.addTab(
|
|
147
|
+
flattenTree(WorkspaceSampleTree.tree).slice(2,2)
|
|
148
|
+
);
|
|
147
149
|
} else if (tool === "implementation-mode") {
|
|
148
150
|
editorRef.current.setMode(EDITOR_MODES.DESIGN);
|
|
149
151
|
}
|