@finos/legend-lego 1.0.20 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/code-editor/CodeEditor.d.ts +1 -0
- package/lib/code-editor/CodeEditor.d.ts.map +1 -1
- package/lib/code-editor/CodeEditor.js +17 -6
- package/lib/code-editor/CodeEditor.js.map +1 -1
- package/lib/data-grid/DataGrid.d.ts +1 -0
- package/lib/data-grid/DataGrid.d.ts.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/package.json +14 -14
- package/src/code-editor/CodeEditor.tsx +35 -7
@@ -25,6 +25,7 @@ export declare const CodeEditor: React.FC<{
|
|
25
25
|
hideMinimap?: boolean | undefined;
|
26
26
|
hideGutter?: boolean | undefined;
|
27
27
|
hidePadding?: boolean | undefined;
|
28
|
+
hideActionBar?: boolean | undefined;
|
28
29
|
extraEditorOptions?: (monacoEditorAPI.IEditorOptions & monacoEditorAPI.IGlobalEditorOptions) | undefined;
|
29
30
|
updateInput?: ((val: string) => void) | undefined;
|
30
31
|
}>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH,OAAO,EAAoB,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,kBAAkB,CAAC,EACf,CAAC,eAAe,CAAC,cAAc,GAAG,eAAe,CAAC,oBAAoB,CAAC,GACvE,SAAS,CAAC;IACd,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACnD,
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH,OAAO,EAAoB,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,kBAAkB,CAAC,EACf,CAAC,eAAe,CAAC,cAAc,GAAG,eAAe,CAAC,oBAAoB,CAAC,GACvE,SAAS,CAAC;IACd,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACnD,CAkJA,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
/**
|
3
3
|
* Copyright (c) 2020-present, Goldman Sachs
|
4
4
|
*
|
@@ -19,11 +19,12 @@ import { editor as monacoEditorAPI } from 'monaco-editor';
|
|
19
19
|
import { disposeCodeEditor, getBaseCodeEditorOptions, resetLineNumberGutterWidth, getCodeEditorValue, normalizeLineEnding, } from './CodeEditorUtils.js';
|
20
20
|
import { DEFAULT_TAB_SIZE, useApplicationStore, } from '@finos/legend-application';
|
21
21
|
import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
|
22
|
-
import { clsx } from '@finos/legend-art';
|
22
|
+
import { clsx, WordWrapIcon } from '@finos/legend-art';
|
23
23
|
export const CodeEditor = (props) => {
|
24
|
-
const { inputValue, updateInput, lightTheme, language, isReadOnly, hideMinimap, hideGutter, hidePadding, extraEditorOptions, } = props;
|
24
|
+
const { inputValue, updateInput, lightTheme, language, isReadOnly, hideMinimap, hideGutter, hidePadding, hideActionBar, extraEditorOptions, } = props;
|
25
25
|
const applicationStore = useApplicationStore();
|
26
26
|
const [editor, setEditor] = useState();
|
27
|
+
const [isWordWrap, setIsWordWrap] = useState(false);
|
27
28
|
const onDidChangeModelContentEventDisposer = useRef(undefined);
|
28
29
|
/**
|
29
30
|
* NOTE: we want to normalize line ending here since if the original
|
@@ -35,6 +36,13 @@ export const CodeEditor = (props) => {
|
|
35
36
|
*/
|
36
37
|
const value = normalizeLineEnding(inputValue);
|
37
38
|
const textInputRef = useRef(null);
|
39
|
+
const toggleWordWrap = () => {
|
40
|
+
const updatedWordWrap = !isWordWrap;
|
41
|
+
setIsWordWrap(updatedWordWrap);
|
42
|
+
editor?.updateOptions({
|
43
|
+
wordWrap: updatedWordWrap ? 'on' : 'off',
|
44
|
+
});
|
45
|
+
};
|
38
46
|
useEffect(() => {
|
39
47
|
if (!editor && textInputRef.current) {
|
40
48
|
const element = textInputRef.current;
|
@@ -103,8 +111,11 @@ export const CodeEditor = (props) => {
|
|
103
111
|
onDidChangeModelContentEventDisposer.current?.dispose();
|
104
112
|
}
|
105
113
|
}, [editor]);
|
106
|
-
return (_jsx("div", { className: clsx('code-
|
107
|
-
|
108
|
-
|
114
|
+
return (_jsxs("div", { className: "code-editor", children: [!hideActionBar && (_jsx("div", { className: "code-editor__header", children: _jsx("button", { tabIndex: -1, className: clsx('code-editor__header__action', {
|
115
|
+
'code-editor__header__action--active': isWordWrap,
|
116
|
+
}), onClick: toggleWordWrap, title: `[${isWordWrap ? 'on' : 'off'}] Toggle word wrap`, children: _jsx(WordWrapIcon, {}) }) })), _jsx("div", { className: clsx('code-editor__content', {
|
117
|
+
'code-editor__content--padding': !hidePadding,
|
118
|
+
'code-editor__content--with__header': !hideActionBar,
|
119
|
+
}), children: _jsx("div", { className: "code-editor__body", ref: textInputRef }) })] }));
|
109
120
|
};
|
110
121
|
//# sourceMappingURL=CodeEditor.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAoB,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;G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C,aAAa,IAAI,CACjB,cAAK,SAAS,EAAC,qBAAqB,YAClC,iBACE,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,IAAI,CAAC,6BAA6B,EAAE;wBAC7C,qCAAqC,EAAE,UAAU;qBAClD,CAAC,EACF,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,oBAAoB,YAExD,KAAC,YAAY,KAAG,GACT,GACL,CACP,EACD,cACE,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE;oBACtC,+BAA+B,EAAE,CAAC,WAAW;oBAC7C,oCAAoC,EAAE,CAAC,aAAa;iBACrD,CAAC,YAEF,cAAK,SAAS,EAAC,mBAAmB,EAAC,GAAG,EAAE,YAAY,GAAI,GACpD,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
@@ -13,6 +13,7 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
+
/// <reference types="react" resolution-mode="require"/>
|
16
17
|
import { type AgReactUiProps, type AgGridReactProps } from '@ag-grid-community/react';
|
17
18
|
import { type CellMouseOverEvent, type ICellRendererParams } from '@ag-grid-community/core';
|
18
19
|
export declare function DataGrid<TData = unknown>(props: AgGridReactProps<TData> | AgReactUiProps<TData>): JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
1
|
+
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAEH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAEzB,MAAM,yBAAyB,CAAC;AAEjC,wBAAgB,QAAQ,CAAC,KAAK,GAAG,OAAO,EACtC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,GACrD,GAAG,CAAC,OAAO,CAab;AAED,eAAO,MAAM,0BAA0B,QAAO,IAE7C,CAAC;AAEF,YAAY,EACV,kBAAkB,IAAI,0BAA0B,EAChD,mBAAmB,IAAI,0BAA0B,GAClD,CAAC"}
|
package/lib/index.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/** @license @finos/legend-lego v1.0
|
1
|
+
/** @license @finos/legend-lego v1.1.0
|
2
2
|
* Copyright (c) 2020-present, Goldman Sachs
|
3
3
|
*
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -14,4 +14,4 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
@import"@ag-grid-community/styles/ag-grid.css";@import"@ag-grid-community/styles/ag-theme-balham.css";.fuzzy-search__advanced-config__panel{width:100%;background:var(--color-dark-grey-250)}.fuzzy-search__advanced-config__panel__header__label{display:flex;align-items:center;font-weight:500;color:var(--color-light-grey-50);background:var(--color-dark-grey-300);padding:0 1rem;line-height:2rem;font-size:1.2rem;cursor:default;user-select:none}.tab-manager{display:flex;flex:1;overflow:hidden;height:100%}.tab-manager__content{width:calc(100% - 2.8rem);display:flex;overflow-x:overlay}.tab-manager__tab{display:flex;align-items:center;cursor:pointer;color:var(--color-light-grey-400);background:var(--color-dark-grey-80);border-right:.1rem solid var(--color-dark-grey-50)}.tab-manager__tab--active{color:var(--color-light-grey-100);background:var(--color-dark-grey-50)}.tab-manager__tab--dragged{filter:opacity(0.7)}.tab-manager__tab__content{display:flex;align-items:center;height:100%;width:100%}.tab-manager__tab__label{height:100%;color:inherit;padding:0 .5rem 0 1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tab-manager__tab__close-btn{visibility:hidden;display:flex;align-items:center}.tab-manager__tab__close-btn svg{color:var(--color-light-grey-200);font-size:1.2rem;margin-right:1rem}.tab-manager__tab--active .tab-manager__tab__close-btn,.tab-manager__tab:hover .tab-manager__tab__close-btn{visibility:visible}.tab-manager__tab--active .tab-manager__tab__close-btn svg,.tab-manager__tab:hover .tab-manager__tab__close-btn svg{color:var(--color-light-grey-100)}.tab-manager__tab__dnd__placeholder{text-align:left;margin:0;padding:0 .5rem;background:var(--color-dark-grey-100)}.tab-manager__menu{min-width:15rem;max-width:30rem;height:100%;padding:0}.tab-manager__menu__toggler{display:flex;align-items:center;justify-content:center;flex-grow:0;flex-shrink:0;color:var(--color-light-grey-400);border-left:.1rem solid var(--color-dark-grey-50);height:100%;width:2.8rem}.tab-manager__menu__item{justify-content:space-between}.tab-manager__menu__item--active,.tab-manager__menu__item:not([disabled]):hover{background:var(--color-dark-grey-250)}.tab-manager__menu__item__label{text-align:left;white-space:nowrap;font-size:1.3rem;overflow:hidden;text-overflow:ellipsis}.tab-manager__menu__item__close-btn{display:flex;align-items:center;justify-content:center;flex-grow:0;flex-shrink:0;padding:.4rem;margin-left:.6rem;flex-direction:end}.tab-manager__menu__item__close-btn svg{width:1.2rem;height:1.2rem}.activity-bar__item .activity-bar__item__experimental-badge{display:flex;align-items:center;justify-content:center;position:absolute;top:.6rem;right:.6rem;height:1.6rem;width:1.6rem;border-radius:50%;background:var(--color-mauve-50);border:.1rem solid var(--color-dark-grey-280)}.activity-bar__item .activity-bar__item__experimental-badge svg{font-size:1.2rem;color:var(--color-dark-grey-280)}.documentation-link{display:inline-flex;align-self:center;color:var(--color-dark-grey-500);cursor:pointer}.documentation-link--inline{margin-left:.5rem}.documentation-link:hover{color:var(--color-light-grey-400)}.documentation-preview{display:flex;background:var(--color-dark-grey-85);border:.1rem solid var(--color-dark-grey-280);border-radius:.2rem}.documentation-preview__text{padding:1rem;width:calc(100% - 3rem);color:var(--color-light-grey-400);line-height:2rem}.documentation-preview__hint{display:flex;justify-content:center;padding:1rem 0;width:3rem}.monaco-editor *{font-size:1.4rem}.monaco-editor--small-font *{font-size:1.2rem}.code-
|
17
|
+
@import"@ag-grid-community/styles/ag-grid.css";@import"@ag-grid-community/styles/ag-theme-balham.css";.fuzzy-search__advanced-config__panel{width:100%;background:var(--color-dark-grey-250)}.fuzzy-search__advanced-config__panel__header__label{display:flex;align-items:center;font-weight:500;color:var(--color-light-grey-50);background:var(--color-dark-grey-300);padding:0 1rem;line-height:2rem;font-size:1.2rem;cursor:default;user-select:none}.tab-manager{display:flex;flex:1;overflow:hidden;height:100%}.tab-manager__content{width:calc(100% - 2.8rem);display:flex;overflow-x:overlay}.tab-manager__tab{display:flex;align-items:center;cursor:pointer;color:var(--color-light-grey-400);background:var(--color-dark-grey-80);border-right:.1rem solid var(--color-dark-grey-50)}.tab-manager__tab--active{color:var(--color-light-grey-100);background:var(--color-dark-grey-50)}.tab-manager__tab--dragged{filter:opacity(0.7)}.tab-manager__tab__content{display:flex;align-items:center;height:100%;width:100%}.tab-manager__tab__label{height:100%;color:inherit;padding:0 .5rem 0 1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tab-manager__tab__close-btn{visibility:hidden;display:flex;align-items:center}.tab-manager__tab__close-btn svg{color:var(--color-light-grey-200);font-size:1.2rem;margin-right:1rem}.tab-manager__tab--active .tab-manager__tab__close-btn,.tab-manager__tab:hover .tab-manager__tab__close-btn{visibility:visible}.tab-manager__tab--active .tab-manager__tab__close-btn svg,.tab-manager__tab:hover .tab-manager__tab__close-btn svg{color:var(--color-light-grey-100)}.tab-manager__tab__dnd__placeholder{text-align:left;margin:0;padding:0 .5rem;background:var(--color-dark-grey-100)}.tab-manager__menu{min-width:15rem;max-width:30rem;height:100%;padding:0}.tab-manager__menu__toggler{display:flex;align-items:center;justify-content:center;flex-grow:0;flex-shrink:0;color:var(--color-light-grey-400);border-left:.1rem solid var(--color-dark-grey-50);height:100%;width:2.8rem}.tab-manager__menu__item{justify-content:space-between}.tab-manager__menu__item--active,.tab-manager__menu__item:not([disabled]):hover{background:var(--color-dark-grey-250)}.tab-manager__menu__item__label{text-align:left;white-space:nowrap;font-size:1.3rem;overflow:hidden;text-overflow:ellipsis}.tab-manager__menu__item__close-btn{display:flex;align-items:center;justify-content:center;flex-grow:0;flex-shrink:0;padding:.4rem;margin-left:.6rem;flex-direction:end}.tab-manager__menu__item__close-btn svg{width:1.2rem;height:1.2rem}.activity-bar__item .activity-bar__item__experimental-badge{display:flex;align-items:center;justify-content:center;position:absolute;top:.6rem;right:.6rem;height:1.6rem;width:1.6rem;border-radius:50%;background:var(--color-mauve-50);border:.1rem solid var(--color-dark-grey-280)}.activity-bar__item .activity-bar__item__experimental-badge svg{font-size:1.2rem;color:var(--color-dark-grey-280)}.documentation-link{display:inline-flex;align-self:center;color:var(--color-dark-grey-500);cursor:pointer}.documentation-link--inline{margin-left:.5rem}.documentation-link:hover{color:var(--color-light-grey-400)}.documentation-preview{display:flex;background:var(--color-dark-grey-85);border:.1rem solid var(--color-dark-grey-280);border-radius:.2rem}.documentation-preview__text{padding:1rem;width:calc(100% - 3rem);color:var(--color-light-grey-400);line-height:2rem}.documentation-preview__hint{display:flex;justify-content:center;padding:1rem 0;width:3rem}.monaco-editor *{font-size:1.4rem}.monaco-editor--small-font *{font-size:1.2rem}.code-editor{height:100%;width:100%}.code-editor__content{height:100%;width:100%;position:relative;background:var(--color-dark-grey-50)}.code-editor__header{display:flex;align-items:center;padding:0 .5rem;justify-content:right;width:100%;height:2.8rem}.code-editor__header__action{display:flex;align-items:center;justify-content:center;color:var(--color-dark-grey-400);height:1.9rem;width:1.9rem}.code-editor__header__action:hover{color:var(--color-dark-grey-500)}.code-editor__header__action--active,.code-editor__header__action--active:hover{color:var(--color-light-grey-300)}.code-editor__body{height:100%;width:100%;position:absolute;top:0;left:0;overflow:hidden}.code-editor__content--padding{border-radius:.2rem}.code-editor__content--with__header{height:calc(100% - 2.8rem)}.code-editor__content--padding .code-editor__body{border-radius:.2rem}.packageable-element-option-label{display:flex;align-items:center}.packageable-element-option-label__tag{display:flex;align-items:center;color:var(--color-dark-grey-500);background:var(--color-light-grey-50);border:.1rem solid var(--color-light-grey-180);margin-left:1rem;border-radius:.2rem;font-size:1rem;padding:0 .5rem;height:1.6rem;font-weight:500}.packageable-element-option-label__name{display:flex;align-items:center;height:1.8rem}.packageable-element-option-label__type{margin:-1rem .8rem -1rem -1.2rem;height:3.2rem;padding-left:.5rem;background:rgba(0,0,0,0)}.packageable-element-option-label__type--system{background:var(--color-system)}.packageable-element-option-label__type--generated{background:var(--color-generated)}.packageable-element-option-label__type--dependency{background:var(--color-dependency)}.packageable-element-option-label--dark{display:flex;align-items:center;display:flex}.packageable-element-option-label--dark__tag{display:flex;align-items:center;color:var(--color-dark-grey-250);background:var(--color-dark-grey-400);margin-left:1rem;border-radius:.2rem;font-size:1rem;padding:0 .5rem;height:1.6rem;font-weight:500}.packageable-element-option-label--dark__name{display:flex;align-items:center;height:1.8rem}/*# sourceMappingURL=index.css.map */
|
package/lib/index.css.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../style/_data-grid.scss","../style/application/_fuzzy-search.scss","../../../node_modules/@finos/legend-art/scss/_mixins.scss","../style/application/_tab-manager.scss","../style/application/_activity-bar.scss","../style/application/_documentation-link.scss","../style/reset/_monaco-editor.scss","../style/_code-editor.scss","../style/graph-editor/_packageable-element-option-label.scss"],"names":[],"mappings":"AAgBQ,+CACA,uDCCR,sCACE,WACA,sCAEA,qDCQA,aACA,mBDNE,gBACA,iCACA,sCACA,eACA,iBACA,iBACA,eACA,iBEdJ,aACE,aACA,OACA,gBACA,YAEA,sBACE,0BACA,aACA,mBAGF,+BDCA,mBCEE,eACA,kCACA,qCACA,mDAEA,0BACE,kCACA,qCAGF,2BACE,oBAGF,2BDjBF,aACA,mBCmBI,YACA,WAGF,yBACE,YACA,cACA,uBACA,mBACA,gBACA,uBAGF,6BACE,kBDlCJ,aACA,mBCqCI,iCACE,kCACA,iBACA,kBAIJ,4GAEE,mBAEA,oHACE,kCAIJ,oCACE,gBACA,SACA,gBACA,sCAIJ,mBACE,gBACA,gBACA,YACA,UAEA,4BD1EF,aACA,mBACA,uBA2BA,YACA,cCgDI,kCACA,kDACA,YACA,aAGF,yBACE,8BAEA,gFAEE,sCAIJ,gCACE,gBACA,mBACA,iBACA,gBACA,uBAGF,oCDrGF,aACA,mBACA,uBA2BA,YACA,cC2EI,cACA,kBACA,mBAEA,wCACE,aACA,cCpHN,4DFKA,aACA,mBACA,uBEJE,kBACA,UACA,YACA,cACA,aACA,kBACA,iCACA,8CAEA,gEACE,iBACA,iCCfN,oBACE,oBACA,kBACA,iCACA,eAEA,4BACE,kBAIJ,0BACE,kCAGF,uBACE,aACA,qCACA,8CACA,oBAEA,6BACE,aACA,wBACA,kCACA,iBAGF,6BHXA,aACA,uBGaE,eACA,WClCJ,iBACE,iBAGF,6BACE,
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../style/_data-grid.scss","../style/application/_fuzzy-search.scss","../../../node_modules/@finos/legend-art/scss/_mixins.scss","../style/application/_tab-manager.scss","../style/application/_activity-bar.scss","../style/application/_documentation-link.scss","../style/reset/_monaco-editor.scss","../style/_code-editor.scss","../style/graph-editor/_packageable-element-option-label.scss"],"names":[],"mappings":"AAgBQ,+CACA,uDCCR,sCACE,WACA,sCAEA,qDCQA,aACA,mBDNE,gBACA,iCACA,sCACA,eACA,iBACA,iBACA,eACA,iBEdJ,aACE,aACA,OACA,gBACA,YAEA,sBACE,0BACA,aACA,mBAGF,+BDCA,mBCEE,eACA,kCACA,qCACA,mDAEA,0BACE,kCACA,qCAGF,2BACE,oBAGF,2BDjBF,aACA,mBCmBI,YACA,WAGF,yBACE,YACA,cACA,uBACA,mBACA,gBACA,uBAGF,6BACE,kBDlCJ,aACA,mBCqCI,iCACE,kCACA,iBACA,kBAIJ,4GAEE,mBAEA,oHACE,kCAIJ,oCACE,gBACA,SACA,gBACA,sCAIJ,mBACE,gBACA,gBACA,YACA,UAEA,4BD1EF,aACA,mBACA,uBA2BA,YACA,cCgDI,kCACA,kDACA,YACA,aAGF,yBACE,8BAEA,gFAEE,sCAIJ,gCACE,gBACA,mBACA,iBACA,gBACA,uBAGF,oCDrGF,aACA,mBACA,uBA2BA,YACA,cC2EI,cACA,kBACA,mBAEA,wCACE,aACA,cCpHN,4DFKA,aACA,mBACA,uBEJE,kBACA,UACA,YACA,cACA,aACA,kBACA,iCACA,8CAEA,gEACE,iBACA,iCCfN,oBACE,oBACA,kBACA,iCACA,eAEA,4BACE,kBAIJ,0BACE,kCAGF,uBACE,aACA,qCACA,8CACA,oBAEA,6BACE,aACA,wBACA,kCACA,iBAGF,6BHXA,aACA,uBGaE,eACA,WClCJ,iBACE,iBAGF,6BACE,iBCJF,aACE,YACA,WAEA,sBACE,YACA,WACA,kBACA,qCAGF,qBLEA,aACA,mCKCE,sBACA,WACA,cAGF,6BLbA,aACA,mBACA,uBKcE,iCACA,cACA,aAEA,mCACE,iCAGF,gFAEE,kCAIJ,mBACE,YACA,WACA,kBACA,MACA,OACA,gBAGF,+BACE,oBAGF,oCACE,2BAGF,kDACE,oBCtDJ,kCNYE,aACA,mBMVA,uCNSA,aACA,mBMPE,iCACA,sCACA,+CACA,iBACA,oBACA,eACA,gBACA,cACA,gBAGF,wCNLA,aACA,mBMOE,cAIJ,wCACE,iCACA,cACA,mBACA,yBAEA,gDACE,+BAGF,mDACE,kCAGF,oDACE,mCAIJ,wCN/BE,aACA,mBMiCA,aAEA,6CNpCA,aACA,mBMsCE,iCACA,sCACA,iBACA,oBACA,eACA,gBACA,cACA,gBAGF,8CNjDA,aACA,mBMmDE","file":"index.css"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-lego",
|
3
|
-
"version": "1.0
|
3
|
+
"version": "1.1.0",
|
4
4
|
"description": "Legend shared advanced application components and building blocks",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -47,17 +47,17 @@
|
|
47
47
|
"test:watch": "jest --watch"
|
48
48
|
},
|
49
49
|
"dependencies": {
|
50
|
-
"@ag-grid-community/client-side-row-model": "30.0.
|
51
|
-
"@ag-grid-community/core": "30.0.
|
52
|
-
"@ag-grid-community/react": "30.0.
|
53
|
-
"@ag-grid-community/styles": "30.0.
|
54
|
-
"@finos/legend-application": "15.0.
|
55
|
-
"@finos/legend-art": "7.0.
|
56
|
-
"@finos/legend-graph": "30.0.
|
57
|
-
"@finos/legend-shared": "10.0.
|
50
|
+
"@ag-grid-community/client-side-row-model": "30.0.2",
|
51
|
+
"@ag-grid-community/core": "30.0.2",
|
52
|
+
"@ag-grid-community/react": "30.0.2",
|
53
|
+
"@ag-grid-community/styles": "30.0.2",
|
54
|
+
"@finos/legend-application": "15.0.24",
|
55
|
+
"@finos/legend-art": "7.0.24",
|
56
|
+
"@finos/legend-graph": "30.0.9",
|
57
|
+
"@finos/legend-shared": "10.0.15",
|
58
58
|
"@types/css-font-loading-module": "0.0.8",
|
59
|
-
"@types/react": "18.2.
|
60
|
-
"@types/react-dom": "18.2.
|
59
|
+
"@types/react": "18.2.13",
|
60
|
+
"@types/react-dom": "18.2.6",
|
61
61
|
"mobx": "6.9.0",
|
62
62
|
"mobx-react-lite": "3.4.3",
|
63
63
|
"monaco-editor": "0.39.0",
|
@@ -66,14 +66,14 @@
|
|
66
66
|
"react-dom": "18.2.0"
|
67
67
|
},
|
68
68
|
"devDependencies": {
|
69
|
-
"@finos/legend-dev-utils": "2.0.
|
69
|
+
"@finos/legend-dev-utils": "2.0.69",
|
70
70
|
"@jest/globals": "29.5.0",
|
71
71
|
"cross-env": "7.0.3",
|
72
|
-
"eslint": "8.
|
72
|
+
"eslint": "8.43.0",
|
73
73
|
"jest": "29.5.0",
|
74
74
|
"npm-run-all": "4.1.5",
|
75
75
|
"rimraf": "5.0.1",
|
76
|
-
"sass": "1.63.
|
76
|
+
"sass": "1.63.4",
|
77
77
|
"typescript": "5.1.3"
|
78
78
|
},
|
79
79
|
"peerDependencies": {
|
@@ -29,7 +29,7 @@ import {
|
|
29
29
|
useApplicationStore,
|
30
30
|
} from '@finos/legend-application';
|
31
31
|
import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
|
32
|
-
import { clsx } from '@finos/legend-art';
|
32
|
+
import { clsx, WordWrapIcon } from '@finos/legend-art';
|
33
33
|
|
34
34
|
export const CodeEditor: React.FC<{
|
35
35
|
inputValue: string;
|
@@ -39,6 +39,7 @@ export const CodeEditor: React.FC<{
|
|
39
39
|
hideMinimap?: boolean | undefined;
|
40
40
|
hideGutter?: boolean | undefined;
|
41
41
|
hidePadding?: boolean | undefined;
|
42
|
+
hideActionBar?: boolean | undefined;
|
42
43
|
extraEditorOptions?:
|
43
44
|
| (monacoEditorAPI.IEditorOptions & monacoEditorAPI.IGlobalEditorOptions)
|
44
45
|
| undefined;
|
@@ -53,12 +54,14 @@ export const CodeEditor: React.FC<{
|
|
53
54
|
hideMinimap,
|
54
55
|
hideGutter,
|
55
56
|
hidePadding,
|
57
|
+
hideActionBar,
|
56
58
|
extraEditorOptions,
|
57
59
|
} = props;
|
58
60
|
const applicationStore = useApplicationStore();
|
59
61
|
const [editor, setEditor] = useState<
|
60
62
|
monacoEditorAPI.IStandaloneCodeEditor | undefined
|
61
63
|
>();
|
64
|
+
const [isWordWrap, setIsWordWrap] = useState(false);
|
62
65
|
const onDidChangeModelContentEventDisposer = useRef<IDisposable | undefined>(
|
63
66
|
undefined,
|
64
67
|
);
|
@@ -74,6 +77,14 @@ export const CodeEditor: React.FC<{
|
|
74
77
|
const value = normalizeLineEnding(inputValue);
|
75
78
|
const textInputRef = useRef<HTMLDivElement>(null);
|
76
79
|
|
80
|
+
const toggleWordWrap = (): void => {
|
81
|
+
const updatedWordWrap = !isWordWrap;
|
82
|
+
setIsWordWrap(updatedWordWrap);
|
83
|
+
editor?.updateOptions({
|
84
|
+
wordWrap: updatedWordWrap ? 'on' : 'off',
|
85
|
+
});
|
86
|
+
};
|
87
|
+
|
77
88
|
useEffect(() => {
|
78
89
|
if (!editor && textInputRef.current) {
|
79
90
|
const element = textInputRef.current;
|
@@ -154,12 +165,29 @@ export const CodeEditor: React.FC<{
|
|
154
165
|
);
|
155
166
|
|
156
167
|
return (
|
157
|
-
<div
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
168
|
+
<div className="code-editor">
|
169
|
+
{!hideActionBar && (
|
170
|
+
<div className="code-editor__header">
|
171
|
+
<button
|
172
|
+
tabIndex={-1}
|
173
|
+
className={clsx('code-editor__header__action', {
|
174
|
+
'code-editor__header__action--active': isWordWrap,
|
175
|
+
})}
|
176
|
+
onClick={toggleWordWrap}
|
177
|
+
title={`[${isWordWrap ? 'on' : 'off'}] Toggle word wrap`}
|
178
|
+
>
|
179
|
+
<WordWrapIcon />
|
180
|
+
</button>
|
181
|
+
</div>
|
182
|
+
)}
|
183
|
+
<div
|
184
|
+
className={clsx('code-editor__content', {
|
185
|
+
'code-editor__content--padding': !hidePadding,
|
186
|
+
'code-editor__content--with__header': !hideActionBar,
|
187
|
+
})}
|
188
|
+
>
|
189
|
+
<div className="code-editor__body" ref={textInputRef} />
|
190
|
+
</div>
|
163
191
|
</div>
|
164
192
|
);
|
165
193
|
};
|