@blocklet/pages-kit 0.2.327 → 0.2.329

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.
Files changed (42) hide show
  1. package/lib/cjs/builtin/async/ai-runtime/components/Header/SimpleHeader.js +1 -1
  2. package/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +47 -29
  3. package/lib/cjs/builtin/async/ai-runtime/components/UserInfo.js +4 -6
  4. package/lib/cjs/builtin/async/ai-runtime/locales/index.js +10 -4
  5. package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +1 -1
  6. package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +1 -1
  7. package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +16 -2
  8. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +10 -0
  9. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +6 -4
  10. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +3 -2
  11. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +4 -1
  12. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +15 -6
  13. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +74 -19
  14. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.js +25 -0
  15. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +8 -3
  16. package/lib/cjs/components/CustomComponentRenderer/index.js +3 -2
  17. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  18. package/lib/esm/builtin/async/ai-runtime/components/Header/SimpleHeader.js +1 -1
  19. package/lib/esm/builtin/async/ai-runtime/components/ThemeProvider.js +48 -30
  20. package/lib/esm/builtin/async/ai-runtime/components/UserInfo.js +4 -6
  21. package/lib/esm/builtin/async/ai-runtime/locales/index.js +10 -4
  22. package/lib/esm/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +1 -1
  23. package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +1 -1
  24. package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +17 -3
  25. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +10 -0
  26. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +6 -4
  27. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +3 -2
  28. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +5 -2
  29. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +15 -6
  30. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +73 -18
  31. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.js +23 -0
  32. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +8 -3
  33. package/lib/esm/components/CustomComponentRenderer/index.js +3 -2
  34. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  35. package/lib/types/builtin/async/ai-runtime/api/agent.d.ts +9 -1
  36. package/lib/types/builtin/async/ai-runtime/components/UserInfo.d.ts +2 -1
  37. package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +6 -0
  38. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.d.ts +2 -1
  39. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/TransparentTooltip.d.ts +3 -0
  40. package/lib/types/components/CustomComponentRenderer/index.d.ts +1 -0
  41. package/lib/types/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +7 -6
@@ -29,8 +29,13 @@ export default function UserQuestion({ question }) {
29
29
  backgroundColor: 'grey.200',
30
30
  maxWidth: 300,
31
31
  }, children: _jsx(CopyButton, { locale: locale, unstyled: true, render: ({ copyButton, containerRef }) => {
32
- return (_jsx(Box, { ref: containerRef, display: "flex", alignItems: "center", sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'textColor' }), children: _jsx(ClickToCopy, { locale: locale, unstyled: true, disableHoverListener: true, disableFocusListener: true, disableTouchListener: true, children: _jsx(Tooltip, { placement: "bottom", arrow: true, title: _jsx(Box, { children: _jsxs(Typography, { sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'white' }), children: [question, _jsx(Box, { id: "copy-button-wrapper", component: "span", sx: {
33
- ml: 0.5,
34
- }, children: copyButton })] }) }), children: _jsx(Typography, { sx: Object.assign(Object.assign(Object.assign({}, BASE_QUESTION_SX), { textAlign: 'left', alignItems: 'center' }), getLineClamp(1)), children: question }) }) }) }));
32
+ return (_jsx(Box, { ref: containerRef, display: "flex", alignItems: "center", sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'textColor' }), children: _jsx(ClickToCopy, { locale: locale, unstyled: true, disableHoverListener: true, disableFocusListener: true, disableTouchListener: true, children: _jsx(Tooltip, { placement: "bottom", arrow: true, title: _jsxs(Box, { sx: {
33
+ display: 'flex',
34
+ alignItems: 'center',
35
+ }, children: [_jsx(Typography, { sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { lineHeight: 1, color: 'white' }), children: question }), _jsx(Box, { id: "copy-button-wrapper", component: "span", sx: {
36
+ ml: 0.5,
37
+ mt: 0.25,
38
+ fontSize: 14,
39
+ }, children: copyButton })] }), children: _jsx(Typography, { sx: Object.assign(Object.assign(Object.assign({}, BASE_QUESTION_SX), { textAlign: 'left', alignItems: 'center' }), getLineClamp(1)), children: question }) }) }) }));
35
40
  } }) })] }));
36
41
  }
@@ -23,7 +23,7 @@ export default function CustomComponentRenderer(_a) {
23
23
  var { dev } = _a, props = __rest(_a, ["dev"]);
24
24
  const inheritedDev = useDev();
25
25
  const BuiltinComponent = BuiltinComponents[props.componentId];
26
- return (_jsx(ErrorBoundary, { fallbackRender: ErrorView, resetKeys: [Date.now()], children: _jsx(DevProvider, { dev: dev !== null && dev !== void 0 ? dev : inheritedDev, children: BuiltinComponent ? (_jsx(BuiltinComponent, Object.assign({}, props))) : (_jsx(ComponentRenderer, Object.assign({}, props, { instanceId: (_b = props.instanceId) !== null && _b !== void 0 ? _b : props.componentId }))) }) }));
26
+ return (_jsx(ErrorBoundary, { fallbackRender: (props === null || props === void 0 ? void 0 : props.fallbackRender) || ErrorView, resetKeys: [Date.now()], children: _jsx(DevProvider, { dev: dev !== null && dev !== void 0 ? dev : inheritedDev, children: BuiltinComponent ? (_jsx(BuiltinComponent, Object.assign({}, props))) : (_jsx(ComponentRenderer, Object.assign({}, props, { instanceId: (_b = props.instanceId) !== null && _b !== void 0 ? _b : props.componentId }))) }) }));
27
27
  }
28
28
  const BuiltinComponents = {
29
29
  'blocklet-react-component': BlockletReactComponentRenderer,
@@ -39,7 +39,8 @@ function ComponentRenderer(_a) {
39
39
  }
40
40
  const component = useComponent(Object.assign(Object.assign({}, props), { dev }));
41
41
  if (component === null || component === void 0 ? void 0 : component.error) {
42
- return _jsx(ErrorView, { error: component.error });
42
+ // throw to outer error boundary
43
+ throw component.error;
43
44
  }
44
45
  if (component === null || component === void 0 ? void 0 : component.Component) {
45
46
  return (_jsx(Renderer, Object.assign({ renderCount: renderCount + 1 }, props, { Component: component.Component, props: Object.assign(Object.assign({}, component.props), props.props) })));