Skip to content

Commit 7a75f9d

Browse files
committed
Merge main into fix/test-elastic-nav
2 parents 12319db + 4fb8280 commit 7a75f9d

95 files changed

Lines changed: 1092 additions & 2711 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Packages.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@
2222
<PackageVersion Include="AngleSharp" Version="1.4.0" />
2323
<PackageVersion Include="Aspire.Hosting" Version="13.0.0" />
2424
<PackageVersion Include="Aspire.Hosting.Testing" Version="13.0.0" />
25-
<PackageVersion Include="AWSSDK.Core" Version="4.0.3.6" />
25+
<PackageVersion Include="AWSSDK.Core" Version="4.0.3.8" />
2626
<PackageVersion Include="AWSSDK.DynamoDBv2" Version="4.0.10.5" />
27-
<PackageVersion Include="AWSSDK.SQS" Version="4.0.2.9" />
27+
<PackageVersion Include="AWSSDK.SQS" Version="4.0.2.11" />
2828
<PackageVersion Include="AWSSDK.S3" Version="4.0.16.2" />
2929
<PackageVersion Include="Elastic.OpenTelemetry" Version="1.1.0" />
3030
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.0" />
31-
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0" />
31+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.1" />
3232
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="10.0.0" />
3333
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.13.0" />
3434
<PackageVersion Include="Generator.Equals" Version="3.2.1" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
3535
<PackageVersion Include="KubernetesClient" Version="18.0.5" />
3636
<PackageVersion Include="Elastic.Aspire.Hosting.Elasticsearch" Version="9.3.0" />
3737
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="9.2.2" />
38-
<PackageVersion Include="FakeItEasy" Version="8.3.0" />
38+
<PackageVersion Include="FakeItEasy" Version="9.0.0" />
3939
<PackageVersion Include="Elastic.Ingest.Elasticsearch" Version="0.17.1" />
4040
<PackageVersion Include="InMemoryLogger" Version="1.0.66" />
41-
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.6.0" />
41+
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.7.0" />
4242
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
4343
<PackageVersion Include="Microsoft.OpenApi" Version="3.0.1" />
4444
<PackageVersion Include="TUnit" Version="0.25.21" />
@@ -100,7 +100,7 @@
100100
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
101101
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.4" />
102102
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0" />
103-
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.0" />
103+
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.1" />
104104
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
105105
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.13.0" />
106106
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.1.0" />

config/versions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ versioning_systems:
33
# Updates for Stack versions are manual
44
stack: &stack
55
base: 9.0
6-
current: 9.2.3
6+
current: 9.2.4
77

88
# Using an unlikely high version
99
# So that our logic that would display "planned" doesn't trigger
@@ -73,7 +73,7 @@ versioning_systems:
7373
# EDOTs
7474
edot-collector:
7575
base: 9.0
76-
current: 9.2.3
76+
current: 9.2.4
7777
edot-ios:
7878
base: 1.0
7979
current: 1.4.0
@@ -82,7 +82,7 @@ versioning_systems:
8282
current: 1.4.0
8383
edot-dotnet:
8484
base: 1.0
85-
current: 1.2.0
85+
current: 1.2.2
8686
edot-java:
8787
base: 1.0
8888
current: 1.8.0
@@ -149,7 +149,7 @@ versioning_systems:
149149
current: 9.2.1
150150
elasticsearch-client-java:
151151
base: 9.0
152-
current: 9.2.3
152+
current: 9.2.4
153153
elasticsearch-client-javascript:
154154
base: 9.0
155155
current: 9.2.0

docs/syntax/applies-switch.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ The applies-switch directive creates tabbed content where each tab displays an a
99

1010
::::{applies-switch}
1111

12-
:::{applies-item} stack:
12+
:::{applies-item} stack: ga 9.0+
1313
Content for Stack
1414
:::
1515

16-
:::{applies-item} serverless:
16+
:::{applies-item} serverless: ga
1717
Content for Serverless
1818
:::
1919

@@ -25,11 +25,11 @@ Content for Serverless
2525
```markdown
2626
::::{applies-switch}
2727

28-
:::{applies-item} stack:
28+
:::{applies-item} stack: ga 9.0+
2929
Content for Stack
3030
:::
3131

32-
:::{applies-item} serverless:
32+
:::{applies-item} serverless: ga
3333
Content for Serverless
3434
:::
3535

@@ -48,11 +48,11 @@ This is useful when content applies to multiple deployment types or versions sim
4848

4949
::::{applies-switch}
5050

51-
:::{applies-item} { ece:, ess: }
51+
:::{applies-item} { ece: ga 4.0+, ess: ga }
5252
Content for ECE and ECH
5353
:::
5454

55-
:::{applies-item} serverless:
55+
:::{applies-item} serverless: ga
5656
Content for Serverless
5757
:::
5858

@@ -64,11 +64,11 @@ Content for Serverless
6464
```markdown
6565
::::{applies-switch}
6666

67-
:::{applies-item} { ece:, ess: }
67+
:::{applies-item} { ece: ga 4.0+, ess: ga }
6868
Content for ECE and ECH
6969
:::
7070

