@lobehub/chat 0.118.5 → 0.118.6

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 (80) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/next.config.mjs +0 -1
  3. package/package.json +1 -1
  4. package/src/app/chat/features/ChatHeader/ShareButton/Preview.tsx +1 -1
  5. package/src/features/Conversation/{ChatList/Actions → Actions}/Assistant.tsx +3 -1
  6. package/src/features/Conversation/{ChatList/Actions → Actions}/Error.tsx +3 -1
  7. package/src/features/Conversation/{ChatList/Actions → Actions}/Fallback.tsx +4 -1
  8. package/src/features/Conversation/{ChatList/Actions → Actions}/Function.tsx +4 -1
  9. package/src/features/Conversation/{ChatList/Actions → Actions}/User.tsx +3 -1
  10. package/src/features/Conversation/{ChatList/Actions → Actions}/index.ts +1 -2
  11. package/src/features/Conversation/{ChatList/Error → Error}/InvalidAccess.tsx +2 -1
  12. package/src/features/Conversation/{ChatList/Error → Error}/OpenAPIKey.tsx +1 -1
  13. package/src/features/Conversation/{ChatList/Error → Error}/OpenAiBizError.tsx +2 -1
  14. package/src/features/Conversation/{ChatList/Error → Error}/Plugin/PluginError.tsx +3 -1
  15. package/src/features/Conversation/{ChatList/Error → Error}/Plugin/PluginSettings.tsx +2 -1
  16. package/src/features/Conversation/{ChatList/Error → Error}/index.tsx +1 -1
  17. package/src/features/Conversation/{ChatList/Extras → Extras}/Translate.tsx +1 -1
  18. package/src/features/Conversation/{ChatList/Extras → Extras}/index.ts +1 -2
  19. package/src/features/Conversation/{ChatList/Messages → Messages}/Default.tsx +1 -1
  20. package/src/features/Conversation/{ChatList/Messages → Messages}/User.tsx +1 -1
  21. package/src/features/Conversation/{ChatList/Messages → Messages}/index.ts +5 -5
  22. package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/Loading.tsx +10 -11
  23. package/src/features/Conversation/components/ChatList/ActionsBar.tsx +27 -0
  24. package/src/features/Conversation/components/ChatList/HistoryDivider.tsx +23 -0
  25. package/src/features/Conversation/components/ChatList/Item.tsx +236 -0
  26. package/src/features/Conversation/components/ChatList/index.tsx +88 -0
  27. package/src/features/Conversation/components/ChatList/style.ts +10 -0
  28. package/src/features/Conversation/{ChatList → container}/index.tsx +6 -7
  29. package/src/features/Conversation/hooks/useChatListActionsBar.tsx +43 -0
  30. package/src/features/Conversation/index.tsx +3 -3
  31. package/src/store/middleware/createHyperStorage/index.test.ts +341 -0
  32. package/src/store/middleware/createHyperStorage/indexedDB.test.ts +64 -0
  33. package/src/store/middleware/createHyperStorage/urlStorage.test.ts +84 -0
  34. package/src/store/middleware/createHyperStorage/urlStorage.ts +25 -8
  35. /package/src/features/Conversation/{ChatList/Actions → Actions}/customAction.ts +0 -0
  36. /package/src/features/Conversation/{ChatList/Error → Error}/ApiKeyForm.tsx +0 -0
  37. /package/src/features/Conversation/{ChatList/Error → Error}/ErrorActionContainer.tsx +0 -0
  38. /package/src/features/Conversation/{ChatList/Error → Error}/style.tsx +0 -0
  39. /package/src/features/Conversation/{ChatList/Extras → Extras}/Assistant.test.tsx +0 -0
  40. /package/src/features/Conversation/{ChatList/Extras → Extras}/Assistant.tsx +0 -0
  41. /package/src/features/Conversation/{ChatList/Extras → Extras}/ExtraContainer.tsx +0 -0
  42. /package/src/features/Conversation/{ChatList/Extras → Extras}/TTS/FilePlayer.tsx +0 -0
  43. /package/src/features/Conversation/{ChatList/Extras → Extras}/TTS/InitPlayer.tsx +0 -0
  44. /package/src/features/Conversation/{ChatList/Extras → Extras}/TTS/Player.tsx +0 -0
  45. /package/src/features/Conversation/{ChatList/Extras → Extras}/TTS/index.tsx +0 -0
  46. /package/src/features/Conversation/{ChatList/Extras → Extras}/User.tsx +0 -0
  47. /package/src/features/Conversation/{ChatList/Extras → Extras}/type.ts +0 -0
  48. /package/src/features/Conversation/{ChatList/Messages → Messages}/Assistant.tsx +0 -0
  49. /package/src/features/Conversation/{ChatList/Messages → Messages}/Function.tsx +0 -0
  50. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Inspector/PluginResultJSON.tsx +0 -0
  51. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Inspector/Settings.tsx +0 -0
  52. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Inspector/index.tsx +0 -0
  53. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Inspector/style.ts +0 -0
  54. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/BuiltinType/index.test.tsx +0 -0
  55. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/BuiltinType/index.tsx +0 -0
  56. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/DefaultType/IFrameRender/index.tsx +0 -0
  57. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/DefaultType/SystemJsRender/index.tsx +0 -0
  58. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/DefaultType/SystemJsRender/utils.ts +0 -0
  59. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/DefaultType/index.tsx +0 -0
  60. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/MarkdownType/index.tsx +0 -0
  61. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/StandaloneType/Iframe.tsx +0 -0
  62. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/StandaloneType/index.tsx +0 -0
  63. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/index.tsx +0 -0
  64. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/useParseContent.ts +0 -0
  65. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/iframeOnReady.test.ts +0 -0
  66. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/iframeOnReady.ts +0 -0
  67. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/listenToPlugin.test.ts +0 -0
  68. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/listenToPlugin.ts +0 -0
  69. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/pluginSettings.test.ts +0 -0
  70. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/pluginSettings.ts +0 -0
  71. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/pluginState.test.ts +0 -0
  72. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/pluginState.ts +0 -0
  73. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/postMessage.test.ts +0 -0
  74. /package/src/features/Conversation/{ChatList/Plugins → Plugins}/Render/utils/postMessage.ts +0 -0
  75. /package/src/features/Conversation/{ChatList/Loading.tsx → components/BubblesLoading.tsx} +0 -0
  76. /package/src/features/Conversation/{ChatList → components}/OTPInput.tsx +0 -0
  77. /package/src/features/Conversation/{ScrollAnchor → components/ScrollAnchor}/index.tsx +0 -0
  78. /package/src/features/Conversation/{ScrollAnchor → components/ScrollAnchor}/useAtBottom.ts +0 -0
  79. /package/src/features/Conversation/{ChatList → components}/SkeletonList.tsx +0 -0
  80. /package/src/features/Conversation/{useInitConversation.ts → hooks/useInitConversation.ts} +0 -0
