@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,158 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.CodeRenderByMessageMemo = exports.CodePreviewMemo = void 0;
|
|
27
|
-
exports.default = CodePreview;
|
|
28
|
-
exports.CodeRenderByMessage = CodeRenderByMessage;
|
|
29
|
-
exports.getCurrentCodeByTaskId = getCurrentCodeByTaskId;
|
|
30
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
-
const api_1 = require("@blocklet/ai-kit/api");
|
|
32
|
-
const react_1 = require("@iconify/react");
|
|
33
|
-
const material_1 = require("@mui/material");
|
|
34
|
-
const react_2 = require("react");
|
|
35
|
-
const CustomComponentRenderer_1 = __importDefault(require("../../../../../../components/CustomComponentRenderer"));
|
|
36
|
-
const locale_1 = require("../../../../../locale");
|
|
37
|
-
const AgentErrorBoundary_1 = require("../../../components/AgentErrorBoundary");
|
|
38
|
-
const LoadingButton_1 = __importDefault(require("../../../components/LoadingButton"));
|
|
39
|
-
const CurrentAgent_1 = require("../../../contexts/CurrentAgent");
|
|
40
|
-
const runtime_1 = require("../../../state/runtime");
|
|
41
|
-
const MessageErrorView_1 = __importDefault(require("../../ChatOutput/MessageErrorView"));
|
|
42
|
-
const V0Runtime_1 = require("../contexts/V0Runtime");
|
|
43
|
-
const Loading_1 = require("./Loading");
|
|
44
|
-
const TransparentTooltip_1 = __importDefault(require("./TransparentTooltip"));
|
|
45
|
-
const codeField = 'code';
|
|
46
|
-
function RetryComponent({ message, tip }) {
|
|
47
|
-
var _a;
|
|
48
|
-
const { t } = (0, locale_1.useLocaleContext)();
|
|
49
|
-
const { execute } = (0, runtime_1.useRuntimeState)();
|
|
50
|
-
const { aid } = (0, CurrentAgent_1.useCurrentAgent)();
|
|
51
|
-
const { setCurrentMessageTaskId } = (0, V0Runtime_1.useV0RuntimeContext)();
|
|
52
|
-
const [loading, setLoading] = (0, react_2.useState)(false);
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
54
|
-
width: '100%',
|
|
55
|
-
height: '100%',
|
|
56
|
-
display: 'flex',
|
|
57
|
-
flexDirection: 'column',
|
|
58
|
-
justifyContent: 'flex-start',
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
gap: 2,
|
|
61
|
-
p: 4,
|
|
62
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { component: react_1.Icon, icon: "unjs:automd", sx: {
|
|
63
|
-
mt: 6,
|
|
64
|
-
fontSize: 120,
|
|
65
|
-
} }), ((_a = message === null || message === void 0 ? void 0 : message.error) === null || _a === void 0 ? void 0 : _a.type) === api_1.SubscriptionErrorType.UNSUBSCRIBED ? ((0, jsx_runtime_1.jsx)(material_1.Box, { width: "100%", children: (0, jsx_runtime_1.jsx)(AgentErrorBoundary_1.AgentErrorView, { error: message.error }) })) : ((0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "h6", sx: {
|
|
66
|
-
display: 'flex',
|
|
67
|
-
alignItems: 'center',
|
|
68
|
-
}, children: [tip || t('v0.retryTip'), (0, jsx_runtime_1.jsx)(TransparentTooltip_1.default, { arrow: true, placement: "top", title: (0, jsx_runtime_1.jsx)(MessageErrorView_1.default, { error: (message === null || message === void 0 ? void 0 : message.error) || new Error('Code syntax errors'), sx: {
|
|
69
|
-
mr: 0,
|
|
70
|
-
} }), children: (0, jsx_runtime_1.jsx)(material_1.Box, { component: react_1.Icon, icon: "akar-icons:info", sx: {
|
|
71
|
-
ml: 1,
|
|
72
|
-
} }) })] })), (0, jsx_runtime_1.jsx)(LoadingButton_1.default, { variant: "contained", loading: loading, color: "primary", onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
setLoading(true);
|
|
74
|
-
try {
|
|
75
|
-
const { inputs } = message || {};
|
|
76
|
-
// remove $ starting parameters object
|
|
77
|
-
const canUseParameters = Object.fromEntries(Object.entries(inputs || {}).filter(([key]) => !key.startsWith('$')));
|
|
78
|
-
yield execute({
|
|
79
|
-
aid,
|
|
80
|
-
parameters: canUseParameters,
|
|
81
|
-
onResponseStart: () => {
|
|
82
|
-
setCurrentMessageTaskId(undefined);
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
console.error(error);
|
|
88
|
-
}
|
|
89
|
-
finally {
|
|
90
|
-
setLoading(false);
|
|
91
|
-
}
|
|
92
|
-
}), children: t('v0.retry') })] }));
|
|
93
|
-
}
|
|
94
|
-
function CodePreview(_a) {
|
|
95
|
-
var { componentId = 'mock-dev-component', code, propertiesValue, message } = _a, restProps = __rest(_a, ["componentId", "code", "propertiesValue", "message"]);
|
|
96
|
-
const { t, locale } = (0, locale_1.useLocaleContext)();
|
|
97
|
-
if (!code)
|
|
98
|
-
return null;
|
|
99
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ id: componentId, className: "code-preview-wrapper" }, restProps, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: componentId, locale: locale, props: propertiesValue || {},
|
|
100
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
101
|
-
fallbackRender: () => (0, jsx_runtime_1.jsx)(RetryComponent, { message: message, tip: t('v0.errorCodeTip') }), dev: {
|
|
102
|
-
components: {
|
|
103
|
-
[componentId]: {
|
|
104
|
-
data: {
|
|
105
|
-
id: componentId,
|
|
106
|
-
createdAt: '',
|
|
107
|
-
updatedAt: '',
|
|
108
|
-
renderer: {
|
|
109
|
-
type: 'react-component',
|
|
110
|
-
script: code,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
} }) }), componentId));
|
|
116
|
-
}
|
|
117
|
-
exports.CodePreviewMemo = (0, react_2.memo)(CodePreview);
|
|
118
|
-
function CodeRenderByMessage({ zoom, message, minHeight = 200, sx, propertiesValueMap, }) {
|
|
119
|
-
var _a;
|
|
120
|
-
const { locale } = (0, locale_1.useLocaleContext)();
|
|
121
|
-
const zoomSx = {
|
|
122
|
-
'& > *': {
|
|
123
|
-
zoom,
|
|
124
|
-
minHeight,
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
const isMessageLoading = ((message === null || message === void 0 ? void 0 : message.loading) || !(message === null || message === void 0 ? void 0 : message.outputs)) && !(message === null || message === void 0 ? void 0 : message.error);
|
|
128
|
-
const ContentRender = (0, react_2.useCallback)(() => {
|
|
129
|
-
var _a, _b, _c, _d;
|
|
130
|
-
if (isMessageLoading) {
|
|
131
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { className: "code-message-loading", sx: {
|
|
132
|
-
py: 8,
|
|
133
|
-
display: 'flex',
|
|
134
|
-
justifyContent: 'center',
|
|
135
|
-
alignItems: 'center',
|
|
136
|
-
}, children: (0, jsx_runtime_1.jsx)(Loading_1.AIRunningLoading, {}) }));
|
|
137
|
-
}
|
|
138
|
-
if ((message === null || message === void 0 ? void 0 : message.error) || !((_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
139
|
-
return (0, jsx_runtime_1.jsx)(RetryComponent, { message: message });
|
|
140
|
-
}
|
|
141
|
-
return (_d = (_c = message === null || message === void 0 ? void 0 : message.outputs) === null || _c === void 0 ? void 0 : _c.objects) === null || _d === void 0 ? void 0 : _d.map((item) => {
|
|
142
|
-
var _a, _b;
|
|
143
|
-
const { taskId } = item;
|
|
144
|
-
// @ts-ignore
|
|
145
|
-
const code = item === null || item === void 0 ? void 0 : item[codeField];
|
|
146
|
-
return ((0, jsx_runtime_1.jsx)(exports.CodePreviewMemo, { componentId: `code-preview-${taskId}`, code: code, propertiesValue: ((_a = propertiesValueMap === null || propertiesValueMap === void 0 ? void 0 : propertiesValueMap[taskId]) === null || _a === void 0 ? void 0 : _a[locale]) || ((_b = propertiesValueMap === null || propertiesValueMap === void 0 ? void 0 : propertiesValueMap[taskId]) === null || _b === void 0 ? void 0 : _b.en) || {}, message: message }, item.taskId));
|
|
147
|
-
});
|
|
148
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
149
|
-
}, [isMessageLoading, (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects, propertiesValueMap, locale]);
|
|
150
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: Object.assign(Object.assign(Object.assign({ transition: 'all 0.3s', overflow: 'hidden', borderRadius: 1, width: '100%', height: '100%', backgroundColor: 'white' }, zoomSx), sx), { '.code-preview-wrapper': {
|
|
151
|
-
// p: 2,
|
|
152
|
-
} }), children: (0, jsx_runtime_1.jsx)(ContentRender, {}) }, message === null || message === void 0 ? void 0 : message.id));
|
|
153
|
-
}
|
|
154
|
-
exports.CodeRenderByMessageMemo = (0, react_2.memo)(CodeRenderByMessage);
|
|
155
|
-
function getCurrentCodeByTaskId(message) {
|
|
156
|
-
var _a, _b, _c;
|
|
157
|
-
return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : 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[codeField])) === null || _c === void 0 ? void 0 : _c[codeField];
|
|
158
|
-
}
|
|
@@ -1,60 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
const react_1 = require("@iconify/react");
|
|
17
|
-
const material_1 = require("@mui/material");
|
|
18
|
-
const react_2 = require("react");
|
|
19
|
-
const locale_1 = require("../../../../../locale");
|
|
20
|
-
const LoadingButton_1 = __importDefault(require("../../../components/LoadingButton"));
|
|
21
|
-
const ConfirmDialog = (0, react_2.forwardRef)((props, ref) => {
|
|
22
|
-
const [openDialog, setOpenDialog] = (0, react_2.useState)(false);
|
|
23
|
-
const [openParams, setOpenParams] = (0, react_2.useState)({});
|
|
24
|
-
const { t } = (0, locale_1.useLocaleContext)();
|
|
25
|
-
const open = (params) => {
|
|
26
|
-
setOpenParams(params);
|
|
27
|
-
setOpenDialog(true);
|
|
28
|
-
};
|
|
29
|
-
const close = () => {
|
|
30
|
-
setOpenDialog(false);
|
|
31
|
-
};
|
|
32
|
-
(0, react_2.useImperativeHandle)(ref, () => ({
|
|
33
|
-
open,
|
|
34
|
-
close,
|
|
35
|
-
}));
|
|
36
|
-
const { title, children, onConfirm, onCancel, onConfirmProps, onCancelProps } = openParams;
|
|
37
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, Object.assign({ disableScrollLock: true, onClose: close, fullWidth: true, maxWidth: "sm" }, props, { open: openDialog, children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { sx: {
|
|
38
|
-
display: 'flex',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
justifyContent: 'space-between',
|
|
41
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h5", sx: { fontSize: 24, fontWeight: 700 }, children: title }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: close,
|
|
42
|
-
// variant="text"
|
|
43
|
-
color: "inherit", disableElevation: true, sx: {
|
|
44
|
-
minWidth: 32,
|
|
45
|
-
minHeight: 32,
|
|
46
|
-
p: 0,
|
|
47
|
-
fontSize: 22,
|
|
48
|
-
}, children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:x" }) })] }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: children }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { sx: {
|
|
49
|
-
px: 3,
|
|
50
|
-
pt: 0,
|
|
51
|
-
pb: 2,
|
|
52
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: "inherit" }, onCancelProps, { onClick: () => {
|
|
53
|
-
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
54
|
-
setOpenDialog(false);
|
|
55
|
-
}, children: (onCancelProps === null || onCancelProps === void 0 ? void 0 : onCancelProps.children) || t('cancel') })), (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ variant: "contained" }, onConfirmProps, { onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
-
yield (onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm());
|
|
57
|
-
setOpenDialog(false);
|
|
58
|
-
}), children: (onConfirmProps === null || onConfirmProps === void 0 ? void 0 : onConfirmProps.children) || t('submit') }))] })] })));
|
|
59
|
-
});
|
|
60
|
-
exports.default = ConfirmDialog;
|
|
@@ -1,153 +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 = Loading;
|
|
18
|
-
exports.AIRunningLoading = AIRunningLoading;
|
|
19
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
|
-
const Spinner_1 = __importDefault(require("@arcblock/ux/lib/Spinner"));
|
|
21
|
-
const material_1 = require("@mui/material");
|
|
22
|
-
function Loading(props) {
|
|
23
|
-
const { sx } = props, restProps = __rest(props, ["sx"]);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: Object.assign({ flex: 1, display: 'flex', justifyContent: 'center', alignItems: 'center', position: 'fixed', top: 0, left: 0, width: '100vw', height: '100vh', backgroundColor: 'rgba(255, 255, 255, 0.8)' }, sx) }, restProps, { children: (0, jsx_runtime_1.jsx)(Spinner_1.default, {}) })));
|
|
25
|
-
}
|
|
26
|
-
function AIRunningLoading(props) {
|
|
27
|
-
const { sx } = props, restProps = __rest(props, ["sx"]);
|
|
28
|
-
const animationTimeList = [
|
|
29
|
-
{
|
|
30
|
-
time: 2,
|
|
31
|
-
width: 60,
|
|
32
|
-
height: 60,
|
|
33
|
-
extraProps: {
|
|
34
|
-
variant: 'circular',
|
|
35
|
-
sx: {
|
|
36
|
-
backgroundColor: 'grey.200',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
time: 3,
|
|
42
|
-
width: 100,
|
|
43
|
-
height: 20,
|
|
44
|
-
extraProps: {
|
|
45
|
-
sx: {
|
|
46
|
-
backgroundColor: 'grey.100',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
time: 2,
|
|
52
|
-
width: 250,
|
|
53
|
-
height: 10,
|
|
54
|
-
extraProps: {
|
|
55
|
-
sx: {
|
|
56
|
-
backgroundColor: 'grey.200',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
time: 4,
|
|
62
|
-
width: 150,
|
|
63
|
-
height: 10,
|
|
64
|
-
extraProps: {
|
|
65
|
-
sx: {
|
|
66
|
-
backgroundColor: 'grey.200',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
time: 8,
|
|
72
|
-
width: '100%',
|
|
73
|
-
height: '100%',
|
|
74
|
-
Component: material_1.Box,
|
|
75
|
-
extraProps: {
|
|
76
|
-
children: [
|
|
77
|
-
(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", sx: {
|
|
78
|
-
width: 60,
|
|
79
|
-
height: 50,
|
|
80
|
-
borderRadius: 1,
|
|
81
|
-
backgroundColor: 'grey.200',
|
|
82
|
-
} }),
|
|
83
|
-
(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", sx: {
|
|
84
|
-
width: 90,
|
|
85
|
-
height: 50,
|
|
86
|
-
borderRadius: 1,
|
|
87
|
-
backgroundColor: 'grey.200',
|
|
88
|
-
} }),
|
|
89
|
-
(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", sx: {
|
|
90
|
-
width: 120,
|
|
91
|
-
height: 50,
|
|
92
|
-
borderRadius: 1,
|
|
93
|
-
backgroundColor: 'grey.200',
|
|
94
|
-
} }),
|
|
95
|
-
],
|
|
96
|
-
sx: {
|
|
97
|
-
px: 2,
|
|
98
|
-
py: 1,
|
|
99
|
-
display: 'flex',
|
|
100
|
-
gap: 1.5,
|
|
101
|
-
justifyContent: 'space-between',
|
|
102
|
-
overflow: 'hidden',
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
time: 60,
|
|
108
|
-
width: 290,
|
|
109
|
-
height: 150,
|
|
110
|
-
extraProps: {
|
|
111
|
-
sx: {
|
|
112
|
-
backgroundColor: 'grey.200',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
];
|
|
117
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: Object.assign({ flex: 1, display: 'inline-flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'white', flexDirection: 'column', gap: 1.5, width: '100%', overflow: 'hidden', '@keyframes loading': {
|
|
118
|
-
'0%': {
|
|
119
|
-
transform: 'translateY(-8px) scaleX(1.3)',
|
|
120
|
-
opacity: 0,
|
|
121
|
-
height: '100%',
|
|
122
|
-
},
|
|
123
|
-
'50%': {
|
|
124
|
-
transform: 'translateY(0px)',
|
|
125
|
-
opacity: 0.5,
|
|
126
|
-
zoom: 1,
|
|
127
|
-
height: '100%',
|
|
128
|
-
},
|
|
129
|
-
'100%': {
|
|
130
|
-
transform: 'translateY(4px)',
|
|
131
|
-
opacity: 1,
|
|
132
|
-
zoom: 1,
|
|
133
|
-
height: '100%',
|
|
134
|
-
},
|
|
135
|
-
} }, sx) }, restProps, { children: animationTimeList.map((item, index) => {
|
|
136
|
-
// 计算 index 之前的累计时间之和,作为动画延迟时间
|
|
137
|
-
const delay = animationTimeList.slice(0, index).reduce((prev, current) => prev + current.time, 0);
|
|
138
|
-
const { time, width, height, Component = material_1.Skeleton } = item, _a = item.extraProps, _b = _a === void 0 ? {} : _a, { sx } = _b, restSkeletonProps = __rest(_b, ["sx"]);
|
|
139
|
-
const isLast = index === animationTimeList.length - 1;
|
|
140
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
141
|
-
animation: `loading ${time}s 1 ${delay}s forwards`,
|
|
142
|
-
borderRadius: 1,
|
|
143
|
-
overflow: 'hidden',
|
|
144
|
-
opacity: 0,
|
|
145
|
-
transition: 'all 0.3s',
|
|
146
|
-
}, children: (0, jsx_runtime_1.jsx)(Component
|
|
147
|
-
// @ts-ignore
|
|
148
|
-
, Object.assign({
|
|
149
|
-
// @ts-ignore
|
|
150
|
-
variant: "rectangular", sx: Object.assign({ width,
|
|
151
|
-
height, animationIterationCount: isLast ? 'infinite' : 1, animationFillMode: isLast ? 'forwards' : 'none' }, sx) }, restSkeletonProps)) }, index));
|
|
152
|
-
}) })));
|
|
153
|
-
}
|
package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js
DELETED
|
@@ -1,80 +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
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const material_1 = require("@mui/material");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const locale_1 = require("../../../../../locale");
|
|
10
|
-
const ConfirmDialog_1 = __importDefault(require("./ConfirmDialog"));
|
|
11
|
-
const FieldComponentMap = {
|
|
12
|
-
number: {
|
|
13
|
-
Filed: material_1.TextField,
|
|
14
|
-
extraProps: {
|
|
15
|
-
type: 'number',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
boolean: {
|
|
19
|
-
Filed: material_1.Switch,
|
|
20
|
-
},
|
|
21
|
-
json: {
|
|
22
|
-
Filed: material_1.TextField,
|
|
23
|
-
extraProps: {
|
|
24
|
-
multiline: true,
|
|
25
|
-
minRows: 3,
|
|
26
|
-
maxRows: 5,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
url: {
|
|
30
|
-
Filed: material_1.TextField,
|
|
31
|
-
},
|
|
32
|
-
string: {
|
|
33
|
-
Filed: material_1.TextField,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
const PropertiesSetting = (0, react_1.forwardRef)((props, ref) => {
|
|
37
|
-
const { t, locale } = (0, locale_1.useLocaleContext)();
|
|
38
|
-
const ConfirmDialogRef = (0, react_1.useRef)();
|
|
39
|
-
const valuesRef = (0, react_1.useRef)({});
|
|
40
|
-
const openParamsRef = (0, react_1.useRef)({});
|
|
41
|
-
const open = (params) => {
|
|
42
|
-
var _a;
|
|
43
|
-
if (!(ConfirmDialogRef === null || ConfirmDialogRef === void 0 ? void 0 : ConfirmDialogRef.current))
|
|
44
|
-
return;
|
|
45
|
-
openParamsRef.current = params;
|
|
46
|
-
ConfirmDialogRef.current.open({
|
|
47
|
-
title: t('v0.propertiesSetting'),
|
|
48
|
-
children: ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "info", sx: { mb: 2 }, children: t('v0.propertiesSettingTip') }), (0, jsx_runtime_1.jsx)(material_1.Stack, { spacing: 2, children: (_a = params === null || params === void 0 ? void 0 : params.schema) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
49
|
-
var _a, _b;
|
|
50
|
-
const { id, key, type, locales } = item;
|
|
51
|
-
const { Filed, extraProps } = (FieldComponentMap[type] || FieldComponentMap.string);
|
|
52
|
-
const currentLocale = (locales === null || locales === void 0 ? void 0 : locales[locale]) || (locales === null || locales === void 0 ? void 0 : locales.en);
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle2", sx: {
|
|
54
|
-
mb: 0.5,
|
|
55
|
-
}, children: currentLocale === null || currentLocale === void 0 ? void 0 : currentLocale.name }), (0, jsx_runtime_1.jsx)(Filed, Object.assign({ fullWidth: true, variant: "outlined", defaultValue: ((_b = (_a = openParamsRef === null || openParamsRef === void 0 ? void 0 : openParamsRef.current) === null || _a === void 0 ? void 0 : _a.defaultValues) === null || _b === void 0 ? void 0 : _b[key]) || (currentLocale === null || currentLocale === void 0 ? void 0 : currentLocale.defaultValue), size: "small", onChange: (e) => {
|
|
56
|
-
// update value
|
|
57
|
-
valuesRef.current = Object.assign(Object.assign({}, valuesRef.current), { [key]: e.target.value });
|
|
58
|
-
} }, extraProps))] }, id));
|
|
59
|
-
}) })] })),
|
|
60
|
-
onConfirm: () => {
|
|
61
|
-
var _a;
|
|
62
|
-
(_a = params === null || params === void 0 ? void 0 : params.onSubmit) === null || _a === void 0 ? void 0 : _a.call(params, getValues());
|
|
63
|
-
},
|
|
64
|
-
onCancel: () => { },
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const getValues = () => {
|
|
68
|
-
var _a;
|
|
69
|
-
return Object.assign(Object.assign({}, (_a = openParamsRef === null || openParamsRef === void 0 ? void 0 : openParamsRef.current) === null || _a === void 0 ? void 0 : _a.defaultValues), valuesRef.current);
|
|
70
|
-
};
|
|
71
|
-
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
72
|
-
open,
|
|
73
|
-
getValues,
|
|
74
|
-
}));
|
|
75
|
-
(0, react_1.useEffect)(() => {
|
|
76
|
-
valuesRef.current = {};
|
|
77
|
-
}, [locale]);
|
|
78
|
-
return (0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, Object.assign({ ref: ConfirmDialogRef }, props));
|
|
79
|
-
});
|
|
80
|
-
exports.default = PropertiesSetting;
|
package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.js
DELETED
|
@@ -1,25 +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
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
const material_1 = require("@mui/material");
|
|
16
|
-
const TransparentTooltip = (0, material_1.styled)((_a) => {
|
|
17
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({}, props, { classes: { popper: className } })));
|
|
19
|
-
})(() => ({
|
|
20
|
-
[`& .${material_1.tooltipClasses.tooltip}`]: {
|
|
21
|
-
backgroundColor: 'transparent',
|
|
22
|
-
boxShadow: 'none',
|
|
23
|
-
},
|
|
24
|
-
}));
|
|
25
|
-
exports.default = TransparentTooltip;
|
|
@@ -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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.default = UserQuestion;
|
|
27
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
-
const ClickToCopy_1 = __importStar(require("@arcblock/ux/lib/ClickToCopy"));
|
|
29
|
-
const material_1 = require("@mui/material");
|
|
30
|
-
const ux_1 = require("../../../../../arcblock/ux");
|
|
31
|
-
const locale_1 = require("../../../../../locale");
|
|
32
|
-
const session_1 = require("../../../../../session");
|
|
33
|
-
const utils_1 = require("../utils");
|
|
34
|
-
const BASE_QUESTION_SX = {
|
|
35
|
-
fontWeight: 500,
|
|
36
|
-
fontSize: 13,
|
|
37
|
-
};
|
|
38
|
-
function UserQuestion({ question }) {
|
|
39
|
-
var _a;
|
|
40
|
-
const { session: authSession } = (0, session_1.useSessionContext)();
|
|
41
|
-
const { user } = authSession;
|
|
42
|
-
const { locale } = (0, locale_1.useLocaleContext)();
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
44
|
-
display: 'flex',
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
gap: 1,
|
|
47
|
-
}, children: [((_a = authSession === null || authSession === void 0 ? void 0 : authSession.user) === null || _a === void 0 ? void 0 : _a.did) && ((0, jsx_runtime_1.jsx)(material_1.Box, { className: "user", sx: {
|
|
48
|
-
width: 30,
|
|
49
|
-
height: 30,
|
|
50
|
-
}, children: (0, jsx_runtime_1.jsx)(ux_1.Avatar, { size: 30, did: user === null || user === void 0 ? void 0 : user.did, variant: "circle", shape: "circle",
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
src: user === null || user === void 0 ? void 0 : user.avatar }) })), (0, jsx_runtime_1.jsx)(material_1.Box, { className: "question", sx: {
|
|
53
|
-
padding: '6px 12px',
|
|
54
|
-
borderRadius: 1,
|
|
55
|
-
// borderTopLeftRadius: 0,
|
|
56
|
-
backgroundColor: 'grey.200',
|
|
57
|
-
maxWidth: 300,
|
|
58
|
-
}, children: (0, jsx_runtime_1.jsx)(ClickToCopy_1.CopyButton, { locale: locale, unstyled: true, render: ({ copyButton, containerRef }) => {
|
|
59
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { ref: containerRef, display: "flex", alignItems: "center", sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'textColor' }), children: (0, jsx_runtime_1.jsx)(ClickToCopy_1.default, { locale: locale, unstyled: true, disableHoverListener: true, disableFocusListener: true, disableTouchListener: true, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { placement: "bottom", arrow: true, title: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
60
|
-
display: 'flex',
|
|
61
|
-
alignItems: 'center',
|
|
62
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'white' }), children: question }), (0, jsx_runtime_1.jsx)(material_1.Box, { id: "copy-button-wrapper", component: "span", sx: {
|
|
63
|
-
ml: 0.5,
|
|
64
|
-
mt: 0.25,
|
|
65
|
-
fontSize: 14,
|
|
66
|
-
}, children: copyButton })] }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: Object.assign(Object.assign(Object.assign({}, BASE_QUESTION_SX), { textAlign: 'left', alignItems: 'center' }), (0, utils_1.getLineClamp)(1)), children: question }) }) }) }));
|
|
67
|
-
} }) })] }));
|
|
68
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.V0RuntimeProvider = V0RuntimeProvider;
|
|
4
|
-
exports.useV0RuntimeContext = useV0RuntimeContext;
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const context = (0, react_1.createContext)(undefined);
|
|
9
|
-
let cancelAutoScrollTimer;
|
|
10
|
-
function V0RuntimeProvider({ children }) {
|
|
11
|
-
const [currentMessageTaskId, setCurrentMessageTaskId] = (0, react_1.useState)();
|
|
12
|
-
const [propertiesValueMap, setPropertiesValueMap] = (0, react_1.useState)({});
|
|
13
|
-
const isMobile = (0, material_1.useMediaQuery)((theme) => theme.breakpoints.down('sm'));
|
|
14
|
-
const state = (0, react_1.useMemo)(() => ({
|
|
15
|
-
setCurrentMessageTaskId: (taskId) => {
|
|
16
|
-
setCurrentMessageTaskId(taskId);
|
|
17
|
-
// auto scroll to the task
|
|
18
|
-
if (taskId) {
|
|
19
|
-
const scrollIntoView = () => {
|
|
20
|
-
const el = document.getElementById(taskId);
|
|
21
|
-
if (el) {
|
|
22
|
-
el.scrollIntoView({ behavior: 'smooth' });
|
|
23
|
-
// is first time to scroll
|
|
24
|
-
if (!currentMessageTaskId) {
|
|
25
|
-
const observer = new MutationObserver(() => {
|
|
26
|
-
if (cancelAutoScrollTimer)
|
|
27
|
-
clearTimeout(cancelAutoScrollTimer);
|
|
28
|
-
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth' });
|
|
29
|
-
cancelAutoScrollTimer = setTimeout(() => {
|
|
30
|
-
observer.disconnect();
|
|
31
|
-
cancelAutoScrollTimer = null;
|
|
32
|
-
}, 1000);
|
|
33
|
-
});
|
|
34
|
-
observer.observe(el.parentElement, { attributes: true, childList: true, subtree: true });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
setTimeout(scrollIntoView, 300);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
currentMessageTaskId,
|
|
42
|
-
propertiesValueMap,
|
|
43
|
-
setPropertiesValueMap: (valueMap) => {
|
|
44
|
-
setPropertiesValueMap(Object.assign(Object.assign({}, propertiesValueMap), valueMap));
|
|
45
|
-
},
|
|
46
|
-
isMobile,
|
|
47
|
-
}), [setCurrentMessageTaskId, currentMessageTaskId, propertiesValueMap, setPropertiesValueMap, isMobile]);
|
|
48
|
-
return (0, jsx_runtime_1.jsx)(context.Provider, { value: state, children: children });
|
|
49
|
-
}
|
|
50
|
-
function useV0RuntimeContext() {
|
|
51
|
-
const current = (0, react_1.useContext)(context);
|
|
52
|
-
if (!current) {
|
|
53
|
-
throw new Error('No such message state. You should use `V0RuntimeProvider` within the `CurrentMessageProvider`');
|
|
54
|
-
}
|
|
55
|
-
return current;
|
|
56
|
-
}
|
|
@@ -1,12 +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.V0Input = exports.V0Output = exports.V0Page = void 0;
|
|
7
|
-
var Page_1 = require("./Page");
|
|
8
|
-
Object.defineProperty(exports, "V0Page", { enumerable: true, get: function () { return __importDefault(Page_1).default; } });
|
|
9
|
-
var Output_1 = require("./Output");
|
|
10
|
-
Object.defineProperty(exports, "V0Output", { enumerable: true, get: function () { return __importDefault(Output_1).default; } });
|
|
11
|
-
var Input_1 = require("./Input");
|
|
12
|
-
Object.defineProperty(exports, "V0Input", { enumerable: true, get: function () { return __importDefault(Input_1).default; } });
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLineClamp = void 0;
|
|
4
|
-
const getLineClamp = (count) => {
|
|
5
|
-
return {
|
|
6
|
-
display: '-webkit-box',
|
|
7
|
-
WebkitLineClamp: count,
|
|
8
|
-
WebkitBoxOrient: 'vertical',
|
|
9
|
-
overflow: 'hidden',
|
|
10
|
-
textOverflow: 'ellipsis',
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
exports.getLineClamp = getLineClamp;
|