@neo4j-ndl/react 4.18.10 → 4.18.11
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/lib/cjs/_common/TruncatedTextWithTooltip.js +67 -0
- package/lib/cjs/_common/TruncatedTextWithTooltip.js.map +1 -0
- package/lib/cjs/ai/preview/Preview.js +4 -3
- package/lib/cjs/ai/preview/Preview.js.map +1 -1
- package/lib/cjs/ai/preview/stories/index.js +9 -9
- package/lib/cjs/ai/preview/stories/index.js.map +1 -1
- package/lib/cjs/ai/preview/stories/preview-code-confirmation.story.js +1 -1
- package/lib/cjs/ai/preview/stories/preview-code-confirmation.story.js.map +1 -1
- package/lib/cjs/ai/preview/stories/{preview-code-read.story.js → preview-code-cypher.story.js} +2 -2
- package/lib/cjs/ai/preview/stories/preview-code-cypher.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-code-languages.story.js +1 -1
- package/lib/cjs/ai/preview/stories/preview-code-languages.story.js.map +1 -1
- package/lib/cjs/ai/preview/stories/{preview-code-write.story.js → preview-code-truncation.story.js} +5 -5
- package/lib/cjs/ai/preview/stories/preview-code-truncation.story.js.map +1 -0
- package/lib/esm/_common/TruncatedTextWithTooltip.js +60 -0
- package/lib/esm/_common/TruncatedTextWithTooltip.js.map +1 -0
- package/lib/esm/ai/preview/Preview.js +4 -3
- package/lib/esm/ai/preview/Preview.js.map +1 -1
- package/lib/esm/ai/preview/stories/index.js +6 -6
- package/lib/esm/ai/preview/stories/index.js.map +1 -1
- package/lib/esm/ai/preview/stories/preview-code-confirmation.story.js +1 -1
- package/lib/esm/ai/preview/stories/preview-code-confirmation.story.js.map +1 -1
- package/lib/esm/ai/preview/stories/{preview-code-read.story.js → preview-code-cypher.story.js} +2 -2
- package/lib/esm/ai/preview/stories/preview-code-cypher.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-code-languages.story.js +1 -1
- package/lib/esm/ai/preview/stories/preview-code-languages.story.js.map +1 -1
- package/lib/esm/ai/preview/stories/{preview-code-write.story.js → preview-code-truncation.story.js} +8 -8
- package/lib/esm/ai/preview/stories/preview-code-truncation.story.js.map +1 -0
- package/lib/types/_common/TruncatedTextWithTooltip.d.ts +46 -0
- package/lib/types/_common/TruncatedTextWithTooltip.d.ts.map +1 -0
- package/lib/types/ai/preview/Preview.d.ts +8 -2
- package/lib/types/ai/preview/Preview.d.ts.map +1 -1
- package/lib/types/ai/preview/stories/index.d.ts +4 -4
- package/lib/types/ai/preview/stories/index.d.ts.map +1 -1
- package/lib/types/ai/preview/stories/{preview-code-write.story.d.ts → preview-code-cypher.story.d.ts} +1 -1
- package/lib/types/ai/preview/stories/preview-code-cypher.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-code-languages.story.d.ts.map +1 -1
- package/lib/types/ai/preview/stories/{preview-code-read.story.d.ts → preview-code-truncation.story.d.ts} +1 -1
- package/lib/types/ai/preview/stories/preview-code-truncation.story.d.ts.map +1 -0
- package/package.json +2 -2
- package/skills/ndl-react/SKILL.md +1 -1
- package/skills/ndl-react/components/ai/preview.md +86 -66
- package/skills/ndl-react/components/ai/user-bubble.md +1 -12
- package/skills/ndl-react/components/breadcrumbs.md +2 -2
- package/lib/cjs/ai/preview/stories/preview-code-read.story.js.map +0 -1
- package/lib/cjs/ai/preview/stories/preview-code-write.story.js.map +0 -1
- package/lib/esm/ai/preview/stories/preview-code-read.story.js.map +0 -1
- package/lib/esm/ai/preview/stories/preview-code-write.story.js.map +0 -1
- package/lib/types/ai/preview/stories/preview-code-read.story.d.ts.map +0 -1
- package/lib/types/ai/preview/stories/preview-code-write.story.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.js","sourceRoot":"","sources":["../../../../src/ai/preview/Preview.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,eAAe,EAEf,cAAc,EACd,WAAW,EACX,UAAU,EACV,c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E,EAAE,SAAS,EAAE,mBAAmB,EAAE,EAChD,eAAe,EAAE,KAAK,YAErB,IAAI,GACa,GAChB,IACL,CACJ,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AAMF,MAAM,cAAc,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACtB,QAAQ,EACR,GAAG,EACH,KAAK,EACL,SAAS,EACT,cAAc,OAE0B,EADrC,SAAS,cANU,2DAOvB,CADa;IAEZ,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,wBAAwB,EAAE,SAAS,CAAC,IACtD,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACrD,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,mBAAmB;IACjC,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n ClipboardButton,\n type CodeBlock,\n LoadingSpinner,\n StatusLabel,\n Typography,\n useNeedleTheme,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { useEffect, useState } from 'react';\nimport { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { type CommonProps } from '../../_common/types';\nimport {\n type LanguageProp,\n Languages,\n loadLanguage,\n} from '../../code-block/code-languages';\nimport ndlCodeDark from '../../code-block/themes/ndl-code-dark';\nimport ndlCodeLight from '../../code-block/themes/ndl-code-light';\nimport { CheckIconOutline } from '../../icons/generated/heroIcons/CheckIconOutline';\nimport { XMarkIconOutline } from '../../icons/generated/heroIcons/XMarkIconOutline';\n\ntype PreviewProps = {\n children: React.ReactNode;\n};\n\n/**\n * Component to use for previewing certain content in AI chat applications.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst PreviewComponent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\ntype PreviewHeaderProps = {\n children?: React.ReactNode;\n actions?: React.ReactNode;\n};\n\nconst PreviewHeader = ({\n children,\n actions,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewHeaderProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-header', className)}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography\n variant=\"code\"\n as=\"div\"\n className=\"ndl-ai-preview-header-leading-content\"\n >\n {children}\n </Typography>\n\n {actions && (\n <div className=\"ndl-ai-preview-header-actions\">{actions}</div>\n )}\n </div>\n );\n};\n\ntype PreviewConfirmationProps = {\n /** The content to display in the confirmation */\n children?: React.ReactNode;\n /** The actions to display in the confirmation, usually two buttons; one for confirming and one for rejecting. */\n actions: React.ReactNode;\n /** Whether the confirmation is used as a footer */\n isFooter?: boolean;\n /** The status of the confirmation */\n status?: 'pending' | 'confirmed' | 'rejected';\n /** The text to display for the confirmed status */\n confirmedActionText?: string;\n /** The text to display for the rejected status */\n rejectedActionText?: string;\n};\n\nconst PreviewConfirmation = ({\n children,\n actions,\n isFooter = false,\n status = 'pending',\n confirmedActionText = 'Action confirmed',\n rejectedActionText = 'Action rejected',\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewConfirmationProps>) => {\n const classes = classNames('ndl-ai-preview-confirmation', className, {\n 'ndl-ai-preview-confirmation-footer': isFooter,\n });\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {!(isFooter && status !== 'pending') && (\n <Typography\n as=\"div\"\n variant={isFooter ? 'subheading-small' : 'body-medium'}\n className=\"ndl-ai-preview-confirmation-content\"\n >\n {children}\n </Typography>\n )}\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-ai-preview-confirmation-actions\"\n >\n {status === 'pending' && actions}\n {status === 'confirmed' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <CheckIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {confirmedActionText}\n </div>\n )}\n {status === 'rejected' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <XMarkIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {rejectedActionText}\n </div>\n )}\n </Typography>\n </div>\n );\n};\n\ntype PreviewCodeProps = {\n /** The code content to display */\n code: string;\n /** The language of the code (e.g., 'cypher', 'python', 'javascript') */\n language: React.ComponentProps<typeof CodeBlock>['language'];\n /** The current state of the code block */\n label?: 'read' | 'write';\n /** Whether the code block is loading */\n isLoading?: boolean;\n /** The actions to display in the header. Should be small buttons or icon buttons only. */\n headerActions?: React.ReactNode;\n /** The theme of the code block */\n theme?: 'ndl-code-dark' | 'ndl-code-light';\n};\n\nconst PreviewCode = ({\n code,\n language,\n label,\n isLoading = false,\n headerActions,\n theme,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewCodeProps>) => {\n const [loadedLanguage, setLoadedLanguage] = useState<\n PreviewCodeProps['language'] | null\n >(null);\n const { theme: ndlTheme } = useNeedleTheme();\n\n useEffect(() => {\n if (!language || !(Languages as readonly string[]).includes(language)) {\n setLoadedLanguage('text');\n return;\n }\n\n loadLanguage(language as LanguageProp)\n .then((module) => {\n SyntaxHighlighter.registerLanguage(language, module.default);\n setLoadedLanguage(language);\n })\n .catch((err) => console.error(err));\n }, [language]);\n\n const getTheme = () => {\n switch (theme) {\n case 'ndl-code-dark':\n return ndlCodeDark;\n case 'ndl-code-light':\n return ndlCodeLight;\n default:\n return ndlTheme === 'light' ? ndlCodeLight : ndlCodeDark;\n }\n };\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-code', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {isLoading && (\n <div className=\"ndl-ai-preview-code-loading\">\n <LoadingSpinner size=\"medium\" />\n <Typography variant=\"code\">\n WRITING {language.toUpperCase()}\n </Typography>\n </div>\n )}\n {!isLoading && (\n <>\n <PreviewHeader\n className=\"ndl-ai-preview-code-header\"\n actions={\n <>\n <ClipboardButton\n textToCopy={code}\n type=\"clean-icon-button\"\n size=\"small\"\n />\n {headerActions}\n </>\n }\n >\n {language} {language.toLowerCase() === 'cypher' ? 'QUERY' : ''}\n {label && (\n <StatusLabel\n variant={label === 'write' ? 'warning' : 'info'}\n size=\"small\"\n fill=\"semi-filled\"\n >\n {label.toUpperCase()}\n </StatusLabel>\n )}\n </PreviewHeader>\n <div className=\"ndl-ai-preview-code-content\">\n <SyntaxHighlighter\n language={loadedLanguage ?? 'text'}\n style={{\n ...getTheme(),\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n overflowX: 'auto',\n padding: 'var(--space-12)',\n width: 'fit-content',\n },\n }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n codeTagProps={{ className: 'n-ai-preview-code' }}\n showLineNumbers={false}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </>\n )}\n </div>\n );\n};\n\ntype PreviewContentProps = {\n children?: React.ReactNode;\n};\n\nconst PreviewContent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewContentProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-content', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nexport const Preview = Object.assign(PreviewComponent, {\n Code: PreviewCode,\n Confirmation: PreviewConfirmation,\n Content: PreviewContent,\n Header: PreviewHeader,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"Preview.js","sourceRoot":"","sources":["../../../../src/ai/preview/Preview.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,eAAe,EAEf,cAAc,EACd,WAAW,EACX,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,OAAO,EAEL,SAAS,EACT,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAMpF;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,EAOS,EAAE,EAAE;QAPb,EACxB,QAAQ,EACR,GAAG,EACH,KAAK,EACL,SAAS,EACT,cAAc,OAEmB,EAD9B,SAAS,cANY,2DAOzB,CADa;IAEZ,OAAO,CACL,4BACE,GAAG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SAAS,CAAC,IACtD,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACrD,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,mBAAmB;IACjC,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n ClipboardButton,\n type CodeBlock,\n LoadingSpinner,\n StatusLabel,\n Typography,\n useNeedleTheme,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { useEffect, useState } from 'react';\nimport { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { TruncatedTextWithTooltip } from '../../_common/TruncatedTextWithTooltip';\nimport { type CommonProps } from '../../_common/types';\nimport {\n type LanguageProp,\n Languages,\n loadLanguage,\n} from '../../code-block/code-languages';\nimport ndlCodeDark from '../../code-block/themes/ndl-code-dark';\nimport ndlCodeLight from '../../code-block/themes/ndl-code-light';\nimport { CheckIconOutline } from '../../icons/generated/heroIcons/CheckIconOutline';\nimport { XMarkIconOutline } from '../../icons/generated/heroIcons/XMarkIconOutline';\n\ntype PreviewProps = {\n children: React.ReactNode;\n};\n\n/**\n * Component to use for previewing certain content in AI chat applications.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst PreviewComponent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\ntype PreviewHeaderProps = {\n /** The content to display in the header. When a plain string is passed, it truncates with an ellipsis and shows a tooltip with the full text when space is limited. */\n children?: React.ReactNode;\n /** The actions to display in the header. Should be small buttons or icon buttons only. */\n actions?: React.ReactNode;\n};\n\nconst PreviewHeader = ({\n children,\n actions,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewHeaderProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-header', className)}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography\n variant=\"code\"\n as=\"div\"\n className=\"ndl-ai-preview-header-leading-content\"\n >\n {typeof children === 'string' ? (\n <TruncatedTextWithTooltip text={children} />\n ) : (\n children\n )}\n </Typography>\n\n {actions && (\n <div className=\"ndl-ai-preview-header-actions\">{actions}</div>\n )}\n </div>\n );\n};\n\ntype PreviewConfirmationProps = {\n /** The content to display in the confirmation */\n children?: React.ReactNode;\n /** The actions to display in the confirmation, usually two buttons; one for confirming and one for rejecting. */\n actions: React.ReactNode;\n /** Whether the confirmation is used as a footer */\n isFooter?: boolean;\n /** The status of the confirmation */\n status?: 'pending' | 'confirmed' | 'rejected';\n /** The text to display for the confirmed status */\n confirmedActionText?: string;\n /** The text to display for the rejected status */\n rejectedActionText?: string;\n};\n\nconst PreviewConfirmation = ({\n children,\n actions,\n isFooter = false,\n status = 'pending',\n confirmedActionText = 'Action confirmed',\n rejectedActionText = 'Action rejected',\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewConfirmationProps>) => {\n const classes = classNames('ndl-ai-preview-confirmation', className, {\n 'ndl-ai-preview-confirmation-footer': isFooter,\n });\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {!(isFooter && status !== 'pending') && (\n <Typography\n as=\"div\"\n variant={isFooter ? 'subheading-small' : 'body-medium'}\n className=\"ndl-ai-preview-confirmation-content\"\n >\n {children}\n </Typography>\n )}\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-ai-preview-confirmation-actions\"\n >\n {status === 'pending' && actions}\n {status === 'confirmed' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <CheckIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {confirmedActionText}\n </div>\n )}\n {status === 'rejected' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <XMarkIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {rejectedActionText}\n </div>\n )}\n </Typography>\n </div>\n );\n};\n\ntype PreviewCodeProps = {\n /** The code content to display */\n code: string;\n /** The language of the code (e.g., 'cypher', 'python', 'javascript') */\n language: React.ComponentProps<typeof CodeBlock>['language'];\n /** The current state of the code block\n * @deprecated - The query should be described in the heading property instead.\n */\n label?: 'read' | 'write';\n /** Whether the code block is loading */\n isLoading?: boolean;\n /** The actions to display in the header. Should be small buttons or icon buttons only. */\n headerActions?: React.ReactNode;\n /** The theme of the code block */\n theme?: 'ndl-code-dark' | 'ndl-code-light';\n /** The heading to display in the header. If not provided, the language will be displayed. Truncates with an ellipsis and shows a tooltip with the full text when space is limited. */\n heading?: string;\n};\n\nconst PreviewCode = ({\n code,\n language,\n label,\n isLoading = false,\n headerActions,\n theme,\n heading,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewCodeProps>) => {\n const [loadedLanguage, setLoadedLanguage] = useState<\n PreviewCodeProps['language'] | null\n >(null);\n const { theme: ndlTheme } = useNeedleTheme();\n\n useEffect(() => {\n if (!language || !(Languages as readonly string[]).includes(language)) {\n setLoadedLanguage('text');\n return;\n }\n\n loadLanguage(language as LanguageProp)\n .then((module) => {\n SyntaxHighlighter.registerLanguage(language, module.default);\n setLoadedLanguage(language);\n })\n .catch((err) => console.error(err));\n }, [language]);\n\n const getTheme = () => {\n switch (theme) {\n case 'ndl-code-dark':\n return ndlCodeDark;\n case 'ndl-code-light':\n return ndlCodeLight;\n default:\n return ndlTheme === 'light' ? ndlCodeLight : ndlCodeDark;\n }\n };\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-code', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {isLoading && (\n <div className=\"ndl-ai-preview-code-loading\">\n <LoadingSpinner size=\"medium\" />\n <Typography variant=\"code\">\n WRITING {language.toUpperCase()}\n </Typography>\n </div>\n )}\n {!isLoading && (\n <>\n <PreviewHeader\n className=\"ndl-ai-preview-code-header\"\n actions={\n <>\n <ClipboardButton\n textToCopy={code}\n type=\"clean-icon-button\"\n size=\"small\"\n />\n {headerActions}\n </>\n }\n >\n <TruncatedTextWithTooltip\n className=\"ndl-ai-preview-code-header-heading\"\n text={\n heading ??\n `${language}${language.toLowerCase() === 'cypher' ? ' QUERY' : ''}`\n }\n />\n {label && (\n <StatusLabel\n variant={label === 'write' ? 'warning' : 'info'}\n size=\"small\"\n fill=\"semi-filled\"\n >\n {label.toUpperCase()}\n </StatusLabel>\n )}\n </PreviewHeader>\n <div className=\"ndl-ai-preview-code-content\">\n <SyntaxHighlighter\n language={loadedLanguage ?? 'text'}\n style={{\n ...getTheme(),\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n overflowX: 'auto',\n padding: 'var(--space-12)',\n width: 'fit-content',\n },\n }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n codeTagProps={{ className: 'n-ai-preview-code' }}\n showLineNumbers={false}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </>\n )}\n </div>\n );\n};\n\ntype PreviewContentProps = {\n children?: React.ReactNode;\n};\n\nconst PreviewContent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewContentProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-content', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nexport const Preview = Object.assign(PreviewComponent, {\n Code: PreviewCode,\n Confirmation: PreviewConfirmation,\n Content: PreviewContent,\n Header: PreviewHeader,\n});\n"]}
|
|
@@ -22,17 +22,17 @@ export { default as PreviewDataGrid } from './preview-data-grid.story';
|
|
|
22
22
|
export { default as PreviewConfirmationStandalone } from './preview-confirmation-standalone.story';
|
|
23
23
|
export { default as PreviewCodeConfirmation } from './preview-code-confirmation.story';
|
|
24
24
|
export { default as PreviewCodeLoading } from './preview-code-loading.story';
|
|
25
|
-
export { default as PreviewCodeRead } from './preview-code-read.story';
|
|
26
|
-
export { default as PreviewCodeWrite } from './preview-code-write.story';
|
|
27
25
|
export { default as PreviewCodeLanguages } from './preview-code-languages.story';
|
|
28
26
|
export { default as PreviewSimple } from './preview-simple.story';
|
|
29
27
|
export { default as PreviewSimpleWithContent } from './preview-simple-with-content.story';
|
|
28
|
+
export { default as PreviewCodeCypher } from './preview-code-cypher.story';
|
|
29
|
+
export { default as PreviewCodeTruncation } from './preview-code-truncation.story';
|
|
30
30
|
import { removeLicenseHeader } from '../../../_common/export-stories-utils';
|
|
31
31
|
import PreviewCodeConfirmationSrcRaw from './preview-code-confirmation.story?raw';
|
|
32
|
+
import PreviewCodeCypherSrcRaw from './preview-code-cypher.story?raw';
|
|
32
33
|
import PreviewCodeLanguagesSrcRaw from './preview-code-languages.story?raw';
|
|
33
34
|
import PreviewCodeLoadingSrcRaw from './preview-code-loading.story?raw';
|
|
34
|
-
import
|
|
35
|
-
import PreviewCodeWriteSrcRaw from './preview-code-write.story?raw';
|
|
35
|
+
import PreviewCodeTruncationSrcRaw from './preview-code-truncation.story?raw';
|
|
36
36
|
import PreviewConfirmationStandaloneSrcRaw from './preview-confirmation-standalone.story?raw';
|
|
37
37
|
import PreviewDataGridSrcRaw from './preview-data-grid.story?raw';
|
|
38
38
|
import PreviewSimpleSrcRaw from './preview-simple.story?raw';
|
|
@@ -41,9 +41,9 @@ export const PreviewDataGridSrc = removeLicenseHeader(PreviewDataGridSrcRaw);
|
|
|
41
41
|
export const PreviewConfirmationStandaloneSrc = removeLicenseHeader(PreviewConfirmationStandaloneSrcRaw);
|
|
42
42
|
export const PreviewCodeConfirmationSrc = removeLicenseHeader(PreviewCodeConfirmationSrcRaw);
|
|
43
43
|
export const PreviewCodeLoadingSrc = removeLicenseHeader(PreviewCodeLoadingSrcRaw);
|
|
44
|
-
export const PreviewCodeReadSrc = removeLicenseHeader(PreviewCodeReadSrcRaw);
|
|
45
|
-
export const PreviewCodeWriteSrc = removeLicenseHeader(PreviewCodeWriteSrcRaw);
|
|
46
44
|
export const PreviewCodeLanguagesSrc = removeLicenseHeader(PreviewCodeLanguagesSrcRaw);
|
|
45
|
+
export const PreviewCodeCypherSrc = removeLicenseHeader(PreviewCodeCypherSrcRaw);
|
|
46
|
+
export const PreviewCodeTruncationSrc = removeLicenseHeader(PreviewCodeTruncationSrcRaw);
|
|
47
47
|
export const PreviewSimpleSrc = removeLicenseHeader(PreviewSimpleSrcRaw);
|
|
48
48
|
export const PreviewSimpleWithContentSrc = removeLicenseHeader(PreviewSimpleWithContentSrcRaw);
|
|
49
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACnG,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BAA4B,CAAC;AAC7D,OAAO,8BAA8B,MAAM,yCAAyC,CAAC;AAErF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CACjE,mCAAmC,CACpC,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAC3D,6BAA6B,CAC9B,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CACtD,wBAAwB,CACzB,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CACxD,0BAA0B,CAC3B,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,uBAAuB,CACxB,CAAC;AACF,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CACzD,2BAA2B,CAC5B,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAC5D,8BAA8B,CAC/B,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as PreviewDataGrid } from './preview-data-grid.story';\nexport { default as PreviewConfirmationStandalone } from './preview-confirmation-standalone.story';\nexport { default as PreviewCodeConfirmation } from './preview-code-confirmation.story';\nexport { default as PreviewCodeLoading } from './preview-code-loading.story';\nexport { default as PreviewCodeLanguages } from './preview-code-languages.story';\nexport { default as PreviewSimple } from './preview-simple.story';\nexport { default as PreviewSimpleWithContent } from './preview-simple-with-content.story';\nexport { default as PreviewCodeCypher } from './preview-code-cypher.story';\nexport { default as PreviewCodeTruncation } from './preview-code-truncation.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport PreviewCodeConfirmationSrcRaw from './preview-code-confirmation.story?raw';\nimport PreviewCodeCypherSrcRaw from './preview-code-cypher.story?raw';\nimport PreviewCodeLanguagesSrcRaw from './preview-code-languages.story?raw';\nimport PreviewCodeLoadingSrcRaw from './preview-code-loading.story?raw';\nimport PreviewCodeTruncationSrcRaw from './preview-code-truncation.story?raw';\nimport PreviewConfirmationStandaloneSrcRaw from './preview-confirmation-standalone.story?raw';\nimport PreviewDataGridSrcRaw from './preview-data-grid.story?raw';\nimport PreviewSimpleSrcRaw from './preview-simple.story?raw';\nimport PreviewSimpleWithContentSrcRaw from './preview-simple-with-content.story?raw';\n\nexport const PreviewDataGridSrc = removeLicenseHeader(PreviewDataGridSrcRaw);\nexport const PreviewConfirmationStandaloneSrc = removeLicenseHeader(\n PreviewConfirmationStandaloneSrcRaw,\n);\nexport const PreviewCodeConfirmationSrc = removeLicenseHeader(\n PreviewCodeConfirmationSrcRaw,\n);\nexport const PreviewCodeLoadingSrc = removeLicenseHeader(\n PreviewCodeLoadingSrcRaw,\n);\nexport const PreviewCodeLanguagesSrc = removeLicenseHeader(\n PreviewCodeLanguagesSrcRaw,\n);\nexport const PreviewCodeCypherSrc = removeLicenseHeader(\n PreviewCodeCypherSrcRaw,\n);\nexport const PreviewCodeTruncationSrc = removeLicenseHeader(\n PreviewCodeTruncationSrcRaw,\n);\nexport const PreviewSimpleSrc = removeLicenseHeader(PreviewSimpleSrcRaw);\nexport const PreviewSimpleWithContentSrc = removeLicenseHeader(\n PreviewSimpleWithContentSrcRaw,\n);\n"]}
|
|
@@ -28,7 +28,7 @@ username
|
|
|
28
28
|
[YIELD { * | field[, ...] } [ORDER BY field ...`;
|
|
29
29
|
const Component = () => {
|
|
30
30
|
const [status, setStatus] = useState('pending');
|
|
31
|
-
return (_jsxs(Preview, { children: [_jsx(Preview.Code, { code: cypherCode, language: "cypher",
|
|
31
|
+
return (_jsxs(Preview, { children: [_jsx(Preview.Code, { code: cypherCode, language: "cypher", heading: "Show functions executable by user", isLoading: false, headerActions: null }), _jsx(Preview.Confirmation, { status: status, isFooter: true, confirmedActionText: "Action confirmed", rejectedActionText: "Action rejected", actions: _jsxs(_Fragment, { children: [_jsx(OutlinedButton, { variant: "neutral", size: "small", onClick: () => setStatus('rejected'), children: "Skip" }), _jsx(FilledButton, { variant: "primary", size: "small", onClick: () => setStatus('confirmed'), children: "Run query" })] }), children: "Assistant wants to run this query" })] }));
|
|
32
32
|
};
|
|
33
33
|
export default Component;
|
|
34
34
|
//# sourceMappingURL=preview-code-confirmation.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-code-confirmation.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-confirmation.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,UAAU,GAAG;;gDAE6B,CAAC;AAEjD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GACvB,QAAQ,CACN,SAAS,CACV,CAAC;IAEJ,OAAO,CACL,MAAC,OAAO,eACN,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,QAAQ,EACjB,
|
|
1
|
+
{"version":3,"file":"preview-code-confirmation.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-confirmation.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,UAAU,GAAG;;gDAE6B,CAAC;AAEjD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GACvB,QAAQ,CACN,SAAS,CACV,CAAC;IAEJ,OAAO,CACL,MAAC,OAAO,eACN,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAC,mCAAmC,EAC3C,SAAS,EAAE,KAAK,EAChB,aAAa,EAAE,IAAI,GACnB,EACF,KAAC,OAAO,CAAC,YAAY,IACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,IAAI,EACd,mBAAmB,EAAC,kBAAkB,EACtC,kBAAkB,EAAC,iBAAiB,EACpC,OAAO,EACL,8BACE,KAAC,cAAc,IACb,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,qBAGrB,EACjB,KAAC,YAAY,IACX,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,0BAGxB,IACd,kDAIgB,IACf,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, OutlinedButton } from '@neo4j-ndl/react';\nimport { Preview } from '@neo4j-ndl/react/ai';\nimport { useState } from 'react';\n\nconst cypherCode = `SHOW [ALL|BUILT IN|USER DEFINED] FUNCTION[S] EXECUTABLE BY\nusername\n[YIELD { * | field[, ...] } [ORDER BY field ...`;\n\nconst Component = () => {\n const [status, setStatus] =\n useState<React.ComponentProps<typeof Preview.Confirmation>['status']>(\n 'pending',\n );\n\n return (\n <Preview>\n <Preview.Code\n code={cypherCode}\n language=\"cypher\"\n heading=\"Show functions executable by user\"\n isLoading={false}\n headerActions={null}\n />\n <Preview.Confirmation\n status={status}\n isFooter={true}\n confirmedActionText=\"Action confirmed\"\n rejectedActionText=\"Action rejected\"\n actions={\n <>\n <OutlinedButton\n variant=\"neutral\"\n size=\"small\"\n onClick={() => setStatus('rejected')}\n >\n Skip\n </OutlinedButton>\n <FilledButton\n variant=\"primary\"\n size=\"small\"\n onClick={() => setStatus('confirmed')}\n >\n Run query\n </FilledButton>\n </>\n }\n >\n Assistant wants to run this query\n </Preview.Confirmation>\n </Preview>\n );\n};\n\nexport default Component;\n"]}
|
package/lib/esm/ai/preview/stories/{preview-code-read.story.js → preview-code-cypher.story.js}
RENAMED
|
@@ -27,7 +27,7 @@ const cypherCode = `SHOW [ALL|BUILT IN|USER DEFINED] FUNCTION[S] EXECUTABLE BY
|
|
|
27
27
|
username
|
|
28
28
|
[YIELD { * | field[, ...] } [ORDER BY field ...`;
|
|
29
29
|
const Component = () => {
|
|
30
|
-
return (_jsx(Preview, { children: _jsx(Preview.Code, { code: cypherCode, language: "cypher",
|
|
30
|
+
return (_jsx(Preview, { children: _jsx(Preview.Code, { code: cypherCode, language: "cypher", heading: "Show functions executable by user", headerActions: _jsx(OutlinedButton, { leadingVisual: _jsx(PencilSquareIconOutline, {}), variant: "neutral", size: "small", children: "Send to Query" }) }) }));
|
|
31
31
|
};
|
|
32
32
|
export default Component;
|
|
33
|
-
//# sourceMappingURL=preview-code-
|
|
33
|
+
//# sourceMappingURL=preview-code-cypher.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-code-cypher.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-cypher.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,UAAU,GAAG;;gDAE6B,CAAC;AAEjD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,OAAO,cACN,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAC,mCAAmC,EAC3C,aAAa,EACX,KAAC,cAAc,IACb,aAAa,EAAE,KAAC,uBAAuB,KAAG,EAC1C,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,8BAGG,GAEnB,GACM,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { OutlinedButton } from '@neo4j-ndl/react';\nimport { Preview } from '@neo4j-ndl/react/ai';\nimport { PencilSquareIconOutline } from '@neo4j-ndl/react/icons';\n\nconst cypherCode = `SHOW [ALL|BUILT IN|USER DEFINED] FUNCTION[S] EXECUTABLE BY\nusername\n[YIELD { * | field[, ...] } [ORDER BY field ...`;\n\nconst Component = () => {\n return (\n <Preview>\n <Preview.Code\n code={cypherCode}\n language=\"cypher\"\n heading=\"Show functions executable by user\"\n headerActions={\n <OutlinedButton\n leadingVisual={<PencilSquareIconOutline />}\n variant=\"neutral\"\n size=\"small\"\n >\n Send to Query\n </OutlinedButton>\n }\n />\n </Preview>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -28,7 +28,7 @@ const pythonCode = `def show_functions(username, function_type='ALL'):
|
|
|
28
28
|
query = f"SHOW {function_type} FUNCTIONS EXECUTABLE BY {username}"
|
|
29
29
|
return query`;
|
|
30
30
|
const Component = () => {
|
|
31
|
-
return (_jsx(Preview, { children: _jsx(Preview.Code, { code: pythonCode, language: "python" }) }));
|
|
31
|
+
return (_jsx(Preview, { children: _jsx(Preview.Code, { code: pythonCode, language: "python", heading: "Show functions executable by user" }) }));
|
|
32
32
|
};
|
|
33
33
|
export default Component;
|
|
34
34
|
//# sourceMappingURL=preview-code-languages.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-code-languages.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-languages.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,UAAU,GAAG;;;;;iBAKF,CAAC;AAElB,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,OAAO,cACN,KAAC,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"preview-code-languages.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-languages.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,UAAU,GAAG;;;;;iBAKF,CAAC;AAElB,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,OAAO,cACN,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAC,mCAAmC,GAC3C,GACM,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Preview } from '@neo4j-ndl/react/ai';\n\nconst pythonCode = `def show_functions(username, function_type='ALL'):\n \"\"\"\n Show functions executable by user\n \"\"\"\n query = f\"SHOW {function_type} FUNCTIONS EXECUTABLE BY {username}\"\n return query`;\n\nconst Component = () => {\n return (\n <Preview>\n <Preview.Code\n code={pythonCode}\n language=\"python\"\n heading=\"Show functions executable by user\"\n />\n </Preview>\n );\n};\n\nexport default Component;\n"]}
|
package/lib/esm/ai/preview/stories/{preview-code-write.story.js → preview-code-truncation.story.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) "Neo4j"
|
|
@@ -20,14 +20,14 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
-
import {
|
|
23
|
+
import { OutlinedButton } from '@neo4j-ndl/react';
|
|
24
24
|
import { Preview } from '@neo4j-ndl/react/ai';
|
|
25
|
-
import { PencilSquareIconOutline
|
|
26
|
-
const cypherCode = `
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
import { PencilSquareIconOutline } from '@neo4j-ndl/react/icons';
|
|
26
|
+
const cypherCode = `MATCH (person:Person)-[:ACTED_IN]->(movie:Movie)
|
|
27
|
+
WHERE movie.released > 2000
|
|
28
|
+
RETURN person.name, movie.title`;
|
|
29
29
|
const Component = () => {
|
|
30
|
-
return (_jsx(Preview, { children: _jsx(Preview.Code, { code: cypherCode, language: "cypher",
|
|
30
|
+
return (_jsx("div", { style: { maxWidth: 400 }, children: _jsx(Preview, { children: _jsx(Preview.Code, { code: cypherCode, language: "cypher", heading: "Find all people who acted in movies released after the year 2000", headerActions: _jsx(OutlinedButton, { leadingVisual: _jsx(PencilSquareIconOutline, {}), variant: "neutral", size: "small", children: "Send to Query" }) }) }) }));
|
|
31
31
|
};
|
|
32
32
|
export default Component;
|
|
33
|
-
//# sourceMappingURL=preview-code-
|
|
33
|
+
//# sourceMappingURL=preview-code-truncation.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-code-truncation.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-truncation.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,UAAU,GAAG;;gCAEa,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,YAC3B,KAAC,OAAO,cACN,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAC,kEAAkE,EAC1E,aAAa,EACX,KAAC,cAAc,IACb,aAAa,EAAE,KAAC,uBAAuB,KAAG,EAC1C,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,8BAGG,GAEnB,GACM,GACN,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { OutlinedButton } from '@neo4j-ndl/react';\nimport { Preview } from '@neo4j-ndl/react/ai';\nimport { PencilSquareIconOutline } from '@neo4j-ndl/react/icons';\n\nconst cypherCode = `MATCH (person:Person)-[:ACTED_IN]->(movie:Movie)\nWHERE movie.released > 2000\nRETURN person.name, movie.title`;\n\nconst Component = () => {\n return (\n <div style={{ maxWidth: 400 }}>\n <Preview>\n <Preview.Code\n code={cypherCode}\n language=\"cypher\"\n heading=\"Find all people who acted in movies released after the year 2000\"\n headerActions={\n <OutlinedButton\n leadingVisual={<PencilSquareIconOutline />}\n variant=\"neutral\"\n size=\"small\"\n >\n Send to Query\n </OutlinedButton>\n }\n />\n </Preview>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { Tooltip } from '../tooltip';
|
|
23
|
+
type TruncatedTextWithTooltipProps = {
|
|
24
|
+
/** The text to display. Truncated with an ellipsis when space is limited. */
|
|
25
|
+
text: string;
|
|
26
|
+
/** Class name applied to the text element. Typography is inherited from the parent. */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Placement of the tooltip showing the full text. */
|
|
29
|
+
tooltipPlacement?: React.ComponentProps<typeof Tooltip>['placement'];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Internal component that renders single-line truncating text and, only while
|
|
33
|
+
* the text is actually clipped, shows a tooltip with the full text.
|
|
34
|
+
*
|
|
35
|
+
* Accessibility: the text element receives `tabIndex={0}` only while truncated,
|
|
36
|
+
* so sighted keyboard users can reveal the full text on focus without adding a
|
|
37
|
+
* dead tab stop otherwise. No button semantics are used since there is no
|
|
38
|
+
* action to perform. Screen readers always receive the full text from the
|
|
39
|
+
* element's own content, as CSS truncation is visual-only. The tooltip is
|
|
40
|
+
* dismissible with Escape and hoverable (WCAG 1.4.13).
|
|
41
|
+
*
|
|
42
|
+
* @internal - Not part of the public API.
|
|
43
|
+
*/
|
|
44
|
+
export declare const TruncatedTextWithTooltip: ({ text, className, tooltipPlacement, }: TruncatedTextWithTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=TruncatedTextWithTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TruncatedTextWithTooltip.d.ts","sourceRoot":"","sources":["../../../src/_common/TruncatedTextWithTooltip.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA4BrC,KAAK,6BAA6B,GAAG;IACnC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;CACtE,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,GAAI,wCAItC,6BAA6B,4CAqB/B,CAAC"}
|
|
@@ -24,7 +24,9 @@ type PreviewProps = {
|
|
|
24
24
|
children: React.ReactNode;
|
|
25
25
|
};
|
|
26
26
|
type PreviewHeaderProps = {
|
|
27
|
+
/** The content to display in the header. When a plain string is passed, it truncates with an ellipsis and shows a tooltip with the full text when space is limited. */
|
|
27
28
|
children?: React.ReactNode;
|
|
29
|
+
/** The actions to display in the header. Should be small buttons or icon buttons only. */
|
|
28
30
|
actions?: React.ReactNode;
|
|
29
31
|
};
|
|
30
32
|
type PreviewConfirmationProps = {
|
|
@@ -46,7 +48,9 @@ type PreviewCodeProps = {
|
|
|
46
48
|
code: string;
|
|
47
49
|
/** The language of the code (e.g., 'cypher', 'python', 'javascript') */
|
|
48
50
|
language: React.ComponentProps<typeof CodeBlock>['language'];
|
|
49
|
-
/** The current state of the code block
|
|
51
|
+
/** The current state of the code block
|
|
52
|
+
* @deprecated - The query should be described in the heading property instead.
|
|
53
|
+
*/
|
|
50
54
|
label?: 'read' | 'write';
|
|
51
55
|
/** Whether the code block is loading */
|
|
52
56
|
isLoading?: boolean;
|
|
@@ -54,12 +58,14 @@ type PreviewCodeProps = {
|
|
|
54
58
|
headerActions?: React.ReactNode;
|
|
55
59
|
/** The theme of the code block */
|
|
56
60
|
theme?: 'ndl-code-dark' | 'ndl-code-light';
|
|
61
|
+
/** The heading to display in the header. If not provided, the language will be displayed. Truncates with an ellipsis and shows a tooltip with the full text when space is limited. */
|
|
62
|
+
heading?: string;
|
|
57
63
|
};
|
|
58
64
|
type PreviewContentProps = {
|
|
59
65
|
children?: React.ReactNode;
|
|
60
66
|
};
|
|
61
67
|
export declare const Preview: (({ children, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewProps>) => import("react/jsx-runtime").JSX.Element) & {
|
|
62
|
-
Code: ({ code, language, label, isLoading, headerActions, theme, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewCodeProps>) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
Code: ({ code, language, label, isLoading, headerActions, theme, heading, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewCodeProps>) => import("react/jsx-runtime").JSX.Element;
|
|
63
69
|
Confirmation: ({ children, actions, isFooter, status, confirmedActionText, rejectedActionText, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewConfirmationProps>) => import("react/jsx-runtime").JSX.Element;
|
|
64
70
|
Content: ({ children, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
65
71
|
Header: ({ children, actions, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewHeaderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../../../src/ai/preview/Preview.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../../../src/ai/preview/Preview.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAWvD,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AA4BF,KAAK,kBAAkB,GAAG;IACxB,uKAAuK;IACvK,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0FAA0F;IAC1F,O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;yFA3PvC,WAAW,CAAC,KAAK,EAAE,kBAAkB,CAAC;CA8QvC,CAAC"}
|
|
@@ -22,18 +22,18 @@ export { default as PreviewDataGrid } from './preview-data-grid.story';
|
|
|
22
22
|
export { default as PreviewConfirmationStandalone } from './preview-confirmation-standalone.story';
|
|
23
23
|
export { default as PreviewCodeConfirmation } from './preview-code-confirmation.story';
|
|
24
24
|
export { default as PreviewCodeLoading } from './preview-code-loading.story';
|
|
25
|
-
export { default as PreviewCodeRead } from './preview-code-read.story';
|
|
26
|
-
export { default as PreviewCodeWrite } from './preview-code-write.story';
|
|
27
25
|
export { default as PreviewCodeLanguages } from './preview-code-languages.story';
|
|
28
26
|
export { default as PreviewSimple } from './preview-simple.story';
|
|
29
27
|
export { default as PreviewSimpleWithContent } from './preview-simple-with-content.story';
|
|
28
|
+
export { default as PreviewCodeCypher } from './preview-code-cypher.story';
|
|
29
|
+
export { default as PreviewCodeTruncation } from './preview-code-truncation.story';
|
|
30
30
|
export declare const PreviewDataGridSrc: string;
|
|
31
31
|
export declare const PreviewConfirmationStandaloneSrc: string;
|
|
32
32
|
export declare const PreviewCodeConfirmationSrc: string;
|
|
33
33
|
export declare const PreviewCodeLoadingSrc: string;
|
|
34
|
-
export declare const PreviewCodeReadSrc: string;
|
|
35
|
-
export declare const PreviewCodeWriteSrc: string;
|
|
36
34
|
export declare const PreviewCodeLanguagesSrc: string;
|
|
35
|
+
export declare const PreviewCodeCypherSrc: string;
|
|
36
|
+
export declare const PreviewCodeTruncationSrc: string;
|
|
37
37
|
export declare const PreviewSimpleSrc: string;
|
|
38
38
|
export declare const PreviewSimpleWithContentSrc: string;
|
|
39
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,E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AACF,eAAO,MAAM,gBAAgB,QAA2C,CAAC;AACzE,eAAO,MAAM,2BAA2B,QAEvC,CAAC"}
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
22
|
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export default Component;
|
|
24
|
-
//# sourceMappingURL=preview-code-
|
|
24
|
+
//# sourceMappingURL=preview-code-cypher.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-code-cypher.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-cypher.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAUjD,QAAA,MAAM,SAAS,+CAmBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-code-languages.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-languages.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAWjD,QAAA,MAAM,SAAS,+
|
|
1
|
+
{"version":3,"file":"preview-code-languages.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-languages.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAWjD,QAAA,MAAM,SAAS,+CAUd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
22
|
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export default Component;
|
|
24
|
-
//# sourceMappingURL=preview-code-
|
|
24
|
+
//# sourceMappingURL=preview-code-truncation.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-code-truncation.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-truncation.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAUjD,QAAA,MAAM,SAAS,+CAqBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.11",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
"@tanstack/react-table": "8.21.3",
|
|
400
400
|
"react": ">=19.0.0",
|
|
401
401
|
"react-dom": ">=19.0.0",
|
|
402
|
-
"@neo4j-ndl/base": "^4.17.
|
|
402
|
+
"@neo4j-ndl/base": "^4.17.6"
|
|
403
403
|
},
|
|
404
404
|
"dependencies": {
|
|
405
405
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -142,7 +142,7 @@ Building blocks for AI chat / agent UIs, imported from the `@neo4j-ndl/react/ai`
|
|
|
142
142
|
| `ImageTag` | [components/ai/image-tag.md](components/ai/image-tag.md) | | 3 |
|
|
143
143
|
| `MoreFilesComponent` | [components/ai/more-files.md](components/ai/more-files.md) | | 1 |
|
|
144
144
|
| `Presence` | [components/ai/presence.md](components/ai/presence.md) | | 2 |
|
|
145
|
-
| `Preview` | [components/ai/preview.md](components/ai/preview.md) |
|
|
145
|
+
| `Preview` | [components/ai/preview.md](components/ai/preview.md) | ✅ | 9 |
|
|
146
146
|
| `Prompt` | [components/ai/prompt.md](components/ai/prompt.md) | | 6 |
|
|
147
147
|
| `Reasoning` | [components/ai/reasoning.md](components/ai/reasoning.md) | | 1 |
|
|
148
148
|
| `Response` | [components/ai/response.md](components/ai/response.md) | | 7 |
|