71-
:::{applies-item} serverless:
71+
:::{applies-item} serverless: ga
7272
Content for Serverless
7373
:::
7474

@@ -81,28 +81,28 @@ Content for Serverless
8181

8282
All applies switches on a page automatically sync together. When you select an applies_to definition in one switch, all other switches will switch to the same applies_to definition.
8383

84-
The format of the applies_to definition doesn't matter - `stack: preview 9.1`, `{ "stack": "preview 9.1" }`, and `{ stack: "preview 9.1" }` all identify the same content and will sync together.
84+
The format of the applies_to definition doesn't matter - `stack: ga 9.1+`, `{ "stack": "ga 9.1+" }`, and `{ stack: "ga 9.1+" }` all identify the same content and will sync together.
8585

8686
In the following example, both switch sets are automatically grouped and will stay in sync.
8787

8888
::::::{tab-set}
8989
:::::{tab-item} Output
9090

9191
::::{applies-switch}
92-
:::{applies-item} { "stack": "preview 9.0" }
93-
Content for 9.0 version
92+
:::{applies-item} { "stack": "ga 9.1+" }
93+
Content for versions 9.1 and newer
9494
:::
95-
:::{applies-item} { "stack": "ga 9.1" }
96-
Content for 9.1 version
95+
:::{applies-item} { "stack": "preview =9.0" }
96+
Content for version 9.0
9797
:::
9898
::::
9999

100100
::::{applies-switch}
101-
:::{applies-item} stack: preview 9.0
102-
Other content for 9.0 version
101+
:::{applies-item} stack: ga 9.1+
102+
Other content for versions 9.1 and newer
103103
:::
104-
:::{applies-item} stack: ga 9.1
105-
Other content for 9.1 version
104+
:::{applies-item} stack: preview =9.0
105+
Other content for version 9.0
106106
:::
107107
::::
108108

@@ -111,20 +111,20 @@ Other content for 9.1 version
111111

112112
```markdown
113113
::::{applies-switch}
114-
:::{applies-item} { "stack": "preview 9.0" }
115-
Content for 9.0 version
114+
:::{applies-item} { "stack": "ga 9.1+" }
115+
Content for versions 9.1 and newer
116116
:::
117-
:::{applies-item} { "stack": "ga 9.1" }
118-
Content for 9.1 version
117+
:::{applies-item} { "stack": "preview =9.0" }
118+
Content for version 9.0
119119
:::
120120
::::
121121

122122
::::{applies-switch}
123-
:::{applies-item} stack: preview 9.0
124-
Other content for 9.0 version
123+
:::{applies-item} stack: ga 9.1+
124+
Other content for versions 9.1 and newer
125125
:::
126-
:::{applies-item} stack: ga 9.1
127-
Other content for 9.1 version
126+
:::{applies-item} stack: preview =9.0
127+
Other content for version 9.0
128128
:::
129129
::::
130130
```

src/Elastic.Documentation.Site/Assets/main.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ initializeOtel({
3030
// Dynamically import web components after telemetry is initialized
3131
// This ensures telemetry is available when the components execute
3232
// Parcel will automatically code-split this into a separate chunk
33-
import('./web-components/SearchOrAskAi/SearchOrAskAi')
33+
import('./web-components/NavigationSearch/NavigationSearchComponent')
34+
import('./web-components/AskAi/AskAi')
3435
import('./web-components/VersionDropdown')
3536
import('./web-components/AppliesToPopover')
3637

@@ -224,3 +225,18 @@ document.body.addEventListener(
224225
}
225226
}
226227
)
228+
229+
// Clean up web component content before htmx saves to history cache.
230+
document.body.addEventListener('htmx:beforeHistorySave', function () {
231+
// connectedCallback() re-renders
232+
$$('applies-to-popover, version-dropdown, search-or-ask-ai').forEach(
233+
(el) => {
234+
el.innerHTML = ''
235+
}
236+
)
237+
238+
// EUI portal containers getting orphaned during navigation
239+
$$('[data-euiportal="true"]').forEach((el) => {
240+
el.remove()
241+
})
242+
})

src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/AiProviderSelector.tsx renamed to src/Elastic.Documentation.Site/Assets/web-components/AskAi/AiProviderSelector.tsx

File renamed without changes.

src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/SearchOrAskAiButton.tsx renamed to src/Elastic.Documentation.Site/Assets/web-components/AskAi/AskAi.tsx

Lines changed: 49 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
import '../../eui-icons-cache'
2-
import { NavigationSearch } from './NavigationSearch'
3-
import {
4-
// ModalMode,
5-
useModalActions,
6-
useModalIsOpen,
7-
useModalMode,
8-
} from './modal.store'
2+
import { useAskAiModalActions, useAskAiModalIsOpen } from './askAi.modal.store'
93
import {
104
EuiPortal,
115
EuiOverlayMask,
126
EuiFocusTrap,
137
EuiPanel,
148
EuiLoadingSpinner,
9+
EuiProvider,
1510
useEuiTheme,
1611
} from '@elastic/eui'
1712
import { css } from '@emotion/react'
18-
import { useQuery } from '@tanstack/react-query'
19-
import { useEffect, Suspense, lazy } from 'react'
13+
import r2wc from '@r2wc/react-to-web-component'
14+
import {
15+
QueryClient,
16+
QueryClientProvider,
17+
useQuery,
18+
} from '@tanstack/react-query'
19+
import { useEffect, Suspense, lazy, StrictMode } from 'react'
20+
21+
const queryClient = new QueryClient()
2022

