@blocklet/pages-kit 0.2.383 → 0.2.385
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/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +2 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.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/V0/components/CodePreview.js +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -38,6 +38,8 @@ export default function GoogleSearchRelatedView({ output, outputValue, onlyLastM
|
|
|
38
38
|
return undefined;
|
|
39
39
|
return result.value;
|
|
40
40
|
}, [outputValue]);
|
|
41
|
+
if (message === null || message === void 0 ? void 0 : message.loading)
|
|
42
|
+
return null;
|
|
41
43
|
if ((!isLastMessage && onlyLastMessage) || !((_b = result === null || result === void 0 ? void 0 : result.related_questions) === null || _b === void 0 ? void 0 : _b.length))
|
|
42
44
|
return null;
|
|
43
45
|
return (_jsx(OutputFieldContainer, { output: output, children: _jsx(List, { dense: true, disablePadding: true, children: result.related_questions.map((item) => (_jsxs(_Fragment, { children: [_jsx(ListItemButton, { sx: { py: 1, px: 2 }, onClick: () => __awaiter(this, void 0, void 0, function* () {
|
package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js
CHANGED
|
@@ -31,7 +31,7 @@ export default function GoogleSearchSourcesView({ output, outputValue }) {
|
|
|
31
31
|
const itemsToShow = showAll
|
|
32
32
|
? [...((searchResult === null || searchResult === void 0 ? void 0 : searchResult.organic_results) || [])]
|
|
33
33
|
: [...((searchResult === null || searchResult === void 0 ? void 0 : searchResult.organic_results) || [])].slice(0, (list === null || list === void 0 ? void 0 : list.length) > 3 ? 2 : 3);
|
|
34
|
-
return (_jsx(OutputFieldContainer, { output: output, children: _jsxs(Grid, { container: true, spacing: 1.5, children: [message.loading && (_jsxs(_Fragment, { children: [_jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemSkeleton, {}) }), _jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemSkeleton, {}) }), _jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemSkeleton, {}) })] })), _jsx(TransitionGroup, { component: null, children: itemsToShow.map((item) => (_jsx(CSSTransition, { timeout: 500, classNames: "item", children: _jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemView, { item: item }) }) }, item.link))) }), !showAll && list.length > 3 && (_jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(MoreItemView, { list: list, onMore: handleToggle }) }))] }) }));
|
|
34
|
+
return (_jsx(OutputFieldContainer, { output: output, children: _jsxs(Grid, { container: true, spacing: 1.5, children: [message.loading && !list.length && (_jsxs(_Fragment, { children: [_jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemSkeleton, {}) }), _jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemSkeleton, {}) }), _jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemSkeleton, {}) })] })), _jsx(TransitionGroup, { component: null, children: itemsToShow.map((item) => (_jsx(CSSTransition, { timeout: 500, classNames: "item", children: _jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(ItemView, { item: item }) }) }, item.link))) }), !showAll && list.length > 3 && (_jsx(Grid, { item: true, xs: 4, sm: 4, md: 4, children: _jsx(MoreItemView, { list: list, onMore: handleToggle }) }))] }) }));
|
|
35
35
|
}
|
|
36
36
|
function ItemView({ item }) {
|
|
37
37
|
var _a;
|
|
@@ -34,7 +34,7 @@ export default function SimpleOutput() {
|
|
|
34
34
|
const value = output.name === RuntimeOutputVariable.text
|
|
35
35
|
? ((_a = message.outputs) === null || _a === void 0 ? void 0 : _a.content) ||
|
|
36
36
|
((_d = (_c = (_b = message.outputs) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.find((i) => i === null || i === void 0 ? void 0 : i[RuntimeOutputVariable.text])) === null || _d === void 0 ? void 0 : _d[RuntimeOutputVariable.text])
|
|
37
|
-
: (_g = (_f = (_e = message.outputs) === null || _e === void 0 ? void 0 : _e.objects) === null || _f === void 0 ? void 0 : _f[
|
|
37
|
+
: (_g = (_f = (_e = message.outputs) === null || _e === void 0 ? void 0 : _e.objects) === null || _f === void 0 ? void 0 : _f.find((i) => i === null || i === void 0 ? void 0 : i[output.name])) === null || _g === void 0 ? void 0 : _g[output.name];
|
|
38
38
|
return (_jsx(CustomComponentRenderer, { instanceId: output.id, componentId: output.appearance.componentId, properties: output.appearance.componentProperties, props: Object.assign({ output, outputValue: value, writing: output.name === RuntimeOutputVariable.text && message.loading }, (((_h = output === null || output === void 0 ? void 0 : output.appearance) === null || _h === void 0 ? void 0 : _h.componentProps) || {})) }, output.id));
|
|
39
39
|
}), message.error && _jsx(AgentErrorView, { error: message.error }), CustomComponentActionsComponent && (_jsx(AgentErrorBoundary, { children: _jsx(Suspense, { children: _jsx(CustomComponentActionsComponent, {}) }) }))] }));
|
|
40
40
|
}
|
|
@@ -145,5 +145,5 @@ export function CodeRenderByMessage({ zoom, message, minHeight = 200, sx, proper
|
|
|
145
145
|
export const CodeRenderByMessageMemo = memo(CodeRenderByMessage);
|
|
146
146
|
export function getCurrentCodeByTaskId(message) {
|
|
147
147
|
var _a, _b, _c;
|
|
148
|
-
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[
|
|
148
|
+
return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((i) => i === null || i === void 0 ? void 0 : i[codeField])) === null || _c === void 0 ? void 0 : _c[codeField];
|
|
149
149
|
}
|