@@ -46,15 +46,32 @@ export const creatUrlStorage = <State extends object>(mode: 'hash' | 'search' =
46
46
  const searchParameters = new URLSearchParams(getUrlSearch());
47
47
 
48
48
  for (const [urlKey, v] of Object.entries(state)) {
49
- if (isEmpty(v)) {
50
- searchParameters.delete(urlKey);
51
- continue;
52
- }
49
+ switch (typeof v) {
50
+ case 'boolean': {
51
+ searchParameters.set(urlKey, (v ? 1 : 0).toString());
52
+ break;
53
+ }
54
+
55
+ case 'bigint':
56
+ case 'number': {
57
+ searchParameters.set(urlKey, v.toString());
58
+ break;
59
+ }
60
+
61
+ case 'string': {
62
+ searchParameters.set(urlKey, v);
63
+ break;
64
+ }
65
+
66
+ case 'object': {
67
+ if (isEmpty(v)) {
68
+ searchParameters.delete(urlKey);
69
+ continue;
70
+ }
53
71
 
54
- if (typeof v === 'string') {
55
- searchParameters.set(urlKey, v);
56
- } else {
57
- searchParameters.set(urlKey, JSON.stringify(v));
72
+ searchParameters.set(urlKey, JSON.stringify(v));
73
+ break;
74
+ }
58
75
  }
59
76
  }
60
77