sample-ui-component-library 0.0.53-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sample-ui-component-library",
3
- "version": "0.0.53-dev",
3
+ "version": "0.0.54-dev",
4
4
  "description": "A library which contains sample UI elements that can be used for populating layouts.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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
- <Editor
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}>
@@ -5,6 +5,12 @@
5
5
  display:flex;
6
6
  align-items:center;
7
7
  justify-content:center;
8
+ z-index:999;
9
+ position:absolute;
10
+ top:0;
11
+ left:0;
12
+ right:0;
13
+ bottom:0;
8
14
  }
9
15
 
10
16
  .editor-container {
@@ -143,7 +143,9 @@ const Template = (args) => {
143
143
 
144
144
  const onSelectTool = useCallback((tool) => {
145
145
  if (tool === "mapping-mode") {
146
- editorRef.current.setMode(EDITOR_MODES.MAPPING);
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
  }