@blocklet/pages-kit 0.2.305 → 0.2.307

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 (46) hide show
  1. package/lib/cjs/builtin/async/ai-runtime/components/ActionButton.js +6 -6
  2. package/lib/cjs/builtin/async/ai-runtime/components/AgentInputField/StringField.js +15 -1
  3. package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +153 -0
  4. package/lib/cjs/builtin/async/ai-runtime/index.js +5 -1
  5. package/lib/cjs/builtin/async/ai-runtime/locales/index.js +2 -0
  6. package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +1 -1
  7. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +11 -8
  8. package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +2 -1
  9. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +38 -2
  10. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +4 -2
  11. package/lib/cjs/builtin/async/ai-runtime/state/agent.js +3 -1
  12. package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +1 -2
  13. package/lib/cjs/builtin/async/ai-runtime/utils/download-image.js +41 -0
  14. package/lib/cjs/components/CustomComponentRenderer/DevProvider.js +26 -0
  15. package/lib/cjs/components/CustomComponentRenderer/index.js +8 -5
  16. package/lib/cjs/utils/builtin.js +1 -0
  17. package/lib/cjs/utils/inject-global-components.js +5 -0
  18. package/lib/esm/builtin/async/ai-runtime/components/ActionButton.js +6 -6
  19. package/lib/esm/builtin/async/ai-runtime/components/AgentInputField/StringField.js +17 -3
  20. package/lib/esm/builtin/async/ai-runtime/components/ShareActions/index.js +124 -0
  21. package/lib/esm/builtin/async/ai-runtime/index.js +2 -0
  22. package/lib/esm/builtin/async/ai-runtime/locales/index.js +2 -0
  23. package/lib/esm/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +1 -1
  24. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +11 -8
  25. package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +2 -1
  26. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +39 -3
  27. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +4 -2
  28. package/lib/esm/builtin/async/ai-runtime/state/agent.js +3 -1
  29. package/lib/esm/builtin/async/ai-runtime/state/runtime.js +1 -2
  30. package/lib/esm/builtin/async/ai-runtime/utils/download-image.js +36 -0
  31. package/lib/esm/components/CustomComponentRenderer/DevProvider.js +21 -0
  32. package/lib/esm/components/CustomComponentRenderer/index.js +8 -5
  33. package/lib/esm/utils/builtin.js +1 -0
  34. package/lib/esm/utils/inject-global-components.js +2 -0
  35. package/lib/types/builtin/async/ai-runtime/components/ActionButton.d.ts +2 -1
  36. package/lib/types/builtin/async/ai-runtime/components/ShareActions/index.d.ts +2 -0
  37. package/lib/types/builtin/async/ai-runtime/index.d.ts +2 -0
  38. package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +2 -0
  39. package/lib/types/builtin/async/ai-runtime/utils/download-image.d.ts +4 -0
  40. package/lib/types/components/CustomComponentRenderer/DevProvider.d.ts +9 -0
  41. package/lib/types/components/CustomComponentRenderer/index.d.ts +1 -1
  42. package/lib/types/utils/builtin.d.ts +1 -0
  43. package/package.json +9 -6
  44. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageActions.js +0 -72
  45. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageActions.js +0 -66
  46. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageActions.d.ts +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit",
3
- "version": "0.2.305",
3
+ "version": "0.2.307",
4
4
  "description": "Pages Kit components and utils",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -82,15 +82,18 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@arcblock/did-connect": "^2.9.77",
85
- "@blocklet/ai-kit": "^0.1.30",
86
- "@blocklet/ai-runtime": "^0.1.376",
85
+ "@blocklet/ai-kit": "^0.1.31",
86
+ "@blocklet/ai-runtime": "^0.1.381",
87
87
  "@blocklet/js-sdk": "1.16.26",
88
88
  "@blocklet/sdk": "^1.16.26",
89
89
  "@iconify/react": "^4.1.1",
90
90
  "@lottiefiles/lottie-player": "^1.7.1",
91
+ "@types/file-saver": "^2.0.7",
91
92
  "axios": "^1.6.8",
92
93
  "dayjs": "^1.11.11",
93
94
  "eventsource-parser": "^1.1.2",
95
+ "file-saver": "^2.0.5",
96
+ "html2pdf.js": "^0.10.1",
94
97
  "immer": "^10.1.1",
95
98
  "js-base64": "^3.7.7",
96
99
  "lodash": "^4.17.21",
@@ -134,7 +137,7 @@
134
137
  "@types/lodash": "^4.17.1",
135
138
  "@types/mustache": "^4.2.5",
136
139
  "@types/node-fetch": "^2.6.11",
137
- "@types/react": "^18.3.1",
140
+ "@types/react": "^18.3.2",
138
141
  "@types/react-helmet": "^6.1.11",
139
142
  "@types/react-scroll-to-bottom": "^4.2.5",
140
143
  "@types/react-syntax-highlighter": "^15.5.13",
@@ -142,8 +145,8 @@
142
145
  "npm-run-all": "^4.1.5",
143
146
  "react": "^18.3.1",
144
147
  "react-dom": "^18.3.1",
145
- "react-router-dom": "^6.23.0",
146
- "rimraf": "^5.0.5"
148
+ "react-router-dom": "^6.23.1",
149
+ "rimraf": "^5.0.6"
147
150
  },
