Skip to content

Commit dac1a5d

Browse files
authored
Search or Ask AI beta webcompontent (#1618)
* Search or Ask AI beta webcompontent * Add custom GCP ID token generation logic that is compatible with AOT
1 parent 46330d2 commit dac1a5d

24 files changed

+1617
-462
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@
7070
</PackageVersion>
7171
<PackageVersion Include="xunit.v3" Version="2.0.2" />
7272
</ItemGroup>
73-
</Project>
73+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
import './web-components/SearchOrAskAi/SearchOrAskAi'
12
import './web-components/VersionDropdown'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { icon as EuiIconVisualizeApp } from '@elastic/eui/es/components/icon/assets/app_visualize'
2+
import { icon as EuiIconArrowDown } from '@elastic/eui/es/components/icon/assets/arrow_down'
3+
import { icon as EuiIconArrowLeft } from '@elastic/eui/es/components/icon/assets/arrow_left'
4+
import { icon as EuiIconArrowRight } from '@elastic/eui/es/components/icon/assets/arrow_right'
5+
import { icon as EuiIconCheck } from '@elastic/eui/es/components/icon/assets/check'
6+
import { icon as EuiIconCopyClipboard } from '@elastic/eui/es/components/icon/assets/copy_clipboard'
7+
import { icon as EuiIconCross } from '@elastic/eui/es/components/icon/assets/cross'
8+
import { icon as EuiIconDocument } from '@elastic/eui/es/components/icon/assets/document'
9+
import { icon as EuiIconError } from '@elastic/eui/es/components/icon/assets/error'
10+
import { icon as EuiIconFaceHappy } from '@elastic/eui/es/components/icon/assets/face_happy'
11+
import { icon as EuiIconFaceSad } from '@elastic/eui/es/components/icon/assets/face_sad'
12+
import { icon as EuiIconNewChat } from '@elastic/eui/es/components/icon/assets/new_chat'
13+
import { icon as EuiIconRefresh } from '@elastic/eui/es/components/icon/assets/refresh'
14+
import { icon as EuiIconSearch } from '@elastic/eui/es/components/icon/assets/search'
15+
import { icon as EuiIconSparkles } from '@elastic/eui/es/components/icon/assets/sparkles'
16+
import { icon as EuiIconTrash } from '@elastic/eui/es/components/icon/assets/trash'
17+
import { icon as EuiIconUser } from '@elastic/eui/es/components/icon/assets/user'
18+
import { icon as EuiIconWrench } from '@elastic/eui/es/components/icon/assets/wrench'
19+
import { appendIconComponentCache } from '@elastic/eui/es/components/icon/icon'
20+
21+
appendIconComponentCache({
22+
newChat: EuiIconNewChat,
23+
arrowDown: EuiIconArrowDown,
24+
arrowLeft: EuiIconArrowLeft,
25+
arrowRight: EuiIconArrowRight,
26+
document: EuiIconDocument,
27+
search: EuiIconSearch,
28+
trash: EuiIconTrash,
29+
user: EuiIconUser,
30+
wrench: EuiIconWrench,
31+
visualizeApp: EuiIconVisualizeApp,
32+
check: EuiIconCheck,
33+
sparkles: EuiIconSparkles,
34+
cross: EuiIconCross,
35+
copyClipboard: EuiIconCopyClipboard,
36+
faceHappy: EuiIconFaceHappy,
37+
faceSad: EuiIconFaceSad,
38+
refresh: EuiIconRefresh,
39+
error: EuiIconError,
40+
})

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { initTabs } from './tabs'
1010
import { initTocNav } from './toc-nav'
1111
import 'htmx-ext-head-support'
1212
import 'htmx-ext-preload'
13-
import 'htmx.org'
1413
import { $, $$ } from 'select-dom'
1514
import { UAParser } from 'ua-parser-js'
1615

Lines changed: 132 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,157 @@
11
@layer components {
2-
.highlight {
3-
@apply mt-4;
4-
}
5-
6-
pre {
7-
@apply grid;
8-
code {
9-
@apply text-grey-30 overflow-x-auto rounded-none border-0 p-6! text-sm;
10-
background-color: #22272e;
11-
mix-blend-mode: unset;
12-
line-height: 1.5em;
13-
word-break: normal;
14-
}
15-
code:first-child {
16-
@apply rounded-t-sm;
2+
.markdown-content {
3+
.highlight {
4+
@apply mt-4;
175
}
18-
code:last-child {
19-
@apply rounded-b-sm;
20-
}
21-
code.language-apiheader {
22-
@apply border-b-grey-80 border-b-1;
23-
}
24-
}
256

26-
pre code .code-callout {
27-
@apply ml-1;
28-
user-select: none;
29-
&::after {
30-
content: attr(data-index);
7+
pre {
8+
@apply grid;
9+
code {
10+
@apply text-grey-30 overflow-x-auto rounded-none border-0 p-6! text-sm;
11+
background-color: #22272e;
12+
mix-blend-mode: unset;
13+
line-height: 1.5em;
14+
word-break: normal;
15+
}
16+
code:first-child {
17+
@apply rounded-t-sm;
18+
}
19+
code:last-child {
20+
@apply rounded-b-sm;
21+
}
22+
code.language-apiheader {
23+
@apply border-b-grey-80 border-b-1;
24+
}
3125
}
32-
}
3326

34-
ol.code-callouts {
35-
li {
36-
@apply relative pl-1;
37-
counter-increment: code-callout-counter;
38-
list-style-type: none;
27+
pre code .code-callout {
28+
@apply ml-1;
29+
user-select: none;
30+
&::after {
31+
content: attr(data-index);
32+
}
3933
}
4034

41-
li::before {
42-
content: counter(code-callout-counter);
43-
position: absolute;
44-
top: 1px;
45-
left: calc(-1 * var(--spacing) * 6);
35+
ol.code-callouts {
36+
li {
37+
@apply relative pl-1;
38+
counter-increment: code-callout-counter;
39+
list-style-type: none;
40+
}
41+
42+
li::before {
43+
content: counter(code-callout-counter);
44+
position: absolute;
45+
top: 1px;
46+
left: calc(-1 * var(--spacing) * 6);
47+
}
4648
}
47-
}
4849

49-
pre code .code-callout .hljs-number {
50-
@apply text-white!;
51-
}
50+
pre code .code-callout .hljs-number {
51+
@apply text-white!;
52+
}
5253

53-
pre code .code-callout,
54-
ol.code-callouts li::before {
55-
@apply bg-blue-elastic inline-flex size-4.5 items-center justify-center rounded-full font-mono text-xs! text-white!;
56-
}
54+
pre code .code-callout,
55+
ol.code-callouts li::before {
56+
@apply bg-blue-elastic inline-flex size-4.5 items-center justify-center rounded-full font-mono text-xs! text-white!;
57+
}
5758

58-
code {
59-
@apply bg-grey-10 border-grey-20 rounded-xs border-1 font-mono;
60-
font-size: 0.875em;
61-
line-height: 1.4em;
62-
padding-left: 0.2em;
63-
padding-right: 0.2em;
64-
text-decoration: inherit;
65-
font-weight: inherit;
66-
mix-blend-mode: multiply;
67-
word-break: break-word;
68-
}
59+
code {
60+
@apply bg-grey-10 border-grey-20 rounded-xs border-1 font-mono;
61+
font-size: 0.875em;
62+
line-height: 1.4em;
63+
padding-left: 0.2em;
64+
padding-right: 0.2em;
65+
text-decoration: inherit;
66+
font-weight: inherit;
67+
mix-blend-mode: multiply;
68+
word-break: break-word;
69+
}
6970

70-
.hljs-built_in,
71-
.hljs-selector-tag,
72-
.hljs-section,
73-
.hljs-link {
74-
color: var(--color-blue-elastic-70);
75-
}
71+
.hljs-built_in,
72+
.hljs-selector-tag,
73+
.hljs-section,
74+
.hljs-link {
75+
color: var(--color-blue-elastic-70);
76+
}
7677

77-
.hljs-keyword {
78-
color: var(--color-blue-elastic-70);
79-
}
78+
.hljs-keyword {
79+
color: var(--color-blue-elastic-70);
80+
}
8081

81-
.hljs {
82-
color: var(--color-blue-elastic-30) !important;
83-
}
84-
.hljs-subst {
85-
color: var(--color-purple-60);
86-
}
87-
.hljs-function {
88-
color: var(--color-purple-60);
89-
}
82+
.hljs {
83+
color: var(--color-blue-elastic-30) !important;
84+
}
85+
.hljs-subst {
86+
color: var(--color-purple-60);
87+
}
88+
.hljs-function {
89+
color: var(--color-purple-60);
90+
}
9091

91-
.hljs-title,
92-
.hljs-title.function,
93-
.hljs-attr,
94-
.hljs-meta-keyword {
95-
color: var(--color-yellow-50);
96-
}
92+
.hljs-title,
93+
.hljs-title.function,
94+
.hljs-attr,
95+
.hljs-meta-keyword {
96+
color: var(--color-yellow-50);
97+
}
9798

98-
.hljs-string {
99-
color: var(--color-green-50);
100-
}
101-
.hljs-operator {
102-
color: var(--color-yellow-50);
103-
}
99+
.hljs-string {
100+
color: var(--color-green-50);
101+
}
102+
.hljs-operator {
103+
color: var(--color-yellow-50);
104+
}
104105

105-
.hljs-meta,
106-
.hljs-name,
107-
.hljs-bullet,
108-
.hljs-addition,
109-
.hljs-template-tag,
110-
.hljs-template-variable {
111-
color: var(--color-yellow-50);
112-
}
106+
.hljs-meta,
107+
.hljs-name,
108+
.hljs-bullet,
109+
.hljs-addition,
110+
.hljs-template-tag,
111+
.hljs-template-variable {
112+
color: var(--color-yellow-50);
113+
}
113114

114-
.hljs-type,
115-
.hljs-symbol {
116-
color: var(--color-teal-50);
117-
}
118-
.hljs-variable {
119-
color: var(--color-purple-50);
120-
}
115+
.hljs-type,
116+
.hljs-symbol {
117+
color: var(--color-teal-50);
118+
}
119+
.hljs-variable {
120+
color: var(--color-purple-50);
121+
}
121122

122-
.hljs-comment,
123-
.hljs-quote,
124-
.hljs-deletion {
125-
color: var(--color-grey-70);
126-
}
123+
.hljs-comment,
124+
.hljs-quote,
125+
.hljs-deletion {
126+
color: var(--color-grey-70);
127+
}
127128

128-
.hljs-punctuation {
129-
color: var(--color-grey-50);
130-
font-weight: bold;
131-
}
129+
.hljs-punctuation {
130+
color: var(--color-grey-50);
131+
font-weight: bold;
132+
}
132133

133-
.hljs-keyword,
134-
.hljs-selector-tag,
135-
.hljs-literal,
136-
.hljs-title,
137-
.hljs-section,
138-
.hljs-doctag,
139-
.hljs-type,
140-
.hljs-name,
141-
.hljs-strong {
142-
font-weight: bold;
143-
}
134+
.hljs-keyword,
135+
.hljs-selector-tag,
136+
.hljs-literal,
137+
.hljs-title,
138+
.hljs-section,
139+
.hljs-doctag,
140+
.hljs-type,
141+
.hljs-name,
142+
.hljs-strong {
143+
font-weight: bold;
144+
}
144145

145-
.hljs-literal {
146-
color: var(--color-pink-50);
147-
}
148-
.hljs-number {
149-
color: var(--color-red-50);
150-
}
146+
.hljs-literal {
147+
color: var(--color-pink-50);
148+
}
149+
.hljs-number {
150+
color: var(--color-red-50);
151+
}
151152

152-
.hljs-emphasis {
153-
font-style: italic;
153+
.hljs-emphasis {
154+
font-style: italic;
155+
}
154156
}
155157
}

0 commit comments

Comments
 (0)