@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.
@@ -44,6 +44,8 @@ function GoogleSearchRelatedView({ output, outputValue, onlyLastMessage, }) {
44
44
  return undefined;
45
45
  return result.value;
46
46
  }, [outputValue]);
47
+ if (message === null || message === void 0 ? void 0 : message.loading)
48
+ return null;
47
49
  if ((!isLastMessage && onlyLastMessage) || !((_b = result === null || result === void 0 ? void 0 : result.related_questions) === null || _b === void 0 ? void 0 : _b.length))
48
50
  return null;
49
51
  return ((0, jsx_runtime_1.jsx)(OutputFieldContainer_1.default, { output: output, children: (0, jsx_runtime_1.jsx)(material_1.List, { dense: true, disablePadding: true, children: result.related_questions.map((item) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemButton, { sx: { py: 1, px: 2 }, onClick: () => __awaiter(this, void 0, void 0, function* () {
@@ -37,7 +37,7 @@ function GoogleSearchSourcesView({ output, outputValue }) {
37
37
  const itemsToShow = showAll
38
38
  ? [...((searchResult === null || searchResult === void 0 ? void 0 : searchResult.organic_results) || [])]
39
39
  : [...((searchResult === null || searchResult === void 0 ? void 0 : searchResult.organic_results) || [])].slice(0, (list === null || list === void 0 ? void 0 : list.length) > 3 ? 2 : 3);
40
- return ((0, jsx_runtime_1.jsx)(OutputFieldContainer_1.default, { output: output, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 1.5, children: [message.loading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemSkeleton, {}) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemSkeleton, {}) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemSkeleton, {}) })] })), (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { component: null, children: itemsToShow.map((item) => ((0, jsx_runtime_1.jsx)(react_transition_group_1.CSSTransition, { timeout: 500, classNames: "item", children: (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemView, { item: item }) }) }, item.link))) }), !showAll && list.length > 3 && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(MoreItemView, { list: list, onMore: handleToggle }) }))] }) }));
40
+ return ((0, jsx_runtime_1.jsx)(OutputFieldContainer_1.default, { output: output, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 1.5, children: [message.loading && !list.length && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemSkeleton, {}) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemSkeleton, {}) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemSkeleton, {}) })] })), (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { component: null, children: itemsToShow.map((item) => ((0, jsx_runtime_1.jsx)(react_transition_group_1.CSSTransition, { timeout: 500, classNames: "item", children: (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(ItemView, { item: item }) }) }, item.link))) }), !showAll && list.length > 3 && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, sm: 4, md: 4, children: (0, jsx_runtime_1.jsx)(MoreItemView, { list: list, onMore: handleToggle }) }))] }) }));
41
41
  }
42
42
  function ItemView({ item }) {
43
43
  var _a;
@@ -63,7 +63,7 @@ function SimpleOutput() {
63
63
  const value = output.name === types_1.RuntimeOutputVariable.text
64
64
  ? ((_a = message.outputs) === null || _a === void 0 ? void 0 : _a.content) ||
65
65
  ((_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[types_1.RuntimeOutputVariable.text])) === null || _d === void 0 ? void 0 : _d[types_1.RuntimeOutputVariable.text])
66
- : (_g = (_f = (_e = message.outputs) === null || _e === void 0 ? void 0 : _e.objects) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g[output.name];
66
+ : (_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];
67
67
  return ((0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { instanceId: output.id, componentId: output.appearance.componentId, properties: output.appearance.componentProperties, props: Object.assign({ output, outputValue: value, writing: output.name === types_1.RuntimeOutputVariable.text && message.loading }, (((_h = output === null || output === void 0 ? void 0 : output.appearance) === null || _h === void 0 ? void 0 : _h.componentProps) || {})) }, output.id));
68
68
  }), message.error && (0, jsx_runtime_1.jsx)(AgentErrorBoundary_1.AgentErrorView, { error: message.error }), CustomComponentActionsComponent && ((0, jsx_runtime_1.jsx)(AgentErrorBoundary_1.default, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(CustomComponentActionsComponent, {}) }) }))] }));
69
69
  }
@@ -154,5 +154,5 @@ function CodeRenderByMessage({ zoom, message, minHeight = 200, sx, propertiesVal
154
154
  exports.CodeRenderByMessageMemo = (0, react_2.memo)(CodeRenderByMessage);
155
155
  function getCurrentCodeByTaskId(message) {
156
156
  var _a, _b, _c;
157
- return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[codeField];
157
+ return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((i) => i === null || i === void 0 ? void 0 : i[codeField])) === null || _c === void 0 ? void 0 : _c[codeField];
158
158
  }