From 148ac4757d620321c22ed16a737540642d2b10f0 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 11 Aug 2021 20:21:44 -0700 Subject: [PATCH] Add EuiCodeEditor to ES UI Shared. --- package.json | 2 +- .../__snapshots__/code_editor.test.tsx.snap | 627 ++++++++++++++++++ .../components/code_editor/_code_editor.scss | 38 ++ .../code_editor/code_editor.test.tsx | 103 +++ .../components/code_editor/code_editor.tsx | 309 +++++++++ .../public/components/code_editor/index.scss | 1 + .../public/components/code_editor/index.ts | 9 + .../components/json_editor/json_editor.tsx | 3 +- yarn.lock | 14 +- 9 files changed, 1092 insertions(+), 14 deletions(-) create mode 100644 src/plugins/es_ui_shared/public/components/code_editor/__snapshots__/code_editor.test.tsx.snap create mode 100644 src/plugins/es_ui_shared/public/components/code_editor/_code_editor.scss create mode 100644 src/plugins/es_ui_shared/public/components/code_editor/code_editor.test.tsx create mode 100644 src/plugins/es_ui_shared/public/components/code_editor/code_editor.tsx create mode 100644 src/plugins/es_ui_shared/public/components/code_editor/index.scss create mode 100644 src/plugins/es_ui_shared/public/components/code_editor/index.ts diff --git a/package.json b/package.json index d7a072d1caef0..a4625c60af5f0 100644 --- a/package.json +++ b/package.json @@ -336,7 +336,7 @@ "re-resizable": "^6.1.1", "re2": "^1.15.4", "react": "^16.12.0", - "react-ace": "^5.9.0", + "react-ace": "^7.0.5", "react-beautiful-dnd": "^13.0.0", "react-color": "^2.13.8", "react-dom": "^16.12.0", diff --git a/src/plugins/es_ui_shared/public/components/code_editor/__snapshots__/code_editor.test.tsx.snap b/src/plugins/es_ui_shared/public/components/code_editor/__snapshots__/code_editor.test.tsx.snap new file mode 100644 index 0000000000000..aeab9a66c7694 --- /dev/null +++ b/src/plugins/es_ui_shared/public/components/code_editor/__snapshots__/code_editor.test.tsx.snap @@ -0,0 +1,627 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`EuiCodeEditor behavior hint element should be disabled when the ui ace box gains focus 1`] = ` + +`; + +exports[`EuiCodeEditor behavior hint element should be enabled when the ui ace box loses focus 1`] = ` + +`; + +exports[`EuiCodeEditor behavior hint element should be tabable 1`] = ` + +`; + +exports[`EuiCodeEditor is rendered 1`] = ` +
+ +
+