sample-ui-component-library 0.0.63-dev → 0.0.65-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.63-dev",
3
+ "version": "0.0.65-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,18 @@ export const MonacoInstance = forwardRef(({ onSelectAbstraction }, ref) => {
151
151
  }
152
152
  }, []);
153
153
 
154
+ // Programatically trigger layout of editor and render overlays.
155
+ const layoutModel = useCallback(() => {
156
+ editorRef.current?.layout();
157
+ updateOverlays();
158
+ }, []);
159
+
154
160
  const api = useMemo(() => {
155
161
  return {
156
162
  clearModel,
163
+ layoutModel,
157
164
  };
158
- }, [clearModel]);
165
+ }, [clearModel, layoutModel]);
159
166
 
160
167
  useImperativeHandle(ref, () => api, [api]);
161
168