sample-ui-component-library 0.0.62-dev → 0.0.64-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.62-dev",
3
+ "version": "0.0.64-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",
@@ -100,6 +100,10 @@ export const Editor = forwardRef(({ onSelectAbstraction, onSelectTab, onUpdateCo
100
100
  dispatch({ type: "SAVE_ALL", payload: {} });
101
101
  }, []);
102
102
 
103
+ const layoutEditor = useCallback(() => {
104
+ editorRef.current && editorRef.current.layoutModel();
105
+ }, []);
106
+
103
107
  const api_entries = {
104
108
  state,
105
109
  addTab,
@@ -115,7 +119,8 @@ export const Editor = forwardRef(({ onSelectAbstraction, onSelectTab, onUpdateCo
115
119
  getActiveTab,
116
120
  setUpdatedContent,
117
121
  setContent,
118
- saveAll
122
+ saveAll,
123
+ layoutEditor
119
124
  }
120
125
 
121
126
  const api = useMemo(() => {
@@ -151,11 +151,16 @@ export const MonacoInstance = forwardRef(({ onSelectAbstraction }, ref) => {
151
151
  }
152
152
  }, []);
153
153
 
154
+ const layoutModel = useCallback(() => {
155
+ editorRef.current?.layout();
156
+ }, []);
157
+
154
158
  const api = useMemo(() => {
155
159
  return {
156
160
  clearModel,
161
+ layoutModel,
157
162
  };
158
- }, [clearModel]);
163
+ }, [clearModel, layoutModel]);
159
164
 
160
165
  useImperativeHandle(ref, () => api, [api]);
161
166
 
@@ -8,12 +8,17 @@ export const OverlayRow =({ entry, top, bottom, onSelectAbstraction }) => {
8
8
  const style= {
9
9
  "top": top + "px",
10
10
  "height": (bottom - top) + "px",
11
- "backgroundColor": entry?.backgroundColor || "none"
12
11
  };
13
12
 
14
- // If entry doesn't have background color, add hover effect.
15
13
  let className = "line-block-overlay";
16
- if (!entry.backgroundColor) {
14
+ if (entry.isMappedCurrent) {
15
+ style["backgroundColor"] = "rgba(123, 255, 0, 0.2)";
16
+ } else if (entry.isMappedOther) {
17
+ style["backgroundColor"] = "rgba(138, 138, 138, 0.2)";
18
+ }
19
+
20
+ // If entry is not mapped, add hover effect.
21
+ if (!entry.isMappedCurrent && !entry.isMappedOther) {
17
22
  className += " line-block-overlay-hover";
18
23
  }
19
24
 
@@ -3,9 +3,9 @@
3
3
  position: absolute;
4
4
  left: 0px;
5
5
  right: 0px;
6
+ cursor: pointer;
6
7
  }
7
8
 
8
9
  .line-block-overlay-hover:hover {
9
10
  background-color: rgba(123, 255, 0, 0.2);
10
- cursor: pointer;
11
11
  }
@@ -260,6 +260,7 @@
260
260
  "uid": "915ae10a-aab9-4003-9dbc-45772015b366",
261
261
  "start_line": 71,
262
262
  "end_line": 71,
263
+ "isMappedOther": true,
263
264
  "source": "book_shelf = place_books_on_shelf_from_basket(book_shelf, basket)"
264
265
  },
265
266
  {
@@ -287,7 +288,7 @@
287
288
  "uid": "f9fff770-f748-407e-99ac-e94246a9d4d3",
288
289
  "start_line": 75,
289
290
  "end_line": 75,
290
- "backgroundColor": "#33000033",
291
+ "isMappedCurrent": true,
291
292
  "source": "print(\"\\nLibrary Audit:\", json.dumps(audit[\"value\"], indent=2))"
292
293
  },
293
294
  {