Skip to content

Commit

Permalink
rebase and retest inkeep PR. (#417)
Browse files Browse the repository at this point in the history
Bumps Inkeep to fix XSS issue

---------

Co-authored-by: sarah_inkeep <[email protected]>
Co-authored-by: Michael Myers <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2023
1 parent 153e8f8 commit 0ea9b7d
Show file tree
Hide file tree
Showing 7 changed files with 7,958 additions and 6,589 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
permissions:
contents: read
with:
allow-dependencies-licenses: 'pkg:npm/%40inkeep/widgets'
allow-dependencies-licenses: 'pkg:npm/%40inkeep/widgets, pkg:npm/domain-browser'
3 changes: 2 additions & 1 deletion components/Search/InkeepSearch.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

.search-input {
width: 100%;
color: var(--color-black);
color: var(--color-text);
background: transparent;
border: none;
font-size: 14px;
Expand All @@ -23,6 +23,7 @@

@media (max-width: 560px) {
width: 100%;
font-size: 16px;
}
}

Expand Down
73 changes: 42 additions & 31 deletions components/Search/InkeepSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
import React, { useContext, useState, useRef, useCallback } from "react";
import dynamic from "next/dynamic";
import {
InkeepAIChatSettings,
InkeepSearchSettings,
InkeepCustomTriggerProps,
InkeepWidgetBaseSettings,
RemoteErrorLogsLevel,
ConsoleDebugLevel,
AIChatFunctions,
SearchFunctions,
type InkeepAIChatSettings,
type InkeepSearchSettings,
type InkeepCustomTriggerProps,
type InkeepWidgetBaseSettings,
type AIChatFunctions,
type SearchFunctions,
} from "@inkeep/widgets";

import { DocsContext } from "layouts/DocsPage/context";

import styles from "./InkeepSearch.module.css";
import InkeepSearchIconSvg from "./inkeepIcon.svg?react";
import { lato } from "../../pages/_app";

const API_KEY = process.env.NEXT_PUBLIC_INKEEP_API_KEY;
const INTEGRATION_ID = process.env.NEXT_PUBLIC_INKEEP_INTEGRATION_ID;

const cssOverrides = `
.ikp-modal-widget-content {
border: 2px solid #512FC9;
border-radius: 12px;
top: 88px;
left: 12px;
}
`;

const stylesheets = [<style key="inkeep-overrides">{cssOverrides}</style>];

const InkeepCustomTrigger = dynamic<InkeepCustomTriggerProps>(
() => import("@inkeep/widgets").then((mod) => mod.InkeepCustomTrigger),
{ ssr: false }
Expand Down Expand Up @@ -49,11 +59,17 @@ export function InkeepSearch() {
const inkeepCustomTriggerProps: InkeepCustomTriggerProps = {
isOpen,
onClose: handleClose,
baseSettings: { ...inkeepBaseSettings, productVersion: version },
stylesheets,
baseSettings: {
...inkeepBaseSettings,
},
aiChatSettings: {
...inkeepAIChatSettings,
chatFunctionsRef: chatCallableFunctionsRef,
handleMessageChange: handleChange,
messageAttributes: {
productVersion: version,
},
},
searchSettings: {
...inkeepSearchSettings,
Expand Down Expand Up @@ -90,12 +106,10 @@ const inkeepBaseSettings: InkeepWidgetBaseSettings = {
organizationId: "teleport",
organizationDisplayName: "Teleport",
primaryBrandColor: "#512FC9",
product: "Teleport",
isInkeepMentionEnabled: true,
apiProxyDomain: "goteleport.com/inkeep-proxy",
remoteErrorLogsLevel: RemoteErrorLogsLevel.AnonymousErrors,
chatApiProxyDomain: "goteleport.com/inkeep-proxy",
remoteErrorLogsLevel: 1,
optOutAllAnalytics: true,
consoleDebugLevel: ConsoleDebugLevel.None,
consoleDebugLevel: 0,
customCardSettings: [
{
filters: {
Expand All @@ -106,24 +120,21 @@ const inkeepBaseSettings: InkeepWidgetBaseSettings = {
},
],
theme: {
zIndices: {
overlay: "2100",
modal: "2200",
popover: "2300",
skipLink: "2400",
toast: "2500",
tooltip: "2600",
colorMode: {
forcedColorMode: "light",
},
components: {
InkeepWidgetModal: {
ModalContent: {
styles: {
border: "2px solid #512FC9",
borderRadius: "xl",
top: "88px",
left: "12px",
},
},
tokens: {
fonts: {
heading: lato?.style?.fontFamily,
body: lato?.style?.fontFamily,
},
zIndex: {
overlay: "2100",
modal: "2200",
popover: "2300",
skipLink: "2400",
toast: "2500",
tooltip: "2600",
},
},
},
Expand Down
1 change: 1 addition & 0 deletions layouts/DocsPage/Scopes.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
margin-left: var(--m-4);
padding-left: 0;
list-style: none;
flex-wrap: wrap;

@media (--sm-scr) {
margin-left: 0;
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"@chakra-ui/theme-tools": "^2.0.16",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@inkeep/widgets": "^0.2.186",
"@inkeep/widgets": "^0.2.220",
"@internationalized/date": "^3.5.0",
"@mermaid-js/mermaid-cli": "^10.2.4",
"@next/font": "13.3.0",
"@reach/listbox": "^0.17.0",
Expand All @@ -75,7 +76,7 @@
"@storybook/addon-interactions": "^7.0.27",
"@storybook/addon-viewport": "^7.0.27",
"@storybook/jest": "^0.1.0",
"@storybook/nextjs": "^7.0.27",
"@storybook/nextjs": "^7.6.3",
"@storybook/react": "^7.0.27",
"@storybook/test-runner": "^0.11.0",
"@storybook/testing-library": "^0.2.0",
Expand Down Expand Up @@ -156,6 +157,7 @@
"webpack": "^5.88.1"
},
"resolutions": {
"semver": "^7.5.2"
"semver": "^7.5.2",
"next/@swc/helpers": "0.4.36"
}
}
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ubuntu = localUbuntu({
variable: "--font-ubunt",
display: "swap",
});
const lato = localLato({
export const lato = localLato({
src: [
{
path: "../styles/assets/lato-400.woff2",
Expand Down
Loading

1 comment on commit 0ea9b7d

@vercel
Copy link

@vercel vercel bot commented on 0ea9b7d Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.