@smart-cloud/ai-kit-ui 1.5.14 → 1.5.16

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.
Files changed (55) hide show
  1. package/dist/LocaleDirectionProvider.d.ts +5 -0
  2. package/dist/ai-feature/AiFeature.d.ts +1 -0
  3. package/dist/index.cjs +9 -9
  4. package/dist/index.js +9 -9
  5. package/dist/locale.d.ts +13 -0
  6. package/package.json +35 -19
  7. package/eslint.config.js +0 -18
  8. package/src/ShadowBoundary.tsx +0 -229
  9. package/src/ai-chatbot/AiChatbot.tsx +0 -2325
  10. package/src/ai-chatbot/attachmentStorage.ts +0 -238
  11. package/src/ai-chatbot/index.tsx +0 -1
  12. package/src/ai-feature/AiFeature.tsx +0 -2334
  13. package/src/ai-feature/AiFeatureBorder.tsx +0 -22
  14. package/src/ai-feature/ProofreadDiff.tsx +0 -118
  15. package/src/ai-feature/index.tsx +0 -2
  16. package/src/ai-feature/utils.tsx +0 -20
  17. package/src/doc-search/DocSearch.tsx +0 -1313
  18. package/src/doc-search/index.tsx +0 -1
  19. package/src/doc-search/initialFilters.ts +0 -10
  20. package/src/errorHandling.ts +0 -305
  21. package/src/i18n/ar.ts +0 -254
  22. package/src/i18n/de.ts +0 -257
  23. package/src/i18n/en.ts +0 -269
  24. package/src/i18n/es.ts +0 -257
  25. package/src/i18n/fr.ts +0 -258
  26. package/src/i18n/he.ts +0 -250
  27. package/src/i18n/hi.ts +0 -256
  28. package/src/i18n/hu.ts +0 -269
  29. package/src/i18n/id.ts +0 -256
  30. package/src/i18n/index.ts +0 -47
  31. package/src/i18n/it.ts +0 -259
  32. package/src/i18n/ja.ts +0 -256
  33. package/src/i18n/ko.ts +0 -254
  34. package/src/i18n/nb.ts +0 -254
  35. package/src/i18n/nl.ts +0 -255
  36. package/src/i18n/pl.ts +0 -258
  37. package/src/i18n/pt.ts +0 -254
  38. package/src/i18n/ru.ts +0 -254
  39. package/src/i18n/sv.ts +0 -253
  40. package/src/i18n/th.ts +0 -252
  41. package/src/i18n/tr.ts +0 -256
  42. package/src/i18n/ua.ts +0 -257
  43. package/src/i18n/zh.ts +0 -247
  44. package/src/index.tsx +0 -7
  45. package/src/poweredBy.tsx +0 -39
  46. package/src/styles/ai-kit-ui.css +0 -1006
  47. package/src/useAiRun.ts +0 -182
  48. package/src/withAiKitShell.tsx +0 -363
  49. package/tests/ai-disclosures.test.ts +0 -126
  50. package/tests/doc-search-initial-filters.test.ts +0 -20
  51. package/tests/error-handling.test.ts +0 -140
  52. package/tsconfig.json +0 -32
  53. package/tsconfig.node.json +0 -13
  54. package/tsconfig.types.json +0 -13
  55. package/tsup.config.ts +0 -22
