@neo4j-ndl/react 4.1.9 → 4.2.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/lib/cjs/ai/code-preview/CodePreview.js +91 -0
- package/lib/cjs/ai/code-preview/CodePreview.js.map +1 -0
- package/lib/cjs/ai/code-preview/index.js +26 -0
- package/lib/cjs/ai/code-preview/index.js.map +1 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-languages.story.js +37 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-languages.story.js.map +1 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-loading.story.js +31 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-loading.story.js.map +1 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-read.story.js +36 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-read.story.js.map +1 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-write.story.js +36 -0
- package/lib/cjs/ai/code-preview/stories/code-preview-write.story.js.map +1 -0
- package/lib/cjs/ai/code-preview/stories/code-preview.stories.js +88 -0
- package/lib/cjs/ai/code-preview/stories/code-preview.stories.js.map +1 -0
- package/lib/cjs/ai/code-preview/stories/index.js +44 -0
- package/lib/cjs/ai/code-preview/stories/index.js.map +1 -0
- package/lib/cjs/ai/file-tag/FileTag.js +58 -0
- package/lib/cjs/ai/file-tag/FileTag.js.map +1 -0
- package/lib/cjs/ai/file-tag/index.js +38 -0
- package/lib/cjs/ai/file-tag/index.js.map +1 -0
- package/lib/cjs/ai/file-tag/stories/file-tag-chat.story.js +31 -0
- package/lib/cjs/ai/file-tag/stories/file-tag-chat.story.js.map +1 -0
- package/lib/cjs/ai/file-tag/stories/file-tag-loading.story.js +33 -0
- package/lib/cjs/ai/file-tag/stories/file-tag-loading.story.js.map +1 -0
- package/lib/cjs/ai/file-tag/stories/file-tag-prompt.story.js +33 -0
- package/lib/cjs/ai/file-tag/stories/file-tag-prompt.story.js.map +1 -0
- package/lib/cjs/ai/file-tag/stories/file-tag.stories.js +76 -0
- package/lib/cjs/ai/file-tag/stories/file-tag.stories.js.map +1 -0
- package/lib/cjs/ai/file-tag/stories/index.js +40 -0
- package/lib/cjs/ai/file-tag/stories/index.js.map +1 -0
- package/lib/cjs/ai/image-tag/ImageTag.js +58 -0
- package/lib/cjs/ai/image-tag/ImageTag.js.map +1 -0
- package/lib/cjs/ai/image-tag/index.js +38 -0
- package/lib/cjs/ai/image-tag/index.js.map +1 -0
- package/lib/cjs/ai/image-tag/stories/image-tag-chat.story.js +30 -0
- package/lib/cjs/ai/image-tag/stories/image-tag-chat.story.js.map +1 -0
- package/lib/cjs/ai/image-tag/stories/image-tag-loading.story.js +32 -0
- package/lib/cjs/ai/image-tag/stories/image-tag-loading.story.js.map +1 -0
- package/lib/cjs/ai/image-tag/stories/image-tag-prompt.story.js +32 -0
- package/lib/cjs/ai/image-tag/stories/image-tag-prompt.story.js.map +1 -0
- package/lib/cjs/ai/image-tag/stories/image-tag.stories.js +76 -0
- package/lib/cjs/ai/image-tag/stories/image-tag.stories.js.map +1 -0
- package/lib/cjs/ai/image-tag/stories/index.js +40 -0
- package/lib/cjs/ai/image-tag/stories/index.js.map +1 -0
- package/lib/cjs/ai/index.js +23 -1
- package/lib/cjs/ai/index.js.map +1 -1
- package/lib/cjs/ai/more-files/MoreFiles.js +55 -0
- package/lib/cjs/ai/more-files/MoreFiles.js.map +1 -0
- package/lib/cjs/ai/more-files/index.js +38 -0
- package/lib/cjs/ai/more-files/index.js.map +1 -0
- package/lib/cjs/ai/more-files/stories/index.js +32 -0
- package/lib/cjs/ai/more-files/stories/index.js.map +1 -0
- package/lib/cjs/ai/more-files/stories/more-files.stories.js +50 -0
- package/lib/cjs/ai/more-files/stories/more-files.stories.js.map +1 -0
- package/lib/cjs/ai/more-files/stories/more-files.story.js +35 -0
- package/lib/cjs/ai/more-files/stories/more-files.story.js.map +1 -0
- package/lib/cjs/ai/presence/Presence.js +5 -1
- package/lib/cjs/ai/presence/Presence.js.map +1 -1
- package/lib/cjs/ai/prompt/Prompt.js +163 -0
- package/lib/cjs/ai/prompt/Prompt.js.map +1 -0
- package/lib/cjs/ai/prompt/index.js +38 -0
- package/lib/cjs/ai/prompt/index.js.map +1 -0
- package/lib/cjs/ai/prompt/stories/index.js +36 -0
- package/lib/cjs/ai/prompt/stories/index.js.map +1 -0
- package/lib/cjs/ai/prompt/stories/prompt-advanced.story.js +56 -0
- package/lib/cjs/ai/prompt/stories/prompt-advanced.story.js.map +1 -0
- package/lib/cjs/ai/prompt/stories/prompt-default.story.js +40 -0
- package/lib/cjs/ai/prompt/stories/prompt-default.story.js.map +1 -0
- package/lib/cjs/ai/prompt/stories/prompt.stories.js +63 -0
- package/lib/cjs/ai/prompt/stories/prompt.stories.js.map +1 -0
- package/lib/cjs/ai/reasoning/Reasoning.js +77 -0
- package/lib/cjs/ai/reasoning/Reasoning.js.map +1 -0
- package/lib/cjs/ai/reasoning/index.js +38 -0
- package/lib/cjs/ai/reasoning/index.js.map +1 -0
- package/lib/cjs/ai/reasoning/stories/index.js +32 -0
- package/lib/cjs/ai/reasoning/stories/index.js.map +1 -0
- package/lib/cjs/ai/reasoning/stories/reasoning-full.story.js +34 -0
- package/lib/cjs/ai/reasoning/stories/reasoning-full.story.js.map +1 -0
- package/lib/cjs/ai/reasoning/stories/reasoning.stories.js +50 -0
- package/lib/cjs/ai/reasoning/stories/reasoning.stories.js.map +1 -0
- package/lib/cjs/ai/response/Response.js +185 -0
- package/lib/cjs/ai/response/Response.js.map +1 -0
- package/lib/cjs/ai/response/index.js +26 -0
- package/lib/cjs/ai/response/index.js.map +1 -0
- package/lib/cjs/ai/response/stories/index.js +56 -0
- package/lib/cjs/ai/response/stories/index.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-all-components.story.js +229 -0
- package/lib/cjs/ai/response/stories/response-all-components.story.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-code-examples.story.js +248 -0
- package/lib/cjs/ai/response/stories/response-code-examples.story.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-default.story.js +50 -0
- package/lib/cjs/ai/response/stories/response-default.story.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-full-example.story.js +162 -0
- package/lib/cjs/ai/response/stories/response-full-example.story.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-headings.story.js +120 -0
- package/lib/cjs/ai/response/stories/response-headings.story.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-lists.story.js +170 -0
- package/lib/cjs/ai/response/stories/response-lists.story.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-streaming.story.js +65 -0
- package/lib/cjs/ai/response/stories/response-streaming.story.js.map +1 -0
- package/lib/cjs/ai/response/stories/response.stories.js +132 -0
- package/lib/cjs/ai/response/stories/response.stories.js.map +1 -0
- package/lib/cjs/ai/suggestion/Suggestion.js +58 -0
- package/lib/cjs/ai/suggestion/Suggestion.js.map +1 -0
- package/lib/cjs/ai/suggestion/index.js +38 -0
- package/lib/cjs/ai/suggestion/index.js.map +1 -0
- package/lib/cjs/ai/suggestion/stories/index.js +44 -0
- package/lib/cjs/ai/suggestion/stories/index.js.map +1 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-default.story.js +30 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-default.story.js.map +1 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-icon.story.js +31 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-icon.story.js.map +1 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-primary.story.js +30 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-primary.story.js.map +1 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-sizes.story.js +30 -0
- package/lib/cjs/ai/suggestion/stories/suggestion-sizes.story.js.map +1 -0
- package/lib/cjs/ai/suggestion/stories/suggestion.stories.js +89 -0
- package/lib/cjs/ai/suggestion/stories/suggestion.stories.js.map +1 -0
- package/lib/cjs/ai/thinking/Thinking.js +57 -0
- package/lib/cjs/ai/thinking/Thinking.js.map +1 -0
- package/lib/cjs/ai/thinking/index.js +38 -0
- package/lib/cjs/ai/thinking/index.js.map +1 -0
- package/lib/cjs/ai/thinking/stories/ai-thinking-default.story.js +30 -0
- package/lib/cjs/ai/thinking/stories/ai-thinking-default.story.js.map +1 -0
- package/lib/cjs/ai/thinking/stories/ai-thinking-finished.story.js +30 -0
- package/lib/cjs/ai/thinking/stories/ai-thinking-finished.story.js.map +1 -0
- package/lib/cjs/ai/thinking/stories/ai-thinking.stories.js +63 -0
- package/lib/cjs/ai/thinking/stories/ai-thinking.stories.js.map +1 -0
- package/lib/cjs/ai/thinking/stories/index.js +36 -0
- package/lib/cjs/ai/thinking/stories/index.js.map +1 -0
- package/lib/cjs/ai/thinking/thinking-duration-formatter.js +71 -0
- package/lib/cjs/ai/thinking/thinking-duration-formatter.js.map +1 -0
- package/lib/cjs/ai/tool-call/ToolCall.js +55 -0
- package/lib/cjs/ai/tool-call/ToolCall.js.map +1 -0
- package/lib/cjs/ai/tool-call/index.js +38 -0
- package/lib/cjs/ai/tool-call/index.js.map +1 -0
- package/lib/cjs/ai/tool-call/stories/index.js +36 -0
- package/lib/cjs/ai/tool-call/stories/index.js.map +1 -0
- package/lib/cjs/ai/tool-call/stories/tool-call-default.story.js +30 -0
- package/lib/cjs/ai/tool-call/stories/tool-call-default.story.js.map +1 -0
- package/lib/cjs/ai/tool-call/stories/tool-call-done.story.js +30 -0
- package/lib/cjs/ai/tool-call/stories/tool-call-done.story.js.map +1 -0
- package/lib/cjs/ai/tool-call/stories/tool-call.stories.js +63 -0
- package/lib/cjs/ai/tool-call/stories/tool-call.stories.js.map +1 -0
- package/lib/cjs/ai/user-bubble/UserBubble.js +53 -0
- package/lib/cjs/ai/user-bubble/UserBubble.js.map +1 -0
- package/lib/cjs/ai/user-bubble/index.js +38 -0
- package/lib/cjs/ai/user-bubble/index.js.map +1 -0
- package/lib/cjs/ai/user-bubble/stories/index.js +44 -0
- package/lib/cjs/ai/user-bubble/stories/index.js.map +1 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble-action.story.js +35 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble-action.story.js.map +1 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble-and-files.story.js +39 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble-and-files.story.js.map +1 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble-long.story.js +33 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble-long.story.js.map +1 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble.stories.js +89 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble.stories.js.map +1 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble.story.js +34 -0
- package/lib/cjs/ai/user-bubble/stories/user-bubble.story.js.map +1 -0
- package/lib/cjs/code/Code.js.map +1 -1
- package/lib/cjs/text-area/TextArea.js.map +1 -1
- package/lib/esm/ai/code-preview/CodePreview.js +84 -0
- package/lib/esm/ai/code-preview/CodePreview.js.map +1 -0
- package/lib/esm/ai/code-preview/index.js +22 -0
- package/lib/esm/ai/code-preview/index.js.map +1 -0
- package/lib/esm/ai/code-preview/stories/code-preview-languages.story.js +33 -0
- package/lib/esm/ai/code-preview/stories/code-preview-languages.story.js.map +1 -0
- package/lib/esm/ai/code-preview/stories/code-preview-loading.story.js +27 -0
- package/lib/esm/ai/code-preview/stories/code-preview-loading.story.js.map +1 -0
- package/lib/esm/ai/code-preview/stories/code-preview-read.story.js +32 -0
- package/lib/esm/ai/code-preview/stories/code-preview-read.story.js.map +1 -0
- package/lib/esm/ai/code-preview/stories/code-preview-write.story.js +32 -0
- package/lib/esm/ai/code-preview/stories/code-preview-write.story.js.map +1 -0
- package/lib/esm/ai/code-preview/stories/code-preview.stories.js +85 -0
- package/lib/esm/ai/code-preview/stories/code-preview.stories.js.map +1 -0
- package/lib/esm/ai/code-preview/stories/index.js +34 -0
- package/lib/esm/ai/code-preview/stories/index.js.map +1 -0
- package/lib/esm/ai/file-tag/FileTag.js +52 -0
- package/lib/esm/ai/file-tag/FileTag.js.map +1 -0
- package/lib/esm/ai/file-tag/index.js +22 -0
- package/lib/esm/ai/file-tag/index.js.map +1 -0
- package/lib/esm/ai/file-tag/stories/file-tag-chat.story.js +29 -0
- package/lib/esm/ai/file-tag/stories/file-tag-chat.story.js.map +1 -0
- package/lib/esm/ai/file-tag/stories/file-tag-loading.story.js +31 -0
- package/lib/esm/ai/file-tag/stories/file-tag-loading.story.js.map +1 -0
- package/lib/esm/ai/file-tag/stories/file-tag-prompt.story.js +31 -0
- package/lib/esm/ai/file-tag/stories/file-tag-prompt.story.js.map +1 -0
- package/lib/esm/ai/file-tag/stories/file-tag.stories.js +73 -0
- package/lib/esm/ai/file-tag/stories/file-tag.stories.js.map +1 -0
- package/lib/esm/ai/file-tag/stories/index.js +31 -0
- package/lib/esm/ai/file-tag/stories/index.js.map +1 -0
- package/lib/esm/ai/image-tag/ImageTag.js +52 -0
- package/lib/esm/ai/image-tag/ImageTag.js.map +1 -0
- package/lib/esm/ai/image-tag/index.js +22 -0
- package/lib/esm/ai/image-tag/index.js.map +1 -0
- package/lib/esm/ai/image-tag/stories/image-tag-chat.story.js +28 -0
- package/lib/esm/ai/image-tag/stories/image-tag-chat.story.js.map +1 -0
- package/lib/esm/ai/image-tag/stories/image-tag-loading.story.js +30 -0
- package/lib/esm/ai/image-tag/stories/image-tag-loading.story.js.map +1 -0
- package/lib/esm/ai/image-tag/stories/image-tag-prompt.story.js +30 -0
- package/lib/esm/ai/image-tag/stories/image-tag-prompt.story.js.map +1 -0
- package/lib/esm/ai/image-tag/stories/image-tag.stories.js +73 -0
- package/lib/esm/ai/image-tag/stories/image-tag.stories.js.map +1 -0
- package/lib/esm/ai/image-tag/stories/index.js +31 -0
- package/lib/esm/ai/image-tag/stories/index.js.map +1 -0
- package/lib/esm/ai/index.js +11 -0
- package/lib/esm/ai/index.js.map +1 -1
- package/lib/esm/ai/more-files/MoreFiles.js +49 -0
- package/lib/esm/ai/more-files/MoreFiles.js.map +1 -0
- package/lib/esm/ai/more-files/index.js +22 -0
- package/lib/esm/ai/more-files/index.js.map +1 -0
- package/lib/esm/ai/more-files/stories/index.js +25 -0
- package/lib/esm/ai/more-files/stories/index.js.map +1 -0
- package/lib/esm/ai/more-files/stories/more-files.stories.js +47 -0
- package/lib/esm/ai/more-files/stories/more-files.stories.js.map +1 -0
- package/lib/esm/ai/more-files/stories/more-files.story.js +33 -0
- package/lib/esm/ai/more-files/stories/more-files.story.js.map +1 -0
- package/lib/esm/ai/presence/Presence.js +5 -1
- package/lib/esm/ai/presence/Presence.js.map +1 -1
- package/lib/esm/ai/prompt/Prompt.js +157 -0
- package/lib/esm/ai/prompt/Prompt.js.map +1 -0
- package/lib/esm/ai/prompt/index.js +22 -0
- package/lib/esm/ai/prompt/index.js.map +1 -0
- package/lib/esm/ai/prompt/stories/index.js +28 -0
- package/lib/esm/ai/prompt/stories/index.js.map +1 -0
- package/lib/esm/ai/prompt/stories/prompt-advanced.story.js +54 -0
- package/lib/esm/ai/prompt/stories/prompt-advanced.story.js.map +1 -0
- package/lib/esm/ai/prompt/stories/prompt-default.story.js +38 -0
- package/lib/esm/ai/prompt/stories/prompt-default.story.js.map +1 -0
- package/lib/esm/ai/prompt/stories/prompt.stories.js +60 -0
- package/lib/esm/ai/prompt/stories/prompt.stories.js.map +1 -0
- package/lib/esm/ai/reasoning/Reasoning.js +71 -0
- package/lib/esm/ai/reasoning/Reasoning.js.map +1 -0
- package/lib/esm/ai/reasoning/index.js +22 -0
- package/lib/esm/ai/reasoning/index.js.map +1 -0
- package/lib/esm/ai/reasoning/stories/index.js +25 -0
- package/lib/esm/ai/reasoning/stories/index.js.map +1 -0
- package/lib/esm/ai/reasoning/stories/reasoning-full.story.js +32 -0
- package/lib/esm/ai/reasoning/stories/reasoning-full.story.js.map +1 -0
- package/lib/esm/ai/reasoning/stories/reasoning.stories.js +47 -0
- package/lib/esm/ai/reasoning/stories/reasoning.stories.js.map +1 -0
- package/lib/esm/ai/response/Response.js +179 -0
- package/lib/esm/ai/response/Response.js.map +1 -0
- package/lib/esm/ai/response/index.js +22 -0
- package/lib/esm/ai/response/index.js.map +1 -0
- package/lib/esm/ai/response/stories/index.js +43 -0
- package/lib/esm/ai/response/stories/index.js.map +1 -0
- package/lib/esm/ai/response/stories/response-all-components.story.js +225 -0
- package/lib/esm/ai/response/stories/response-all-components.story.js.map +1 -0
- package/lib/esm/ai/response/stories/response-code-examples.story.js +244 -0
- package/lib/esm/ai/response/stories/response-code-examples.story.js.map +1 -0
- package/lib/esm/ai/response/stories/response-default.story.js +46 -0
- package/lib/esm/ai/response/stories/response-default.story.js.map +1 -0
- package/lib/esm/ai/response/stories/response-full-example.story.js +158 -0
- package/lib/esm/ai/response/stories/response-full-example.story.js.map +1 -0
- package/lib/esm/ai/response/stories/response-headings.story.js +116 -0
- package/lib/esm/ai/response/stories/response-headings.story.js.map +1 -0
- package/lib/esm/ai/response/stories/response-lists.story.js +166 -0
- package/lib/esm/ai/response/stories/response-lists.story.js.map +1 -0
- package/lib/esm/ai/response/stories/response-streaming.story.js +61 -0
- package/lib/esm/ai/response/stories/response-streaming.story.js.map +1 -0
- package/lib/esm/ai/response/stories/response.stories.js +129 -0
- package/lib/esm/ai/response/stories/response.stories.js.map +1 -0
- package/lib/esm/ai/suggestion/Suggestion.js +52 -0
- package/lib/esm/ai/suggestion/Suggestion.js.map +1 -0
- package/lib/esm/ai/suggestion/index.js +22 -0
- package/lib/esm/ai/suggestion/index.js.map +1 -0
- package/lib/esm/ai/suggestion/stories/index.js +34 -0
- package/lib/esm/ai/suggestion/stories/index.js.map +1 -0
- package/lib/esm/ai/suggestion/stories/suggestion-default.story.js +28 -0
- package/lib/esm/ai/suggestion/stories/suggestion-default.story.js.map +1 -0
- package/lib/esm/ai/suggestion/stories/suggestion-icon.story.js +29 -0
- package/lib/esm/ai/suggestion/stories/suggestion-icon.story.js.map +1 -0
- package/lib/esm/ai/suggestion/stories/suggestion-primary.story.js +28 -0
- package/lib/esm/ai/suggestion/stories/suggestion-primary.story.js.map +1 -0
- package/lib/esm/ai/suggestion/stories/suggestion-sizes.story.js +28 -0
- package/lib/esm/ai/suggestion/stories/suggestion-sizes.story.js.map +1 -0
- package/lib/esm/ai/suggestion/stories/suggestion.stories.js +86 -0
- package/lib/esm/ai/suggestion/stories/suggestion.stories.js.map +1 -0
- package/lib/esm/ai/thinking/Thinking.js +51 -0
- package/lib/esm/ai/thinking/Thinking.js.map +1 -0
- package/lib/esm/ai/thinking/index.js +22 -0
- package/lib/esm/ai/thinking/index.js.map +1 -0
- package/lib/esm/ai/thinking/stories/ai-thinking-default.story.js +28 -0
- package/lib/esm/ai/thinking/stories/ai-thinking-default.story.js.map +1 -0
- package/lib/esm/ai/thinking/stories/ai-thinking-finished.story.js +28 -0
- package/lib/esm/ai/thinking/stories/ai-thinking-finished.story.js.map +1 -0
- package/lib/esm/ai/thinking/stories/ai-thinking.stories.js +60 -0
- package/lib/esm/ai/thinking/stories/ai-thinking.stories.js.map +1 -0
- package/lib/esm/ai/thinking/stories/index.js +28 -0
- package/lib/esm/ai/thinking/stories/index.js.map +1 -0
- package/lib/esm/ai/thinking/thinking-duration-formatter.js +67 -0
- package/lib/esm/ai/thinking/thinking-duration-formatter.js.map +1 -0
- package/lib/esm/ai/tool-call/ToolCall.js +49 -0
- package/lib/esm/ai/tool-call/ToolCall.js.map +1 -0
- package/lib/esm/ai/tool-call/index.js +22 -0
- package/lib/esm/ai/tool-call/index.js.map +1 -0
- package/lib/esm/ai/tool-call/stories/index.js +28 -0
- package/lib/esm/ai/tool-call/stories/index.js.map +1 -0
- package/lib/esm/ai/tool-call/stories/tool-call-default.story.js +28 -0
- package/lib/esm/ai/tool-call/stories/tool-call-default.story.js.map +1 -0
- package/lib/esm/ai/tool-call/stories/tool-call-done.story.js +28 -0
- package/lib/esm/ai/tool-call/stories/tool-call-done.story.js.map +1 -0
- package/lib/esm/ai/tool-call/stories/tool-call.stories.js +60 -0
- package/lib/esm/ai/tool-call/stories/tool-call.stories.js.map +1 -0
- package/lib/esm/ai/user-bubble/UserBubble.js +47 -0
- package/lib/esm/ai/user-bubble/UserBubble.js.map +1 -0
- package/lib/esm/ai/user-bubble/index.js +22 -0
- package/lib/esm/ai/user-bubble/index.js.map +1 -0
- package/lib/esm/ai/user-bubble/stories/index.js +34 -0
- package/lib/esm/ai/user-bubble/stories/index.js.map +1 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble-action.story.js +33 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble-action.story.js.map +1 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble-and-files.story.js +37 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble-and-files.story.js.map +1 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble-long.story.js +31 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble-long.story.js.map +1 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble.stories.js +86 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble.stories.js.map +1 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble.story.js +32 -0
- package/lib/esm/ai/user-bubble/stories/user-bubble.story.js.map +1 -0
- package/lib/esm/code/Code.js.map +1 -1
- package/lib/esm/text-area/TextArea.js.map +1 -1
- package/lib/types/ai/code-preview/CodePreview.d.ts +44 -0
- package/lib/types/ai/code-preview/CodePreview.d.ts.map +1 -0
- package/lib/types/ai/code-preview/index.d.ts +22 -0
- package/lib/types/ai/code-preview/index.d.ts.map +1 -0
- package/lib/types/ai/code-preview/stories/code-preview-languages.story.d.ts +23 -0
- package/lib/types/ai/code-preview/stories/code-preview-languages.story.d.ts.map +1 -0
- package/lib/types/ai/code-preview/stories/code-preview-loading.story.d.ts +23 -0
- package/lib/types/ai/code-preview/stories/code-preview-loading.story.d.ts.map +1 -0
- package/lib/types/ai/code-preview/stories/code-preview-read.story.d.ts +23 -0
- package/lib/types/ai/code-preview/stories/code-preview-read.story.d.ts.map +1 -0
- package/lib/types/ai/code-preview/stories/code-preview-write.story.d.ts +23 -0
- package/lib/types/ai/code-preview/stories/code-preview-write.story.d.ts.map +1 -0
- package/lib/types/ai/code-preview/stories/code-preview.stories.d.ts +30 -0
- package/lib/types/ai/code-preview/stories/code-preview.stories.d.ts.map +1 -0
- package/lib/types/ai/code-preview/stories/index.d.ts +29 -0
- package/lib/types/ai/code-preview/stories/index.d.ts.map +1 -0
- package/lib/types/ai/file-tag/FileTag.d.ts +44 -0
- package/lib/types/ai/file-tag/FileTag.d.ts.map +1 -0
- package/lib/types/ai/file-tag/index.d.ts +22 -0
- package/lib/types/ai/file-tag/index.d.ts.map +1 -0
- package/lib/types/ai/file-tag/stories/file-tag-chat.story.d.ts +24 -0
- package/lib/types/ai/file-tag/stories/file-tag-chat.story.d.ts.map +1 -0
- package/lib/types/ai/file-tag/stories/file-tag-loading.story.d.ts +24 -0
- package/lib/types/ai/file-tag/stories/file-tag-loading.story.d.ts.map +1 -0
- package/lib/types/ai/file-tag/stories/file-tag-prompt.story.d.ts +24 -0
- package/lib/types/ai/file-tag/stories/file-tag-prompt.story.d.ts.map +1 -0
- package/lib/types/ai/file-tag/stories/file-tag.stories.d.ts +29 -0
- package/lib/types/ai/file-tag/stories/file-tag.stories.d.ts.map +1 -0
- package/lib/types/ai/file-tag/stories/index.d.ts +27 -0
- package/lib/types/ai/file-tag/stories/index.d.ts.map +1 -0
- package/lib/types/ai/image-tag/ImageTag.d.ts +46 -0
- package/lib/types/ai/image-tag/ImageTag.d.ts.map +1 -0
- package/lib/types/ai/image-tag/index.d.ts +22 -0
- package/lib/types/ai/image-tag/index.d.ts.map +1 -0
- package/lib/types/ai/image-tag/stories/image-tag-chat.story.d.ts +24 -0
- package/lib/types/ai/image-tag/stories/image-tag-chat.story.d.ts.map +1 -0
- package/lib/types/ai/image-tag/stories/image-tag-loading.story.d.ts +24 -0
- package/lib/types/ai/image-tag/stories/image-tag-loading.story.d.ts.map +1 -0
- package/lib/types/ai/image-tag/stories/image-tag-prompt.story.d.ts +24 -0
- package/lib/types/ai/image-tag/stories/image-tag-prompt.story.d.ts.map +1 -0
- package/lib/types/ai/image-tag/stories/image-tag.stories.d.ts +29 -0
- package/lib/types/ai/image-tag/stories/image-tag.stories.d.ts.map +1 -0
- package/lib/types/ai/image-tag/stories/index.d.ts +27 -0
- package/lib/types/ai/image-tag/stories/index.d.ts.map +1 -0
- package/lib/types/ai/index.d.ts +11 -0
- package/lib/types/ai/index.d.ts.map +1 -1
- package/lib/types/ai/more-files/MoreFiles.d.ts +38 -0
- package/lib/types/ai/more-files/MoreFiles.d.ts.map +1 -0
- package/lib/types/ai/more-files/index.d.ts +22 -0
- package/lib/types/ai/more-files/index.d.ts.map +1 -0
- package/lib/types/ai/more-files/stories/index.d.ts +23 -0
- package/lib/types/ai/more-files/stories/index.d.ts.map +1 -0
- package/lib/types/ai/more-files/stories/more-files.stories.d.ts +27 -0
- package/lib/types/ai/more-files/stories/more-files.stories.d.ts.map +1 -0
- package/lib/types/ai/more-files/stories/more-files.story.d.ts +24 -0
- package/lib/types/ai/more-files/stories/more-files.story.d.ts.map +1 -0
- package/lib/types/ai/presence/Presence.d.ts.map +1 -1
- package/lib/types/ai/prompt/Prompt.d.ts +62 -0
- package/lib/types/ai/prompt/Prompt.d.ts.map +1 -0
- package/lib/types/ai/prompt/index.d.ts +22 -0
- package/lib/types/ai/prompt/index.d.ts.map +1 -0
- package/lib/types/ai/prompt/stories/index.d.ts +25 -0
- package/lib/types/ai/prompt/stories/index.d.ts.map +1 -0
- package/lib/types/ai/prompt/stories/prompt-advanced.story.d.ts +24 -0
- package/lib/types/ai/prompt/stories/prompt-advanced.story.d.ts.map +1 -0
- package/lib/types/ai/prompt/stories/prompt-default.story.d.ts +24 -0
- package/lib/types/ai/prompt/stories/prompt-default.story.d.ts.map +1 -0
- package/lib/types/ai/prompt/stories/prompt.stories.d.ts +28 -0
- package/lib/types/ai/prompt/stories/prompt.stories.d.ts.map +1 -0
- package/lib/types/ai/reasoning/Reasoning.d.ts +44 -0
- package/lib/types/ai/reasoning/Reasoning.d.ts.map +1 -0
- package/lib/types/ai/reasoning/index.d.ts +22 -0
- package/lib/types/ai/reasoning/index.d.ts.map +1 -0
- package/lib/types/ai/reasoning/stories/index.d.ts +23 -0
- package/lib/types/ai/reasoning/stories/index.d.ts.map +1 -0
- package/lib/types/ai/reasoning/stories/reasoning-full.story.d.ts +24 -0
- package/lib/types/ai/reasoning/stories/reasoning-full.story.d.ts.map +1 -0
- package/lib/types/ai/reasoning/stories/reasoning.stories.d.ts +27 -0
- package/lib/types/ai/reasoning/stories/reasoning.stories.d.ts.map +1 -0
- package/lib/types/ai/response/Response.d.ts +37 -0
- package/lib/types/ai/response/Response.d.ts.map +1 -0
- package/lib/types/ai/response/index.d.ts +22 -0
- package/lib/types/ai/response/index.d.ts.map +1 -0
- package/lib/types/ai/response/stories/index.d.ts +35 -0
- package/lib/types/ai/response/stories/index.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-all-components.story.d.ts +24 -0
- package/lib/types/ai/response/stories/response-all-components.story.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-code-examples.story.d.ts +24 -0
- package/lib/types/ai/response/stories/response-code-examples.story.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-default.story.d.ts +23 -0
- package/lib/types/ai/response/stories/response-default.story.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-full-example.story.d.ts +24 -0
- package/lib/types/ai/response/stories/response-full-example.story.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-headings.story.d.ts +24 -0
- package/lib/types/ai/response/stories/response-headings.story.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-lists.story.d.ts +24 -0
- package/lib/types/ai/response/stories/response-lists.story.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-streaming.story.d.ts +23 -0
- package/lib/types/ai/response/stories/response-streaming.story.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response.stories.d.ts +33 -0
- package/lib/types/ai/response/stories/response.stories.d.ts.map +1 -0
- package/lib/types/ai/suggestion/Suggestion.d.ts +42 -0
- package/lib/types/ai/suggestion/Suggestion.d.ts.map +1 -0
- package/lib/types/ai/suggestion/index.d.ts +22 -0
- package/lib/types/ai/suggestion/index.d.ts.map +1 -0
- package/lib/types/ai/suggestion/stories/index.d.ts +29 -0
- package/lib/types/ai/suggestion/stories/index.d.ts.map +1 -0
- package/lib/types/ai/suggestion/stories/suggestion-default.story.d.ts +24 -0
- package/lib/types/ai/suggestion/stories/suggestion-default.story.d.ts.map +1 -0
- package/lib/types/ai/suggestion/stories/suggestion-icon.story.d.ts +24 -0
- package/lib/types/ai/suggestion/stories/suggestion-icon.story.d.ts.map +1 -0
- package/lib/types/ai/suggestion/stories/suggestion-primary.story.d.ts +24 -0
- package/lib/types/ai/suggestion/stories/suggestion-primary.story.d.ts.map +1 -0
- package/lib/types/ai/suggestion/stories/suggestion-sizes.story.d.ts +24 -0
- package/lib/types/ai/suggestion/stories/suggestion-sizes.story.d.ts.map +1 -0
- package/lib/types/ai/suggestion/stories/suggestion.stories.d.ts +30 -0
- package/lib/types/ai/suggestion/stories/suggestion.stories.d.ts.map +1 -0
- package/lib/types/ai/thinking/Thinking.d.ts +40 -0
- package/lib/types/ai/thinking/Thinking.d.ts.map +1 -0
- package/lib/types/ai/thinking/index.d.ts +22 -0
- package/lib/types/ai/thinking/index.d.ts.map +1 -0
- package/lib/types/ai/thinking/stories/ai-thinking-default.story.d.ts +24 -0
- package/lib/types/ai/thinking/stories/ai-thinking-default.story.d.ts.map +1 -0
- package/lib/types/ai/thinking/stories/ai-thinking-finished.story.d.ts +24 -0
- package/lib/types/ai/thinking/stories/ai-thinking-finished.story.d.ts.map +1 -0
- package/lib/types/ai/thinking/stories/ai-thinking.stories.d.ts +28 -0
- package/lib/types/ai/thinking/stories/ai-thinking.stories.d.ts.map +1 -0
- package/lib/types/ai/thinking/stories/index.d.ts +25 -0
- package/lib/types/ai/thinking/stories/index.d.ts.map +1 -0
- package/lib/types/ai/thinking/thinking-duration-formatter.d.ts +45 -0
- package/lib/types/ai/thinking/thinking-duration-formatter.d.ts.map +1 -0
- package/lib/types/ai/tool-call/ToolCall.d.ts +37 -0
- package/lib/types/ai/tool-call/ToolCall.d.ts.map +1 -0
- package/lib/types/ai/tool-call/index.d.ts +22 -0
- package/lib/types/ai/tool-call/index.d.ts.map +1 -0
- package/lib/types/ai/tool-call/stories/index.d.ts +25 -0
- package/lib/types/ai/tool-call/stories/index.d.ts.map +1 -0
- package/lib/types/ai/tool-call/stories/tool-call-default.story.d.ts +24 -0
- package/lib/types/ai/tool-call/stories/tool-call-default.story.d.ts.map +1 -0
- package/lib/types/ai/tool-call/stories/tool-call-done.story.d.ts +24 -0
- package/lib/types/ai/tool-call/stories/tool-call-done.story.d.ts.map +1 -0
- package/lib/types/ai/tool-call/stories/tool-call.stories.d.ts +28 -0
- package/lib/types/ai/tool-call/stories/tool-call.stories.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/UserBubble.d.ts +39 -0
- package/lib/types/ai/user-bubble/UserBubble.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/index.d.ts +22 -0
- package/lib/types/ai/user-bubble/index.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/stories/index.d.ts +29 -0
- package/lib/types/ai/user-bubble/stories/index.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/stories/user-bubble-action.story.d.ts +24 -0
- package/lib/types/ai/user-bubble/stories/user-bubble-action.story.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/stories/user-bubble-and-files.story.d.ts +24 -0
- package/lib/types/ai/user-bubble/stories/user-bubble-and-files.story.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/stories/user-bubble-long.story.d.ts +24 -0
- package/lib/types/ai/user-bubble/stories/user-bubble-long.story.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/stories/user-bubble.stories.d.ts +30 -0
- package/lib/types/ai/user-bubble/stories/user-bubble.stories.d.ts.map +1 -0
- package/lib/types/ai/user-bubble/stories/user-bubble.story.d.ts +24 -0
- package/lib/types/ai/user-bubble/stories/user-bubble.story.d.ts.map +1 -0
- package/lib/types/code/Code.d.ts +4 -1
- package/lib/types/code/Code.d.ts.map +1 -1
- package/lib/types/text-area/TextArea.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-bubble.stories.js","sourceRoot":"","sources":["../../../../../src/ai/user-bubble/stories/user-bubble.stories.tsx"],"names":[],"mappings":";;;AAsBA,8CAA2C;AAC3C,wBASW;AAEX,MAAM,aAAa,GAA4B;IAC7C,SAAS,EAAE,uBAAU;IACrB,EAAE,EAAE,2BAA2B;IAC/B,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,0BAA0B;CAClC,CAAC;AAEF,kBAAe,aAAa,CAAC;AAIhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,uBAAoB;gBAC1B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,oBAAiB;CAC1B,CAAC;AAEW,QAAA,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAmB;gBACzB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,mBAAgB;CACzB,CAAC;AAEW,QAAA,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,oBAAiB;gBACvB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,iBAAc;CACvB,CAAC;AAEW,QAAA,SAAS,GAAU;IAC9B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAqB;gBAC3B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,qBAAkB;CAC3B,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 { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { UserBubble } from '../UserBubble';\nimport {\n UserBubbleAction,\n UserBubbleActionSrc,\n UserBubbleAndFiles,\n UserBubbleAndFilesSrc,\n UserBubbleDefault,\n UserBubbleDefaultSrc,\n UserBubbleLong,\n UserBubbleLongSrc,\n} from '.';\n\nconst componentMeta: Meta<typeof UserBubble> = {\n component: UserBubble,\n id: 'components-ai-user-bubble',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/AI/UserBubble',\n};\n\nexport default componentMeta;\n\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: UserBubbleDefaultSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: UserBubbleDefault,\n};\n\nexport const WithAction: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: UserBubbleActionSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: UserBubbleAction,\n};\n\nexport const LongMessage: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: UserBubbleLongSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: UserBubbleLong,\n};\n\nexport const WithFiles: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: UserBubbleAndFilesSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: UserBubbleAndFiles,\n};\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const ai_1 = require("@neo4j-ndl/react/ai");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(ai_1.UserBubble, { avatarProps: {
|
|
28
|
+
name: 'KM',
|
|
29
|
+
source: 'https://media.istockphoto.com/id/1334716681/photo/a-smiling-man.jpg?s=612x612&w=0&k=20&c=U6rkSDpQMzkcJEqx2hAa63fNLIhqnZb31Xuc_QSi648=',
|
|
30
|
+
type: 'image',
|
|
31
|
+
}, children: "Can you analyse my data and tell me about...?" }));
|
|
32
|
+
};
|
|
33
|
+
exports.default = Component;
|
|
34
|
+
//# sourceMappingURL=user-bubble.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-bubble.story.js","sourceRoot":"","sources":["../../../../../src/ai/user-bubble/stories/user-bubble.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAiD;AAEjD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,eAAU,IACT,WAAW,EAAE;YACX,IAAI,EAAE,IAAI;YACV,MAAM,EACJ,uIAAuI;YACzI,IAAI,EAAE,OAAO;SACd,8DAGU,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,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 { UserBubble } from '@neo4j-ndl/react/ai';\n\nconst Component = () => {\n return (\n <UserBubble\n avatarProps={{\n name: 'KM',\n source:\n 'https://media.istockphoto.com/id/1334716681/photo/a-smiling-man.jpg?s=612x612&w=0&k=20&c=U6rkSDpQMzkcJEqx2hAa63fNLIhqnZb31Xuc_QSi648=',\n type: 'image',\n }}\n >\n Can you analyse my data and tell me about...?\n </UserBubble>\n );\n};\n\nexport default Component;\n"]}
|
package/lib/cjs/code/Code.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../../src/code/Code.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAGpC,0DAAsD;AACtD,wCAAqC;
|
|
1
|
+
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../../src/code/Code.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAGpC,0DAAsD;AACtD,wCAAqC;AAmB9B,MAAM,IAAI,GAAG,CAAyC,EAYtB,EAAE,EAAE;QAZkB,EAC3D,QAAQ,EACR,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,WAAW,EACX,OAAO,EACP,EAAE,EACF,GAAG,EACH,cAAc,OAEuB,EADlC,SAAS,cAX+C,uHAY5D,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,OAAO,GAAG,IAAA,oBAAU,EACxB,UAAU,EACV;QACE,cAAc,EAAE,UAAU;QAC1B,cAAc,EAAE,UAAU;KAC3B,EACD,SAAS,CACV,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,CAA4C,EAAE,EAAE;QACnE,IAAI,UAAU,EAAE,CAAC;YACf,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,CAAC;IACf,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,kCAAe,IACd,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,EACzC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAClB,wBAAC,iBAAO,IAAC,IAAI,EAAC,QAAQ,aACpB,uBAAC,iBAAO,CAAC,OAAO,IAAC,gBAAgB,EAAE,SAAS,KAAK,QAAQ,YACtD,QAAQ,GACO,EAClB,uBAAC,iBAAO,CAAC,OAAO,cAAE,WAAW,GAAmB,IACxC,CACX,YAED,uBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,UAAU,EACpB,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAElB,2CAAO,QAAQ,GAAQ,IACb,GACI,CACnB,CAAC;AACJ,CAAC,CAAC;AA1DW,QAAA,IAAI,QA0Df","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 classNames from 'classnames';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { Tooltip } from '../tooltip';\n\ntype CodeProps = {\n /** The content of the code */\n children?: React.ReactNode;\n /** Whether the code is disabled */\n isDisabled?: boolean;\n /** Whether the code is runnable */\n isRunnable?: boolean;\n /** The description of the code, will be displayed in a tooltip */\n description?: string;\n /** The callback function triggered when the inline code is clicked */\n onClick?: (\n e:\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.KeyboardEvent<HTMLElement>,\n ) => void;\n};\n\nexport const Code = <T extends React.ElementType = 'button'>({\n children,\n className,\n isDisabled = false,\n style,\n isRunnable = false,\n description,\n onClick,\n as,\n ref,\n htmlAttributes,\n ...restProps\n}: PolymorphicCommonProps<T, CodeProps>) => {\n const Component: React.ElementType = as ?? (onClick ? 'button' : 'span');\n\n const classes = classNames(\n 'ndl-code',\n {\n 'ndl-disabled': isDisabled,\n 'ndl-runnable': isRunnable,\n },\n className,\n );\n\n const handleClick = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {\n if (isDisabled) {\n e.preventDefault();\n return;\n }\n\n onClick?.(e);\n };\n\n return (\n <ConditionalWrap\n shouldWrap={Boolean(description) === true}\n wrap={(children) => (\n <Tooltip type=\"simple\">\n <Tooltip.Trigger hasButtonWrapper={Component === 'button'}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content>{description}</Tooltip.Content>\n </Tooltip>\n )}\n >\n <Component\n className={classes}\n style={style}\n onClick={handleClick}\n disabled={isDisabled}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <code>{children}</code>\n </Component>\n </ConditionalWrap>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/text-area/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAEpC,iCAAgD;AAEhD,kDAA8E;AAM9E,4CAAwD;AACxD,oCAGkB;AAClB,wCAAqC;
|
|
1
|
+
{"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/text-area/TextArea.tsx"],"names":[],"mappings":"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","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 classNames from 'classnames';\nimport type React from 'react';\nimport { type ReactNode, useMemo } from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport {\n type CommonProps,\n type HtmlAttributes,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport {\n ExclamationCircleIconSolid,\n InformationCircleIconOutline,\n} from '../icons';\nimport { Tooltip } from '../tooltip';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype TextAreaProps = {\n /** The label displayed above the textarea */\n label?: ReactNode;\n\n /** Whether the textarea should take the full available width */\n isFluid?: boolean;\n\n /** Assistive text displayed below the textarea */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the textarea. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Size of the textarea */\n size?: 'small' | 'medium' | 'large';\n\n // TODO v5: use isRequired and showRequiredOrOptionalLabel like in TextInput\n /** Whether to display the Optional label next to the field label */\n isOptional?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether the textarea is disabled */\n isDisabled?: boolean;\n\n /** Additional HTML attributes passed to the textarea element */\n htmlAttributes?: HtmlAttributes<'textarea'>;\n\n /** Aria label for accessibility when no visible label is provided */\n ariaLabel?: string;\n\n /** Additional class names */\n className?: string;\n\n /** Additional styles applied to the root element */\n style?: React.CSSProperties;\n\n /** Whether the textarea is read-only */\n isReadOnly?: boolean;\n\n /** The current value of the textarea */\n value?: React.ComponentPropsWithoutRef<'textarea'>['value'];\n\n /** Placeholder text displayed when the textarea is empty */\n placeholder?: React.ComponentPropsWithoutRef<'textarea'>['placeholder'];\n};\n\n/**\n *\n *\n * TextArea Component\n *\n *\n */\n\nexport const TextArea = ({\n label,\n isFluid = false,\n errorText,\n helpText,\n isOptional = false,\n moreInformationText,\n size = 'medium',\n ariaLabel,\n tooltipProps,\n isDisabled = false,\n className,\n isReadOnly = false,\n style,\n value,\n placeholder,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'textarea', TextAreaProps>) => {\n const containerWrappingClasses = classNames(\n `ndl-text-area ndl-type-text`,\n className,\n {\n 'ndl-disabled': isDisabled,\n 'ndl-small': size === 'small',\n 'ndl-medium': size === 'medium',\n 'ndl-large': size === 'large',\n 'ndl-has-error': errorText,\n 'ndl-has-trailing-icon': errorText,\n 'ndl-has-icon': errorText,\n },\n );\n\n const hasEmptyLabelValue = !label || label === '';\n\n const labelWrappingClasses = classNames('ndl-text-area-label', {\n 'ndl-fluid': isFluid,\n 'ndl-text-area-no-label': hasEmptyLabelValue,\n });\n\n const isCustomLabel = label && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel = isCustomLabel && !ariaLabel;\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextArea without a label does not have an aria label, be sure to include an aria label for screen readers link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n 'ndl-information-icon-large': size === 'large',\n });\n\n return (\n <div className={containerWrappingClasses}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n <div className=\"ndl-text-area-wrapper\">\n <textarea\n disabled={isDisabled}\n ref={ref}\n aria-label={ariaLabel}\n readOnly={isReadOnly}\n value={value}\n placeholder={placeholder}\n style={style}\n {...restProps}\n {...htmlAttributes}\n />\n </div>\n {!hasEmptyLabelValue && (\n <div className=\"ndl-text-area-wrapper\">\n <span className=\"ndl-text-area-label-text\">{label}</span>\n {Boolean(moreInformationText) && (\n <Tooltip type=\"simple\" {...tooltipProps?.root}>\n <Tooltip.Trigger {...tooltipProps?.trigger}>\n <div\n className={informationIconClasses}\n data-testid=\"ndl-information-icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {isOptional && (\n <span className=\"ndl-text-area-optional\">Optional</span>\n )}\n </div>\n )}\n </label>\n {helpText && !errorText && (\n <div className=\"ndl-text-area-msg\">{helpText}</div>\n )}\n {errorText && (\n <div className=\"ndl-text-area-msg\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <div className=\"ndl-error-text\">{errorText}</div>\n </div>\n )}\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) "Neo4j"
|
|
16
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
17
|
+
*
|
|
18
|
+
* This file is part of Neo4j.
|
|
19
|
+
*
|
|
20
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
21
|
+
* it under the terms of the GNU General Public License as published by
|
|
22
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
23
|
+
* (at your option) any later version.
|
|
24
|
+
*
|
|
25
|
+
* This program is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
28
|
+
* GNU General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU General Public License
|
|
31
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
|
+
*/
|
|
33
|
+
import { ClipboardButton, LoadingSpinner, StatusLabel, Typography, useNeedleTheme, } from '@neo4j-ndl/react';
|
|
34
|
+
import classNames from 'classnames';
|
|
35
|
+
import { useEffect, useState } from 'react';
|
|
36
|
+
import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
37
|
+
import { Languages, loadLanguage, } from '../../code-block/code-languages';
|
|
38
|
+
import ndlCodeDark from '../../code-block/themes/ndl-code-dark';
|
|
39
|
+
import ndlCodeLight from '../../code-block/themes/ndl-code-light';
|
|
40
|
+
/**
|
|
41
|
+
* The component is used to display code that is generated by an LLM.
|
|
42
|
+
*
|
|
43
|
+
* @alpha - Changes to this component may be breaking.
|
|
44
|
+
*/
|
|
45
|
+
export const CodePreview = (_a) => {
|
|
46
|
+
var { code, language, label, isLoading = false, headerActions, theme, ref, style, className, htmlAttributes } = _a, restProps = __rest(_a, ["code", "language", "label", "isLoading", "headerActions", "theme", "ref", "style", "className", "htmlAttributes"]);
|
|
47
|
+
const [loadedLanguage, setLoadedLanguage] = useState(null);
|
|
48
|
+
const { theme: ndlTheme } = useNeedleTheme();
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!language || !Languages.includes(language)) {
|
|
51
|
+
setLoadedLanguage('text');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
loadLanguage(language)
|
|
55
|
+
.then((module) => {
|
|
56
|
+
SyntaxHighlighter.registerLanguage(language, module.default);
|
|
57
|
+
setLoadedLanguage(language);
|
|
58
|
+
})
|
|
59
|
+
.catch((err) => console.error(err));
|
|
60
|
+
}, [language]);
|
|
61
|
+
const getTheme = () => {
|
|
62
|
+
switch (theme) {
|
|
63
|
+
case 'ndl-code-dark':
|
|
64
|
+
return ndlCodeDark;
|
|
65
|
+
case 'ndl-code-light':
|
|
66
|
+
return ndlCodeLight;
|
|
67
|
+
default:
|
|
68
|
+
return ndlTheme === 'light' ? ndlCodeLight : ndlCodeDark;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return (_jsxs("div", Object.assign({ ref: ref, style: style, className: classNames('ndl-ai-code-preview', className) }, restProps, htmlAttributes, { children: [_jsxs("div", { className: "ndl-ai-code-preview-header", children: [_jsx("div", { className: "ndl-ai-code-preview-title", children: isLoading ? (_jsxs(_Fragment, { children: [_jsx(LoadingSpinner, { size: "medium" }), _jsxs(Typography, { variant: "code", children: ["WRITING ", language.toUpperCase()] })] })) : (_jsxs(_Fragment, { children: [_jsxs(Typography, { variant: "code", children: [language.toUpperCase(), ' ', language.toLowerCase() === 'cypher' ? 'QUERY' : ''] }), label && (_jsx(StatusLabel, { variant: label === 'write' ? 'warning' : 'info', size: "small", fill: "outlined", children: label }))] })) }), !isLoading && (_jsxs("div", { className: "ndl-ai-code-preview-actions", children: [_jsx(ClipboardButton, { textToCopy: code, type: "clean-icon-button", size: "small" }), headerActions] }))] }), !isLoading && (_jsx("div", { className: "ndl-ai-code-preview-content", children: _jsx("div", { className: "ndl-code-content-container", children: _jsx(SyntaxHighlighter, { language: loadedLanguage !== null && loadedLanguage !== void 0 ? loadedLanguage : 'text', style: Object.assign(Object.assign({}, getTheme()), { 'pre[class*="language-"]': {
|
|
72
|
+
border: 0,
|
|
73
|
+
color: 'var(--theme-color-neutral-text-default)',
|
|
74
|
+
lineHeight: '1',
|
|
75
|
+
overflowX: 'auto',
|
|
76
|
+
padding: 'var(--space-12)',
|
|
77
|
+
width: 'fit-content',
|
|
78
|
+
} }),
|
|
79
|
+
// Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong
|
|
80
|
+
// https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402
|
|
81
|
+
// wrapLongLines
|
|
82
|
+
codeTagProps: { className: 'n-ai-code-preview' }, showLineNumbers: false, children: code }) }) }))] })));
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=CodePreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodePreview.js","sourceRoot":"","sources":["../../../../src/ai/code-preview/CodePreview.tsx"],"names":[],"mappings":"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","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';\n\ntype CodePreviewProps = {\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 CleanIconButton components. */\n headerActions?: React.ReactNode;\n /** The theme of the code block */\n theme?: 'ndl-code-dark' | 'ndl-code-light';\n};\n\n/**\n * The component is used to display code that is generated by an LLM.\n *\n * @alpha - Changes to this component may be breaking.\n */\nexport const CodePreview = ({\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', CodePreviewProps>) => {\n const [loadedLanguage, setLoadedLanguage] = useState<\n CodePreviewProps['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-code-preview', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {/* Header */}\n <div className=\"ndl-ai-code-preview-header\">\n <div className=\"ndl-ai-code-preview-title\">\n {isLoading ? (\n <>\n <LoadingSpinner size=\"medium\" />\n <Typography variant=\"code\">\n WRITING {language.toUpperCase()}\n </Typography>\n </>\n ) : (\n <>\n <Typography variant=\"code\">\n {language.toUpperCase()}{' '}\n {language.toLowerCase() === 'cypher' ? 'QUERY' : ''}\n </Typography>\n {label && (\n <StatusLabel\n variant={label === 'write' ? 'warning' : 'info'}\n size=\"small\"\n fill=\"outlined\"\n >\n {label}\n </StatusLabel>\n )}\n </>\n )}\n </div>\n\n {!isLoading && (\n <div className=\"ndl-ai-code-preview-actions\">\n <ClipboardButton\n textToCopy={code}\n type=\"clean-icon-button\"\n size=\"small\"\n />\n {headerActions}\n </div>\n )}\n </div>\n\n {!isLoading && (\n <div className=\"ndl-ai-code-preview-content\">\n <div className=\"ndl-code-content-container\">\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-code-preview' }}\n showLineNumbers={false}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </div>\n )}\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
export { CodePreview } from './CodePreview';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai/code-preview/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,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 { CodePreview } from './CodePreview';\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { CodePreview } from '@neo4j-ndl/react/ai';
|
|
23
|
+
const pythonCode = `def show_functions(username, function_type='ALL'):
|
|
24
|
+
"""
|
|
25
|
+
Show functions executable by user
|
|
26
|
+
"""
|
|
27
|
+
query = f"SHOW {function_type} FUNCTIONS EXECUTABLE BY {username}"
|
|
28
|
+
return query`;
|
|
29
|
+
export const Component = () => {
|
|
30
|
+
return _jsx(CodePreview, { code: pythonCode, language: "python" });
|
|
31
|
+
};
|
|
32
|
+
export default Component;
|
|
33
|
+
//# sourceMappingURL=code-preview-languages.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-preview-languages.story.js","sourceRoot":"","sources":["../../../../../src/ai/code-preview/stories/code-preview-languages.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,UAAU,GAAG;;;;;iBAKF,CAAC;AAElB,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,KAAC,WAAW,IAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAC,QAAQ,GAAG,CAAC;AAC7D,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 { CodePreview } 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\nexport const Component = () => {\n return <CodePreview code={pythonCode} language=\"python\" />;\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { CodePreview } from '@neo4j-ndl/react/ai';
|
|
23
|
+
export const Component = () => {
|
|
24
|
+
return _jsx(CodePreview, { code: "", language: "cypher", isLoading: true });
|
|
25
|
+
};
|
|
26
|
+
export default Component;
|
|
27
|
+
//# sourceMappingURL=code-preview-loading.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-preview-loading.story.js","sourceRoot":"","sources":["../../../../../src/ai/code-preview/stories/code-preview-loading.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,KAAC,WAAW,IAAC,IAAI,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,EAAC,SAAS,EAAE,IAAI,GAAI,CAAC;AACpE,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 { CodePreview } from '@neo4j-ndl/react/ai';\n\nexport const Component = () => {\n return <CodePreview code=\"\" language=\"cypher\" isLoading={true} />;\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { OutlinedButton } from '@neo4j-ndl/react';
|
|
23
|
+
import { CodePreview } from '@neo4j-ndl/react/ai';
|
|
24
|
+
import { PencilSquareIconOutline } from '@neo4j-ndl/react/icons';
|
|
25
|
+
const cypherCode = `SHOW [ALL|BUILT IN|USER DEFINED] FUNCTION[S] EXECUTABLE BY
|
|
26
|
+
username
|
|
27
|
+
[YIELD { * | field[, ...] } [ORDER BY field ...`;
|
|
28
|
+
export const Component = () => {
|
|
29
|
+
return (_jsx(CodePreview, { code: cypherCode, language: "cypher", label: "read", headerActions: _jsx(OutlinedButton, { leadingVisual: _jsx(PencilSquareIconOutline, {}), variant: "neutral", size: "small", children: "Send to Query" }) }));
|
|
30
|
+
};
|
|
31
|
+
export default Component;
|
|
32
|
+
//# sourceMappingURL=code-preview-read.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-preview-read.story.js","sourceRoot":"","sources":["../../../../../src/ai/code-preview/stories/code-preview-read.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,UAAU,GAAG;;gDAE6B,CAAC;AAEjD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,CACL,KAAC,WAAW,IACV,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,QAAQ,EACjB,KAAK,EAAC,MAAM,EACZ,aAAa,EACX,KAAC,cAAc,IACb,aAAa,EAAE,KAAC,uBAAuB,KAAG,EAC1C,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,8BAGG,GAEnB,CACH,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 { OutlinedButton } from '@neo4j-ndl/react';\nimport { CodePreview } 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\nexport const Component = () => {\n return (\n <CodePreview\n code={cypherCode}\n language=\"cypher\"\n label=\"read\"\n headerActions={\n <OutlinedButton\n leadingVisual={<PencilSquareIconOutline />}\n variant=\"neutral\"\n size=\"small\"\n >\n Send to Query\n </OutlinedButton>\n }\n />\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { CleanIconButton } from '@neo4j-ndl/react';
|
|
23
|
+
import { CodePreview } from '@neo4j-ndl/react/ai';
|
|
24
|
+
import { PencilSquareIconOutline, PlayCircleIconOutline, } from '@neo4j-ndl/react/icons';
|
|
25
|
+
const cypherCode = `SHOW [ALL|BUILT IN|USER DEFINED] FUNCTION[S] EXECUTABLE BY
|
|
26
|
+
username
|
|
27
|
+
[YIELD { * | field[, ...] } [ORDER BY field ...`;
|
|
28
|
+
export const Component = () => {
|
|
29
|
+
return (_jsx(CodePreview, { code: cypherCode, language: "cypher", label: "write", headerActions: _jsxs(_Fragment, { children: [_jsx(CleanIconButton, { variant: "neutral", description: "Send to Query", size: "small", children: _jsx(PencilSquareIconOutline, {}) }), _jsx(CleanIconButton, { variant: "neutral", description: "Run in Query", size: "small", children: _jsx(PlayCircleIconOutline, {}) })] }) }));
|
|
30
|
+
};
|
|
31
|
+
export default Component;
|
|
32
|
+
//# sourceMappingURL=code-preview-write.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-preview-write.story.js","sourceRoot":"","sources":["../../../../../src/ai/code-preview/stories/code-preview-write.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,UAAU,GAAG;;gDAE6B,CAAC;AAEjD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,CACL,KAAC,WAAW,IACV,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,QAAQ,EACjB,KAAK,EAAC,OAAO,EACb,aAAa,EACX,8BACE,KAAC,eAAe,IACd,OAAO,EAAC,SAAS,EACjB,WAAW,EAAC,eAAe,EAC3B,IAAI,EAAC,OAAO,YAEZ,KAAC,uBAAuB,KAAG,GACX,EAClB,KAAC,eAAe,IACd,OAAO,EAAC,SAAS,EACjB,WAAW,EAAC,cAAc,EAC1B,IAAI,EAAC,OAAO,YAEZ,KAAC,qBAAqB,KAAG,GACT,IACjB,GAEL,CACH,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 { CleanIconButton } from '@neo4j-ndl/react';\nimport { CodePreview } from '@neo4j-ndl/react/ai';\nimport {\n PencilSquareIconOutline,\n PlayCircleIconOutline,\n} 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\nexport const Component = () => {\n return (\n <CodePreview\n code={cypherCode}\n language=\"cypher\"\n label=\"write\"\n headerActions={\n <>\n <CleanIconButton\n variant=\"neutral\"\n description=\"Send to Query\"\n size=\"small\"\n >\n <PencilSquareIconOutline />\n </CleanIconButton>\n <CleanIconButton\n variant=\"neutral\"\n description=\"Run in Query\"\n size=\"small\"\n >\n <PlayCircleIconOutline />\n </CleanIconButton>\n </>\n }\n />\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
import { CodePreview } from '../CodePreview';
|
|
22
|
+
import { CodePreviewLanguages, CodePreviewLanguagesSource, CodePreviewLoading, CodePreviewLoadingSource, CodePreviewRead, CodePreviewReadSource, CodePreviewWrite, CodePreviewWriteSource, } from './index';
|
|
23
|
+
const componentMeta = {
|
|
24
|
+
component: CodePreview,
|
|
25
|
+
id: 'components-ai-code-preview',
|
|
26
|
+
parameters: {
|
|
27
|
+
controls: { disable: true },
|
|
28
|
+
},
|
|
29
|
+
tags: ['docsPage'],
|
|
30
|
+
title: 'Components/AI/CodePreview',
|
|
31
|
+
};
|
|
32
|
+
export default componentMeta;
|
|
33
|
+
export const Loading = {
|
|
34
|
+
args: {},
|
|
35
|
+
parameters: {
|
|
36
|
+
docs: {
|
|
37
|
+
source: {
|
|
38
|
+
code: CodePreviewLoadingSource,
|
|
39
|
+
language: 'tsx',
|
|
40
|
+
type: 'code',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
render: CodePreviewLoading,
|
|
45
|
+
};
|
|
46
|
+
export const Read = {
|
|
47
|
+
args: {},
|
|
48
|
+
parameters: {
|
|
49
|
+
docs: {
|
|
50
|
+
source: {
|
|
51
|
+
code: CodePreviewReadSource,
|
|
52
|
+
language: 'tsx',
|
|
53
|
+
type: 'code',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
render: CodePreviewRead,
|
|
58
|
+
};
|
|
59
|
+
export const Write = {
|
|
60
|
+
args: {},
|
|
61
|
+
parameters: {
|
|
62
|
+
docs: {
|
|
63
|
+
source: {
|
|
64
|
+
code: CodePreviewWriteSource,
|
|
65
|
+
language: 'tsx',
|
|
66
|
+
type: 'code',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
render: CodePreviewWrite,
|
|
71
|
+
};
|
|
72
|
+
export const Languages = {
|
|
73
|
+
args: {},
|
|
74
|
+
parameters: {
|
|
75
|
+
docs: {
|
|
76
|
+
source: {
|
|
77
|
+
code: CodePreviewLanguagesSource,
|
|
78
|
+
language: 'tsx',
|
|
79
|
+
type: 'code',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
render: CodePreviewLanguages,
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=code-preview.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-preview.stories.js","sourceRoot":"","sources":["../../../../../src/ai/code-preview/stories/code-preview.stories.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AAEjB,MAAM,aAAa,GAA6B;IAC9C,SAAS,EAAE,WAAW;IACtB,EAAE,EAAE,4BAA4B;IAChC,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,2BAA2B;CACnC,CAAC;AAEF,eAAe,aAAa,CAAC;AAI7B,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAwB;gBAC9B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAU;IACzB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAqB;gBAC3B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAsB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,gBAAgB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,0BAA0B;gBAChC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,oBAAoB;CAC7B,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 type { Meta, StoryObj } from '@storybook/react-vite';\n\nimport { CodePreview } from '../CodePreview';\nimport {\n CodePreviewLanguages,\n CodePreviewLanguagesSource,\n CodePreviewLoading,\n CodePreviewLoadingSource,\n CodePreviewRead,\n CodePreviewReadSource,\n CodePreviewWrite,\n CodePreviewWriteSource,\n} from './index';\n\nconst componentMeta: Meta<typeof CodePreview> = {\n component: CodePreview,\n id: 'components-ai-code-preview',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/AI/CodePreview',\n};\n\nexport default componentMeta;\n\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Loading: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: CodePreviewLoadingSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: CodePreviewLoading,\n};\n\nexport const Read: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: CodePreviewReadSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: CodePreviewRead,\n};\n\nexport const Write: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: CodePreviewWriteSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: CodePreviewWrite,\n};\n\nexport const Languages: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: CodePreviewLanguagesSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: CodePreviewLanguages,\n};\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
export { default as CodePreviewLoading } from './code-preview-loading.story';
|
|
22
|
+
export { default as CodePreviewRead } from './code-preview-read.story';
|
|
23
|
+
export { default as CodePreviewWrite } from './code-preview-write.story';
|
|
24
|
+
export { default as CodePreviewLanguages } from './code-preview-languages.story';
|
|
25
|
+
import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
|
|
26
|
+
import CodePreviewLanguagesSourceRaw from './code-preview-languages.story?raw';
|
|
27
|
+
import CodePreviewLoadingSourceRaw from './code-preview-loading.story?raw';
|
|
28
|
+
import CodePreviewReadSourceRaw from './code-preview-read.story?raw';
|
|
29
|
+
import CodePreviewWriteSourceRaw from './code-preview-write.story?raw';
|
|
30
|
+
export const CodePreviewLoadingSource = removeLicenseHeader(CodePreviewLoadingSourceRaw);
|
|
31
|
+
export const CodePreviewReadSource = removeLicenseHeader(CodePreviewReadSourceRaw);
|
|
32
|
+
export const CodePreviewWriteSource = removeLicenseHeader(CodePreviewWriteSourceRaw);
|
|
33
|
+
export const CodePreviewLanguagesSource = removeLicenseHeader(CodePreviewLanguagesSourceRaw);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/code-preview/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,6BAA6B,MAAM,oCAAoC,CAAC;AAC/E,OAAO,2BAA2B,MAAM,kCAAkC,CAAC;AAC3E,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AACrE,OAAO,yBAAyB,MAAM,gCAAgC,CAAC;AAEvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CACzD,2BAA2B,CAC5B,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CACtD,wBAAwB,CACzB,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,yBAAyB,CAC1B,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAC3D,6BAA6B,CAC9B,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 CodePreviewLoading } from './code-preview-loading.story';\nexport { default as CodePreviewRead } from './code-preview-read.story';\nexport { default as CodePreviewWrite } from './code-preview-write.story';\nexport { default as CodePreviewLanguages } from './code-preview-languages.story';\n\nimport { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';\n\nimport CodePreviewLanguagesSourceRaw from './code-preview-languages.story?raw';\nimport CodePreviewLoadingSourceRaw from './code-preview-loading.story?raw';\nimport CodePreviewReadSourceRaw from './code-preview-read.story?raw';\nimport CodePreviewWriteSourceRaw from './code-preview-write.story?raw';\n\nexport const CodePreviewLoadingSource = removeLicenseHeader(\n CodePreviewLoadingSourceRaw,\n);\nexport const CodePreviewReadSource = removeLicenseHeader(\n CodePreviewReadSourceRaw,\n);\nexport const CodePreviewWriteSource = removeLicenseHeader(\n CodePreviewWriteSourceRaw,\n);\nexport const CodePreviewLanguagesSource = removeLicenseHeader(\n CodePreviewLanguagesSourceRaw,\n);\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) "Neo4j"
|
|
16
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
17
|
+
*
|
|
18
|
+
* This file is part of Neo4j.
|
|
19
|
+
*
|
|
20
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
21
|
+
* it under the terms of the GNU General Public License as published by
|
|
22
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
23
|
+
* (at your option) any later version.
|
|
24
|
+
*
|
|
25
|
+
* This program is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
28
|
+
* GNU General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU General Public License
|
|
31
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
|
+
*/
|
|
33
|
+
import { CleanIconButton, LoadingSpinner, Tooltip } from '@neo4j-ndl/react';
|
|
34
|
+
import { XMarkIconOutline } from '@neo4j-ndl/react/icons';
|
|
35
|
+
import classNames from 'classnames';
|
|
36
|
+
/**
|
|
37
|
+
* The component is used to display a file in a chat, or in a prompt.
|
|
38
|
+
* It can be removable and it can be loading.
|
|
39
|
+
*
|
|
40
|
+
* @alpha - Changes to this component may be breaking.
|
|
41
|
+
*/
|
|
42
|
+
const FileTag = (_a) => {
|
|
43
|
+
var { onClick, isRemovable = false, fileName, fileType, icon, className, style, htmlAttributes, ref, isLoading = false } = _a, restProps = __rest(_a, ["onClick", "isRemovable", "fileName", "fileType", "icon", "className", "style", "htmlAttributes", "ref", "isLoading"]);
|
|
44
|
+
const Component = isRemovable !== true ? 'button' : 'div';
|
|
45
|
+
const classes = classNames('ndl-ai-file-tag', className);
|
|
46
|
+
const file = `${fileName}.${fileType}`;
|
|
47
|
+
return (_jsxs(Tooltip, { type: "simple", placement: "bottom", hoverDelay: { close: 0, open: 500 }, children: [_jsx(Tooltip.Trigger, { hasButtonWrapper: true, children: _jsxs(Component, Object.assign({ ref: ref, className: classes, style: style }, (isRemovable ? {} : { onClick }), restProps, htmlAttributes, { children: [_jsx("div", { className: "ndl-ai-file-tag-leading", children: isLoading ? _jsx(LoadingSpinner, { size: "medium" }) : icon }), _jsxs("div", { className: "ndl-ai-file-tag-content", children: [_jsx("span", { className: "ndl-ai-file-tag-content-title", children: fileName }), _jsx("span", { className: "ndl-ai-file-tag-content-type", children: fileType === null || fileType === void 0 ? void 0 : fileType.toUpperCase() })] }), isRemovable && (_jsx(CleanIconButton, { onClick: onClick, description: null, htmlAttributes: {
|
|
48
|
+
'aria-label': `Remove ${file}`,
|
|
49
|
+
}, size: "small", className: "ndl-ai-file-tag-remove", children: _jsx(XMarkIconOutline, {}) }))] })) }), _jsx(Tooltip.Content, { children: file })] }));
|
|
50
|
+
};
|
|
51
|
+
export { FileTag };
|
|
52
|
+
//# sourceMappingURL=FileTag.js.map
|