148
151
  "scripts": {
149
152
  "lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
@@ -1,72 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const jsx_runtime_1 = require("react/jsx-runtime");
18
- const material_1 = require("@mui/material");
19
- const locale_1 = require("../../../../locale");
20
- const ActionButton_1 = __importDefault(require("../../components/ActionButton"));
21
- const SocialShare_1 = require("../../components/SocialShare");
22
- function MessageActions(_a) {
23
- var { content } = _a, props = __rest(_a, ["content"]);
24
- const { t } = (0, locale_1.useLocaleContext)();
25
- const commonActionButtonsSx = {
26
- border: '0px !important',
27
- borderRadius: '4px !important',
28
- minWidth: '32px',
29
- color: 'rgba(75, 85, 99, 1)',
30
- '.MuiButton-startIcon': {
31
- marginRight: '0px !important',
32
- },
33
- };
34
- return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "column", gap: 0.5 }, props, { children: [(0, jsx_runtime_1.jsx)(ActionButton_1.default, { autoReset: true, size: "small", variant: "outlined", placement: "right",
35
- // @ts-ignore
36
- color: "black", tip: t('copyToClipboard'),
37
- // title={t('copy')}
38
- // titleSucceed={t('copied')}
39
- icon: "tabler:copy", iconSucceed: "tabler:copy-check-filled", sx: Object.assign({}, commonActionButtonsSx), onClick: () => {
40
- window.navigator.clipboard.writeText(content);
41
- } }), (0, jsx_runtime_1.jsx)(SocialShare_1.SocialShareMenu, { content: content, disableCopyLink: true, size: "small", disableRipple: true, MenuProps: {
42
- anchorOrigin: {
43
- vertical: 'center',
44
- horizontal: 'right',
45
- },
46
- transformOrigin: {
47
- vertical: 'top',
48
- horizontal: 'left',
49
- },
50
- slotProps: {
51
- paper: {
52
- sx: {
53
- ml: 1.5,
54
- mt: -2,
55
- border: 1,
56
- borderColor: 'divider',
57
- boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
58
- },
59
- },
60
- },
61
- sx: {
62
- zIndex: 9999,
63
- },
64
- }, sx: {
65
- '.MuiIconButton-root': {
66
- p: 0,
67
- },
68
- }, children: (0, jsx_runtime_1.jsx)(ActionButton_1.default, { autoReset: true, size: "small", variant: "outlined", placement: "right",
69
- // @ts-ignore
70
- color: "black", tip: t('socialShare.title'), icon: "tabler:share", iconSucceed: "tabler:share", sx: Object.assign({}, commonActionButtonsSx) }) })] })));
71
- }
72
- exports.default = MessageActions;
@@ -1,66 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { Stack } from '@mui/material';
14
- import { useLocaleContext } from '../../../../locale';
15
- import ActionButton from '../../components/ActionButton';
16
- import { SocialShareMenu } from '../../components/SocialShare';
17
- export default function MessageActions(_a) {
18
- var { content } = _a, props = __rest(_a, ["content"]);
19
- const { t } = useLocaleContext();
20
- const commonActionButtonsSx = {
21
- border: '0px !important',
22
- borderRadius: '4px !important',
23
- minWidth: '32px',
24
- color: 'rgba(75, 85, 99, 1)',
25
- '.MuiButton-startIcon': {
26
- marginRight: '0px !important',
27
- },
28
- };
29
- return (_jsxs(Stack, Object.assign({ direction: "column", gap: 0.5 }, props, { children: [_jsx(ActionButton, { autoReset: true, size: "small", variant: "outlined", placement: "right",
30
- // @ts-ignore
31
- color: "black", tip: t('copyToClipboard'),
32
- // title={t('copy')}
33
- // titleSucceed={t('copied')}
34
- icon: "tabler:copy", iconSucceed: "tabler:copy-check-filled", sx: Object.assign({}, commonActionButtonsSx), onClick: () => {
35
- window.navigator.clipboard.writeText(content);
36
- } }), _jsx(SocialShareMenu, { content: content, disableCopyLink: true, size: "small", disableRipple: true, MenuProps: {
37
- anchorOrigin: {
38
- vertical: 'center',
39
- horizontal: 'right',
40
- },
41
- transformOrigin: {
42
- vertical: 'top',
43
- horizontal: 'left',
44
- },
45
- slotProps: {
46
- paper: {
47
- sx: {
48
- ml: 1.5,
49
- mt: -2,
50
- border: 1,
51
- borderColor: 'divider',
52
- boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
53
- },
54
- },
55
- },
56
- sx: {
57
- zIndex: 9999,
58
- },
59
- }, sx: {
60
- '.MuiIconButton-root': {
61
- p: 0,
62
- },
63
- }, children: _jsx(ActionButton, { autoReset: true, size: "small", variant: "outlined", placement: "right",
64
- // @ts-ignore
65
- color: "black", tip: t('socialShare.title'), icon: "tabler:share", iconSucceed: "tabler:share", sx: Object.assign({}, commonActionButtonsSx) }) })] })));
66
- }
@@ -1,4 +0,0 @@
1
- import { StackProps } from '@mui/material';
2
- export default function MessageActions({ content, ...props }: {
3
- content: string;
4
- } & StackProps): import("react/jsx-runtime").JSX.Element;