@blocklet/pages-kit 0.2.352 → 0.2.354
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 +6 -8
- 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 +6 -7
- 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 +4 -4
- 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 +5 -7
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +2 -3
- package/lib/esm/builtin/async/ai-runtime/state/session.js +17 -17
- package/lib/esm/components/CustomComponentRenderer/state.js +1 -1
- 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 +1 -2
- 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 +4 -4
package/lib/cjs/utils/preload.js
CHANGED
|
@@ -11,7 +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.injectPreloadComponents =
|
|
14
|
+
exports.injectPreloadComponents = injectPreloadComponents;
|
|
15
15
|
const types_1 = require("../types");
|
|
16
16
|
function injectPreloadComponents(data) {
|
|
17
17
|
const injectState = {
|
|
@@ -41,4 +41,3 @@ var ${types_1.PreloadComponentsStateGlobalVariableName} = ${JSON.stringify(injec
|
|
|
41
41
|
`,
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
exports.injectPreloadComponents = injectPreloadComponents;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.RenderNestedComponent = void 0;
|
|
4
|
+
exports.componentUMDName = componentUMDName;
|
|
5
|
+
exports.mergeComponent = mergeComponent;
|
|
6
|
+
exports.parsePropertyValue = parsePropertyValue;
|
|
7
|
+
exports.assignNullableFields = assignNullableFields;
|
|
4
8
|
function componentUMDName({ componentId }) {
|
|
5
9
|
return `PagesCustomComponent${componentId}`;
|
|
6
10
|
}
|
|
7
|
-
exports.componentUMDName = componentUMDName;
|
|
8
11
|
function mergeComponent({ componentId, getComponent, locale, defaultLocale, properties: parameters, }) {
|
|
9
12
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
13
|
let component = getComponent(componentId);
|
|
@@ -56,7 +59,6 @@ function mergeComponent({ componentId, getComponent, locale, defaultLocale, prop
|
|
|
56
59
|
return null;
|
|
57
60
|
return { script, properties };
|
|
58
61
|
}
|
|
59
|
-
exports.mergeComponent = mergeComponent;
|
|
60
62
|
exports.RenderNestedComponent = '__RENDER_NESTED_COMPONENT__';
|
|
61
63
|
function parsePropertyValue(property, value, { locale, defaultLocale }) {
|
|
62
64
|
var _a, _b, _c, _d, _e;
|
|
@@ -84,7 +86,6 @@ function parsePropertyValue(property, value, { locale, defaultLocale }) {
|
|
|
84
86
|
}
|
|
85
87
|
return value;
|
|
86
88
|
}
|
|
87
|
-
exports.parsePropertyValue = parsePropertyValue;
|
|
88
89
|
function assignNullableFields(properties, newProperties) {
|
|
89
90
|
for (const [key, val] of Object.entries(newProperties)) {
|
|
90
91
|
if (properties[key] === undefined || properties[key] === null) {
|
|
@@ -93,4 +94,3 @@ function assignNullableFields(properties, newProperties) {
|
|
|
93
94
|
}
|
|
94
95
|
return properties;
|
|
95
96
|
}
|
|
96
|
-
exports.assignNullableFields = assignNullableFields;
|
|
@@ -23,5 +23,8 @@ function MissingSecretErrorView() {
|
|
|
23
23
|
const { t } = useLocaleContext();
|
|
24
24
|
const { agent } = useRuntimeState();
|
|
25
25
|
const isAdmin = useIsAgentAdmin(agent);
|
|
26
|
-
|
|
26
|
+
const allSecretsHasValue = agent.config.secrets.every((i) => i.hasValue);
|
|
27
|
+
return (_jsx(Alert, { severity: allSecretsHasValue ? 'info' : 'error', sx: { [`.${alertClasses.message}`]: { flex: 1 } }, children: _jsxs(Stack, { width: "100%", children: [allSecretsHasValue
|
|
28
|
+
? 'Configuration successful, you can continue to use it now!'
|
|
29
|
+
: 'The required configuration is missing. Please complete the setup before proceeding!', isAdmin && (_jsx(Stack, { alignItems: "flex-end", children: _jsx(Button, { size: "small", variant: "outlined", onClick: () => settingsDialogState.getState().open(), children: t('setup') }) }))] }) }));
|
|
27
30
|
}
|
|
@@ -26,7 +26,7 @@ export default function LoadingMenuItem(_a) {
|
|
|
26
26
|
const [clicked, setClicked] = useState(false);
|
|
27
27
|
const [loading, setLoading] = useState(false);
|
|
28
28
|
const handleClick = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var
|
|
29
|
+
var _a;
|
|
30
30
|
if (loading)
|
|
31
31
|
return;
|
|
32
32
|
if (!clicked && confirmation) {
|
|
@@ -35,7 +35,7 @@ export default function LoadingMenuItem(_a) {
|
|
|
35
35
|
}
|
|
36
36
|
try {
|
|
37
37
|
setLoading(true);
|
|
38
|
-
yield ((
|
|
38
|
+
yield ((_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e));
|
|
39
39
|
}
|
|
40
40
|
finally {
|
|
41
41
|
setClicked(false);
|
|
@@ -34,8 +34,8 @@ export default function PopperMenuButton(_a) {
|
|
|
34
34
|
: React.cloneElement(menu, {
|
|
35
35
|
// Close popper after the menu item click handler has been resolved
|
|
36
36
|
onClick: (...args) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
var
|
|
38
|
-
yield ((
|
|
37
|
+
var _a, _b;
|
|
38
|
+
yield ((_b = (_a = menu.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, ...args));
|
|
39
39
|
state.close();
|
|
40
40
|
}),
|
|
41
41
|
})) }) }) })) })) }))] }));
|
|
@@ -109,9 +109,9 @@ export default function V0Output() {
|
|
|
109
109
|
disabled,
|
|
110
110
|
sx: Object.assign({}, responsiveSx),
|
|
111
111
|
onClick: (e) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
var
|
|
113
|
-
const { taskid: taskId } = ((
|
|
114
|
-
const currentCode = getCurrentCodeByTaskId(message
|
|
112
|
+
var _a;
|
|
113
|
+
const { taskid: taskId } = ((_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.dataset) || {};
|
|
114
|
+
const currentCode = getCurrentCodeByTaskId(message);
|
|
115
115
|
try {
|
|
116
116
|
yield transpileAndLoadScript(currentCode).then((m) => {
|
|
117
117
|
var _a, _b, _c;
|
|
@@ -178,10 +178,8 @@ export default function V0Output() {
|
|
|
178
178
|
disabled,
|
|
179
179
|
variant: 'contained',
|
|
180
180
|
color: 'primary',
|
|
181
|
-
onClick: (
|
|
182
|
-
|
|
183
|
-
const { taskid: taskId } = ((_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.dataset) || {};
|
|
184
|
-
setCode(getCurrentCodeByTaskId(message, taskId));
|
|
181
|
+
onClick: () => {
|
|
182
|
+
setCode(getCurrentCodeByTaskId(message));
|
|
185
183
|
},
|
|
186
184
|
},
|
|
187
185
|
group: 'codePreview',
|
|
@@ -140,8 +140,7 @@ export function CodeRenderByMessage({ zoom, message, minHeight = 200, sx, proper
|
|
|
140
140
|
} }), children: _jsx(ContentRender, {}) }, message === null || message === void 0 ? void 0 : message.id));
|
|
141
141
|
}
|
|
142
142
|
export const CodeRenderByMessageMemo = memo(CodeRenderByMessage);
|
|
143
|
-
export function getCurrentCodeByTaskId(message
|
|
143
|
+
export function getCurrentCodeByTaskId(message) {
|
|
144
144
|
var _a, _b, _c;
|
|
145
|
-
|
|
146
|
-
return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((item) => item.taskId === taskId)) === null || _c === void 0 ? void 0 : _c[codeField];
|
|
145
|
+
return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[codeField];
|
|
147
146
|
}
|
|
@@ -137,7 +137,7 @@ export const createSessionState = ({ aid }) => {
|
|
|
137
137
|
state.currentSessionId = sessionId;
|
|
138
138
|
});
|
|
139
139
|
},
|
|
140
|
-
createSession: (...
|
|
140
|
+
createSession: (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ name } = {}) {
|
|
141
141
|
const { created, sessions } = yield createSession({ aid, name });
|
|
142
142
|
set((state) => {
|
|
143
143
|
state.sessions = sessions;
|
|
@@ -152,7 +152,7 @@ export const createSessionState = ({ aid }) => {
|
|
|
152
152
|
});
|
|
153
153
|
return created;
|
|
154
154
|
}),
|
|
155
|
-
deleteSession: (...
|
|
155
|
+
deleteSession: (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (args = {}) {
|
|
156
156
|
var _a;
|
|
157
157
|
const sessionId = args.sessionId || get().currentSessionId;
|
|
158
158
|
const autoSetCurrentSessionId = (_a = args.autoSetCurrentSessionId) !== null && _a !== void 0 ? _a : true;
|
|
@@ -167,7 +167,7 @@ export const createSessionState = ({ aid }) => {
|
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
}),
|
|
170
|
-
clearSession: (...
|
|
170
|
+
clearSession: (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (args = {}) {
|
|
171
171
|
const sessionId = args.sessionId || get().currentSessionId;
|
|
172
172
|
if (!sessionId)
|
|
173
173
|
return;
|
|
@@ -182,8 +182,8 @@ export const createSessionState = ({ aid }) => {
|
|
|
182
182
|
s.messageLoading = undefined;
|
|
183
183
|
});
|
|
184
184
|
}),
|
|
185
|
-
loadMoreMessages: (...
|
|
186
|
-
var
|
|
185
|
+
loadMoreMessages: (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (args = {}) {
|
|
186
|
+
var _a, _b;
|
|
187
187
|
const sessionId = args.sessionId || get().currentSessionId;
|
|
188
188
|
const limit = args.limit || GET_MESSAGES_LIMIT;
|
|
189
189
|
if (!sessionId)
|
|
@@ -202,7 +202,7 @@ export const createSessionState = ({ aid }) => {
|
|
|
202
202
|
try {
|
|
203
203
|
const result = yield getMessages({
|
|
204
204
|
sessionId: s.session.id,
|
|
205
|
-
before: (
|
|
205
|
+
before: (_b = (_a = s.messages) === null || _a === void 0 ? void 0 : _a.slice(-1)[0]) === null || _b === void 0 ? void 0 : _b.id,
|
|
206
206
|
orderDirection: GET_MESSAGES_ORDER_DIRECTION,
|
|
207
207
|
limit,
|
|
208
208
|
});
|
|
@@ -232,18 +232,18 @@ export const createSessionState = ({ aid }) => {
|
|
|
232
232
|
for (let i = 0; i < sessions.length; i += groupSize) {
|
|
233
233
|
const group = sessions.slice(i, i + groupSize);
|
|
234
234
|
// eslint-disable-next-line no-await-in-loop
|
|
235
|
-
yield Promise.all(group.map((
|
|
236
|
-
var
|
|
235
|
+
yield Promise.all(group.map((_a) => __awaiter(void 0, [_a], void 0, function* ({ id: sessionId }) {
|
|
236
|
+
var _b, _c;
|
|
237
237
|
// if messages is empty, load latest message
|
|
238
|
-
if (!((
|
|
238
|
+
if (!((_c = (_b = sessionMap === null || sessionMap === void 0 ? void 0 : sessionMap[sessionId]) === null || _b === void 0 ? void 0 : _b.messages) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
239
239
|
yield get().loadMoreMessages({ sessionId, limit: 1 });
|
|
240
240
|
}
|
|
241
241
|
})));
|
|
242
242
|
}
|
|
243
243
|
}),
|
|
244
|
-
execute: (
|
|
245
|
-
var
|
|
246
|
-
var { blockletDid, aid, working, parameters, onResponseStart } =
|
|
244
|
+
execute: (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
245
|
+
var _b, e_1, _c, _d;
|
|
246
|
+
var { blockletDid, aid, working, parameters, onResponseStart } = _a, args = __rest(_a, ["blockletDid", "aid", "working", "parameters", "onResponseStart"]);
|
|
247
247
|
const sessionId = args.sessionId ||
|
|
248
248
|
get().currentSessionId ||
|
|
249
249
|
(yield get().createSession({
|
|
@@ -269,10 +269,10 @@ export const createSessionState = ({ aid }) => {
|
|
|
269
269
|
});
|
|
270
270
|
let responseStarted = false;
|
|
271
271
|
try {
|
|
272
|
-
for (var
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const value =
|
|
272
|
+
for (var _e = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield stream_1.next(), _b = stream_1_1.done, !_b; _e = true) {
|
|
273
|
+
_d = stream_1_1.value;
|
|
274
|
+
_e = false;
|
|
275
|
+
const value = _d;
|
|
276
276
|
if (!responseStarted) {
|
|
277
277
|
responseStarted = true;
|
|
278
278
|
onResponseStart === null || onResponseStart === void 0 ? void 0 : onResponseStart();
|
|
@@ -336,7 +336,7 @@ export const createSessionState = ({ aid }) => {
|
|
|
336
336
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
337
337
|
finally {
|
|
338
338
|
try {
|
|
339
|
-
if (!
|
|
339
|
+
if (!_e && !_b && (_c = stream_1.return)) yield _c.call(stream_1);
|
|
340
340
|
}
|
|
341
341
|
finally { if (e_1) throw e_1.error; }
|
|
342
342
|
}
|
|
@@ -208,7 +208,7 @@ function useTranspileComponent({ componentId, locale, properties, dev: { default
|
|
|
208
208
|
export function transpileAndLoadScript(script) {
|
|
209
209
|
return __awaiter(this, void 0, void 0, function* () {
|
|
210
210
|
const [ts, { createBuiltinModuleTransformer }] = yield Promise.all([
|
|
211
|
-
import('typescript'),
|
|
211
|
+
import('typescript').then((m) => m.default || m),
|
|
212
212
|
import('../../utils/typescript/builtin-module-transformer'),
|
|
213
213
|
]);
|
|
214
214
|
const compiled = ts.transpileModule(script, {
|