diff --git a/components/layouts/globalTemplate.js b/components/layouts/globalTemplate.js index 12361fe1a..2eb1a2e44 100644 --- a/components/layouts/globalTemplate.js +++ b/components/layouts/globalTemplate.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from "react"; import Header from "../navigation/header"; -import ChatSticky from "../navigation/chatSticky"; +import Assistant from "../utilities/assistant"; import styles from "./globalTemplate.module.css"; @@ -26,7 +26,7 @@ const Layout = ({ children }) => {
{children}
- + ); }; diff --git a/components/navigation/chatSticky.js b/components/navigation/chatSticky.js deleted file mode 100644 index 358d805ce..000000000 --- a/components/navigation/chatSticky.js +++ /dev/null @@ -1,17 +0,0 @@ -import classNames from "classnames"; -import Kapa from "../utilities/kapa"; -import styles from "./chatSticky.module.css"; - -const ChatSticky = () => { - return ( -
- -
- ); -}; - -export default ChatSticky; diff --git a/components/navigation/chatSticky.module.css b/components/navigation/chatSticky.module.css deleted file mode 100644 index 37b42c0ce..000000000 --- a/components/navigation/chatSticky.module.css +++ /dev/null @@ -1,11 +0,0 @@ -.Container { - @apply fixed bottom-[30px] w-full z-10; -} - -.Navigation { - @apply container px-2 xl:px-4 flex items-center justify-between relative transition-all mx-auto h-full left-auto; -} - -.NavigationContainer { - @apply flex flex-auto justify-end; -} diff --git a/components/navigation/footer.js b/components/navigation/footer.js index 474b8e874..1f4273704 100644 --- a/components/navigation/footer.js +++ b/components/navigation/footer.js @@ -182,7 +182,7 @@ const Footer = ({ setIsTelemetryModalVisible }) => {
© {new Date().getFullYear()} Snowflake Inc. + + +
+ {children} +
+ +
+ ); +} diff --git a/components/utilities/Modal.module.css b/components/utilities/Modal.module.css new file mode 100644 index 000000000..47cac1d66 --- /dev/null +++ b/components/utilities/Modal.module.css @@ -0,0 +1,29 @@ +.Shim { + @apply fixed inset-0 z-40; + @apply bg-gray-90 bg-opacity-90; + @apply flex items-center justify-center; +} + +.Modal { + @apply relative; + @apply bg-white sm:rounded-xl; + @apply p-8 md:p-12; + @apply overscroll-none; + @apply h-full sm:max-h-[90vh]; + @apply w-full sm:max-w-4xl; + @apply flex flex-col; + @apply gap-4; +} + +.Header { + @apply flex flex-row w-full items-center z-10; +} + +.Content { + @apply overflow-y-auto; + @apply flex-1; +} + +.Title { + @apply flex-1; +} diff --git a/components/utilities/assistant.js b/components/utilities/assistant.js new file mode 100644 index 000000000..383c6706b --- /dev/null +++ b/components/utilities/assistant.js @@ -0,0 +1,40 @@ +import React, { useState, useCallback, useEffect } from "react"; +import styles from "./assistant.module.css"; + +import Modal from "./Modal"; + +const Assistant = () => { + const [assistantVisible, setAssistantVisible] = useState(false); + + const showAssistant = useCallback(() => { + setAssistantVisible(true); + }, []); + + const hideAssistant = useCallback(() => { + setAssistantVisible(false); + }, []); + + return ( + <> +
+ +
+ + {assistantVisible && ( + + + + )} + + ); +}; + +export default Assistant; diff --git a/components/utilities/kapa.module.css b/components/utilities/assistant.module.css similarity index 81% rename from components/utilities/kapa.module.css rename to components/utilities/assistant.module.css index 63fcc5b19..fdb5e1fa6 100644 --- a/components/utilities/kapa.module.css +++ b/components/utilities/assistant.module.css @@ -24,6 +24,7 @@ .AskButtonContainer { @apply flex justify-end; + @apply fixed bottom-4 right-4 sm:bottom-12 sm:right-12 z-20; } .AskButton { @@ -53,14 +54,13 @@ @apply text-gray-100 !important; } -.Tooltip { - @apply hidden absolute top-20 right-[4.5rem] h-8 px-2 pt-0.5 rounded-md bg-gray-20; +.IframeWrapper { + @apply flex-1; + @apply flex; + @apply -mx-8 -mb-8 sm:-mx-12 sm:-mt-12 sm:-mb-4 sm:z-0; } -.Tooltip p { - @apply text-gray-70; -} - -:global(.dark) .Tooltip { - @apply bg-gray-90; +.Iframe { + @apply flex-1; + @apply p-0; } diff --git a/components/utilities/cookieSettingsModal.js b/components/utilities/cookieSettingsModal.js index 25536dfae..fa9432a50 100644 --- a/components/utilities/cookieSettingsModal.js +++ b/components/utilities/cookieSettingsModal.js @@ -3,71 +3,57 @@ import classNames from "classnames"; import content from "../../content/cookie-settings.md"; import styles from "./cookieSettingsModal.module.css"; +import Modal from "./Modal"; +import { useCallback } from "react"; export default function CookieSettingsModal({ setIsTelemetryModalVisible, declineTelemetryAndCloseBanner, allowTelemetryAndCloseBanner, }) { + const closeDialog = useCallback(() => { + setIsTelemetryModalVisible(false); + }, []); + return ( -
-
+
+ + -
- - -
-
+ Accept all + + ); } diff --git a/components/utilities/cookieSettingsModal.module.css b/components/utilities/cookieSettingsModal.module.css index 825ba029a..0bc9feebb 100644 --- a/components/utilities/cookieSettingsModal.module.css +++ b/components/utilities/cookieSettingsModal.module.css @@ -2,6 +2,10 @@ @apply text-gray-90 grid grid-cols-1 gap-4 text-base leading-loose; } +.Content { + @apply overflow-y-auto; +} + .Container h1, .Container h2, .Container h3, diff --git a/components/utilities/kapa.js b/components/utilities/kapa.js deleted file mode 100644 index 31ebafe8e..000000000 --- a/components/utilities/kapa.js +++ /dev/null @@ -1,67 +0,0 @@ -import styles from "./kapa.module.css"; - -const Kapa = () => { - const showTooltip = () => { - let tips = document.getElementsByClassName(styles.Tooltip); - if (tips.length > 0) { - tips[0].style.display = "block"; - } - }; - - const hideTooltip = () => { - let tips = document.getElementsByClassName(styles.Tooltip); - if (tips.length > 0) { - tips[0].style.display = "none"; - } - }; - let kapaWidget = ( -
-
- - {/*
-

Try our new docs assistant!

-
*/} - -
-
- ); - - return kapaWidget; -}; - -export default Kapa; diff --git a/components/utilities/kapaModal.css b/components/utilities/kapaModal.css deleted file mode 100644 index ed2d91488..000000000 --- a/components/utilities/kapaModal.css +++ /dev/null @@ -1,128 +0,0 @@ -.mantine-Modal-overlay { - background-color: rgba(166, 168, 184, 0.6) !important; -} - -.mantine-Paper-root { - @apply bg-white dark:bg-gray-90; -} - -.mantine-Modal-header, -.mantine-Modal-header h3 { - @apply bg-white dark:bg-gray-90 text-gray-90 dark:text-gray-40 border-b-0 font-normal tracking-wide; -} - -.mantine-Modal-header > .mantine-Group-root:first-child .mantine-Image-root { - @apply hidden; -} - -.mantine-Modal-body, -.mantine-Modal-body a, -.mantine-Modal-body .mantine-List-root, -.mantine-Modal-body .mantine-List-item { - @apply bg-white dark:bg-gray-90; - @apply text-gray-90 dark:text-gray-40; -} - -.mantine-Paper-root - > .mantine-Modal-body - > .mantine-Modal-body - > div:first-child - > div:first-child:has(.mantine-Text-root) { - @apply bg-gray-20 dark:bg-gray-80; -} - -.mantine-Paper-root - > .mantine-Modal-body - > .mantine-Modal-body - > div:first-child - > div:first-child - .mantine-Text-root { - @apply text-gray-70 dark:text-gray-50; -} - -.mantine-Group-root button { - @apply text-gray-70; -} - -.mantine-Group-root button:hover { - @apply bg-gray-20 dark:bg-gray-80; -} - -.mantine-Input-input { - @apply bg-white dark:bg-gray-90 border-gray-70 focus:border-orange-70 text-gray-90 dark:text-gray-40; -} - -.mantine-Input-rightSection > .mantine-Group-root > .mantine-ActionIcon-root { - @apply bg-white dark:bg-gray-90 border-none text-orange-70 !important; -} - -.mantine-Input-rightSection - > .mantine-Group-root - > .mantine-ActionIcon-root - svg { - @apply scale-150 hover:scale-[1.6]; -} - -.mantine-Code-root { - @apply bg-transparent border border-gray-40 dark:border-gray-80 rounded-md text-red-70 px-1 mx-1; -} - -.mantine-Grid-root .mantine-Grid-col a { - @apply border-gray-20 dark:border-gray-80 bg-transparent; -} - -.mantine-Grid-root .mantine-Grid-col a:hover { - @apply bg-gray-20 dark:bg-gray-80; -} - -.mantine-Grid-root .mantine-Grid-col div { - @apply text-gray-90 dark:text-gray-40; -} - -.mantine-Grid-root .mantine-Grid-col div.mantine-Tooltip-tooltip { - @apply bg-gray-80 dark:bg-gray-20 text-gray-50 dark:text-gray-70; -} - -.mantine-Popover-dropdown, -.mantine-Popover-arrow { - @apply bg-white dark:bg-gray-90 text-gray-90 dark:text-gray-40; -} - -.mantine-Popover-dropdown .mantine-Button-root { - @apply text-white; -} - -.mantine-Popover-dropdown h5 { - @apply text-gray-90 dark:text-gray-40; -} - -.mantine-Checkbox-input { - @apply bg-gray-20 dark:bg-gray-80 border-gray-70; -} - -.mantine-Checkbox-label { - @apply text-gray-90 dark:text-gray-40; -} - -.mantine-Paper-root - > .mantine-Modal-body - > .mantine-Modal-body - > div:last-child { - @apply text-gray-70; -} - -.mantine-Paper-root - > .mantine-Modal-body - > .mantine-Modal-body - > div:last-child - a { - @apply text-gray-70; -} - -.mantine-Button-icon:has(.tabler-icon-player-stop) { - @apply hidden; -} - -.mantine-Button-root:has(.tabler-icon-player-stop) { - @apply py-0 px-4; -} diff --git a/content/cookie-settings.md b/content/cookie-settings.md index b422adc73..94268f1df 100644 --- a/content/cookie-settings.md +++ b/content/cookie-settings.md @@ -2,8 +2,6 @@ visible: false --- -### Cookie settings - ##### Strictly necessary cookies These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. diff --git a/netlify.toml b/netlify.toml index 287030946..9222f6e4a 100644 --- a/netlify.toml +++ b/netlify.toml @@ -25,7 +25,6 @@ connect-src \ https://px.ads.linkedin.com/ \ https://*.algolia.net/ \ https://*.algolianet.com/ \ - https://kapa-widget-proxy-la7dkmplpq-uc.a.run.app/ \ ; \ default-src 'none' ; \ font-src 'self' ; \ @@ -54,10 +53,6 @@ script-src \ https://connect.facebook.net/ \ https://*.algolia.net/ \ https://*.algolianet.com/ \ - https://widget.kapa.ai/kapa-widget.bundle.js \ - https://www.google.com/recaptcha/api.js \ - https://www.gstatic.com/recaptcha/releases/ \ - https://www.google.com/recaptcha/enterprise.js \ ; \ style-src \ 'self' \ diff --git a/next.config.js b/next.config.js index 525b6f3ab..b695a6206 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,15 @@ const IS_DEV = process.env.NODE_ENV === "development"; +const PROD_OPTIMIZATIONS = IS_DEV + ? {} + : { + experimental: { + workerThreads: true, + cpus: 2, + sharedPool: true, + }, + }; + // IMPORTANT: Keep this in sync with netlify.toml // prettier-ignore const CSP_HEADER = [ @@ -23,11 +33,6 @@ const CSP_HEADER = [ "https://px.ads.linkedin.com/", // LinkedIn ad pixel "https://*.algolia.net/", // Search "https://*.algolianet.com/", // Search - "https://widget.kapa.ai/kapa-widget.bundle.js", // Kapa.ai - "https://kapa-widget-proxy-la7dkmplpq-uc.a.run.app/", // Kapa.ai - "https://www.google.com/recaptcha/api.js", // Recaptcha for Kapa.ai - "https://www.gstatic.com/recaptcha/releases/", // Recaptchas for Kapa.ai - "https://www.google.com/recaptcha/enterprise.js", // Recaptchas for Kapa.ai ";", "default-src 'none';", "font-src 'self';", @@ -56,11 +61,6 @@ const CSP_HEADER = [ "https://connect.facebook.net/", // Facebook ad pixel "https://*.algolia.net/", // Search "https://*.algolianet.com/", // Search - "https://widget.kapa.ai/kapa-widget.bundle.js", // Kapa.ai - "https://kapa-widget-proxy-la7dkmplpq-uc.a.run.app/", // Kapa.ai - "https://www.google.com/recaptcha/api.js", // Recaptcha for Kapa.ai - "https://www.gstatic.com/recaptcha/releases/", // Recaptchas for Kapa.ai - "https://www.google.com/recaptcha/enterprise.js", // Recaptchas for Kapa.ai ";", "style-src", "'self'", @@ -75,6 +75,8 @@ const CSP_HEADER = [ module.exports = { output: "export", + ...PROD_OPTIMIZATIONS, + webpack: (configuration) => { // Don't try to polyfill the fs module. configuration.resolve.fallback = { fs: false }; diff --git a/pages/_app.js b/pages/_app.js index 0eb7a1725..924745a84 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -2,7 +2,6 @@ import { debounce } from "lodash"; import "../styles/globals.css"; import "../components/utilities/searchModal.css"; -import "../components/utilities/kapaModal.css"; import "../styles/main.scss"; import "../public/fonts/styles.css";