2123
// Lazy load the modal component
22-
const SearchOrAskAiModal = lazy(() =>
23-
import('./SearchOrAskAiModal').then((module) => ({
24-
default: module.SearchOrAskAiModal,
24+
const LazyAskAiModal = lazy(() =>
25+
import('./AskAiModal').then((module) => ({
26+
default: module.AskAiModal,
2527
}))
2628
)
2729

28-
export const SearchOrAskAiButton = () => {
30+
const AskAiButton = () => {
2931
const { euiTheme } = useEuiTheme()
30-
const isModalOpen = useModalIsOpen()
31-
const modalMode = useModalMode()
32-
const {
33-
// openModal,
34-
closeModal,
35-
// setModalMode
36-
} = useModalActions()
32+
const isModalOpen = useAskAiModalIsOpen()
33+
const { openModal, closeModal } = useAskAiModalActions()
3734

3835
const { data: isApiAvailable } = useQuery({
3936
queryKey: ['api-health'],
@@ -62,43 +59,26 @@ export const SearchOrAskAiButton = () => {
6259
padding: 2rem;
6360
`
6461

65-
// const openAndSetModalMode = (mode: ModalMode) => {
66-
// setModalMode(mode)
67-
// if (!isModalOpen) {
68-
// openModal()
69-
// }
70-
// }
71-
72-
// const openAskAiModal = () => openAndSetModalMode('askAi')
73-
// const openSearchModal = () => openAndSetModalMode('search')
74-
75-
// Prevent layout jump when hiding the scrollbar by compensating its width
76-
7762
useEffect(() => {
7863
const handleKeydown = (event: KeyboardEvent) => {
7964
if (event.key === 'Escape') {
80-
closeModal()
65+
//closeModal()
66+
}
67+
68+
// Cmd+; to open Ask AI modal
69+
if (
70+
(event.metaKey || event.ctrlKey) &&
71+
event.code === 'Semicolon'
72+
) {
73+
//event.preventDefault()
74+
//openModal()
8175
}
82-
// Cmd+K is now handled by NavigationSearch to focus the input
83-
// if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
84-
// event.preventDefault()
85-
// openSearchModal()
86-
// }
87-
88-
// if (
89-
// (event.metaKey || event.ctrlKey) &&
90-
// event.code === 'Semicolon'
91-
// ) {
92-
// event.preventDefault()
93-
// openAskAiModal()
94-
// // Input focuses itself via its own Cmd+; listener
95-
// }
9676
}
9777
window.addEventListener('keydown', handleKeydown)
9878
return () => {
9979
window.removeEventListener('keydown', handleKeydown)
10080
}
101-
}, [isModalOpen, modalMode])
81+
}, [openModal, closeModal])
10282

10383
useEffect(() => {
10484
if (!isModalOpen) return
@@ -132,19 +112,7 @@ export const SearchOrAskAiButton = () => {
132112
}
133113

134114
return (
135-
<div>
136-
{/*<EuiToolTip content="Keyboard shortcut: ⌘;">*/}
137-
{/* <ElasticAiAssistantButton*/}
138-
{/* size="s"*/}
139-
{/* iconType={AiIcon}*/}
140-
{/* onClick={openAskAiModal}*/}
141-
{/* >*/}
142-
{/* Ask AI Assistant*/}
143-
{/* </ElasticAiAssistantButton>*/}
144-
{/*</EuiToolTip>*/}
145-
146-
<NavigationSearch />
147-
115+
<>
148116
{isModalOpen && (
149117
<EuiPortal>
150118
<EuiOverlayMask>
@@ -161,13 +129,31 @@ export const SearchOrAskAiButton = () => {
161129
</div>
162130
}
163131
>
164-
<SearchOrAskAiModal />
132+
<LazyAskAiModal />
165133
</Suspense>
166134
</EuiPanel>
167135
</EuiFocusTrap>
168136
</EuiOverlayMask>
169137
</EuiPortal>
170138
)}
171-
</div>
139+
</>
172140
)
173141
}
142+
143+
const AskAi = () => {
144+
return (
145+
<StrictMode>
146+
<EuiProvider
147+
colorMode="light"
148+
globalStyles={false}
149+
utilityClasses={false}
150+
>
151+
<QueryClientProvider client={queryClient}>
152+
<AskAiButton />
153+
</QueryClientProvider>
154+
</EuiProvider>
155+
</StrictMode>
156+
)
157+
}
158+
159+
customElements.define('ask-ai', r2wc(AskAi))

src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/AskAiEvent.ts renamed to src/Elastic.Documentation.Site/Assets/web-components/AskAi/AskAiEvent.ts

File renamed without changes.

0 commit comments

Comments
 (0)