@pega/cosmos-react-build 9.0.0-build.10.3 → 9.0.0-build.11.1
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/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +5 -3
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +52 -30
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +2 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +7 -7
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +16 -8
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,oCAAoC,CAAC;AAC5C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,oCAAoC,CAAC;AAC5C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;AAuB7C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,KAAK,EAEV,eAAe,EAGhB,MAAM,oBAAoB,CAAC;;;;AAooB5B,wBAA0D"}
|
|
@@ -6,7 +6,7 @@ import 'codemirror/addon/hint/show-hint.js';
|
|
|
6
6
|
import 'codemirror/addon/edit/closebrackets';
|
|
7
7
|
import 'codemirror/addon/edit/matchbrackets';
|
|
8
8
|
import { Pass, showHint, defineMode, registerHelper } from 'codemirror';
|
|
9
|
-
import { Popover, Text, UnorderedList, Flex, useI18n, useTestIds, withTestIds, useUID, debounce } from '@pega/cosmos-react-core';
|
|
9
|
+
import { useTheme, Popover, Text, UnorderedList, Flex, useI18n, useTestIds, withTestIds, useUID, debounce } from '@pega/cosmos-react-core';
|
|
10
10
|
import { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
|
|
11
11
|
import { StyledSuggestions, StyledCodeEditor, StyledPopover, StyledList, StyledWarnIcon } from './CodeEditor.styles';
|
|
12
12
|
import getCodeSuggestions from './getCodeSuggestions';
|
|
@@ -120,6 +120,7 @@ const CodeEditor = forwardRef(({ testId, fetchSuggestions, autoCompleteTriggers,
|
|
|
120
120
|
const errorDescId = `${uId}-description`;
|
|
121
121
|
const onBlurRef = useRef(onBlur);
|
|
122
122
|
const hasSuggestionRef = useRef(true);
|
|
123
|
+
const theme = useTheme();
|
|
123
124
|
useImperativeHandle(codeEditorHandle, () => ({
|
|
124
125
|
insertText: (text, resetContent, customPosition) => {
|
|
125
126
|
if (editorRef.current) {
|
|
@@ -150,7 +151,8 @@ const CodeEditor = forwardRef(({ testId, fetchSuggestions, autoCompleteTriggers,
|
|
|
150
151
|
closeOnUnfocus: true,
|
|
151
152
|
suggestions,
|
|
152
153
|
loading,
|
|
153
|
-
triggerCharacterCursorPos: suggestionTrigger?.cursorPosition
|
|
154
|
+
triggerCharacterCursorPos: suggestionTrigger?.cursorPosition,
|
|
155
|
+
theme
|
|
154
156
|
};
|
|
155
157
|
debounce(() => showHint(codeEditor, getCodeSuggestions, hintOptions), 100)();
|
|
156
158
|
};
|
|
@@ -467,7 +469,7 @@ const CodeEditor = forwardRef(({ testId, fetchSuggestions, autoCompleteTriggers,
|
|
|
467
469
|
textArea.removeAttribute('aria-describedby');
|
|
468
470
|
}
|
|
469
471
|
}, [codeMirror, errors, ariaDescribedBy]);
|
|
470
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledSuggestions, { isLoading: loading, suggestions: suggestions }), _jsxs(StyledCodeEditor, { ...restProps, "data-testid": testIds.root, container: {
|
|
472
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledSuggestions, { isLoading: loading, suggestions: suggestions, theme: theme }), _jsxs(StyledCodeEditor, { ...restProps, "data-testid": testIds.root, container: {
|
|
471
473
|
direction: 'column',
|
|
472
474
|
justify: 'between'
|
|
473
475
|
}, item: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":";AAAA,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,oCAAoC,CAAC;AAC5C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAUxE,OAAO,EACL,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EAC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,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC,aAAa,KAAK,IAAI,IAAI,CAC7E,KAAC,OAAO,IACN,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,WAAW,CAAC,aAAa,EACjC,SAAS,EAAC,cAAc,iBACX,OAAO,CAAC,YAAY,YAEjC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,aACzB,KAAC,cAAc,IAAC,IAAI,EAAC,YAAY,GAAG,EACpC,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YACf,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE;gDACf,KAAK,EACH,WAAW,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC;oDACpC,CAAC,CAAC,CAAC;oDACH,CAAC,CAAC,wDAAwD;wDACxD,GAAG;6CACV,CAAC,GACG,IACF,EACN,WAAW,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACtC,KAAC,aAAa,IAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,aAAa,GAAI,CACpE,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,cAAE,WAAW,CAAC,aAAa,GAAQ,CACzC,IACI,GACC,CACX,EACA,MAAM,IAAI,CACT,KAAC,mBAAmB,IAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAC,OAAO,iBAAc,OAAO,CAAC,YAAY,YACnF,MAAM,GACa,CACvB,IACgB,IAClB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["// cspell:words unfocus\nimport { forwardRef, useRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport { Controlled as ReactCodeMirror } from 'react-codemirror2';\nimport 'codemirror/addon/hint/show-hint.js';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/edit/matchbrackets';\nimport { Pass, showHint, defineMode, registerHelper } from 'codemirror';\nimport type {\n Editor,\n Position,\n EditorChange,\n EditorConfiguration,\n MarkerRange,\n TextMarker\n} from 'codemirror';\n\nimport {\n Popover,\n Text,\n UnorderedList,\n Flex,\n useI18n,\n useTestIds,\n withTestIds,\n useUID,\n debounce\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\nimport { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type {\n AutoCompleteTriggerChar,\n CodeEditorProps,\n SuggestionType,\n CustomPositionProps\n} from './CodeEditor.types';\nimport {\n StyledSuggestions,\n StyledCodeEditor,\n StyledPopover,\n StyledList,\n StyledWarnIcon\n} from './CodeEditor.styles';\nimport getCodeSuggestions from './getCodeSuggestions';\nimport { getEditorsTestIds } from './CodeEditor.test-ids';\nimport { lint as jsonLint } from './mode/jsonLinter';\n\nconst contextText = 'ex-context';\nconst commentText = 'ex-comment';\nconst languages = ['json', 'javascript'];\n\nconst additionalOperators = ['and', 'or', 'when', 'otherwise', 'isA', 'asA', 'define', 'isNone'];\n\ndefineMode('expression', (config, parserConfig) => {\n const isSingleLine = parserConfig.isSingleLine;\n\n const tokens = [\n // Below regex is used to identify the context\n { token: /\\w+@/, style: contextText },\n // Below regex is used to identify the RuleType\n { token: /\\w+:/, style: contextText },\n // Below regex is used to identify the RuleName\n { token: /\\w+[(]/, style: 'ex-ruleName' },\n // Below regex is used to identify the delimeters\n { token: /[:.(),[\\]]/, style: 'ex-delimeter' },\n // Below regex is used to identify the operators\n { token: /[-+\\\\/*=<>@#]+/, style: 'ex-operator' },\n // Below regex is used to identify the spaces\n { token: / /, style: 'ex-space' }\n ];\n\n return {\n startState() {\n return { inString: false, inMultiLineComment: false };\n },\n token(stream, state) {\n /** Additional operator highlighting */\n for (let i = 0; i < additionalOperators.length; i += 1) {\n const keyword = additionalOperators[i];\n const len = keyword.length;\n const currentPos = stream.pos;\n\n if (stream.match(keyword, true)) {\n const before = currentPos === 0 ? null : stream.string.charAt(currentPos - 1);\n const after = stream.eol() ? null : stream.peek();\n\n const isWordChar = (char: string) => char.includes(' ');\n\n if ((!before || isWordChar(before)) && (!after || isWordChar(after))) {\n return 'ex-additional-operators';\n }\n stream.backUp(len);\n }\n }\n /* Highlights single and multi line comments */\n if (state.inMultiLineComment && !isSingleLine) {\n if (stream.match(/.*?\\*\\//)) {\n state.inMultiLineComment = false;\n } else {\n stream.skipToEnd();\n }\n return commentText;\n }\n\n if (stream.match(/\\/\\*/) && !isSingleLine) {\n state.inMultiLineComment = true;\n return commentText;\n }\n\n if (stream.match(/\\/\\//) && !isSingleLine) {\n stream.skipToEnd();\n return commentText;\n }\n // Used to identify the constants in the expression\n if (!state.inMultiLineComment) {\n const nextChar = stream.peek();\n if (!state.inString && (nextChar === \"'\" || nextChar === '\"')) {\n stream.next(); // Skip quote\n state.inString = true; // Update state\n }\n\n if (state.inString) {\n if (nextChar && stream.skipTo(nextChar)) {\n // Quote found on this line\n stream.next(); // Skip quote\n state.inString = false; // Clear flag\n } else {\n stream.skipToEnd(); // Rest of line is string\n }\n return nextChar === '\"' ? 'ex-constant' : contextText; // Token style\n }\n\n // Used to match the regex in the expression\n for (const element of tokens) {\n const match = stream.match(element.token, false);\n if (match) {\n if (stream.pos === stream.start) {\n stream.next();\n }\n return element.style;\n }\n }\n }\n stream.next();\n return null;\n }\n };\n});\n\nconst CodeEditor: ForwardRefForwardPropsComponent<CodeEditorProps> = forwardRef(\n (\n {\n testId,\n fetchSuggestions,\n autoCompleteTriggers,\n editorConfigProps,\n codeEditorHandle,\n defaultValue = '',\n loading = false,\n readOnly,\n isSingleLine = false,\n errors,\n onChange,\n onBlur,\n inLineErrors,\n 'aria-describedby': ariaDescribedBy,\n ...restProps\n }: PropsWithoutRef<CodeEditorProps>,\n ref: CodeEditorProps['ref']\n ) => {\n const t = useI18n();\n const [value, setCode] = useState<string>(defaultValue);\n const [showEditor, setShowEditor] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [suggestions, setSuggestions] = useState<SuggestionType[]>([]);\n const [codeMirror, setCodeMirror] = useState<Editor | null>(null);\n const [suggestionTrigger, setSuggestionTrigger] = useState<{\n character: AutoCompleteTriggerChar;\n cursorPosition: Position;\n } | null>(null);\n const [popover, showPopover] = useState(false);\n const mounted = useRef(false);\n const testIds = useTestIds(testId, getEditorsTestIds);\n const editorRef = useRef<Editor | null>(null);\n const uId = useUID();\n const errorDescId = `${uId}-description`;\n const onBlurRef = useRef(onBlur);\n const hasSuggestionRef = useRef(true);\n\n useImperativeHandle(\n codeEditorHandle,\n () => ({\n insertText: (\n text: string,\n resetContent?: boolean,\n customPosition?: CustomPositionProps\n ) => {\n if (editorRef.current) {\n if (editorRef.current.getSelection()) {\n editorRef.current.replaceSelection(text);\n } else if (customPosition?.start && customPosition?.end) {\n editorRef.current.replaceRange(\n text,\n { ...customPosition.start },\n { ...customPosition.end }\n );\n } else {\n const cur: Position = editorRef.current.getCursor();\n const doc = editorRef.current.getDoc();\n const lastLine = doc.lastLine(); // Get the index of the last line\n const lastCharIndex = doc.getLine(lastLine).length;\n editorRef.current.replaceRange(\n text,\n resetContent ? { ch: lastCharIndex, line: lastLine } : cur,\n resetContent ? { ch: 0, line: 0 } : undefined\n );\n }\n }\n },\n getValue: () => {\n return editorRef.current?.getValue();\n }\n }),\n []\n );\n\n const autoComplete = (codeEditor: Editor) => {\n const hintOptions = {\n completeSingle: false,\n completeOnSingleClick: true,\n closeCharacters: /./s,\n closeOnUnfocus: true,\n suggestions,\n loading,\n triggerCharacterCursorPos: suggestionTrigger?.cursorPosition\n };\n\n debounce(() => showHint(codeEditor, getCodeSuggestions, hintOptions), 100)();\n };\n\n const errorHandler = (val: string) => {\n if (!editorConfigProps?.lint) return;\n const mode = editorConfigProps?.mode;\n switch (mode) {\n case 'json':\n return jsonLint(val);\n case 'expression':\n default:\n return undefined;\n }\n };\n\n useEffect(() => {\n onBlurRef.current = onBlur;\n }, [onBlur]);\n\n const onBlurHandler = (editor: Editor) => {\n if (onBlurRef.current) {\n onBlurRef.current(editor.getDoc().getValue());\n }\n };\n\n const onBeforeChange = async (editor: Editor, _data: EditorChange, textvalue: string) => {\n const updatedTextValue = isSingleLine ? textvalue.replaceAll(/\\n/g, '') : textvalue;\n setCode(updatedTextValue);\n /** _data.origin is a flag from codemirror that tells from where the change was made in the code editor input */\n onChange?.(updatedTextValue, errorHandler(updatedTextValue), _data.origin);\n const currentCursor = editor.getCursor();\n const currentCharacter = editor\n .getTokenAt(currentCursor)\n .string.trim() as AutoCompleteTriggerChar;\n let newSuggestions: SuggestionType[] = [];\n\n if (autoCompleteTriggers?.includes(currentCharacter) && fetchSuggestions) {\n const suggestionData = await fetchSuggestions(currentCharacter, {\n line: currentCursor.line,\n ch: currentCursor.ch\n });\n\n if (suggestionData === undefined) {\n hasSuggestionRef.current = false;\n return;\n }\n\n setSuggestionTrigger({\n character: currentCharacter,\n cursorPosition: currentCursor\n });\n\n hasSuggestionRef.current = true;\n newSuggestions = [...suggestionData];\n if (mounted.current) {\n setSuggestions(newSuggestions);\n }\n }\n };\n\n useEffect(() => {\n if (!popover) {\n return;\n }\n const isSuggestionTriggerPresent =\n suggestionTrigger &&\n codeMirror\n ?.getTokenAt(suggestionTrigger.cursorPosition)\n .string.includes(suggestionTrigger.character);\n\n if (!isSuggestionTriggerPresent) {\n codeMirror?.closeHint();\n showPopover(false);\n setSuggestionTrigger(null);\n }\n }, [onBeforeChange]);\n\n useEffect(() => {\n if (codeMirror && isFocused && hasSuggestionRef.current && (suggestionTrigger || loading)) {\n autoComplete(codeMirror);\n showPopover(true);\n } else {\n codeMirror?.closeHint();\n showPopover(false);\n }\n }, [suggestions, loading, suggestionTrigger, codeMirror]);\n\n const [popoverInfo, setPopoverInfo] = useState<{\n targetElement: Element | null;\n errorMessages: string[];\n }>({ targetElement: null, errorMessages: [] });\n\n const [show, setShow] = useState(false);\n const [errorMapping, setErrorMapping] = useState<string[][]>([]);\n const [textMarkerList, setTextMarkerList] = useState<TextMarker<MarkerRange>[]>([]);\n\n const removeInLineErrors = () => {\n if (textMarkerList.length) {\n textMarkerList.forEach(item => item.clear());\n }\n };\n\n useEffect(() => {\n removeInLineErrors();\n if (inLineErrors?.length && codeMirror) {\n const markerList: TextMarker<MarkerRange>[] = [];\n const errorMessageMap = inLineErrors?.map(({ start, end, messages }, index) => {\n if (messages.length) {\n markerList.push(\n codeMirror.markText(start, end, {\n className: `cm-ex-underline-error error-${index}`\n })\n );\n return messages;\n }\n return [];\n });\n setTextMarkerList(markerList);\n setErrorMapping(errorMessageMap);\n } else {\n setErrorMapping([]);\n }\n }, [inLineErrors, codeMirror]);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const getErrors = (target: Element) => {\n const errorMessages: string[] = [];\n if (target) {\n errorMapping.forEach((item, index) => {\n if (target.classList.contains(`error-${index}`)) {\n errorMessages.push(...item);\n }\n });\n }\n\n return errorMessages;\n };\n\n const onMouseMove = (event: Event | null, type?: string) => {\n if (codeMirror && errorMapping.length) {\n let target: Element | null;\n\n if (type === 'cursor') {\n const coords = codeMirror.getCursor();\n const charCoords = codeMirror.charCoords(coords, 'window');\n target = document.elementFromPoint(charCoords.left, charCoords.top);\n } else {\n target = event?.target instanceof Element ? event.target : null;\n }\n\n if (target) {\n const errorMessages = getErrors(target);\n if (errorMessages.length) {\n setPopoverInfo(() => {\n return {\n targetElement: target,\n errorMessages\n };\n });\n setShow(true);\n } else {\n setShow(false);\n }\n }\n }\n };\n\n const onMouseLeave = () => {\n setShow(false);\n };\n\n const hidePopover = (e: KeyboardEvent) => {\n if (e.shiftKey && (e.metaKey || e.ctrlKey) && e.key === ' ') {\n onMouseMove(null, 'cursor');\n } else {\n setShow(false);\n }\n };\n\n useEffect(() => {\n if (codeMirror && inLineErrors?.length && errorMapping.length) {\n const codeMirrorWrapper = codeMirror.getWrapperElement();\n\n codeMirrorWrapper.addEventListener('keydown', hidePopover);\n codeMirrorWrapper.addEventListener('mousedown', onMouseLeave);\n\n const elementsWithClassName = Array.from(\n codeMirrorWrapper.getElementsByClassName('cm-ex-underline-error')\n );\n\n elementsWithClassName.forEach(element => {\n element.addEventListener('mouseenter', onMouseMove);\n element.addEventListener('mouseleave', onMouseLeave);\n });\n\n return () => {\n codeMirrorWrapper.removeEventListener('keydown', hidePopover);\n codeMirrorWrapper.removeEventListener('mousedown', onMouseLeave);\n\n elementsWithClassName.forEach(element => {\n element.removeEventListener('mouseenter', onMouseMove);\n element.removeEventListener('mouseleave', onMouseLeave);\n });\n };\n }\n return undefined;\n }, [value, inLineErrors, errorMapping, codeMirror]);\n\n const extendModeWithSingleLine = (\n mode: EditorConfiguration['mode'],\n singleLineEditor: boolean\n ) => {\n if (typeof mode === 'string' || (mode && typeof mode.name === 'string')) {\n return {\n name: typeof mode === 'string' ? mode : mode.name,\n isSingleLine: singleLineEditor\n };\n }\n return mode;\n };\n\n useEffect(() => {\n (async () => {\n if (editorConfigProps?.placeholder) {\n await import('codemirror/addon/display/placeholder');\n }\n\n if (languages.includes(editorConfigProps?.mode as string)) {\n await import('codemirror/mode/javascript/javascript');\n await import('codemirror/theme/eclipse.css');\n }\n\n if (editorConfigProps?.foldGutter && !isSingleLine) {\n await import('codemirror/addon/fold/foldcode');\n await import('codemirror/addon/fold/foldgutter');\n await import('codemirror/addon/fold/brace-fold');\n await import('codemirror/addon/fold/comment-fold');\n await import('codemirror/addon/fold/foldgutter.css');\n }\n\n if (editorConfigProps?.lint) {\n await import('codemirror/addon/lint/lint.css');\n await import('codemirror/addon/lint/lint');\n\n if (editorConfigProps.mode === 'json') {\n await import('codemirror/addon/lint/json-lint');\n registerHelper('lint', 'json', jsonLint);\n }\n }\n setShowEditor(true);\n })();\n }, [editorConfigProps]);\n\n const updatedEditorConfig: EditorConfiguration = useMemo(() => {\n const mode = extendModeWithSingleLine(editorConfigProps?.mode || 'expression', isSingleLine);\n return {\n ...editorConfigProps,\n lineWrapping: !isSingleLine,\n smartIndent: true,\n autoCloseBrackets: true,\n matchBrackets: true,\n lineNumbers: !isSingleLine && editorConfigProps?.lineNumbers,\n placeholder: editorConfigProps?.placeholder,\n extraKeys: {\n /** default tab and shift tab behavior\n * https://codemirror.net/5/\n * https://discuss.codemirror.net/t/does-tab-key-work-in-codemirror-6/2705\n */\n Tab: isSingleLine ? false : () => Pass,\n 'Shift-Tab': isSingleLine ? false : () => Pass,\n ...(isSingleLine ? { Enter: () => {} } : {})\n },\n mode,\n ...(languages.includes(editorConfigProps?.mode as string) ? { theme: 'eclipse' } : {}),\n ...(editorConfigProps?.foldGutter && !isSingleLine\n ? {\n foldGutter: true,\n gutters: (() => {\n const guttersArr: string[] = [];\n if (editorConfigProps?.lint) guttersArr.push('CodeMirror-lint-markers');\n if (editorConfigProps?.lineNumbers) guttersArr.push('CodeMirror-linenumbers');\n return [...guttersArr, 'CodeMirror-foldgutter'];\n })()\n }\n : {}),\n ...(editorConfigProps?.mode === 'json'\n ? {\n mode: 'application/json',\n lint: editorConfigProps.lint\n }\n : {})\n };\n }, [isSingleLine, editorConfigProps]);\n\n const handlePaste = (editor: Editor, event: ClipboardEvent) => {\n if (isSingleLine) {\n const doc = editor.getDoc();\n const pastedContent = event.clipboardData?.getData('text/plain').trim();\n const singleLineContent = pastedContent?.replace(/\\r?\\n|\\r/g, ' ') || '';\n\n if (doc && doc.getSelection()) {\n doc.replaceSelection(singleLineContent);\n } else {\n const cursor: Position = doc.getCursor();\n doc.replaceRange(singleLineContent, cursor);\n }\n const cursor: Position = doc.getCursor();\n doc.setCursor(cursor);\n event.preventDefault();\n }\n };\n\n useEffect(() => {\n const editor = editorRef.current;\n if (editor && isSingleLine) {\n editor.on('paste', handlePaste);\n }\n return () => {\n if (editor) {\n editor.off('paste', handlePaste);\n }\n };\n }, [isSingleLine]);\n\n useEffect(() => {\n const textArea = codeMirror?.getInputField();\n if (!textArea) return;\n\n let describedBy = textArea.getAttribute('aria-describedby') || '';\n const ids = new Set(describedBy.split(' ').filter(item => item));\n\n if (ariaDescribedBy && !ids.has(ariaDescribedBy)) {\n ids.add(ariaDescribedBy);\n }\n\n if (errors && !ids.has(errorDescId)) {\n ids.add(errorDescId);\n } else if (!errors && ids.has(errorDescId)) {\n ids.delete(errorDescId);\n }\n\n if (!ariaDescribedBy) {\n describedBy = ids.has(errorDescId) ? errorDescId : '';\n } else describedBy = Array.from(ids).join(' ').trim();\n\n if (describedBy) {\n textArea.setAttribute('aria-describedby', describedBy);\n } else {\n textArea.removeAttribute('aria-describedby');\n }\n }, [codeMirror, errors, ariaDescribedBy]);\n\n return (\n <>\n <StyledSuggestions isLoading={loading} suggestions={suggestions} />\n <StyledCodeEditor\n {...restProps}\n data-testid={testIds.root}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n ref={ref}\n errors={errors}\n readOnly={readOnly}\n isLoading={loading}\n suggestions={suggestions}\n isSingleLine={isSingleLine}\n editorConfigProps={updatedEditorConfig}\n >\n {showEditor && (\n <ReactCodeMirror\n value={value}\n onBeforeChange={onBeforeChange}\n options={updatedEditorConfig}\n editorDidMount={editor => {\n editor.setSize('100%', '100%');\n setCodeMirror(editor);\n editorRef.current = editor;\n }}\n onBlur={editor => {\n setIsFocused(false);\n if (onBlur) {\n onBlurHandler(editor);\n }\n }}\n onFocus={() => {\n setIsFocused(true);\n }}\n />\n )}\n {popoverInfo.errorMessages.length > 0 && popoverInfo.targetElement !== null && (\n <Popover\n as={StyledPopover}\n show={show}\n target={popoverInfo.targetElement}\n placement='bottom-start'\n data-testid={testIds.errorPopover}\n >\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Flex container={{ gap: 1 }}>\n <StyledWarnIcon name='warn-solid' />\n <Text variant='h4'>\n {t('errors', [], {\n count:\n popoverInfo.errorMessages.length === 1\n ? 1\n : // Using NaN to always select \"other\" pluralization form\n NaN\n })}\n </Text>\n </Flex>\n {popoverInfo.errorMessages.length > 1 ? (\n <UnorderedList as={StyledList} items={popoverInfo.errorMessages} />\n ) : (\n <Text>{popoverInfo.errorMessages}</Text>\n )}\n </Flex>\n </Popover>\n )}\n {errors && (\n <StyledFormFieldInfo id={errorDescId} status='error' data-testid={testIds.errorMessage}>\n {errors}\n </StyledFormFieldInfo>\n )}\n </StyledCodeEditor>\n </>\n );\n }\n);\n\nexport default withTestIds(CodeEditor, getEditorsTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":";AAAA,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,oCAAoC,CAAC;AAC5C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAUxE,OAAO,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,MAAM,EACN,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4DAA4D,CAAC;AAQjG,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;A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MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,aACzB,KAAC,cAAc,IAAC,IAAI,EAAC,YAAY,GAAG,EACpC,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YACf,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE;gDACf,KAAK,EACH,WAAW,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC;oDACpC,CAAC,CAAC,CAAC;oDACH,CAAC,CAAC,wDAAwD;wDACxD,GAAG;6CACV,CAAC,GACG,IACF,EACN,WAAW,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACtC,KAAC,aAAa,IAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,aAAa,GAAI,CACpE,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,cAAE,WAAW,CAAC,aAAa,GAAQ,CACzC,IACI,GACC,CACX,EACA,MAAM,IAAI,CACT,KAAC,mBAAmB,IAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAC,OAAO,iBAAc,OAAO,CAAC,YAAY,YACnF,MAAM,GACa,CACvB,IACgB,IAClB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["// cspell:words unfocus\nimport { forwardRef, useRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport { Controlled as ReactCodeMirror } from 'react-codemirror2';\nimport 'codemirror/addon/hint/show-hint.js';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/edit/matchbrackets';\nimport { Pass, showHint, defineMode, registerHelper } from 'codemirror';\nimport type {\n Editor,\n Position,\n EditorChange,\n EditorConfiguration,\n MarkerRange,\n TextMarker\n} from 'codemirror';\n\nimport {\n useTheme,\n Popover,\n Text,\n UnorderedList,\n Flex,\n useI18n,\n useTestIds,\n withTestIds,\n useUID,\n debounce\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\nimport { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type {\n AutoCompleteTriggerChar,\n CodeEditorProps,\n SuggestionType,\n CustomPositionProps\n} from './CodeEditor.types';\nimport {\n StyledSuggestions,\n StyledCodeEditor,\n StyledPopover,\n StyledList,\n StyledWarnIcon\n} from './CodeEditor.styles';\nimport getCodeSuggestions from './getCodeSuggestions';\nimport { getEditorsTestIds } from './CodeEditor.test-ids';\nimport { lint as jsonLint } from './mode/jsonLinter';\n\nconst contextText = 'ex-context';\nconst commentText = 'ex-comment';\nconst languages = ['json', 'javascript'];\n\nconst additionalOperators = ['and', 'or', 'when', 'otherwise', 'isA', 'asA', 'define', 'isNone'];\n\ndefineMode('expression', (config, parserConfig) => {\n const isSingleLine = parserConfig.isSingleLine;\n\n const tokens = [\n // Below regex is used to identify the context\n { token: /\\w+@/, style: contextText },\n // Below regex is used to identify the RuleType\n { token: /\\w+:/, style: contextText },\n // Below regex is used to identify the RuleName\n { token: /\\w+[(]/, style: 'ex-ruleName' },\n // Below regex is used to identify the delimeters\n { token: /[:.(),[\\]]/, style: 'ex-delimeter' },\n // Below regex is used to identify the operators\n { token: /[-+\\\\/*=<>@#]+/, style: 'ex-operator' },\n // Below regex is used to identify the spaces\n { token: / /, style: 'ex-space' }\n ];\n\n return {\n startState() {\n return { inString: false, inMultiLineComment: false };\n },\n token(stream, state) {\n /** Additional operator highlighting */\n for (let i = 0; i < additionalOperators.length; i += 1) {\n const keyword = additionalOperators[i];\n const len = keyword.length;\n const currentPos = stream.pos;\n\n if (stream.match(keyword, true)) {\n const before = currentPos === 0 ? null : stream.string.charAt(currentPos - 1);\n const after = stream.eol() ? null : stream.peek();\n\n const isWordChar = (char: string) => char.includes(' ');\n\n if ((!before || isWordChar(before)) && (!after || isWordChar(after))) {\n return 'ex-additional-operators';\n }\n stream.backUp(len);\n }\n }\n /* Highlights single and multi line comments */\n if (state.inMultiLineComment && !isSingleLine) {\n if (stream.match(/.*?\\*\\//)) {\n state.inMultiLineComment = false;\n } else {\n stream.skipToEnd();\n }\n return commentText;\n }\n\n if (stream.match(/\\/\\*/) && !isSingleLine) {\n state.inMultiLineComment = true;\n return commentText;\n }\n\n if (stream.match(/\\/\\//) && !isSingleLine) {\n stream.skipToEnd();\n return commentText;\n }\n // Used to identify the constants in the expression\n if (!state.inMultiLineComment) {\n const nextChar = stream.peek();\n if (!state.inString && (nextChar === \"'\" || nextChar === '\"')) {\n stream.next(); // Skip quote\n state.inString = true; // Update state\n }\n\n if (state.inString) {\n if (nextChar && stream.skipTo(nextChar)) {\n // Quote found on this line\n stream.next(); // Skip quote\n state.inString = false; // Clear flag\n } else {\n stream.skipToEnd(); // Rest of line is string\n }\n return nextChar === '\"' ? 'ex-constant' : contextText; // Token style\n }\n\n // Used to match the regex in the expression\n for (const element of tokens) {\n const match = stream.match(element.token, false);\n if (match) {\n if (stream.pos === stream.start) {\n stream.next();\n }\n return element.style;\n }\n }\n }\n stream.next();\n return null;\n }\n };\n});\n\nconst CodeEditor: ForwardRefForwardPropsComponent<CodeEditorProps> = forwardRef(\n (\n {\n testId,\n fetchSuggestions,\n autoCompleteTriggers,\n editorConfigProps,\n codeEditorHandle,\n defaultValue = '',\n loading = false,\n readOnly,\n isSingleLine = false,\n errors,\n onChange,\n onBlur,\n inLineErrors,\n 'aria-describedby': ariaDescribedBy,\n ...restProps\n }: PropsWithoutRef<CodeEditorProps>,\n ref: CodeEditorProps['ref']\n ) => {\n const t = useI18n();\n const [value, setCode] = useState<string>(defaultValue);\n const [showEditor, setShowEditor] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [suggestions, setSuggestions] = useState<SuggestionType[]>([]);\n const [codeMirror, setCodeMirror] = useState<Editor | null>(null);\n const [suggestionTrigger, setSuggestionTrigger] = useState<{\n character: AutoCompleteTriggerChar;\n cursorPosition: Position;\n } | null>(null);\n const [popover, showPopover] = useState(false);\n const mounted = useRef(false);\n const testIds = useTestIds(testId, getEditorsTestIds);\n const editorRef = useRef<Editor | null>(null);\n const uId = useUID();\n const errorDescId = `${uId}-description`;\n const onBlurRef = useRef(onBlur);\n const hasSuggestionRef = useRef(true);\n const theme = useTheme();\n\n useImperativeHandle(\n codeEditorHandle,\n () => ({\n insertText: (\n text: string,\n resetContent?: boolean,\n customPosition?: CustomPositionProps\n ) => {\n if (editorRef.current) {\n if (editorRef.current.getSelection()) {\n editorRef.current.replaceSelection(text);\n } else if (customPosition?.start && customPosition?.end) {\n editorRef.current.replaceRange(\n text,\n { ...customPosition.start },\n { ...customPosition.end }\n );\n } else {\n const cur: Position = editorRef.current.getCursor();\n const doc = editorRef.current.getDoc();\n const lastLine = doc.lastLine(); // Get the index of the last line\n const lastCharIndex = doc.getLine(lastLine).length;\n editorRef.current.replaceRange(\n text,\n resetContent ? { ch: lastCharIndex, line: lastLine } : cur,\n resetContent ? { ch: 0, line: 0 } : undefined\n );\n }\n }\n },\n getValue: () => {\n return editorRef.current?.getValue();\n }\n }),\n []\n );\n\n const autoComplete = (codeEditor: Editor) => {\n const hintOptions = {\n completeSingle: false,\n completeOnSingleClick: true,\n closeCharacters: /./s,\n closeOnUnfocus: true,\n suggestions,\n loading,\n triggerCharacterCursorPos: suggestionTrigger?.cursorPosition,\n theme\n };\n\n debounce(() => showHint(codeEditor, getCodeSuggestions, hintOptions), 100)();\n };\n\n const errorHandler = (val: string) => {\n if (!editorConfigProps?.lint) return;\n const mode = editorConfigProps?.mode;\n switch (mode) {\n case 'json':\n return jsonLint(val);\n case 'expression':\n default:\n return undefined;\n }\n };\n\n useEffect(() => {\n onBlurRef.current = onBlur;\n }, [onBlur]);\n\n const onBlurHandler = (editor: Editor) => {\n if (onBlurRef.current) {\n onBlurRef.current(editor.getDoc().getValue());\n }\n };\n\n const onBeforeChange = async (editor: Editor, _data: EditorChange, textvalue: string) => {\n const updatedTextValue = isSingleLine ? textvalue.replaceAll(/\\n/g, '') : textvalue;\n setCode(updatedTextValue);\n /** _data.origin is a flag from codemirror that tells from where the change was made in the code editor input */\n onChange?.(updatedTextValue, errorHandler(updatedTextValue), _data.origin);\n const currentCursor = editor.getCursor();\n const currentCharacter = editor\n .getTokenAt(currentCursor)\n .string.trim() as AutoCompleteTriggerChar;\n let newSuggestions: SuggestionType[] = [];\n\n if (autoCompleteTriggers?.includes(currentCharacter) && fetchSuggestions) {\n const suggestionData = await fetchSuggestions(currentCharacter, {\n line: currentCursor.line,\n ch: currentCursor.ch\n });\n\n if (suggestionData === undefined) {\n hasSuggestionRef.current = false;\n return;\n }\n\n setSuggestionTrigger({\n character: currentCharacter,\n cursorPosition: currentCursor\n });\n\n hasSuggestionRef.current = true;\n newSuggestions = [...suggestionData];\n if (mounted.current) {\n setSuggestions(newSuggestions);\n }\n }\n };\n\n useEffect(() => {\n if (!popover) {\n return;\n }\n const isSuggestionTriggerPresent =\n suggestionTrigger &&\n codeMirror\n ?.getTokenAt(suggestionTrigger.cursorPosition)\n .string.includes(suggestionTrigger.character);\n\n if (!isSuggestionTriggerPresent) {\n codeMirror?.closeHint();\n showPopover(false);\n setSuggestionTrigger(null);\n }\n }, [onBeforeChange]);\n\n useEffect(() => {\n if (codeMirror && isFocused && hasSuggestionRef.current && (suggestionTrigger || loading)) {\n autoComplete(codeMirror);\n showPopover(true);\n } else {\n codeMirror?.closeHint();\n showPopover(false);\n }\n }, [suggestions, loading, suggestionTrigger, codeMirror]);\n\n const [popoverInfo, setPopoverInfo] = useState<{\n targetElement: Element | null;\n errorMessages: string[];\n }>({ targetElement: null, errorMessages: [] });\n\n const [show, setShow] = useState(false);\n const [errorMapping, setErrorMapping] = useState<string[][]>([]);\n const [textMarkerList, setTextMarkerList] = useState<TextMarker<MarkerRange>[]>([]);\n\n const removeInLineErrors = () => {\n if (textMarkerList.length) {\n textMarkerList.forEach(item => item.clear());\n }\n };\n\n useEffect(() => {\n removeInLineErrors();\n if (inLineErrors?.length && codeMirror) {\n const markerList: TextMarker<MarkerRange>[] = [];\n const errorMessageMap = inLineErrors?.map(({ start, end, messages }, index) => {\n if (messages.length) {\n markerList.push(\n codeMirror.markText(start, end, {\n className: `cm-ex-underline-error error-${index}`\n })\n );\n return messages;\n }\n return [];\n });\n setTextMarkerList(markerList);\n setErrorMapping(errorMessageMap);\n } else {\n setErrorMapping([]);\n }\n }, [inLineErrors, codeMirror]);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const getErrors = (target: Element) => {\n const errorMessages: string[] = [];\n if (target) {\n errorMapping.forEach((item, index) => {\n if (target.classList.contains(`error-${index}`)) {\n errorMessages.push(...item);\n }\n });\n }\n\n return errorMessages;\n };\n\n const onMouseMove = (event: Event | null, type?: string) => {\n if (codeMirror && errorMapping.length) {\n let target: Element | null;\n\n if (type === 'cursor') {\n const coords = codeMirror.getCursor();\n const charCoords = codeMirror.charCoords(coords, 'window');\n target = document.elementFromPoint(charCoords.left, charCoords.top);\n } else {\n target = event?.target instanceof Element ? event.target : null;\n }\n\n if (target) {\n const errorMessages = getErrors(target);\n if (errorMessages.length) {\n setPopoverInfo(() => {\n return {\n targetElement: target,\n errorMessages\n };\n });\n setShow(true);\n } else {\n setShow(false);\n }\n }\n }\n };\n\n const onMouseLeave = () => {\n setShow(false);\n };\n\n const hidePopover = (e: KeyboardEvent) => {\n if (e.shiftKey && (e.metaKey || e.ctrlKey) && e.key === ' ') {\n onMouseMove(null, 'cursor');\n } else {\n setShow(false);\n }\n };\n\n useEffect(() => {\n if (codeMirror && inLineErrors?.length && errorMapping.length) {\n const codeMirrorWrapper = codeMirror.getWrapperElement();\n\n codeMirrorWrapper.addEventListener('keydown', hidePopover);\n codeMirrorWrapper.addEventListener('mousedown', onMouseLeave);\n\n const elementsWithClassName = Array.from(\n codeMirrorWrapper.getElementsByClassName('cm-ex-underline-error')\n );\n\n elementsWithClassName.forEach(element => {\n element.addEventListener('mouseenter', onMouseMove);\n element.addEventListener('mouseleave', onMouseLeave);\n });\n\n return () => {\n codeMirrorWrapper.removeEventListener('keydown', hidePopover);\n codeMirrorWrapper.removeEventListener('mousedown', onMouseLeave);\n\n elementsWithClassName.forEach(element => {\n element.removeEventListener('mouseenter', onMouseMove);\n element.removeEventListener('mouseleave', onMouseLeave);\n });\n };\n }\n return undefined;\n }, [value, inLineErrors, errorMapping, codeMirror]);\n\n const extendModeWithSingleLine = (\n mode: EditorConfiguration['mode'],\n singleLineEditor: boolean\n ) => {\n if (typeof mode === 'string' || (mode && typeof mode.name === 'string')) {\n return {\n name: typeof mode === 'string' ? mode : mode.name,\n isSingleLine: singleLineEditor\n };\n }\n return mode;\n };\n\n useEffect(() => {\n (async () => {\n if (editorConfigProps?.placeholder) {\n await import('codemirror/addon/display/placeholder');\n }\n\n if (languages.includes(editorConfigProps?.mode as string)) {\n await import('codemirror/mode/javascript/javascript');\n await import('codemirror/theme/eclipse.css');\n }\n\n if (editorConfigProps?.foldGutter && !isSingleLine) {\n await import('codemirror/addon/fold/foldcode');\n await import('codemirror/addon/fold/foldgutter');\n await import('codemirror/addon/fold/brace-fold');\n await import('codemirror/addon/fold/comment-fold');\n await import('codemirror/addon/fold/foldgutter.css');\n }\n\n if (editorConfigProps?.lint) {\n await import('codemirror/addon/lint/lint.css');\n await import('codemirror/addon/lint/lint');\n\n if (editorConfigProps.mode === 'json') {\n await import('codemirror/addon/lint/json-lint');\n registerHelper('lint', 'json', jsonLint);\n }\n }\n setShowEditor(true);\n })();\n }, [editorConfigProps]);\n\n const updatedEditorConfig: EditorConfiguration = useMemo(() => {\n const mode = extendModeWithSingleLine(editorConfigProps?.mode || 'expression', isSingleLine);\n return {\n ...editorConfigProps,\n lineWrapping: !isSingleLine,\n smartIndent: true,\n autoCloseBrackets: true,\n matchBrackets: true,\n lineNumbers: !isSingleLine && editorConfigProps?.lineNumbers,\n placeholder: editorConfigProps?.placeholder,\n extraKeys: {\n /** default tab and shift tab behavior\n * https://codemirror.net/5/\n * https://discuss.codemirror.net/t/does-tab-key-work-in-codemirror-6/2705\n */\n Tab: isSingleLine ? false : () => Pass,\n 'Shift-Tab': isSingleLine ? false : () => Pass,\n ...(isSingleLine ? { Enter: () => {} } : {})\n },\n mode,\n ...(languages.includes(editorConfigProps?.mode as string) ? { theme: 'eclipse' } : {}),\n ...(editorConfigProps?.foldGutter && !isSingleLine\n ? {\n foldGutter: true,\n gutters: (() => {\n const guttersArr: string[] = [];\n if (editorConfigProps?.lint) guttersArr.push('CodeMirror-lint-markers');\n if (editorConfigProps?.lineNumbers) guttersArr.push('CodeMirror-linenumbers');\n return [...guttersArr, 'CodeMirror-foldgutter'];\n })()\n }\n : {}),\n ...(editorConfigProps?.mode === 'json'\n ? {\n mode: 'application/json',\n lint: editorConfigProps.lint\n }\n : {})\n };\n }, [isSingleLine, editorConfigProps]);\n\n const handlePaste = (editor: Editor, event: ClipboardEvent) => {\n if (isSingleLine) {\n const doc = editor.getDoc();\n const pastedContent = event.clipboardData?.getData('text/plain').trim();\n const singleLineContent = pastedContent?.replace(/\\r?\\n|\\r/g, ' ') || '';\n\n if (doc && doc.getSelection()) {\n doc.replaceSelection(singleLineContent);\n } else {\n const cursor: Position = doc.getCursor();\n doc.replaceRange(singleLineContent, cursor);\n }\n const cursor: Position = doc.getCursor();\n doc.setCursor(cursor);\n event.preventDefault();\n }\n };\n\n useEffect(() => {\n const editor = editorRef.current;\n if (editor && isSingleLine) {\n editor.on('paste', handlePaste);\n }\n return () => {\n if (editor) {\n editor.off('paste', handlePaste);\n }\n };\n }, [isSingleLine]);\n\n useEffect(() => {\n const textArea = codeMirror?.getInputField();\n if (!textArea) return;\n\n let describedBy = textArea.getAttribute('aria-describedby') || '';\n const ids = new Set(describedBy.split(' ').filter(item => item));\n\n if (ariaDescribedBy && !ids.has(ariaDescribedBy)) {\n ids.add(ariaDescribedBy);\n }\n\n if (errors && !ids.has(errorDescId)) {\n ids.add(errorDescId);\n } else if (!errors && ids.has(errorDescId)) {\n ids.delete(errorDescId);\n }\n\n if (!ariaDescribedBy) {\n describedBy = ids.has(errorDescId) ? errorDescId : '';\n } else describedBy = Array.from(ids).join(' ').trim();\n\n if (describedBy) {\n textArea.setAttribute('aria-describedby', describedBy);\n } else {\n textArea.removeAttribute('aria-describedby');\n }\n }, [codeMirror, errors, ariaDescribedBy]);\n\n return (\n <>\n <StyledSuggestions isLoading={loading} suggestions={suggestions} theme={theme} />\n <StyledCodeEditor\n {...restProps}\n data-testid={testIds.root}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n ref={ref}\n errors={errors}\n readOnly={readOnly}\n isLoading={loading}\n suggestions={suggestions}\n isSingleLine={isSingleLine}\n editorConfigProps={updatedEditorConfig}\n >\n {showEditor && (\n <ReactCodeMirror\n value={value}\n onBeforeChange={onBeforeChange}\n options={updatedEditorConfig}\n editorDidMount={editor => {\n editor.setSize('100%', '100%');\n setCodeMirror(editor);\n editorRef.current = editor;\n }}\n onBlur={editor => {\n setIsFocused(false);\n if (onBlur) {\n onBlurHandler(editor);\n }\n }}\n onFocus={() => {\n setIsFocused(true);\n }}\n />\n )}\n {popoverInfo.errorMessages.length > 0 && popoverInfo.targetElement !== null && (\n <Popover\n as={StyledPopover}\n show={show}\n target={popoverInfo.targetElement}\n placement='bottom-start'\n data-testid={testIds.errorPopover}\n >\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Flex container={{ gap: 1 }}>\n <StyledWarnIcon name='warn-solid' />\n <Text variant='h4'>\n {t('errors', [], {\n count:\n popoverInfo.errorMessages.length === 1\n ? 1\n : // Using NaN to always select \"other\" pluralization form\n NaN\n })}\n </Text>\n </Flex>\n {popoverInfo.errorMessages.length > 1 ? (\n <UnorderedList as={StyledList} items={popoverInfo.errorMessages} />\n ) : (\n <Text>{popoverInfo.errorMessages}</Text>\n )}\n </Flex>\n </Popover>\n )}\n {errors && (\n <StyledFormFieldInfo id={errorDescId} status='error' data-testid={testIds.errorMessage}>\n {errors}\n </StyledFormFieldInfo>\n )}\n </StyledCodeEditor>\n </>\n );\n }\n);\n\nexport default withTestIds(CodeEditor, getEditorsTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAK1E,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,cAAc,0LAIzB,CAAC;AAIH,eAAO,MAAM,aAAa,yGAWxB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAIrB,CAAC;AAGH,eAAO,MAAM,gBAAgB;gBAEb,OAAO;aACV,MAAM;eACJ,OAAO;iBACL,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAK1E,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,cAAc,0LAIzB,CAAC;AAIH,eAAO,MAAM,aAAa,yGAWxB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAIrB,CAAC;AAGH,eAAO,MAAM,gBAAgB;gBAEb,OAAO;aACV,MAAM;eACJ,OAAO;iBACL,cAAc,EAAE;SAyjB/B,CAAC;AAIH,eAAO,MAAM,iBAAiB;gBAChB,OAAO;iBACN,cAAc,EAAE;4CA+C7B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { createGlobalStyle, css } from 'styled-components';
|
|
2
|
-
import { mix } from 'polished';
|
|
2
|
+
import { mix, transparentize } from 'polished';
|
|
3
3
|
import { defaultThemeProp, calculateFontSize, Flex, Icon } from '@pega/cosmos-react-core';
|
|
4
4
|
import { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
|
|
5
5
|
const primaryBackground = 'primary-background';
|
|
@@ -86,14 +86,34 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
86
86
|
|
|
87
87
|
${editorConfigProps?.theme === 'eclipse' &&
|
|
88
88
|
css `
|
|
89
|
-
.cm-s-eclipse
|
|
90
|
-
|
|
89
|
+
.cm-s-eclipse {
|
|
90
|
+
.cm-string {
|
|
91
|
+
color: ${base.palette.pending};
|
|
92
|
+
&.cm-property {
|
|
93
|
+
color: ${base.palette['foreground-color']};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
.cm-operator {
|
|
97
|
+
color: ${base.palette.info};
|
|
98
|
+
}
|
|
99
|
+
.cm-variable,
|
|
100
|
+
.cm-variable-2,
|
|
101
|
+
.cm-variable-3 {
|
|
102
|
+
color: ${base.palette['foreground-color']};
|
|
103
|
+
}
|
|
104
|
+
.cm-atom,
|
|
105
|
+
.cm-keyword {
|
|
106
|
+
color: ${base.palette.warn};
|
|
107
|
+
}
|
|
108
|
+
.cm-number {
|
|
109
|
+
color: ${base.palette.success};
|
|
110
|
+
}
|
|
91
111
|
}
|
|
92
112
|
`}
|
|
93
113
|
|
|
94
114
|
.CodeMirror-scrollbar-filler,
|
|
95
115
|
.CodeMirror-gutter-filler {
|
|
96
|
-
background-color:
|
|
116
|
+
background-color: ${base.palette['primary-background']}; /* The little square between H and V scrollbars */
|
|
97
117
|
}
|
|
98
118
|
|
|
99
119
|
/* GUTTER */
|
|
@@ -104,23 +124,23 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
104
124
|
top: 0;
|
|
105
125
|
min-height: 100%;
|
|
106
126
|
z-index: 3;
|
|
107
|
-
border-right: 0.063rem solid
|
|
108
|
-
background-color:
|
|
127
|
+
border-right: 0.063rem solid ${base.palette['border-line']};
|
|
128
|
+
background-color: ${base.palette['secondary-background']};
|
|
109
129
|
white-space: nowrap;
|
|
110
130
|
}
|
|
111
131
|
.CodeMirror-linenumber {
|
|
112
132
|
padding: 0 0.125rem 0 0.313rem;
|
|
113
133
|
min-width: 1.25rem;
|
|
114
134
|
text-align: right;
|
|
115
|
-
color:
|
|
135
|
+
color: ${transparentize(0.5, base.palette['foreground-color'])};
|
|
116
136
|
white-space: nowrap;
|
|
117
137
|
}
|
|
118
138
|
|
|
119
139
|
.CodeMirror-guttermarker {
|
|
120
|
-
color:
|
|
140
|
+
color: ${base.palette['foreground-color']};
|
|
121
141
|
}
|
|
122
142
|
.CodeMirror-guttermarker-subtle {
|
|
123
|
-
color:
|
|
143
|
+
color: ${transparentize(0.5, base.palette['foreground-color'])};
|
|
124
144
|
}
|
|
125
145
|
|
|
126
146
|
/* CURSOR */
|
|
@@ -128,7 +148,7 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
128
148
|
.CodeMirror-cursor {
|
|
129
149
|
position: absolute;
|
|
130
150
|
pointer-events: none;
|
|
131
|
-
border-left: 0.0625rem solid ${base.palette.
|
|
151
|
+
border-left: 0.0625rem solid ${base.palette.interactive};
|
|
132
152
|
border-right: none;
|
|
133
153
|
width: 0;
|
|
134
154
|
${readOnly &&
|
|
@@ -139,7 +159,7 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
139
159
|
|
|
140
160
|
/* Shown when moving in bi-directional text */
|
|
141
161
|
.CodeMirror div.CodeMirror-secondarycursor {
|
|
142
|
-
border-left: 0.063rem solid
|
|
162
|
+
border-left: 0.063rem solid ${base.palette['secondary-background']};
|
|
143
163
|
}
|
|
144
164
|
.cm-fat-cursor-mark {
|
|
145
165
|
background-color: rgba(20, 255, 20, 0.5);
|
|
@@ -185,7 +205,7 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
185
205
|
overflow: hidden;
|
|
186
206
|
}
|
|
187
207
|
.CodeMirror-ruler {
|
|
188
|
-
border-left: 0.063rem solid
|
|
208
|
+
border-left: 0.063rem solid ${base.palette['border-line']};
|
|
189
209
|
top: 0;
|
|
190
210
|
bottom: 0;
|
|
191
211
|
position: absolute;
|
|
@@ -256,26 +276,26 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
256
276
|
color: #3300aa;
|
|
257
277
|
}
|
|
258
278
|
.cm-s-default .cm-bracket {
|
|
259
|
-
color:
|
|
279
|
+
color: ${base.palette.skeleton};
|
|
260
280
|
}
|
|
261
281
|
.cm-s-default .cm-tag {
|
|
262
|
-
color:
|
|
282
|
+
color: ${base.palette.info};
|
|
263
283
|
}
|
|
264
284
|
.cm-s-default .cm-attribute {
|
|
265
|
-
color:
|
|
285
|
+
color: ${base.palette.interactive};
|
|
266
286
|
}
|
|
267
287
|
.cm-s-default .cm-hr {
|
|
268
|
-
color:
|
|
288
|
+
color: ${base.palette['border-line']};
|
|
269
289
|
}
|
|
270
290
|
.cm-s-default .cm-link {
|
|
271
|
-
color:
|
|
291
|
+
color: ${base.palette.interactive};
|
|
272
292
|
}
|
|
273
293
|
|
|
274
294
|
.cm-s-default .cm-error {
|
|
275
|
-
color:
|
|
295
|
+
color: ${base.palette.urgent};
|
|
276
296
|
}
|
|
277
297
|
.cm-invalidchar {
|
|
278
|
-
color:
|
|
298
|
+
color: ${base.palette.urgent};
|
|
279
299
|
}
|
|
280
300
|
|
|
281
301
|
.CodeMirror-composing {
|
|
@@ -285,16 +305,18 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
285
305
|
/* Default styles for common addons */
|
|
286
306
|
|
|
287
307
|
div.CodeMirror span.CodeMirror-matchingbracket {
|
|
288
|
-
color:
|
|
308
|
+
color: ${base.palette.success} !important;
|
|
309
|
+
outline: 0.0625rem dotted ${base.palette.success};
|
|
289
310
|
}
|
|
290
311
|
div.CodeMirror span.CodeMirror-nonmatchingbracket {
|
|
291
|
-
color:
|
|
312
|
+
color: ${base.palette.urgent} !important;
|
|
313
|
+
outline: 0.0625rem dotted ${base.palette.urgent};
|
|
292
314
|
}
|
|
293
315
|
.CodeMirror-matchingtag {
|
|
294
|
-
background:
|
|
316
|
+
background: ${transparentize(0.5, base.palette.warn)};
|
|
295
317
|
}
|
|
296
318
|
.CodeMirror-activeline-background {
|
|
297
|
-
background:
|
|
319
|
+
background: ${base.palette['secondary-background']};
|
|
298
320
|
}
|
|
299
321
|
|
|
300
322
|
/* STOP */
|
|
@@ -457,10 +479,10 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
457
479
|
}
|
|
458
480
|
|
|
459
481
|
.CodeMirror-selected {
|
|
460
|
-
background:
|
|
482
|
+
background: ${transparentize(0.8, base.palette.interactive)};
|
|
461
483
|
}
|
|
462
484
|
.CodeMirror-focused .CodeMirror-selected {
|
|
463
|
-
background:
|
|
485
|
+
background: ${transparentize(0.8, base.palette.interactive)};
|
|
464
486
|
}
|
|
465
487
|
.CodeMirror-focused {
|
|
466
488
|
border-color: ${base.palette.interactive} !important;
|
|
@@ -474,16 +496,16 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
474
496
|
.CodeMirror-line::selection,
|
|
475
497
|
.CodeMirror-line > span::selection,
|
|
476
498
|
.CodeMirror-line > span > span::selection {
|
|
477
|
-
background:
|
|
499
|
+
background: ${transparentize(0.8, base.palette.interactive)};
|
|
478
500
|
}
|
|
479
501
|
.CodeMirror-line::-moz-selection,
|
|
480
502
|
.CodeMirror-line > span::-moz-selection,
|
|
481
503
|
.CodeMirror-line > span > span::-moz-selection {
|
|
482
|
-
background:
|
|
504
|
+
background: ${transparentize(0.8, base.palette.interactive)};
|
|
483
505
|
}
|
|
484
506
|
|
|
485
507
|
.cm-searching {
|
|
486
|
-
background-color:
|
|
508
|
+
background-color: ${transparentize(0.5, base.palette['foreground-color'])};
|
|
487
509
|
}
|
|
488
510
|
|
|
489
511
|
/* Used to force a border model for a node */
|
|
@@ -537,7 +559,7 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
537
559
|
font-weight: bold;
|
|
538
560
|
}
|
|
539
561
|
.cm-ex-comment {
|
|
540
|
-
color: ${base.palette.info};
|
|
562
|
+
color: ${transparentize(0.2, base.palette.info)};
|
|
541
563
|
}
|
|
542
564
|
.cm-ex-ruleName {
|
|
543
565
|
color: ${base.palette.success};
|
|
@@ -551,7 +573,7 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
551
573
|
.cm-ex-underline-error {
|
|
552
574
|
text-decoration: underline;
|
|
553
575
|
text-decoration-style: wavy;
|
|
554
|
-
text-decoration-color: ${base.
|
|
576
|
+
text-decoration-color: ${base.palette.urgent};
|
|
555
577
|
}
|
|
556
578
|
`;
|
|
557
579
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAI7F,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,YAAY,GAAG,eAAe,CAAC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEtC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,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EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3E,OAAO,GAAG,CAAA;;;sBAGU,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;2BACnB,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;kCAC3C,IAAI,CAAC,eAAe,CAAC;oBACnC,IAAI,CAAC,MAAM,CAAC,GAAG;gCACH,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;0BACjC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;mBACtC,SAAS,CAAC,CAAC;;;mBAGX,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;;0BAId,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;4BAGnB,WAAW;;;;4BAIX,UAAU;;wBAEd,IAAI,CAAC,OAAO;;;;iBAInB,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO;;;MAGlC,CAAC,SAAS;QACZ,WAAW,EAAE,MAAM,GAAG,CAAC;QACvB,GAAG,CAAA;;4BAEqB,WAAW;;KAElC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { defaultThemeProp, calculateFontSize, Flex, Icon } from '@pega/cosmos-react-core';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type { CodeEditorProps, SuggestionType } from './CodeEditor.types';\n\nconst primaryBackground = 'primary-background';\nconst contentWidth = 'content-width';\n\nexport const StyledLoading = styled.div`\n font-size: 1.5rem;\n`;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.xxs};\n max-width: ${theme.base[contentWidth].sm};\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n pointer-events: none;\n `;\n});\n\nStyledPopover.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.div(({ theme }) => {\n return css`\n padding-inline-start: calc(0.25 * ${theme.base.spacing});\n `;\n});\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditor = styled(Flex)<\n Pick<CodeEditorProps, 'showEditorOnly' | 'editorConfigProps' | 'isSingleLine'> & {\n isLoading?: boolean;\n errors?: string;\n readOnly?: boolean;\n suggestions: SuggestionType[];\n }\n>(({\n theme: {\n base,\n components: {\n 'form-control': {\n 'background-color': formControlBgColor,\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'form-field': {\n error: { 'status-color': errorBackground }\n },\n input\n }\n },\n errors,\n readOnly,\n showEditorOnly,\n editorConfigProps,\n isSingleLine = false\n}) => {\n const jsonMode = editorConfigProps?.mode === 'application/json';\n\n return css`\n width: 100%;\n ${showEditorOnly &&\n css`\n max-height: 10rem;\n width: 27vw;\n `}\n position: relative;\n ${!showEditorOnly &&\n css`\n max-height: 100%;\n `}\n overflow-y: auto;\n ${StyledFormField} {\n flex-grow: 1;\n }\n\n /* PADDING */\n .react-codemirror2 {\n flex-grow: 1;\n ${isSingleLine\n ? css`\n min-height: ${input.height};\n & * {\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n }\n `\n : css`\n min-height: 3.75rem;\n `}\n overflow-y: auto;\n ${readOnly &&\n !jsonMode &&\n css`\n max-height: 5.625rem;\n `}\n }\n\n .CodeMirror-placeholder {\n opacity: ${base.transparency['transparent-3']};\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: ${base.spacing} 0;\n }\n\n ${editorConfigProps?.theme === 'eclipse' &&\n css`\n .cm-s-eclipse .cm-string {\n color: ${base.palette.urgent};\n }\n `}\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n position: absolute;\n left: 0;\n top: 0;\n min-height: 100%;\n z-index: 3;\n border-right: 0.063rem solid #dddddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumber {\n padding: 0 0.125rem 0 0.313rem;\n min-width: 1.25rem;\n text-align: right;\n color: #999999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-left: 0.0625rem solid ${base.palette.dark};\n border-right: none;\n width: 0;\n ${readOnly &&\n css`\n display: none;\n `}\n }\n\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 0.063rem solid silver;\n }\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #77ee77;\n }\n @-moz-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @-webkit-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -3.125rem;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 0.063rem solid #cccccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-s-default .cm-header {\n color: blue;\n }\n .cm-negative {\n color: #dd4444;\n }\n .cm-positive {\n color: #229922;\n }\n .cm-strong {\n font-weight: bold;\n }\n .cm-s-default .cm-quote {\n color: #009900;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .cm-s-default .cm-keyword {\n color: #770088;\n }\n .cm-s-default .cm-atom {\n color: #221199;\n }\n .cm-s-default .cm-number {\n color: #116644;\n }\n .cm-s-default .cm-def {\n color: #0000ff;\n }\n .cm-s-default .cm-variable-2 {\n color: #0055aa;\n }\n .cm-s-default .cm-variable-3,\n .cm-s-default .cm-type {\n color: #008855;\n }\n .cm-s-default .cm-comment {\n color: #aa5500;\n }\n .cm-s-default .cm-string {\n color: #aa1111;\n }\n .cm-s-default .cm-string-2 {\n color: #ff5500;\n }\n .cm-s-default .cm-meta {\n color: #555555;\n }\n .cm-s-default .cm-qualifier {\n color: #555555;\n }\n .cm-s-default .cm-builtin {\n color: #3300aa;\n }\n .cm-s-default .cm-bracket {\n color: #999977;\n }\n .cm-s-default .cm-tag {\n color: #117700;\n }\n .cm-s-default .cm-attribute {\n color: #0000cc;\n }\n .cm-s-default .cm-hr {\n color: #999999;\n }\n .cm-s-default .cm-link {\n color: #0000cc;\n }\n\n .cm-s-default .cm-error {\n color: #ff0000;\n }\n .cm-invalidchar {\n color: #ff0000;\n }\n\n .CodeMirror-composing {\n border-bottom: 0.125rem solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #00bb00;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #aa2222;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror-scroll {\n overflow: scroll !important;\n margin-bottom: -3.125rem;\n margin-right: -3.125rem;\n padding-bottom: 3.125rem;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 3.125rem solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n }\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n .CodeMirror-gutter-filler {\n left: 0;\n bottom: 0;\n }\n .CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -3.125rem;\n }\n .CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n }\n .CodeMirror-gutter-background {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 4;\n }\n .CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n }\n .CodeMirror-gutter-wrapper ::selection {\n background-color: transparent;\n }\n .CodeMirror-gutter-wrapper ::-moz-selection {\n background-color: transparent;\n }\n\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n padding: 0 ${base.spacing};\n }\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.006rem; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: #d9d9d9;\n }\n .CodeMirror-focused .CodeMirror-selected {\n background: #d7d4f0;\n }\n .CodeMirror-focused {\n border-color: ${base.palette.interactive} !important;\n }\n .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {\n visibility: hidden;\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n .CodeMirror-line::selection,\n .CodeMirror-line > span::selection,\n .CodeMirror-line > span > span::selection {\n background: #d7d4f0;\n }\n .CodeMirror-line::-moz-selection,\n .CodeMirror-line > span::-moz-selection,\n .CodeMirror-line > span > span::-moz-selection {\n background: #d7d4f0;\n }\n\n .cm-searching {\n background-color: rgba(255, 255, 0, 0.4);\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.006rem;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack::after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n .CodeMirror {\n ${isSingleLine &&\n css`\n white-space: nowrap;\n height: auto;\n padding-inline-end: ${base.spacing};\n `}\n overflow: hidden;\n font-family: monospace;\n direction: ltr;\n position: relative;\n background-color: ${formControlBgColor};\n color: ${base.palette['foreground-color']};\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: calc(0.5 * ${base['border-radius']});\n ${errors &&\n css`\n border-color: ${errorBackground};\n `}\n ${readOnly &&\n css`\n background-color: ${readOnlyBackgroundColor};\n `}\n }\n\n .cm-ex-context {\n color: ${base.palette.interactive};\n }\n .cm-ex-additional-operators {\n color: ${base.palette.interactive};\n }\n .cm-ex-operator {\n color: ${base.palette.warn};\n font-weight: bold;\n }\n .cm-ex-comment {\n color: ${base.palette.info};\n }\n .cm-ex-ruleName {\n color: ${base.palette.success};\n }\n .cm-ex-delimeter {\n color: ${base.palette['foreground-color']};\n }\n .cm-ex-constant {\n color: ${base.palette.pending};\n }\n .cm-ex-underline-error {\n text-decoration: underline;\n text-decoration-style: wavy;\n text-decoration-color: ${base.colors.red.medium};\n }\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestions = createGlobalStyle<{\n isLoading?: boolean;\n suggestions: SuggestionType[];\n}>(({ theme: { base }, isLoading, suggestions }) => {\n const activeColor = mix(0.85, base.palette[primaryBackground], base.palette.interactive);\n\n const hoverColor = mix(0.95, base.palette[primaryBackground], base.palette.interactive);\n\n const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);\n return css`\n .CodeMirror-hints {\n position: absolute;\n z-index: calc(${base['z-index'].backdrop} + 1);\n transition: height ${base.animation.speed} ${base.animation.timing.ease};\n border-radius: calc(0.5 * ${base['border-radius']});\n box-shadow: ${base.shadow.low};\n border: 0.0625rem solid ${base.palette['border-line']};\n background-color: ${base.palette[primaryBackground]};\n font-size: ${fontSizes.s};\n max-height: 12rem;\n overflow-y: auto;\n min-width: ${base[contentWidth].xs};\n }\n\n .CodeMirror-hint {\n width: calc(1.5 * ${base[contentWidth].xs});\n cursor: pointer;\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n padding-inline: ${base.spacing};\n }\n\n body .CodeMirror-lint-tooltip {\n z-index: ${base['z-index'].tooltip};\n }\n\n ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n});\n\nStyledSuggestions.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAI7F,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,YAAY,GAAG,eAAe,CAAC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEtC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvD,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;GACnC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE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C,WAAW,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3E,OAAO,GAAG,CAAA;;;sBAGU,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;2BACnB,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;kCAC3C,IAAI,CAAC,eAAe,CAAC;oBACnC,IAAI,CAAC,MAAM,CAAC,GAAG;gCACH,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;0BACjC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;mBACtC,SAAS,CAAC,CAAC;;;mBAGX,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;;0BAId,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;4BAGnB,WAAW;;;;4BAIX,UAAU;;wBAEd,IAAI,CAAC,OAAO;;;;iBAInB,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO;;;MAGlC,CAAC,SAAS;QACZ,WAAW,EAAE,MAAM,GAAG,CAAC;QACvB,GAAG,CAAA;;4BAEqB,WAAW;;KAElC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components';\nimport { mix, transparentize } from 'polished';\n\nimport { defaultThemeProp, calculateFontSize, Flex, Icon } from '@pega/cosmos-react-core';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type { CodeEditorProps, SuggestionType } from './CodeEditor.types';\n\nconst primaryBackground = 'primary-background';\nconst contentWidth = 'content-width';\n\nexport const StyledLoading = styled.div`\n font-size: 1.5rem;\n`;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.xxs};\n max-width: ${theme.base[contentWidth].sm};\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n pointer-events: none;\n `;\n});\n\nStyledPopover.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.div(({ theme }) => {\n return css`\n padding-inline-start: calc(0.25 * ${theme.base.spacing});\n `;\n});\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditor = styled(Flex)<\n Pick<CodeEditorProps, 'showEditorOnly' | 'editorConfigProps' | 'isSingleLine'> & {\n isLoading?: boolean;\n errors?: string;\n readOnly?: boolean;\n suggestions: SuggestionType[];\n }\n>(({\n theme: {\n base,\n components: {\n 'form-control': {\n 'background-color': formControlBgColor,\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'form-field': {\n error: { 'status-color': errorBackground }\n },\n input\n }\n },\n errors,\n readOnly,\n showEditorOnly,\n editorConfigProps,\n isSingleLine = false\n}) => {\n const jsonMode = editorConfigProps?.mode === 'application/json';\n\n return css`\n width: 100%;\n ${showEditorOnly &&\n css`\n max-height: 10rem;\n width: 27vw;\n `}\n position: relative;\n ${!showEditorOnly &&\n css`\n max-height: 100%;\n `}\n overflow-y: auto;\n ${StyledFormField} {\n flex-grow: 1;\n }\n\n /* PADDING */\n .react-codemirror2 {\n flex-grow: 1;\n ${isSingleLine\n ? css`\n min-height: ${input.height};\n & * {\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n }\n `\n : css`\n min-height: 3.75rem;\n `}\n overflow-y: auto;\n ${readOnly &&\n !jsonMode &&\n css`\n max-height: 5.625rem;\n `}\n }\n\n .CodeMirror-placeholder {\n opacity: ${base.transparency['transparent-3']};\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: ${base.spacing} 0;\n }\n\n ${editorConfigProps?.theme === 'eclipse' &&\n css`\n .cm-s-eclipse {\n .cm-string {\n color: ${base.palette.pending};\n &.cm-property {\n color: ${base.palette['foreground-color']};\n }\n }\n .cm-operator {\n color: ${base.palette.info};\n }\n .cm-variable,\n .cm-variable-2,\n .cm-variable-3 {\n color: ${base.palette['foreground-color']};\n }\n .cm-atom,\n .cm-keyword {\n color: ${base.palette.warn};\n }\n .cm-number {\n color: ${base.palette.success};\n }\n }\n `}\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n background-color: ${base.palette[\n 'primary-background'\n ]}; /* The little square between H and V scrollbars */\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n position: absolute;\n left: 0;\n top: 0;\n min-height: 100%;\n z-index: 3;\n border-right: 0.063rem solid ${base.palette['border-line']};\n background-color: ${base.palette['secondary-background']};\n white-space: nowrap;\n }\n .CodeMirror-linenumber {\n padding: 0 0.125rem 0 0.313rem;\n min-width: 1.25rem;\n text-align: right;\n color: ${transparentize(0.5, base.palette['foreground-color'])};\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: ${base.palette['foreground-color']};\n }\n .CodeMirror-guttermarker-subtle {\n color: ${transparentize(0.5, base.palette['foreground-color'])};\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-left: 0.0625rem solid ${base.palette.interactive};\n border-right: none;\n width: 0;\n ${readOnly &&\n css`\n display: none;\n `}\n }\n\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 0.063rem solid ${base.palette['secondary-background']};\n }\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #77ee77;\n }\n @-moz-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @-webkit-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -3.125rem;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 0.063rem solid ${base.palette['border-line']};\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-s-default .cm-header {\n color: blue;\n }\n .cm-negative {\n color: #dd4444;\n }\n .cm-positive {\n color: #229922;\n }\n .cm-strong {\n font-weight: bold;\n }\n .cm-s-default .cm-quote {\n color: #009900;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .cm-s-default .cm-keyword {\n color: #770088;\n }\n .cm-s-default .cm-atom {\n color: #221199;\n }\n .cm-s-default .cm-number {\n color: #116644;\n }\n .cm-s-default .cm-def {\n color: #0000ff;\n }\n .cm-s-default .cm-variable-2 {\n color: #0055aa;\n }\n .cm-s-default .cm-variable-3,\n .cm-s-default .cm-type {\n color: #008855;\n }\n .cm-s-default .cm-comment {\n color: #aa5500;\n }\n .cm-s-default .cm-string {\n color: #aa1111;\n }\n .cm-s-default .cm-string-2 {\n color: #ff5500;\n }\n .cm-s-default .cm-meta {\n color: #555555;\n }\n .cm-s-default .cm-qualifier {\n color: #555555;\n }\n .cm-s-default .cm-builtin {\n color: #3300aa;\n }\n .cm-s-default .cm-bracket {\n color: ${base.palette.skeleton};\n }\n .cm-s-default .cm-tag {\n color: ${base.palette.info};\n }\n .cm-s-default .cm-attribute {\n color: ${base.palette.interactive};\n }\n .cm-s-default .cm-hr {\n color: ${base.palette['border-line']};\n }\n .cm-s-default .cm-link {\n color: ${base.palette.interactive};\n }\n\n .cm-s-default .cm-error {\n color: ${base.palette.urgent};\n }\n .cm-invalidchar {\n color: ${base.palette.urgent};\n }\n\n .CodeMirror-composing {\n border-bottom: 0.125rem solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: ${base.palette.success} !important;\n outline: 0.0625rem dotted ${base.palette.success};\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: ${base.palette.urgent} !important;\n outline: 0.0625rem dotted ${base.palette.urgent};\n }\n .CodeMirror-matchingtag {\n background: ${transparentize(0.5, base.palette.warn)};\n }\n .CodeMirror-activeline-background {\n background: ${base.palette['secondary-background']};\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror-scroll {\n overflow: scroll !important;\n margin-bottom: -3.125rem;\n margin-right: -3.125rem;\n padding-bottom: 3.125rem;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 3.125rem solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n }\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n .CodeMirror-gutter-filler {\n left: 0;\n bottom: 0;\n }\n .CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -3.125rem;\n }\n .CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n }\n .CodeMirror-gutter-background {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 4;\n }\n .CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n }\n .CodeMirror-gutter-wrapper ::selection {\n background-color: transparent;\n }\n .CodeMirror-gutter-wrapper ::-moz-selection {\n background-color: transparent;\n }\n\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n padding: 0 ${base.spacing};\n }\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.006rem; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: ${transparentize(0.8, base.palette.interactive)};\n }\n .CodeMirror-focused .CodeMirror-selected {\n background: ${transparentize(0.8, base.palette.interactive)};\n }\n .CodeMirror-focused {\n border-color: ${base.palette.interactive} !important;\n }\n .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {\n visibility: hidden;\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n .CodeMirror-line::selection,\n .CodeMirror-line > span::selection,\n .CodeMirror-line > span > span::selection {\n background: ${transparentize(0.8, base.palette.interactive)};\n }\n .CodeMirror-line::-moz-selection,\n .CodeMirror-line > span::-moz-selection,\n .CodeMirror-line > span > span::-moz-selection {\n background: ${transparentize(0.8, base.palette.interactive)};\n }\n\n .cm-searching {\n background-color: ${transparentize(0.5, base.palette['foreground-color'])};\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.006rem;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack::after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n .CodeMirror {\n ${isSingleLine &&\n css`\n white-space: nowrap;\n height: auto;\n padding-inline-end: ${base.spacing};\n `}\n overflow: hidden;\n font-family: monospace;\n direction: ltr;\n position: relative;\n background-color: ${formControlBgColor};\n color: ${base.palette['foreground-color']};\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: calc(0.5 * ${base['border-radius']});\n ${errors &&\n css`\n border-color: ${errorBackground};\n `}\n ${readOnly &&\n css`\n background-color: ${readOnlyBackgroundColor};\n `}\n }\n\n .cm-ex-context {\n color: ${base.palette.interactive};\n }\n .cm-ex-additional-operators {\n color: ${base.palette.interactive};\n }\n .cm-ex-operator {\n color: ${base.palette.warn};\n font-weight: bold;\n }\n .cm-ex-comment {\n color: ${transparentize(0.2, base.palette.info)};\n }\n .cm-ex-ruleName {\n color: ${base.palette.success};\n }\n .cm-ex-delimeter {\n color: ${base.palette['foreground-color']};\n }\n .cm-ex-constant {\n color: ${base.palette.pending};\n }\n .cm-ex-underline-error {\n text-decoration: underline;\n text-decoration-style: wavy;\n text-decoration-color: ${base.palette.urgent};\n }\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestions = createGlobalStyle<{\n isLoading?: boolean;\n suggestions: SuggestionType[];\n}>(({ theme: { base }, isLoading, suggestions }) => {\n const activeColor = mix(0.85, base.palette[primaryBackground], base.palette.interactive);\n\n const hoverColor = mix(0.95, base.palette[primaryBackground], base.palette.interactive);\n\n const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);\n return css`\n .CodeMirror-hints {\n position: absolute;\n z-index: calc(${base['z-index'].backdrop} + 1);\n transition: height ${base.animation.speed} ${base.animation.timing.ease};\n border-radius: calc(0.5 * ${base['border-radius']});\n box-shadow: ${base.shadow.low};\n border: 0.0625rem solid ${base.palette['border-line']};\n background-color: ${base.palette[primaryBackground]};\n font-size: ${fontSizes.s};\n max-height: 12rem;\n overflow-y: auto;\n min-width: ${base[contentWidth].xs};\n }\n\n .CodeMirror-hint {\n width: calc(1.5 * ${base[contentWidth].xs});\n cursor: pointer;\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n padding-inline: ${base.spacing};\n }\n\n body .CodeMirror-lint-tooltip {\n z-index: ${base['z-index'].tooltip};\n }\n\n ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n});\n\nStyledSuggestions.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
2
|
import type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';
|
|
3
|
-
import type { MenuItemProps, TestIdProp } from '@pega/cosmos-react-core';
|
|
3
|
+
import type { DefaultSettableTheme, MenuItemProps, TestIdProp } from '@pega/cosmos-react-core';
|
|
4
4
|
export type AutoCompleteTriggerChar = '@' | '.' | ':' | '#' | '(' | ')' | '[' | ']';
|
|
5
5
|
export type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;
|
|
6
6
|
export interface CustomPositionProps {
|
|
@@ -58,5 +58,6 @@ export interface EditorHintOptions extends ShowHintOptions {
|
|
|
58
58
|
suggestions?: SuggestionType[];
|
|
59
59
|
loading?: boolean;
|
|
60
60
|
triggerCharacterCursorPos?: Position;
|
|
61
|
+
theme?: DefaultSettableTheme;
|
|
61
62
|
}
|
|
62
63
|
//# sourceMappingURL=CodeEditor.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.types.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjF,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeEditor.types.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE/F,MAAM,MAAM,uBAAuB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEpF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC;AAEjF,MAAM,WAAW,mBAAmB;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AM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/E,+BAA+B;IAC/B,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,GAAG,EAAE,UAAU,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC5E,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,QAAQ,CAAC;IACrC,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.types.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\nimport type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';\n\nimport type { MenuItemProps, TestIdProp } from '@pega/cosmos-react-core';\n\nexport type AutoCompleteTriggerChar = '@' | '.' | ':' | '#' | '(' | ')' | '[' | ']';\n\nexport type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;\n\nexport interface CustomPositionProps {\n start?: Position;\n end?: Position;\n}\n\nexport interface EditorState {\n getValue: () => string | undefined;\n insertText: (text: string, resetContent?: boolean, customPositions?: CustomPositionProps) => void;\n}\n\nexport type CursorPosition = Pick<Position, 'ch' | 'line'>;\n\nexport interface ErrorRange {\n line: number;\n ch: number;\n}\n\nexport interface LintError {\n from: Position;\n to: Position;\n message: string;\n}\n\nexport interface CodeEditorProps extends TestIdProp {\n /** Default expression to set in the code editor */\n defaultValue?: string;\n /** Compiled error message */\n errors?: string;\n /** Enable read only mode */\n readOnly?: boolean;\n /** Fetches suggestion list for suggestions popover */\n fetchSuggestions?: (\n autoCompleteTrigger: AutoCompleteTriggerChar,\n cursorPosition: CursorPosition\n ) => Promise<SuggestionType[] | undefined>;\n /** characters which triggers suggestions */\n autoCompleteTriggers?: AutoCompleteTriggerChar[];\n /** Code editor configuration props */\n editorConfigProps?: EditorConfiguration;\n /** To show loader for intellisense popover */\n loading?: boolean;\n /** Called when editor loses the focus */\n onBlur?: (expression: string) => void;\n /** Called when editor content changes. */\n onChange?: (expression: string, errors?: LintError[], source?: string) => void;\n /** underlined error message */\n inLineErrors?: { start: ErrorRange; end: ErrorRange; messages: string[] }[];\n /** For single line code editor rendering */\n isSingleLine?: boolean;\n codeEditorHandle: Ref<EditorState>;\n ref?: Ref<HTMLDivElement>;\n showEditorOnly?: boolean;\n /** Information to announce to screen reader users on focusing CodeEditor. */\n 'aria-describedby'?: string;\n}\n\nexport interface EditorHintOptions extends ShowHintOptions {\n suggestions?: SuggestionType[];\n loading?: boolean;\n triggerCharacterCursorPos?: Position;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CodeEditor.types.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\nimport type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';\n\nimport type { DefaultSettableTheme, MenuItemProps, TestIdProp } from '@pega/cosmos-react-core';\n\nexport type AutoCompleteTriggerChar = '@' | '.' | ':' | '#' | '(' | ')' | '[' | ']';\n\nexport type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;\n\nexport interface CustomPositionProps {\n start?: Position;\n end?: Position;\n}\n\nexport interface EditorState {\n getValue: () => string | undefined;\n insertText: (text: string, resetContent?: boolean, customPositions?: CustomPositionProps) => void;\n}\n\nexport type CursorPosition = Pick<Position, 'ch' | 'line'>;\n\nexport interface ErrorRange {\n line: number;\n ch: number;\n}\n\nexport interface LintError {\n from: Position;\n to: Position;\n message: string;\n}\n\nexport interface CodeEditorProps extends TestIdProp {\n /** Default expression to set in the code editor */\n defaultValue?: string;\n /** Compiled error message */\n errors?: string;\n /** Enable read only mode */\n readOnly?: boolean;\n /** Fetches suggestion list for suggestions popover */\n fetchSuggestions?: (\n autoCompleteTrigger: AutoCompleteTriggerChar,\n cursorPosition: CursorPosition\n ) => Promise<SuggestionType[] | undefined>;\n /** characters which triggers suggestions */\n autoCompleteTriggers?: AutoCompleteTriggerChar[];\n /** Code editor configuration props */\n editorConfigProps?: EditorConfiguration;\n /** To show loader for intellisense popover */\n loading?: boolean;\n /** Called when editor loses the focus */\n onBlur?: (expression: string) => void;\n /** Called when editor content changes. */\n onChange?: (expression: string, errors?: LintError[], source?: string) => void;\n /** underlined error message */\n inLineErrors?: { start: ErrorRange; end: ErrorRange; messages: string[] }[];\n /** For single line code editor rendering */\n isSingleLine?: boolean;\n codeEditorHandle: Ref<EditorState>;\n ref?: Ref<HTMLDivElement>;\n showEditorOnly?: boolean;\n /** Information to announce to screen reader users on focusing CodeEditor. */\n 'aria-describedby'?: string;\n}\n\nexport interface EditorHintOptions extends ShowHintOptions {\n suggestions?: SuggestionType[];\n loading?: boolean;\n triggerCharacterCursorPos?: Position;\n theme?: DefaultSettableTheme;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Editor } from 'codemirror';
|
|
2
2
|
import type { EditorHintOptions } from './CodeEditor.types';
|
|
3
|
-
declare const getCodeSuggestions: (codeMirror: Editor, { suggestions, loading, triggerCharacterCursorPos }: EditorHintOptions) => {
|
|
3
|
+
declare const getCodeSuggestions: (codeMirror: Editor, { suggestions, loading, triggerCharacterCursorPos, theme }: EditorHintOptions) => {
|
|
4
4
|
list: {
|
|
5
5
|
text: string;
|
|
6
6
|
displayText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCodeSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,QAAA,MAAM,kBAAkB,GACtB,YAAY,MAAM,EAClB,
|
|
1
|
+
{"version":3,"file":"getCodeSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,QAAA,MAAM,kBAAkB,GACtB,YAAY,MAAM,EAClB,4DAQG,iBAAiB;;cASZ,MAAM;qBACC,MAAM;gBACX,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI;;;;CA2D3C,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -2,13 +2,13 @@ import { createElement as _createElement } from "react";
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
4
|
import { Pos } from 'codemirror';
|
|
5
|
-
import { Progress, Flex, EmptyState } from '@pega/cosmos-react-core';
|
|
5
|
+
import { Progress, Flex, EmptyState, ThemeOverride } from '@pega/cosmos-react-core';
|
|
6
6
|
import MenuItem from '@pega/cosmos-react-core/lib/components/Menu/MenuItem';
|
|
7
7
|
import { StyledLoading } from './CodeEditor.styles';
|
|
8
8
|
const getCodeSuggestions = (codeMirror, { suggestions = [], loading = false, triggerCharacterCursorPos = {
|
|
9
9
|
ch: 0,
|
|
10
10
|
line: 0
|
|
11
|
-
} }) => {
|
|
11
|
+
}, theme = {} }) => {
|
|
12
12
|
const currentPosition = codeMirror.getCursor();
|
|
13
13
|
const filterQuery = codeMirror
|
|
14
14
|
.getValue()
|
|
@@ -21,10 +21,10 @@ const getCodeSuggestions = (codeMirror, { suggestions = [], loading = false, tri
|
|
|
21
21
|
displayText: '',
|
|
22
22
|
render: (element) => {
|
|
23
23
|
element.style.pointerEvents = 'none';
|
|
24
|
-
ReactDOM.render(_jsx(Flex, { container: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
ReactDOM.render(_jsx(ThemeOverride, { theme: theme, children: _jsx(Flex, { container: {
|
|
25
|
+
justify: 'center',
|
|
26
|
+
pad: 1
|
|
27
|
+
}, children: loading ? (_jsx(Progress, { variant: 'ring', placement: 'inline', visible: loading, as: StyledLoading })) : (_jsx(EmptyState, {})) }) }), element);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
];
|
|
@@ -36,7 +36,7 @@ const getCodeSuggestions = (codeMirror, { suggestions = [], loading = false, tri
|
|
|
36
36
|
text: hint.id,
|
|
37
37
|
displayText: hint.primary,
|
|
38
38
|
render: (element) => {
|
|
39
|
-
ReactDOM.render(_createElement(MenuItem, { ...hint, key: hint.id, role: 'menuitem' }), element);
|
|
39
|
+
ReactDOM.render(_jsx(ThemeOverride, { theme: theme, children: _createElement(MenuItem, { ...hint, key: hint.id, role: 'menuitem' }) }), element);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCodeSuggestions.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":";;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"getCodeSuggestions.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":";;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,QAAQ,MAAM,sDAAsD,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,kBAAkB,GAAG,CACzB,UAAkB,EAClB,EACE,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,KAAK,EACf,yBAAyB,GAAG;IAC1B,EAAE,EAAE,CAAC;IACL,IAAI,EAAE,CAAC;CACR,EACD,KAAK,GAAG,EAAE,EACQ,EACpB,EAAE;IACF,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IAC/C,MAAM,WAAW,GAAG,UAAU;SAC3B,QAAQ,EAAE;SACV,KAAK,CAAC,IAAI,CAAC,CACX,yBAAyB,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,yBAAyB,CAAC,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;IAEhG,IAAI,YAAY,GAIV,EAAE,CAAC;IAET,IAAI,OAAO,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,YAAY,GAAG;YACb;gBACE,IAAI,EAAE,EAAE;gBACR,WAAW,EAAE,EAAE;gBACf,MAAM,EAAE,CAAC,OAAsB,EAAE,EAAE;oBACjC,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;oBACrC,QAAQ,CAAC,MAAM,CACb,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YACzB,KAAC,IAAI,IAC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codemirror';\nimport type { Editor } from 'codemirror';\n\nimport { Progress, Flex, EmptyState, ThemeOverride } from '@pega/cosmos-react-core';\nimport MenuItem from '@pega/cosmos-react-core/lib/components/Menu/MenuItem';\n\nimport type { EditorHintOptions } from './CodeEditor.types';\nimport { StyledLoading } from './CodeEditor.styles';\n\nconst getCodeSuggestions = (\n codeMirror: Editor,\n {\n suggestions = [],\n loading = false,\n triggerCharacterCursorPos = {\n ch: 0,\n line: 0\n },\n theme = {}\n }: EditorHintOptions\n) => {\n const currentPosition = codeMirror.getCursor();\n const filterQuery = codeMirror\n .getValue()\n .split('\\n')\n [triggerCharacterCursorPos.line]?.substring(triggerCharacterCursorPos.ch, currentPosition.ch);\n\n let filteredList: {\n text: string;\n displayText: string;\n render: (element: HTMLLIElement) => void;\n }[] = [];\n\n if (loading || suggestions.length === 0) {\n filteredList = [\n {\n text: '',\n displayText: '',\n render: (element: HTMLLIElement) => {\n element.style.pointerEvents = 'none';\n ReactDOM.render(\n <ThemeOverride theme={theme}>\n <Flex\n container={{\n justify: 'center',\n pad: 1\n }}\n >\n {loading ? (\n <Progress\n variant='ring'\n placement='inline'\n visible={loading}\n as={StyledLoading}\n />\n ) : (\n <EmptyState />\n )}\n </Flex>\n </ThemeOverride>,\n element\n );\n }\n }\n ];\n } else {\n filteredList = suggestions\n .map(hint => {\n return {\n text: hint.id,\n displayText: hint.primary,\n render: (element: HTMLLIElement) => {\n ReactDOM.render(\n <ThemeOverride theme={theme}>\n <MenuItem {...hint} key={hint.id} role='menuitem' />\n </ThemeOverride>,\n element\n );\n }\n };\n })\n .filter(item => item.displayText.toLowerCase().startsWith(filterQuery.toLowerCase()));\n }\n\n return {\n list: filteredList,\n from: Pos(currentPosition.line, triggerCharacterCursorPos.ch - 1),\n to: Pos(currentPosition.line, currentPosition.ch)\n };\n};\n\nexport default getCodeSuggestions;\n"]}
|
|
@@ -365,9 +365,12 @@ export declare const getStageInfo: (currentType: StageType, transitionType: Stag
|
|
|
365
365
|
readonly "foreground-color": string;
|
|
366
366
|
readonly "background-color": string;
|
|
367
367
|
readonly "border-color": string;
|
|
368
|
+
readonly "create-button-background": string;
|
|
369
|
+
readonly "nested-list-background": string;
|
|
368
370
|
readonly detached: boolean;
|
|
369
371
|
};
|
|
370
372
|
readonly header: {
|
|
373
|
+
readonly "app-name-color": string;
|
|
371
374
|
readonly background: string;
|
|
372
375
|
readonly "foreground-color": string;
|
|
373
376
|
readonly "background-color": string;
|
|
@@ -417,6 +420,19 @@ export declare const getStageInfo: (currentType: StageType, transitionType: Stag
|
|
|
417
420
|
readonly avatar: {
|
|
418
421
|
readonly "background-color": string;
|
|
419
422
|
};
|
|
423
|
+
readonly agent: {
|
|
424
|
+
readonly background: string;
|
|
425
|
+
readonly "foreground-color": string;
|
|
426
|
+
readonly "user-message": {
|
|
427
|
+
readonly background: string;
|
|
428
|
+
readonly "foreground-color": string;
|
|
429
|
+
};
|
|
430
|
+
readonly "coach-message": {
|
|
431
|
+
readonly avatar: {
|
|
432
|
+
readonly background: string;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
420
436
|
readonly badges: {
|
|
421
437
|
readonly "font-stretch": string;
|
|
422
438
|
readonly status: {
|
|
@@ -512,14 +528,6 @@ export declare const getStageInfo: (currentType: StageType, transitionType: Stag
|
|
|
512
528
|
readonly padding: string;
|
|
513
529
|
readonly "border-color": string;
|
|
514
530
|
};
|
|
515
|
-
readonly "accent-card": {
|
|
516
|
-
readonly "primary-background": string;
|
|
517
|
-
readonly "secondary-background": string;
|
|
518
|
-
readonly "foreground-color": string;
|
|
519
|
-
readonly avatar: {
|
|
520
|
-
readonly background: string;
|
|
521
|
-
};
|
|
522
|
-
};
|
|
523
531
|
readonly checkbox: {
|
|
524
532
|
readonly "border-radius": string;
|
|
525
533
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifeCycle.types.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],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AAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAID,eAAO,MAAM,YAAY,GACvB,aAAa,SAAS,EACtB,gBAAgB,cAAc,CAAC,gBAAgB,CAAC,EAChD,eAAe,cAAc,EAC7B,oBAAkB,EAClB
|
|
1
|
+
{"version":3,"file":"LifeCycle.types.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,cAAc,EACd,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAE1D,UAAU,eAAe;IACvB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,CAAC,EAAE,M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;;;;;;;;;;;;CAAa,cAsFd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-build",
|
|
3
|
-
"version": "9.0.0-build.
|
|
3
|
+
"version": "9.0.0-build.11.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-core": "9.0.0-build.
|
|
18
|
-
"@pega/cosmos-react-dnd": "9.0.0-build.
|
|
19
|
-
"@pega/cosmos-react-rte": "9.0.0-build.
|
|
17
|
+
"@pega/cosmos-react-core": "9.0.0-build.11.1",
|
|
18
|
+
"@pega/cosmos-react-dnd": "9.0.0-build.11.1",
|
|
19
|
+
"@pega/cosmos-react-rte": "9.0.0-build.11.1",
|
|
20
20
|
"@types/codemirror": "^5.60.15",
|
|
21
21
|
"@types/dagre": "^0.7.46",
|
|
22
22
|
"@types/react": "^17.0.62 || ^18.3.3",
|