@blocklet/pages-kit 0.2.353 → 0.2.355
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/api/call.js +1 -2
- package/lib/cjs/api/pages-kit.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/api/agent.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/api/dataset.js +11 -12
- package/lib/cjs/builtin/async/ai-runtime/api/message.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/api/request.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/api/secret.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/api/session.js +7 -8
- package/lib/cjs/builtin/async/ai-runtime/components/ActionButton.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/AgentErrorBoundary.js +6 -4
- package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/GlobalLoading/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/Header/SimpleHeader.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/Layout/SimpleLayout.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/MenuButton.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +3 -3
- package/lib/cjs/builtin/async/ai-runtime/components/PopperMenuButton/index.js +3 -3
- package/lib/cjs/builtin/async/ai-runtime/components/RuntimeCommonProvider.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/components/ScrollView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/SocialShare.js +3 -4
- package/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/UserInfo.js +3 -4
- package/lib/cjs/builtin/async/ai-runtime/constants.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/contexts/ActiveAgent.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/contexts/ComponentPreferences.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentAgent.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentMessage.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/contexts/Runtime.js +3 -4
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-agent-admin.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-appearances.js +4 -5
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageMetadataRenderer.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageSuggestedQuestions.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/ReferenceLinks.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ShareView/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Input.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Output.js +3 -3
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +4 -4
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/state/agent.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +21 -21
- package/lib/cjs/builtin/async/ai-runtime/utils/agent-inputs.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/utils/download-image.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/utils/map-right.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/utils/runtime-output-schema.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/utils/zustand.js +1 -2
- package/lib/cjs/builtin/call.js +1 -2
- package/lib/cjs/builtin/iconify/react.js +1 -2
- package/lib/cjs/builtin/page/header.js +2 -2
- package/lib/cjs/builtin/session.js +1 -2
- package/lib/cjs/builtin/utils.js +2 -2
- package/lib/cjs/components/CustomComponentRenderer/BlockletReactComponentRenderer.js +1 -1
- package/lib/cjs/components/CustomComponentRenderer/DevProvider.js +2 -3
- package/lib/cjs/components/CustomComponentRenderer/index.js +1 -1
- package/lib/cjs/components/CustomComponentRenderer/state.js +3 -3
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/preload.js +1 -2
- package/lib/cjs/utils/property.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/components/AgentErrorBoundary.js +4 -1
- package/lib/esm/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/components/PopperMenuButton/index.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Output.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/state/session.js +17 -17
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/builtin/async/ai-runtime/api/request.d.ts +1 -1
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/LanguageField.d.ts +2 -3
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/NumberField.d.ts +2 -3
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/RadioField.d.ts +2 -3
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/SelectField.d.ts +2 -3
- package/lib/types/builtin/async/ai-runtime/components/AgentInputField/StringField.d.ts +2 -3
- package/lib/types/builtin/async/ai-runtime/components/LoadingButton.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/hooks/use-appearances.d.ts +7 -7
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/state/runtime.d.ts +4 -4
- package/lib/types/builtin/async/react-scroll-to-bottom.d.ts +22 -23
- package/lib/types/builtin/async/react-syntax-highlighter.d.ts +0 -1
- package/lib/types/builtin/call.d.ts +0 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/typescript/builtin-module-transformer.d.ts +1 -1
- package/lib/types/utils/typescript/imports-removal-transformer.d.ts +1 -1
- package/package.json +6 -6
package/lib/cjs/api/call.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.preloadComponents =
|
|
12
|
+
exports.preloadComponents = preloadComponents;
|
|
13
13
|
const component_1 = require("@blocklet/sdk/lib/component");
|
|
14
14
|
function preloadComponents(input) {
|
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -21,4 +21,3 @@ function preloadComponents(input) {
|
|
|
21
21
|
}).then((res) => res.data);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
exports.preloadComponents = preloadComponents;
|
package/lib/cjs/api/pages-kit.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.preloadComponents =
|
|
15
|
+
exports.preloadComponents = preloadComponents;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
17
|
const ufo_1 = require("ufo");
|
|
18
18
|
const PAGES_KIT_DID = 'z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o';
|
|
@@ -23,4 +23,3 @@ function preloadComponents(input) {
|
|
|
23
23
|
return axios_1.default.post((0, ufo_1.joinURL)(prefix, '/api/components/preload'), input).then((res) => res.data);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
exports.preloadComponents = preloadComponents;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getAgent =
|
|
12
|
+
exports.getAgent = getAgent;
|
|
13
13
|
const ufo_1 = require("ufo");
|
|
14
14
|
const request_1 = require("./request");
|
|
15
15
|
function getAgent(_a) {
|
|
@@ -20,4 +20,3 @@ function getAgent(_a) {
|
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
exports.getAgent = getAgent;
|
|
@@ -9,7 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.getDataset = getDataset;
|
|
13
|
+
exports.getDatasets = getDatasets;
|
|
14
|
+
exports.createDataset = createDataset;
|
|
15
|
+
exports.updateDataset = updateDataset;
|
|
16
|
+
exports.deleteDataset = deleteDataset;
|
|
17
|
+
exports.deleteDocument = deleteDocument;
|
|
18
|
+
exports.getDocuments = getDocuments;
|
|
19
|
+
exports.getDocument = getDocument;
|
|
20
|
+
exports.createDocument = createDocument;
|
|
21
|
+
exports.createDocumentFile = createDocumentFile;
|
|
22
|
+
exports.updateDocument = updateDocument;
|
|
13
23
|
const ufo_1 = require("ufo");
|
|
14
24
|
const utils_1 = require("../../../utils");
|
|
15
25
|
const constants_1 = require("../constants");
|
|
@@ -23,14 +33,12 @@ function getDataset(_a) {
|
|
|
23
33
|
return result;
|
|
24
34
|
});
|
|
25
35
|
}
|
|
26
|
-
exports.getDataset = getDataset;
|
|
27
36
|
function getDatasets(_a) {
|
|
28
37
|
return __awaiter(this, arguments, void 0, function* ({ appId }) {
|
|
29
38
|
const url = (0, ufo_1.withQuery)((0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/datasets'), { appId });
|
|
30
39
|
return (0, request_1.request)({ url });
|
|
31
40
|
});
|
|
32
41
|
}
|
|
33
|
-
exports.getDatasets = getDatasets;
|
|
34
42
|
function createDataset(_a) {
|
|
35
43
|
return __awaiter(this, arguments, void 0, function* ({ appId, name, description, }) {
|
|
36
44
|
return (0, request_1.request)({
|
|
@@ -44,7 +52,6 @@ function createDataset(_a) {
|
|
|
44
52
|
});
|
|
45
53
|
});
|
|
46
54
|
}
|
|
47
|
-
exports.createDataset = createDataset;
|
|
48
55
|
function updateDataset(datasetId, input) {
|
|
49
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
57
|
return (0, request_1.request)({
|
|
@@ -54,14 +61,12 @@ function updateDataset(datasetId, input) {
|
|
|
54
61
|
});
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
|
-
exports.updateDataset = updateDataset;
|
|
58
64
|
function deleteDataset(datasetId) {
|
|
59
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
66
|
const url = (0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/datasets', datasetId);
|
|
61
67
|
return (0, request_1.request)({ method: 'DELETE', url });
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
|
-
exports.deleteDataset = deleteDataset;
|
|
65
70
|
function deleteDocument(datasetId, documentId) {
|
|
66
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
72
|
return (0, request_1.request)({
|
|
@@ -70,7 +75,6 @@ function deleteDocument(datasetId, documentId) {
|
|
|
70
75
|
});
|
|
71
76
|
});
|
|
72
77
|
}
|
|
73
|
-
exports.deleteDocument = deleteDocument;
|
|
74
78
|
function getDocuments(datasetId) {
|
|
75
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
80
|
return (0, request_1.request)({
|
|
@@ -78,7 +82,6 @@ function getDocuments(datasetId) {
|
|
|
78
82
|
});
|
|
79
83
|
});
|
|
80
84
|
}
|
|
81
|
-
exports.getDocuments = getDocuments;
|
|
82
85
|
function getDocument(datasetId, documentId) {
|
|
83
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
87
|
const result = yield (0, request_1.request)({
|
|
@@ -89,7 +92,6 @@ function getDocument(datasetId, documentId) {
|
|
|
89
92
|
return result;
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
|
-
exports.getDocument = getDocument;
|
|
93
95
|
function createDocument(datasetId, type, input) {
|
|
94
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
97
|
if (type === 'file')
|
|
@@ -101,7 +103,6 @@ function createDocument(datasetId, type, input) {
|
|
|
101
103
|
});
|
|
102
104
|
});
|
|
103
105
|
}
|
|
104
|
-
exports.createDocument = createDocument;
|
|
105
106
|
function createDocumentFile(datasetId, file) {
|
|
106
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
108
|
const form = new FormData();
|
|
@@ -114,7 +115,6 @@ function createDocumentFile(datasetId, file) {
|
|
|
114
115
|
}).then((res) => res.json());
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
|
-
exports.createDocumentFile = createDocumentFile;
|
|
118
118
|
function updateDocument(datasetId, documentId, type, input) {
|
|
119
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
120
|
return (0, request_1.request)({
|
|
@@ -124,4 +124,3 @@ function updateDocument(datasetId, documentId, type, input) {
|
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
exports.updateDocument = updateDocument;
|
|
@@ -20,7 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
23
|
+
exports.getMessages = getMessages;
|
|
24
|
+
exports.deleteMessages = deleteMessages;
|
|
24
25
|
const ufo_1 = require("ufo");
|
|
25
26
|
const request_1 = require("./request");
|
|
26
27
|
function getMessages(_a) {
|
|
@@ -32,7 +33,6 @@ function getMessages(_a) {
|
|
|
32
33
|
});
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
exports.getMessages = getMessages;
|
|
36
36
|
function deleteMessages(_a) {
|
|
37
37
|
return __awaiter(this, arguments, void 0, function* ({ sessionId }) {
|
|
38
38
|
yield (0, request_1.request)({
|
|
@@ -41,4 +41,3 @@ function deleteMessages(_a) {
|
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
exports.deleteMessages = deleteMessages;
|
|
@@ -20,7 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
23
|
+
exports.fetch = exports.getAIRuntimeApiPrefix = void 0;
|
|
24
|
+
exports.request = request;
|
|
24
25
|
const js_sdk_1 = require("@blocklet/js-sdk");
|
|
25
26
|
const ufo_1 = require("ufo");
|
|
26
27
|
const utils_1 = require("../../../utils");
|
|
@@ -58,4 +59,3 @@ function request(_a) {
|
|
|
58
59
|
return result.json();
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
exports.request = request;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createSecrets =
|
|
12
|
+
exports.createSecrets = createSecrets;
|
|
13
13
|
const ufo_1 = require("ufo");
|
|
14
14
|
const request_1 = require("./request");
|
|
15
15
|
function createSecrets(_a) {
|
|
@@ -21,4 +21,3 @@ function createSecrets(_a) {
|
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
exports.createSecrets = createSecrets;
|
|
@@ -22,7 +22,13 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
|
|
22
22
|
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
25
|
+
exports.getSessions = getSessions;
|
|
26
|
+
exports.getSession = getSession;
|
|
27
|
+
exports.createSession = createSession;
|
|
28
|
+
exports.clearSession = clearSession;
|
|
29
|
+
exports.updateSession = updateSession;
|
|
30
|
+
exports.deleteSession = deleteSession;
|
|
31
|
+
exports.runAgent = runAgent;
|
|
26
32
|
const ufo_1 = require("ufo");
|
|
27
33
|
const stream_1 = require("../../../stream");
|
|
28
34
|
const request_1 = require("./request");
|
|
@@ -34,7 +40,6 @@ function getSessions(_a) {
|
|
|
34
40
|
});
|
|
35
41
|
});
|
|
36
42
|
}
|
|
37
|
-
exports.getSessions = getSessions;
|
|
38
43
|
function getSession(_a) {
|
|
39
44
|
return __awaiter(this, arguments, void 0, function* ({ sessionId }) {
|
|
40
45
|
return (0, request_1.request)({
|
|
@@ -42,7 +47,6 @@ function getSession(_a) {
|
|
|
42
47
|
});
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
|
-
exports.getSession = getSession;
|
|
46
50
|
function createSession(_a) {
|
|
47
51
|
return __awaiter(this, arguments, void 0, function* ({ aid, name, }) {
|
|
48
52
|
return (0, request_1.request)({
|
|
@@ -55,7 +59,6 @@ function createSession(_a) {
|
|
|
55
59
|
});
|
|
56
60
|
});
|
|
57
61
|
}
|
|
58
|
-
exports.createSession = createSession;
|
|
59
62
|
function clearSession(_a) {
|
|
60
63
|
return __awaiter(this, arguments, void 0, function* ({ sessionId }) {
|
|
61
64
|
return (0, request_1.request)({
|
|
@@ -64,7 +67,6 @@ function clearSession(_a) {
|
|
|
64
67
|
});
|
|
65
68
|
});
|
|
66
69
|
}
|
|
67
|
-
exports.clearSession = clearSession;
|
|
68
70
|
function updateSession(_a) {
|
|
69
71
|
return __awaiter(this, arguments, void 0, function* ({ sessionId, name, }) {
|
|
70
72
|
return (0, request_1.request)({
|
|
@@ -74,7 +76,6 @@ function updateSession(_a) {
|
|
|
74
76
|
});
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
|
-
exports.updateSession = updateSession;
|
|
78
79
|
function deleteSession(_a) {
|
|
79
80
|
return __awaiter(this, arguments, void 0, function* ({ sessionId, }) {
|
|
80
81
|
return (0, request_1.request)({
|
|
@@ -83,7 +84,6 @@ function deleteSession(_a) {
|
|
|
83
84
|
});
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
exports.deleteSession = deleteSession;
|
|
87
87
|
function runAgent(_a) {
|
|
88
88
|
return __asyncGenerator(this, arguments, function* runAgent_1({ aid, sessionId, blockletDid, working, parameters, }) {
|
|
89
89
|
var _b;
|
|
@@ -128,4 +128,3 @@ function runAgent(_a) {
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
exports.runAgent = runAgent;
|
|
@@ -23,6 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.default = ActionButton;
|
|
26
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
28
|
const react_1 = require("@iconify/react");
|
|
28
29
|
const material_1 = require("@mui/material");
|
|
@@ -59,4 +60,3 @@ function ActionButton(_a) {
|
|
|
59
60
|
}
|
|
60
61
|
}), children: buttonText })) }) }));
|
|
61
62
|
}
|
|
62
|
-
exports.default = ActionButton;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.default = AgentErrorBoundary;
|
|
4
|
+
exports.AgentErrorView = AgentErrorView;
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const api_1 = require("@blocklet/ai-kit/api");
|
|
6
7
|
const components_1 = require("@blocklet/ai-kit/components");
|
|
@@ -13,7 +14,6 @@ const AgentSettingsDialog_1 = require("./AgentSettings/AgentSettingsDialog");
|
|
|
13
14
|
function AgentErrorBoundary() {
|
|
14
15
|
return (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: AgentErrorView });
|
|
15
16
|
}
|
|
16
|
-
exports.default = AgentErrorBoundary;
|
|
17
17
|
function AgentErrorView({ error }) {
|
|
18
18
|
if (error.type === 'MissingSecretError') {
|
|
19
19
|
return (0, jsx_runtime_1.jsx)(MissingSecretErrorView, {});
|
|
@@ -23,10 +23,12 @@ function AgentErrorView({ error }) {
|
|
|
23
23
|
}
|
|
24
24
|
return (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", children: String(error === null || error === void 0 ? void 0 : error.message) });
|
|
25
25
|
}
|
|
26
|
-
exports.AgentErrorView = AgentErrorView;
|
|
27
26
|
function MissingSecretErrorView() {
|
|
28
27
|
const { t } = (0, locale_1.useLocaleContext)();
|
|
29
28
|
const { agent } = (0, runtime_1.useRuntimeState)();
|
|
30
29
|
const isAdmin = (0, use_agent_admin_1.useIsAgentAdmin)(agent);
|
|
31
|
-
|
|
30
|
+
const allSecretsHasValue = agent.config.secrets.every((i) => i.hasValue);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: allSecretsHasValue ? 'info' : 'error', sx: { [`.${material_1.alertClasses.message}`]: { flex: 1 } }, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { width: "100%", children: [allSecretsHasValue
|
|
32
|
+
? 'Configuration successful, you can continue to use it now!'
|
|
33
|
+
: 'The required configuration is missing. Please complete the setup before proceeding!', isAdmin && ((0, jsx_runtime_1.jsx)(material_1.Stack, { alignItems: "flex-end", children: (0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", variant: "outlined", onClick: () => AgentSettingsDialog_1.settingsDialogState.getState().open(), children: t('setup') }) }))] }) }));
|
|
32
34
|
}
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.default = AgentInputField;
|
|
17
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
19
|
const LanguageField_1 = __importDefault(require("./LanguageField"));
|
|
19
20
|
const NumberField_1 = __importDefault(require("./NumberField"));
|
|
@@ -39,4 +40,3 @@ function AgentInputField(_a) {
|
|
|
39
40
|
const Field = FIELDS[parameter.type || 'string'] || StringField_1.default;
|
|
40
41
|
return ((0, jsx_runtime_1.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)));
|
|
41
42
|
}
|
|
42
|
-
exports.default = AgentInputField;
|
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.settingsDialogState = void 0;
|
|
24
|
+
exports.default = AgentSettingsDialog;
|
|
24
25
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
25
26
|
const lab_1 = require("@mui/lab");
|
|
26
27
|
const material_1 = require("@mui/material");
|
|
@@ -77,4 +78,3 @@ function AgentSettingsDialog(_a) {
|
|
|
77
78
|
});
|
|
78
79
|
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, Object.assign({ fullWidth: true, maxWidth: "md" }, props, { open: isOpen, onClose: onClose, component: "form", onSubmit: form.handleSubmit(onSubmit), children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('settings') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, { gap: 1, children: agent.config.secrets.map(({ targetInput, hasValue }, index) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, { gap: 0.5, children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, { children: targetInput.label || targetInput.key }), (0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({ type: "password", fullWidth: true, hiddenLabel: true, size: "small", inputProps: { maxLength: 100 }, placeholder: hasValue ? '******' : targetInput.placeholder }, form.register(`secrets.${index}.secret`, { required: true })))] }, targetInput.id))) }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: onClose, children: t('cancel') }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, { type: "submit", variant: "contained", loading: form.formState.isSubmitting, children: t('save') })] })] })));
|
|
79
80
|
}
|
|
80
|
-
exports.default = AgentSettingsDialog;
|
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.globalLoadingState = void 0;
|
|
15
|
+
exports.default = GlobalLoading;
|
|
15
16
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
17
|
const material_1 = require("@mui/material");
|
|
17
18
|
const state_1 = require("./state");
|
|
@@ -24,4 +25,3 @@ function GlobalLoading(_a) {
|
|
|
24
25
|
return null;
|
|
25
26
|
return (0, jsx_runtime_1.jsx)(material_1.LinearProgress, Object.assign({}, props));
|
|
26
27
|
}
|
|
27
|
-
exports.default = GlobalLoading;
|
|
@@ -34,6 +34,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
34
34
|
return t;
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.default = SimpleHeader;
|
|
37
38
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
39
|
const css_1 = require("@emotion/css");
|
|
39
40
|
const material_1 = require("@mui/material");
|
|
@@ -46,4 +47,3 @@ function SimpleHeader(_a) {
|
|
|
46
47
|
const { description } = agent.project;
|
|
47
48
|
return ((0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ gap: 2, mt: 8, mb: 4 }, props, { className: (0, css_1.cx)('aigne-header aigne-simple-header', props.className), children: (0, jsx_runtime_1.jsxs)(react_wrap_balancer_1.Provider, { children: [title && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ width: "100%", variant: "h4", fontSize: 30, fontWeight: 700, textAlign: "center" }, TitleProps, { children: (0, jsx_runtime_1.jsx)(react_wrap_balancer_1.default, { children: title }) }))), description && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ width: "100%", textAlign: "center" }, DescriptionProps, { children: (0, jsx_runtime_1.jsx)(react_wrap_balancer_1.default, { children: description }) })))] }) })));
|
|
48
49
|
}
|
|
49
|
-
exports.default = SimpleHeader;
|
|
@@ -11,6 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.default = SimpleLayout;
|
|
14
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
16
|
const css_1 = require("@emotion/css");
|
|
16
17
|
const material_1 = require("@mui/material");
|
|
@@ -18,4 +19,3 @@ function SimpleLayout(_a) {
|
|
|
18
19
|
var props = __rest(_a, []);
|
|
19
20
|
return ((0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ flexGrow: 1, maxWidth: "md", width: "100%", mx: "auto", px: { xs: 2, sm: 3 } }, props, { className: (0, css_1.cx)('aigne-layout aigne-layout-simple', props.className) })));
|
|
20
21
|
}
|
|
21
|
-
exports.default = SimpleLayout;
|
|
@@ -11,6 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.default = MenuButton;
|
|
14
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
16
|
const icons_material_1 = require("@mui/icons-material");
|
|
16
17
|
const material_1 = require("@mui/material");
|
|
@@ -52,4 +53,3 @@ function MenuButton(_a) {
|
|
|
52
53
|
horizontal: 'right',
|
|
53
54
|
}, open: open, onClick: handleClose, onClose: handleClose }, MenuProps, { children: typeof menus === 'function' ? menus() : menus }))] }));
|
|
54
55
|
}
|
|
55
|
-
exports.default = MenuButton;
|
|
@@ -11,6 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.default = OutputFieldContainer;
|
|
14
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
16
|
const react_1 = require("@iconify/react");
|
|
16
17
|
const material_1 = require("@mui/material");
|
|
@@ -19,4 +20,3 @@ function OutputFieldContainer(_a) {
|
|
|
19
20
|
var { output } = _a, props = __rest(_a, ["output"]);
|
|
20
21
|
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ gap: 1 }, props, { children: [((_b = output.appearance) === null || _b === void 0 ? void 0 : _b.title) && ((0, jsx_runtime_1.jsxs)(material_1.Typography, { component: "h6", noWrap: true, sx: { display: 'flex', alignItems: 'center', gap: 1, fontSize: 18, fontWeight: 500 }, children: [output.appearance.icon && (0, jsx_runtime_1.jsx)(material_1.Box, { component: react_1.Icon, icon: output.appearance.icon }), (0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: { flex: 1, textOverflow: 'hidden' }, children: output.appearance.title })] })), props.children] })));
|
|
21
22
|
}
|
|
22
|
-
exports.default = OutputFieldContainer;
|
|
@@ -20,6 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.default = LoadingMenuItem;
|
|
23
24
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
24
25
|
const material_1 = require("@mui/material");
|
|
25
26
|
const react_1 = require("react");
|
|
@@ -28,7 +29,7 @@ function LoadingMenuItem(_a) {
|
|
|
28
29
|
const [clicked, setClicked] = (0, react_1.useState)(false);
|
|
29
30
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
30
31
|
const handleClick = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var
|
|
32
|
+
var _a;
|
|
32
33
|
if (loading)
|
|
33
34
|
return;
|
|
34
35
|
if (!clicked && confirmation) {
|
|
@@ -37,7 +38,7 @@ function LoadingMenuItem(_a) {
|
|
|
37
38
|
}
|
|
38
39
|
try {
|
|
39
40
|
setLoading(true);
|
|
40
|
-
yield ((
|
|
41
|
+
yield ((_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e));
|
|
41
42
|
}
|
|
42
43
|
finally {
|
|
43
44
|
setClicked(false);
|
|
@@ -46,4 +47,3 @@ function LoadingMenuItem(_a) {
|
|
|
46
47
|
});
|
|
47
48
|
return ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({}, props, { onClick: handleClick, sx: Object.assign(Object.assign({}, props.sx), { display: 'flex', alignItems: 'center' }), children: [(clicked && confirmation) || children, (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end", sx: { width: 18 }, children: loading && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 14 }) })] })));
|
|
48
49
|
}
|
|
49
|
-
exports.default = LoadingMenuItem;
|
|
@@ -43,6 +43,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
43
43
|
return t;
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.default = PopperMenuButton;
|
|
46
47
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
47
48
|
const material_1 = require("@mui/material");
|
|
48
49
|
const hooks_1 = require("material-ui-popup-state/hooks");
|
|
@@ -59,10 +60,9 @@ function PopperMenuButton(_a) {
|
|
|
59
60
|
: react_1.default.cloneElement(menu, {
|
|
60
61
|
// Close popper after the menu item click handler has been resolved
|
|
61
62
|
onClick: (...args) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
var
|
|
63
|
-
yield ((
|
|
63
|
+
var _a, _b;
|
|
64
|
+
yield ((_b = (_a = menu.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, ...args));
|
|
64
65
|
state.close();
|
|
65
66
|
}),
|
|
66
67
|
})) }) }) })) })) }))] }));
|
|
67
68
|
}
|
|
68
|
-
exports.default = PopperMenuButton;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = RuntimeCommonProvider;
|
|
7
|
+
exports.RuntimeLocaleProvider = RuntimeLocaleProvider;
|
|
7
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
const react_error_boundary_1 = require("react-error-boundary");
|
|
@@ -13,7 +14,6 @@ const locales_1 = require("../locales");
|
|
|
13
14
|
function RuntimeCommonProvider({ children }) {
|
|
14
15
|
return ((0, jsx_runtime_1.jsx)(RuntimeLocaleProvider, { children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorRender, children: (0, jsx_runtime_1.jsx)(react_1.default.Suspense, { children: children }) }) }));
|
|
15
16
|
}
|
|
16
|
-
exports.default = RuntimeCommonProvider;
|
|
17
17
|
function ErrorRender({ error }) {
|
|
18
18
|
return ((0, jsx_runtime_1.jsx)(ux_1.Result, { status: error.status || 'error', description: error.message, sx: { bgcolor: 'transparent', mt: '20%' } }));
|
|
19
19
|
}
|
|
@@ -21,4 +21,3 @@ function RuntimeLocaleProvider({ children }) {
|
|
|
21
21
|
const { locale } = (0, locale_1.useLocaleContext)();
|
|
22
22
|
return ((0, jsx_runtime_1.jsx)(locale_1.LocaleProvider, { translations: locales_1.translations, locale: locale, fallbackLocale: "en", children: children }));
|
|
23
23
|
}
|
|
24
|
-
exports.RuntimeLocaleProvider = RuntimeLocaleProvider;
|
|
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.default = ScrollView;
|
|
40
41
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
42
|
const material_1 = require("@mui/material");
|
|
42
43
|
const react_1 = require("react");
|
|
@@ -55,7 +56,6 @@ function ScrollView(_a) {
|
|
|
55
56
|
}
|
|
56
57
|
return ((0, jsx_runtime_1.jsx)(Composer, { initialScrollBehavior: initialScrollBehavior, children: (0, jsx_runtime_1.jsx)(ScrollViewWithinWindow, Object.assign({ scroll: scroll, component: component }, props, { children: children })) }));
|
|
57
58
|
}
|
|
58
|
-
exports.default = ScrollView;
|
|
59
59
|
function ScrollViewWithinWindow(_a) {
|
|
60
60
|
var { children, scroll, component } = _a, props = __rest(_a, ["children", "scroll", "component"]);
|
|
61
61
|
const { setTarget } = (0, useInternalContext_1.default)();
|
|
@@ -46,6 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
47
|
};
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.default = ShareActions;
|
|
49
50
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
50
51
|
const types_1 = require("@blocklet/ai-runtime/types");
|
|
51
52
|
const react_1 = require("@iconify/react");
|
|
@@ -89,7 +90,6 @@ function ShareActions(_a) {
|
|
|
89
90
|
return null;
|
|
90
91
|
return (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({}, props, { children: items }));
|
|
91
92
|
}
|
|
92
|
-
exports.default = ShareActions;
|
|
93
93
|
const ShareActionsMap = {
|
|
94
94
|
twitter: ShareTwitter,
|
|
95
95
|
copy: ShareCopy,
|
|
@@ -14,7 +14,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.default = SocialShare;
|
|
18
|
+
exports.SocialShareMenu = SocialShareMenu;
|
|
19
|
+
exports.SocialShareButtons = SocialShareButtons;
|
|
18
20
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
21
|
const react_1 = require("@iconify/react");
|
|
20
22
|
const material_1 = require("@mui/material");
|
|
@@ -43,7 +45,6 @@ function SocialShare(props) {
|
|
|
43
45
|
}, [type, restProps]);
|
|
44
46
|
return ((0, jsx_runtime_1.jsx)(locale_1.LocaleProvider, { translations: locales_1.translations, locale: locale, fallbackLocale: "en", children: renderContent() }));
|
|
45
47
|
}
|
|
46
|
-
exports.default = SocialShare;
|
|
47
48
|
function SocialShareMenu(_a) {
|
|
48
49
|
var { url = getFormattedUrl(window.location.href), content, children = (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:share" }), MenuProps, disableCopyLink = false } = _a, restProps = __rest(_a, ["url", "content", "children", "MenuProps", "disableCopyLink"]);
|
|
49
50
|
const theme = (0, material_1.useTheme)();
|
|
@@ -87,7 +88,6 @@ function SocialShareMenu(_a) {
|
|
|
87
88
|
}, children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: itemIconSx, round: true }, iconProps, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:link" }) })), (0, jsx_runtime_1.jsx)("span", { children: t('socialShare.copyLink') })] }) }, "copyToClipboard")),
|
|
88
89
|
].filter(Boolean) }, restProps, { children: children })));
|
|
89
90
|
}
|
|
90
|
-
exports.SocialShareMenu = SocialShareMenu;
|
|
91
91
|
function SocialShareButtons(_a) {
|
|
92
92
|
var { url = getFormattedUrl(window.location.href), content, sx, itemSx, onClick, bgFill, iconFill } = _a, rest = __rest(_a, ["url", "content", "sx", "itemSx", "onClick", "bgFill", "iconFill"]);
|
|
93
93
|
const mergedSx = [
|
|
@@ -104,4 +104,3 @@ function SocialShareButtons(_a) {
|
|
|
104
104
|
};
|
|
105
105
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: mergedSx }, rest, { children: [(0, jsx_runtime_1.jsx)(react_share_1.TwitterShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.XIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.TelegramShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.TelegramIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.RedditShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.RedditIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.WeiboShareButton, { url: url, title: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.WeiboIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.FacebookShareButton, { url: url, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.FacebookIcon, sx: mergedItemSx }, iconProps)) }), (0, jsx_runtime_1.jsx)(react_share_1.LinkedinShareButton, { url: url, summary: content, children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: react_share_1.LinkedinIcon, sx: mergedItemSx }, iconProps)) })] })));
|
|
106
106
|
}
|
|
107
|
-
exports.SocialShareButtons = SocialShareButtons;
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.default = ThemeProvider;
|
|
17
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
19
|
const icons_material_1 = require("@mui/icons-material");
|
|
19
20
|
const material_1 = require("@mui/material");
|
|
@@ -181,4 +182,3 @@ function ThemeProvider({ children }) {
|
|
|
181
182
|
},
|
|
182
183
|
}) }), (0, jsx_runtime_1.jsx)(GlobalLoading_1.default, { sx: { position: 'fixed', left: 0, top: 0, width: '100%', zIndex: 'snackbar' } }), (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(material_1.Stack, { flexGrow: 1, alignItems: "center", justifyContent: "center", children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 24 }) }), children: children })] })] }));
|
|
183
184
|
}
|
|
184
|
-
exports.default = ThemeProvider;
|
|
@@ -14,7 +14,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.default = UserInfo;
|
|
18
|
+
exports.UserName = UserName;
|
|
19
|
+
exports.UserTime = UserTime;
|
|
18
20
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
21
|
const DID_1 = __importDefault(require("@arcblock/ux/lib/DID"));
|
|
20
22
|
const material_1 = require("@mui/material");
|
|
@@ -33,12 +35,10 @@ function UserInfo(_a) {
|
|
|
33
35
|
opacity: 0.8,
|
|
34
36
|
} }))] })), showDID && did && (0, jsx_runtime_1.jsx)(material_1.Box, { component: DID_1.default, did: did, copyable: false, size: 14, responsive: true, sx: { mt: -0.25 } }), (0, jsx_runtime_1.jsx)(material_1.Box, { flex: 1, children: children })] })] })));
|
|
35
37
|
}
|
|
36
|
-
exports.default = UserInfo;
|
|
37
38
|
function UserName(_a) {
|
|
38
39
|
var { children, sx } = _a, restProps = __rest(_a, ["children", "sx"]);
|
|
39
40
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "div", noWrap: true, sx: Object.assign({ fontSize: 14, lineHeight: '24px', fontWeight: 500, display: 'flex', alignItems: 'center', gap: 1 }, sx) }, restProps, { children: children })));
|
|
40
41
|
}
|
|
41
|
-
exports.UserName = UserName;
|
|
42
42
|
function UserTime(_a) {
|
|
43
43
|
var { time } = _a, restProps = __rest(_a, ["time"]);
|
|
44
44
|
const formattedTime = (0, react_1.useMemo)(() => {
|
|
@@ -51,4 +51,3 @@ function UserTime(_a) {
|
|
|
51
51
|
return null;
|
|
52
52
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({}, restProps, { children: formattedTime }), "user-time"));
|
|
53
53
|
}
|
|
54
|
-
exports.UserTime = UserTime;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_OUTPUT_COMPONENTS = exports.OPENING_QUESTIONS_VIEW_ID = exports.IMAGES_VIEW_ID = exports.SHARE_VIEW_ID = exports.REFERENCED_LINKS_VIEW_ID = exports.SUGGESTED_QUESTIONS_VIEW_ID = exports.MARKDOWN_VIEW_ID = exports.DEFAULT_OUTPUT_COMPONENT_ID = exports.DEFAULT_INPUT_COMPONENT_ID = exports.DEFAULT_PAGE_COMPONENT_ID = exports.PAYMENT_KIT_DID = exports.AI_RUNTIME_DID = exports.AI_STUDIO_DID = void 0;
|
|
4
|
+
exports.getDefaultOutputComponent = getDefaultOutputComponent;
|
|
4
5
|
const types_1 = require("@blocklet/ai-runtime/types");
|
|
5
6
|
exports.AI_STUDIO_DID = 'z8iZpog7mcgcgBZzTiXJCWESvmnRrQmnd3XBB';
|
|
6
7
|
exports.AI_RUNTIME_DID = 'z2qaBP9SahqU2L2YA3ip7NecwKACMByTFuiJ2';
|
|
@@ -40,4 +41,3 @@ exports.DEFAULT_OUTPUT_COMPONENTS = {
|
|
|
40
41
|
function getDefaultOutputComponent(output) {
|
|
41
42
|
return exports.DEFAULT_OUTPUT_COMPONENTS[output.name];
|
|
42
43
|
}
|
|
43
|
-
exports.getDefaultOutputComponent = getDefaultOutputComponent;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useActiveAgent =
|
|
3
|
+
exports.useActiveAgent = useActiveAgent;
|
|
4
|
+
exports.default = ActiveAgentProvider;
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const types_1 = require("@blocklet/ai-runtime/types");
|
|
6
7
|
const react_1 = require("react");
|
|
@@ -14,7 +15,6 @@ function useActiveAgent() {
|
|
|
14
15
|
}
|
|
15
16
|
return context;
|
|
16
17
|
}
|
|
17
|
-
exports.useActiveAgent = useActiveAgent;
|
|
18
18
|
function ActiveAgentProvider({ children }) {
|
|
19
19
|
const { agent } = (0, runtime_1.useRuntimeState)();
|
|
20
20
|
const childAgentId = (0, react_1.useMemo)(() => {
|
|
@@ -25,4 +25,3 @@ function ActiveAgentProvider({ children }) {
|
|
|
25
25
|
const activeAgent = (0, react_1.useMemo)(() => ({ activeAgentId, setActiveAgentId }), [activeAgentId, setActiveAgentId]);
|
|
26
26
|
return (0, jsx_runtime_1.jsx)(activeAgentContext.Provider, { value: activeAgent, children: children });
|
|
27
27
|
}
|
|
28
|
-
exports.default = ActiveAgentProvider;
|