Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

VALIDATION_PACKAGE_DIR="packages/kbn-esql-validation-autocomplete"
EDITOR_PACKAGE_DIR="packages/kbn-language-documentation-popover"
EDITOR_PACKAGE_DIR="packages/kbn-language-documentation"
GIT_SCOPE="$VALIDATION_PACKAGE_DIR/**/* $EDITOR_PACKAGE_DIR/**/*"

report_main_step () {
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ src/plugins/kibana_usage_collection @elastic/kibana-core
src/plugins/kibana_utils @elastic/appex-sharedux
x-pack/plugins/kubernetes_security @elastic/kibana-cloud-security-posture
x-pack/packages/kbn-langchain @elastic/security-generative-ai
packages/kbn-language-documentation-popover @elastic/kibana-esql
packages/kbn-language-documentation @elastic/kibana-esql
x-pack/examples/lens_config_builder_example @elastic/kibana-visualizations
packages/kbn-lens-embeddable-utils @elastic/obs-ux-infra_services-team @elastic/kibana-visualizations
packages/kbn-lens-formula-docs @elastic/kibana-visualizations
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"serverlessPackages": "packages/serverless",
"sse": [ "packages/kbn-sse-utils" ],
"coloring": "packages/kbn-coloring/src",
"languageDocumentationPopover": "packages/kbn-language-documentation-popover/src",
"languageDocumentation": "packages/kbn-language-documentation/src",
"esql": "src/plugins/esql",
"esqlDataGrid": "src/plugins/esql_datagrid",
"statusPage": "src/legacy/core_plugins/status_page",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
"@kbn/kibana-utils-plugin": "link:src/plugins/kibana_utils",
"@kbn/kubernetes-security-plugin": "link:x-pack/plugins/kubernetes_security",
"@kbn/langchain": "link:x-pack/packages/kbn-langchain",
"@kbn/language-documentation-popover": "link:packages/kbn-language-documentation-popover",
"@kbn/language-documentation": "link:packages/kbn-language-documentation",
"@kbn/lens-config-builder-example-plugin": "link:x-pack/examples/lens_config_builder_example",
"@kbn/lens-embeddable-utils": "link:packages/kbn-lens-embeddable-utils",
"@kbn/lens-formula-docs": "link:packages/kbn-lens-formula-docs",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
### Shareable language documentation popover
### Shareable language documentation

This is a stateless shareable component that can be used to render documentation for a language as a popover.
This is a stateless shareable component that can be used to render documentation for a language as a popover, flyour or a React component that you can add in your applications as you wish.

It can be used in every application that would like to add an in-app documentation. The component consists of:
- A sidebar navigation with a search
- A details page

### As a popover (currently used for Lens formulas)

```
<LanguageDocumentationPopover language={language} sections={documentationSections} onHelpMenuVisibilityChange={onHelpMenuVisibilityChange} isHelpMenuOpen={isHelpMenuOpen} />
```

### As a flyout (currently used for ES|QL in unified search)

```
<LanguageDocumentationFlyout linkToDocumentation={docLinks?.links?.query?.queryESQL ?? ''} isHelpMenuOpen={isLanguageComponentOpen} onHelpMenuVisibilityChange={setIsLanguageComponentOpen} />
```

### As an inline component (currently used for ES|QL in Lens inline editing, alerts)

```
<LanguageDocumentationInline />
```

The properties are typed as:

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-language-documentation-popover'],
roots: ['<rootDir>/packages/kbn-language-documentation'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/language-documentation-popover",
"id": "@kbn/language-documentation",
"owner": "@elastic/kibana-esql"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@kbn/language-documentation-popover",
"name": "@kbn/language-documentation",
"version": "1.0.0",
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0",
"private": true,
Expand All @@ -9,6 +9,6 @@
"scripts": {
"make:docs": "ts-node --transpileOnly scripts/generate_esql_docs.ts",
"postmake:docs": "yarn run lint:fix",
"lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-language-documentation-popover/src/sections/generated"
"lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-language-documentation/src/sections/generated"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function writeFunctionDocs(functionDocs: Map<string, string>, pathToDocsFile: st
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
{
label: i18n.translate(
'languageDocumentationPopover.documentationESQL.${name}',
'languageDocumentation.documentationESQL.${name}',
{
defaultMessage: '${name.toUpperCase()}',
}
Expand All @@ -97,7 +97,7 @@ function writeFunctionDocs(functionDocs: Map<string, string>, pathToDocsFile: st
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate(
'languageDocumentationPopover.documentationESQL.${name}.markdown',
'languageDocumentation.documentationESQL.${name}.markdown',
{
defaultMessage: \`${docWithoutLinks.replaceAll('`', '\\`')}\`,
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function DocumentationFlyout({
<EuiFlyoutHeader hasBorder>
<EuiTitle size="s">
<h3>
{i18n.translate('languageDocumentationPopover.documentationFlyoutTitle', {
{i18n.translate('languageDocumentation.documentationFlyoutTitle', {
defaultMessage: 'ES|QL quick reference',
})}
</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function DocumentationPopover({
button={
<EuiToolTip
position="top"
content={i18n.translate('languageDocumentationPopover.tooltip', {
content={i18n.translate('languageDocumentation.tooltip', {
defaultMessage: '{lang} reference',
values: {
lang: language,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ function DocumentationContent({
justifyContent="spaceBetween"
>
<EuiFlexItem grow={false}>
{i18n.translate('languageDocumentationPopover.header', {
{i18n.translate('languageDocumentation.header', {
defaultMessage: '{language} reference',
values: { language },
})}
</EuiFlexItem>
{linkToDocumentation && (
<EuiFlexItem grow={false}>
<EuiLink external href={linkToDocumentation} target="_blank">
{i18n.translate('languageDocumentationPopover.documentationLinkLabel', {
{i18n.translate('languageDocumentation.documentationLinkLabel', {
defaultMessage: 'View full documentation',
})}
</EuiLink>
Expand Down Expand Up @@ -106,7 +106,7 @@ function DocumentationContent({
setSearchText(e.target.value);
}}
data-test-subj="language-documentation-navigation-search"
placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', {
placeholder={i18n.translate('languageDocumentation.searchPlaceholder', {
defaultMessage: 'Search',
})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function DocumentationNav({
<EuiFlexItem grow={true}>
<EuiFormRow
fullWidth
label={i18n.translate('languageDocumentationPopover.esqlDocsLabel', {
label={i18n.translate('languageDocumentation.esqlDocsLabel', {
defaultMessage: 'Select or search topics',
})}
labelAppend={
Expand All @@ -57,7 +57,7 @@ function DocumentationNav({
target="_blank"
data-test-subj="language-documentation-navigation-link"
>
{i18n.translate('languageDocumentationPopover.esqlDocsLinkLabel', {
{i18n.translate('languageDocumentation.esqlDocsLinkLabel', {
defaultMessage: 'View full ES|QL documentation',
})}
</EuiLink>
Expand All @@ -66,10 +66,10 @@ function DocumentationNav({
}
>
<EuiComboBox
aria-label={i18n.translate('languageDocumentationPopover.navigationAriaLabel', {
aria-label={i18n.translate('languageDocumentation.navigationAriaLabel', {
defaultMessage: 'Navigate through the documentation',
})}
placeholder={i18n.translate('languageDocumentationPopover.navigationPlaceholder', {
placeholder={i18n.translate('languageDocumentation.navigationPlaceholder', {
defaultMessage: 'Commands and functions',
})}
data-test-subj="language-documentation-navigation-dropdown"
Expand All @@ -94,7 +94,7 @@ function DocumentationNav({
setSearchText(e.target.value);
}}
data-test-subj="language-documentation-navigation-search"
placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', {
placeholder={i18n.translate('languageDocumentation.searchPlaceholder', {
defaultMessage: 'Search',
})}
fullWidth
Expand Down
Loading