any
| |
+
+Returns:
+
+`void`
+
diff --git a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsinspectoradapter.md b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsinspectoradapter.md
new file mode 100644
index 000000000000..23d542a0f69e
--- /dev/null
+++ b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsinspectoradapter.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) > [ExpressionsInspectorAdapter](./kibana-plugin-plugins-expressions-public.expressionsinspectoradapter.md)
+
+## ExpressionsInspectorAdapter class
+
+Signature:
+
+```typescript
+export declare class ExpressionsInspectorAdapter extends EventEmitter
+```
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [ast](./kibana-plugin-plugins-expressions-public.expressionsinspectoradapter.ast.md) | | any
| |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [logAST(ast)](./kibana-plugin-plugins-expressions-public.expressionsinspectoradapter.logast.md) | | |
+
diff --git a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.md b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.md
index 1b97c9e11f83..e3eb7a34175e 100644
--- a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.md
+++ b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.md
@@ -16,6 +16,7 @@
| [ExpressionRenderer](./kibana-plugin-plugins-expressions-public.expressionrenderer.md) | |
| [ExpressionRendererRegistry](./kibana-plugin-plugins-expressions-public.expressionrendererregistry.md) | |
| [ExpressionRenderHandler](./kibana-plugin-plugins-expressions-public.expressionrenderhandler.md) | |
+| [ExpressionsInspectorAdapter](./kibana-plugin-plugins-expressions-public.expressionsinspectoradapter.md) | |
| [ExpressionsPublicPlugin](./kibana-plugin-plugins-expressions-public.expressionspublicplugin.md) | |
| [ExpressionsService](./kibana-plugin-plugins-expressions-public.expressionsservice.md) | ExpressionsService
class is used for multiple purposes:1. It implements the same Expressions service that can be used on both: (1) server-side and (2) browser-side. 2. It implements the same Expressions service that users can fork/clone, thus have their own instance of the Expressions plugin. 3. ExpressionsService
defines the public contracts of \*setup\* and \*start\* Kibana Platform life-cycles for ease-of-use on server-side and browser-side. 4. ExpressionsService
creates a bound version of all exported contract functions. 5. Functions are bound the way there are:\`\`\`ts registerFunction = (...args: Parameters<Executor\['registerFunction'\]> ): ReturnType<Executor\['registerFunction'\]> => this.executor.registerFunction(...args); \`\`\`so that JSDoc appears in developers IDE when they use those plugins.expressions.registerFunction(
. |
| [ExpressionType](./kibana-plugin-plugins-expressions-public.expressiontype.md) | |
diff --git a/examples/expressions_explorer/README.md b/examples/expressions_explorer/README.md
new file mode 100644
index 000000000000..ead0ca758f8e
--- /dev/null
+++ b/examples/expressions_explorer/README.md
@@ -0,0 +1,8 @@
+## expressions explorer
+
+This example expressions explorer app shows how to:
+ - to run expression
+ - to render expression output
+ - emit events from expression renderer and handle them
+
+To run this example, use the command `yarn start --run-examples`.
\ No newline at end of file
diff --git a/examples/expressions_explorer/kibana.json b/examples/expressions_explorer/kibana.json
new file mode 100644
index 000000000000..038b7eea0ef2
--- /dev/null
+++ b/examples/expressions_explorer/kibana.json
@@ -0,0 +1,10 @@
+{
+ "id": "expressionsExplorer",
+ "version": "0.0.1",
+ "kibanaVersion": "kibana",
+ "server": false,
+ "ui": true,
+ "requiredPlugins": ["expressions", "inspector", "uiActions", "developerExamples"],
+ "optionalPlugins": [],
+ "requiredBundles": []
+}
diff --git a/examples/expressions_explorer/public/actions/navigate_action.ts b/examples/expressions_explorer/public/actions/navigate_action.ts
new file mode 100644
index 000000000000..d29a9e6b345b
--- /dev/null
+++ b/examples/expressions_explorer/public/actions/navigate_action.ts
@@ -0,0 +1,21 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * and the Server Side Public License, v 1; you may not use this file except in
+ * compliance with, at your election, the Elastic License or the Server Side
+ * Public License, v 1.
+ */
+
+import { createAction } from '../../../../src/plugins/ui_actions/public';
+
+export const ACTION_NAVIGATE = 'ACTION_NAVIGATE';
+
+export const createNavigateAction = () =>
+ createAction({
+ id: ACTION_NAVIGATE,
+ type: ACTION_NAVIGATE,
+ getDisplayName: () => 'Navigate',
+ execute: async (event: any) => {
+ window.location.href = event.href;
+ },
+ });
diff --git a/examples/expressions_explorer/public/actions/navigate_trigger.ts b/examples/expressions_explorer/public/actions/navigate_trigger.ts
new file mode 100644
index 000000000000..eacbd968eaa9
--- /dev/null
+++ b/examples/expressions_explorer/public/actions/navigate_trigger.ts
@@ -0,0 +1,15 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * and the Server Side Public License, v 1; you may not use this file except in
+ * compliance with, at your election, the Elastic License or the Server Side
+ * Public License, v 1.
+ */
+
+import { Trigger } from '../../../../src/plugins/ui_actions/public';
+
+export const NAVIGATE_TRIGGER_ID = 'NAVIGATE_TRIGGER_ID';
+
+export const navigateTrigger: Trigger = {
+ id: NAVIGATE_TRIGGER_ID,
+};
diff --git a/examples/expressions_explorer/public/actions_and_expressions.tsx b/examples/expressions_explorer/public/actions_and_expressions.tsx
new file mode 100644
index 000000000000..6e2eebcde4a0
--- /dev/null
+++ b/examples/expressions_explorer/public/actions_and_expressions.tsx
@@ -0,0 +1,102 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * and the Server Side Public License, v 1; you may not use this file except in
+ * compliance with, at your election, the Elastic License or the Server Side
+ * Public License, v 1.
+ */
+
+import React, { useState } from 'react';
+import {
+ EuiFlexItem,
+ EuiFlexGroup,
+ EuiPageBody,
+ EuiPageContent,
+ EuiPageContentBody,
+ EuiPageHeader,
+ EuiPageHeaderSection,
+ EuiPanel,
+ EuiText,
+ EuiTitle,
+} from '@elastic/eui';
+import {
+ ExpressionsStart,
+ ReactExpressionRenderer,
+ ExpressionsInspectorAdapter,
+} from '../../../src/plugins/expressions/public';
+import { ExpressionEditor } from './editor/expression_editor';
+import { UiActionsStart } from '../../../src/plugins/ui_actions/public';
+import { NAVIGATE_TRIGGER_ID } from './actions/navigate_trigger';
+
+interface Props {
+ expressions: ExpressionsStart;
+ actions: UiActionsStart;
+}
+
+export function ActionsExpressionsExample({ expressions, actions }: Props) {
+ const [expression, updateExpression] = useState(
+ 'button name="click me" href="http://www.google.com"'
+ );
+
+ const expressionChanged = (value: string) => {
+ updateExpression(value);
+ };
+
+ const inspectorAdapters = {
+ expression: new ExpressionsInspectorAdapter(),
+ };
+
+ const handleEvents = (event: any) => {
+ if (event.id !== 'NAVIGATE') return;
+ // enrich event context with some extra data
+ event.baseUrl = 'http://www.google.com';
+
+ actions.executeTriggerActions(NAVIGATE_TRIGGER_ID, event.value);
+ };
+
+ return (
+
+ There are a couple of ways to run the expressions. Below some of the options are
+ demonstrated. You can read more about it{' '}
+
+