package/src/i18n/zh.ts DELETED
@@ -1,247 +0,0 @@
1
- export const zhDict: Record<string, string> = {
2
- "--- Select ---": "--- 选择 ---",
3
- Accept: "接受",
4
- "Accept response": "接受回复",
5
- Add: "添加",
6
- "Add image": "添加图片",
7
- "Additional instructions to guide the AI.": "指导人工智能的附加指令。",
8
- "AI Assistant": "AI 助手",
9
- "AI Summary": "人工智能概要",
10
- "Alt Text": "替代文字",
11
- "An error occurred.": "发生错误。",
12
- "An unknown error occurred.": "发生未知错误。",
13
- "Answers from {name} are generated by AI and may contain mistakes. Check important information.":
14
- "{name} 的回答由 AI 生成,可能包含错误。请核实重要信息。",
15
- Arabic: "阿拉伯",
16
- "Are you sure you want to reset the conversation?": "确定要重置对话吗?",
17
- "As-Is": "不变",
18
- "as-is": "原样",
19
- "Ask anything…": "随便问…",
20
- "Ask me": "问我",
21
- Assistant: "助手",
22
- "Assistant is thinking…": "助手正在思考……",
23
- "Audio message": "音频消息",
24
- "Audio no longer available": "音频已不可用",
25
- "Audio recorded": "音频已录制",
26
- auto: "汽车",
27
- "Auto-detect": "自动检测",
28
- Cancel: "取消",
29
- Caption: "标题",
30
- Casual: "随意的",
31
- casual: "随意的",
32
- Categories: "分类",
33
- "Checking capabilities…": "正在检查功能……",
34
- "Checking capabilities...": "正在检查功能……",
35
- Chinese: "中国人",
36
- Clear: "清除",
37
- "Clear audio": "清除音频",
38
- "Click again to confirm": "再次点击以确认",
39
- Close: "关闭",
40
- "Close chat": "关闭聊天",
41
- Confirm: "确认",
42
- Corrected: "已更正",
43
- "Creating final summary...": "正在生成最终摘要...",
44
- "Creating LanguageDetector session": "创建 LanguageDetector 会话",
45
- "Creating LanguageModel session": "创建 LanguageModel 会话",
46
- "Creating Proofreader session": "创建校对会议",
47
- "Creating Rewriter session": "创建 Rewriter 会话",
48
- "Creating Summarizer session": "创建摘要器会话",
49
- "Creating Translator session": "创建翻译会话",
50
- "Creating Writer session": "创建作家会议",
51
- "Deciding capability": "决策能力",
52
- Description: "描述",
53
- "Detecting language": "语言检测",
54
- "Done.": "完毕。",
55
- "Downloading model…": "正在下载模型…",
56
- "Downloading model...": "正在下载模型…",
57
- Dutch: "荷兰语",
58
- Edit: "编辑",
59
- "Empty response": "空回复",
60
- English: "英语",
61
- "Enter a search query to start.": "输入搜索词开始搜索。",
62
- Error: "错误",
63
- Excerpt: "摘抄",
64
- Filters: "筛选条件",
65
- Formal: "正式的",
66
- formal: "正式的",
67
- French: "法语",
68
- Generate: "生成",
69
- "Generate Image Metadata": "生成图片元数据",
70
- "Generate Post Metadata": "生成文章元数据",
71
- "Generated content": "生成的内容",
72
- "Generating text": "生成文本",
73
- "Generating…": "正在生成…",
74
- "Generating...": "正在生成…",
75
- German: "德语",
76
- Headline: "标题",
77
- headline: "标题",
78
- Hebrew: "希伯来语",
79
- Hide: "隐藏",
80
- Hindi: "印地语",
81
- "Hover highlights to see explanations.": "将鼠标悬停在高亮部分即可查看说明。",
82
- HTML: "HTML",
83
- Hungarian: "匈牙利",
84
- "I'm ready to assist you.": "我已准备好为你提供帮助。",
85
- "Image no longer available": "图片已不可用",
86
- "Image preview": "图片预览",
87
- Indonesian: "印度尼西亚",
88
- "Initializing on-device AI…": "正在初始化设备端人工智能……",
89
- "Initializing on-device AI...": "正在初始化设备端人工智能……",
90
- "Inlining images as base64": "将图像内联为 base64 格式",
91
- "Input and output languages cannot be the same.":
92
- "输入语言和输出语言不能相同。",
93
- "Input language": "输入语言",
94
- Instructions: "指示",
95
- "Interface language": "界面语言",
96
- Italian: "意大利语",
97
- Japanese: "日本人",
98
- "Key Points": "要点",
99
- "key-points": "要点",
100
- Korean: "韩国人",
101
- Length: "长度",
102
- Long: "长的",
103
- long: "长的",
104
- Longer: "更长",
105
- longer: "更长",
106
- Markdown: "Markdown",
107
- Maximize: "最大化",
108
- Medium: "中等的",
109
- medium: "中等的",
110
- "More casual": "更休闲",
111
- "More formal": "更正式",
112
- "more-casual": "更随意",
113
- "more-formal": "更正式的",
114
- Neutral: "中性的",
115
- neutral: "中性的",
116
- No: "否",
117
- "No content generated.": "未生成内容。",
118
- "No issues found. Your text looks great!": "未发现问题。您的文本看起来很棒!",
119
- "No overrides": "不覆盖",
120
- Norwegian: "挪威",
121
- "Not sent": "未发送",
122
- "On-device model ready.": "设备端模型已准备就绪。",
123
- "On-device model ready...": "端侧模型已就绪...",
124
- Options: "选项",
125
- "Output format": "输出格式",
126
- "Output language": "输出语言",
127
- "Plain Text": "纯文本",
128
- Polish: "抛光",
129
- Portuguese: "葡萄牙语",
130
- "Powered by": "供电",
131
- Preview: "预览",
132
- Proofread: "校对",
133
- "Proofread again": "再次校对",
134
- "Proofread on Backend": "后端校对",
135
- Proofreading: "校对中",
136
- "Proofreading part {current}/{total}...":
137
- "正在校对第 {current}/{total} 部分...",
138
- "Ready.": "就绪。",
139
- "Received backend response.": "已收到后端响应。",
140
- "Receiving response...": "正在接收响应...",
141
- Record: "录音",
142
- "Record audio": "录制音频",
143
- "Recorded audio:": "已录制音频:",
144
- "Recording...": "录制中...",
145
- Reference: "参考",
146
- References: "参考资料",
147
- Regenerate: "重新生成",
148
- "Regenerate on Backend": "后端重新生成",
149
- "Reject response": "拒绝回复",
150
- "Remove image": "移除图片",
151
- "Replace with": "替换为",
152
- "Requesting signed URL": "请求已签名 URL",
153
- Reset: "重置",
154
- "Reset conversation": "重置对话",
155
- "Restore size": "恢复大小",
156
- Rewrite: "改写",
157
- "Rewrite again": "重写",
158
- "Rewrite on Backend": "后端重写",
159
- "Rewriting part {current}/{total}...": "正在重写第 {current}/{total} 部分...",
160
- "Rewriting text": "重写文本",
161
- "Running on-device...": "正在端侧运行...",
162
- Russian: "俄语",
163
- Search: "搜索",
164
- "Search the documentation…": "查找文档……",
165
- "Search with AI-Kit": "使用 AI 工具包进行搜索",
166
- "Searching…": "正在搜索……",
167
- "Select or type tags…": "选择或输入标签…",
168
- "Select or type tags...": "选择或输入标签…",
169
- Send: "发送",
170
- "Sending request to backend…": "正在向后端发送请求…",
171
- "Sending request to server...": "正在向服务器发送请求...",
172
- Short: "短的",
173
- short: "短的",
174
- Shorter: "较短",
175
- shorter: "较短",
176
- Show: "展示",
177
- "Something went wrong.": "出问题了。",
178
- Sources: "来源",
179
- Spanish: "西班牙语",
180
- Stop: "停止",
181
- "Stop recording": "停止录制",
182
- Subcategories: "子分类",
183
- "Suggested change": "建议的更改",
184
- Summarize: "总结",
185
- "Summarize again": "再次总结",
186
- "Summarize on Backend": "后端总结",
187
- Summarizing: "总结",
188
- "Summarizing part {current}/{total}...":
189
- "正在总结第 {current}/{total} 部分...",
190
- Swedish: "瑞典",
191
- Tags: "标签",
192
- Teaser: "引导文案",
193
- teaser: "预告片",
194
- Thai: "泰国",
195
- "The alt text for the image.": "图片的替代文字。",
196
- "The caption for the image.": "图片说明文字。",
197
- "The configured AI model does not support image attachments. Contact the site administrator.":
198
- "配置的 AI 模型不支持图片附件。请联系网站管理员。",
199
- "The description for the image.": "图片描述。",
200
- "The excerpt for the post.": "可选。可能显示在搜索结果和预览中的简短摘要。",
201
- "The format for the generated output.": "生成输出的格式。",
202
- "The language AI-Kit should use for generated text by default (when applicable).":
203
- "AIKit 默认用于生成文本的语言(如适用)。",
204
- "The language of the input text.": "输入文本的语言。",
205
- "The summary style to generate.": "要生成的摘要样式。",
206
- "The target output length.": "目标输出长度。",
207
- "The title for the image.": "图片标题。",
208
- "The title for the post.": "帖子标题。",
209
- "The tone or style for the AI to use.": "人工智能使用的语气或风格。",
210
- "The topic or subject for the AI to write about.":
211
- "人工智能要撰写的主题或题目。",
212
- "This summary was generated by AI and may contain mistakes. Check important information.":
213
- "此摘要由 AI 生成,可能包含错误。请核实重要信息。",
214
- Title: "标题",
215
- "TL;DR": "简述",
216
- tldr: "太长不看",
217
- Tone: "语气",
218
- Topic: "话题",
219
- Translate: "翻译",
220
- "Translate again": "再次翻译",
221
- "Translate on Backend": "后端翻译",
222
- Translating: "翻译",
223
- "Translating text": "正在翻译文本",
224
- "Translating part {current}/{total}...":
225
- "正在翻译第 {current}/{total} 部分...",
226
- Turkish: "土耳其",
227
- Type: "类型",
228
- Ukrainian: "乌克兰",
229
- "Unexpected error": "意外错误",
230
- Uploading: "上传",
231
- "Uploading images via signed URL": "通过已签名 URL 上传图片",
232
- User: "用户",
233
- "View image": "查看图片",
234
- "Using backend": "使用后端",
235
- "Using on-device": "使用设备上的设备",
236
- "Waiting for backend response…": "正在等待后端响应……",
237
- "Waiting for response...": "正在等待响应...",
238
- Why: "为什么",
239
- "Working…": "正在处理…",
240
- "Working...": "正在处理…",
241
- "WPSuite AI-Kit": "WPSuite AI-Kit",
242
- Write: "撰写",
243
- "Writing part {current}/{total}...": "正在撰写第 {current}/{total} 部分...",
244
- Yes: "是",
245
- "You need a subscription to use this feature on frontend.":
246
- "您需要订阅才能在前端使用此功能。",
247
- };
package/src/index.tsx DELETED
@@ -1,7 +0,0 @@
1
- export * from "./ai-feature";
2
- export * from "./ai-chatbot";
3
- export * from "./doc-search";
4
- export * from "./useAiRun";
5
- export * from "./errorHandling";
6
- export { withAiKitShell } from "./withAiKitShell";
7
- export { translations } from "./i18n";
package/src/poweredBy.tsx DELETED
@@ -1,39 +0,0 @@
1
- import { Anchor, Text } from "@mantine/core";
2
- import { getAiKitPlugin } from "@smart-cloud/ai-kit-core";
3
- import { I18n } from "aws-amplify/utils";
4
- import { FC } from "react";
5
-
6
- const aiKit = getAiKitPlugin();
7
-
8
- export const PoweredBy: FC<{ variation?: "default" | "modal" }> = ({
9
- variation,
10
- }) => {
11
- return (
12
- <div
13
- style={{
14
- display: aiKit.settings?.enablePoweredBy ? "flex" : "none",
15
- justifyContent: aiKit.settings?.enablePoweredBy
16
- ? "flex-end"
17
- : undefined,
18
- padding: 0,
19
- marginRight: "var(--ai-kit-spacing-sm)",
20
- marginBottom:
21
- variation === "default" ? "var(--ai-kit-spacing-sm)" : undefined,
22
- }}
23
- className={aiKit.settings?.enablePoweredBy ? undefined : "sr-only"}
24
- >
25
- <Text c="p" ta="right" fs="italic" fz="xs">
26
- {I18n.get("Powered by")}{" "}
27
- <Anchor
28
- href="https://wpsuite.io/ai-kit/"
29
- target="_blank"
30
- td="none"
31
- fz="xs"
32
- fw={400}
33
- >
34
- {I18n.get("WPSuite AI-Kit")}
35
- </Anchor>
36
- </Text>
37
- </div>
38
- );
39
- };