sample-ui-component-library 0.0.52-dev → 0.0.54-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/MonacoInstance/MonacoInstance.jsx +16 -16
- package/src/components/Editor/MonacoInstance/MonacoInstance.scss +6 -0
- package/src/stories/Editor.stories.js +3 -1
package/package.json
CHANGED
|
@@ -112,23 +112,23 @@ export const MonacoInstance = forwardRef(({ onSelectAbstraction }, ref) => {
|
|
|
112
112
|
|
|
113
113
|
return (
|
|
114
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
|
+
/>
|
|
115
129
|
{
|
|
116
|
-
showEditor ?
|
|
117
|
-
<
|
|
118
|
-
defaultLanguage="python"
|
|
119
|
-
defaultValue={"Loading content..."}
|
|
120
|
-
onMount={handleEditorDidMount}
|
|
121
|
-
theme="vs-dark"
|
|
122
|
-
options={{
|
|
123
|
-
minimap: { enabled: false },
|
|
124
|
-
padding: { top: 10 },
|
|
125
|
-
renderWhitespace: "none",
|
|
126
|
-
wordWrap: "on",
|
|
127
|
-
scrollBeyondLastLine: false,
|
|
128
|
-
automaticLayout: false,
|
|
129
|
-
}}
|
|
130
|
-
/>:
|
|
131
|
-
<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
|
|
132
132
|
}
|
|
133
133
|
{state.mode === EDITOR_MODES.MAPPING && (
|
|
134
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
|
}
|