@finos/legend-application 0.0.6 → 0.0.10
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.
- package/CHANGELOG.md +12 -0
- package/lib/components/ActionAlert.js +2 -2
- package/lib/components/ActionAlert.js.map +1 -1
- package/lib/components/LambdaEditor.d.ts +42 -0
- package/lib/components/LambdaEditor.d.ts.map +1 -1
- package/lib/components/LambdaEditor.js +173 -14
- package/lib/components/LambdaEditor.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/package.json +13 -13
- package/src/components/ActionAlert.tsx +2 -2
- package/src/components/LambdaEditor.tsx +353 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @finos/legend-application
|
|
2
2
|
|
|
3
|
+
## 0.0.10
|
|
4
|
+
|
|
5
|
+
## 0.0.9
|
|
6
|
+
|
|
7
|
+
## 0.0.8
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#506](https://github.com/finos/legend-studio/pull/506) [`4fd0d256`](https://github.com/finos/legend-studio/commit/4fd0d2560ef245d97f1d86a4a6ed227a9c3d2cbe) ([@akphi](https://github.com/akphi)) - Add popup mode for `LambdaEditor` to allow more spaces for users to work with big lambdas. Also, document `LambdaEditor` props and add 2 new flags to disable `expansion` mode and `popup` mode.
|
|
12
|
+
|
|
13
|
+
## 0.0.7
|
|
14
|
+
|
|
3
15
|
## 0.0.6
|
|
4
16
|
|
|
5
17
|
## 0.0.5
|
|
@@ -37,7 +37,7 @@ const ActionAlertInner = observer((props) => {
|
|
|
37
37
|
onClose?.();
|
|
38
38
|
applicationStore.setActionAltertInfo(undefined);
|
|
39
39
|
};
|
|
40
|
-
const
|
|
40
|
+
const handleEnter = () => onEnter?.();
|
|
41
41
|
const handleSubmit = () => {
|
|
42
42
|
const proceedActions = actions.filter((action) => action.default);
|
|
43
43
|
if (proceedActions.length) {
|
|
@@ -50,7 +50,7 @@ const ActionAlertInner = observer((props) => {
|
|
|
50
50
|
handleSubmit();
|
|
51
51
|
};
|
|
52
52
|
return (_jsx(Dialog, Object.assign({ open: Boolean(applicationStore.actionAlertInfo), onClose: noop, TransitionProps: {
|
|
53
|
-
onEnter:
|
|
53
|
+
onEnter: handleEnter,
|
|
54
54
|
} }, { children: _jsxs("form", Object.assign({ onSubmit: onSubmit, className: `modal search-modal modal--dark blocking-alert blocking-alert--${(type ?? ActionAlertType.STANDARD).toLowerCase()}` }, { children: [title && (_jsx("div", Object.assign({ className: "modal__header" }, { children: _jsx("div", Object.assign({ className: "modal__title" }, { children: _jsx("div", Object.assign({ className: "modal__title__label" }, { children: title }), void 0) }), void 0) }), void 0)), _jsxs("div", Object.assign({ className: "modal__body" }, { children: [_jsx("div", Object.assign({ className: "blocking-alert__summary-text" }, { children: message }), void 0), _jsx("div", Object.assign({ className: "blocking-alert__prompt-text" }, { children: prompt }), void 0)] }), void 0), _jsxs("div", Object.assign({ className: "modal__footer" }, { children: [actions.map((action) => {
|
|
55
55
|
// NOTE: need to prevent default for the submit button, otherwise, we would get the warning "Form submission canceled because the form is not connected"
|
|
56
56
|
// See https://stackoverflow.com/a/58234405
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionAlert.js","sourceRoot":"","sources":["../../src/components/ActionAlert.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EACL,qBAAqB,EACrB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,wBAAwB,GAAG,CAAC,IAA2B,EAAU,EAAE;IACvE,QAAQ,IAAI,EAAE;QACZ,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AC;IAC/C,MAAM,eAAe,GAAG,gBAAgB,CAAC,eAAe,CAAC;IAEzD,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAC,gBAAgB,IAAC,IAAI,EAAE,eAAe,WAAI,CAAC;AACrD,CAAC,CAAC,CAAC"}
|
|
@@ -36,11 +36,53 @@ export declare const LambdaEditor: ((props: {
|
|
|
36
36
|
expectedType?: Type | undefined;
|
|
37
37
|
matchedExpectedType?: (() => boolean) | undefined;
|
|
38
38
|
onExpectedTypeLabelSelect?: (() => void) | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* As backdrop element is often shared in the application, and there could be multiple
|
|
41
|
+
* editor using that backdrop, we could end up in situation where some such editors
|
|
42
|
+
* have parser errors and some don't (this can happen when user make edits very quickly 2 lambda
|
|
43
|
+
* editor and causes parsers error simultaneously). In this case, we want to make sure when
|
|
44
|
+
* parser error is fixed in one editor, the backdrop is not dismissed immediately.
|
|
45
|
+
*
|
|
46
|
+
* NOTE: the current approach has a critical flaw, where on the same screen, there could be multiple
|
|
47
|
+
* sets of lambda editors with different values for `forceBackdrop`. So really, the only way to
|
|
48
|
+
* accomondate for this is to have `forceBackdrop` as a global value. Or we should get rid of this
|
|
49
|
+
* backdrop mechanism altogether as it's not really a good UX pattern. i.e. quick evaluation makes
|
|
50
|
+
* us believe that this is a good option, user will lose what they type, but the most recent parsable
|
|
51
|
+
* input will still be captured.
|
|
52
|
+
*/
|
|
39
53
|
forceBackdrop: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* (de)activator for backdrop that is usually used to block any background interactions
|
|
56
|
+
* while there is a parser error in the editor
|
|
57
|
+
*/
|
|
40
58
|
backdropSetter?: ((val: boolean) => void) | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* To whether or not disable expasipn toggler
|
|
61
|
+
*/
|
|
62
|
+
disableExpansion?: boolean | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* To whether show the inline editor in expanded mode initially and
|
|
65
|
+
* disable expansion toggler
|
|
66
|
+
*
|
|
67
|
+
* This flag will override the effect of `forceExpansion`
|
|
68
|
+
*/
|
|
41
69
|
forceExpansion?: boolean | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* To whether or not disable popup mode
|
|
72
|
+
*/
|
|
73
|
+
disablePopUp?: boolean | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* To whether or not style inline editor
|
|
76
|
+
*/
|
|
42
77
|
useBaseTextEditorSettings?: boolean | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* To whether or not hide parser error bar in inline mode
|
|
80
|
+
*/
|
|
43
81
|
hideErrorBar?: boolean | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Allow adding hotkeys handler to the editor, this is usually used
|
|
84
|
+
* to allow activating global hotkeys while typing in the editor
|
|
85
|
+
*/
|
|
44
86
|
onKeyDownEventHandlers?: LambdaEditorOnKeyDownEventHandler[];
|
|
45
87
|
}) => JSX.Element) & {
|
|
46
88
|
displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LambdaEditor.d.ts","sourceRoot":"","sources":["../../src/components/LambdaEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"LambdaEditor.d.ts","sourceRoot":"","sources":["../../src/components/LambdaEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,eAAe,CAAC;AAgBjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIrE,OAAO,KAAK,EAAe,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAO7D,oBAAY,iCAAiC,GAAG;IAC9C,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC;IAC5C,MAAM,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CACzC,CAAC;AA+mBF;;;GAGG;AACH,eAAO,MAAM,YAAY;gBAET,MAAM,GAAG,SAAS;cACpB,OAAO;uBACE,iBAAiB;IACpC;;;;OAIG;mBACY,IAAI,GAAG,SAAS;0BACT,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS;gCACrB,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS;IACpD;;;;;;;;;;;;;OAaG;mBACY,OAAO;IACtB;;;OAGG;4BACqB,OAAO,KAAK,IAAI;IACxC;;OAEG;uBACgB,OAAO,GAAG,SAAS;IACtC;;;;;OAKG;qBACc,OAAO,GAAG,SAAS;IACpC;;OAEG;mBACY,OAAO,GAAG,SAAS;IAClC;;OAEG;gCACyB,OAAO,GAAG,SAAS;IAC/C;;OAEG;mBACY,OAAO,GAAG,SAAS;IAClC;;;OAGG;6BACsB,iCAAiC,EAAE;;;CAiG/D,CAAC"}
|
|
@@ -19,13 +19,14 @@ import { editor as monacoEditorAPI } from 'monaco-editor';
|
|
|
19
19
|
import { observer } from 'mobx-react-lite';
|
|
20
20
|
import { useResizeDetector } from 'react-resize-detector';
|
|
21
21
|
import { clsx, setErrorMarkers, disposeEditor, disableEditorHotKeys, baseTextEditorSettings, } from '@finos/legend-art';
|
|
22
|
-
import { FaLongArrowAltDown, FaLongArrowAltUp } from 'react-icons/fa';
|
|
23
|
-
import { debounce } from '@finos/legend-shared';
|
|
22
|
+
import { FaLongArrowAltDown, FaLongArrowAltUp, FaWindowMaximize, } from 'react-icons/fa';
|
|
23
|
+
import { noop, debounce } from '@finos/legend-shared';
|
|
24
24
|
import { flowResult } from 'mobx';
|
|
25
25
|
import { ParserError } from '@finos/legend-graph';
|
|
26
26
|
import { APPLICATION_TEST_ID } from './ApplicationTestID';
|
|
27
27
|
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
28
28
|
import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const';
|
|
29
|
+
import { Dialog } from '@material-ui/core';
|
|
29
30
|
const LambdaErrorFeedback = (props) => {
|
|
30
31
|
const { error, discardChanges } = props;
|
|
31
32
|
if (!error) {
|
|
@@ -33,8 +34,8 @@ const LambdaErrorFeedback = (props) => {
|
|
|
33
34
|
}
|
|
34
35
|
return (_jsxs("div", Object.assign({ className: "lambda-editor__error-feedback" }, { children: [_jsx("div", Object.assign({ className: "lambda-editor__error-feedback__error__message" }, { children: error.message }), void 0), error instanceof ParserError && (_jsx("div", Object.assign({ className: "lambda-editor__error-feedback__parsing-error__content" }, { children: _jsx("button", Object.assign({ className: "lambda-editor__error-feedback__parsing-error__discard-changes-btn", onClick: discardChanges, tabIndex: -1 }, { children: "Discard Changes" }), void 0) }), void 0))] }), void 0));
|
|
35
36
|
};
|
|
36
|
-
const
|
|
37
|
-
const { className, disabled, lambdaEditorState, transformStringToLambda, expectedType, onExpectedTypeLabelSelect, matchedExpectedType, forceBackdrop, backdropSetter, forceExpansion, useBaseTextEditorSettings, hideErrorBar, onKeyDownEventHandlers, } = props;
|
|
37
|
+
const LambdaEditorInline = observer((props) => {
|
|
38
|
+
const { className, disabled, lambdaEditorState, transformStringToLambda, expectedType, onExpectedTypeLabelSelect, matchedExpectedType, forceBackdrop, backdropSetter, disableExpansion, forceExpansion, disablePopUp, useBaseTextEditorSettings, hideErrorBar, onKeyDownEventHandlers, openInPopUp, } = props;
|
|
38
39
|
const applicationStore = useApplicationStore();
|
|
39
40
|
const onDidChangeModelContentEventDisposer = useRef(undefined);
|
|
40
41
|
const onKeyDownEventDisposer = useRef(undefined);
|
|
@@ -44,10 +45,10 @@ const LambdaEditorInner = observer((props) => {
|
|
|
44
45
|
const selectTypeLabel = () => onExpectedTypeLabelSelect?.();
|
|
45
46
|
const [isExpanded, setExpanded] = useState(Boolean(forceExpansion));
|
|
46
47
|
const [editor, setEditor] = useState();
|
|
47
|
-
const
|
|
48
|
-
const transformLambdaToString = (pretty) => {
|
|
48
|
+
const textInputRef = useRef(null);
|
|
49
|
+
const transformLambdaToString = async (pretty) => {
|
|
49
50
|
transformStringToLambda?.cancel();
|
|
50
|
-
return flowResult(lambdaEditorState.convertLambdaObjectToGrammarString(pretty)).catch(applicationStore.alertIllegalUnhandledError);
|
|
51
|
+
return await flowResult(lambdaEditorState.convertLambdaObjectToGrammarString(pretty)).catch(applicationStore.alertIllegalUnhandledError);
|
|
51
52
|
};
|
|
52
53
|
const discardChanges = applicationStore.guaranteeSafeAction(() => transformLambdaToString(isExpanded));
|
|
53
54
|
const toggleExpandedMode = () => {
|
|
@@ -63,8 +64,8 @@ const LambdaEditorInner = observer((props) => {
|
|
|
63
64
|
}
|
|
64
65
|
}, [editor, width, height]);
|
|
65
66
|
useEffect(() => {
|
|
66
|
-
if (!editor &&
|
|
67
|
-
const element =
|
|
67
|
+
if (!editor && textInputRef.current) {
|
|
68
|
+
const element = textInputRef.current;
|
|
68
69
|
const lambdaEditorOptions = useBaseTextEditorSettings
|
|
69
70
|
? {}
|
|
70
71
|
: {
|
|
@@ -119,6 +120,8 @@ const LambdaEditorInner = observer((props) => {
|
|
|
119
120
|
}
|
|
120
121
|
else if (!forceBackdrop) {
|
|
121
122
|
// make sure the backdrop is no longer `needed` for blocking by another parser error before hiding it
|
|
123
|
+
// NOTE: this has a serious drawback, see the documentation for `forceBackdrop` prop of `LambdaEditor`
|
|
124
|
+
// for better context
|
|
122
125
|
backdropSetter(false);
|
|
123
126
|
}
|
|
124
127
|
}
|
|
@@ -226,22 +229,176 @@ const LambdaEditorInner = observer((props) => {
|
|
|
226
229
|
}, [editor]); // dispose editor
|
|
227
230
|
return (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({ className: clsx('lambda-editor', className, {
|
|
228
231
|
'lambda-editor__expanded': isExpanded,
|
|
229
|
-
}) }, { children: [_jsx("div", Object.assign({ ref: ref, "data-testid": APPLICATION_TEST_ID.LAMBDA_EDITOR__EDITOR_INPUT, className: "lambda-editor__editor__input" }, { children: _jsx("div", { className: "text-editor__body", ref:
|
|
232
|
+
}) }, { children: [_jsx("div", Object.assign({ ref: ref, "data-testid": APPLICATION_TEST_ID.LAMBDA_EDITOR__EDITOR_INPUT, className: "lambda-editor__editor__input" }, { children: _jsx("div", { className: "text-editor__body", ref: textInputRef }, void 0) }), void 0), Boolean(expectedType) && (_jsxs("div", Object.assign({ className: "lambda-editor__editor__info" }, { children: [onExpectedTypeLabelSelect && (_jsx("button", Object.assign({ className: clsx('lambda-editor__editor__expected-return-type lambda-editor__editor__expected-return-type--clickable', {
|
|
230
233
|
'lambda-editor__editor__expected-return-type--highlighted': matchedExpectedType?.(),
|
|
231
234
|
}), onClick: selectTypeLabel, tabIndex: -1, title: 'Toggle highlight expected type' }, { children: expectedType?.name ?? 'unknown' }), void 0)), !onExpectedTypeLabelSelect && (_jsx("div", Object.assign({ className: clsx('lambda-editor__editor__expected-return-type', {
|
|
232
235
|
'lambda-editor__editor__expected-return-type--highlighted': matchedExpectedType?.(),
|
|
233
|
-
}) }, { children: expectedType?.name ?? 'unknown' }), void 0))] }), void 0)), !forceExpansion && (_jsx("button", Object.assign({ className: "lambda-editor__editor__expand-btn", onClick: toggleExpandedMode, disabled: Boolean(parserError), tabIndex: -1, title: "Toggle Expand" }, { children: isExpanded ? _jsx(FaLongArrowAltUp, {}, void 0) : _jsx(FaLongArrowAltDown, {}, void 0) }), void 0))] }), void 0), !hideErrorBar && (_jsx(LambdaErrorFeedback, { error: parserError ?? compilationError, discardChanges: discardChanges }, void 0))] }, void 0));
|
|
236
|
+
}) }, { children: expectedType?.name ?? 'unknown' }), void 0))] }), void 0)), !disableExpansion && !forceExpansion && (_jsx("button", Object.assign({ className: "lambda-editor__editor__expand-btn", onClick: toggleExpandedMode, disabled: Boolean(parserError), tabIndex: -1, title: "Toggle Expand" }, { children: isExpanded ? _jsx(FaLongArrowAltUp, {}, void 0) : _jsx(FaLongArrowAltDown, {}, void 0) }), void 0)), !disablePopUp && (_jsx("button", Object.assign({ className: "lambda-editor__action", onClick: openInPopUp, disabled: Boolean(parserError), tabIndex: -1, title: "Open..." }, { children: _jsx(FaWindowMaximize, {}, void 0) }), void 0))] }), void 0), !hideErrorBar && (_jsx(LambdaErrorFeedback, { error: parserError ?? compilationError, discardChanges: discardChanges }, void 0))] }, void 0));
|
|
237
|
+
});
|
|
238
|
+
const LambdaEditorPopUp = observer((props) => {
|
|
239
|
+
const { className, disabled, lambdaEditorState, transformStringToLambda, onKeyDownEventHandlers, onClose, } = props;
|
|
240
|
+
const applicationStore = useApplicationStore();
|
|
241
|
+
const onKeyDownEventDisposer = useRef(undefined);
|
|
242
|
+
const onDidChangeModelContentEventDisposer = useRef(undefined);
|
|
243
|
+
const value = lambdaEditorState.lambdaString;
|
|
244
|
+
const parserError = lambdaEditorState.parserError;
|
|
245
|
+
const compilationError = lambdaEditorState.compilationError;
|
|
246
|
+
// const selectTypeLabel = (): void => onExpectedTypeLabelSelect?.();
|
|
247
|
+
const [editor, setEditor] = useState();
|
|
248
|
+
const textInputRef = useRef(null);
|
|
249
|
+
const transformLambdaToString = async (pretty) => {
|
|
250
|
+
transformStringToLambda?.cancel();
|
|
251
|
+
return await flowResult(lambdaEditorState.convertLambdaObjectToGrammarString(pretty)).catch(applicationStore.alertIllegalUnhandledError);
|
|
252
|
+
};
|
|
253
|
+
const discardChanges = applicationStore.guaranteeSafeAction(() => transformLambdaToString(true));
|
|
254
|
+
const { ref, width, height } = useResizeDetector();
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
if (width !== undefined && height !== undefined) {
|
|
257
|
+
editor?.layout({ width, height });
|
|
258
|
+
}
|
|
259
|
+
}, [editor, width, height]);
|
|
260
|
+
const onEnter = () => {
|
|
261
|
+
if (!editor && textInputRef.current) {
|
|
262
|
+
const element = textInputRef.current;
|
|
263
|
+
const _editor = monacoEditorAPI.create(element, {
|
|
264
|
+
...baseTextEditorSettings,
|
|
265
|
+
language: EDITOR_LANGUAGE.PURE,
|
|
266
|
+
theme: EDITOR_THEME.LEGEND,
|
|
267
|
+
});
|
|
268
|
+
disableEditorHotKeys(_editor);
|
|
269
|
+
setEditor(_editor);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
if (editor) {
|
|
273
|
+
/**
|
|
274
|
+
* See the extensive note about this instantiation in `LambdaEditor`. The fact that `transformStringToLambda` can change
|
|
275
|
+
* since it does not solely depends on `LambdaEditorState` but also the `disabled` flag means that the update function
|
|
276
|
+
* can go stale, so we cannot place this `onDidChangeModelContent` in a one-time called instantiation of the editor
|
|
277
|
+
* (i.e. the first `useEffect` where we create the editor). As such, we have to use refs and disposer to update this every time
|
|
278
|
+
* the lambda editor is re-rendered.
|
|
279
|
+
*
|
|
280
|
+
* A potential bug that could come up if we place this logic in the `useEffect` for instantiating the editor is:
|
|
281
|
+
* 1. Initially set the `disabled` to true, then switch it back to `false` (using a timer or something)
|
|
282
|
+
* 2. Type something in the lambda editor, the transform function is `undefined` and does not update the underlying lambda
|
|
283
|
+
*/
|
|
284
|
+
onDidChangeModelContentEventDisposer.current?.dispose();
|
|
285
|
+
onDidChangeModelContentEventDisposer.current =
|
|
286
|
+
editor.onDidChangeModelContent(() => {
|
|
287
|
+
const currentVal = editor.getValue();
|
|
288
|
+
/**
|
|
289
|
+
* Avoid unecessary setting of lambda string. Also, this prevents clearing the non-parser error on first render.
|
|
290
|
+
* Since this method is guaranteed to be called one time during the first rendering when we first set the
|
|
291
|
+
* value for the lambda editor, we do not want to clear any existing non-parser error in case it is set by methods
|
|
292
|
+
* like reveal error in each editor
|
|
293
|
+
*/
|
|
294
|
+
if (currentVal !== lambdaEditorState.lambdaString) {
|
|
295
|
+
lambdaEditorState.setLambdaString(currentVal);
|
|
296
|
+
/**
|
|
297
|
+
* Here we clear the error as user changes the input
|
|
298
|
+
* NOTE: we don't reset the parser error here, we could, but with that, we have to assume that the parsing check is
|
|
299
|
+
* pretty quick--almost near real time, but if after typing new character, we clear the parsing error and the user
|
|
300
|
+
* still make mistake, then the warning message will appear to flash, which is bad UX, so for now, we leave it be
|
|
301
|
+
*/
|
|
302
|
+
lambdaEditorState.setCompilationError(undefined);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* This method MUST run on the first rendering of the lambda editor, as it will update the lambda object. This is
|
|
306
|
+
* needed for new lambda where a lot of time is just a stub lambda. Without having this method called on the first
|
|
307
|
+
* rendering, that stub lambda will remain stub lambda until user starts typing something in the lambda editor.
|
|
308
|
+
* This stub lambda sometimes does not even get registered in change detection and causing the user to lose data
|
|
309
|
+
* Although, technically a stub lambda is useless, so this is not too serious, but it may come across as buggy
|
|
310
|
+
*/
|
|
311
|
+
transformStringToLambda?.cancel();
|
|
312
|
+
if (transformStringToLambda) {
|
|
313
|
+
const stringToLambdaTransformation = transformStringToLambda();
|
|
314
|
+
if (stringToLambdaTransformation) {
|
|
315
|
+
flowResult(stringToLambdaTransformation).catch(applicationStore.alertIllegalUnhandledError);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
// set hotkeys (before calling the action, finish parsing the current text value)
|
|
320
|
+
onKeyDownEventDisposer.current?.dispose(); // dispose to avoid trigger hotkeys multiple times
|
|
321
|
+
/**
|
|
322
|
+
* NOTE: We can use `setCommand` here but that does not expose the event so we cannot `stopPropagation`, and we need to
|
|
323
|
+
* use `stopPropagation` to prevent the event top bubble up to global hotkeys listener.
|
|
324
|
+
* If we really want to use `setCommand` the other approach is to set <HotKeys/> around this lambda editor to override F9
|
|
325
|
+
* perhaps that's the cleaner approach because we use `react-hotkeys` to handle it's business, but there is an on-going
|
|
326
|
+
* issue with <HotKeys/> keybindings are lost when component rerenders and this happen as users type because we call `setValue`
|
|
327
|
+
* See https://github.com/greena13/react-hotkeys/issues/209
|
|
328
|
+
*
|
|
329
|
+
* The main role of this section is to disable `monaco-editor` command and override with global actions, such as generate, compile,
|
|
330
|
+
* toggle text mode, etc. The important thing is before we do so, we would like to finish the parsing of the current string, otherwise,
|
|
331
|
+
* those operations can end up flushing the current state and trashing the user input, which is bad, as such, we make sure the
|
|
332
|
+
* parsing passes before actually calling those global operations.
|
|
333
|
+
*/
|
|
334
|
+
onKeyDownEventDisposer.current = editor.onKeyDown((event) => {
|
|
335
|
+
onKeyDownEventHandlers.forEach((handler) => {
|
|
336
|
+
if (handler.matcher(event)) {
|
|
337
|
+
event.preventDefault();
|
|
338
|
+
event.stopPropagation();
|
|
339
|
+
transformStringToLambda?.cancel();
|
|
340
|
+
handler.action(event);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
// Set the text value
|
|
345
|
+
const currentValue = editor.getValue();
|
|
346
|
+
const editorModel = editor.getModel();
|
|
347
|
+
const currentConfig = editor.getRawOptions();
|
|
348
|
+
if (currentValue !== value) {
|
|
349
|
+
editor.setValue(value);
|
|
350
|
+
}
|
|
351
|
+
if (currentConfig.readOnly !== disabled) {
|
|
352
|
+
editor.updateOptions({
|
|
353
|
+
readOnly: disabled,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
// Set the errors
|
|
357
|
+
if (editorModel) {
|
|
358
|
+
editorModel.updateOptions({ tabSize: TAB_SIZE });
|
|
359
|
+
const error = parserError ?? compilationError;
|
|
360
|
+
if (error?.sourceInformation) {
|
|
361
|
+
setErrorMarkers(editorModel, error.message, error.sourceInformation.startLine, error.sourceInformation.startColumn, error.sourceInformation.endLine, error.sourceInformation.endColumn);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
monacoEditorAPI.setModelMarkers(editorModel, 'Error', []);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
useEffect(() => {
|
|
369
|
+
flowResult(lambdaEditorState.convertLambdaObjectToGrammarString(true)).catch(applicationStore.alertIllegalUnhandledError);
|
|
370
|
+
}, [applicationStore, lambdaEditorState]);
|
|
371
|
+
useEffect(() => () => {
|
|
372
|
+
if (editor) {
|
|
373
|
+
disposeEditor(editor);
|
|
374
|
+
}
|
|
375
|
+
}, [editor]); // dispose editor
|
|
376
|
+
return (_jsx(Dialog, Object.assign({ open: true, TransitionProps: {
|
|
377
|
+
onEnter,
|
|
378
|
+
}, onClose: noop, classes: {
|
|
379
|
+
root: 'editor-modal__root-container',
|
|
380
|
+
container: 'editor-modal__container',
|
|
381
|
+
paper: 'editor-modal__content',
|
|
382
|
+
} }, { children: _jsxs("div", Object.assign({ className: clsx('modal modal--dark editor-modal lambda-editor__popup__modal', {
|
|
383
|
+
'lambda-editor__popup__modal--has-error': Boolean(lambdaEditorState.parserError),
|
|
384
|
+
}) }, { children: [_jsxs("div", Object.assign({ className: "modal__header" }, { children: [_jsx("div", Object.assign({ className: "modal__title" }, { children: "Edit Lambda" }), void 0), lambdaEditorState.parserError && (_jsx("div", Object.assign({ className: "modal__title__error-badge" }, { children: "Failed to parse lambda" }), void 0))] }), void 0), _jsx("div", Object.assign({ className: "modal__body" }, { children: _jsx("div", Object.assign({ className: clsx('lambda-editor__popup__content', className) }, { children: _jsx("div", Object.assign({ ref: ref, "data-testid": APPLICATION_TEST_ID.LAMBDA_EDITOR__EDITOR_INPUT, className: "lambda-editor__editor__input" }, { children: _jsx("div", { className: "text-editor__body", ref: textInputRef }, void 0) }), void 0) }), void 0) }), void 0), _jsxs("div", Object.assign({ className: "modal__footer" }, { children: [_jsx("button", Object.assign({ className: "btn btn--dark btn--caution", onClick: discardChanges }, { children: "Discard changes" }), void 0), _jsx("button", Object.assign({ className: "btn btn--dark", onClick: onClose, disabled: Boolean(lambdaEditorState.parserError) }, { children: "Close" }), void 0)] }), void 0)] }), void 0) }), void 0));
|
|
234
385
|
});
|
|
235
386
|
/**
|
|
236
387
|
* This is not strictly meant for lambda. The idea is to create an editor that allows
|
|
237
388
|
* editing _something_ but allows user to edit via text.
|
|
238
389
|
*/
|
|
239
390
|
export const LambdaEditor = observer((props) => {
|
|
240
|
-
const { className, lambdaEditorState, disabled, forceBackdrop, backdropSetter, expectedType, onExpectedTypeLabelSelect, matchedExpectedType, forceExpansion, useBaseTextEditorSettings, hideErrorBar, onKeyDownEventHandlers, } = props;
|
|
391
|
+
const { className, lambdaEditorState, disabled, forceBackdrop, backdropSetter, expectedType, onExpectedTypeLabelSelect, matchedExpectedType, disableExpansion, forceExpansion, disablePopUp, useBaseTextEditorSettings, hideErrorBar, onKeyDownEventHandlers, } = props;
|
|
392
|
+
const [showPopUp, setShowPopUp] = useState(false);
|
|
393
|
+
const openInPopUp = () => setShowPopUp(true);
|
|
394
|
+
const closePopUp = () => setShowPopUp(false);
|
|
241
395
|
const debouncedTransformStringToLambda = useMemo(() => disabled
|
|
242
396
|
? undefined
|
|
243
397
|
: debounce(() => lambdaEditorState.convertLambdaGrammarStringToObject(), 1000), [lambdaEditorState, disabled]);
|
|
244
|
-
|
|
398
|
+
if (!disablePopUp && showPopUp) {
|
|
399
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "lambda-editor" }, void 0), _jsx(LambdaEditorPopUp, { className: className, disabled: disabled, lambdaEditorState: lambdaEditorState, transformStringToLambda: debouncedTransformStringToLambda, onKeyDownEventHandlers: onKeyDownEventHandlers ?? [], onClose: closePopUp }, void 0)] }, void 0));
|
|
400
|
+
}
|
|
401
|
+
return (_jsx(LambdaEditorInline
|
|
245
402
|
/**
|
|
246
403
|
* See the usage of `transformStringToLambda` as well as the instatiation of the editor in `LambdaEditorInner`.
|
|
247
404
|
* One of the big problem is that the editor uses lambda editor state (there are some non-trivial logic there, that
|
|
@@ -266,6 +423,8 @@ export const LambdaEditor = observer((props) => {
|
|
|
266
423
|
* So technically, we don't need to do the force-remount using `key`, but to be cleaner, we prevent other poential bugs, we do it anyway
|
|
267
424
|
* to reset everything.
|
|
268
425
|
*/
|
|
269
|
-
, { className: className, disabled: disabled, lambdaEditorState: lambdaEditorState, transformStringToLambda: debouncedTransformStringToLambda, expectedType: expectedType, matchedExpectedType: matchedExpectedType, onExpectedTypeLabelSelect: onExpectedTypeLabelSelect, forceBackdrop: forceBackdrop, backdropSetter: backdropSetter,
|
|
426
|
+
, { className: className, disabled: disabled, lambdaEditorState: lambdaEditorState, transformStringToLambda: debouncedTransformStringToLambda, expectedType: expectedType, matchedExpectedType: matchedExpectedType, onExpectedTypeLabelSelect: onExpectedTypeLabelSelect, forceBackdrop: forceBackdrop, backdropSetter: backdropSetter, disableExpansion: disableExpansion, forceExpansion: disableExpansion !== undefined
|
|
427
|
+
? !disableExpansion && forceExpansion
|
|
428
|
+
: forceExpansion, disablePopUp: disablePopUp, useBaseTextEditorSettings: useBaseTextEditorSettings, hideErrorBar: hideErrorBar, onKeyDownEventHandlers: onKeyDownEventHandlers ?? [], openInPopUp: openInPopUp }, lambdaEditorState.uuid));
|
|
270
429
|
});
|
|
271
430
|
//# sourceMappingURL=LambdaEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LambdaEditor.js","sourceRoot":"","sources":["../../src/components/LambdaEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,IAAI,EACJ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGtE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,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AAW,EAAE,WAAW,IApBnB,iBAAiB,CAAC,IAAI,CAqB3B,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
|
package/lib/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license @finos/legend-application v0.0.
|
|
1
|
+
/** @license @finos/legend-application v0.0.10
|
|
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
|
-
:root{--color-primitive: var(--color-light-blue-200);--color-enum-value: var(--color-green-100);--color-enumeration: var(--color-medium-green-100);--color-measure: var(--color-medium-green-100);--color-unit: var(--color-medium-green-100);--color-class: var(--color-purple-100);--color-mapping: var(--color-teal-50);--color-function: var(--color-light-blue-20);--color-profile: var(--color-lime-75);--color-generated: var(--color-pink-200);--color-system: var(--color-light-blue-50);--color-dependency: var(--color-lime-50);--color-config: var(--color-orange-100);--color-flat-data: var(--color-orange-100);--color-relational: var(--color-blue-500);--color-file-generation: var(--color-blue-50);--color-database: var(--color-orange-100);--color-schema: var(--color-medium-green-500);--color-table: var(--color-light-blue-200);--color-association: var(--color-light-grey-400);--color-service: var(--color-blue-40);--color-runtime: var(--color-red-180);--color-connection: var(--color-yellow-100)}.color--class{color:var(--color-class)}.color--enumeration{color:var(--color-enumeration)}.color--unit{color:var(--color-unit)}.color--measure{color:var(--color-measure)}.color--association{color:var(--color-association)}.color--primitive{color:var(--color-primitive)}.color--enum-value{color:var(--color-enum-value)}.color--mapping{color:var(--color-mapping)}.color--function{color:var(--color-function)}.color--file-generation{color:var(--color-file-generation)}.color--profile{color:var(--color-profile)}.color--generated{color:var(--color-generated)}.color--system{color:var(--color-system)}.color--dependency{color:var(--color-dependency)}.color--config{color:var(--color-config)}.color--flat-data{color:var(--color-flat-data)}.color--database{color:var(--color-database)}.color--table{color:var(--color-table)}.color--schema{color:var(--color-schema)}.color--service{color:var(--color-service)}.color--connection{color:var(--color-connection)}.color--runtime{color:var(--color-runtime)}.background--pureinstance,.background--class{background:var(--color-class)}.background--enumeration{background:var(--color-enumeration)}.background--unit{background:var(--color-unit)}.background--measure{background:var(--color-measure)}.background--association{background:var(--color-association)}.background--primitive{background:var(--color-primitive)}.background--enum-value{background:var(--color-enum-value)}.background--mapping{background:var(--color-mapping)}.background--profile{background:var(--color-profile)}.background--flat-data{background:var(--color-flat-data)}.background--database{background:var(--color-database)}.background--service{background:var(--color-service)}.background--connection{background:var(--color-connection)}.background--runtime{background:var(--color-runtime)}.background--relational{background:var(--color-relational)}.blocking-alert{padding:0}.blocking-alert__root-container{margin-top:0 !important}.blocking-alert__container{align-items:center !important}.blocking-alert .btn{display:flex;align-items:center;justify-content:center;height:2.8rem;border-radius:.1rem;border:none;color:var(--color-light-grey-50)}.blocking-alert .modal__body{line-height:2.2rem;cursor:default;text-align:justify}.blocking-alert__message{text-align:center}.blocking-alert__message__prompt{text-align:center;font-size:1.2rem;color:var(--color-blue-150);font-weight:500}.blocking-alert__summary-text{color:var(--color-light-grey-400);font-weight:500}.blocking-alert__prompt-text{color:var(--color-blue-50);font-size:1.3rem;margin-top:1rem;font-weight:500}.blocking-alert--standard{border:.1rem solid var(--color-blue-200)}.blocking-alert--caution{border:.1rem solid var(--color-pink-400)}.blocking-alert--caution .mode__header{background:var(--color-pink-400)}.blocking-alert--caution .blocking-alert__prompt-text{color:var(--color-pink-300)}.backdrop{background:var(--color-dark-shade-230) !important;z-index:100 !important}.backdrop__element{z-index:100;position:relative;box-shadow:var(--color-dark-shade-280) 0 .1rem .3rem .1rem}.lambda-editor{display:flex;align-items:center;height:2.8rem;flex:1 0 auto;min-width:0;border-radius:.2rem;background:var(--color-dark-grey-300)}.lambda-editor .monaco-editor .margin,.lambda-editor .monaco-editor .monaco-editor-background{background:var(--color-dark-grey-300) !important}.lambda-editor .monaco-editor .decorationsOverviewRuler{display:none}.lambda-editor__editor__input{position:relative;height:100%;width:100%}.lambda-editor__editor__input__compressed .scroll-decoration{box-shadow:none}.lambda-editor__editor__input__compressed .selected-text,.lambda-editor__editor__input__compressed .selectionHighlight{height:2.6rem !important}.lambda-editor__editor__input__compressed .cursors-layer .cursor{top:.3rem !important;height:2rem !important}.lambda-editor__editor__input__compressed .view-line{display:flex;align-items:center;height:2.6rem !important}.lambda-editor__editor__info{display:flex;align-items:center;height:100%;padding:0 .5rem;border:.1rem solid var(--color-dark-grey-300);border-right:none;border-left:none;background:var(--color-dark-grey-300)}.lambda-editor__editor__expected-return-type{display:flex;align-items:center;justify-content:center;height:100%;height:1.8rem;border-radius:.2rem;padding:0 .5rem;color:var(--color-dark-grey-400);background:var(--color-light-grey-0);border:.1rem solid var(--color-light-grey-0);font-size:1.1rem;cursor:default}.lambda-editor__editor__expected-return-type--clickable{cursor:pointer}.lambda-editor__editor__expected-return-type--highlighted{border-color:var(--color-yellow-0);background:var(--color-yellow-0);color:var(--color-dark-grey-0)}.lambda-editor__editor__expand-btn{display:flex;align-items:center;justify-content:center;height:100%;width:1.6rem;background:var(--color-dark-grey-280);border:.1rem solid var(--color-dark-grey-280);color:var(--color-light-grey-
|
|
17
|
+
:root{--color-primitive: var(--color-light-blue-200);--color-enum-value: var(--color-green-100);--color-enumeration: var(--color-medium-green-100);--color-measure: var(--color-medium-green-100);--color-unit: var(--color-medium-green-100);--color-class: var(--color-purple-100);--color-mapping: var(--color-teal-50);--color-function: var(--color-light-blue-20);--color-profile: var(--color-lime-75);--color-generated: var(--color-pink-200);--color-system: var(--color-light-blue-50);--color-dependency: var(--color-lime-50);--color-config: var(--color-orange-100);--color-flat-data: var(--color-orange-100);--color-relational: var(--color-blue-500);--color-file-generation: var(--color-blue-50);--color-database: var(--color-orange-100);--color-schema: var(--color-medium-green-500);--color-table: var(--color-light-blue-200);--color-association: var(--color-light-grey-400);--color-service: var(--color-blue-40);--color-runtime: var(--color-red-180);--color-connection: var(--color-yellow-100)}.color--class{color:var(--color-class)}.color--enumeration{color:var(--color-enumeration)}.color--unit{color:var(--color-unit)}.color--measure{color:var(--color-measure)}.color--association{color:var(--color-association)}.color--primitive{color:var(--color-primitive)}.color--enum-value{color:var(--color-enum-value)}.color--mapping{color:var(--color-mapping)}.color--function{color:var(--color-function)}.color--file-generation{color:var(--color-file-generation)}.color--profile{color:var(--color-profile)}.color--generated{color:var(--color-generated)}.color--system{color:var(--color-system)}.color--dependency{color:var(--color-dependency)}.color--config{color:var(--color-config)}.color--flat-data{color:var(--color-flat-data)}.color--database{color:var(--color-database)}.color--table{color:var(--color-table)}.color--schema{color:var(--color-schema)}.color--service{color:var(--color-service)}.color--connection{color:var(--color-connection)}.color--runtime{color:var(--color-runtime)}.background--pureinstance,.background--class{background:var(--color-class)}.background--enumeration{background:var(--color-enumeration)}.background--unit{background:var(--color-unit)}.background--measure{background:var(--color-measure)}.background--association{background:var(--color-association)}.background--primitive{background:var(--color-primitive)}.background--enum-value{background:var(--color-enum-value)}.background--mapping{background:var(--color-mapping)}.background--profile{background:var(--color-profile)}.background--flat-data{background:var(--color-flat-data)}.background--database{background:var(--color-database)}.background--service{background:var(--color-service)}.background--connection{background:var(--color-connection)}.background--runtime{background:var(--color-runtime)}.background--relational{background:var(--color-relational)}.blocking-alert{padding:0}.blocking-alert__root-container{margin-top:0 !important}.blocking-alert__container{align-items:center !important}.blocking-alert .btn{display:flex;align-items:center;justify-content:center;height:2.8rem;border-radius:.1rem;border:none;color:var(--color-light-grey-50)}.blocking-alert .modal__body{line-height:2.2rem;cursor:default;text-align:justify}.blocking-alert__message{text-align:center}.blocking-alert__message__prompt{text-align:center;font-size:1.2rem;color:var(--color-blue-150);font-weight:500}.blocking-alert__summary-text{color:var(--color-light-grey-400);font-weight:500}.blocking-alert__prompt-text{color:var(--color-blue-50);font-size:1.3rem;margin-top:1rem;font-weight:500}.blocking-alert--standard{border:.1rem solid var(--color-blue-200)}.blocking-alert--caution{border:.1rem solid var(--color-pink-400)}.blocking-alert--caution .mode__header{background:var(--color-pink-400)}.blocking-alert--caution .blocking-alert__prompt-text{color:var(--color-pink-300)}.backdrop{background:var(--color-dark-shade-230) !important;z-index:100 !important}.backdrop__element{z-index:100;position:relative;box-shadow:var(--color-dark-shade-280) 0 .1rem .3rem .1rem}.lambda-editor{display:flex;align-items:center;height:2.8rem;flex:1 0 auto;min-width:0;border-radius:.2rem;background:var(--color-dark-grey-300)}.lambda-editor .monaco-editor .margin,.lambda-editor .monaco-editor .monaco-editor-background{background:var(--color-dark-grey-300) !important}.lambda-editor .monaco-editor .decorationsOverviewRuler{display:none}.lambda-editor__editor__input{position:relative;height:100%;width:100%}.lambda-editor__editor__input__compressed .scroll-decoration{box-shadow:none}.lambda-editor__editor__input__compressed .selected-text,.lambda-editor__editor__input__compressed .selectionHighlight{height:2.6rem !important}.lambda-editor__editor__input__compressed .cursors-layer .cursor{top:.3rem !important;height:2rem !important}.lambda-editor__editor__input__compressed .view-line{display:flex;align-items:center;height:2.6rem !important}.lambda-editor__editor__info{display:flex;align-items:center;height:100%;padding:0 .5rem;border:.1rem solid var(--color-dark-grey-300);border-right:none;border-left:none;background:var(--color-dark-grey-300)}.lambda-editor__editor__expected-return-type{display:flex;align-items:center;justify-content:center;height:100%;height:1.8rem;border-radius:.2rem;padding:0 .5rem;color:var(--color-dark-grey-400);background:var(--color-light-grey-0);border:.1rem solid var(--color-light-grey-0);font-size:1.1rem;cursor:default}.lambda-editor__editor__expected-return-type--clickable{cursor:pointer}.lambda-editor__editor__expected-return-type--highlighted{border-color:var(--color-yellow-0);background:var(--color-yellow-0);color:var(--color-dark-grey-0)}.lambda-editor__editor__expand-btn{display:flex;align-items:center;justify-content:center;height:100%;width:1.6rem;background:var(--color-dark-grey-280);border:.1rem solid var(--color-dark-grey-280);color:var(--color-light-grey-100);border-radius:0 .2rem .2rem 0;cursor:pointer}.lambda-editor__editor__expand-btn[disabled]{color:var(--color-dark-grey-400);cursor:not-allowed}.lambda-editor__expanded{height:28rem !important}.lambda-editor__expanded .lambda-editor__editor__info{align-items:flex-start;padding:.4rem .5rem}.lambda-editor__expanded .lambda-editor__editor__expand-btn{background:var(--color-dark-grey-280);border-color:var(--color-dark-grey-280)}.lambda-editor--dnd-match .lambda-editor__editor__expected-return-type{background:var(--color-yellow-0);border-color:var(--color-yellow-0);color:var(--color-dark-grey-0)}.lambda-editor__action{width:2.8rem;min-width:2.8rem;background:var(--color-dark-grey-250);height:2.8rem;border-left:.1rem solid var(--color-dark-shade-300)}.lambda-editor__action svg{color:var(--color-light-grey-200)}.lambda-editor__error-feedback{width:100%;margin-top:.5rem;background:var(--color-red-100);color:var(--color-light-grey-0);border-radius:.2rem;cursor:default}.lambda-editor__error-feedback__error__message{display:inline-flex;line-height:1.6rem;padding:.5rem}.lambda-editor__error-feedback__parsing-error__content{display:flex;justify-content:space-between;border-top:.1rem solid var(--color-dark-shade-230);padding:.5rem}.lambda-editor__error-feedback__parsing-error__discard-changes-btn{cursor:pointer;font-size:1.2rem;height:1.8rem;background:var(--color-dark-shade-230);white-space:nowrap;border-radius:.2rem;padding:0 .5rem;color:var(--color-light-grey-50)}.lambda-editor__popup__modal__content{width:100%;height:100%;background:var(--color-dark-grey-50)}.lambda-editor__popup__modal--has-error{border:.1rem solid var(--color-red-200) !important}.lambda-editor__popup__modal--has-error .modal__header{background:var(--color-red-200)}.lambda-editor__popup__modal--has-error .modal__title__error-badge{display:flex;align-items:center;justify-content:center;margin-right:1rem;background:var(--color-red-400);height:2.2rem;border-radius:.2rem;padding:.5rem;font-size:1.2rem;user-select:none}.lambda-editor__popup__content{height:100% !important;background:var(--color-dark-grey-50);padding-top:1rem}.lambda-editor__popup__content .monaco-editor .margin,.lambda-editor__popup__content .monaco-editor .monaco-editor-background{background:var(--color-dark-grey-50) !important}.notification__position{bottom:3rem !important;right:1rem !important}.notification__content{background-color:var(--color-dark-grey-200) !important;color:var(--color-light-grey-150) !important;border-radius:.3rem !important;align-items:flex-start !important}.notification__message__content{display:flex;align-items:flex-start}.notification__message__content__icon{padding-top:.2rem;padding-right:1rem}.notification__message__content__icon svg{font-size:1.6rem}.notification__message__content__icon--info{color:var(--color-light-grey-200)}.notification__message__content__icon--error{color:var(--color-red-100)}.notification__message__content__icon--warning{color:var(--color-yellow-200)}.notification__message__content__icon--success{color:var(--color-green-100)}.notification__message__content__text{max-height:10rem;max-width:60rem;overflow:auto}.notification__actions{padding:.8rem 0 .8rem 1rem !important}.notification__action{display:flex;align-items:center;justify-content:center;width:2rem;color:var(--color-dark-grey-400) !important}.notification__action:hover{color:var(--color-light-grey-400) !important}.text-editor__container{height:100%;width:100%;background:var(--color-dark-grey-50)}.text-editor__body{height:100%;width:100%;position:absolute;top:0;left:0}/*# sourceMappingURL=index.css.map */
|
package/lib/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../style/_extensions.scss","../style/components/_blocking-alert.scss","../style/_mixins.scss","../style/components/_backdrop.scss","../style/components/_lambda-editor.scss","../style/components/_notification.scss","../style/components/_text-editor.scss"],"names":[],"mappings":"AAgBA,MAEE,+CACA,2CAEA,mDACA,+CACA,4CACA,uCACA,sCACA,6CACA,sCACA,yCACA,2CACA,yCACA,wCACA,2CACA,0CACA,8CACA,0CACA,8CACA,2CACA,iDACA,sCACA,sCACA,4CAKA,cACE,yBAGF,oBACE,+BAGF,aACE,wBAGF,gBACE,2BAGF,oBACE,+BAGF,kBACE,6BAGF,mBACE,8BAGF,gBACE,2BAGF,iBACE,4BAGF,wBACE,mCAGF,gBACE,2BAGF,kBACE,6BAGF,eACE,0BAGF,mBACE,8BAGF,eACE,0BAGF,kBACE,6BAGF,iBACE,4BAGF,cACE,yBAGF,eACE,0BAGF,gBACE,2BAGF,mBACE,8BAGF,gBACE,2BAMF,6CAEE,8BAGF,yBACE,oCAGF,kBACE,6BAGF,qBACE,gCAGF,yBACE,oCAGF,uBACE,kCAGF,wBACE,mCAGF,qBACE,gCAGF,qBACE,gCAGF,uBACE,kCAGF,sBACE,iCAGF,qBACE,gCAGF,wBACE,mCAGF,qBACE,gCAGF,wBACE,mCCjLJ,gBACE,UAEA,gCACE,wBAGF,2BACE,8BAGF,qBCLA,aACA,mBACA,uBDME,cACA,oBACA,YACA,iCAGF,6BACE,mBACA,eACA,mBAGF,yBACE,kBAGF,iCACE,kBACA,iBACA,4BACA,gBAGF,8BACE,kCACA,gBAGF,6BACE,2BACA,iBACA,gBACA,gBAGF,0BACE,yCAGF,yBACE,yCAEA,uCACE,iCAGF,sDACE,4BE/DN,UACE,kDACA,uBAEA,mBACE,YACA,kBACA,2DCLJ,eFYE,aACA,mBEVA,cACA,cACA,YACA,oBACA,sCAKE,8FAEE,iDAGF,wDACE,aAIJ,8BACE,kBACA,YACA,WAIA,6DACE,gBAIF,uHAEE,yBAGF,iEACE,qBACA,uBAGF,qDFhCF,aACA,mBEkCI,yBAIJ,6BFvCA,aACA,mBEyCE,YACA,gBACA,8CACA,kBACA,iBACA,sCAGF,6CFxDA,aACA,mBACA,uBEyDE,YACA,cACA,oBACA,gBACA,iCACA,qCACA,6CACA,iBACA,eAGF,wDACE,eAGF,0DACE,mCACA,iCACA,+BAGF,mCFhFA,aACA,mBACA,uBEiFE,YACA,aACA,sCACA,8CACA,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../style/_extensions.scss","../style/components/_blocking-alert.scss","../style/_mixins.scss","../style/components/_backdrop.scss","../style/components/_lambda-editor.scss","../style/components/_notification.scss","../style/components/_text-editor.scss"],"names":[],"mappings":"AAgBA,MAEE,+CACA,2CAEA,mDACA,+CACA,4CACA,uCACA,sCACA,6CACA,sCACA,yCACA,2CACA,yCACA,wCACA,2CACA,0CACA,8CACA,0CACA,8CACA,2CACA,iDACA,sCACA,sCACA,4CAKA,cACE,yBAGF,oBACE,+BAGF,aACE,wBAGF,gBACE,2BAGF,oBACE,+BAGF,kBACE,6BAGF,mBACE,8BAGF,gBACE,2BAGF,iBACE,4BAGF,wBACE,mCAGF,gBACE,2BAGF,kBACE,6BAGF,eACE,0BAGF,mBACE,8BAGF,eACE,0BAGF,kBACE,6BAGF,iBACE,4BAGF,cACE,yBAGF,eACE,0BAGF,gBACE,2BAGF,mBACE,8BAGF,gBACE,2BAMF,6CAEE,8BAGF,yBACE,oCAGF,kBACE,6BAGF,qBACE,gCAGF,yBACE,oCAGF,uBACE,kCAGF,wBACE,mCAGF,qBACE,gCAGF,qBACE,gCAGF,uBACE,kCAGF,sBACE,iCAGF,qBACE,gCAGF,wBACE,mCAGF,qBACE,gCAGF,wBACE,mCCjLJ,gBACE,UAEA,gCACE,wBAGF,2BACE,8BAGF,qBCLA,aACA,mBACA,uBDME,cACA,oBACA,YACA,iCAGF,6BACE,mBACA,eACA,mBAGF,yBACE,kBAGF,iCACE,kBACA,iBACA,4BACA,gBAGF,8BACE,kCACA,gBAGF,6BACE,2BACA,iBACA,gBACA,gBAGF,0BACE,yCAGF,yBACE,yCAEA,uCACE,iCAGF,sDACE,4BE/DN,UACE,kDACA,uBAEA,mBACE,YACA,kBACA,2DCLJ,eFYE,aACA,mBEVA,cACA,cACA,YACA,oBACA,sCAKE,8FAEE,iDAGF,wDACE,aAIJ,8BACE,kBACA,YACA,WAIA,6DACE,gBAIF,uHAEE,yBAGF,iEACE,qBACA,uBAGF,qDFhCF,aACA,mBEkCI,yBAIJ,6BFvCA,aACA,mBEyCE,YACA,gBACA,8CACA,kBACA,iBACA,sCAGF,6CFxDA,aACA,mBACA,uBEyDE,YACA,cACA,oBACA,gBACA,iCACA,qCACA,6CACA,iBACA,eAGF,wDACE,eAGF,0DACE,mCACA,iCACA,+BAGF,mCFhFA,aACA,mBACA,uBEiFE,YACA,aACA,sCACA,8CACA,kCACA,8BACA,eAGF,6CACE,iCACA,mBAGF,yBACE,wBAGF,sDACE,uBACA,oBAGF,4DACE,sCACA,wCAGF,uEACE,iCACA,mCACA,+BAGF,uBACE,aACA,iBACA,sCACA,cACA,oDAEA,2BACE,kCAKN,+BACE,WACA,iBACA,gCACA,gCACA,oBACA,eAEA,+CACE,oBACA,mBACA,cAGF,uDFxHA,aACA,8BE0HE,mDACA,cAGF,mEACE,eACA,iBACA,cACA,uCACA,mBACA,oBACA,gBACA,iCAMA,sCACE,WACA,YACA,qCAIJ,wCACE,mDAEA,uDACE,gCAGF,mEFnLF,aACA,mBACA,uBEoLI,kBACA,gCACA,cACA,oBACA,cACA,iBACA,iBAIJ,+BACE,uBACA,qCACA,iBAGE,8HAEE,gDC7MN,wBACE,uBACA,sBAGF,uBACE,uDACA,6CACA,+BACA,kCAGF,gCACE,aACA,uBAGF,sCACE,kBACA,mBAGF,0CACE,iBAGF,4CACE,kCAGF,6CACE,2BAGF,+CACE,8BAGF,+CACE,6BAGF,sCACE,iBACA,gBACA,cAGF,uBACE,sCAGF,sBH/CA,aACA,mBACA,uBGgDE,WACA,4CAGF,4BACE,6CC9DF,wBACE,YACA,WACA,qCAGF,mBACE,YACA,WACA,kBACA,MACA","file":"index.css"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Legend application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"test:watch": "jest --watch"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@finos/legend-art": "0.0.
|
|
41
|
-
"@finos/legend-graph": "0.
|
|
42
|
-
"@finos/legend-shared": "0.0.
|
|
40
|
+
"@finos/legend-art": "0.0.6",
|
|
41
|
+
"@finos/legend-graph": "0.1.1",
|
|
42
|
+
"@finos/legend-shared": "0.0.5",
|
|
43
43
|
"@material-ui/core": "4.12.3",
|
|
44
|
-
"@testing-library/react": "12.
|
|
44
|
+
"@testing-library/react": "12.1.1",
|
|
45
45
|
"@types/css-font-loading-module": "0.0.6",
|
|
46
|
-
"@types/react": "17.0.
|
|
46
|
+
"@types/react": "17.0.24",
|
|
47
47
|
"@types/react-dom": "17.0.9",
|
|
48
|
-
"@types/react-router-dom": "5.
|
|
48
|
+
"@types/react-router-dom": "5.3.0",
|
|
49
49
|
"history": "5.0.1",
|
|
50
50
|
"mobx": "6.3.3",
|
|
51
51
|
"mobx-react-lite": "3.2.1",
|
|
52
|
-
"monaco-editor": "0.
|
|
52
|
+
"monaco-editor": "0.28.1",
|
|
53
53
|
"react": "17.0.2",
|
|
54
54
|
"react-dom": "17.0.2",
|
|
55
55
|
"react-icons": "4.2.0",
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"serializr": "2.0.5"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@finos/legend-dev-utils": "0.0.
|
|
63
|
-
"@testing-library/dom": "8.
|
|
62
|
+
"@finos/legend-dev-utils": "0.0.11",
|
|
63
|
+
"@testing-library/dom": "8.7.1",
|
|
64
64
|
"cross-env": "7.0.3",
|
|
65
65
|
"eslint": "7.32.0",
|
|
66
|
-
"jest": "27.
|
|
66
|
+
"jest": "27.2.4",
|
|
67
67
|
"npm-run-all": "4.1.5",
|
|
68
68
|
"rimraf": "3.0.2",
|
|
69
|
-
"sass": "1.
|
|
70
|
-
"typescript": "4.4.
|
|
69
|
+
"sass": "1.42.1",
|
|
70
|
+
"typescript": "4.4.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^17.0.0"
|
|
@@ -43,7 +43,7 @@ const ActionAlertInner = observer((props: { info: ActionAlertInfo }) => {
|
|
|
43
43
|
onClose?.();
|
|
44
44
|
applicationStore.setActionAltertInfo(undefined);
|
|
45
45
|
};
|
|
46
|
-
const
|
|
46
|
+
const handleEnter = (): void => onEnter?.();
|
|
47
47
|
const handleSubmit = (): void => {
|
|
48
48
|
const proceedActions = actions.filter((action) => action.default);
|
|
49
49
|
if (proceedActions.length) {
|
|
@@ -61,7 +61,7 @@ const ActionAlertInner = observer((props: { info: ActionAlertInfo }) => {
|
|
|
61
61
|
open={Boolean(applicationStore.actionAlertInfo)}
|
|
62
62
|
onClose={noop} // disallow closing dialog by using Esc key or clicking on the backdrop
|
|
63
63
|
TransitionProps={{
|
|
64
|
-
onEnter:
|
|
64
|
+
onEnter: handleEnter,
|
|
65
65
|
}}
|
|
66
66
|
>
|
|
67
67
|
<form
|
|
@@ -26,16 +26,21 @@ import {
|
|
|
26
26
|
disableEditorHotKeys,
|
|
27
27
|
baseTextEditorSettings,
|
|
28
28
|
} from '@finos/legend-art';
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
FaLongArrowAltDown,
|
|
31
|
+
FaLongArrowAltUp,
|
|
32
|
+
FaWindowMaximize,
|
|
33
|
+
} from 'react-icons/fa';
|
|
30
34
|
import type { LambdaEditorState } from '../stores/LambdaEditorState';
|
|
31
35
|
import type { DebouncedFunc, GeneratorFn } from '@finos/legend-shared';
|
|
32
|
-
import { debounce } from '@finos/legend-shared';
|
|
36
|
+
import { noop, debounce } from '@finos/legend-shared';
|
|
33
37
|
import { flowResult } from 'mobx';
|
|
34
38
|
import type { EngineError, Type } from '@finos/legend-graph';
|
|
35
39
|
import { ParserError } from '@finos/legend-graph';
|
|
36
40
|
import { APPLICATION_TEST_ID } from './ApplicationTestID';
|
|
37
41
|
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
38
42
|
import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const';
|
|
43
|
+
import { Dialog } from '@material-ui/core';
|
|
39
44
|
|
|
40
45
|
export type LambdaEditorOnKeyDownEventHandler = {
|
|
41
46
|
matcher: (event: IKeyboardEvent) => boolean;
|
|
@@ -71,7 +76,7 @@ const LambdaErrorFeedback: React.FC<{
|
|
|
71
76
|
);
|
|
72
77
|
};
|
|
73
78
|
|
|
74
|
-
const
|
|
79
|
+
const LambdaEditorInline = observer(
|
|
75
80
|
(props: {
|
|
76
81
|
className?: string | undefined;
|
|
77
82
|
disabled: boolean;
|
|
@@ -80,12 +85,15 @@ const LambdaEditorInner = observer(
|
|
|
80
85
|
expectedType?: Type | undefined;
|
|
81
86
|
matchedExpectedType?: (() => boolean) | undefined;
|
|
82
87
|
onExpectedTypeLabelSelect?: (() => void) | undefined;
|
|
83
|
-
forceExpansion?: boolean | undefined;
|
|
84
88
|
useBaseTextEditorSettings?: boolean | undefined;
|
|
85
89
|
hideErrorBar?: boolean | undefined;
|
|
86
90
|
forceBackdrop: boolean;
|
|
91
|
+
disableExpansion?: boolean | undefined;
|
|
92
|
+
forceExpansion?: boolean | undefined;
|
|
93
|
+
disablePopUp?: boolean | undefined;
|
|
87
94
|
backdropSetter?: ((val: boolean) => void) | undefined;
|
|
88
95
|
onKeyDownEventHandlers: LambdaEditorOnKeyDownEventHandler[];
|
|
96
|
+
openInPopUp: () => void;
|
|
89
97
|
}) => {
|
|
90
98
|
const {
|
|
91
99
|
className,
|
|
@@ -97,10 +105,13 @@ const LambdaEditorInner = observer(
|
|
|
97
105
|
matchedExpectedType,
|
|
98
106
|
forceBackdrop,
|
|
99
107
|
backdropSetter,
|
|
108
|
+
disableExpansion,
|
|
100
109
|
forceExpansion,
|
|
110
|
+
disablePopUp,
|
|
101
111
|
useBaseTextEditorSettings,
|
|
102
112
|
hideErrorBar,
|
|
103
113
|
onKeyDownEventHandlers,
|
|
114
|
+
openInPopUp,
|
|
104
115
|
} = props;
|
|
105
116
|
const applicationStore = useApplicationStore();
|
|
106
117
|
const onDidChangeModelContentEventDisposer = useRef<
|
|
@@ -115,11 +126,11 @@ const LambdaEditorInner = observer(
|
|
|
115
126
|
const [editor, setEditor] = useState<
|
|
116
127
|
monacoEditorAPI.IStandaloneCodeEditor | undefined
|
|
117
128
|
>();
|
|
118
|
-
const
|
|
129
|
+
const textInputRef = useRef<HTMLDivElement>(null);
|
|
119
130
|
|
|
120
|
-
const transformLambdaToString = (pretty: boolean): Promise<void> => {
|
|
131
|
+
const transformLambdaToString = async (pretty: boolean): Promise<void> => {
|
|
121
132
|
transformStringToLambda?.cancel();
|
|
122
|
-
return flowResult(
|
|
133
|
+
return await flowResult(
|
|
123
134
|
lambdaEditorState.convertLambdaObjectToGrammarString(pretty),
|
|
124
135
|
).catch(applicationStore.alertIllegalUnhandledError);
|
|
125
136
|
};
|
|
@@ -143,8 +154,8 @@ const LambdaEditorInner = observer(
|
|
|
143
154
|
}, [editor, width, height]);
|
|
144
155
|
|
|
145
156
|
useEffect(() => {
|
|
146
|
-
if (!editor &&
|
|
147
|
-
const element =
|
|
157
|
+
if (!editor && textInputRef.current) {
|
|
158
|
+
const element = textInputRef.current;
|
|
148
159
|
const lambdaEditorOptions: monacoEditorAPI.IStandaloneEditorConstructionOptions =
|
|
149
160
|
useBaseTextEditorSettings
|
|
150
161
|
? {}
|
|
@@ -205,6 +216,8 @@ const LambdaEditorInner = observer(
|
|
|
205
216
|
backdropSetter(true);
|
|
206
217
|
} else if (!forceBackdrop) {
|
|
207
218
|
// make sure the backdrop is no longer `needed` for blocking by another parser error before hiding it
|
|
219
|
+
// NOTE: this has a serious drawback, see the documentation for `forceBackdrop` prop of `LambdaEditor`
|
|
220
|
+
// for better context
|
|
208
221
|
backdropSetter(false);
|
|
209
222
|
}
|
|
210
223
|
}
|
|
@@ -339,7 +352,7 @@ const LambdaEditorInner = observer(
|
|
|
339
352
|
data-testid={APPLICATION_TEST_ID.LAMBDA_EDITOR__EDITOR_INPUT}
|
|
340
353
|
className="lambda-editor__editor__input"
|
|
341
354
|
>
|
|
342
|
-
<div className="text-editor__body" ref={
|
|
355
|
+
<div className="text-editor__body" ref={textInputRef} />
|
|
343
356
|
</div>
|
|
344
357
|
{Boolean(expectedType) && (
|
|
345
358
|
<div className="lambda-editor__editor__info">
|
|
@@ -374,7 +387,7 @@ const LambdaEditorInner = observer(
|
|
|
374
387
|
)}
|
|
375
388
|
</div>
|
|
376
389
|
)}
|
|
377
|
-
{!forceExpansion && (
|
|
390
|
+
{!disableExpansion && !forceExpansion && (
|
|
378
391
|
<button
|
|
379
392
|
className="lambda-editor__editor__expand-btn"
|
|
380
393
|
onClick={toggleExpandedMode}
|
|
@@ -385,6 +398,17 @@ const LambdaEditorInner = observer(
|
|
|
385
398
|
{isExpanded ? <FaLongArrowAltUp /> : <FaLongArrowAltDown />}
|
|
386
399
|
</button>
|
|
387
400
|
)}
|
|
401
|
+
{!disablePopUp && (
|
|
402
|
+
<button
|
|
403
|
+
className="lambda-editor__action"
|
|
404
|
+
onClick={openInPopUp}
|
|
405
|
+
disabled={Boolean(parserError)}
|
|
406
|
+
tabIndex={-1}
|
|
407
|
+
title="Open..."
|
|
408
|
+
>
|
|
409
|
+
<FaWindowMaximize />
|
|
410
|
+
</button>
|
|
411
|
+
)}
|
|
388
412
|
</div>
|
|
389
413
|
{!hideErrorBar && (
|
|
390
414
|
<LambdaErrorFeedback
|
|
@@ -397,6 +421,253 @@ const LambdaEditorInner = observer(
|
|
|
397
421
|
},
|
|
398
422
|
);
|
|
399
423
|
|
|
424
|
+
const LambdaEditorPopUp = observer(
|
|
425
|
+
(props: {
|
|
426
|
+
className?: string | undefined;
|
|
427
|
+
disabled: boolean;
|
|
428
|
+
lambdaEditorState: LambdaEditorState;
|
|
429
|
+
transformStringToLambda: DebouncedFunc<() => GeneratorFn<void>> | undefined;
|
|
430
|
+
onKeyDownEventHandlers: LambdaEditorOnKeyDownEventHandler[];
|
|
431
|
+
onClose: () => void;
|
|
432
|
+
}) => {
|
|
433
|
+
const {
|
|
434
|
+
className,
|
|
435
|
+
disabled,
|
|
436
|
+
lambdaEditorState,
|
|
437
|
+
transformStringToLambda,
|
|
438
|
+
onKeyDownEventHandlers,
|
|
439
|
+
onClose,
|
|
440
|
+
} = props;
|
|
441
|
+
const applicationStore = useApplicationStore();
|
|
442
|
+
const onKeyDownEventDisposer = useRef<IDisposable | undefined>(undefined);
|
|
443
|
+
const onDidChangeModelContentEventDisposer = useRef<
|
|
444
|
+
IDisposable | undefined
|
|
445
|
+
>(undefined);
|
|
446
|
+
const value = lambdaEditorState.lambdaString;
|
|
447
|
+
const parserError = lambdaEditorState.parserError;
|
|
448
|
+
const compilationError = lambdaEditorState.compilationError;
|
|
449
|
+
// const selectTypeLabel = (): void => onExpectedTypeLabelSelect?.();
|
|
450
|
+
const [editor, setEditor] = useState<
|
|
451
|
+
monacoEditorAPI.IStandaloneCodeEditor | undefined
|
|
452
|
+
>();
|
|
453
|
+
const textInputRef = useRef<HTMLDivElement>(null);
|
|
454
|
+
|
|
455
|
+
const transformLambdaToString = async (pretty: boolean): Promise<void> => {
|
|
456
|
+
transformStringToLambda?.cancel();
|
|
457
|
+
return await flowResult(
|
|
458
|
+
lambdaEditorState.convertLambdaObjectToGrammarString(pretty),
|
|
459
|
+
).catch(applicationStore.alertIllegalUnhandledError);
|
|
460
|
+
};
|
|
461
|
+
const discardChanges = applicationStore.guaranteeSafeAction(() =>
|
|
462
|
+
transformLambdaToString(true),
|
|
463
|
+
);
|
|
464
|
+
|
|
465
|
+
const { ref, width, height } = useResizeDetector<HTMLDivElement>();
|
|
466
|
+
useEffect(() => {
|
|
467
|
+
if (width !== undefined && height !== undefined) {
|
|
468
|
+
editor?.layout({ width, height });
|
|
469
|
+
}
|
|
470
|
+
}, [editor, width, height]);
|
|
471
|
+
|
|
472
|
+
const onEnter = (): void => {
|
|
473
|
+
if (!editor && textInputRef.current) {
|
|
474
|
+
const element = textInputRef.current;
|
|
475
|
+
const _editor = monacoEditorAPI.create(element, {
|
|
476
|
+
...baseTextEditorSettings,
|
|
477
|
+
language: EDITOR_LANGUAGE.PURE,
|
|
478
|
+
theme: EDITOR_THEME.LEGEND,
|
|
479
|
+
});
|
|
480
|
+
disableEditorHotKeys(_editor);
|
|
481
|
+
setEditor(_editor);
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
if (editor) {
|
|
486
|
+
/**
|
|
487
|
+
* See the extensive note about this instantiation in `LambdaEditor`. The fact that `transformStringToLambda` can change
|
|
488
|
+
* since it does not solely depends on `LambdaEditorState` but also the `disabled` flag means that the update function
|
|
489
|
+
* can go stale, so we cannot place this `onDidChangeModelContent` in a one-time called instantiation of the editor
|
|
490
|
+
* (i.e. the first `useEffect` where we create the editor). As such, we have to use refs and disposer to update this every time
|
|
491
|
+
* the lambda editor is re-rendered.
|
|
492
|
+
*
|
|
493
|
+
* A potential bug that could come up if we place this logic in the `useEffect` for instantiating the editor is:
|
|
494
|
+
* 1. Initially set the `disabled` to true, then switch it back to `false` (using a timer or something)
|
|
495
|
+
* 2. Type something in the lambda editor, the transform function is `undefined` and does not update the underlying lambda
|
|
496
|
+
*/
|
|
497
|
+
onDidChangeModelContentEventDisposer.current?.dispose();
|
|
498
|
+
onDidChangeModelContentEventDisposer.current =
|
|
499
|
+
editor.onDidChangeModelContent(() => {
|
|
500
|
+
const currentVal = editor.getValue();
|
|
501
|
+
/**
|
|
502
|
+
* Avoid unecessary setting of lambda string. Also, this prevents clearing the non-parser error on first render.
|
|
503
|
+
* Since this method is guaranteed to be called one time during the first rendering when we first set the
|
|
504
|
+
* value for the lambda editor, we do not want to clear any existing non-parser error in case it is set by methods
|
|
505
|
+
* like reveal error in each editor
|
|
506
|
+
*/
|
|
507
|
+
if (currentVal !== lambdaEditorState.lambdaString) {
|
|
508
|
+
lambdaEditorState.setLambdaString(currentVal);
|
|
509
|
+
/**
|
|
510
|
+
* Here we clear the error as user changes the input
|
|
511
|
+
* NOTE: we don't reset the parser error here, we could, but with that, we have to assume that the parsing check is
|
|
512
|
+
* pretty quick--almost near real time, but if after typing new character, we clear the parsing error and the user
|
|
513
|
+
* still make mistake, then the warning message will appear to flash, which is bad UX, so for now, we leave it be
|
|
514
|
+
*/
|
|
515
|
+
lambdaEditorState.setCompilationError(undefined);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* This method MUST run on the first rendering of the lambda editor, as it will update the lambda object. This is
|
|
519
|
+
* needed for new lambda where a lot of time is just a stub lambda. Without having this method called on the first
|
|
520
|
+
* rendering, that stub lambda will remain stub lambda until user starts typing something in the lambda editor.
|
|
521
|
+
* This stub lambda sometimes does not even get registered in change detection and causing the user to lose data
|
|
522
|
+
* Although, technically a stub lambda is useless, so this is not too serious, but it may come across as buggy
|
|
523
|
+
*/
|
|
524
|
+
transformStringToLambda?.cancel();
|
|
525
|
+
if (transformStringToLambda) {
|
|
526
|
+
const stringToLambdaTransformation = transformStringToLambda();
|
|
527
|
+
if (stringToLambdaTransformation) {
|
|
528
|
+
flowResult(stringToLambdaTransformation).catch(
|
|
529
|
+
applicationStore.alertIllegalUnhandledError,
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
// set hotkeys (before calling the action, finish parsing the current text value)
|
|
536
|
+
onKeyDownEventDisposer.current?.dispose(); // dispose to avoid trigger hotkeys multiple times
|
|
537
|
+
/**
|
|
538
|
+
* NOTE: We can use `setCommand` here but that does not expose the event so we cannot `stopPropagation`, and we need to
|
|
539
|
+
* use `stopPropagation` to prevent the event top bubble up to global hotkeys listener.
|
|
540
|
+
* If we really want to use `setCommand` the other approach is to set <HotKeys/> around this lambda editor to override F9
|
|
541
|
+
* perhaps that's the cleaner approach because we use `react-hotkeys` to handle it's business, but there is an on-going
|
|
542
|
+
* issue with <HotKeys/> keybindings are lost when component rerenders and this happen as users type because we call `setValue`
|
|
543
|
+
* See https://github.com/greena13/react-hotkeys/issues/209
|
|
544
|
+
*
|
|
545
|
+
* The main role of this section is to disable `monaco-editor` command and override with global actions, such as generate, compile,
|
|
546
|
+
* toggle text mode, etc. The important thing is before we do so, we would like to finish the parsing of the current string, otherwise,
|
|
547
|
+
* those operations can end up flushing the current state and trashing the user input, which is bad, as such, we make sure the
|
|
548
|
+
* parsing passes before actually calling those global operations.
|
|
549
|
+
*/
|
|
550
|
+
onKeyDownEventDisposer.current = editor.onKeyDown((event) => {
|
|
551
|
+
onKeyDownEventHandlers.forEach((handler) => {
|
|
552
|
+
if (handler.matcher(event)) {
|
|
553
|
+
event.preventDefault();
|
|
554
|
+
event.stopPropagation();
|
|
555
|
+
transformStringToLambda?.cancel();
|
|
556
|
+
handler.action(event);
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
// Set the text value
|
|
562
|
+
const currentValue = editor.getValue();
|
|
563
|
+
const editorModel = editor.getModel();
|
|
564
|
+
const currentConfig = editor.getRawOptions();
|
|
565
|
+
if (currentValue !== value) {
|
|
566
|
+
editor.setValue(value);
|
|
567
|
+
}
|
|
568
|
+
if (currentConfig.readOnly !== disabled) {
|
|
569
|
+
editor.updateOptions({
|
|
570
|
+
readOnly: disabled,
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// Set the errors
|
|
575
|
+
if (editorModel) {
|
|
576
|
+
editorModel.updateOptions({ tabSize: TAB_SIZE });
|
|
577
|
+
const error = parserError ?? compilationError;
|
|
578
|
+
if (error?.sourceInformation) {
|
|
579
|
+
setErrorMarkers(
|
|
580
|
+
editorModel,
|
|
581
|
+
error.message,
|
|
582
|
+
error.sourceInformation.startLine,
|
|
583
|
+
error.sourceInformation.startColumn,
|
|
584
|
+
error.sourceInformation.endLine,
|
|
585
|
+
error.sourceInformation.endColumn,
|
|
586
|
+
);
|
|
587
|
+
} else {
|
|
588
|
+
monacoEditorAPI.setModelMarkers(editorModel, 'Error', []);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
useEffect(() => {
|
|
594
|
+
flowResult(
|
|
595
|
+
lambdaEditorState.convertLambdaObjectToGrammarString(true),
|
|
596
|
+
).catch(applicationStore.alertIllegalUnhandledError);
|
|
597
|
+
}, [applicationStore, lambdaEditorState]);
|
|
598
|
+
|
|
599
|
+
useEffect(
|
|
600
|
+
() => (): void => {
|
|
601
|
+
if (editor) {
|
|
602
|
+
disposeEditor(editor);
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
[editor],
|
|
606
|
+
); // dispose editor
|
|
607
|
+
|
|
608
|
+
return (
|
|
609
|
+
<Dialog
|
|
610
|
+
open={true}
|
|
611
|
+
TransitionProps={{
|
|
612
|
+
onEnter,
|
|
613
|
+
}}
|
|
614
|
+
onClose={noop} // disallow closing dialog by using Esc key or clicking on the backdrop
|
|
615
|
+
classes={{
|
|
616
|
+
root: 'editor-modal__root-container',
|
|
617
|
+
container: 'editor-modal__container',
|
|
618
|
+
paper: 'editor-modal__content',
|
|
619
|
+
}}
|
|
620
|
+
>
|
|
621
|
+
<div
|
|
622
|
+
className={clsx(
|
|
623
|
+
'modal modal--dark editor-modal lambda-editor__popup__modal',
|
|
624
|
+
{
|
|
625
|
+
'lambda-editor__popup__modal--has-error': Boolean(
|
|
626
|
+
lambdaEditorState.parserError,
|
|
627
|
+
),
|
|
628
|
+
},
|
|
629
|
+
)}
|
|
630
|
+
>
|
|
631
|
+
<div className="modal__header">
|
|
632
|
+
<div className="modal__title">Edit Lambda</div>
|
|
633
|
+
{lambdaEditorState.parserError && (
|
|
634
|
+
<div className="modal__title__error-badge">
|
|
635
|
+
Failed to parse lambda
|
|
636
|
+
</div>
|
|
637
|
+
)}
|
|
638
|
+
</div>
|
|
639
|
+
<div className="modal__body">
|
|
640
|
+
<div className={clsx('lambda-editor__popup__content', className)}>
|
|
641
|
+
<div
|
|
642
|
+
ref={ref}
|
|
643
|
+
data-testid={APPLICATION_TEST_ID.LAMBDA_EDITOR__EDITOR_INPUT}
|
|
644
|
+
className="lambda-editor__editor__input"
|
|
645
|
+
>
|
|
646
|
+
<div className="text-editor__body" ref={textInputRef} />
|
|
647
|
+
</div>
|
|
648
|
+
</div>
|
|
649
|
+
</div>
|
|
650
|
+
<div className="modal__footer">
|
|
651
|
+
<button
|
|
652
|
+
className="btn btn--dark btn--caution"
|
|
653
|
+
onClick={discardChanges}
|
|
654
|
+
>
|
|
655
|
+
Discard changes
|
|
656
|
+
</button>
|
|
657
|
+
<button
|
|
658
|
+
className="btn btn--dark"
|
|
659
|
+
onClick={onClose}
|
|
660
|
+
disabled={Boolean(lambdaEditorState.parserError)}
|
|
661
|
+
>
|
|
662
|
+
Close
|
|
663
|
+
</button>
|
|
664
|
+
</div>
|
|
665
|
+
</div>
|
|
666
|
+
</Dialog>
|
|
667
|
+
);
|
|
668
|
+
},
|
|
669
|
+
);
|
|
670
|
+
|
|
400
671
|
/**
|
|
401
672
|
* This is not strictly meant for lambda. The idea is to create an editor that allows
|
|
402
673
|
* editing _something_ but allows user to edit via text.
|
|
@@ -414,11 +685,53 @@ export const LambdaEditor = observer(
|
|
|
414
685
|
expectedType?: Type | undefined;
|
|
415
686
|
matchedExpectedType?: (() => boolean) | undefined;
|
|
416
687
|
onExpectedTypeLabelSelect?: (() => void) | undefined;
|
|
688
|
+
/**
|
|
689
|
+
* As backdrop element is often shared in the application, and there could be multiple
|
|
690
|
+
* editor using that backdrop, we could end up in situation where some such editors
|
|
691
|
+
* have parser errors and some don't (this can happen when user make edits very quickly 2 lambda
|
|
692
|
+
* editor and causes parsers error simultaneously). In this case, we want to make sure when
|
|
693
|
+
* parser error is fixed in one editor, the backdrop is not dismissed immediately.
|
|
694
|
+
*
|
|
695
|
+
* NOTE: the current approach has a critical flaw, where on the same screen, there could be multiple
|
|
696
|
+
* sets of lambda editors with different values for `forceBackdrop`. So really, the only way to
|
|
697
|
+
* accomondate for this is to have `forceBackdrop` as a global value. Or we should get rid of this
|
|
698
|
+
* backdrop mechanism altogether as it's not really a good UX pattern. i.e. quick evaluation makes
|
|
699
|
+
* us believe that this is a good option, user will lose what they type, but the most recent parsable
|
|
700
|
+
* input will still be captured.
|
|
701
|
+
*/
|
|
417
702
|
forceBackdrop: boolean;
|
|
703
|
+
/**
|
|
704
|
+
* (de)activator for backdrop that is usually used to block any background interactions
|
|
705
|
+
* while there is a parser error in the editor
|
|
706
|
+
*/
|
|
418
707
|
backdropSetter?: ((val: boolean) => void) | undefined;
|
|
708
|
+
/**
|
|
709
|
+
* To whether or not disable expasipn toggler
|
|
710
|
+
*/
|
|
711
|
+
disableExpansion?: boolean | undefined;
|
|
712
|
+
/**
|
|
713
|
+
* To whether show the inline editor in expanded mode initially and
|
|
714
|
+
* disable expansion toggler
|
|
715
|
+
*
|
|
716
|
+
* This flag will override the effect of `forceExpansion`
|
|
717
|
+
*/
|
|
419
718
|
forceExpansion?: boolean | undefined;
|
|
719
|
+
/**
|
|
720
|
+
* To whether or not disable popup mode
|
|
721
|
+
*/
|
|
722
|
+
disablePopUp?: boolean | undefined;
|
|
723
|
+
/**
|
|
724
|
+
* To whether or not style inline editor
|
|
725
|
+
*/
|
|
420
726
|
useBaseTextEditorSettings?: boolean | undefined;
|
|
727
|
+
/**
|
|
728
|
+
* To whether or not hide parser error bar in inline mode
|
|
729
|
+
*/
|
|
421
730
|
hideErrorBar?: boolean | undefined;
|
|
731
|
+
/**
|
|
732
|
+
* Allow adding hotkeys handler to the editor, this is usually used
|
|
733
|
+
* to allow activating global hotkeys while typing in the editor
|
|
734
|
+
*/
|
|
422
735
|
onKeyDownEventHandlers?: LambdaEditorOnKeyDownEventHandler[];
|
|
423
736
|
}) => {
|
|
424
737
|
const {
|
|
@@ -430,11 +743,16 @@ export const LambdaEditor = observer(
|
|
|
430
743
|
expectedType,
|
|
431
744
|
onExpectedTypeLabelSelect,
|
|
432
745
|
matchedExpectedType,
|
|
746
|
+
disableExpansion,
|
|
433
747
|
forceExpansion,
|
|
748
|
+
disablePopUp,
|
|
434
749
|
useBaseTextEditorSettings,
|
|
435
750
|
hideErrorBar,
|
|
436
751
|
onKeyDownEventHandlers,
|
|
437
752
|
} = props;
|
|
753
|
+
const [showPopUp, setShowPopUp] = useState(false);
|
|
754
|
+
const openInPopUp = (): void => setShowPopUp(true);
|
|
755
|
+
const closePopUp = (): void => setShowPopUp(false);
|
|
438
756
|
const debouncedTransformStringToLambda = useMemo(
|
|
439
757
|
() =>
|
|
440
758
|
disabled
|
|
@@ -446,8 +764,23 @@ export const LambdaEditor = observer(
|
|
|
446
764
|
[lambdaEditorState, disabled],
|
|
447
765
|
);
|
|
448
766
|
|
|
767
|
+
if (!disablePopUp && showPopUp) {
|
|
768
|
+
return (
|
|
769
|
+
<>
|
|
770
|
+
<div className="lambda-editor" />
|
|
771
|
+
<LambdaEditorPopUp
|
|
772
|
+
className={className}
|
|
773
|
+
disabled={disabled}
|
|
774
|
+
lambdaEditorState={lambdaEditorState}
|
|
775
|
+
transformStringToLambda={debouncedTransformStringToLambda}
|
|
776
|
+
onKeyDownEventHandlers={onKeyDownEventHandlers ?? []}
|
|
777
|
+
onClose={closePopUp}
|
|
778
|
+
/>
|
|
779
|
+
</>
|
|
780
|
+
);
|
|
781
|
+
}
|
|
449
782
|
return (
|
|
450
|
-
<
|
|
783
|
+
<LambdaEditorInline
|
|
451
784
|
/**
|
|
452
785
|
* See the usage of `transformStringToLambda` as well as the instatiation of the editor in `LambdaEditorInner`.
|
|
453
786
|
* One of the big problem is that the editor uses lambda editor state (there are some non-trivial logic there, that
|
|
@@ -482,10 +815,17 @@ export const LambdaEditor = observer(
|
|
|
482
815
|
onExpectedTypeLabelSelect={onExpectedTypeLabelSelect}
|
|
483
816
|
forceBackdrop={forceBackdrop}
|
|
484
817
|
backdropSetter={backdropSetter}
|
|
485
|
-
|
|
818
|
+
disableExpansion={disableExpansion}
|
|
819
|
+
forceExpansion={
|
|
820
|
+
disableExpansion !== undefined
|
|
821
|
+
? !disableExpansion && forceExpansion
|
|
822
|
+
: forceExpansion
|
|
823
|
+
}
|
|
824
|
+
disablePopUp={disablePopUp}
|
|
486
825
|
useBaseTextEditorSettings={useBaseTextEditorSettings}
|
|
487
826
|
hideErrorBar={hideErrorBar}
|
|
488
827
|
onKeyDownEventHandlers={onKeyDownEventHandlers ?? []}
|
|
828
|
+
openInPopUp={openInPopUp}
|
|
489
829
|
/>
|
|
490
830
|
);
|
|
491
831
|
},
|