@vectara/vectara-ui 13.12.0 → 13.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  @import "checkbox/index";
2
+ @import "codeEditor/index";
2
3
  @import "input/index";
3
4
  @import "itemsInput/index";
4
5
  @import "label/index";
@@ -0,0 +1,34 @@
1
+ import { generateTokensProvider } from "./generateTokensProvider";
2
+ export type ColorConfig = {
3
+ token: string;
4
+ foreground: `#${string}`;
5
+ };
6
+ export type CodeEditorError = {
7
+ startLine: number;
8
+ endLine: number;
9
+ startColumn: number;
10
+ endColumn: number;
11
+ message: string;
12
+ };
13
+ interface Props {
14
+ language: string;
15
+ TokensProvider?: ReturnType<typeof generateTokensProvider>;
16
+ onChange?: (value?: string) => void;
17
+ onError?: (errors: Array<CodeEditorError>) => void;
18
+ colorConfig?: Array<ColorConfig>;
19
+ value?: string;
20
+ defaultValue?: string;
21
+ error?: CodeEditorError;
22
+ /** Placeholder text that supports code formatting, indentation, and line breaks */
23
+ placeholder?: string;
24
+ isReadOnly?: boolean;
25
+ height?: string;
26
+ resizable?: boolean;
27
+ "data-testid"?: string;
28
+ }
29
+ /**
30
+ * Generic (to console) code editor that wraps React Monaco Editor.
31
+ * As the need arises, this component can accept props to customize the internal Monaco editor options.
32
+ */
33
+ export declare const VuiCodeEditor: ({ language, TokensProvider, onChange, placeholder, onError, colorConfig, value, defaultValue, error, isReadOnly, height, resizable, "data-testid": testId }: Props) => import("react/jsx-runtime").JSX.Element;
34
+ export {};
@@ -0,0 +1,98 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Editor from "@monaco-editor/react";
3
+ import * as monacoTypes from "monaco-editor/esm/vs/editor/editor.api";
4
+ import { useRef } from "react";
5
+ /**
6
+ * Generic (to console) code editor that wraps React Monaco Editor.
7
+ * As the need arises, this component can accept props to customize the internal Monaco editor options.
8
+ */
9
+ export const VuiCodeEditor = ({ language, TokensProvider, onChange, placeholder, onError = (errors) => {
10
+ /*noop*/
11
+ }, colorConfig, value, defaultValue, error, isReadOnly, height = "300px", resizable = false, "data-testid": testId }) => {
12
+ const tokensProvider = TokensProvider ? new TokensProvider() : null;
13
+ const monacoRef = useRef(null);
14
+ const modelRef = useRef(null);
15
+ if (modelRef.current && monacoRef.current) {
16
+ if (error) {
17
+ const markers = [
18
+ {
19
+ severity: monacoRef.current.MarkerSeverity.Error,
20
+ startLineNumber: error.startLine,
21
+ startColumn: error.startColumn,
22
+ endLineNumber: error.endLine,
23
+ endColumn: error.endColumn,
24
+ message: error.message
25
+ }
26
+ ];
27
+ monacoRef.current.editor.setModelMarkers(modelRef.current, language, markers);
28
+ }
29
+ else {
30
+ monacoRef.current.editor.setModelMarkers(modelRef.current, language, []);
31
+ }
32
+ }
33
+ const init = (monaco) => {
34
+ monacoRef.current = monaco;
35
+ monaco.languages.register({ id: language });
36
+ if (tokensProvider) {
37
+ monaco.languages.setTokensProvider(language, tokensProvider);
38
+ }
39
+ monaco.editor.defineTheme("vectaraEditor", {
40
+ base: "vs",
41
+ inherit: true,
42
+ rules: colorConfig !== null && colorConfig !== void 0 ? colorConfig : [],
43
+ colors: {}
44
+ });
45
+ monaco.languages.setLanguageConfiguration(language, {
46
+ autoClosingPairs: [
47
+ { open: "(", close: ")" },
48
+ { open: "[", close: "]" },
49
+ { open: "{", close: "}" },
50
+ { open: "'", close: "'", notIn: ["string"] }
51
+ ],
52
+ colorizedBracketPairs: [
53
+ ["(", ")"],
54
+ ["[", "]"],
55
+ ["(", ")"]
56
+ ]
57
+ });
58
+ monaco.editor.onDidCreateModel((model) => (modelRef.current = model));
59
+ };
60
+ const shouldShowPlaceholder = placeholder && (!value || value.trim() === "") && (!defaultValue || defaultValue.trim() === "");
61
+ return (_jsxs("div", Object.assign({ className: "vuiCodeEditor", "data-testid": testId, style: resizable ? { minHeight: height, height, resize: "vertical", overflow: "auto" } : undefined }, { children: [shouldShowPlaceholder && (_jsx("div", Object.assign({ className: "vuiCodeEditor-placeholder", "aria-hidden": "true" }, { children: placeholder }))), _jsx(Editor, { beforeMount: init, height: resizable ? "100%" : height, width: "100%", defaultLanguage: language, defaultValue: defaultValue, value: value, onChange: onChange, onValidate: (markers) => {
62
+ const errors = markers.reduce((acc, marker) => {
63
+ if (marker.severity === monacoTypes.MarkerSeverity.Error) {
64
+ acc.push({
65
+ startLine: marker.startLineNumber,
66
+ endLine: marker.endLineNumber,
67
+ startColumn: marker.startColumn,
68
+ endColumn: marker.endColumn,
69
+ message: marker.message
70
+ });
71
+ }
72
+ return acc;
73
+ }, []);
74
+ if (errors.length) {
75
+ onError(errors);
76
+ }
77
+ }, theme: "vectaraEditor", options: {
78
+ readOnly: isReadOnly,
79
+ fontSize: 12,
80
+ automaticLayout: true,
81
+ renderLineHighlight: "none",
82
+ lineNumbers: "off",
83
+ glyphMargin: false,
84
+ folding: false,
85
+ lineDecorationsWidth: 2,
86
+ fixedOverflowWidgets: true,
87
+ quickSuggestions: {
88
+ comments: false,
89
+ strings: false,
90
+ other: false
91
+ },
92
+ suggestOnTriggerCharacters: true,
93
+ minimap: {
94
+ enabled: false
95
+ },
96
+ wordWrap: "on"
97
+ } })] })));
98
+ };
@@ -0,0 +1,20 @@
1
+ .vuiCodeEditor {
2
+ position: relative;
3
+ border: 1px solid var(--vui-color-border-medium);
4
+ border-radius: $sizeXxs;
5
+ padding: $sizeS;
6
+ padding-right: 0;
7
+ }
8
+
9
+ .vuiCodeEditor-placeholder {
10
+ position: absolute;
11
+ top: $sizeS;
12
+ left: $sizeS;
13
+ color: #999999;
14
+ font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
15
+ font-size: 12px;
16
+ line-height: 18px;
17
+ pointer-events: none;
18
+ z-index: 1;
19
+ white-space: pre-wrap;
20
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This exposes a utility that wraps an ANTLR-generated lexer in a TokensProvider class and returns that class.
3
+ * The underlying logic is mostly lifted from https://tomassetti.me/writing-a-browser-based-editor-using-monaco-and-antlr.
4
+ */
5
+ import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
6
+ import ILineTokens = monaco.languages.ILineTokens;
7
+ import { Token } from "antlr4ng";
8
+ type SyntaxChecker = {
9
+ Parser: any;
10
+ onError: (offendingSymbol: Token | null, line: number, column: number, msg: string) => void;
11
+ };
12
+ /**
13
+ * Generates a TokensProvider for use with the CodeEditor component.
14
+ * Provide the optional syntaxChecker config to enable client-side syntax checking.
15
+ */
16
+ export declare const generateTokensProvider: (Lexer: any, syntaxChecker?: SyntaxChecker) => {
17
+ new (): {
18
+ getInitialState(): monaco.languages.IState;
19
+ tokenize(line: string): monaco.languages.ILineTokens;
20
+ tokensForLine(input: string): monaco.languages.ILineTokens;
21
+ };
22
+ };
23
+ export {};
@@ -0,0 +1,96 @@
1
+ /**
2
+ * This exposes a utility that wraps an ANTLR-generated lexer in a TokensProvider class and returns that class.
3
+ * The underlying logic is mostly lifted from https://tomassetti.me/writing-a-browser-based-editor-using-monaco-and-antlr.
4
+ */
5
+ import { BaseErrorListener, CharStream, CommonTokenStream } from "antlr4ng";
6
+ const EOF = -1;
7
+ /**
8
+ * Generates a TokensProvider for use with the CodeEditor component.
9
+ * Provide the optional syntaxChecker config to enable client-side syntax checking.
10
+ */
11
+ export const generateTokensProvider = (Lexer, syntaxChecker) => {
12
+ return class TokensProvider {
13
+ getInitialState() {
14
+ return new MonacoState();
15
+ }
16
+ tokenize(line) {
17
+ if (line.length === 0)
18
+ return new MonacoLineTokens([]);
19
+ return this.tokensForLine(line);
20
+ }
21
+ tokensForLine(input) {
22
+ const lexerInputStream = CharStream.fromString(input);
23
+ const lexer = new Lexer(lexerInputStream);
24
+ const myTokens = [];
25
+ let done = false;
26
+ // If doing client-side syntax checking, create a second input stream for the parser.
27
+ // This is because using a single stream for both results in
28
+ // the lexer consuming the stream, leaving nothing for the parser to consume.
29
+ // TODO: Check if there's a way to use just one. In the interest of time, this will do.
30
+ if (syntaxChecker) {
31
+ const parserInputStream = CharStream.fromString(input);
32
+ const tokenStream = new CommonTokenStream(new Lexer(parserInputStream));
33
+ const parser = new syntaxChecker.Parser(tokenStream);
34
+ class ConsoleErrorListener extends BaseErrorListener {
35
+ syntaxError(recognizer, offendingSymbol, line, column, msg) {
36
+ syntaxChecker === null || syntaxChecker === void 0 ? void 0 : syntaxChecker.onError(offendingSymbol, line, column, msg);
37
+ }
38
+ }
39
+ parser.addErrorListener(new ConsoleErrorListener());
40
+ parser.parse();
41
+ }
42
+ do {
43
+ const token = lexer.nextToken();
44
+ if (token == null) {
45
+ done = true;
46
+ }
47
+ else {
48
+ // We exclude EOF
49
+ if (token.type == EOF) {
50
+ done = true;
51
+ }
52
+ else if (lexer.literalNames[token.type]) {
53
+ // Allow tokenizing of literal names.
54
+ // Facilitates colorizing of tokens like "+".
55
+ const tokenTypeName = lexer.literalNames[token.type];
56
+ if (tokenTypeName) {
57
+ const myToken = new MonacoToken("LITERAL", token.column);
58
+ myTokens.push(myToken);
59
+ }
60
+ }
61
+ else {
62
+ const tokenTypeName = lexer.symbolicNames[token.type];
63
+ if (tokenTypeName) {
64
+ const myToken = new MonacoToken(tokenTypeName, token.column);
65
+ myTokens.push(myToken);
66
+ }
67
+ }
68
+ }
69
+ } while (!done);
70
+ myTokens.sort((a, b) => (a.startIndex > b.startIndex ? 1 : -1));
71
+ return new MonacoLineTokens(myTokens);
72
+ }
73
+ };
74
+ };
75
+ class MonacoState {
76
+ clone() {
77
+ return new MonacoState();
78
+ }
79
+ // This is hard-coded to true because this implementation exists solely to
80
+ // satisfy the monaco.languages.IState interface.
81
+ equals() {
82
+ return true;
83
+ }
84
+ }
85
+ class MonacoToken {
86
+ constructor(ruleName, startIndex) {
87
+ this.scopes = ruleName;
88
+ this.startIndex = startIndex;
89
+ }
90
+ }
91
+ class MonacoLineTokens {
92
+ constructor(tokens) {
93
+ this.endState = new MonacoState();
94
+ this.tokens = tokens;
95
+ }
96
+ }
@@ -1,4 +1,6 @@
1
1
  export { VuiCheckbox } from "./checkbox/Checkbox";
2
+ export { VuiCodeEditor } from "./codeEditor/CodeEditor";
3
+ export { generateTokensProvider } from "./codeEditor/generateTokensProvider";
2
4
  export { VuiItemsInput } from "./itemsInput/ItemsInput";
3
5
  export { VuiLabel } from "./label/Label";
4
6
  export { VuiNumberInput } from "./input/NumberInput";
@@ -1,4 +1,6 @@
1
1
  export { VuiCheckbox } from "./checkbox/Checkbox";
2
+ export { VuiCodeEditor } from "./codeEditor/CodeEditor";
3
+ export { generateTokensProvider } from "./codeEditor/generateTokensProvider";
2
4
  export { VuiItemsInput } from "./itemsInput/ItemsInput";
3
5
  export { VuiLabel } from "./label/Label";
4
6
  export { VuiNumberInput } from "./input/NumberInput";
@@ -28,7 +28,7 @@ import { VuiDrawer } from "./drawer/Drawer";
28
28
  import { VuiErrorBoundary } from "./errorBoundary/ErrorBoundary";
29
29
  import { VuiFlexContainer } from "./flex/FlexContainer";
30
30
  import { VuiFlexItem } from "./flex/FlexItem";
31
- import { RadioButtonConfig, VuiCheckbox, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
31
+ import { RadioButtonConfig, generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
32
32
  import { VuiFormGroup } from "./formGroup/FormGroup";
33
33
  import { VuiGrid } from "./grid/Grid";
34
34
  import { VuiGridItem } from "./grid/GridItem";
@@ -94,4 +94,4 @@ import { VuiTopicButton } from "./topicButton/TopicButton";
94
94
  import { copyToClipboard } from "../utils/copyToClipboard";
95
95
  import { toRgb, toRgba } from "./context/Theme";
96
96
  export type { AnchorSide, AppContentPadding, ButtonColor, CalloutColor, ChatLanguage, ChatStyle, ChatTurn, CodeLanguage, InfoListItemType, InfoListType, InfoTableColumnAlign, InfoTableRow, InfoTableRowType, LinkProps, MenuItem, OptionListItem, Pagination, RadioButtonConfig, SearchResult, SearchSuggestion, Sections, SectionItem, Stat, StepStatus, StepSize, TabSize, Tree, TreeItem, VuiStepProps };
97
- export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiSimpleGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
97
+ export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiCodeEditor, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiSimpleGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
@@ -24,7 +24,7 @@ import { VuiDrawer } from "./drawer/Drawer";
24
24
  import { VuiErrorBoundary } from "./errorBoundary/ErrorBoundary";
25
25
  import { VuiFlexContainer } from "./flex/FlexContainer";
26
26
  import { VuiFlexItem } from "./flex/FlexItem";
27
- import { VuiCheckbox, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
27
+ import { generateTokensProvider, VuiCheckbox, VuiCodeEditor, VuiItemsInput, VuiLabel, VuiNumberInput, VuiRadioButton, VuiSelect, VuiSuperRadioGroup, VuiTextInput, VuiTextArea, VuiPasswordInput } from "./form";
28
28
  import { VuiFormGroup } from "./formGroup/FormGroup";
29
29
  import { VuiGrid } from "./grid/Grid";
30
30
  import { VuiGridItem } from "./grid/GridItem";
@@ -86,4 +86,4 @@ import { VuiTooltip } from "./tooltip/Tooltip";
86
86
  import { VuiTopicButton } from "./topicButton/TopicButton";
87
87
  import { copyToClipboard } from "../utils/copyToClipboard";
88
88
  import { toRgb, toRgba } from "./context/Theme";
89
- export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiSimpleGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
89
+ export { BADGE_COLOR, BUTTON_COLOR, BUTTON_SIZE, CALLOUT_COLOR, CALLOUT_SIZE, ICON_COLOR, ICON_SIZE, ICON_TYPE, PROGRESS_BAR_COLOR, SPACER_SIZE, SPINNER_COLOR, SKELETON_COLOR, SPINNER_SIZE, TAB_SIZE, TEXT_COLOR, TEXT_SIZE, TITLE_SIZE, addNotification, copyToClipboard, generateTokensProvider, toRgb, toRgba, VuiAccordion, VuiAccountButton, VuiAppContent, VuiAppHeader, VuiAppLayout, VuiAppSideNav, VuiAppSideNavLink, VuiBadge, VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiIconButton, VuiCallout, VuiCard, VuiChat, VuiCheckbox, VuiCode, VuiCodeEditor, VuiContextProvider, VuiCopyButton, VuiDatePicker, VuiDateRangePicker, VuiDrawer, VuiErrorBoundary, VuiFlexContainer, VuiFlexItem, VuiFormGroup, VuiGrid, VuiGridItem, VuiSimpleGrid, VuiHorizontalRule, VuiIcon, VuiImage, VuiImagePreview, VuiInfoList, VuiInfoListItem, VuiInfoMenu, VuiInfoTable, VuiInProgress, VuiItemsInput, VuiLabel, VuiLink, VuiLinkInternal, VuiList, VuiMenu, VuiMenuItem, VuiModal, VuiNotifications, VuiNumberInput, VuiOptionsButton, VuiOptionsList, VuiOptionsListItem, VuiPagination, VuiPanel, VuiPasswordInput, VuiPopover, VuiPortal, VuiProgressBar, VuiPrompt, VuiRadioButton, VuiScreenBlock, VuiSearchInput, VuiSearchResult, VuiSearchSelect, VuiSelect, VuiSetting, VuiSpacer, VuiSpinner, VuiStat, VuiStatList, VuiStatus, VuiSteps, VuiSummary, VuiSkeleton, VuiSummaryCitation, VuiSuperRadioGroup, VuiTable, VuiTab, VuiTabbedRoutes, VuiTabs, VuiText, VuiTextArea, VuiTextColor, VuiTextInput, VuiTimeline, VuiTimelineItem, VuiTitle, VuiToggle, VuiTooltip, VuiTopicButton };
@@ -2636,6 +2636,27 @@ h2.react-datepicker__current-month {
2636
2636
  font-size: 14px;
2637
2637
  }
2638
2638
 
2639
+ .vuiCodeEditor {
2640
+ position: relative;
2641
+ border: 1px solid var(--vui-color-border-medium);
2642
+ border-radius: 4px;
2643
+ padding: 12px;
2644
+ padding-right: 0;
2645
+ }
2646
+
2647
+ .vuiCodeEditor-placeholder {
2648
+ position: absolute;
2649
+ top: 12px;
2650
+ left: 12px;
2651
+ color: #999999;
2652
+ font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
2653
+ font-size: 12px;
2654
+ line-height: 18px;
2655
+ pointer-events: none;
2656
+ z-index: 1;
2657
+ white-space: pre-wrap;
2658
+ }
2659
+
2639
2660
  .vuiInput {
2640
2661
  appearance: none;
2641
2662
  border-radius: 4px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "13.12.0",
3
+ "version": "13.13.0",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",
@@ -39,6 +39,7 @@
39
39
  "@types/node": "^16.18.34",
40
40
  "@types/react": "^18.2.0",
41
41
  "@types/react-dom": "^18.2.0",
42
+ "antlr4ng": "^3.0.4",
42
43
  "autoprefixer": "^10.4.7",
43
44
  "classnames": "^2.3.2",
44
45
  "colortranslator": "^5.0.0",
@@ -58,6 +59,7 @@
58
59
  "web-vitals": "^2.1.4"
59
60
  },
60
61
  "peerDependencies": {
62
+ "@monaco-editor/react": "^4.7.0",
61
63
  "react": ">= 18.2.0",
62
64
  "react-dom": ">= 18.2.0",
63
65
  "react-router-dom": "^6.8.2"