@intlayer/design-system 8.7.9 → 8.7.11-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
- package/dist/esm/components/IDE/Code.mjs +5 -4
- package/dist/esm/components/IDE/Code.mjs.map +1 -1
- package/dist/esm/components/IDE/CodeConditionalRenderer.mjs +3 -2
- package/dist/esm/components/IDE/CodeConditionalRenderer.mjs.map +1 -1
- package/dist/esm/hooks/useAuth/useOAuth2.mjs +1 -1
- package/dist/esm/hooks/useAuth/useSession.mjs +1 -1
- package/dist/types/components/Badge/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
- package/dist/types/components/Command/index.d.ts +2 -2
- package/dist/types/components/Container/index.d.ts +5 -5
- package/dist/types/components/IDE/Code.d.ts +3 -3
- package/dist/types/components/IDE/Code.d.ts.map +1 -1
- package/dist/types/components/IDE/CodeConditionalRenderer.d.ts.map +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +2 -2
- package/dist/types/components/Tag/index.d.ts +1 -1
- package/package.json +19 -19
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Button, ButtonColor, ButtonTextAlign, ButtonVariant } from "../../Button/Button.mjs";
|
|
2
2
|
import { Accordion } from "../../Accordion/Accordion.mjs";
|
|
3
3
|
import { getIsEditableSection } from "../getIsEditableSection.mjs";
|
|
4
|
+
import { internationalization } from "@intlayer/config/built";
|
|
4
5
|
import { ChevronRight, Plus } from "lucide-react";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { internationalization } from "@intlayer/config/built";
|
|
7
7
|
import { useIntlayer } from "react-intlayer";
|
|
8
8
|
import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
9
9
|
import { getContentNodeByKeyPath, getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
@@ -18,15 +18,16 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
const MIN_HEIGHT = 700;
|
|
19
19
|
/** Languages that use JSX syntax — CommonJS doesn't make sense for these. */
|
|
20
20
|
const JSX_LANGUAGES = new Set(["tsx", "jsx"]);
|
|
21
|
-
/** Parse a codeFormat prop that may be a single value
|
|
22
|
-
|
|
21
|
+
/** Parse a codeFormat prop that may be a single value, a JSON-array string, or already an array. */
|
|
22
|
+
const parseFormats = (raw) => {
|
|
23
23
|
if (!raw) return void 0;
|
|
24
|
-
if (
|
|
24
|
+
if (Array.isArray(raw)) return raw;
|
|
25
|
+
if (typeof raw === "string" && raw.startsWith("[")) try {
|
|
25
26
|
const parsed = JSON.parse(raw);
|
|
26
27
|
if (Array.isArray(parsed)) return parsed;
|
|
27
28
|
} catch {}
|
|
28
29
|
return [raw];
|
|
29
|
-
}
|
|
30
|
+
};
|
|
30
31
|
const Code = ({ children, language, isDarkMode, showHeader = true, showLineNumbers = true, className, fileName, packageManager, codeFormat: rawCodeFormat, contentDeclarationFormat: rawContentDeclarationFormat, isRollable = true, ...props }) => {
|
|
31
32
|
const { codeFormat: selectedCodeFormat, contentDeclarationFormat: selectedContentDeclarationFormat } = useCodeContext();
|
|
32
33
|
const codeFormats = useMemo(() => parseFormats(rawCodeFormat), [rawCodeFormat]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.mjs","names":[],"sources":["../../../../src/components/IDE/Code.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes } from 'react';\nimport { useEffect, useMemo, useState } from 'react';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { Container } from '../Container';\nimport { ExpandCollapse } from '../ExpandCollapse';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeBlockHighlight } from './CodeBlockHighlight';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n CodeFormat,\n ContentDeclarationFormat,\n PackageManager,\n} from './CodeContext';\nimport { useCodeContext } from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyCode } from './CopyCode';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n /** Single format, or a JSON-array string like `[\"typescript\",\"esm\",\"commonjs\"]`. */\n codeFormat?: CodeFormat | string;\n contentDeclarationFormat?: ContentDeclarationFormat | string;\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n isRollable?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nconst MIN_HEIGHT = 700;\n\n/** Languages that use JSX syntax — CommonJS doesn't make sense for these. */\nconst JSX_LANGUAGES = new Set(['tsx', 'jsx']);\n\n/** Parse a codeFormat prop that may be a single value or a JSON-array string. */\nfunction parseFormats(raw: string | undefined): CodeFormat[] | undefined {\n if (!raw) return undefined;\n if (raw.startsWith('[')) {\n try {\n const parsed = JSON.parse(raw);\n if (Array.isArray(parsed)) return parsed as CodeFormat[];\n } catch {\n /* ignore */\n }\n }\n return [raw as CodeFormat];\n}\n\nexport const Code: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat: rawCodeFormat,\n contentDeclarationFormat: rawContentDeclarationFormat,\n isRollable = true,\n ...props\n}) => {\n const {\n codeFormat: selectedCodeFormat,\n contentDeclarationFormat: selectedContentDeclarationFormat,\n } = useCodeContext();\n\n // Parse whichever attribute is present as an array of formats.\n const codeFormats = useMemo(\n () => parseFormats(rawCodeFormat as string | undefined),\n [rawCodeFormat]\n );\n const contentFormats = useMemo(\n () => parseFormats(rawContentDeclarationFormat as string | undefined),\n [rawContentDeclarationFormat]\n );\n\n // A block is \"multi-format\" when it has multiple formats including TypeScript\n // (the canonical source). Such blocks transform at runtime.\n const isMultiCodeFormat =\n codeFormats !== undefined &&\n codeFormats.length > 1 &&\n codeFormats.includes('typescript');\n\n const isMultiContentFormat =\n contentFormats !== undefined &&\n contentFormats.length > 1 &&\n contentFormats.includes('typescript');\n\n const isMultiFormat = isMultiCodeFormat || isMultiContentFormat;\n\n // Determine which context format drives this block's selection.\n // content declaration blocks use selectedContentDeclarationFormat;\n // regular code blocks use selectedCodeFormat.\n const selectedFormat: CodeFormat = isMultiContentFormat\n ? (selectedContentDeclarationFormat as CodeFormat)\n : selectedCodeFormat;\n\n // The formats actually relevant for transformation (no 'json', no 'commonjs' for JSX).\n const effectiveFormats = useMemo<CodeFormat[] | undefined>(() => {\n const base = isMultiContentFormat ? contentFormats : codeFormats;\n if (!base) return base;\n let filtered = base.filter((f) => f !== 'json') as CodeFormat[];\n if (JSX_LANGUAGES.has(language as string)) {\n filtered = filtered.filter((f) => f !== 'commonjs');\n }\n return filtered;\n }, [isMultiContentFormat, contentFormats, codeFormats, language]);\n\n // When the globally-selected format isn't valid for this block\n // (e.g. CJS selected but this is a JSX file), fall back to the last valid one.\n const resolvedFormat: Exclude<CodeFormat, 'json'> = useMemo(() => {\n if (!effectiveFormats || effectiveFormats.includes(selectedFormat)) {\n return selectedFormat as Exclude<CodeFormat, 'json'>;\n }\n return (\n effectiveFormats[effectiveFormats.length - 1] ?? 'typescript'\n ) as Exclude<CodeFormat, 'json'>;\n }, [effectiveFormats, selectedFormat]);\n\n // ── Async filename derivation (dynamic import of transformer) ──────────────\n // We derive the displayed fileName so the header updates when format changes.\n // deriveFileName is tiny but it lives inside codeTransformer, which is only\n // imported when actually needed (non-TypeScript selection).\n const [displayedFileName, setDisplayedFileName] = useState<\n string | undefined\n >(fileName);\n\n useEffect(() => {\n if (!isMultiFormat || resolvedFormat === 'typescript') {\n setDisplayedFileName(fileName);\n return;\n }\n if (!fileName) return;\n\n let cancelled = false;\n (async () => {\n const { deriveFileName } = await import('./codeTransformer');\n if (!cancelled) setDisplayedFileName(deriveFileName(fileName, resolvedFormat));\n })();\n return () => { cancelled = true; };\n }, [fileName, isMultiFormat, resolvedFormat]);\n\n // ── Async copy text (transformed code for CopyCode) ───────────────────────\n const rawCode = useMemo(\n () => (children?.endsWith('\\n') ? children.slice(0, -1) : children),\n [children]\n );\n\n const [copyCode, setCopyCode] = useState<string>(rawCode);\n\n useEffect(() => {\n if (!isMultiFormat || resolvedFormat === 'typescript') {\n setCopyCode(rawCode);\n return;\n }\n let cancelled = false;\n (async () => {\n const { transformCode } = await import('./codeTransformer');\n if (!cancelled) setCopyCode(transformCode(rawCode, resolvedFormat));\n })();\n return () => { cancelled = true; };\n }, [rawCode, isMultiFormat, resolvedFormat]);\n\n const hadSelectInHeader =\n packageManager || rawCodeFormat || rawContentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={rawCodeFormat as string | undefined}\n contentDeclarationFormat={\n rawContentDeclarationFormat as string | undefined\n }\n >\n <Container\n className={cn(\n 'relative min-w-0 max-w-full text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl bg-card/50 py-1.5 pr-12 pl-4 text-neutral text-xs\">\n <span className=\"truncate\">\n {displayedFileName ?? language}\n </span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {rawCodeFormat && (\n <CodeFormatSelector availableFormats={effectiveFormats} />\n )}\n {rawContentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-46 z-20\">\n <div\n className={cn(\n 'absolute right-2 bottom-0 flex h-7 items-center',\n hadSelectInHeader && 'h-11'\n )}\n >\n <CopyCode code={copyCode} />\n </div>\n </div>\n </>\n )}\n <ExpandCollapse\n minHeight={MIN_HEIGHT}\n isRollable={isRollable}\n className=\"min-w-0 max-w-full overflow-x-auto p-2\"\n >\n {isMultiFormat ? (\n /*\n * Multi-format: CodeBlockHighlight manages both the transformation\n * (dynamic import of codeTransformer) and the Shiki highlighting in\n * a single useEffect. The previous highlighted output stays visible\n * while the new one loads — no white-text flash.\n */\n <CodeBlockHighlight\n originalLang={language}\n targetFormat={resolvedFormat}\n isDarkMode={isDarkMode}\n >\n {rawCode}\n </CodeBlockHighlight>\n ) : (\n /*\n * Single-format: use the original Suspense-based async Shiki renderer\n * (good for SSR / static content).\n */\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {rawCode}\n </CodeBlock>\n )}\n </ExpandCollapse>\n </Container>\n </CodeConditionalRender>\n );\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Code.mjs","names":[],"sources":["../../../../src/components/IDE/Code.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes } from 'react';\nimport { useEffect, useMemo, useState } from 'react';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { Container } from '../Container';\nimport { ExpandCollapse } from '../ExpandCollapse';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeBlockHighlight } from './CodeBlockHighlight';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n CodeFormat,\n ContentDeclarationFormat,\n PackageManager,\n} from './CodeContext';\nimport { useCodeContext } from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyCode } from './CopyCode';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n /** Single format, a JSON-array string, or an array of formats. */\n codeFormat?: CodeFormat | string | string[];\n contentDeclarationFormat?: ContentDeclarationFormat | string | string[];\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n isRollable?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nconst MIN_HEIGHT = 700;\n\n/** Languages that use JSX syntax — CommonJS doesn't make sense for these. */\nconst JSX_LANGUAGES = new Set(['tsx', 'jsx']);\n\n/** Parse a codeFormat prop that may be a single value, a JSON-array string, or already an array. */\nconst parseFormats = (\n raw: string | string[] | undefined\n): CodeFormat[] | undefined => {\n if (!raw) return undefined;\n if (Array.isArray(raw)) return raw as CodeFormat[];\n if (typeof raw === 'string' && raw.startsWith('[')) {\n try {\n const parsed = JSON.parse(raw);\n if (Array.isArray(parsed)) return parsed as CodeFormat[];\n } catch {\n /* ignore */\n }\n }\n return [raw as CodeFormat];\n};\n\nexport const Code: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat: rawCodeFormat,\n contentDeclarationFormat: rawContentDeclarationFormat,\n isRollable = true,\n ...props\n}) => {\n const {\n codeFormat: selectedCodeFormat,\n contentDeclarationFormat: selectedContentDeclarationFormat,\n } = useCodeContext();\n\n // Parse whichever attribute is present as an array of formats.\n const codeFormats = useMemo(\n () => parseFormats(rawCodeFormat as string | undefined),\n [rawCodeFormat]\n );\n const contentFormats = useMemo(\n () => parseFormats(rawContentDeclarationFormat as string | undefined),\n [rawContentDeclarationFormat]\n );\n\n // A block is \"multi-format\" when it has multiple formats including TypeScript\n // (the canonical source). Such blocks transform at runtime.\n const isMultiCodeFormat =\n codeFormats !== undefined &&\n codeFormats.length > 1 &&\n codeFormats.includes('typescript');\n\n const isMultiContentFormat =\n contentFormats !== undefined &&\n contentFormats.length > 1 &&\n contentFormats.includes('typescript');\n\n const isMultiFormat = isMultiCodeFormat || isMultiContentFormat;\n\n // Determine which context format drives this block's selection.\n // content declaration blocks use selectedContentDeclarationFormat;\n // regular code blocks use selectedCodeFormat.\n const selectedFormat: CodeFormat = isMultiContentFormat\n ? (selectedContentDeclarationFormat as CodeFormat)\n : selectedCodeFormat;\n\n // The formats actually relevant for transformation (no 'json', no 'commonjs' for JSX).\n const effectiveFormats = useMemo<CodeFormat[] | undefined>(() => {\n const base = isMultiContentFormat ? contentFormats : codeFormats;\n if (!base) return base;\n let filtered = base.filter((f) => f !== 'json') as CodeFormat[];\n if (JSX_LANGUAGES.has(language as string)) {\n filtered = filtered.filter((f) => f !== 'commonjs');\n }\n return filtered;\n }, [isMultiContentFormat, contentFormats, codeFormats, language]);\n\n // When the globally-selected format isn't valid for this block\n // (e.g. CJS selected but this is a JSX file), fall back to the last valid one.\n const resolvedFormat: Exclude<CodeFormat, 'json'> = useMemo(() => {\n if (!effectiveFormats || effectiveFormats.includes(selectedFormat)) {\n return selectedFormat as Exclude<CodeFormat, 'json'>;\n }\n return (effectiveFormats[effectiveFormats.length - 1] ??\n 'typescript') as Exclude<CodeFormat, 'json'>;\n }, [effectiveFormats, selectedFormat]);\n\n // ── Async filename derivation (dynamic import of transformer) ──────────────\n // We derive the displayed fileName so the header updates when format changes.\n // deriveFileName is tiny but it lives inside codeTransformer, which is only\n // imported when actually needed (non-TypeScript selection).\n const [displayedFileName, setDisplayedFileName] = useState<\n string | undefined\n >(fileName);\n\n useEffect(() => {\n if (!isMultiFormat || resolvedFormat === 'typescript') {\n setDisplayedFileName(fileName);\n return;\n }\n if (!fileName) return;\n\n let cancelled = false;\n (async () => {\n const { deriveFileName } = await import('./codeTransformer');\n if (!cancelled)\n setDisplayedFileName(deriveFileName(fileName, resolvedFormat));\n })();\n return () => {\n cancelled = true;\n };\n }, [fileName, isMultiFormat, resolvedFormat]);\n\n // ── Async copy text (transformed code for CopyCode) ───────────────────────\n const rawCode = useMemo(\n () => (children?.endsWith('\\n') ? children.slice(0, -1) : children),\n [children]\n );\n\n const [copyCode, setCopyCode] = useState<string>(rawCode);\n\n useEffect(() => {\n if (!isMultiFormat || resolvedFormat === 'typescript') {\n setCopyCode(rawCode);\n return;\n }\n let cancelled = false;\n (async () => {\n const { transformCode } = await import('./codeTransformer');\n if (!cancelled) setCopyCode(transformCode(rawCode, resolvedFormat));\n })();\n return () => {\n cancelled = true;\n };\n }, [rawCode, isMultiFormat, resolvedFormat]);\n\n const hadSelectInHeader =\n packageManager || rawCodeFormat || rawContentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={rawCodeFormat as string | undefined}\n contentDeclarationFormat={\n rawContentDeclarationFormat as string | undefined\n }\n >\n <Container\n className={cn(\n 'relative min-w-0 max-w-full text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl bg-card/50 py-1.5 pr-12 pl-4 text-neutral text-xs\">\n <span className=\"truncate\">{displayedFileName ?? language}</span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {rawCodeFormat && (\n <CodeFormatSelector availableFormats={effectiveFormats} />\n )}\n {rawContentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-46 z-20\">\n <div\n className={cn(\n 'absolute right-2 bottom-0 flex h-7 items-center',\n hadSelectInHeader && 'h-11'\n )}\n >\n <CopyCode code={copyCode} />\n </div>\n </div>\n </>\n )}\n <ExpandCollapse\n minHeight={MIN_HEIGHT}\n isRollable={isRollable}\n className=\"min-w-0 max-w-full overflow-x-auto p-2\"\n >\n {isMultiFormat ? (\n /*\n * Multi-format: CodeBlockHighlight manages both the transformation\n * (dynamic import of codeTransformer) and the Shiki highlighting in\n * a single useEffect. The previous highlighted output stays visible\n * while the new one loads — no white-text flash.\n */\n <CodeBlockHighlight\n originalLang={language}\n targetFormat={resolvedFormat}\n isDarkMode={isDarkMode}\n >\n {rawCode}\n </CodeBlockHighlight>\n ) : (\n /*\n * Single-format: use the original Suspense-based async Shiki renderer\n * (good for SSR / static content).\n */\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {rawCode}\n </CodeBlock>\n )}\n </ExpandCollapse>\n </Container>\n </CodeConditionalRender>\n );\n};\n"],"mappings":"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"}
|
|
@@ -6,8 +6,9 @@ import { Fragment, jsx } from "react/jsx-runtime";
|
|
|
6
6
|
//#region src/components/IDE/CodeConditionalRenderer.tsx
|
|
7
7
|
/** Parse a codeFormat prop that may be a single value or a JSON array string. */
|
|
8
8
|
const parseCodeFormats = (raw) => {
|
|
9
|
-
if (raw ===
|
|
10
|
-
if (
|
|
9
|
+
if (typeof raw === "undefined" || raw === null) return void 0;
|
|
10
|
+
if (Array.isArray(raw)) return raw;
|
|
11
|
+
if (typeof raw === "string" && raw.startsWith("[")) try {
|
|
11
12
|
const parsed = JSON.parse(raw);
|
|
12
13
|
if (Array.isArray(parsed)) return parsed;
|
|
13
14
|
} catch {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeConditionalRenderer.mjs","names":[],"sources":["../../../../src/components/IDE/CodeConditionalRenderer.tsx"],"sourcesContent":["'use client';\n\nimport type { FC, PropsWithChildren } from 'react';\nimport type { CodeCompAttributes } from './Code';\nimport type { CodeFormat } from './CodeContext';\nimport { useCodeContext } from './CodeContext';\n\n/** Parse a codeFormat prop that may be a single value or a JSON array string. */\nconst parseCodeFormats = (\n raw: string | undefined\n): CodeFormat[] | undefined => {\n if (raw === undefined) return undefined;\n // JSON array string: `[\"typescript\",\"esm\",\"commonjs\"]`\n if (raw.startsWith('[')) {\n try {\n const parsed = JSON.parse(raw);\n if (Array.isArray(parsed)) return parsed as CodeFormat[];\n } catch {\n // fall through\n }\n }\n return [raw as CodeFormat];\n};\n\nexport const CodeConditionalRender: FC<\n PropsWithChildren<CodeCompAttributes>\n> = ({ children, ...props }) => {\n const { packageManager, codeFormat, contentDeclarationFormat } =\n useCodeContext();\n\n const isPackageManagerUndefined = typeof props.packageManager === 'undefined';\n const isPackageManagerSelected = packageManager === props.packageManager;\n\n const formats = parseCodeFormats(props.codeFormat as string | undefined);\n const isCodeFormatUndefined = formats === undefined;\n const isCodeFormatSelected = formats ? formats.includes(codeFormat) : false;\n\n const contentFormats = parseCodeFormats(\n props.contentDeclarationFormat as string | undefined\n );\n const isContentDeclarationFormatUndefined = contentFormats === undefined;\n const isContentDeclarationFormatSelected = contentFormats\n ? contentFormats.includes(contentDeclarationFormat as CodeFormat)\n : false;\n\n if (\n (isPackageManagerUndefined || isPackageManagerSelected) &&\n (isCodeFormatUndefined || isCodeFormatSelected) &&\n (isContentDeclarationFormatUndefined || isContentDeclarationFormatSelected)\n ) {\n return children;\n }\n\n return <></>;\n};\n"],"mappings":";;;;;;;AAQA,MAAM,oBACJ,QAC6B;AAC7B,KAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"CodeConditionalRenderer.mjs","names":[],"sources":["../../../../src/components/IDE/CodeConditionalRenderer.tsx"],"sourcesContent":["'use client';\n\nimport type { FC, PropsWithChildren } from 'react';\nimport type { CodeCompAttributes } from './Code';\nimport type { CodeFormat } from './CodeContext';\nimport { useCodeContext } from './CodeContext';\n\n/** Parse a codeFormat prop that may be a single value or a JSON array string. */\nconst parseCodeFormats = (\n raw: string | string[] | undefined\n): CodeFormat[] | undefined => {\n if (typeof raw === 'undefined' || raw === null) return undefined;\n if (Array.isArray(raw)) return raw as CodeFormat[];\n\n // JSON array string: `[\"typescript\",\"esm\",\"commonjs\"]`\n if (typeof raw === 'string' && raw.startsWith('[')) {\n try {\n const parsed = JSON.parse(raw);\n if (Array.isArray(parsed)) return parsed as CodeFormat[];\n } catch {\n // fall through\n }\n }\n return [raw as CodeFormat];\n};\n\nexport const CodeConditionalRender: FC<\n PropsWithChildren<CodeCompAttributes>\n> = ({ children, ...props }) => {\n const { packageManager, codeFormat, contentDeclarationFormat } =\n useCodeContext();\n\n const isPackageManagerUndefined = typeof props.packageManager === 'undefined';\n const isPackageManagerSelected = packageManager === props.packageManager;\n\n const formats = parseCodeFormats(props.codeFormat as string | undefined);\n const isCodeFormatUndefined = formats === undefined;\n const isCodeFormatSelected = formats ? formats.includes(codeFormat) : false;\n\n const contentFormats = parseCodeFormats(\n props.contentDeclarationFormat as string | undefined\n );\n const isContentDeclarationFormatUndefined = contentFormats === undefined;\n const isContentDeclarationFormatSelected = contentFormats\n ? contentFormats.includes(contentDeclarationFormat as CodeFormat)\n : false;\n\n if (\n (isPackageManagerUndefined || isPackageManagerSelected) &&\n (isCodeFormatUndefined || isCodeFormatSelected) &&\n (isContentDeclarationFormatUndefined || isContentDeclarationFormatSelected)\n ) {\n return children;\n }\n\n return <></>;\n};\n"],"mappings":";;;;;;;AAQA,MAAM,oBACJ,QAC6B;AAC7B,KAAI,OAAO,QAAQ,eAAe,QAAQ,KAAM,QAAO;AACvD,KAAI,MAAM,QAAQ,IAAI,CAAE,QAAO;AAG/B,KAAI,OAAO,QAAQ,YAAY,IAAI,WAAW,IAAI,CAChD,KAAI;EACF,MAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,MAAI,MAAM,QAAQ,OAAO,CAAE,QAAO;SAC5B;AAIV,QAAO,CAAC,IAAkB;;AAG5B,MAAa,yBAER,EAAE,UAAU,GAAG,YAAY;CAC9B,MAAM,EAAE,gBAAgB,YAAY,6BAClC,gBAAgB;CAElB,MAAM,4BAA4B,OAAO,MAAM,mBAAmB;CAClE,MAAM,2BAA2B,mBAAmB,MAAM;CAE1D,MAAM,UAAU,iBAAiB,MAAM,WAAiC;CACxE,MAAM,wBAAwB,YAAY;CAC1C,MAAM,uBAAuB,UAAU,QAAQ,SAAS,WAAW,GAAG;CAEtE,MAAM,iBAAiB,iBACrB,MAAM,yBACP;CACD,MAAM,sCAAsC,mBAAmB;CAC/D,MAAM,qCAAqC,iBACvC,eAAe,SAAS,yBAAuC,GAC/D;AAEJ,MACG,6BAA6B,8BAC7B,yBAAyB,0BACzB,uCAAuC,oCAExC,QAAO;AAGT,QAAO,gCAAK"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useQuery } from "@tanstack/react-query";
|
|
4
3
|
import configuration from "@intlayer/config/built";
|
|
4
|
+
import { useQuery } from "@tanstack/react-query";
|
|
5
5
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
6
6
|
import { getOAuthAPI } from "@intlayer/api";
|
|
7
7
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { getAuthAPI } from "../../libs/auth.mjs";
|
|
4
4
|
import { useQueryClient } from "../reactQuery.mjs";
|
|
5
|
-
import { useQuery } from "@tanstack/react-query";
|
|
6
5
|
import configuration from "@intlayer/config/built";
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
7
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
8
8
|
|
|
9
9
|
//#region src/hooks/useAuth/useSession.ts
|
|
@@ -44,7 +44,7 @@ declare enum BadgeSize {
|
|
|
44
44
|
*/
|
|
45
45
|
declare const badgeVariants: (props?: {
|
|
46
46
|
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "error" | "success" | "custom";
|
|
47
|
-
variant?: "none" | "default" | "
|
|
47
|
+
variant?: "none" | "default" | "hoverable" | "outline";
|
|
48
48
|
size?: "sm" | "md" | "lg";
|
|
49
49
|
} & _$class_variance_authority_types0.ClassProp) => string;
|
|
50
50
|
/**
|
|
@@ -61,9 +61,9 @@ declare enum ButtonTextAlign {
|
|
|
61
61
|
*/
|
|
62
62
|
declare const buttonVariants: (props?: {
|
|
63
63
|
size?: "sm" | "md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl";
|
|
64
|
-
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "
|
|
65
|
-
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
66
|
-
variant?: "input" | "none" | "default" | "
|
|
64
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "error" | "success" | "custom" | "card" | "current";
|
|
65
|
+
roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "4xl" | "5xl";
|
|
66
|
+
variant?: "input" | "none" | "default" | "invisible-link" | "hoverable" | "outline" | "link" | "fade";
|
|
67
67
|
textAlign?: "left" | "center" | "right";
|
|
68
68
|
isFullWidth?: boolean;
|
|
69
69
|
} & _$class_variance_authority_types0.ClassProp) => string;
|
|
@@ -6,7 +6,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
6
6
|
declare const collapsibleTableVariants: (props?: {
|
|
7
7
|
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
8
8
|
variant?: "default" | "dark" | "ghost" | "outlined";
|
|
9
|
-
spacing?: "
|
|
9
|
+
spacing?: "none" | "sm" | "md" | "lg" | "auto";
|
|
10
10
|
} & _$class_variance_authority_types0.ClassProp) => string;
|
|
11
11
|
interface CollapsibleTableProps extends Omit<HTMLAttributes<HTMLElement>, 'title'>, VariantProps<typeof collapsibleTableVariants> {
|
|
12
12
|
/** Table title displayed in the header */
|
|
@@ -55,7 +55,7 @@ declare const Command: {
|
|
|
55
55
|
ref?: React.Ref<HTMLDivElement>;
|
|
56
56
|
} & {
|
|
57
57
|
asChild?: boolean;
|
|
58
|
-
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "
|
|
58
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
|
59
59
|
heading?: React.ReactNode;
|
|
60
60
|
value?: string;
|
|
61
61
|
forceMount?: boolean;
|
|
@@ -73,7 +73,7 @@ declare const Command: {
|
|
|
73
73
|
ref?: React.Ref<HTMLDivElement>;
|
|
74
74
|
} & {
|
|
75
75
|
asChild?: boolean;
|
|
76
|
-
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "
|
|
76
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
|
|
77
77
|
disabled?: boolean;
|
|
78
78
|
onSelect?: (value: string) => void;
|
|
79
79
|
value?: string;
|
|
@@ -8,14 +8,14 @@ import { VariantProps } from "class-variance-authority";
|
|
|
8
8
|
* Provides flexible styling options for background, padding, borders, and layout
|
|
9
9
|
*/
|
|
10
10
|
declare const containerVariants: (props?: {
|
|
11
|
-
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
12
|
-
transparency?: "xs" | "sm" | "md" | "lg" | "xl" | "
|
|
13
|
-
padding?: "sm" | "md" | "lg" | "xl" | "2xl"
|
|
11
|
+
roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "4xl";
|
|
12
|
+
transparency?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
13
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
14
14
|
separator?: "both" | "without" | "x" | "y";
|
|
15
15
|
border?: "with" | "none";
|
|
16
|
-
borderColor?: "error" | "
|
|
16
|
+
borderColor?: "error" | "success" | "text" | "primary" | "secondary" | "neutral" | "card" | "warning";
|
|
17
17
|
background?: "with" | "none" | "hoverable";
|
|
18
|
-
gap?: "sm" | "md" | "lg" | "xl" | "2xl"
|
|
18
|
+
gap?: "none" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
19
19
|
} & _$class_variance_authority_types0.ClassProp) => string;
|
|
20
20
|
/** Available rounded corner sizes for the container */
|
|
21
21
|
declare enum ContainerRoundedSize {
|
|
@@ -5,9 +5,9 @@ import { BundledLanguage } from "shiki/bundle/web";
|
|
|
5
5
|
//#region src/components/IDE/Code.d.ts
|
|
6
6
|
type CodeCompAttributes = {
|
|
7
7
|
fileName?: string;
|
|
8
|
-
packageManager?: PackageManager; /** Single format,
|
|
9
|
-
codeFormat?: CodeFormat | string;
|
|
10
|
-
contentDeclarationFormat?: ContentDeclarationFormat | string;
|
|
8
|
+
packageManager?: PackageManager; /** Single format, a JSON-array string, or an array of formats. */
|
|
9
|
+
codeFormat?: CodeFormat | string | string[];
|
|
10
|
+
contentDeclarationFormat?: ContentDeclarationFormat | string | string[];
|
|
11
11
|
};
|
|
12
12
|
type CodeCompProps = {
|
|
13
13
|
children: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.d.ts","names":[],"sources":["../../../../src/components/IDE/Code.tsx"],"mappings":";;;;;KAsBY,kBAAA;EACV,QAAA;EACA,cAAA,GAAiB,cAAA,EAFW;EAI5B,UAAA,GAAa,UAAA;EACb,wBAAA,GAA2B,wBAAA;AAAA;AAAA,KAGxB,aAAA;EACH,QAAA;EACA,QAAA;EACA,QAAA,EAAU,eAAA;EACV,UAAA;EACA,UAAA;EACA,eAAA;EACA,UAAA;AAAA,IACE,kBAAA,GACF,cAAA,CAAe,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"Code.d.ts","names":[],"sources":["../../../../src/components/IDE/Code.tsx"],"mappings":";;;;;KAsBY,kBAAA;EACV,QAAA;EACA,cAAA,GAAiB,cAAA,EAFW;EAI5B,UAAA,GAAa,UAAA;EACb,wBAAA,GAA2B,wBAAA;AAAA;AAAA,KAGxB,aAAA;EACH,QAAA;EACA,QAAA;EACA,QAAA,EAAU,eAAA;EACV,UAAA;EACA,UAAA;EACA,eAAA;EACA,UAAA;AAAA,IACE,kBAAA,GACF,cAAA,CAAe,cAAA;AAAA,cAwBJ,IAAA,EAAM,EAAA,CAAG,aAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeConditionalRenderer.d.ts","names":[],"sources":["../../../../src/components/IDE/CodeConditionalRenderer.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"CodeConditionalRenderer.d.ts","names":[],"sources":["../../../../src/components/IDE/CodeConditionalRenderer.tsx"],"mappings":";;;;cA0Ba,qBAAA,EAAuB,EAAA,CAClC,iBAAA,CAAkB,kBAAA"}
|
|
@@ -6,7 +6,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
6
6
|
declare const checkboxVariants: (props?: {
|
|
7
7
|
variant?: "default";
|
|
8
8
|
size?: "xs" | "sm" | "md" | "lg";
|
|
9
|
-
color?: "error" | "
|
|
9
|
+
color?: "error" | "success" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "custom";
|
|
10
10
|
validationStyleEnabled?: "enabled" | "disabled";
|
|
11
11
|
} & _$class_variance_authority_types0.ClassProp) => string;
|
|
12
12
|
declare enum CheckboxSize {
|
|
@@ -53,8 +53,8 @@ declare enum LinkUnderlined {
|
|
|
53
53
|
FALSE = "false"
|
|
54
54
|
}
|
|
55
55
|
declare const linkVariants: (props?: {
|
|
56
|
-
variant?: "default" | "invisible-link" | "
|
|
57
|
-
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
56
|
+
variant?: "default" | "invisible-link" | "button" | "button-outlined" | "hoverable";
|
|
57
|
+
roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
|
|
58
58
|
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "error" | "success" | "custom";
|
|
59
59
|
size?: "sm" | "md" | "lg" | "xl" | "custom";
|
|
60
60
|
underlined?: boolean | LinkUnderlined.DEFAULT;
|
|
@@ -185,7 +185,7 @@ declare enum TagBackground {
|
|
|
185
185
|
WITH = "with"
|
|
186
186
|
}
|
|
187
187
|
declare const containerVariants: (props?: {
|
|
188
|
-
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
188
|
+
roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
|
|
189
189
|
color?: "text" | "primary" | "neutral" | "error" | "success" | "warning" | "blue" | "yellow" | "green" | "red" | "orange" | "purple" | "pink" | "brown" | "gray" | "black" | "white";
|
|
190
190
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
191
191
|
border?: "none" | "with";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/design-system",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.11-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer design system, including UI components used in the Intlayer editor, website, and visual editor/CMS.",
|
|
6
6
|
"keywords": [
|
|
@@ -421,12 +421,12 @@
|
|
|
421
421
|
"dependencies": {
|
|
422
422
|
"@better-auth/passkey": "1.6.9",
|
|
423
423
|
"@better-auth/sso": "1.6.9",
|
|
424
|
-
"@intlayer/api": "8.7.
|
|
425
|
-
"@intlayer/config": "8.7.
|
|
426
|
-
"@intlayer/core": "8.7.
|
|
427
|
-
"@intlayer/dictionaries-entry": "8.7.
|
|
428
|
-
"@intlayer/editor-react": "8.7.
|
|
429
|
-
"@intlayer/types": "8.7.
|
|
424
|
+
"@intlayer/api": "8.7.11-canary.0",
|
|
425
|
+
"@intlayer/config": "8.7.11-canary.0",
|
|
426
|
+
"@intlayer/core": "8.7.11-canary.0",
|
|
427
|
+
"@intlayer/dictionaries-entry": "8.7.11-canary.0",
|
|
428
|
+
"@intlayer/editor-react": "8.7.11-canary.0",
|
|
429
|
+
"@intlayer/types": "8.7.11-canary.0",
|
|
430
430
|
"@radix-ui/react-dialog": "1.1.15",
|
|
431
431
|
"@radix-ui/react-select": "2.2.6",
|
|
432
432
|
"@radix-ui/react-slot": "1.2.4",
|
|
@@ -435,12 +435,12 @@
|
|
|
435
435
|
"better-auth": "1.6.9",
|
|
436
436
|
"class-variance-authority": "0.7.1",
|
|
437
437
|
"cmdk": "1.1.1",
|
|
438
|
-
"react-intlayer": "8.7.
|
|
438
|
+
"react-intlayer": "8.7.11-canary.0",
|
|
439
439
|
"rollup-preserve-directives": "1.1.3",
|
|
440
440
|
"zod": "4.3.6"
|
|
441
441
|
},
|
|
442
442
|
"devDependencies": {
|
|
443
|
-
"@intlayer/backend": "8.7.
|
|
443
|
+
"@intlayer/backend": "8.7.11-canary.0",
|
|
444
444
|
"@shikijs/transformers": "4.0.2",
|
|
445
445
|
"@storybook/addon-a11y": "8.6.14",
|
|
446
446
|
"@storybook/addon-essentials": "8.6.14",
|
|
@@ -470,7 +470,7 @@
|
|
|
470
470
|
"@utils/ts-config-types": "1.0.4",
|
|
471
471
|
"clsx": "2.1.1",
|
|
472
472
|
"fast-glob": "3.3.3",
|
|
473
|
-
"intlayer": "8.7.
|
|
473
|
+
"intlayer": "8.7.11-canary.0",
|
|
474
474
|
"rimraf": "6.1.3",
|
|
475
475
|
"shiki": "4.0.2",
|
|
476
476
|
"storybook": "8.6.17",
|
|
@@ -478,28 +478,28 @@
|
|
|
478
478
|
"tsdown": "0.21.10",
|
|
479
479
|
"typescript": "6.0.3",
|
|
480
480
|
"vite": "8.0.10",
|
|
481
|
-
"vite-intlayer": "8.7.
|
|
481
|
+
"vite-intlayer": "8.7.11-canary.0",
|
|
482
482
|
"vite-plugin-dts": "4.5.4",
|
|
483
483
|
"vitest": "4.1.5"
|
|
484
484
|
},
|
|
485
485
|
"peerDependencies": {
|
|
486
486
|
"@better-fetch/fetch": "1.1.21",
|
|
487
487
|
"@hookform/resolvers": "5.2.2",
|
|
488
|
-
"@intlayer/backend": "8.7.
|
|
488
|
+
"@intlayer/backend": "8.7.11-canary.0",
|
|
489
489
|
"@monaco-editor/react": "4.7.0",
|
|
490
490
|
"@shikijs/transformers": "4.0.2",
|
|
491
|
-
"@tanstack/react-query": "5.100.
|
|
492
|
-
"@tanstack/react-query-devtools": "5.100.
|
|
491
|
+
"@tanstack/react-query": "5.100.6",
|
|
492
|
+
"@tanstack/react-query-devtools": "5.100.6",
|
|
493
493
|
"framer-motion": "12.38.0",
|
|
494
494
|
"fuse.js": "7.3.0",
|
|
495
|
-
"intlayer": "8.7.
|
|
496
|
-
"lucide-react": "1.
|
|
495
|
+
"intlayer": "8.7.11-canary.0",
|
|
496
|
+
"lucide-react": "1.12.0",
|
|
497
497
|
"react": ">=16.0.0",
|
|
498
498
|
"react-dom": ">=16.0.0",
|
|
499
|
-
"react-hook-form": "7.
|
|
500
|
-
"react-intlayer": "8.7.
|
|
499
|
+
"react-hook-form": "7.74.0",
|
|
500
|
+
"react-intlayer": "8.7.11-canary.0",
|
|
501
501
|
"shiki": "4.0.2",
|
|
502
|
-
"tailwindcss": "4.2.
|
|
502
|
+
"tailwindcss": "4.2.4"
|
|
503
503
|
},
|
|
504
504
|
"peerDependenciesMeta": {
|
|
505
505
|
"@intlayer/backend": {
|