@tinacms/app 2.2.10 → 2.3.0
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/CHANGELOG.md +12 -0
- package/package.json +6 -4
- package/src/fields/rich-text/monaco/index.tsx +15 -19
- package/src/index.css +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @tinacms/app
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#5744](https://github.com/tinacms/tinacms/pull/5744) [`98a61e2`](https://github.com/tinacms/tinacms/commit/98a61e2d263978a7096cc23ac7e94aa0039981be) Thanks [@Ben0189](https://github.com/Ben0189)! - Upgrade Plate editor to v48 beta, integrating latest features and improvements.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`98a61e2`](https://github.com/tinacms/tinacms/commit/98a61e2d263978a7096cc23ac7e94aa0039981be)]:
|
|
12
|
+
- @tinacms/mdx@1.8.0
|
|
13
|
+
- tinacms@2.8.0
|
|
14
|
+
|
|
3
15
|
## 2.2.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"main": "src/main.tsx",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"devDependencies": {
|
|
@@ -16,15 +16,17 @@
|
|
|
16
16
|
"@graphiql/toolkit": "0.8.4",
|
|
17
17
|
"@headlessui/react": "2.1.8",
|
|
18
18
|
"@heroicons/react": "^1.0.6",
|
|
19
|
-
"@monaco-editor/react": "4.
|
|
19
|
+
"@monaco-editor/react": "4.4.5",
|
|
20
20
|
"final-form": "4.20.10",
|
|
21
21
|
"graphiql": "3.0.0-alpha.1",
|
|
22
22
|
"graphql": "15.8.0",
|
|
23
23
|
"monaco-editor": "0.31.0",
|
|
24
|
+
"react": "^18.3.1",
|
|
25
|
+
"react-dom": "^18.3.1",
|
|
24
26
|
"react-router-dom": "6.3.0",
|
|
25
27
|
"typescript": "^5.7.3",
|
|
26
28
|
"zod": "^3.24.2",
|
|
27
|
-
"@tinacms/mdx": "1.
|
|
28
|
-
"tinacms": "2.
|
|
29
|
+
"@tinacms/mdx": "1.8.0",
|
|
30
|
+
"tinacms": "2.8.0"
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
|
|
1
|
+
import React from 'react';
|
|
7
2
|
import MonacoEditor, { useMonaco, loader } from '@monaco-editor/react';
|
|
8
3
|
/**
|
|
9
4
|
* MDX is built directly to the app because of how we load dependencies.
|
|
@@ -13,7 +8,6 @@ import MonacoEditor, { useMonaco, loader } from '@monaco-editor/react';
|
|
|
13
8
|
*/
|
|
14
9
|
import { parseMDX, serializeMDX } from '@tinacms/mdx';
|
|
15
10
|
import type * as monaco from 'monaco-editor';
|
|
16
|
-
import React from 'react';
|
|
17
11
|
import { RichTextType } from 'tinacms';
|
|
18
12
|
import {
|
|
19
13
|
ErrorMessage,
|
|
@@ -34,11 +28,6 @@ export const uuid = () => {
|
|
|
34
28
|
|
|
35
29
|
type Monaco = typeof monaco;
|
|
36
30
|
|
|
37
|
-
// 0.33.0 has a bug https://github.com/microsoft/monaco-editor/issues/2947
|
|
38
|
-
loader.config({
|
|
39
|
-
paths: { vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs' },
|
|
40
|
-
});
|
|
41
|
-
|
|
42
31
|
/**
|
|
43
32
|
* Since monaco lazy-loads we may have a delay from when the block is inserted
|
|
44
33
|
* to when monaco has intantiated, keep trying to focus on it.
|
|
@@ -149,13 +138,17 @@ export const RawEditor = (props: RichTextType) => {
|
|
|
149
138
|
monacoEditor: monaco.editor.IStandaloneCodeEditor,
|
|
150
139
|
monaco: Monaco
|
|
151
140
|
) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
141
|
+
if (monacoEditor) {
|
|
142
|
+
monacoEditorRef.current = monacoEditor;
|
|
143
|
+
monacoEditor.onDidContentSizeChange(() => {
|
|
144
|
+
// FIXME: if the window is too tall the performance degrades, come up with a nice
|
|
145
|
+
// balance between the two
|
|
146
|
+
setHeight(
|
|
147
|
+
Math.min(Math.max(100, monacoEditor.getContentHeight()), 1000)
|
|
148
|
+
);
|
|
149
|
+
monacoEditor.layout();
|
|
150
|
+
});
|
|
151
|
+
}
|
|
159
152
|
}
|
|
160
153
|
|
|
161
154
|
return (
|
|
@@ -168,6 +161,9 @@ export const RawEditor = (props: RichTextType) => {
|
|
|
168
161
|
</div>
|
|
169
162
|
<div style={{ height: `${height}px` }}>
|
|
170
163
|
<MonacoEditor
|
|
164
|
+
beforeMount={() => {}}
|
|
165
|
+
height='100%'
|
|
166
|
+
width='100%'
|
|
171
167
|
path={id}
|
|
172
168
|
onMount={handleEditorDidMount}
|
|
173
169
|
// Setting a custom theme is kind of buggy because it doesn't get defined until monaco has mounted.
|