@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
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const jsx_runtime_1 = require("react/jsx-runtime");
15
+ const material_1 = require("@mui/material");
16
+ const TransparentTooltip = (0, material_1.styled)((_a) => {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({}, props, { classes: { popper: className } })));
19
+ })(() => ({
20
+ [`& .${material_1.tooltipClasses.tooltip}`]: {
21
+ backgroundColor: 'transparent',
22
+ boxShadow: 'none',
23
+ },
24
+ }));
25
+ exports.default = TransparentTooltip;
@@ -54,9 +54,14 @@ function UserQuestion({ question }) {
54
54
  backgroundColor: 'grey.200',
55
55
  maxWidth: 300,
56
56
  }, children: (0, jsx_runtime_1.jsx)(ClickToCopy_1.CopyButton, { locale: locale, unstyled: true, render: ({ copyButton, containerRef }) => {
57
- return ((0, jsx_runtime_1.jsx)(material_1.Box, { ref: containerRef, display: "flex", alignItems: "center", sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'textColor' }), children: (0, jsx_runtime_1.jsx)(ClickToCopy_1.default, { locale: locale, unstyled: true, disableHoverListener: true, disableFocusListener: true, disableTouchListener: true, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { placement: "bottom", arrow: true, title: (0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, { sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'white' }), children: [question, (0, jsx_runtime_1.jsx)(material_1.Box, { id: "copy-button-wrapper", component: "span", sx: {
58
- ml: 0.5,
59
- }, children: copyButton })] }) }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: Object.assign(Object.assign(Object.assign({}, BASE_QUESTION_SX), { textAlign: 'left', alignItems: 'center' }), (0, utils_1.getLineClamp)(1)), children: question }) }) }) }));
57
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { ref: containerRef, display: "flex", alignItems: "center", sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { color: 'textColor' }), children: (0, jsx_runtime_1.jsx)(ClickToCopy_1.default, { locale: locale, unstyled: true, disableHoverListener: true, disableFocusListener: true, disableTouchListener: true, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { placement: "bottom", arrow: true, title: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
58
+ display: 'flex',
59
+ alignItems: 'center',
60
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: Object.assign(Object.assign({}, BASE_QUESTION_SX), { lineHeight: 1, color: 'white' }), children: question }), (0, jsx_runtime_1.jsx)(material_1.Box, { id: "copy-button-wrapper", component: "span", sx: {
61
+ ml: 0.5,
62
+ mt: 0.25,
63
+ fontSize: 14,
64
+ }, children: copyButton })] }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: Object.assign(Object.assign(Object.assign({}, BASE_QUESTION_SX), { textAlign: 'left', alignItems: 'center' }), (0, utils_1.getLineClamp)(1)), children: question }) }) }) }));
60
65
  } }) })] }));
61
66
  }
62
67
  exports.default = UserQuestion;
@@ -42,7 +42,7 @@ function CustomComponentRenderer(_a) {
42
42
  var { dev } = _a, props = __rest(_a, ["dev"]);
43
43
  const inheritedDev = (0, DevProvider_1.useDev)();
44
44
  const BuiltinComponent = BuiltinComponents[props.componentId];
45
- return ((0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { fallbackRender: ErrorView, resetKeys: [Date.now()], children: (0, jsx_runtime_1.jsx)(DevProvider_1.DevProvider, { dev: dev !== null && dev !== void 0 ? dev : inheritedDev, children: BuiltinComponent ? ((0, jsx_runtime_1.jsx)(BuiltinComponent, Object.assign({}, props))) : ((0, jsx_runtime_1.jsx)(ComponentRenderer, Object.assign({}, props, { instanceId: (_b = props.instanceId) !== null && _b !== void 0 ? _b : props.componentId }))) }) }));
45
+ return ((0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { fallbackRender: (props === null || props === void 0 ? void 0 : props.fallbackRender) || ErrorView, resetKeys: [Date.now()], children: (0, jsx_runtime_1.jsx)(DevProvider_1.DevProvider, { dev: dev !== null && dev !== void 0 ? dev : inheritedDev, children: BuiltinComponent ? ((0, jsx_runtime_1.jsx)(BuiltinComponent, Object.assign({}, props))) : ((0, jsx_runtime_1.jsx)(ComponentRenderer, Object.assign({}, props, { instanceId: (_b = props.instanceId) !== null && _b !== void 0 ? _b : props.componentId }))) }) }));
46
46
  }
47
47
  exports.default = CustomComponentRenderer;
48
48
  const BuiltinComponents = {
@@ -59,7 +59,8 @@ function ComponentRenderer(_a) {
59
59
  }
60
60
  const component = (0, state_1.useComponent)(Object.assign(Object.assign({}, props), { dev }));
61
61
  if (component === null || component === void 0 ? void 0 : component.error) {
62
- return (0, jsx_runtime_1.jsx)(ErrorView, { error: component.error });
62
+ // throw to outer error boundary
63
+ throw component.error;
63
64
  }
64
65
  if (component === null || component === void 0 ? void 0 : component.Component) {
65
66
  return ((0, jsx_runtime_1.jsx)(Renderer, Object.assign({ renderCount: renderCount + 1 }, props, { Component: component.Component, props: Object.assign(Object.assign({}, component.props), props.props) })));