diff --git a/.prettierignore b/.prettierignore index 06d04f6a8..16f2e8ff8 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,4 +4,6 @@ dist build coverage package-lock.json -yarn.lock \ No newline at end of file +yarn.lock +# Generated by scripts/api-report.mjs +api-report diff --git a/.sync-ref b/.sync-ref index d7530ca73..b8109c147 100644 --- a/.sync-ref +++ b/.sync-ref @@ -1 +1 @@ -chaibuilder/pro@55058ebe503eb924ba1b9a9829f0a15989989ede +chaibuilder/pro@a4127ad93f51d4f04e4945a035f5845739418ca3 diff --git a/package.json b/package.json index e28a27a11..4d0e5aa94 100644 --- a/package.json +++ b/package.json @@ -256,7 +256,6 @@ "@rjsf/core": "5.24.13", "@rjsf/utils": "5.24.13", "@rjsf/validator-ajv8": "5.24.13", - "@tailwindcss/container-queries": "0.1.1", "@tailwindcss/forms": "0.5.11", "@tailwindcss/typography": "0.5.19", "@tanstack/react-query": "5.90.16", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 21a96368b..973e01059 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,9 +98,6 @@ importers: '@rjsf/validator-ajv8': specifier: 5.24.13 version: 5.24.13(@rjsf/utils@5.24.13(react@19.2.7)) - '@tailwindcss/container-queries': - specifier: 0.1.1 - version: 0.1.1(tailwindcss@4.3.2) '@tailwindcss/forms': specifier: 0.5.11 version: 0.5.11(tailwindcss@4.3.2) @@ -2740,11 +2737,6 @@ packages: '@swc/helpers@0.5.23': resolution: {integrity: sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==} - '@tailwindcss/container-queries@0.1.1': - resolution: {integrity: sha512-p18dswChx6WnTSaJCSGx6lTmrGzNNvm2FtXmiO6AuA1V4U5REyoqwmT6kgAsIMdjo07QdAfYXHJ4hnMtfHzWgA==} - peerDependencies: - tailwindcss: '>=3.2.0' - '@tailwindcss/forms@0.5.11': resolution: {integrity: sha512-h9wegbZDPurxG22xZSoWtdzc41/OlNEUQERNqI/0fOwa2aVlWGu7C35E/x6LDyD3lgtztFSSjKZyuVM0hxhbgA==} peerDependencies: @@ -8764,10 +8756,6 @@ snapshots: dependencies: tslib: 2.8.1 - '@tailwindcss/container-queries@0.1.1(tailwindcss@4.3.2)': - dependencies: - tailwindcss: 4.3.2 - '@tailwindcss/forms@0.5.11(tailwindcss@4.3.2)': dependencies: mini-svg-data-uri: 1.4.4 diff --git a/src-sync.exclude b/src-sync.exclude index b15c58273..d22645580 100644 --- a/src-sync.exclude +++ b/src-sync.exclude @@ -5,6 +5,7 @@ # Read by scripts/sync-src.mjs and scripts/sync-check.mjs. Edit in both repos in the same change. /edition/ /payload/ +/plugins/ai-advanced/ /plugins/ai-pro/ /plugins/animation/ /plugins/bulk-publish/ diff --git a/src/ai/openai-compatible.deprecated.ts b/src/ai/openai-compatible.deprecated.ts new file mode 100644 index 000000000..781da1630 --- /dev/null +++ b/src/ai/openai-compatible.deprecated.ts @@ -0,0 +1,12 @@ +/** + * Deprecated names of `/ai/openai-compatible`, re-exported by `./openai-compatible.ts`. + * + * chaipro makes no breaking changes: a renamed or retired export keeps working from its original + * import path, with a `@deprecated` notice that names its replacement. Never delete an entry here. + * See API-CONSISTENCY.md. + */ + +export { + /** @deprecated Use `openAiCompatiblePlugin` from `/ai/openai-compatible`. Kept for compatibility. */ + openAiCompatiblePlugin as openAICompatiblePlugin, +} from "~/ai/openai-compatible"; diff --git a/src/ai/openai-compatible.test.ts b/src/ai/openai-compatible.test.ts index 880ac4c36..a99072097 100644 --- a/src/ai/openai-compatible.test.ts +++ b/src/ai/openai-compatible.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from "vitest"; -import { openAICompatiblePlugin } from "./openai-compatible"; +import { openAiCompatiblePlugin } from "./openai-compatible"; const createOpenAICompatible = vi.hoisted(() => vi.fn((_options: Record) => ({ languageModel: (id: string) => ({ id }) })), @@ -14,33 +14,33 @@ afterEach(() => { describe("openAICompatiblePlugin (static SDK import)", () => { it("matches the built-in plugin's identity, so error messages stay the same", () => { - expect(openAICompatiblePlugin.id).toBe("openai-compatible"); - expect(openAICompatiblePlugin.label).toBe("OpenAI-compatible"); - expect(openAICompatiblePlugin.packageName).toBe("@ai-sdk/openai-compatible"); + expect(openAiCompatiblePlugin.id).toBe("openai-compatible"); + expect(openAiCompatiblePlugin.label).toBe("OpenAI-compatible"); + expect(openAiCompatiblePlugin.packageName).toBe("@ai-sdk/openai-compatible"); }); it("activates on the base URL — without it the AI gateway keeps serving requests", () => { vi.stubEnv("OPENAI_COMPATIBLE_BASE_URL", "https://router.huggingface.co/v1"); - expect(openAICompatiblePlugin.isConfigured()).toBe(true); + expect(openAiCompatiblePlugin.isConfigured()).toBe(true); vi.stubEnv("OPENAI_COMPATIBLE_BASE_URL", ""); - expect(openAICompatiblePlugin.isConfigured()).toBe(false); + expect(openAiCompatiblePlugin.isConfigured()).toBe(false); }); it("rebuilds when the endpoint or key changes", () => { vi.stubEnv("OPENAI_COMPATIBLE_BASE_URL", "http://localhost:11434/v1"); - const first = openAICompatiblePlugin.fingerprint?.(); + const first = openAiCompatiblePlugin.fingerprint?.(); vi.stubEnv("OPENAI_COMPATIBLE_API_KEY", "sk-1"); - expect(openAICompatiblePlugin.fingerprint?.()).not.toBe(first); + expect(openAiCompatiblePlugin.fingerprint?.()).not.toBe(first); }); it("builds the provider from the endpoint, with the default label", async () => { vi.stubEnv("OPENAI_COMPATIBLE_BASE_URL", "https://api.groq.com/openai/v1"); vi.stubEnv("OPENAI_COMPATIBLE_API_KEY", "sk-1"); - const provider = await openAICompatiblePlugin.createProvider(); + const provider = await openAiCompatiblePlugin.createProvider(); expect(createOpenAICompatible).toHaveBeenCalledWith({ name: "openai-compatible", @@ -55,7 +55,7 @@ describe("openAICompatiblePlugin (static SDK import)", () => { vi.stubEnv("OPENAI_COMPATIBLE_API_KEY", ""); vi.stubEnv("OPENAI_COMPATIBLE_NAME", "ollama"); - await openAICompatiblePlugin.createProvider(); + await openAiCompatiblePlugin.createProvider(); const options = createOpenAICompatible.mock.calls[0][0]; expect(options.name).toBe("ollama"); diff --git a/src/ai/openai-compatible.ts b/src/ai/openai-compatible.ts index d19327862..d06458a04 100644 --- a/src/ai/openai-compatible.ts +++ b/src/ai/openai-compatible.ts @@ -38,7 +38,7 @@ import { } from "~/server/chai-actions/ai-providers/openai-compatible-options"; import type { ChaiAiProviderPlugin, ChaiAiSdkProvider } from "~/types/server-config"; -export const openAICompatiblePlugin: ChaiAiProviderPlugin = { +export const openAiCompatiblePlugin: ChaiAiProviderPlugin = { id: OPENAI_COMPATIBLE_PLUGIN_ID, label: OPENAI_COMPATIBLE_PLUGIN_LABEL, packageName: OPENAI_COMPATIBLE_PACKAGE, @@ -46,3 +46,6 @@ export const openAICompatiblePlugin: ChaiAiProviderPlugin = { fingerprint: openAICompatibleFingerprint, createProvider: (): ChaiAiSdkProvider => createOpenAICompatible(openAICompatibleOptions()) as ChaiAiSdkProvider, }; + +// Deprecated names, kept for compatibility. See ./openai-compatible.deprecated.ts. +export * from "./openai-compatible.deprecated"; diff --git a/src/builder/core/components/QuickPrompts.tsx b/src/builder/core/components/QuickPrompts.tsx index 1a01f2c23..7fab127c1 100644 --- a/src/builder/core/components/QuickPrompts.tsx +++ b/src/builder/core/components/QuickPrompts.tsx @@ -13,7 +13,7 @@ import { useTranslation } from "react-i18next"; import { useAskAi } from "~/builder/hooks/use-ask-ai"; import { useLanguages } from "~/builder/hooks/use-languages"; import { Popover, PopoverContent, PopoverTrigger } from "~/components/ui/popover"; -import { LANGUAGES } from "~/constants/LANGUAGES"; +import { CHAI_LANGUAGES } from "~/constants/LANGUAGES"; export function QuickPrompts({ onClick }: { onClick: (prompt: string) => void }) { const { loading } = useAskAi(); @@ -64,11 +64,11 @@ export function QuickPrompts({ onClick }: { onClick: (prompt: string) => void }) if (selectedLang && selectedLang !== fallbackLang) { quickPrompts.splice(0, 0, { name: t(`Translate to {{lang}}`, { - lang: get(LANGUAGES, selectedLang, selectedLang), + lang: get(CHAI_LANGUAGES, selectedLang, selectedLang), }), icon: ChatBubbleIcon, prompt: t(`Translate the content to {{lang}}. Maintain same tone, style and length.`, { - lang: get(LANGUAGES, selectedLang, selectedLang), + lang: get(CHAI_LANGUAGES, selectedLang, selectedLang), }), }); } @@ -96,7 +96,7 @@ export function QuickPrompts({ onClick }: { onClick: (prompt: string) => void }) ) : (
  • onClick(prompt)} - className="flex cursor-pointer items-center space-x-2 rounded p-1 text-xs hover:bg-primary/10 hover:text-primary dark:hover:bg-gray-800" + className="hover:bg-primary/10 hover:text-primary flex cursor-pointer items-center space-x-2 rounded p-1 text-xs dark:hover:bg-gray-800" key={name}> {t(name)} diff --git a/src/builder/core/components/binding-popup/path-dropdown.tsx b/src/builder/core/components/binding-popup/path-dropdown.tsx index e5b8051b4..20c155d1d 100644 --- a/src/builder/core/components/binding-popup/path-dropdown.tsx +++ b/src/builder/core/components/binding-popup/path-dropdown.tsx @@ -6,7 +6,7 @@ import { useBuilderProp } from "~/builder/hooks/use-builder-prop"; import { Button } from "~/components/ui/button"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "~/components/ui/command"; import { COLLECTION_PREFIX } from "~/constants/STRINGS"; -import type { ChaiCollection } from "~/types/collections"; +import type { ChaiCollection } from "~/types/deprecated"; import { BindingOptionRow, type BindingOptionIcon } from "./binding-option-row"; import { compareBindingFieldNames, diff --git a/src/builder/core/components/canvas/IframeInitialContent.test.ts b/src/builder/core/components/canvas/IframeInitialContent.test.ts index c07ef179a..e33db2d23 100644 --- a/src/builder/core/components/canvas/IframeInitialContent.test.ts +++ b/src/builder/core/components/canvas/IframeInitialContent.test.ts @@ -1,47 +1,27 @@ import { describe, expect, it } from "vitest"; -import { getIframeInitialContent, TAILWIND_CDN_URLS, TAILWIND_THEME_STYLE_ID } from "./IframeInitialContent"; +import { getIframeInitialContent, TAILWIND_CDN_URL, TAILWIND_THEME_STYLE_ID } from "./IframeInitialContent"; describe("getIframeInitialContent", () => { - it("defaults to Tailwind v4 CDN", () => { + it("loads the Tailwind v4 browser build", () => { const html = getIframeInitialContent(); - expect(html).toContain(TAILWIND_CDN_URLS["4"]); - expect(html).toContain(`src="${TAILWIND_CDN_URLS["4"]}"`); + expect(TAILWIND_CDN_URL).toContain("@tailwindcss/browser@4"); + expect(html).toContain(`src="${TAILWIND_CDN_URL}"`); + expect(html).not.toContain("cdn.tailwindcss.com"); expect(html).not.toContain("__TAILWIND_CDN__"); expect(html).not.toContain("__HTML_DIR__"); }); - it("uses the v3 CDN when tailwindCSS is 3", () => { - const html = getIframeInitialContent({ tailwindCSS: "3" }); - - expect(html).toContain(TAILWIND_CDN_URLS["3"]); - expect(html).toContain("cdn.tailwindcss.com"); - expect(html).not.toContain(TAILWIND_CDN_URLS["4"]); - }); - it("sets html dir for rtl layouts", () => { - const html = getIframeInitialContent({ htmlDir: "rtl", tailwindCSS: "4" }); + const html = getIframeInitialContent({ htmlDir: "rtl" }); expect(html).toContain('dir="rtl"'); - expect(html).toContain(TAILWIND_CDN_URLS["4"]); - }); - - it("exposes distinct CDN URLs for v3 and v4", () => { - expect(TAILWIND_CDN_URLS["3"]).toContain("cdn.tailwindcss.com"); - expect(TAILWIND_CDN_URLS["4"]).toContain("@tailwindcss/browser"); - expect(TAILWIND_CDN_URLS["3"]).not.toBe(TAILWIND_CDN_URLS["4"]); - }); - - it("keeps the config-driven @apply base rule on v3", () => { - const html = getIframeInitialContent({ tailwindCSS: "3" }); - - expect(html).toContain("@apply border-border;"); - expect(html).not.toContain("__TAILWIND_STYLE__"); + expect(html).toContain(TAILWIND_CDN_URL); }); // The v4 browser build drops the whole sheet when one utility is unknown. - it("compiles standalone on v4 without theme-dependent utilities in base", () => { - const html = getIframeInitialContent({ tailwindCSS: "4" }); + it("compiles standalone without theme-dependent utilities in base", () => { + const html = getIframeInitialContent(); expect(html).toContain("@custom-variant dark (&:where(.dark, .dark *));"); expect(html).toContain("border-color: var(--color-border, currentColor);"); @@ -51,23 +31,20 @@ describe("getIframeInitialContent", () => { // Spelling out the import makes the browser resolve "tailwindcss" as a relative URL and 404; // the build injects it for us when the concatenated CSS has no @import of its own. - it("leaves the tailwindcss import to the v4 browser build", () => { - expect(getIframeInitialContent({ tailwindCSS: "4" })).not.toContain("@import"); + it("leaves the tailwindcss import to the browser build", () => { + expect(getIframeInitialContent()).not.toContain("@import"); }); - it("ships an empty theme placeholder on v4 for TailwindV4Theme to fill", () => { - const html = getIframeInitialContent({ tailwindCSS: "4" }); + it("ships an empty theme placeholder for TailwindV4Theme to fill", () => { + const html = getIframeInitialContent(); expect(html).toContain(``); - expect(getIframeInitialContent({ tailwindCSS: "3" })).not.toContain(TAILWIND_THEME_STYLE_ID); }); - it("ships the rte utilities on both versions", () => { - for (const tailwindCSS of ["3", "4"] as const) { - const html = getIframeInitialContent({ tailwindCSS }); + it("ships the rte utilities", () => { + const html = getIframeInitialContent(); - expect(html).toContain('`; - // The v4 browser build concatenates every `style[type="text/tailwindcss"]` into a single // compile. One unknown utility fails the whole sheet, so base styles here stay on plain CSS // vars; theme-dependent utilities come from the `@theme` block written into the placeholder // below. The typography and forms plugins the page CSS compiles with arrive pre-rewritten as // `@utility` / `@custom-variant` rules (the browser build cannot load npm plugins). No `@import "tailwindcss"` here on purpose: the build prepends it when no @import is // present, and spelling it out makes the browser fetch the bare specifier as a relative URL. -const TAILWIND_V4_STYLE = ``; -export const TAILWIND_CDN_URLS: Record = { - "3": "https://cdn.tailwindcss.com/3.4.17?plugins=forms@0.5.9,typography@0.5.15,aspect-ratio@0.4.2", - "4": "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4", -}; - -const TAILWIND_STYLES: Record = { - "3": TAILWIND_V3_STYLE, - "4": TAILWIND_V4_STYLE, -}; +export const TAILWIND_CDN_URL = "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"; -export const getIframeInitialContent = ({ - htmlDir = "ltr", - tailwindCSS = "4", -}: { - htmlDir?: "ltr" | "rtl" | string; - tailwindCSS?: TailwindCSSVersion; -} = {}): string => +export const getIframeInitialContent = ({ htmlDir = "ltr" }: { htmlDir?: "ltr" | "rtl" | string } = {}): string => IframeInitialContent.replace("__HTML_DIR__", htmlDir) - .replace("__TAILWIND_CDN__", TAILWIND_CDN_URLS[tailwindCSS]) - .replace("__TAILWIND_STYLE__", TAILWIND_STYLES[tailwindCSS]); + .replace("__TAILWIND_CDN__", TAILWIND_CDN_URL) + .replace("__TAILWIND_STYLE__", TAILWIND_STYLE); diff --git a/src/builder/core/components/canvas/dnd/drag-and-drop/hooks/use-block-drop.ts b/src/builder/core/components/canvas/dnd/drag-and-drop/hooks/use-block-drop.ts index 519db9509..cac266cba 100644 --- a/src/builder/core/components/canvas/dnd/drag-and-drop/hooks/use-block-drop.ts +++ b/src/builder/core/components/canvas/dnd/drag-and-drop/hooks/use-block-drop.ts @@ -33,7 +33,7 @@ import { useCheckPartialCanAdd } from "~/builder/hooks/use-partial-blocks-store" import { useSelectedBlockIds } from "~/builder/hooks/use-selected-blockIds"; import { useSelectedStylingBlocks } from "~/builder/hooks/use-selected-styling-blocks"; import { useUpdateBlocksProps } from "~/builder/hooks/use-update-blocks-props"; -import { syncBlocksWithDefaultProps } from "~/registry"; +import { syncChaiBlocksWithDefaultProps } from "~/registry"; import { ChaiBlock } from "~/types/common"; /** @@ -203,7 +203,7 @@ export const useBlockDrop = () => { const preBlocks = !dropBlock?.blocks ? null : isFunction(dropBlock?.blocks) - ? syncBlocksWithDefaultProps(dropBlock?.blocks()) + ? syncChaiBlocksWithDefaultProps(dropBlock?.blocks()) : dropBlock?.blocks; if (draggedBlockType === "PartialBlock") { diff --git a/src/builder/core/components/canvas/static/chai-theme-helpers.ts b/src/builder/core/components/canvas/static/chai-theme-helpers.ts index e6281357c..407eb7f9d 100644 --- a/src/builder/core/components/canvas/static/chai-theme-helpers.ts +++ b/src/builder/core/components/canvas/static/chai-theme-helpers.ts @@ -1,21 +1,7 @@ import { flatten, get, keys, uniq, uniqBy } from "lodash-es"; -import { resolveFont } from "~/registry/fonts"; +import { resolveChaiFont } from "~/registry/fonts"; import type { ChaiFontBySrc, ChaiFontByUrl } from "~/types"; import type { ChaiTheme, ChaiThemeOptions } from "~/types/chaibuilder-editor-props"; -import { V3_COMPAT_CSS } from "~/utils/tailwind-v3-compat"; - -/** - * Tailwind v3 values for the utilities v4 rescaled, so content authored under v3 renders - * unchanged: `shadow-sm`, `drop-shadow-sm`, `blur-sm`/`backdrop-blur-sm` and a bare `ring`'s - * width. Applied to both the page CSS (JS theme below) and the canvas (`@theme` in - * getChaiThemeCssTheme). The rest of the v3 deltas need CSS: see V3_COMPAT_CSS. - */ -export const V3_SCALE = { - shadowSm: "0 1px 2px 0 rgb(0 0 0 / 0.05)", - dropShadowSm: "0 1px 1px rgb(0 0 0 / 0.05)", - blurSm: "4px", - ringWidth: "3px", -}; export const getChaiThemeOptions = (chaiThemeOptions: ChaiThemeOptions) => { const theme = { @@ -41,11 +27,6 @@ export const getChaiThemeOptions = (chaiThemeOptions: ChaiThemeOptions) => { {}, ) : {}, - boxShadow: { sm: V3_SCALE.shadowSm }, - dropShadow: { sm: V3_SCALE.dropShadowSm }, - blur: { sm: V3_SCALE.blurSm }, - backdropBlur: { sm: V3_SCALE.blurSm }, - ringWidth: { DEFAULT: V3_SCALE.ringWidth }, }; return theme; }; @@ -74,10 +55,6 @@ export const getChaiThemeCssTheme = (chaiThemeOptions: ChaiThemeOptions): string ] : []), ...colorKeys.map((key) => `--color-${key}: hsl(var(--${key}));`), - `--shadow-sm: ${V3_SCALE.shadowSm};`, - `--drop-shadow-sm: ${V3_SCALE.dropShadowSm};`, - `--blur-sm: ${V3_SCALE.blurSm};`, - `--default-ring-width: ${V3_SCALE.ringWidth};`, ]; return `:root { @@ -106,8 +83,7 @@ export const getChaiThemeCssTheme = (chaiThemeOptions: ChaiThemeOptions): string color: hsl(var(--foreground)); background-color: hsl(var(--background)); } - } - ${V3_COMPAT_CSS}`; + }`; }; export function hexToHSL(hex: string) { @@ -144,7 +120,7 @@ export function hexToHSL(hex: string) { } export const getFontFamily = (font: string) => { - const fallback = get(resolveFont(font), "fallback", ""); + const fallback = get(resolveChaiFont(font), "fallback", ""); // A font with no fallback would otherwise leave a trailing comma, which makes the whole // font-family declaration invalid and silently drops the font. return fallback ? `"${font}", ${fallback}` : `"${font}"`; @@ -180,7 +156,7 @@ export const getChaiThemeCssVariables = ({ theme }: { theme: ChaiTheme }) => { }`; }; -export const getThemeFontsLinkMarkup = (fonts: ChaiFontByUrl[]) => { +export const getChaiThemeFontsLinkMarkup = (fonts: ChaiFontByUrl[]) => { if (!fonts || fonts.length === 0) return ""; return uniqBy(fonts, "family") @@ -196,7 +172,7 @@ export const getThemeFontsUrls = (fonts: ChaiFontByUrl[]) => { return uniq(uniqBy(fonts, "family").map((font: ChaiFontByUrl) => font.url)); }; -export const getThemeFontsCSSImport = (fonts: ChaiFontByUrl[]) => { +export const getChaiThemeFontsCssImport = (fonts: ChaiFontByUrl[]) => { if (!fonts || fonts.length === 0) return ""; return uniqBy(fonts, "family") diff --git a/src/builder/core/components/canvas/static/code-editor.tsx b/src/builder/core/components/canvas/static/code-editor.tsx index e48d0b2c6..c9fe80c66 100644 --- a/src/builder/core/components/canvas/static/code-editor.tsx +++ b/src/builder/core/components/canvas/static/code-editor.tsx @@ -9,7 +9,7 @@ import { useSelectedBlockIds } from "~/builder/hooks/use-selected-blockIds"; import { useUpdateBlocksProps, useUpdateBlocksPropsRealtime } from "~/builder/hooks/use-update-blocks-props"; import { Dialog, DialogContent, DialogHeader, DialogTitle } from "~/components/ui/dialog"; import { Textarea } from "~/components/ui/textarea"; -import { LANGUAGES } from "~/constants/LANGUAGES"; +import { CHAI_LANGUAGES } from "~/constants/LANGUAGES"; /** * Try to fix the HTML code @@ -30,7 +30,7 @@ export default function CodeEditor() { const updateBlockProps = useUpdateBlocksProps(); const updateRealTime = useUpdateBlocksPropsRealtime(); const { selectedLang } = useLanguages(); - const currentLanguage = useMemo(() => get(LANGUAGES, selectedLang, selectedLang), [selectedLang]); + const currentLanguage = useMemo(() => get(CHAI_LANGUAGES, selectedLang, selectedLang), [selectedLang]); const saveCodeContentRealTime = useThrottledCallback( (value: string) => { if (!codeEditor) return; @@ -63,18 +63,18 @@ export default function CodeEditor() { return ( - +

    {t("HTML Code Editor")}

    -
    - {currentLanguage && {currentLanguage}} +
    + {currentLanguage && {currentLanguage}} {t("Scripts will be only executed in preview and live mode.")}
    -
    +