@sqlrooms/monaco-editor 0.24.20 → 0.24.22
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonMonacoEditor.d.ts","sourceRoot":"","sources":["../../src/components/JsonMonacoEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAG/D,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,OAAO,CAAC;IACrD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"JsonMonacoEditor.d.ts","sourceRoot":"","sources":["../../src/components/JsonMonacoEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAG/D,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,OAAO,CAAC;IACrD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoD5D,CAAC"}
|
|
@@ -23,6 +23,7 @@ export const JsonMonacoEditor = ({ schema, value = '', onMount, className, ...pr
|
|
|
23
23
|
}
|
|
24
24
|
// Format the document on initial load
|
|
25
25
|
setTimeout(() => {
|
|
26
|
+
console.log('formatting document');
|
|
26
27
|
editor.getAction('editor.action.formatDocument')?.run();
|
|
27
28
|
}, 100);
|
|
28
29
|
// Call the original onMount if provided
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonMonacoEditor.js","sourceRoot":"","sources":["../../src/components/JsonMonacoEditor.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAe/D;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAChE,MAAM,EACN,KAAK,GAAG,EAAE,EACV,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,EAAE;IACH,2CAA2C;IAC3C,MAAM,WAAW,GACf,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAErE,kDAAkD;IAClD,MAAM,oBAAoB,GAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QACvD,IAAI,MAAM,EAAE,CAAC;YACX,mCAAmC;YACnC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;gBACvD,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE;oBACP;wBACE,GAAG,EAAE,6BAA6B;wBAClC,SAAS,EAAE,CAAC,GAAG,CAAC;wBAChB,MAAM,EAAE,MAAa;qBACtB;iBACF;aACF,CAAC,CAAC;QACL,CAAC;QAED,sCAAsC;QACtC,UAAU,CAAC,GAAG,EAAE;YACd,MAAM,CAAC,SAAS,CAAC,8BAA8B,CAAC,EAAE,GAAG,EAAE,CAAC;QAC1D,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,wCAAwC;QACxC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,YAAY,IACX,QAAQ,EAAC,MAAM,EACf,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE;YACP,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,IAAI;SACnB,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport {MonacoEditor, MonacoEditorProps} from './MonacoEditor';\nimport {OnMount} from '@monaco-editor/react';\n\nexport interface JsonMonacoEditorProps\n extends Omit<MonacoEditorProps, 'language' | 'value'> {\n /**\n * The JSON schema to validate against\n */\n schema?: object;\n /**\n * The JSON value to edit\n */\n value?: string | object;\n}\n\n/**\n * A Monaco editor for editing JSON with schema validation\n */\nexport const JsonMonacoEditor: React.FC<JsonMonacoEditorProps> = ({\n schema,\n value = '',\n onMount,\n className,\n ...props\n}) => {\n // Convert object value to string if needed\n const stringValue =\n typeof value === 'object' ? JSON.stringify(value, null, 2) : value;\n\n // Handle editor mounting to configure JSON schema\n const handleEditorDidMount: OnMount = (editor, monaco) => {\n if (schema) {\n // Configure JSON schema validation\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n validate: true,\n schemas: [\n {\n uri: 'http://myserver/schema.json',\n fileMatch: ['*'],\n schema: schema as any,\n },\n ],\n });\n }\n\n // Format the document on initial load\n setTimeout(() => {\n editor.getAction('editor.action.formatDocument')?.run();\n }, 100);\n\n // Call the original onMount if provided\n if (onMount) {\n onMount(editor, monaco);\n }\n };\n\n return (\n <MonacoEditor\n language=\"json\"\n value={stringValue}\n onMount={handleEditorDidMount}\n className={className}\n options={{\n formatOnPaste: true,\n formatOnType: true,\n }}\n {...props}\n />\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"JsonMonacoEditor.js","sourceRoot":"","sources":["../../src/components/JsonMonacoEditor.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAe/D;;GAEG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,CAAC","sourcesContent":["import React from 'react';\nimport {MonacoEditor, MonacoEditorProps} from './MonacoEditor';\nimport {OnMount} from '@monaco-editor/react';\n\nexport interface JsonMonacoEditorProps\n extends Omit<MonacoEditorProps, 'language' | 'value'> {\n /**\n * The JSON schema to validate against\n */\n schema?: object;\n /**\n * The JSON value to edit\n */\n value?: string | object;\n}\n\n/**\n * A Monaco editor for editing JSON with schema validation\n */\nexport const JsonMonacoEditor: React.FC<JsonMonacoEditorProps> = ({\n schema,\n value = '',\n onMount,\n className,\n ...props\n}) => {\n // Convert object value to string if needed\n const stringValue =\n typeof value === 'object' ? JSON.stringify(value, null, 2) : value;\n\n // Handle editor mounting to configure JSON schema\n const handleEditorDidMount: OnMount = (editor, monaco) => {\n if (schema) {\n // Configure JSON schema validation\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n validate: true,\n schemas: [\n {\n uri: 'http://myserver/schema.json',\n fileMatch: ['*'],\n schema: schema as any,\n },\n ],\n });\n }\n\n // Format the document on initial load\n setTimeout(() => {\n console.log('formatting document');\n editor.getAction('editor.action.formatDocument')?.run();\n }, 100);\n\n // Call the original onMount if provided\n if (onMount) {\n onMount(editor, monaco);\n }\n };\n\n return (\n <MonacoEditor\n language=\"json\"\n value={stringValue}\n onMount={handleEditorDidMount}\n className={className}\n options={{\n formatOnPaste: true,\n formatOnType: true,\n }}\n {...props}\n />\n );\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/monaco-editor",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.22",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@monaco-editor/react": "^4.7.0",
|
|
22
|
-
"@sqlrooms/ui": "0.24.
|
|
22
|
+
"@sqlrooms/ui": "0.24.22",
|
|
23
23
|
"monaco-editor": "^0.52.2"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"typecheck": "tsc --noEmit",
|
|
34
34
|
"typedoc": "typedoc"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "bc633cde7574270b679cb6c3d9ce9b496a634133"
|
|
37
37
|
}
|