@kwiz/fluentui 1.0.175 → 1.0.176
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.
|
@@ -6,6 +6,14 @@ export interface iCodeEditorProps {
|
|
|
6
6
|
/** key: name of library/module, value: types, enums, interfaces and declare global variables */
|
|
7
7
|
extraLibs?: IDictionary<string>;
|
|
8
8
|
hideLineNumbers?: boolean;
|
|
9
|
+
jsonSchemaValidations?: {
|
|
10
|
+
/** https://your-app/license-blob-schema.json */
|
|
11
|
+
uri: string;
|
|
12
|
+
/** ["*"], // Apply to all JSON models or use a specific model URI */
|
|
13
|
+
fileMatch: string[];
|
|
14
|
+
/** json schema */
|
|
15
|
+
schema: Object;
|
|
16
|
+
}[];
|
|
9
17
|
}
|
|
10
18
|
/** it is recommended to lazy load this control into its own chunk */
|
|
11
19
|
export declare function CodeEditor(props: iCodeEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isNotEmptyArray } from "@kwiz/common";
|
|
2
3
|
import Editor from '@monaco-editor/react';
|
|
3
4
|
/** it is recommended to lazy load this control into its own chunk */
|
|
4
5
|
export function CodeEditor(props) {
|
|
@@ -9,6 +10,11 @@ export function CodeEditor(props) {
|
|
|
9
10
|
// extra libraries
|
|
10
11
|
if (props.extraLibs)
|
|
11
12
|
Object.keys(props.extraLibs).forEach(key => monaco.languages.typescript.javascriptDefaults.addExtraLib(props.extraLibs[key], key));
|
|
13
|
+
if (isNotEmptyArray(props.jsonSchemaValidations))
|
|
14
|
+
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
15
|
+
validate: true,
|
|
16
|
+
schemas: props.jsonSchemaValidations
|
|
17
|
+
});
|
|
12
18
|
}, onChange: (value, ev) => {
|
|
13
19
|
props.onChange(value);
|
|
14
20
|
} })] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../src/controls/code-editor/editor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../src/controls/code-editor/editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,eAAe,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAmB1C,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,KAAuB;IAC9C,OAAO,8BACH,0BAAQ,4BAA4B,GAAS,EAC7C,KAAC,MAAM,IAAC,SAAS,EAAC,WAAW,EAAC,eAAe,EAAE,KAAK,CAAC,eAAe,EAChE,OAAO,EAAE;oBACL,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;oBAC3B,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;iBACzD,EACD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,MAAM,CAAC,EAAE;oBAClB,kBAAkB;oBAClB,IAAI,KAAK,CAAC,SAAS;wBACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CACvC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CACxF,CAAC;oBAEN,IAAI,eAAe,CAAC,KAAK,CAAC,qBAAqB,CAAC;wBAC5C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;4BACrD,QAAQ,EAAE,IAAI;4BACd,OAAO,EAAE,KAAK,CAAC,qBAAqB;yBACvC,CAAC,CAAC;gBACX,CAAC,EACD,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;oBACpB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC,GACH,IAAG,CAAC;AACd,CAAC"}
|