@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.
- package/lib/cjs/builtin/async/ai-runtime.js +17 -0
- package/lib/cjs/builtin/{async/ai-runtime/components/AgentInputField/LanguageField.js → components/LanguageField/index.js} +3 -3
- package/lib/cjs/builtin/{components.js → components/index.js} +1 -1
- package/lib/cjs/components/CustomComponentRenderer/context.js +13 -0
- package/lib/cjs/components/CustomComponentRenderer/index.js +5 -1
- package/lib/cjs/components/CustomComponentRenderer/state.js +20 -6
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime.js +1 -0
- package/lib/esm/builtin/{async/ai-runtime/components/AgentInputField/LanguageField.js → components/LanguageField/index.js} +2 -2
- package/lib/esm/builtin/components/index.js +1 -0
- package/lib/esm/components/CustomComponentRenderer/context.js +9 -0
- package/lib/esm/components/CustomComponentRenderer/index.js +5 -1
- package/lib/esm/components/CustomComponentRenderer/state.js +21 -7
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/builtin/async/ai-runtime.d.ts +1 -0
- package/lib/types/builtin/components/index.d.ts +1 -0
- package/lib/types/components/CustomComponentRenderer/context.d.ts +14 -0
- package/lib/types/components/CustomComponentRenderer/index.d.ts +1 -0
- package/lib/types/components/CustomComponentRenderer/state.d.ts +5 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -5
- package/tsconfig.json +1 -1
- package/lib/cjs/builtin/async/ai-runtime/api/agent.js +0 -24
- package/lib/cjs/builtin/async/ai-runtime/api/asset.js +0 -25
- package/lib/cjs/builtin/async/ai-runtime/api/dataset.js +0 -134
- package/lib/cjs/builtin/async/ai-runtime/api/message.js +0 -46
- package/lib/cjs/builtin/async/ai-runtime/api/request.js +0 -74
- package/lib/cjs/builtin/async/ai-runtime/api/secret.js +0 -24
- package/lib/cjs/builtin/async/ai-runtime/api/session.js +0 -137
- package/lib/cjs/builtin/async/ai-runtime/components/ActionButton.js +0 -62
- package/lib/cjs/builtin/async/ai-runtime/components/AgentErrorBoundary.js +0 -34
- package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/BooleanField.js +0 -21
- package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/NumberField.js +0 -21
- package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/RadioField.js +0 -39
- package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/SelectField.js +0 -24
- package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/StringField.js +0 -35
- package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/index.js +0 -44
- package/lib/cjs/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +0 -80
- package/lib/cjs/builtin/async/ai-runtime/components/GlobalLoading/index.js +0 -27
- package/lib/cjs/builtin/async/ai-runtime/components/GlobalLoading/state.js +0 -39
- package/lib/cjs/builtin/async/ai-runtime/components/Header/SimpleHeader.js +0 -49
- package/lib/cjs/builtin/async/ai-runtime/components/Layout/SimpleLayout.js +0 -21
- package/lib/cjs/builtin/async/ai-runtime/components/LoadingButton.js +0 -40
- package/lib/cjs/builtin/async/ai-runtime/components/MarkdownRenderer/index.js +0 -146
- package/lib/cjs/builtin/async/ai-runtime/components/MenuButton.js +0 -55
- package/lib/cjs/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +0 -22
- package/lib/cjs/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +0 -49
- package/lib/cjs/builtin/async/ai-runtime/components/PopperMenuButton/index.js +0 -68
- package/lib/cjs/builtin/async/ai-runtime/components/RuntimeCommonProvider.js +0 -25
- package/lib/cjs/builtin/async/ai-runtime/components/ScrollView.js +0 -92
- package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/Community.js +0 -6
- package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +0 -255
- package/lib/cjs/builtin/async/ai-runtime/components/SocialShare.js +0 -108
- package/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +0 -191
- package/lib/cjs/builtin/async/ai-runtime/components/UserInfo.js +0 -55
- package/lib/cjs/builtin/async/ai-runtime/constants.js +0 -43
- package/lib/cjs/builtin/async/ai-runtime/contexts/ActiveAgent.js +0 -27
- package/lib/cjs/builtin/async/ai-runtime/contexts/ComponentPreferences.js +0 -31
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentAgent.js +0 -34
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentMessage.js +0 -18
- package/lib/cjs/builtin/async/ai-runtime/contexts/Identity.js +0 -36
- package/lib/cjs/builtin/async/ai-runtime/contexts/Runtime.js +0 -52
- package/lib/cjs/builtin/async/ai-runtime/error.js +0 -10
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-agent-admin.js +0 -13
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-appearances.js +0 -109
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +0 -50
- package/lib/cjs/builtin/async/ai-runtime/index.js +0 -83
- package/lib/cjs/builtin/async/ai-runtime/locales/index.js +0 -237
- package/lib/cjs/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +0 -116
- package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +0 -48
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +0 -138
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +0 -19
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +0 -186
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageMetadataRenderer.js +0 -24
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageSuggestedQuestions.js +0 -34
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/ReferenceLinks.js +0 -11
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/index.js +0 -24
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +0 -85
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +0 -64
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +0 -30
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +0 -13
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +0 -46
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +0 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +0 -65
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +0 -150
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +0 -26
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ShareView/index.js +0 -16
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +0 -38
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/DrawerOpenCloseIcon.js +0 -42
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +0 -94
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +0 -79
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +0 -34
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +0 -45
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +0 -28
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +0 -82
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +0 -69
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +0 -55
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +0 -54
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Input.js +0 -189
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Output.js +0 -252
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +0 -300
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +0 -158
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +0 -60
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +0 -153
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +0 -80
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.js +0 -25
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +0 -68
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +0 -56
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/index.js +0 -12
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/utils.js +0 -13
- package/lib/cjs/builtin/async/ai-runtime/state/agent.js +0 -58
- package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +0 -48
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +0 -415
- package/lib/cjs/builtin/async/ai-runtime/utils/agent-inputs.js +0 -14
- package/lib/cjs/builtin/async/ai-runtime/utils/download-image.js +0 -40
- package/lib/cjs/builtin/async/ai-runtime/utils/fonts.js +0 -35
- package/lib/cjs/builtin/async/ai-runtime/utils/map-right.js +0 -10
- package/lib/cjs/builtin/async/ai-runtime/utils/runtime-output-schema.js +0 -7
- package/lib/cjs/builtin/async/ai-runtime/utils/zustand.js +0 -9
- package/lib/esm/builtin/async/ai-runtime/api/agent.js +0 -21
- package/lib/esm/builtin/async/ai-runtime/api/asset.js +0 -22
- package/lib/esm/builtin/async/ai-runtime/api/dataset.js +0 -121
- package/lib/esm/builtin/async/ai-runtime/api/message.js +0 -42
- package/lib/esm/builtin/async/ai-runtime/api/request.js +0 -68
- package/lib/esm/builtin/async/ai-runtime/api/secret.js +0 -21
- package/lib/esm/builtin/async/ai-runtime/api/session.js +0 -128
- package/lib/esm/builtin/async/ai-runtime/components/ActionButton.js +0 -56
- package/lib/esm/builtin/async/ai-runtime/components/AgentErrorBoundary.js +0 -30
- package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/BooleanField.js +0 -19
- package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/NumberField.js +0 -19
- package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/RadioField.js +0 -37
- package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/SelectField.js +0 -22
- package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/StringField.js +0 -33
- package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/index.js +0 -38
- package/lib/esm/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +0 -76
- package/lib/esm/builtin/async/ai-runtime/components/GlobalLoading/index.js +0 -22
- package/lib/esm/builtin/async/ai-runtime/components/GlobalLoading/state.js +0 -36
- package/lib/esm/builtin/async/ai-runtime/components/Header/SimpleHeader.js +0 -23
- package/lib/esm/builtin/async/ai-runtime/components/Layout/SimpleLayout.js +0 -18
- package/lib/esm/builtin/async/ai-runtime/components/LoadingButton.js +0 -38
- package/lib/esm/builtin/async/ai-runtime/components/MarkdownRenderer/index.js +0 -118
- package/lib/esm/builtin/async/ai-runtime/components/MenuButton.js +0 -52
- package/lib/esm/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +0 -19
- package/lib/esm/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +0 -46
- package/lib/esm/builtin/async/ai-runtime/components/PopperMenuButton/index.js +0 -42
- package/lib/esm/builtin/async/ai-runtime/components/RuntimeCommonProvider.js +0 -18
- package/lib/esm/builtin/async/ai-runtime/components/ScrollView.js +0 -63
- package/lib/esm/builtin/async/ai-runtime/components/ShareActions/Community.js +0 -4
- package/lib/esm/builtin/async/ai-runtime/components/ShareActions/index.js +0 -226
- package/lib/esm/builtin/async/ai-runtime/components/SocialShare.js +0 -100
- package/lib/esm/builtin/async/ai-runtime/components/ThemeProvider.js +0 -185
- package/lib/esm/builtin/async/ai-runtime/components/UserInfo.js +0 -47
- package/lib/esm/builtin/async/ai-runtime/constants.js +0 -39
- package/lib/esm/builtin/async/ai-runtime/contexts/ActiveAgent.js +0 -23
- package/lib/esm/builtin/async/ai-runtime/contexts/ComponentPreferences.js +0 -24
- package/lib/esm/builtin/async/ai-runtime/contexts/CurrentAgent.js +0 -30
- package/lib/esm/builtin/async/ai-runtime/contexts/CurrentMessage.js +0 -14
- package/lib/esm/builtin/async/ai-runtime/contexts/Identity.js +0 -28
- package/lib/esm/builtin/async/ai-runtime/contexts/Runtime.js +0 -22
- package/lib/esm/builtin/async/ai-runtime/error.js +0 -6
- package/lib/esm/builtin/async/ai-runtime/hooks/use-agent-admin.js +0 -10
- package/lib/esm/builtin/async/ai-runtime/hooks/use-appearances.js +0 -103
- package/lib/esm/builtin/async/ai-runtime/hooks/use-header-menu.js +0 -44
- package/lib/esm/builtin/async/ai-runtime/index.js +0 -37
- package/lib/esm/builtin/async/ai-runtime/locales/index.js +0 -234
- package/lib/esm/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +0 -87
- package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +0 -19
- package/lib/esm/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +0 -132
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +0 -13
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +0 -157
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageMetadataRenderer.js +0 -18
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageSuggestedQuestions.js +0 -30
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/ReferenceLinks.js +0 -8
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/index.js +0 -18
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +0 -56
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +0 -58
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +0 -24
- package/lib/esm/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +0 -7
- package/lib/esm/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +0 -40
- package/lib/esm/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +0 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +0 -59
- package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +0 -144
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +0 -20
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ShareView/index.js +0 -10
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +0 -35
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/DrawerOpenCloseIcon.js +0 -39
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +0 -65
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +0 -50
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +0 -28
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +0 -40
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +0 -22
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +0 -53
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +0 -40
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +0 -49
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +0 -48
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Input.js +0 -183
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Output.js +0 -246
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +0 -294
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +0 -149
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +0 -55
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +0 -146
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +0 -75
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.js +0 -23
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +0 -42
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +0 -52
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/index.js +0 -3
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/utils.js +0 -9
- package/lib/esm/builtin/async/ai-runtime/state/agent.js +0 -55
- package/lib/esm/builtin/async/ai-runtime/state/runtime.js +0 -45
- package/lib/esm/builtin/async/ai-runtime/state/session.js +0 -408
- package/lib/esm/builtin/async/ai-runtime/utils/agent-inputs.js +0 -10
- package/lib/esm/builtin/async/ai-runtime/utils/download-image.js +0 -36
- package/lib/esm/builtin/async/ai-runtime/utils/fonts.js +0 -32
- package/lib/esm/builtin/async/ai-runtime/utils/map-right.js +0 -7
- package/lib/esm/builtin/async/ai-runtime/utils/runtime-output-schema.js +0 -4
- package/lib/esm/builtin/async/ai-runtime/utils/zustand.js +0 -6
- package/lib/esm/builtin/components.js +0 -1
- package/lib/types/builtin/async/ai-runtime/api/agent.d.ts +0 -51
- package/lib/types/builtin/async/ai-runtime/api/asset.d.ts +0 -16
- package/lib/types/builtin/async/ai-runtime/api/dataset.d.ts +0 -39
- package/lib/types/builtin/async/ai-runtime/api/message.d.ts +0 -35
- package/lib/types/builtin/async/ai-runtime/api/request.d.ts +0 -12
- package/lib/types/builtin/async/ai-runtime/api/secret.d.ts +0 -12
- package/lib/types/builtin/async/ai-runtime/api/session.d.ts +0 -61
- package/lib/types/builtin/async/ai-runtime/components/ActionButton.d.ts +0 -14
- package/lib/types/builtin/async/ai-runtime/components/AgentErrorBoundary.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/BooleanField.d.ts +0 -8
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/NumberField.d.ts +0 -8
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/RadioField.d.ts +0 -8
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/SelectField.d.ts +0 -8
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/StringField.d.ts +0 -8
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/index.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.d.ts +0 -10
- package/lib/types/builtin/async/ai-runtime/components/GlobalLoading/index.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/components/GlobalLoading/state.d.ts +0 -10
- package/lib/types/builtin/async/ai-runtime/components/Header/SimpleHeader.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/Layout/SimpleLayout.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/components/LoadingButton.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/components/MarkdownRenderer/index.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/components/MenuButton.d.ts +0 -10
- package/lib/types/builtin/async/ai-runtime/components/OutputFieldContainer/index.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/PopperMenuButton/index.d.ts +0 -6
- package/lib/types/builtin/async/ai-runtime/components/RuntimeCommonProvider.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/components/ScrollView.d.ts +0 -10
- package/lib/types/builtin/async/ai-runtime/components/ShareActions/Community.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/components/ShareActions/index.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/components/SocialShare.d.ts +0 -20
- package/lib/types/builtin/async/ai-runtime/components/ThemeProvider.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/components/UserInfo.d.ts +0 -18
- package/lib/types/builtin/async/ai-runtime/constants.d.ts +0 -21
- package/lib/types/builtin/async/ai-runtime/contexts/ActiveAgent.d.ts +0 -9
- package/lib/types/builtin/async/ai-runtime/contexts/ComponentPreferences.d.ts +0 -11
- package/lib/types/builtin/async/ai-runtime/contexts/CurrentAgent.d.ts +0 -16
- package/lib/types/builtin/async/ai-runtime/contexts/CurrentMessage.d.ts +0 -15
- package/lib/types/builtin/async/ai-runtime/contexts/Identity.d.ts +0 -16
- package/lib/types/builtin/async/ai-runtime/contexts/Runtime.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/error.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/hooks/use-agent-admin.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/hooks/use-appearances.d.ts +0 -78
- package/lib/types/builtin/async/ai-runtime/hooks/use-header-menu.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/index.d.ts +0 -36
- package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +0 -210
- package/lib/types/builtin/async/ai-runtime/runtime/ChatBotButton/index.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/runtime/Runtime/index.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/runtime-components/AutoForm/index.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.d.ts +0 -12
- package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageMetadataRenderer.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageSuggestedQuestions.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/ReferenceLinks.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/index.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/ImagesView/index.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/MarkdownView/index.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/ShareView/index.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/DrawerOpenCloseIcon.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.d.ts +0 -9
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/index.d.ts +0 -16
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimplePage/index.d.ts +0 -6
- package/lib/types/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Input.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Output.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Page.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.d.ts +0 -20
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/Loading.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.d.ts +0 -17
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/index.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/utils.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/state/agent.d.ts +0 -12
- package/lib/types/builtin/async/ai-runtime/state/runtime.d.ts +0 -14
- package/lib/types/builtin/async/ai-runtime/state/session.d.ts +0 -60
- package/lib/types/builtin/async/ai-runtime/utils/agent-inputs.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/utils/download-image.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/utils/fonts.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/utils/map-right.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/utils/runtime-output-schema.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/utils/zustand.d.ts +0 -2
- package/lib/types/builtin/components.d.ts +0 -1
- /package/lib/cjs/builtin/{async/ai-runtime/utils → components/LanguageField}/languages.js +0 -0
- /package/lib/esm/builtin/{async/ai-runtime/utils → components/LanguageField}/languages.js +0 -0
- /package/lib/types/builtin/{async/ai-runtime/components/AgentInputField/LanguageField.d.ts → components/LanguageField/index.d.ts} +0 -0
- /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) => ``).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
|
-
}
|