@blocklet/pages-kit 0.2.432 → 0.2.434

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 (319) hide show
  1. package/lib/cjs/builtin/async/ai-runtime.js +17 -0
  2. package/lib/cjs/builtin/{async/ai-runtime/components/AgentInputField/LanguageField.js → components/LanguageField/index.js} +3 -3
  3. package/lib/cjs/builtin/{components.js → components/index.js} +1 -1
  4. package/lib/cjs/components/CustomComponentRenderer/context.js +13 -0
  5. package/lib/cjs/components/CustomComponentRenderer/index.js +5 -1
  6. package/lib/cjs/components/CustomComponentRenderer/state.js +20 -6
  7. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  8. package/lib/esm/builtin/async/ai-runtime.js +1 -0
  9. package/lib/esm/builtin/{async/ai-runtime/components/AgentInputField/LanguageField.js → components/LanguageField/index.js} +2 -2
  10. package/lib/esm/builtin/components/index.js +1 -0
  11. package/lib/esm/components/CustomComponentRenderer/context.js +9 -0
  12. package/lib/esm/components/CustomComponentRenderer/index.js +5 -1
  13. package/lib/esm/components/CustomComponentRenderer/state.js +21 -7
  14. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  15. package/lib/types/builtin/async/ai-runtime.d.ts +1 -0
  16. package/lib/types/builtin/components/index.d.ts +1 -0
  17. package/lib/types/components/CustomComponentRenderer/context.d.ts +14 -0
  18. package/lib/types/components/CustomComponentRenderer/index.d.ts +1 -0
  19. package/lib/types/components/CustomComponentRenderer/state.d.ts +5 -1
  20. package/lib/types/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +12 -5
  22. package/tsconfig.json +1 -1
  23. package/lib/cjs/builtin/async/ai-runtime/api/agent.js +0 -24
  24. package/lib/cjs/builtin/async/ai-runtime/api/asset.js +0 -25
  25. package/lib/cjs/builtin/async/ai-runtime/api/dataset.js +0 -134
  26. package/lib/cjs/builtin/async/ai-runtime/api/message.js +0 -46
  27. package/lib/cjs/builtin/async/ai-runtime/api/request.js +0 -74
  28. package/lib/cjs/builtin/async/ai-runtime/api/secret.js +0 -24
  29. package/lib/cjs/builtin/async/ai-runtime/api/session.js +0 -137
  30. package/lib/cjs/builtin/async/ai-runtime/components/ActionButton.js +0 -62
  31. package/lib/cjs/builtin/async/ai-runtime/components/AgentErrorBoundary.js +0 -34
  32. package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/BooleanField.js +0 -21
  33. package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/NumberField.js +0 -21
  34. package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/RadioField.js +0 -39
  35. package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/SelectField.js +0 -24
  36. package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/StringField.js +0 -35
  37. package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/index.js +0 -44
  38. package/lib/cjs/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +0 -80
  39. package/lib/cjs/builtin/async/ai-runtime/components/GlobalLoading/index.js +0 -27
  40. package/lib/cjs/builtin/async/ai-runtime/components/GlobalLoading/state.js +0 -39
  41. package/lib/cjs/builtin/async/ai-runtime/components/Header/SimpleHeader.js +0 -49
  42. package/lib/cjs/builtin/async/ai-runtime/components/Layout/SimpleLayout.js +0 -21
  43. package/lib/cjs/builtin/async/ai-runtime/components/LoadingButton.js +0 -40
  44. package/lib/cjs/builtin/async/ai-runtime/components/MarkdownRenderer/index.js +0 -146
  45. package/lib/cjs/builtin/async/ai-runtime/components/MenuButton.js +0 -55
  46. package/lib/cjs/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +0 -22
  47. package/lib/cjs/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +0 -49
  48. package/lib/cjs/builtin/async/ai-runtime/components/PopperMenuButton/index.js +0 -68
  49. package/lib/cjs/builtin/async/ai-runtime/components/RuntimeCommonProvider.js +0 -25
  50. package/lib/cjs/builtin/async/ai-runtime/components/ScrollView.js +0 -92
  51. package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/Community.js +0 -6
  52. package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +0 -255
  53. package/lib/cjs/builtin/async/ai-runtime/components/SocialShare.js +0 -108
  54. package/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +0 -191
  55. package/lib/cjs/builtin/async/ai-runtime/components/UserInfo.js +0 -55
  56. package/lib/cjs/builtin/async/ai-runtime/constants.js +0 -43
  57. package/lib/cjs/builtin/async/ai-runtime/contexts/ActiveAgent.js +0 -27
  58. package/lib/cjs/builtin/async/ai-runtime/contexts/ComponentPreferences.js +0 -31
  59. package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentAgent.js +0 -34
  60. package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentMessage.js +0 -18
  61. package/lib/cjs/builtin/async/ai-runtime/contexts/Identity.js +0 -36
  62. package/lib/cjs/builtin/async/ai-runtime/contexts/Runtime.js +0 -52
  63. package/lib/cjs/builtin/async/ai-runtime/error.js +0 -10
  64. package/lib/cjs/builtin/async/ai-runtime/hooks/use-agent-admin.js +0 -13
  65. package/lib/cjs/builtin/async/ai-runtime/hooks/use-appearances.js +0 -109
  66. package/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +0 -50
  67. package/lib/cjs/builtin/async/ai-runtime/index.js +0 -83
  68. package/lib/cjs/builtin/async/ai-runtime/locales/index.js +0 -237
  69. package/lib/cjs/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +0 -116
  70. package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +0 -48
  71. package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +0 -138
  72. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +0 -19
  73. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +0 -186
  74. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageMetadataRenderer.js +0 -24
  75. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageSuggestedQuestions.js +0 -34
  76. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/ReferenceLinks.js +0 -11
  77. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/index.js +0 -24
  78. package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +0 -85
  79. package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +0 -64
  80. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +0 -30
  81. package/lib/cjs/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +0 -13
  82. package/lib/cjs/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +0 -46
  83. package/lib/cjs/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +0 -2
  84. package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +0 -65
  85. package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +0 -150
  86. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +0 -26
  87. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ShareView/index.js +0 -16
  88. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +0 -38
  89. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/DrawerOpenCloseIcon.js +0 -42
  90. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +0 -94
  91. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +0 -79
  92. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +0 -34
  93. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +0 -45
  94. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +0 -28
  95. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +0 -82
  96. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +0 -69
  97. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +0 -55
  98. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +0 -54
  99. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Input.js +0 -189
  100. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Output.js +0 -252
  101. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +0 -300
  102. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +0 -158
  103. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +0 -60
  104. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +0 -153
  105. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +0 -80
  106. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.js +0 -25
  107. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +0 -68
  108. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +0 -56
  109. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/index.js +0 -12
  110. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/utils.js +0 -13
  111. package/lib/cjs/builtin/async/ai-runtime/state/agent.js +0 -58
  112. package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +0 -48
  113. package/lib/cjs/builtin/async/ai-runtime/state/session.js +0 -415
  114. package/lib/cjs/builtin/async/ai-runtime/utils/agent-inputs.js +0 -14
  115. package/lib/cjs/builtin/async/ai-runtime/utils/download-image.js +0 -40
  116. package/lib/cjs/builtin/async/ai-runtime/utils/fonts.js +0 -35
  117. package/lib/cjs/builtin/async/ai-runtime/utils/map-right.js +0 -10
  118. package/lib/cjs/builtin/async/ai-runtime/utils/runtime-output-schema.js +0 -7
  119. package/lib/cjs/builtin/async/ai-runtime/utils/zustand.js +0 -9
  120. package/lib/esm/builtin/async/ai-runtime/api/agent.js +0 -21
  121. package/lib/esm/builtin/async/ai-runtime/api/asset.js +0 -22
  122. package/lib/esm/builtin/async/ai-runtime/api/dataset.js +0 -121
  123. package/lib/esm/builtin/async/ai-runtime/api/message.js +0 -42
  124. package/lib/esm/builtin/async/ai-runtime/api/request.js +0 -68
  125. package/lib/esm/builtin/async/ai-runtime/api/secret.js +0 -21
  126. package/lib/esm/builtin/async/ai-runtime/api/session.js +0 -128
  127. package/lib/esm/builtin/async/ai-runtime/components/ActionButton.js +0 -56
  128. package/lib/esm/builtin/async/ai-runtime/components/AgentErrorBoundary.js +0 -30
  129. package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/BooleanField.js +0 -19
  130. package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/NumberField.js +0 -19
  131. package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/RadioField.js +0 -37
  132. package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/SelectField.js +0 -22
  133. package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/StringField.js +0 -33
  134. package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/index.js +0 -38
  135. package/lib/esm/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +0 -76
  136. package/lib/esm/builtin/async/ai-runtime/components/GlobalLoading/index.js +0 -22
  137. package/lib/esm/builtin/async/ai-runtime/components/GlobalLoading/state.js +0 -36
  138. package/lib/esm/builtin/async/ai-runtime/components/Header/SimpleHeader.js +0 -23
  139. package/lib/esm/builtin/async/ai-runtime/components/Layout/SimpleLayout.js +0 -18
  140. package/lib/esm/builtin/async/ai-runtime/components/LoadingButton.js +0 -38
  141. package/lib/esm/builtin/async/ai-runtime/components/MarkdownRenderer/index.js +0 -118
  142. package/lib/esm/builtin/async/ai-runtime/components/MenuButton.js +0 -52
  143. package/lib/esm/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +0 -19
  144. package/lib/esm/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +0 -46
  145. package/lib/esm/builtin/async/ai-runtime/components/PopperMenuButton/index.js +0 -42
  146. package/lib/esm/builtin/async/ai-runtime/components/RuntimeCommonProvider.js +0 -18
  147. package/lib/esm/builtin/async/ai-runtime/components/ScrollView.js +0 -63
  148. package/lib/esm/builtin/async/ai-runtime/components/ShareActions/Community.js +0 -4
  149. package/lib/esm/builtin/async/ai-runtime/components/ShareActions/index.js +0 -226
  150. package/lib/esm/builtin/async/ai-runtime/components/SocialShare.js +0 -100
  151. package/lib/esm/builtin/async/ai-runtime/components/ThemeProvider.js +0 -185
  152. package/lib/esm/builtin/async/ai-runtime/components/UserInfo.js +0 -47
  153. package/lib/esm/builtin/async/ai-runtime/constants.js +0 -39
  154. package/lib/esm/builtin/async/ai-runtime/contexts/ActiveAgent.js +0 -23
  155. package/lib/esm/builtin/async/ai-runtime/contexts/ComponentPreferences.js +0 -24
  156. package/lib/esm/builtin/async/ai-runtime/contexts/CurrentAgent.js +0 -30
  157. package/lib/esm/builtin/async/ai-runtime/contexts/CurrentMessage.js +0 -14
  158. package/lib/esm/builtin/async/ai-runtime/contexts/Identity.js +0 -28
  159. package/lib/esm/builtin/async/ai-runtime/contexts/Runtime.js +0 -22
  160. package/lib/esm/builtin/async/ai-runtime/error.js +0 -6
  161. package/lib/esm/builtin/async/ai-runtime/hooks/use-agent-admin.js +0 -10
  162. package/lib/esm/builtin/async/ai-runtime/hooks/use-appearances.js +0 -103
  163. package/lib/esm/builtin/async/ai-runtime/hooks/use-header-menu.js +0 -44
  164. package/lib/esm/builtin/async/ai-runtime/index.js +0 -37
  165. package/lib/esm/builtin/async/ai-runtime/locales/index.js +0 -234
  166. package/lib/esm/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +0 -87
  167. package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +0 -19
  168. package/lib/esm/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +0 -132
  169. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +0 -13
  170. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +0 -157
  171. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageMetadataRenderer.js +0 -18
  172. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageSuggestedQuestions.js +0 -30
  173. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/ReferenceLinks.js +0 -8
  174. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/index.js +0 -18
  175. package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +0 -56
  176. package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +0 -58
  177. package/lib/esm/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +0 -24
  178. package/lib/esm/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +0 -7
  179. package/lib/esm/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +0 -40
  180. package/lib/esm/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +0 -1
  181. package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +0 -59
  182. package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +0 -144
  183. package/lib/esm/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +0 -20
  184. package/lib/esm/builtin/async/ai-runtime/runtime-components/ShareView/index.js +0 -10
  185. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +0 -35
  186. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/DrawerOpenCloseIcon.js +0 -39
  187. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +0 -65
  188. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +0 -50
  189. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +0 -28
  190. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +0 -40
  191. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +0 -22
  192. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +0 -53
  193. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +0 -40
  194. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +0 -49
  195. package/lib/esm/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +0 -48
  196. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Input.js +0 -183
  197. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Output.js +0 -246
  198. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +0 -294
  199. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +0 -149
  200. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +0 -55
  201. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +0 -146
  202. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +0 -75
  203. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.js +0 -23
  204. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +0 -42
  205. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +0 -52
  206. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/index.js +0 -3
  207. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/utils.js +0 -9
  208. package/lib/esm/builtin/async/ai-runtime/state/agent.js +0 -55
  209. package/lib/esm/builtin/async/ai-runtime/state/runtime.js +0 -45
  210. package/lib/esm/builtin/async/ai-runtime/state/session.js +0 -408
  211. package/lib/esm/builtin/async/ai-runtime/utils/agent-inputs.js +0 -10
  212. package/lib/esm/builtin/async/ai-runtime/utils/download-image.js +0 -36
  213. package/lib/esm/builtin/async/ai-runtime/utils/fonts.js +0 -32
  214. package/lib/esm/builtin/async/ai-runtime/utils/map-right.js +0 -7
  215. package/lib/esm/builtin/async/ai-runtime/utils/runtime-output-schema.js +0 -4
  216. package/lib/esm/builtin/async/ai-runtime/utils/zustand.js +0 -6
  217. package/lib/esm/builtin/components.js +0 -1
  218. package/lib/types/builtin/async/ai-runtime/api/agent.d.ts +0 -51
  219. package/lib/types/builtin/async/ai-runtime/api/asset.d.ts +0 -16
  220. package/lib/types/builtin/async/ai-runtime/api/dataset.d.ts +0 -39
  221. package/lib/types/builtin/async/ai-runtime/api/message.d.ts +0 -35
  222. package/lib/types/builtin/async/ai-runtime/api/request.d.ts +0 -12
  223. package/lib/types/builtin/async/ai-runtime/api/secret.d.ts +0 -12
  224. package/lib/types/builtin/async/ai-runtime/api/session.d.ts +0 -61
  225. package/lib/types/builtin/async/ai-runtime/components/ActionButton.d.ts +0 -14
  226. package/lib/types/builtin/async/ai-runtime/components/AgentErrorBoundary.d.ts +0 -7
  227. package/lib/types/builtin/async/ai-runtime/components/AgentInputField/BooleanField.d.ts +0 -8
  228. package/lib/types/builtin/async/ai-runtime/components/AgentInputField/NumberField.d.ts +0 -8
  229. package/lib/types/builtin/async/ai-runtime/components/AgentInputField/RadioField.d.ts +0 -8
  230. package/lib/types/builtin/async/ai-runtime/components/AgentInputField/SelectField.d.ts +0 -8
  231. package/lib/types/builtin/async/ai-runtime/components/AgentInputField/StringField.d.ts +0 -8
  232. package/lib/types/builtin/async/ai-runtime/components/AgentInputField/index.d.ts +0 -7
  233. package/lib/types/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.d.ts +0 -10
  234. package/lib/types/builtin/async/ai-runtime/components/GlobalLoading/index.d.ts +0 -3
  235. package/lib/types/builtin/async/ai-runtime/components/GlobalLoading/state.d.ts +0 -10
  236. package/lib/types/builtin/async/ai-runtime/components/Header/SimpleHeader.d.ts +0 -5
  237. package/lib/types/builtin/async/ai-runtime/components/Layout/SimpleLayout.d.ts +0 -2
  238. package/lib/types/builtin/async/ai-runtime/components/LoadingButton.d.ts +0 -3
  239. package/lib/types/builtin/async/ai-runtime/components/MarkdownRenderer/index.d.ts +0 -2
  240. package/lib/types/builtin/async/ai-runtime/components/MenuButton.d.ts +0 -10
  241. package/lib/types/builtin/async/ai-runtime/components/OutputFieldContainer/index.d.ts +0 -5
  242. package/lib/types/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.d.ts +0 -5
  243. package/lib/types/builtin/async/ai-runtime/components/PopperMenuButton/index.d.ts +0 -6
  244. package/lib/types/builtin/async/ai-runtime/components/RuntimeCommonProvider.d.ts +0 -7
  245. package/lib/types/builtin/async/ai-runtime/components/ScrollView.d.ts +0 -10
  246. package/lib/types/builtin/async/ai-runtime/components/ShareActions/Community.d.ts +0 -4
  247. package/lib/types/builtin/async/ai-runtime/components/ShareActions/index.d.ts +0 -2
  248. package/lib/types/builtin/async/ai-runtime/components/SocialShare.d.ts +0 -20
  249. package/lib/types/builtin/async/ai-runtime/components/ThemeProvider.d.ts +0 -4
  250. package/lib/types/builtin/async/ai-runtime/components/UserInfo.d.ts +0 -18
  251. package/lib/types/builtin/async/ai-runtime/constants.d.ts +0 -21
  252. package/lib/types/builtin/async/ai-runtime/contexts/ActiveAgent.d.ts +0 -9
  253. package/lib/types/builtin/async/ai-runtime/contexts/ComponentPreferences.d.ts +0 -11
  254. package/lib/types/builtin/async/ai-runtime/contexts/CurrentAgent.d.ts +0 -16
  255. package/lib/types/builtin/async/ai-runtime/contexts/CurrentMessage.d.ts +0 -15
  256. package/lib/types/builtin/async/ai-runtime/contexts/Identity.d.ts +0 -16
  257. package/lib/types/builtin/async/ai-runtime/contexts/Runtime.d.ts +0 -4
  258. package/lib/types/builtin/async/ai-runtime/error.d.ts +0 -4
  259. package/lib/types/builtin/async/ai-runtime/hooks/use-agent-admin.d.ts +0 -2
  260. package/lib/types/builtin/async/ai-runtime/hooks/use-appearances.d.ts +0 -78
  261. package/lib/types/builtin/async/ai-runtime/hooks/use-header-menu.d.ts +0 -1
  262. package/lib/types/builtin/async/ai-runtime/index.d.ts +0 -36
  263. package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +0 -210
  264. package/lib/types/builtin/async/ai-runtime/runtime/ChatBotButton/index.d.ts +0 -5
  265. package/lib/types/builtin/async/ai-runtime/runtime/Runtime/index.d.ts +0 -5
  266. package/lib/types/builtin/async/ai-runtime/runtime-components/AutoForm/index.d.ts +0 -7
  267. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.d.ts +0 -4
  268. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.d.ts +0 -12
  269. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageMetadataRenderer.d.ts +0 -4
  270. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageSuggestedQuestions.d.ts +0 -7
  271. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/ReferenceLinks.d.ts +0 -4
  272. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/index.d.ts +0 -4
  273. package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.d.ts +0 -4
  274. package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.d.ts +0 -2
  275. package/lib/types/builtin/async/ai-runtime/runtime-components/ImagesView/index.d.ts +0 -2
  276. package/lib/types/builtin/async/ai-runtime/runtime-components/MarkdownView/index.d.ts +0 -5
  277. package/lib/types/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.d.ts +0 -2
  278. package/lib/types/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.d.ts +0 -5
  279. package/lib/types/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.d.ts +0 -3
  280. package/lib/types/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.d.ts +0 -1
  281. package/lib/types/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.d.ts +0 -2
  282. package/lib/types/builtin/async/ai-runtime/runtime-components/ShareView/index.d.ts +0 -2
  283. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.d.ts +0 -1
  284. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/DrawerOpenCloseIcon.d.ts +0 -4
  285. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.d.ts +0 -2
  286. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.d.ts +0 -9
  287. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.d.ts +0 -2
  288. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.d.ts +0 -4
  289. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.d.ts +0 -1
  290. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/index.d.ts +0 -16
  291. package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.d.ts +0 -1
  292. package/lib/types/builtin/async/ai-runtime/runtime-components/SimplePage/index.d.ts +0 -6
  293. package/lib/types/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.d.ts +0 -4
  294. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Input.d.ts +0 -7
  295. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Output.d.ts +0 -1
  296. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Page.d.ts +0 -1
  297. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.d.ts +0 -20
  298. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.d.ts +0 -5
  299. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/Loading.d.ts +0 -3
  300. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.d.ts +0 -5
  301. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.d.ts +0 -3
  302. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.d.ts +0 -3
  303. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.d.ts +0 -17
  304. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/index.d.ts +0 -3
  305. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/utils.d.ts +0 -7
  306. package/lib/types/builtin/async/ai-runtime/state/agent.d.ts +0 -12
  307. package/lib/types/builtin/async/ai-runtime/state/runtime.d.ts +0 -14
  308. package/lib/types/builtin/async/ai-runtime/state/session.d.ts +0 -60
  309. package/lib/types/builtin/async/ai-runtime/utils/agent-inputs.d.ts +0 -5
  310. package/lib/types/builtin/async/ai-runtime/utils/download-image.d.ts +0 -4
  311. package/lib/types/builtin/async/ai-runtime/utils/fonts.d.ts +0 -5
  312. package/lib/types/builtin/async/ai-runtime/utils/map-right.d.ts +0 -1
  313. package/lib/types/builtin/async/ai-runtime/utils/runtime-output-schema.d.ts +0 -3
  314. package/lib/types/builtin/async/ai-runtime/utils/zustand.d.ts +0 -2
  315. package/lib/types/builtin/components.d.ts +0 -1
  316. /package/lib/cjs/builtin/{async/ai-runtime/utils → components/LanguageField}/languages.js +0 -0
  317. /package/lib/esm/builtin/{async/ai-runtime/utils → components/LanguageField}/languages.js +0 -0
  318. /package/lib/types/builtin/{async/ai-runtime/components/AgentInputField/LanguageField.d.ts → components/LanguageField/index.d.ts} +0 -0
  319. /package/lib/types/builtin/{async/ai-runtime/utils → components/LanguageField}/languages.d.ts +0 -0
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.default = OutputFieldContainer;
15
- const jsx_runtime_1 = require("react/jsx-runtime");
16
- const react_1 = require("@iconify/react");
17
- const material_1 = require("@mui/material");
18
- function OutputFieldContainer(_a) {
19
- var _b;
20
- var { output } = _a, props = __rest(_a, ["output"]);
21
- return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ gap: 1 }, props, { children: [((_b = output.appearance) === null || _b === void 0 ? void 0 : _b.title) && ((0, jsx_runtime_1.jsxs)(material_1.Typography, { component: "h6", noWrap: true, sx: { display: 'flex', alignItems: 'center', gap: 1, fontSize: 18, fontWeight: 500 }, children: [output.appearance.icon && (0, jsx_runtime_1.jsx)(material_1.Box, { component: react_1.Icon, icon: output.appearance.icon }), (0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: { flex: 1, textOverflow: 'hidden' }, children: output.appearance.title })] })), props.children] })));
22
- }
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
19
- }
20
- return t;
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.default = LoadingMenuItem;
24
- const jsx_runtime_1 = require("react/jsx-runtime");
25
- const material_1 = require("@mui/material");
26
- const react_1 = require("react");
27
- function LoadingMenuItem(_a) {
28
- var { children, confirmation } = _a, props = __rest(_a, ["children", "confirmation"]);
29
- const [clicked, setClicked] = (0, react_1.useState)(false);
30
- const [loading, setLoading] = (0, react_1.useState)(false);
31
- const handleClick = (e) => __awaiter(this, void 0, void 0, function* () {
32
- var _a;
33
- if (loading)
34
- return;
35
- if (!clicked && confirmation) {
36
- setClicked(true);
37
- return;
38
- }
39
- try {
40
- setLoading(true);
41
- yield ((_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e));
42
- }
43
- finally {
44
- setClicked(false);
45
- setLoading(false);
46
- }
47
- });
48
- return ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({}, props, { onClick: handleClick, sx: Object.assign(Object.assign({}, props.sx), { display: 'flex', alignItems: 'center' }), children: [(clicked && confirmation) || children, (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end", sx: { width: 18 }, children: loading && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 14 }) })] })));
49
- }
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __rest = (this && this.__rest) || function (s, e) {
35
- var t = {};
36
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
37
- t[p] = s[p];
38
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
39
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
40
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
41
- t[p[i]] = s[p[i]];
42
- }
43
- return t;
44
- };
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.default = PopperMenuButton;
47
- const jsx_runtime_1 = require("react/jsx-runtime");
48
- const material_1 = require("@mui/material");
49
- const hooks_1 = require("material-ui-popup-state/hooks");
50
- const react_1 = __importStar(require("react"));
51
- function PopperMenuButton(_a) {
52
- var { PopperProps, menus } = _a, props = __rest(_a, ["PopperProps", "menus"]);
53
- const state = (0, hooks_1.usePopupState)({ variant: 'popper' });
54
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: material_1.Button }, (0, hooks_1.bindTrigger)(state), props)), (0, jsx_runtime_1.jsx)(material_1.Popper, Object.assign({ transition: true }, PopperProps, (0, hooks_1.bindPopper)(state), { children: ({ TransitionProps }) => ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: state.close, children: (0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({}, TransitionProps, { children: (0, jsx_runtime_1.jsx)(material_1.Paper, { children: (0, jsx_runtime_1.jsx)(material_1.List, { dense: true, sx: {
55
- [`.${material_1.listItemIconClasses.root}`]: {
56
- minWidth: 24,
57
- },
58
- }, children: react_1.default.Children.map(menus, (menu) => !(0, react_1.isValidElement)(menu)
59
- ? menu
60
- : react_1.default.cloneElement(menu, {
61
- // Close popper after the menu item click handler has been resolved
62
- onClick: (...args) => __awaiter(this, void 0, void 0, function* () {
63
- var _a, _b;
64
- yield ((_b = (_a = menu.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, ...args));
65
- state.close();
66
- }),
67
- })) }) }) })) })) }))] }));
68
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = RuntimeCommonProvider;
7
- exports.RuntimeLocaleProvider = RuntimeLocaleProvider;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const react_1 = __importDefault(require("react"));
10
- const react_error_boundary_1 = require("react-error-boundary");
11
- const ux_1 = require("../../../arcblock/ux");
12
- const locale_1 = require("../../../locale");
13
- const locales_1 = require("../locales");
14
- function RuntimeCommonProvider({ children }) {
15
- return ((0, jsx_runtime_1.jsx)(RuntimeLocaleProvider, { children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorRender, children: (0, jsx_runtime_1.jsx)(react_1.default.Suspense, { children: children }) }) }));
16
- }
17
- function ErrorRender({ error }) {
18
- return ((0, jsx_runtime_1.jsx)(ux_1.Result, { status: error.status || 'error', description: error.message, sx: { bgcolor: 'transparent', mt: '20%' } }));
19
- }
20
- function RuntimeLocaleProvider({ children }) {
21
- const { locale } = (0, locale_1.useLocaleContext)();
22
- return (
23
- // @ts-ignore
24
- (0, jsx_runtime_1.jsx)(locale_1.LocaleProvider, { translations: locales_1.translations, locale: locale, fallbackLocale: "en", children: children }));
25
- }
@@ -1,92 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.default = ScrollView;
41
- const jsx_runtime_1 = require("react/jsx-runtime");
42
- const material_1 = require("@mui/material");
43
- const react_1 = require("react");
44
- const scrollToBottom = __importStar(require("react-scroll-to-bottom"));
45
- // @ts-ignore
46
- const useInternalContext_1 = __importDefault(require("react-scroll-to-bottom/lib/esm/hooks/internal/useInternalContext"));
47
- // @ts-ignore
48
- const Composer = scrollToBottom.Composer;
49
- function ScrollView(_a) {
50
- var { disabled, children, scroll, component, initialScrollBehavior } = _a, props = __rest(_a, ["disabled", "children", "scroll", "component", "initialScrollBehavior"]);
51
- if (disabled) {
52
- if (component) {
53
- return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: component }, props, { children: children })));
54
- }
55
- return children;
56
- }
57
- return ((0, jsx_runtime_1.jsx)(Composer, { initialScrollBehavior: initialScrollBehavior, children: (0, jsx_runtime_1.jsx)(ScrollViewWithinWindow, Object.assign({ scroll: scroll, component: component }, props, { children: children })) }));
58
- }
59
- function ScrollViewWithinWindow(_a) {
60
- var { children, scroll, component } = _a, props = __rest(_a, ["children", "scroll", "component"]);
61
- const { setTarget } = (0, useInternalContext_1.default)();
62
- const ele = useFakeScrollElementOfWindow();
63
- (0, react_1.useEffect)(() => {
64
- if (scroll === 'window') {
65
- setTarget(ele);
66
- }
67
- }, [scroll]);
68
- if (!component)
69
- return children;
70
- return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: component }, props, { ref: !scroll ? setTarget : undefined, children: children })));
71
- }
72
- function useFakeScrollElementOfWindow() {
73
- return (0, react_1.useMemo)(() => {
74
- const e = document.scrollingElement;
75
- return new Proxy(e, {
76
- get: (_, p) => {
77
- if (p === 'offsetHeight')
78
- return window.innerHeight;
79
- if (['addEventListener', 'removeEventListener'].includes(p))
80
- return window[p].bind(window);
81
- const v = e[p];
82
- if (v instanceof Function)
83
- return v.bind(e);
84
- return v;
85
- },
86
- set: (_, p, v) => {
87
- e[p] = v;
88
- return true;
89
- },
90
- });
91
- }, []);
92
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const material_1 = require("@mui/material");
5
- const CommunityIcon = (0, material_1.createSvgIcon)((0, jsx_runtime_1.jsxs)("svg", { style: { width: '15px', height: '15px' }, viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { opacity: "0.6", fillRule: "evenodd", clipRule: "evenodd", d: "M29.2518 28.4159V29.282L28.5018 29.715L6.89191 42.1915L7.64197 43.4906L30.0019 30.5811L52.3618 43.4906L53.1119 42.1915L31.502 29.715L30.752 29.282V28.4159V3.46293H29.2518V28.4159Z", stroke: "currentColor", fill: "white", strokeWidth: "2" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M30.0019 2L54.0038 15.8575V43.5725L30.0019 57.43L6 43.5725V15.8575L30.0019 2ZM8.25018 16.2905L23.1764 24.9082L30.0019 13.086L36.8274 24.9082L51.7536 16.2905L30.0019 3.73219L8.25018 16.2905ZM52.5037 17.5897L37.5775 26.2073L44.403 38.0295L30.752 45.911V55.2648L52.5037 42.7064V17.5897ZM29.2518 55.2648V45.911L15.6008 38.0295L22.4263 26.2073L7.50012 17.5897V42.7064L29.2518 55.2648ZM23.7254 26.9574L17.65 37.4804L29.2518 44.1788V31.0141V30.148L28.5018 29.715L23.7254 26.9574ZM30.752 44.1788L42.3538 37.4804L36.2784 26.9574L31.502 29.715L30.752 30.148V31.0141V44.1788ZM35.5283 25.6582L30.0019 16.0862L24.4755 25.6582L30.0019 28.8489L35.5283 25.6582Z", stroke: "currentColor", fill: "white", strokeWidth: "2" })] }), 'AIGNE');
6
- exports.default = CommunityIcon;
@@ -1,255 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __rest = (this && this.__rest) || function (s, e) {
35
- var t = {};
36
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
37
- t[p] = s[p];
38
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
39
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
40
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
41
- t[p[i]] = s[p[i]];
42
- }
43
- return t;
44
- };
45
- var __importDefault = (this && this.__importDefault) || function (mod) {
46
- return (mod && mod.__esModule) ? mod : { "default": mod };
47
- };
48
- Object.defineProperty(exports, "__esModule", { value: true });
49
- exports.default = ShareActions;
50
- const jsx_runtime_1 = require("react/jsx-runtime");
51
- const types_1 = require("@blocklet/ai-runtime/types");
52
- const react_1 = require("@iconify/react");
53
- const material_1 = require("@mui/material");
54
- const file_saver_1 = require("file-saver");
55
- const isomorphic_dompurify_1 = __importDefault(require("isomorphic-dompurify"));
56
- const react_2 = require("react");
57
- const ufo_1 = require("ufo");
58
- const locale_1 = require("../../../../locale");
59
- const session_1 = require("../../../../session");
60
- const constants_1 = require("../../constants");
61
- const CurrentAgent_1 = require("../../contexts/CurrentAgent");
62
- const CurrentMessage_1 = require("../../contexts/CurrentMessage");
63
- const use_appearances_1 = require("../../hooks/use-appearances");
64
- const runtime_1 = require("../../state/runtime");
65
- const agent_inputs_1 = require("../../utils/agent-inputs");
66
- const download_image_1 = require("../../utils/download-image");
67
- const ActionButton_1 = __importDefault(require("../ActionButton"));
68
- const Community_1 = __importDefault(require("./Community"));
69
- function ShareActions(_a) {
70
- var _b;
71
- var props = __rest(_a, []);
72
- const { agent } = (0, CurrentAgent_1.useCurrentAgent)();
73
- const { message } = (0, CurrentMessage_1.useCurrentMessage)();
74
- const sharing = (0, react_2.useMemo)(() => {
75
- var _a, _b;
76
- return (_b = (_a = agent.outputVariables) === null || _a === void 0 ? void 0 : _a.find((i) => i.name === types_1.RuntimeOutputVariable.share)) === null || _b === void 0 ? void 0 : _b.initialValue;
77
- }, [agent]);
78
- const inputs = (0, react_2.useMemo)(() => {
79
- var _a;
80
- return ((_a = agent.parameters) === null || _a === void 0 ? void 0 : _a.filter(agent_inputs_1.isValidInput).map((i) => { var _a, _b; return [((_a = i.label) === null || _a === void 0 ? void 0 : _a.trim()) || i.key, (_b = message.inputs) === null || _b === void 0 ? void 0 : _b[i.key]]; }).filter((i) => i[1]).map(([k, v]) => `${k}: ${v}`).join('\n')) || '';
81
- }, [agent.parameters, message.inputs]);
82
- const items = (_b = sharing === null || sharing === void 0 ? void 0 : sharing.items) === null || _b === void 0 ? void 0 : _b.map((item) => {
83
- var _a, _b;
84
- const C = ShareActionsMap[item.to];
85
- if (!C)
86
- return null;
87
- return ((0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(C, { inputs: inputs, shareAttach: {
88
- shareAttachInputs: (_a = sharing === null || sharing === void 0 ? void 0 : sharing.shareAttachInputs) !== null && _a !== void 0 ? _a : false,
89
- shareAttachUrl: (_b = sharing === null || sharing === void 0 ? void 0 : sharing.shareAttachUrl) !== null && _b !== void 0 ? _b : false,
90
- } }) }, item.to));
91
- }).filter((i) => !!i);
92
- if (!(items === null || items === void 0 ? void 0 : items.length))
93
- return null;
94
- return (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({}, props, { children: items }));
95
- }
96
- const ShareActionsMap = {
97
- twitter: ShareTwitter,
98
- copy: ShareCopy,
99
- saveAs: ShareSave,
100
- community: ShareCommunity,
101
- link: ShareLink,
102
- };
103
- function ShareTwitter({ inputs, shareAttach, }) {
104
- const { t } = (0, locale_1.useLocaleContext)();
105
- const { message } = (0, CurrentMessage_1.useCurrentMessage)();
106
- const { link } = useCurrentLink();
107
- const query = (0, react_2.useMemo)(() => {
108
- var _a, _b, _c, _d, _e, _f, _g, _h;
109
- const content = ((_c = (_b = (_a = message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((i) => i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.text])) === null || _c === void 0 ? void 0 : _c[types_1.RuntimeOutputVariable.text]) ||
110
- ((_h = (_g = (_f = (_e = (_d = message.outputs) === null || _d === void 0 ? void 0 : _d.objects) === null || _e === void 0 ? void 0 : _e.find((i) => { var _a; return (_a = i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.images]) === null || _a === void 0 ? void 0 : _a.length; })) === null || _f === void 0 ? void 0 : _f[types_1.RuntimeOutputVariable.images]) === null || _g === void 0 ? void 0 : _g.at(0)) === null || _h === void 0 ? void 0 : _h.url);
111
- if (!content)
112
- return null;
113
- const texts = [];
114
- if (shareAttach.shareAttachInputs) {
115
- texts.push(inputs);
116
- }
117
- texts.push(content);
118
- let text = texts.join('\n\n');
119
- // 如果 content 长度超过 100,截断
120
- if (text.length > 250) {
121
- text = `${text.slice(0, 250)}...`;
122
- }
123
- return {
124
- text,
125
- url: link,
126
- };
127
- }, [message.outputs]);
128
- if (!query)
129
- return null;
130
- return ((0, jsx_runtime_1.jsx)(StyledActionButton, { tip: t('socialShare.shareToX'), title: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:brand-x" }), target: "_blank", href: (0, ufo_1.withQuery)('https://twitter.com/intent/tweet', query) }));
131
- }
132
- function ShareLink() {
133
- const { t } = (0, locale_1.useLocaleContext)();
134
- const { link } = useCurrentLink();
135
- return ((0, jsx_runtime_1.jsx)(StyledActionButton, { autoReset: true, tip: t('socialShare.copyLink'), tipSucceed: t('copied'), title: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:link" }), titleSucceed: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:link-plus" }), onClick: () => __awaiter(this, void 0, void 0, function* () {
136
- if (link) {
137
- window.navigator.clipboard.writeText(link);
138
- }
139
- }) }));
140
- }
141
- function ShareCopy({ inputs, shareAttach, }) {
142
- var _a, _b, _c, _d, _e, _f, _g, _h;
143
- const { t } = (0, locale_1.useLocaleContext)();
144
- const { message } = (0, CurrentMessage_1.useCurrentMessage)();
145
- const { link } = useCurrentLink();
146
- const content = (_c = (_b = (_a = message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((i) => i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.text])) === null || _c === void 0 ? void 0 : _c[types_1.RuntimeOutputVariable.text];
147
- const image = (_h = (_g = (_f = (_e = (_d = message.outputs) === null || _d === void 0 ? void 0 : _d.objects) === null || _e === void 0 ? void 0 : _e.find((i) => { var _a; return (_a = i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.images]) === null || _a === void 0 ? void 0 : _a.length; })) === null || _f === void 0 ? void 0 : _f[types_1.RuntimeOutputVariable.images]) === null || _g === void 0 ? void 0 : _g.at(0)) === null || _h === void 0 ? void 0 : _h.url;
148
- if (!content && !image)
149
- return null;
150
- return ((0, jsx_runtime_1.jsx)(StyledActionButton, { autoReset: true, tip: t('copy'), tipSucceed: t('copied'), title: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:copy" }), titleSucceed: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:copy-check" }), onClick: () => __awaiter(this, void 0, void 0, function* () {
151
- if (content) {
152
- const texts = [];
153
- if (shareAttach.shareAttachUrl) {
154
- texts.push(link);
155
- }
156
- if (shareAttach.shareAttachInputs) {
157
- texts.push(inputs);
158
- }
159
- texts.push(content);
160
- window.navigator.clipboard.writeText(texts.filter(Boolean).join('\n\n'));
161
- }
162
- else if (image) {
163
- const imageBlob = yield (0, download_image_1.convertImageToBlob)(yield (0, download_image_1.downloadImage)({ url: image }));
164
- window.navigator.clipboard.write([new ClipboardItem({ 'image/png': imageBlob })]);
165
- }
166
- }) }));
167
- }
168
- function ShareSave({ inputs, shareAttach, }) {
169
- var _a, _b, _c, _d, _e, _f, _g, _h;
170
- const { t } = (0, locale_1.useLocaleContext)();
171
- const { message } = (0, CurrentMessage_1.useCurrentMessage)();
172
- const { aid, agent } = (0, runtime_1.useRuntimeState)();
173
- const profile = (0, use_appearances_1.useProfile)({ aid });
174
- const { link } = useCurrentLink();
175
- const content = (_c = (_b = (_a = message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((i) => i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.text])) === null || _c === void 0 ? void 0 : _c[types_1.RuntimeOutputVariable.text];
176
- const image = (_h = (_g = (_f = (_e = (_d = message.outputs) === null || _d === void 0 ? void 0 : _d.objects) === null || _e === void 0 ? void 0 : _e.find((i) => { var _a; return (_a = i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.images]) === null || _a === void 0 ? void 0 : _a.length; })) === null || _f === void 0 ? void 0 : _f[types_1.RuntimeOutputVariable.images]) === null || _g === void 0 ? void 0 : _g.at(0)) === null || _h === void 0 ? void 0 : _h.url;
177
- if (!content && !image)
178
- return null;
179
- return ((0, jsx_runtime_1.jsx)(StyledActionButton, { tip: t('save'), tipSucceed: t('saved'), title: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:file-download" }), titleSucceed: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:file-check" }), onClick: () => __awaiter(this, void 0, void 0, function* () {
180
- // @ts-ignore
181
- const { default: html2pdf } = yield Promise.resolve().then(() => __importStar(require('html2pdf.js')));
182
- if (content) {
183
- const element = document.createElement('div');
184
- if (shareAttach.shareAttachUrl) {
185
- element.innerHTML += `<p><a href="{${link}}">${link}</a></p>`;
186
- }
187
- if (shareAttach.shareAttachInputs) {
188
- element.innerHTML += `<p><blockquote>${isomorphic_dompurify_1.default.sanitize(inputs)}</blockquote></p>`;
189
- }
190
- element.innerHTML += `<p>${isomorphic_dompurify_1.default.sanitize(content)}</p>`;
191
- yield html2pdf()
192
- .set({
193
- margin: 1,
194
- filename: `${profile.name || agent.id} - ${message.id}.pdf`,
195
- image: { type: 'jpeg', quality: 0.98 },
196
- html2canvas: { scale: 2 },
197
- jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' },
198
- })
199
- .from(element)
200
- .save();
201
- }
202
- else if (image) {
203
- (0, file_saver_1.saveAs)(image, `${profile.name || agent.id}.png`);
204
- }
205
- }) }));
206
- }
207
- function ShareCommunity({ inputs, shareAttach, }) {
208
- const { t } = (0, locale_1.useLocaleContext)();
209
- const { message } = (0, CurrentMessage_1.useCurrentMessage)();
210
- const { link } = useCurrentLink();
211
- const query = (0, react_2.useMemo)(() => {
212
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
213
- const text = (_d = (_c = (_b = (_a = message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((i) => i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.text])) === null || _c === void 0 ? void 0 : _c[types_1.RuntimeOutputVariable.text]) !== null && _d !== void 0 ? _d : '';
214
- const images = (_j = (_h = (_g = (_f = (_e = message.outputs) === null || _e === void 0 ? void 0 : _e.objects) === null || _f === void 0 ? void 0 : _f.find) === null || _g === void 0 ? void 0 : _g.call(_f, (i) => { var _a; return (_a = i === null || i === void 0 ? void 0 : i[types_1.RuntimeOutputVariable.images]) === null || _a === void 0 ? void 0 : _a.length; })) === null || _h === void 0 ? void 0 : _h[types_1.RuntimeOutputVariable.images]) === null || _j === void 0 ? void 0 : _j.map((i) => i.url);
215
- let content = '';
216
- if (shareAttach.shareAttachUrl) {
217
- content += `[[]](${link})\n\n`;
218
- }
219
- if (shareAttach.shareAttachInputs) {
220
- content += `> ${inputs}\n\n`;
221
- }
222
- if (images) {
223
- content += images.map((image) => `![image](${image})`).join('\n');
224
- }
225
- content += text;
226
- return {
227
- boardId: 'aigne',
228
- format: 'markdown',
229
- title: `${((_k = message.inputs) === null || _k === void 0 ? void 0 : _k.question) || inputs}`,
230
- content,
231
- labels: 'demo',
232
- };
233
- }, [inputs, message.outputs, shareAttach]);
234
- return ((0, jsx_runtime_1.jsx)(StyledActionButton, { tip: t('socialShare.shareToCommunity'), title: (0, jsx_runtime_1.jsx)(Community_1.default, {}), target: "_blank", href: (0, ufo_1.withQuery)('https://community.arcblock.io/discussions/add?', query) }));
235
- }
236
- const StyledActionButton = (0, material_1.styled)(ActionButton_1.default)(({ theme }) => theme.unstable_sx({
237
- fontSize: 'inherit',
238
- p: 0.5,
239
- minWidth: '0 !important',
240
- minHeight: '0 !important',
241
- }));
242
- const useCurrentLink = () => {
243
- var _a, _b, _c;
244
- const { session } = (0, session_1.useSessionContext)();
245
- const { message } = (0, CurrentMessage_1.useCurrentMessage)();
246
- const prefix = (_b = (_a = window.blocklet) === null || _a === void 0 ? void 0 : _a.componentMountPoints.find((i) => i.did === constants_1.AI_RUNTIME_DID)) === null || _b === void 0 ? void 0 : _b.mountPoint;
247
- if (!prefix)
248
- throw new Error('No aigne runtime prefix found');
249
- const link = (0, ufo_1.withQuery)((0, ufo_1.joinURL)(window.origin, prefix, '/messages', message.id), {
250
- agentUrl: (0, ufo_1.withQuery)((0, ufo_1.getQuery)(window.location.href).agentUrl || window.location.href, {
251
- inviter: (_c = session.user) === null || _c === void 0 ? void 0 : _c.did,
252
- }),
253
- });
254
- return { link };
255
- };
@@ -1,108 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.default = SocialShare;
18
- exports.SocialShareMenu = SocialShareMenu;
19
- exports.SocialShareButtons = SocialShareButtons;
20
- const jsx_runtime_1 = require("react/jsx-runtime");
21
- const react_1 = require("@iconify/react");
22
- const material_1 = require("@mui/material");
23
- const react_2 = require("react");
24
- const react_share_1 = require("react-share");
25
- const locale_1 = require("../../../locale");
26
- const locales_1 = require("../locales");
27
- const MenuButton_1 = __importDefault(require("./MenuButton"));
28
- const getFormattedUrl = (url) => {
29
- // remove page & sessionId query params
30
- const urlObj = new URL(url);
31
- urlObj.searchParams.delete('page');
32
- urlObj.searchParams.delete('sessionId');
33
- return urlObj.toString();
34
- };
35
- function SocialShare(props) {
36
- const { type = 'menu' } = props, restProps = __rest(props, ["type"]);
37
- const { locale } = (0, locale_1.useLocaleContext)();
38
- const renderContent = (0, react_2.useCallback)(() => {
39
- // @ts-ignore
40
- if (type === 'buttons') {
41
- return (0, jsx_runtime_1.jsx)(SocialShareButtons, Object.assign({}, restProps));
42
- }
43
- // @ts-ignore
44
- return (0, jsx_runtime_1.jsx)(SocialShareMenu, Object.assign({}, restProps));
45
- }, [type, restProps]);
46
- return (
47
- // @ts-ignore
48
- (0, jsx_runtime_1.jsx)(locale_1.LocaleProvider, { translations: locales_1.translations, locale: locale, fallbackLocale: "en", children: renderContent() }));
49
- }
50
- function SocialShareMenu(_a) {
51
- var { url = getFormattedUrl(window.location.href), content, children = (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:share" }), MenuProps, disableCopyLink = false } = _a, restProps = __rest(_a, ["url", "content", "children", "MenuProps", "disableCopyLink"]);
52
- const theme = (0, material_1.useTheme)();
53
- const { t } = (0, locale_1.useLocaleContext)();
54
- const itemIconSx = {
55
- width: 22,
56
- height: 22,
57
- border: 1,
58
- borderColor: theme.palette.text.secondary,
59
- borderRadius: 0.75,
60
- display: 'flex',
61
- alignItems: 'center',
62
- justifyContent: 'center',
63
- };
64
- const buttonSx = {
65
- display: 'flex',
66
- alignItems: 'center',
67
- gap: 1.5,
68
- minWidth: 120,
69
- lineHeight: '1!important',
70
- width: '100%',
71
- border: 'none',
72
- bgcolor: 'transparent',
73
- };
74
- const iconProps = {
75
- bgStyle: { fill: '#fff' },
76
- iconFillColor: theme.palette.text.secondary,
77
- style: {
78
- borderRadius: '6px',
79
- },
80
- };
81
- return ((0, jsx_runtime_1.jsx)(MenuButton_1.default, Object.assign({ MenuProps: Object.assign(Object.assign({}, MenuProps), { sx: { li: { p: 0, button: { px: '8px !important', py: '4px !important' } } } }), menus: [
82
- (0, jsx_runtime_1.jsx)(material_1.MenuItem, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: react_share_1.TwitterShareButton, url: url, title: content, sx: buttonSx, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.XIcon, sx: itemIconSx, round: true }, iconProps)), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.shareToX') })] }) }, "shareOnX"),
83
- (0, jsx_runtime_1.jsx)(material_1.MenuItem, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: react_share_1.TelegramShareButton, url: url, title: content, sx: buttonSx, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.TelegramIcon, sx: itemIconSx, round: true }, iconProps)), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.shareToTelegram') })] }) }, "shareOnTelegram"),
84
- (0, jsx_runtime_1.jsx)(material_1.MenuItem, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: react_share_1.RedditShareButton, url: url, title: content, sx: buttonSx, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.RedditIcon, sx: itemIconSx, round: true }, iconProps)), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.shareToReddit') })] }) }, "shareOnReddit"),
85
- (0, jsx_runtime_1.jsx)(material_1.MenuItem, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: react_share_1.WeiboShareButton, url: url, title: content, sx: buttonSx, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.WeiboIcon, sx: itemIconSx, round: true }, iconProps)), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.shareToWeibo') })] }) }, "shareOnWeibo"),
86
- (0, jsx_runtime_1.jsx)(material_1.MenuItem, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: react_share_1.FacebookShareButton, url: url, sx: buttonSx, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.FacebookIcon, sx: itemIconSx, round: true }, iconProps)), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.shareToFacebook') })] }) }, "shareOnFacebook"),
87
- (0, jsx_runtime_1.jsx)(material_1.MenuItem, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: react_share_1.LinkedinShareButton, url: url, summary: content, sx: buttonSx, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.LinkedinIcon, sx: itemIconSx, round: true }, iconProps)), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.shareToLinkedin') })] }) }, "shareOnLinkedin"),
88
- !disableCopyLink && ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: buttonSx, onClick: () => {
89
- window.navigator.clipboard.writeText(url);
90
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: itemIconSx, round: true }, iconProps, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:link" }) })), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.copyLink') })] }) }, "copyToClipboard")),
91
- ].filter(Boolean) }, restProps, { children: children })));
92
- }
93
- function SocialShareButtons(_a) {
94
- var { url = getFormattedUrl(window.location.href), content, sx, itemSx, onClick, bgFill, iconFill } = _a, rest = __rest(_a, ["url", "content", "sx", "itemSx", "onClick", "bgFill", "iconFill"]);
95
- const mergedSx = [
96
- { display: 'flex', alignItems: 'center', gap: 0.5, lineHeight: 1 },
97
- ...(Array.isArray(sx) ? sx : [sx]),
98
- ];
99
- const mergedItemSx = [
100
- { width: { xs: 24, sm: 28 }, height: { xs: 24, sm: 28 }, borderRadius: 1 },
101
- ...(Array.isArray(itemSx) ? itemSx : [itemSx]),
102
- ];
103
- const iconProps = {
104
- bgStyle: { fill: bgFill || '#bbb' },
105
- iconFillColor: iconFill || '#fff',
106
- };
107
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: mergedSx }, rest, { children: [(0, jsx_runtime_1.jsx)(react_share_1.TwitterShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.XIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.TelegramShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.TelegramIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.RedditShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.RedditIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.WeiboShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.WeiboIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.FacebookShareButton, { url: url, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.FacebookIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.LinkedinShareButton, { url: url, summary: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.LinkedinIcon, sx: mergedItemSx }, iconProps)) })] })));
108
- }