@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,38 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import BooleanField from './BooleanField';
|
|
14
|
-
import LanguageField from './LanguageField';
|
|
15
|
-
import NumberField from './NumberField';
|
|
16
|
-
import RadioField from './RadioField';
|
|
17
|
-
import SelectField from './SelectField';
|
|
18
|
-
import StringField from './StringField';
|
|
19
|
-
export default function AgentInputField(_a) {
|
|
20
|
-
var _b;
|
|
21
|
-
var { parameter } = _a, props = __rest(_a, ["parameter"]);
|
|
22
|
-
if (parameter.type === 'source')
|
|
23
|
-
return null;
|
|
24
|
-
if (parameter.key === 'datasetId') {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const FIELDS = {
|
|
28
|
-
number: NumberField,
|
|
29
|
-
string: StringField,
|
|
30
|
-
select: parameter.type === 'select' && ((_b = parameter.options) === null || _b === void 0 ? void 0 : _b.length) && parameter.options.length <= 8
|
|
31
|
-
? RadioField
|
|
32
|
-
: SelectField,
|
|
33
|
-
language: LanguageField,
|
|
34
|
-
boolean: BooleanField,
|
|
35
|
-
};
|
|
36
|
-
const Field = FIELDS[parameter.type || 'string'] || StringField;
|
|
37
|
-
return (_jsx(Field, Object.assign({ label: parameter === null || parameter === void 0 ? void 0 : parameter.label, helperText: parameter === null || parameter === void 0 ? void 0 : parameter.helper, placeholder: parameter === null || parameter === void 0 ? void 0 : parameter.placeholder }, { parameter }, { size: "small" }, props)));
|
|
38
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { LoadingButton } from '@mui/lab';
|
|
23
|
-
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Link, Stack, TextField, Typography, } from '@mui/material';
|
|
24
|
-
import { useForm } from 'react-hook-form';
|
|
25
|
-
import { create } from 'zustand';
|
|
26
|
-
import { immer } from 'zustand/middleware/immer';
|
|
27
|
-
import { Toast } from '../../../../arcblock/ux';
|
|
28
|
-
import { useLocaleContext } from '../../../../locale';
|
|
29
|
-
import { createSecrets } from '../../api/secret';
|
|
30
|
-
import { useAgentState } from '../../state/agent';
|
|
31
|
-
import { useRuntimeState } from '../../state/runtime';
|
|
32
|
-
export const settingsDialogState = create()(immer((set) => ({
|
|
33
|
-
isOpen: false,
|
|
34
|
-
open() {
|
|
35
|
-
set((state) => {
|
|
36
|
-
state.isOpen = true;
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
onClose() {
|
|
40
|
-
set((state) => {
|
|
41
|
-
state.isOpen = false;
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
})));
|
|
45
|
-
export default function AgentSettingsDialog(_a) {
|
|
46
|
-
var props = __rest(_a, []);
|
|
47
|
-
const { t } = useLocaleContext();
|
|
48
|
-
const isOpen = settingsDialogState((state) => state.isOpen);
|
|
49
|
-
const onClose = settingsDialogState((state) => state.onClose);
|
|
50
|
-
const { aid, blockletDid, working } = useRuntimeState();
|
|
51
|
-
const [agent, state] = useAgentState({ aid, blockletDid, working });
|
|
52
|
-
const form = useForm({
|
|
53
|
-
defaultValues: {
|
|
54
|
-
secrets: agent.config.secrets.map((i) => ({
|
|
55
|
-
projectId: agent.project.id,
|
|
56
|
-
targetProjectId: i.targetProjectId,
|
|
57
|
-
targetAgentId: i.targetAgentId,
|
|
58
|
-
targetInputKey: i.targetInput.key,
|
|
59
|
-
secret: '',
|
|
60
|
-
})),
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
const onSubmit = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
try {
|
|
65
|
-
yield createSecrets({ input });
|
|
66
|
-
yield state.load();
|
|
67
|
-
Toast.success(t('saved'));
|
|
68
|
-
onClose();
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
Toast.error(error.message);
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return (_jsxs(Dialog, Object.assign({ fullWidth: true, maxWidth: "md" }, props, { open: isOpen, onClose: onClose, component: "form", onSubmit: form.handleSubmit(onSubmit), children: [_jsx(DialogTitle, { children: t('settings') }), _jsx(DialogContent, { children: _jsx(Stack, { gap: 1, children: agent.config.secrets.map(({ targetInput, hasValue }, index) => (_jsxs(Stack, { gap: 0.5, children: [_jsxs(Typography, { variant: "caption", children: [targetInput.label || targetInput.key, ' ', targetInput.docLink && (_jsx(Link, { href: targetInput.docLink, target: "_blank", children: t('docLink') }))] }), _jsx(TextField, Object.assign({ autoFocus: index === 0, type: "password", fullWidth: true, hiddenLabel: true, size: "small", inputProps: { maxLength: 100 }, placeholder: hasValue ? '******' : targetInput.placeholder }, form.register(`secrets.${index}.secret`, { required: true })))] }, targetInput.id))) }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: onClose, children: t('cancel') }), _jsx(LoadingButton, { type: "submit", variant: "contained", loading: form.formState.isSubmitting, children: t('save') })] })] })));
|
|
76
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { LinearProgress } from '@mui/material';
|
|
14
|
-
import { globalLoadingState } from './state';
|
|
15
|
-
export { globalLoadingState } from './state';
|
|
16
|
-
export default function GlobalLoading(_a) {
|
|
17
|
-
var props = __rest(_a, []);
|
|
18
|
-
const state = globalLoadingState();
|
|
19
|
-
if (!state.loading)
|
|
20
|
-
return null;
|
|
21
|
-
return _jsx(LinearProgress, Object.assign({}, props));
|
|
22
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { create } from 'zustand';
|
|
11
|
-
import { immer } from 'zustand/middleware/immer';
|
|
12
|
-
export const globalLoadingState = create()(immer((set, get) => ({
|
|
13
|
-
loading: false,
|
|
14
|
-
count: 0,
|
|
15
|
-
run: (fn) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
try {
|
|
17
|
-
get().start();
|
|
18
|
-
return (yield (typeof fn === 'function' ? fn() : fn));
|
|
19
|
-
}
|
|
20
|
-
finally {
|
|
21
|
-
get().end();
|
|
22
|
-
}
|
|
23
|
-
}),
|
|
24
|
-
start: () => {
|
|
25
|
-
set((state) => {
|
|
26
|
-
state.count += 1;
|
|
27
|
-
state.loading = true;
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
end: () => {
|
|
31
|
-
set((state) => {
|
|
32
|
-
state.count = Math.max(0, state.count - 1);
|
|
33
|
-
state.loading = state.count > 0;
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
})));
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { cx } from '@emotion/css';
|
|
14
|
-
import { Stack, Typography } from '@mui/material';
|
|
15
|
-
import Balancer, { Provider } from 'react-wrap-balancer';
|
|
16
|
-
import { useProfile } from '../../hooks/use-appearances';
|
|
17
|
-
import { useRuntimeState } from '../../state/runtime';
|
|
18
|
-
export default function SimpleHeader(_a) {
|
|
19
|
-
var { TitleProps, DescriptionProps } = _a, props = __rest(_a, ["TitleProps", "DescriptionProps"]);
|
|
20
|
-
const { aid } = useRuntimeState();
|
|
21
|
-
const { name, description } = useProfile({ aid });
|
|
22
|
-
return (_jsx(Stack, Object.assign({ gap: 2, mt: 8, mb: 4 }, props, { className: cx('aigne-header aigne-simple-header', props.className), children: _jsxs(Provider, { children: [name && (_jsx(Typography, Object.assign({ width: "100%", variant: "h4", fontSize: 30, fontWeight: 700, textAlign: "center" }, TitleProps, { children: _jsx(Balancer, { children: name }) }))), description && (_jsx(Typography, Object.assign({ width: "100%", textAlign: "center" }, DescriptionProps, { children: _jsx(Balancer, { children: description }) })))] }) })));
|
|
23
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { cx } from '@emotion/css';
|
|
14
|
-
import { Stack } from '@mui/material';
|
|
15
|
-
export default function SimpleLayout(_a) {
|
|
16
|
-
var props = __rest(_a, []);
|
|
17
|
-
return (_jsx(Stack, Object.assign({ flexGrow: 1, maxWidth: "md", width: "100%", mx: "auto", px: { xs: 2, sm: 3 } }, props, { className: cx('aigne-layout aigne-layout-simple', props.className) })));
|
|
18
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
import { LoadingButton as MuiLoadingButton } from '@mui/lab';
|
|
23
|
-
import { forwardRef, useCallback, useState } from 'react';
|
|
24
|
-
const LoadingButton = forwardRef((_a, ref) => {
|
|
25
|
-
var { onClick } = _a, props = __rest(_a, ["onClick"]);
|
|
26
|
-
const [loading, setLoading] = useState(false);
|
|
27
|
-
const handleClick = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
try {
|
|
29
|
-
setLoading(true);
|
|
30
|
-
yield (onClick === null || onClick === void 0 ? void 0 : onClick(e));
|
|
31
|
-
}
|
|
32
|
-
finally {
|
|
33
|
-
setLoading(false);
|
|
34
|
-
}
|
|
35
|
-
}), [onClick]);
|
|
36
|
-
return _jsx(MuiLoadingButton, Object.assign({ ref: ref }, props, { loading: props.loading || loading, onClick: handleClick }));
|
|
37
|
-
});
|
|
38
|
-
export default LoadingButton;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { Icon } from '@iconify/react';
|
|
14
|
-
import { Box, Stack, styled } from '@mui/material';
|
|
15
|
-
import React, { Suspense } from 'react';
|
|
16
|
-
import Markdown from 'react-markdown';
|
|
17
|
-
import remarkGfm from 'remark-gfm';
|
|
18
|
-
import { useLocaleContext } from '../../../../locale';
|
|
19
|
-
import ReactSyntaxHighlighterAsync from '../../../react-syntax-highlighter';
|
|
20
|
-
import ActionButton from '../ActionButton';
|
|
21
|
-
const ReactSyntaxHighlighter = React.lazy(() => ReactSyntaxHighlighterAsync().then((m) => ({ default: m.Prism })));
|
|
22
|
-
const MarkdownRenderer = styled((props) => (_jsx(Markdown, Object.assign({}, props, { remarkPlugins: [remarkGfm], components: {
|
|
23
|
-
pre: MarkdownPre,
|
|
24
|
-
table: ({ className, children }) => {
|
|
25
|
-
return (_jsx(Box, { sx: { overflow: 'auto', my: 1 }, children: _jsx("table", { className: className, children: children }) }));
|
|
26
|
-
},
|
|
27
|
-
} })))) `
|
|
28
|
-
width: 100%;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
word-break: break-word;
|
|
31
|
-
|
|
32
|
-
> * {
|
|
33
|
-
&:first-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */ {
|
|
34
|
-
margin-top: 0;
|
|
35
|
-
}
|
|
36
|
-
&:last-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */ {
|
|
37
|
-
margin-bottom: 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
pre {
|
|
42
|
-
overflow: auto;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
li {
|
|
46
|
-
margin: 0;
|
|
47
|
-
padding: 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
li p {
|
|
51
|
-
display: inline-block;
|
|
52
|
-
vertical-align: top;
|
|
53
|
-
margin: 0;
|
|
54
|
-
padding: 0;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
table {
|
|
58
|
-
border-collapse: collapse;
|
|
59
|
-
white-space: nowrap;
|
|
60
|
-
|
|
61
|
-
th,
|
|
62
|
-
td {
|
|
63
|
-
border: 1px solid grey;
|
|
64
|
-
padding: 4px 8px;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
a {
|
|
69
|
-
color: ${({ theme }) => theme.palette.primary.main};
|
|
70
|
-
|
|
71
|
-
:hover {
|
|
72
|
-
text-decoration: underline;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&.writing:empty,
|
|
77
|
-
&.writing > *:last-child {
|
|
78
|
-
&:after {
|
|
79
|
-
content: '';
|
|
80
|
-
display: inline-block;
|
|
81
|
-
vertical-align: middle;
|
|
82
|
-
height: 1.2em;
|
|
83
|
-
margin-top: -0.2em;
|
|
84
|
-
margin-left: 0.1em;
|
|
85
|
-
border-right: 0.2em solid orange;
|
|
86
|
-
border-radius: 10px;
|
|
87
|
-
animation: blink-caret 0.75s step-end infinite;
|
|
88
|
-
|
|
89
|
-
@keyframes blink-caret {
|
|
90
|
-
from,
|
|
91
|
-
to {
|
|
92
|
-
border-color: transparent;
|
|
93
|
-
}
|
|
94
|
-
50% {
|
|
95
|
-
border-color: ${({ theme }) => theme.palette.secondary.main};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
`;
|
|
101
|
-
export default MarkdownRenderer;
|
|
102
|
-
function MarkdownPre(_a) {
|
|
103
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
104
|
-
const { t } = useLocaleContext();
|
|
105
|
-
const childrenProps = children === null || children === void 0 ? void 0 : children.props;
|
|
106
|
-
if (!(childrenProps === null || childrenProps === void 0 ? void 0 : childrenProps.children))
|
|
107
|
-
return null;
|
|
108
|
-
const match = /language-(\w+)/.exec(childrenProps.className || '');
|
|
109
|
-
const language = match === null || match === void 0 ? void 0 : match[1];
|
|
110
|
-
return (_jsxs(Box, { component: "div", sx: {
|
|
111
|
-
fontSize: 14,
|
|
112
|
-
borderRadius: 1,
|
|
113
|
-
bgcolor: 'rgb(245, 242, 240)',
|
|
114
|
-
'> pre': { mt: '0 !important' },
|
|
115
|
-
}, children: [_jsxs(Stack, { direction: "row", alignItems: "center", p: 0.5, pl: 1.5, borderBottom: 1, borderColor: "grey.200", children: [_jsx(Box, { children: language }), _jsx(Box, { flex: 1 }), _jsx(ActionButton, { autoReset: true, tip: t('copyToClipboard'), tipSucceed: t('copied'), title: _jsx(Icon, { icon: "tabler:copy" }), titleSucceed: _jsx(Icon, { icon: "tabler:copy-check" }), sx: { minWidth: 32, minHeight: 32, p: 0, fontSize: 18 }, onClick: () => {
|
|
116
|
-
window.navigator.clipboard.writeText(childrenProps.children);
|
|
117
|
-
} })] }), _jsx(Suspense, { children: _jsx(Box, Object.assign({ component: ReactSyntaxHighlighter, language: match === null || match === void 0 ? void 0 : match[1] }, props, { sx: { borderRadius: 1, bgcolor: 'red' }, children: String(childrenProps.children).replace(/\n$/, '') })) })] }));
|
|
118
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material';
|
|
14
|
-
import { Box, IconButton, Menu } from '@mui/material';
|
|
15
|
-
import { useState } from 'react';
|
|
16
|
-
export default function MenuButton(_a) {
|
|
17
|
-
var { sx, menus, children, MenuProps } = _a, restProps = __rest(_a, ["sx", "menus", "children", "MenuProps"]);
|
|
18
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
19
|
-
const open = Boolean(anchorEl);
|
|
20
|
-
const handleClick = (event) => {
|
|
21
|
-
setAnchorEl(event.currentTarget);
|
|
22
|
-
};
|
|
23
|
-
const handleClose = () => {
|
|
24
|
-
setAnchorEl(null);
|
|
25
|
-
};
|
|
26
|
-
return (_jsxs(Box, { sx: sx, children: [_jsx(IconButton, Object.assign({ onClick: handleClick }, restProps, { children: children || _jsx(MoreHorizIcon, {}) })), _jsx(Menu, Object.assign({ disableScrollLock: true, MenuListProps: {
|
|
27
|
-
sx: {
|
|
28
|
-
p: 0.5,
|
|
29
|
-
'.MuiMenuItem-root': {
|
|
30
|
-
minWidth: 120,
|
|
31
|
-
fontSize: 14,
|
|
32
|
-
lineHeight: 1.5,
|
|
33
|
-
fontWeight: 'medium',
|
|
34
|
-
borderRadius: 0.5,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
}, slotProps: {
|
|
38
|
-
paper: {
|
|
39
|
-
sx: {
|
|
40
|
-
border: 1,
|
|
41
|
-
borderColor: 'divider',
|
|
42
|
-
boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
}, anchorEl: anchorEl, anchorOrigin: {
|
|
46
|
-
vertical: 'bottom',
|
|
47
|
-
horizontal: 'right',
|
|
48
|
-
}, transformOrigin: {
|
|
49
|
-
vertical: 'top',
|
|
50
|
-
horizontal: 'right',
|
|
51
|
-
}, open: open, onClick: handleClose, onClose: handleClose }, MenuProps, { children: typeof menus === 'function' ? menus() : menus }))] }));
|
|
52
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { Icon } from '@iconify/react';
|
|
14
|
-
import { Box, Stack, Typography } from '@mui/material';
|
|
15
|
-
export default function OutputFieldContainer(_a) {
|
|
16
|
-
var _b;
|
|
17
|
-
var { output } = _a, props = __rest(_a, ["output"]);
|
|
18
|
-
return (_jsxs(Stack, Object.assign({ gap: 1 }, props, { children: [((_b = output.appearance) === null || _b === void 0 ? void 0 : _b.title) && (_jsxs(Typography, { component: "h6", noWrap: true, sx: { display: 'flex', alignItems: 'center', gap: 1, fontSize: 18, fontWeight: 500 }, children: [output.appearance.icon && _jsx(Box, { component: Icon, icon: output.appearance.icon }), _jsx(Box, { component: "span", sx: { flex: 1, textOverflow: 'hidden' }, children: output.appearance.title })] })), props.children] })));
|
|
19
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { CircularProgress, MenuItem, Stack } from '@mui/material';
|
|
23
|
-
import { useState } from 'react';
|
|
24
|
-
export default function LoadingMenuItem(_a) {
|
|
25
|
-
var { children, confirmation } = _a, props = __rest(_a, ["children", "confirmation"]);
|
|
26
|
-
const [clicked, setClicked] = useState(false);
|
|
27
|
-
const [loading, setLoading] = useState(false);
|
|
28
|
-
const handleClick = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a;
|
|
30
|
-
if (loading)
|
|
31
|
-
return;
|
|
32
|
-
if (!clicked && confirmation) {
|
|
33
|
-
setClicked(true);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
setLoading(true);
|
|
38
|
-
yield ((_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e));
|
|
39
|
-
}
|
|
40
|
-
finally {
|
|
41
|
-
setClicked(false);
|
|
42
|
-
setLoading(false);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return (_jsxs(MenuItem, Object.assign({}, props, { onClick: handleClick, sx: Object.assign(Object.assign({}, props.sx), { display: 'flex', alignItems: 'center' }), children: [(clicked && confirmation) || children, _jsx(Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end", sx: { width: 18 }, children: loading && _jsx(CircularProgress, { size: 14 }) })] })));
|
|
46
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { Box, Button, ClickAwayListener, Grow, List, Paper, Popper, listItemIconClasses, } from '@mui/material';
|
|
23
|
-
import { bindPopper, bindTrigger, usePopupState } from 'material-ui-popup-state/hooks';
|
|
24
|
-
import React, { isValidElement } from 'react';
|
|
25
|
-
export default function PopperMenuButton(_a) {
|
|
26
|
-
var { PopperProps, menus } = _a, props = __rest(_a, ["PopperProps", "menus"]);
|
|
27
|
-
const state = usePopupState({ variant: 'popper' });
|
|
28
|
-
return (_jsxs(_Fragment, { children: [_jsx(Box, Object.assign({ component: Button }, bindTrigger(state), props)), _jsx(Popper, Object.assign({ transition: true }, PopperProps, bindPopper(state), { children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: state.close, children: _jsx(Grow, Object.assign({}, TransitionProps, { children: _jsx(Paper, { children: _jsx(List, { dense: true, sx: {
|
|
29
|
-
[`.${listItemIconClasses.root}`]: {
|
|
30
|
-
minWidth: 24,
|
|
31
|
-
},
|
|
32
|
-
}, children: React.Children.map(menus, (menu) => !isValidElement(menu)
|
|
33
|
-
? menu
|
|
34
|
-
: React.cloneElement(menu, {
|
|
35
|
-
// Close popper after the menu item click handler has been resolved
|
|
36
|
-
onClick: (...args) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
var _a, _b;
|
|
38
|
-
yield ((_b = (_a = menu.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, ...args));
|
|
39
|
-
state.close();
|
|
40
|
-
}),
|
|
41
|
-
})) }) }) })) })) }))] }));
|
|
42
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
|
-
import { Result } from '../../../arcblock/ux';
|
|
5
|
-
import { LocaleProvider, useLocaleContext } from '../../../locale';
|
|
6
|
-
import { translations } from '../locales';
|
|
7
|
-
export default function RuntimeCommonProvider({ children }) {
|
|
8
|
-
return (_jsx(RuntimeLocaleProvider, { children: _jsx(ErrorBoundary, { FallbackComponent: ErrorRender, children: _jsx(React.Suspense, { children: children }) }) }));
|
|
9
|
-
}
|
|
10
|
-
function ErrorRender({ error }) {
|
|
11
|
-
return (_jsx(Result, { status: error.status || 'error', description: error.message, sx: { bgcolor: 'transparent', mt: '20%' } }));
|
|
12
|
-
}
|
|
13
|
-
export function RuntimeLocaleProvider({ children }) {
|
|
14
|
-
const { locale } = useLocaleContext();
|
|
15
|
-
return (
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
_jsx(LocaleProvider, { translations: translations, locale: locale, fallbackLocale: "en", children: children }));
|
|
18
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { Box } from '@mui/material';
|
|
14
|
-
import { useEffect, useMemo } from 'react';
|
|
15
|
-
import * as scrollToBottom from 'react-scroll-to-bottom';
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
import useInternalContext from 'react-scroll-to-bottom/lib/esm/hooks/internal/useInternalContext';
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
const Composer = scrollToBottom.Composer;
|
|
20
|
-
export default function ScrollView(_a) {
|
|
21
|
-
var { disabled, children, scroll, component, initialScrollBehavior } = _a, props = __rest(_a, ["disabled", "children", "scroll", "component", "initialScrollBehavior"]);
|
|
22
|
-
if (disabled) {
|
|
23
|
-
if (component) {
|
|
24
|
-
return (_jsx(Box, Object.assign({ component: component }, props, { children: children })));
|
|
25
|
-
}
|
|
26
|
-
return children;
|
|
27
|
-
}
|
|
28
|
-
return (_jsx(Composer, { initialScrollBehavior: initialScrollBehavior, children: _jsx(ScrollViewWithinWindow, Object.assign({ scroll: scroll, component: component }, props, { children: children })) }));
|
|
29
|
-
}
|
|
30
|
-
function ScrollViewWithinWindow(_a) {
|
|
31
|
-
var { children, scroll, component } = _a, props = __rest(_a, ["children", "scroll", "component"]);
|
|
32
|
-
const { setTarget } = useInternalContext();
|
|
33
|
-
const ele = useFakeScrollElementOfWindow();
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (scroll === 'window') {
|
|
36
|
-
setTarget(ele);
|
|
37
|
-
}
|
|
38
|
-
}, [scroll]);
|
|
39
|
-
if (!component)
|
|
40
|
-
return children;
|
|
41
|
-
return (_jsx(Box, Object.assign({ component: component }, props, { ref: !scroll ? setTarget : undefined, children: children })));
|
|
42
|
-
}
|
|
43
|
-
function useFakeScrollElementOfWindow() {
|
|
44
|
-
return useMemo(() => {
|
|
45
|
-
const e = document.scrollingElement;
|
|
46
|
-
return new Proxy(e, {
|
|
47
|
-
get: (_, p) => {
|
|
48
|
-
if (p === 'offsetHeight')
|
|
49
|
-
return window.innerHeight;
|
|
50
|
-
if (['addEventListener', 'removeEventListener'].includes(p))
|
|
51
|
-
return window[p].bind(window);
|
|
52
|
-
const v = e[p];
|
|
53
|
-
if (v instanceof Function)
|
|
54
|
-
return v.bind(e);
|
|
55
|
-
return v;
|
|
56
|
-
},
|
|
57
|
-
set: (_, p, v) => {
|
|
58
|
-
e[p] = v;
|
|
59
|
-
return true;
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
}, []);
|
|
63
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createSvgIcon } from '@mui/material';
|
|
3
|
-
const CommunityIcon = createSvgIcon(_jsxs("svg", { style: { width: '15px', height: '15px' }, viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_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" }), _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');
|
|
4
|
-
export default CommunityIcon;
|