@kwiz/fluentui 1.0.201 → 1.0.202
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,4 +1,5 @@
|
|
|
1
1
|
import { IDictionary } from "@kwiz/common";
|
|
2
|
+
import { Monaco } from '@monaco-editor/react';
|
|
2
3
|
export interface iCodeEditorProps {
|
|
3
4
|
value: string;
|
|
4
5
|
onChange: (newValue: string) => void;
|
|
@@ -14,8 +15,8 @@ export interface iCodeEditorProps {
|
|
|
14
15
|
/** json schema */
|
|
15
16
|
schema: Object;
|
|
16
17
|
}[];
|
|
17
|
-
/** pass in the CDN to use, like: https://apps.kwizcom.com/libs/monaco-editor/4.7.0/min/vs */
|
|
18
|
-
|
|
18
|
+
/** pass in the CDN to use, like: https://apps.kwizcom.com/libs/monaco-editor/4.7.0/min/vs or a Monaco instance to overide loader.config*/
|
|
19
|
+
loaderOptions?: string | Monaco;
|
|
19
20
|
}
|
|
20
21
|
/** it is recommended to lazy load this control into its own chunk */
|
|
21
22
|
export declare function CodeEditor(props: iCodeEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isNotEmptyArray,
|
|
2
|
+
import { isNotEmptyArray, isNullOrUndefined, isString } from "@kwiz/common";
|
|
3
3
|
import { Editor, loader } from '@monaco-editor/react';
|
|
4
4
|
/** it is recommended to lazy load this control into its own chunk */
|
|
5
5
|
export function CodeEditor(props) {
|
|
6
|
-
if (
|
|
7
|
-
loader.config(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
if (!isNullOrUndefined(props.loaderOptions)) //load from our build do not load from cdn
|
|
7
|
+
loader.config(isString(props.loaderOptions)
|
|
8
|
+
? {
|
|
9
|
+
paths: {
|
|
10
|
+
vs: props.loaderOptions //'https://apps.kwizcom.com/libs/monaco-editor/4.7.0/min/vs',
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
: {
|
|
14
|
+
monaco: props.loaderOptions
|
|
15
|
+
});
|
|
12
16
|
return _jsxs(_Fragment, { children: [_jsx("style", { children: `.force-ltr{direction:ltr;}` }), _jsx(Editor, { className: "force-ltr", defaultLanguage: props.defaultLanguage, options: {
|
|
13
17
|
minimap: { enabled: false },
|
|
14
18
|
lineNumbers: props.hideLineNumbers ? "off" : undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../src/controls/code-editor/editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../src/controls/code-editor/editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAU,MAAM,sBAAsB,CAAC;AAsB9D,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,KAAuB;IAC9C,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,aAAa,CAAC,EAAC,0CAA0C;QAClF,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;YACvC,CAAC,CAAC;gBACE,KAAK,EAAE;oBACH,EAAE,EAAE,KAAK,CAAC,aAAa,CAAA,6DAA6D;iBACvF;aACJ;YACD,CAAC,CAAC;gBACE,MAAM,EAAE,KAAK,CAAC,aAAa;aAC9B,CAAC,CAAC;IAEX,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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