@blocklet/pages-kit 0.2.304 → 0.2.306

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/ActionButton.js +6 -6
  2. package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +153 -0
  3. package/lib/cjs/builtin/async/ai-runtime/index.js +5 -1
  4. package/lib/cjs/builtin/async/ai-runtime/locales/index.js +2 -0
  5. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +11 -8
  6. package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +4 -3
  7. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +38 -2
  8. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +4 -2
  9. package/lib/cjs/builtin/async/ai-runtime/state/agent.js +3 -1
  10. package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +1 -2
  11. package/lib/cjs/builtin/async/ai-runtime/utils/download-image.js +41 -0
  12. package/lib/cjs/components/CustomComponentRenderer/DevProvider.js +26 -0
  13. package/lib/cjs/components/CustomComponentRenderer/index.js +8 -5
  14. package/lib/cjs/utils/builtin.js +1 -0
  15. package/lib/cjs/utils/inject-global-components.js +5 -0
  16. package/lib/esm/builtin/async/ai-runtime/components/ActionButton.js +6 -6
  17. package/lib/esm/builtin/async/ai-runtime/components/ShareActions/index.js +124 -0
  18. package/lib/esm/builtin/async/ai-runtime/index.js +2 -0
  19. package/lib/esm/builtin/async/ai-runtime/locales/index.js +2 -0
  20. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +11 -8
  21. package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +4 -3
  22. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +39 -3
  23. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +4 -2
  24. package/lib/esm/builtin/async/ai-runtime/state/agent.js +3 -1
  25. package/lib/esm/builtin/async/ai-runtime/state/runtime.js +1 -2
  26. package/lib/esm/builtin/async/ai-runtime/utils/download-image.js +36 -0
  27. package/lib/esm/components/CustomComponentRenderer/DevProvider.js +21 -0
  28. package/lib/esm/components/CustomComponentRenderer/index.js +8 -5
  29. package/lib/esm/utils/builtin.js +1 -0
  30. package/lib/esm/utils/inject-global-components.js +2 -0
  31. package/lib/types/builtin/async/ai-runtime/components/ActionButton.d.ts +2 -1
  32. package/lib/types/builtin/async/ai-runtime/components/ShareActions/index.d.ts +2 -0
  33. package/lib/types/builtin/async/ai-runtime/index.d.ts +2 -0
  34. package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +2 -0
  35. package/lib/types/builtin/async/ai-runtime/utils/download-image.d.ts +4 -0
  36. package/lib/types/components/CustomComponentRenderer/DevProvider.d.ts +9 -0
  37. package/lib/types/components/CustomComponentRenderer/index.d.ts +1 -1
  38. package/lib/types/utils/builtin.d.ts +1 -0
  39. package/package.json +9 -6
  40. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageActions.js +0 -72
  41. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageActions.js +0 -66
  42. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageActions.d.ts +0 -4
@@ -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;