@typefox/monaco-editor-react
Advanced tools
Comparing version 6.0.0 to 6.1.0
@@ -5,2 +5,7 @@ # CHANGELOG | ||
## [6.1.0] - 2025-01-10 | ||
- `@typefox/monaco-editor-react` now works with views service [#823](https://github.com/TypeFox/monaco-languageclient/pull/823) | ||
- Ensure configuration is init before service init [#820](https://github.com/TypeFox/monaco-languageclient/pull/820) | ||
## [6.0.0] - 2024-12-18 | ||
@@ -7,0 +12,0 @@ |
@@ -26,2 +26,3 @@ /* -------------------------------------------------------------------------------------------- | ||
containerRef.current.className = className ?? ''; | ||
wrapperConfig.htmlContainer = containerRef.current; | ||
} | ||
@@ -45,7 +46,12 @@ }, [className]); | ||
const initMonaco = useCallback(async () => { | ||
await wrapperRef.current.init(wrapperConfig); | ||
if (containerRef.current) { | ||
wrapperConfig.htmlContainer = containerRef.current; | ||
await wrapperRef.current.init(wrapperConfig); | ||
} | ||
else { | ||
throw new Error('No htmlContainer found! Aborting...'); | ||
} | ||
}, [wrapperConfig]); | ||
const startMonaco = useCallback(async () => { | ||
if (containerRef.current) { | ||
containerRef.current.className = className ?? ''; | ||
try { | ||
@@ -70,3 +76,6 @@ wrapperRef.current.registerModelUpdate((textModels) => { | ||
}); | ||
await wrapperRef.current.start(containerRef.current); | ||
const viewServiceType = wrapperConfig.vscodeApiConfig?.viewsConfig?.viewServiceType; | ||
if (viewServiceType === 'EditorService' || viewServiceType === undefined) { | ||
await wrapperRef.current.start(); | ||
} | ||
onLoad?.(wrapperRef.current); | ||
@@ -85,5 +94,5 @@ handleOnTextChanged(); | ||
else { | ||
throw new Error('No htmlContainer found'); | ||
throw new Error('No htmlContainer found! Aborting...'); | ||
} | ||
}, [className, onError, onLoad, onTextChanged]); | ||
}, [onError, onLoad, onTextChanged]); | ||
const handleOnTextChanged = useCallback(() => { | ||
@@ -90,0 +99,0 @@ disposeOnTextChanged(); |
{ | ||
"name": "@typefox/monaco-editor-react", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"license": "MIT", | ||
@@ -50,4 +50,3 @@ "description": "React component for Monaco-Editor and Monaco Languageclient", | ||
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~11.1.2", | ||
"monaco-languageclient": "~9.0.0", | ||
"react": "~18.3.1", | ||
"monaco-languageclient": "~9.1.0", | ||
"vscode": "npm:@codingame/monaco-vscode-api@~11.1.2", | ||
@@ -57,3 +56,4 @@ "vscode-ws-jsonrpc": "~3.4.0" | ||
"peerDependencies": { | ||
"monaco-editor-wrapper": "~6.0.0" | ||
"monaco-editor-wrapper": "~6.1.0", | ||
"react": ">=18.0.0 || <20.0.0" | ||
}, | ||
@@ -60,0 +60,0 @@ "peerDependenciesMeta": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30629
258
1
+ Addedmonaco-editor-wrapper@6.1.0(transitive)
+ Addedmonaco-languageclient@9.1.0(transitive)
+ Addedreact@19.0.0(transitive)
- Removedreact@~18.3.1
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedmonaco-editor-wrapper@6.0.0(transitive)
- Removedmonaco-languageclient@9.0.0(transitive)
- Removedreact@18.3.1(transitive)
Updatedmonaco-languageclient@~9.1.0