@react-fabric/monaco 1.0.0-beta.51 → 1.0.0-beta.52
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.
|
@@ -13,6 +13,33 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
13
13
|
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
/**
|
|
17
|
+
* CodeEditor component to render a code editor using Monaco Editor.
|
|
18
|
+
* It supports JSON and HTML languages with optional schema validation and handlebar suggestions.
|
|
19
|
+
* The editor can be configured to be read-only, minimal, and can handle changes in the code.
|
|
20
|
+
* It provides a ref to access the editor's value and validation methods.
|
|
21
|
+
*
|
|
22
|
+
* @param {EditorProps} props - The properties for the CodeEditor component.
|
|
23
|
+
* @param {RefProp<MonacoEditorRef>} ref - The ref to access the editor methods.
|
|
24
|
+
* @return {JSX.Element} The rendered CodeEditor component.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <CodeEditor
|
|
29
|
+
* value={initialValue}
|
|
30
|
+
* schema={[{ uri: "http://example.com/schema.json", schema: {} }]}
|
|
31
|
+
* handlebarSuggestions={[{ text: "example", description: "An example suggestion" }]}
|
|
32
|
+
* required={true}
|
|
33
|
+
* readOnly={false}
|
|
34
|
+
* minimal={false}
|
|
35
|
+
* onChange={(value) => console.log("Code changed:", value)}
|
|
36
|
+
* language="json"
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/monaco-playground--playground}
|
|
41
|
+
* @see {@link https://microsoft.github.io/monaco-editor/}
|
|
42
|
+
*/
|
|
16
43
|
var CodeEditor = function CodeEditor(_ref) {
|
|
17
44
|
var ref = _ref.ref,
|
|
18
45
|
value = _ref.value,
|
|
@@ -13,6 +13,33 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
13
13
|
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
/**
|
|
17
|
+
* CodeEditor component to render a code editor using Monaco Editor.
|
|
18
|
+
* It supports JSON and HTML languages with optional schema validation and handlebar suggestions.
|
|
19
|
+
* The editor can be configured to be read-only, minimal, and can handle changes in the code.
|
|
20
|
+
* It provides a ref to access the editor's value and validation methods.
|
|
21
|
+
*
|
|
22
|
+
* @param {EditorProps} props - The properties for the CodeEditor component.
|
|
23
|
+
* @param {RefProp<MonacoEditorRef>} ref - The ref to access the editor methods.
|
|
24
|
+
* @return {JSX.Element} The rendered CodeEditor component.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <CodeEditor
|
|
29
|
+
* value={initialValue}
|
|
30
|
+
* schema={[{ uri: "http://example.com/schema.json", schema: {} }]}
|
|
31
|
+
* handlebarSuggestions={[{ text: "example", description: "An example suggestion" }]}
|
|
32
|
+
* required={true}
|
|
33
|
+
* readOnly={false}
|
|
34
|
+
* minimal={false}
|
|
35
|
+
* onChange={(value) => console.log("Code changed:", value)}
|
|
36
|
+
* language="json"
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/monaco-playground--playground}
|
|
41
|
+
* @see {@link https://microsoft.github.io/monaco-editor/}
|
|
42
|
+
*/
|
|
16
43
|
var CodeEditor = function CodeEditor(_ref) {
|
|
17
44
|
var ref = _ref.ref,
|
|
18
45
|
value = _ref.value,
|
|
@@ -29,5 +29,32 @@ type EditorProps = BaseEditorProps & ({
|
|
|
29
29
|
schema?: any;
|
|
30
30
|
handlebarSuggestions?: never;
|
|
31
31
|
});
|
|
32
|
+
/**
|
|
33
|
+
* CodeEditor component to render a code editor using Monaco Editor.
|
|
34
|
+
* It supports JSON and HTML languages with optional schema validation and handlebar suggestions.
|
|
35
|
+
* The editor can be configured to be read-only, minimal, and can handle changes in the code.
|
|
36
|
+
* It provides a ref to access the editor's value and validation methods.
|
|
37
|
+
*
|
|
38
|
+
* @param {EditorProps} props - The properties for the CodeEditor component.
|
|
39
|
+
* @param {RefProp<MonacoEditorRef>} ref - The ref to access the editor methods.
|
|
40
|
+
* @return {JSX.Element} The rendered CodeEditor component.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* <CodeEditor
|
|
45
|
+
* value={initialValue}
|
|
46
|
+
* schema={[{ uri: "http://example.com/schema.json", schema: {} }]}
|
|
47
|
+
* handlebarSuggestions={[{ text: "example", description: "An example suggestion" }]}
|
|
48
|
+
* required={true}
|
|
49
|
+
* readOnly={false}
|
|
50
|
+
* minimal={false}
|
|
51
|
+
* onChange={(value) => console.log("Code changed:", value)}
|
|
52
|
+
* language="json"
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/monaco-playground--playground}
|
|
57
|
+
* @see {@link https://microsoft.github.io/monaco-editor/}
|
|
58
|
+
*/
|
|
32
59
|
export declare const CodeEditor: ({ ref, value, schema, handlebarSuggestions, required, readOnly, minimal, onChange, language, }: EditorProps & RefProp<MonacoEditorRef>) => import("react/jsx-runtime").JSX.Element;
|
|
33
60
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/monaco",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.52",
|
|
4
4
|
"description": "RUF: Monaco editor",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
38
|
+
"@react-fabric/core": "^1.0.0-beta.52",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.52",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"monaco-editor": "^0.52.2",
|
|
42
42
|
"react-monaco-editor": "^0.58.0"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"node": ">=18.12.0",
|
|
52
52
|
"npm": ">=8.19.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "0eabb9d88d91af93d657bcc209b226fd576e8260"
|
|
55
55
|
}
|
|
@@ -77,6 +77,33 @@ type EditorProps = BaseEditorProps &
|
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* CodeEditor component to render a code editor using Monaco Editor.
|
|
82
|
+
* It supports JSON and HTML languages with optional schema validation and handlebar suggestions.
|
|
83
|
+
* The editor can be configured to be read-only, minimal, and can handle changes in the code.
|
|
84
|
+
* It provides a ref to access the editor's value and validation methods.
|
|
85
|
+
*
|
|
86
|
+
* @param {EditorProps} props - The properties for the CodeEditor component.
|
|
87
|
+
* @param {RefProp<MonacoEditorRef>} ref - The ref to access the editor methods.
|
|
88
|
+
* @return {JSX.Element} The rendered CodeEditor component.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```jsx
|
|
92
|
+
* <CodeEditor
|
|
93
|
+
* value={initialValue}
|
|
94
|
+
* schema={[{ uri: "http://example.com/schema.json", schema: {} }]}
|
|
95
|
+
* handlebarSuggestions={[{ text: "example", description: "An example suggestion" }]}
|
|
96
|
+
* required={true}
|
|
97
|
+
* readOnly={false}
|
|
98
|
+
* minimal={false}
|
|
99
|
+
* onChange={(value) => console.log("Code changed:", value)}
|
|
100
|
+
* language="json"
|
|
101
|
+
* />
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/monaco-playground--playground}
|
|
105
|
+
* @see {@link https://microsoft.github.io/monaco-editor/}
|
|
106
|
+
*/
|
|
80
107
|
export const CodeEditor = ({
|
|
81
108
|
ref,
|
|
82
109
|
value,
|