sample-ui-component-library 0.0.63-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
|
@@ -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
|
|