@mybricks/plugin-ai 0.0.2 → 0.0.3
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.
- package/dist/_virtual/_rollupPluginBabelHelpers.js +164 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/agents/app.js +335 -0
- package/dist/agents/app.js.map +1 -0
- package/dist/agents/common.js +483 -0
- package/dist/agents/common.js.map +1 -0
- package/dist/agents/custom.js +16 -0
- package/dist/agents/custom.js.map +1 -0
- package/dist/agents/index.js +38 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/knowledges/knowledge-base.js +579 -0
- package/dist/agents/knowledges/knowledge-base.js.map +1 -0
- package/dist/agents/knowledges/knowledge-node.js +228 -0
- package/dist/agents/knowledges/knowledge-node.js.map +1 -0
- package/dist/agents/knowledges/types.js +105 -0
- package/dist/agents/knowledges/types.js.map +1 -0
- package/dist/agents/utils/config.js +229 -0
- package/dist/agents/utils/config.js.map +1 -0
- package/dist/agents/workspace/coding-manager.js +20 -0
- package/dist/agents/workspace/coding-manager.js.map +1 -0
- package/dist/agents/workspace/components-manager.js +113 -0
- package/dist/agents/workspace/components-manager.js.map +1 -0
- package/dist/agents/workspace/outline-focus.js +167 -0
- package/dist/agents/workspace/outline-focus.js.map +1 -0
- package/dist/agents/workspace/outline-info.js +430 -0
- package/dist/agents/workspace/outline-info.js.map +1 -0
- package/dist/agents/workspace/page-tree-generator.js +70 -0
- package/dist/agents/workspace/page-tree-generator.js.map +1 -0
- package/dist/agents/workspace/workspace.js +251 -0
- package/dist/agents/workspace/workspace.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/providers/component-docs-provider.js +100 -0
- package/dist/agents/workspace-by-knowledges/providers/component-docs-provider.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/providers/focus-info-provider.js +120 -0
- package/dist/agents/workspace-by-knowledges/providers/focus-info-provider.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/providers/project-info-provider.js +146 -0
- package/dist/agents/workspace-by-knowledges/providers/project-info-provider.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/test.js +242 -0
- package/dist/agents/workspace-by-knowledges/test.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/utils/components-manager.js +132 -0
- package/dist/agents/workspace-by-knowledges/utils/components-manager.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-focus.js +167 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-focus.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-info.js +430 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-info.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/workspace.js +169 -0
- package/dist/agents/workspace-by-knowledges/workspace.js.map +1 -0
- package/dist/api/cloud-components.js +85 -0
- package/dist/api/cloud-components.js.map +1 -0
- package/dist/api-record-replay/manager.js +168 -0
- package/dist/api-record-replay/manager.js.map +1 -0
- package/{src/api-record-replay/recorder.ts → dist/api-record-replay/recorder.js} +22 -32
- package/dist/api-record-replay/recorder.js.map +1 -0
- package/dist/api-record-replay/replayer.js +136 -0
- package/dist/api-record-replay/replayer.js.map +1 -0
- package/dist/components/attachments/index.js +124 -0
- package/dist/components/attachments/index.js.map +1 -0
- package/dist/components/attachments/index.less.js +8 -0
- package/dist/components/attachments/index.less.js.map +1 -0
- package/dist/components/icons/index.js +112 -0
- package/dist/components/icons/index.js.map +1 -0
- package/dist/components/icons/index.less.js +8 -0
- package/dist/components/icons/index.less.js.map +1 -0
- package/dist/components/mention/index.js +19 -0
- package/dist/components/mention/index.js.map +1 -0
- package/dist/components/mention/index.less.js +8 -0
- package/dist/components/mention/index.less.js.map +1 -0
- package/dist/components/messages/index.js +429 -0
- package/dist/components/messages/index.js.map +1 -0
- package/dist/components/messages/index.less.js +8 -0
- package/dist/components/messages/index.less.js.map +1 -0
- package/dist/components/sender/index.js +244 -0
- package/dist/components/sender/index.js.map +1 -0
- package/dist/components/sender/index.less.js +8 -0
- package/dist/components/sender/index.less.js.map +1 -0
- package/dist/context/RequestStatusTracker.js +44 -0
- package/dist/context/RequestStatusTracker.js.map +1 -0
- package/dist/context/index.js +45 -0
- package/dist/context/index.js.map +1 -0
- package/dist/data.js +4 -0
- package/dist/data.js.map +1 -0
- package/dist/index.js +306 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-ai/node_modules/style-inject/dist/style-inject.es.js +27 -0
- package/dist/plugin-ai/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/plugin-ai/package.json.js +8 -0
- package/dist/plugin-ai/package.json.js.map +1 -0
- package/dist/plugin-ai/test/index.js +206 -0
- package/dist/plugin-ai/test/index.js.map +1 -0
- package/dist/preset/createTemplates.js +29 -0
- package/dist/preset/createTemplates.js.map +1 -0
- package/dist/preset/index.js +13 -0
- package/dist/preset/index.js.map +1 -0
- package/dist/preset/prompts.js +34 -0
- package/dist/preset/prompts.js.map +1 -0
- package/{src/preset/user.ts → dist/preset/user.js} +4 -3
- package/dist/preset/user.js.map +1 -0
- package/dist/requestAsStream.js +269 -0
- package/dist/requestAsStream.js.map +1 -0
- package/dist/rxai/node_modules/idb/build/index.js +277 -0
- package/dist/rxai/node_modules/idb/build/index.js.map +1 -0
- package/dist/rxai/src/agent/base.js +16 -0
- package/dist/rxai/src/agent/base.js.map +1 -0
- package/dist/rxai/src/agent/planning.js +1076 -0
- package/dist/rxai/src/agent/planning.js.map +1 -0
- package/dist/rxai/src/agent/rxai.js +254 -0
- package/dist/rxai/src/agent/rxai.js.map +1 -0
- package/dist/rxai/src/error/base.js +39 -0
- package/dist/rxai/src/error/base.js.map +1 -0
- package/dist/rxai/src/prompt/base.js +11 -0
- package/dist/rxai/src/prompt/base.js.map +1 -0
- package/dist/rxai/src/prompt/planning.js +23 -0
- package/dist/rxai/src/prompt/planning.js.map +1 -0
- package/dist/rxai/src/prompt/tool.js +14 -0
- package/dist/rxai/src/prompt/tool.js.map +1 -0
- package/dist/rxai/src/request/request.js +123 -0
- package/dist/rxai/src/request/request.js.map +1 -0
- package/dist/rxai/src/tool/getHistoryRecords.js +65 -0
- package/dist/rxai/src/tool/getHistoryRecords.js.map +1 -0
- package/dist/rxai/src/tool/util.js +424 -0
- package/dist/rxai/src/tool/util.js.map +1 -0
- package/dist/rxai/src/utils/events.js +43 -0
- package/dist/rxai/src/utils/events.js.map +1 -0
- package/dist/rxai/src/utils/idb.js +240 -0
- package/dist/rxai/src/utils/idb.js.map +1 -0
- package/dist/rxai/src/utils/retry.js +32 -0
- package/dist/rxai/src/utils/retry.js.map +1 -0
- package/dist/rxai/src/utils/uuid.js +7 -0
- package/dist/rxai/src/utils/uuid.js.map +1 -0
- package/dist/startView/components/header/header.js +12 -0
- package/dist/startView/components/header/header.js.map +1 -0
- package/dist/startView/components/header/header.less.js +8 -0
- package/dist/startView/components/header/header.less.js.map +1 -0
- package/dist/startView/index.js +62 -0
- package/dist/startView/index.js.map +1 -0
- package/dist/startView/index.less.js +8 -0
- package/dist/startView/index.less.js.map +1 -0
- package/dist/tools/analyze-and-expand-prd.js +116 -0
- package/dist/tools/analyze-and-expand-prd.js.map +1 -0
- package/dist/tools/analyze-requirement-and-components.js +208 -0
- package/dist/tools/analyze-requirement-and-components.js.map +1 -0
- package/dist/tools/answer.js +33 -0
- package/dist/tools/answer.js.map +1 -0
- package/dist/tools/build-process.js +550 -0
- package/dist/tools/build-process.js.map +1 -0
- package/dist/tools/coding-subagent-as-tool.js +101 -0
- package/dist/tools/coding-subagent-as-tool.js.map +1 -0
- package/dist/tools/generate-ui-content.js +528 -0
- package/dist/tools/generate-ui-content.js.map +1 -0
- package/dist/tools/index.js +31 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/open-dsl.js +49 -0
- package/dist/tools/open-dsl.js.map +1 -0
- package/dist/tools/refactor-ui-content.js +292 -0
- package/dist/tools/refactor-ui-content.js.map +1 -0
- package/dist/tools/utils.js +832 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/view/components/header/header.js +59 -0
- package/dist/view/components/header/header.js.map +1 -0
- package/dist/view/components/header/header.less.js +8 -0
- package/dist/view/components/header/header.less.js.map +1 -0
- package/dist/view/index.js +184 -0
- package/dist/view/index.js.map +1 -0
- package/dist/view/index.less.js +8 -0
- package/dist/view/index.less.js.map +1 -0
- package/package.json +28 -6
- package/src/agents/app.ts +0 -301
- package/src/agents/common.ts +0 -471
- package/src/agents/custom.ts +0 -14
- package/src/agents/index.ts +0 -37
- package/src/agents/knowledges/README.md +0 -614
- package/src/agents/knowledges/SUMMARY.md +0 -527
- package/src/agents/knowledges/index.ts +0 -8
- package/src/agents/knowledges/knowledge-base.ts +0 -565
- package/src/agents/knowledges/knowledge-node.ts +0 -266
- package/src/agents/knowledges/types.ts +0 -208
- package/src/agents/utils/config.ts +0 -427
- package/src/agents/workspace/coding-manager.ts +0 -31
- package/src/agents/workspace/components-manager.ts +0 -124
- package/src/agents/workspace/outline-focus.ts +0 -188
- package/src/agents/workspace/outline-info.ts +0 -520
- package/src/agents/workspace/page-tree-generator.ts +0 -83
- package/src/agents/workspace/workspace.ts +0 -319
- package/src/agents/workspace-by-knowledges/MIGRATION.md +0 -568
- package/src/agents/workspace-by-knowledges/README.md +0 -521
- package/src/agents/workspace-by-knowledges/index.ts +0 -11
- package/src/agents/workspace-by-knowledges/providers/component-docs-provider.ts +0 -92
- package/src/agents/workspace-by-knowledges/providers/focus-info-provider.ts +0 -131
- package/src/agents/workspace-by-knowledges/providers/index.ts +0 -8
- package/src/agents/workspace-by-knowledges/providers/project-info-provider.ts +0 -151
- package/src/agents/workspace-by-knowledges/test.ts +0 -240
- package/src/agents/workspace-by-knowledges/types.ts +0 -56
- package/src/agents/workspace-by-knowledges/utils/components-manager.ts +0 -145
- package/src/agents/workspace-by-knowledges/utils/index.ts +0 -8
- package/src/agents/workspace-by-knowledges/utils/outline-focus.ts +0 -178
- package/src/agents/workspace-by-knowledges/utils/outline-info.ts +0 -521
- package/src/agents/workspace-by-knowledges/workspace.ts +0 -166
- package/src/api/cloud-components.ts +0 -129
- package/src/api-record-replay/README.md +0 -187
- package/src/api-record-replay/index.ts +0 -11
- package/src/api-record-replay/manager.ts +0 -168
- package/src/api-record-replay/replayer.ts +0 -148
- package/src/components/attachments/index.less +0 -117
- package/src/components/attachments/index.tsx +0 -136
- package/src/components/icons/index.less +0 -8
- package/src/components/icons/index.tsx +0 -44
- package/src/components/index.less +0 -34
- package/src/components/mention/index.less +0 -23
- package/src/components/mention/index.tsx +0 -19
- package/src/components/messages/index.less +0 -1013
- package/src/components/messages/index.tsx +0 -519
- package/src/components/sender/index.less +0 -203
- package/src/components/sender/index.tsx +0 -298
- package/src/components/types.ts +0 -31
- package/src/constants/index.ts +0 -8
- package/src/context/RequestStatusTracker.ts +0 -50
- package/src/context/index.ts +0 -83
- package/src/data.ts +0 -5
- package/src/global.d.ts +0 -100
- package/src/index.tsx +0 -264
- package/src/mock.ts +0 -1267
- package/src/preset/agents.ts +0 -380
- package/src/preset/createTemplates.ts +0 -25
- package/src/preset/index.ts +0 -12
- package/src/preset/prompts.ts +0 -235
- package/src/preset/requestAsStream.ts +0 -246
- package/src/startView/components/header/header.less +0 -17
- package/src/startView/components/header/header.tsx +0 -15
- package/src/startView/components/index.ts +0 -1
- package/src/startView/index.less +0 -34
- package/src/startView/index.tsx +0 -61
- package/src/tools/analyze-and-expand-prd.ts +0 -272
- package/src/tools/analyze-requirement-and-components.ts +0 -589
- package/src/tools/answer.ts +0 -59
- package/src/tools/build-process.ts +0 -1174
- package/src/tools/coding-subagent-as-tool.ts +0 -119
- package/src/tools/generate-ui-content.ts +0 -1083
- package/src/tools/index.ts +0 -28
- package/src/tools/open-dsl.ts +0 -69
- package/src/tools/refactor-ui-content.ts +0 -801
- package/src/tools/type.d.ts +0 -12
- package/src/tools/utils.ts +0 -914
- package/src/types/index.ts +0 -4
- package/src/view/components/header/header.less +0 -51
- package/src/view/components/header/header.tsx +0 -60
- package/src/view/components/index.ts +0 -1
- package/src/view/index.less +0 -5
- package/src/view/index.tsx +0 -168
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
.attachments {
|
|
2
|
-
display: flex;
|
|
3
|
-
// gap: 8px;
|
|
4
|
-
gap: 4px;
|
|
5
|
-
align-items: center;
|
|
6
|
-
|
|
7
|
-
.imageThumbnail {
|
|
8
|
-
cursor: pointer;
|
|
9
|
-
pointer-events: auto;
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
// width: 56px;
|
|
12
|
-
aspect-ratio: 1;
|
|
13
|
-
// min-width: 56px;
|
|
14
|
-
// border-radius: 8px;
|
|
15
|
-
width: 32px;
|
|
16
|
-
height: 32px;
|
|
17
|
-
border-radius: 4px;
|
|
18
|
-
// border: 1px solid rgba(0, 0, 0, .13);
|
|
19
|
-
position: relative;
|
|
20
|
-
// overflow: hidden;
|
|
21
|
-
background: #fff;
|
|
22
|
-
|
|
23
|
-
img {
|
|
24
|
-
// width: 100%;
|
|
25
|
-
// height: 100%;
|
|
26
|
-
width: 32px;
|
|
27
|
-
height: 32px;
|
|
28
|
-
display: inline-block;
|
|
29
|
-
// background-repeat: no-repeat;
|
|
30
|
-
// background-size: cover;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
// object-fit: contain;
|
|
33
|
-
// background-size: cover;
|
|
34
|
-
// background-position: center;
|
|
35
|
-
// background-repeat: no-repeat;
|
|
36
|
-
border-radius: 4px;
|
|
37
|
-
object-fit: contain;
|
|
38
|
-
outline: 1px solid rgba(0, 0, 0, 0.13);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.imageDeleteContainer {
|
|
42
|
-
visibility: hidden;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
position: absolute;
|
|
45
|
-
// top: 0;
|
|
46
|
-
// right: 0;
|
|
47
|
-
top: -4px;
|
|
48
|
-
right: -4px;
|
|
49
|
-
// padding: 4px;
|
|
50
|
-
z-index: 2;
|
|
51
|
-
|
|
52
|
-
.imageDeleteIcon {
|
|
53
|
-
width: 12px;
|
|
54
|
-
height: 12px;
|
|
55
|
-
border-radius: 50%;
|
|
56
|
-
background-color: rgba(0, 0, 0, .4);
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: center;
|
|
60
|
-
color: #ffffff;
|
|
61
|
-
|
|
62
|
-
svg {
|
|
63
|
-
width: 8px;
|
|
64
|
-
height: 8px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&:hover {
|
|
68
|
-
opacity: 0.8;
|
|
69
|
-
background-color: var(--mybricks-color-primary);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.preview {
|
|
75
|
-
z-index: 2000;
|
|
76
|
-
position: absolute;
|
|
77
|
-
width: 300px;
|
|
78
|
-
background: #fff;
|
|
79
|
-
box-shadow: 0 5px 16px -4px rgba(0, 0, 0, 0.07059);
|
|
80
|
-
padding: 10px;
|
|
81
|
-
border-radius: 8px;
|
|
82
|
-
border: 1px solid #f1f1f1;
|
|
83
|
-
visibility: hidden;
|
|
84
|
-
|
|
85
|
-
img {
|
|
86
|
-
width: 280px;
|
|
87
|
-
height: fit-content;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
&:hover {
|
|
92
|
-
.preview {
|
|
93
|
-
visibility: visible;
|
|
94
|
-
}
|
|
95
|
-
.imageDeleteContainer {
|
|
96
|
-
visibility: visible;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.preview {
|
|
103
|
-
z-index: 2000;
|
|
104
|
-
position: absolute;
|
|
105
|
-
width: 300px;
|
|
106
|
-
background: #fff;
|
|
107
|
-
box-shadow: 0 5px 16px -4px rgba(0, 0, 0, 0.07059);
|
|
108
|
-
padding: 10px;
|
|
109
|
-
border-radius: 8px;
|
|
110
|
-
border: 1px solid #f1f1f1;
|
|
111
|
-
visibility: hidden;
|
|
112
|
-
|
|
113
|
-
img {
|
|
114
|
-
width: 280px;
|
|
115
|
-
height: fit-content;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState, useMemo } from "react";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
import { Close } from "../icons";
|
|
4
|
-
import css from "./index.less";
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
|
|
7
|
-
interface Attachment {
|
|
8
|
-
type: "image";
|
|
9
|
-
content: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface AttachmentsProps {
|
|
13
|
-
attachments: Attachment[];
|
|
14
|
-
className?: string;
|
|
15
|
-
onDelete?: (index: number) => void;
|
|
16
|
-
}
|
|
17
|
-
/** 附件图片 */
|
|
18
|
-
const AttachmentsList = (props: AttachmentsProps) => {
|
|
19
|
-
const { attachments, onDelete, className } = props;
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div className={classNames(css.attachments, className)}>
|
|
23
|
-
{attachments.map((attachment, index) => {
|
|
24
|
-
return <Attachment key={index} attachment={attachment} onDelete={onDelete ? () => onDelete(index) : undefined} />
|
|
25
|
-
})}
|
|
26
|
-
</div>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { AttachmentsList };
|
|
31
|
-
|
|
32
|
-
const Attachment = (props: { attachment: Attachment, onDelete?: () => void; }) => {
|
|
33
|
-
const imgRef = useRef<HTMLImageElement>(null);
|
|
34
|
-
const previewRef = useRef<HTMLDivElement>(null);
|
|
35
|
-
const { attachment, onDelete } = props;
|
|
36
|
-
const [previewBCR, setPreviewBCR] = useState<DOMRect | null>(null);
|
|
37
|
-
const [visible, setVisible] = useState(false);
|
|
38
|
-
|
|
39
|
-
const delayedTask = useMemo(() => {
|
|
40
|
-
return new DelayedTask<[boolean]>((visible) => {
|
|
41
|
-
setVisible(visible);
|
|
42
|
-
}, 50)
|
|
43
|
-
}, [])
|
|
44
|
-
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
if (visible) {
|
|
47
|
-
if (previewBCR) {
|
|
48
|
-
const imgBcr = imgRef.current!.getBoundingClientRect();
|
|
49
|
-
|
|
50
|
-
const topSpace = imgBcr.top - 4 - previewBCR.height;
|
|
51
|
-
|
|
52
|
-
if (topSpace > 0) {
|
|
53
|
-
previewRef.current!.style.top = `${topSpace}px`;
|
|
54
|
-
} else {
|
|
55
|
-
previewRef.current!.style.top = `${imgBcr.top + imgBcr.height}px`;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (imgBcr.left + previewBCR.width > document.body.offsetWidth) {
|
|
59
|
-
previewRef.current!.style.left = `${imgBcr.left + imgBcr.width - previewBCR.width}px`
|
|
60
|
-
} else {
|
|
61
|
-
previewRef.current!.style.left = `${imgBcr.left}px`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
previewRef.current!.style.visibility = "visible";
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
previewRef.current!.style.visibility = "hidden";
|
|
68
|
-
}
|
|
69
|
-
}, [previewBCR, visible])
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<>
|
|
73
|
-
<div
|
|
74
|
-
className={css.imageThumbnail}
|
|
75
|
-
onMouseEnter={() => {
|
|
76
|
-
delayedTask.startNow(true);
|
|
77
|
-
}}
|
|
78
|
-
onMouseLeave={() => {
|
|
79
|
-
delayedTask.start(false);
|
|
80
|
-
}}
|
|
81
|
-
>
|
|
82
|
-
<img ref={imgRef} src={attachment.content} />
|
|
83
|
-
{onDelete && <div className={css.imageDeleteContainer} onClick={onDelete}>
|
|
84
|
-
<div className={css.imageDeleteIcon}>
|
|
85
|
-
<Close />
|
|
86
|
-
</div>
|
|
87
|
-
</div>}
|
|
88
|
-
</div>
|
|
89
|
-
{createPortal((
|
|
90
|
-
<div
|
|
91
|
-
ref={previewRef}
|
|
92
|
-
className={css.preview}
|
|
93
|
-
onMouseEnter={() => {
|
|
94
|
-
delayedTask.startNow(true);
|
|
95
|
-
}}
|
|
96
|
-
onMouseLeave={() => {
|
|
97
|
-
delayedTask.start(false);
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
<img src={attachment.content} onLoad={(event) => {
|
|
101
|
-
setPreviewBCR((event.target as HTMLImageElement).parentElement!.getBoundingClientRect())
|
|
102
|
-
}} />
|
|
103
|
-
</div>
|
|
104
|
-
), document.body)}
|
|
105
|
-
</>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
class DelayedTask<T extends unknown[]> {
|
|
110
|
-
private timerId: number | null = null;
|
|
111
|
-
constructor(private callback: (...args: T) => void, private delay: number) {}
|
|
112
|
-
|
|
113
|
-
start(...args: T) {
|
|
114
|
-
this.cancel();
|
|
115
|
-
this.timerId = setTimeout(() => {
|
|
116
|
-
this.callback(...args);
|
|
117
|
-
this.timerId = null;
|
|
118
|
-
}, this.delay) as unknown as number;
|
|
119
|
-
|
|
120
|
-
return this;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
cancel() {
|
|
124
|
-
if (this.timerId) {
|
|
125
|
-
clearTimeout(this.timerId);
|
|
126
|
-
this.timerId = null;
|
|
127
|
-
}
|
|
128
|
-
return this;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
startNow(...args: T) {
|
|
132
|
-
this.cancel();
|
|
133
|
-
this.callback(...args);
|
|
134
|
-
return this;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import css from "./index.less";
|
|
3
|
-
|
|
4
|
-
const ArrowUp = () => {
|
|
5
|
-
return <svg data-v-dbdac3f2="" xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 1024 1024" name="Send"><path d="M705.536 433.664a38.4 38.4 0 1 1-54.272 54.272L550.4 387.114667V729.6a38.4 38.4 0 0 1-76.8 0V387.114667l-100.864 100.821333a38.4 38.4 0 1 1-54.272-54.272l166.4-166.4a38.4 38.4 0 0 1 54.272 0l166.4 166.4z" fill="currentColor"></path></svg>
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const Attachment = () => {
|
|
9
|
-
return <svg data-v-5d21dc8d="" xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 1024 1024" name="Clip"><path d="M239.08352 319.0784a188.17024 188.17024 0 0 1 376.29952 0v0.16384l4.62848 347.62752v0.08192a112.64 112.64 0 0 1-156.0576 105.63584 112.55808 112.55808 0 0 1-68.97664-105.39008V315.14624a36.864 36.864 0 1 1 73.728 0v352.99328a38.83008 38.83008 0 1 0 77.57824 0v-0.16384l-4.58752-347.58656V320.3072a114.4832 114.4832 0 0 0-228.88448-0.4096l4.5056 347.58656a190.13632 190.13632 0 1 0 380.3136 0l0.4096-334.39744a36.864 36.864 0 1 1 73.728 0.08192l-0.4096 334.31552a263.90528 263.90528 0 0 1-450.43712 186.61376 263.86432 263.86432 0 0 1-77.29152-186.368l-4.54656-347.50464v-1.10592z" fill="currentColor"></path></svg>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Loading = () => {
|
|
13
|
-
return <svg className={css.spin} viewBox="0 0 1024 1024" focusable="false" data-icon="loading-3-quarters" fill="currentColor" aria-hidden="true"><path d="M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874c-47-47-84-101.7-109.8-162.7C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3 22.2 52.4 53.9 99.5 94.3 139.9 40.4 40.4 87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952c59.4 0 117-11.6 171.3-34.6 52.4-22.2 99.5-53.9 139.9-94.3 40.4-40.4 72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512c0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874c-47 47-101.8 83.9-162.7 109.7-63.1 26.8-130.2 40.3-199.3 40.3z"></path></svg>
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Close = () => {
|
|
17
|
-
return <svg fill-rule="evenodd" viewBox="64 64 896 896" focusable="false" data-icon="close-circle" fill="currentColor" aria-hidden="true"><path d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"></path></svg>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const Success = () => {
|
|
21
|
-
return <svg role="presentation" xmlns="http://www.w3.org/2000/svg" fill="none" version="1.1" viewBox="0 0 14 14"><path d="M12.25,7.000000238418579C12.25,9.899500238418579,9.8995,12.250000238418579,7,12.250000238418579C4.1005,12.250000238418579,1.75,9.899500238418579,1.75,7.000000238418579C1.75,4.100510238418579,4.1005,1.750000238418579,7,1.750000238418579C9.8995,1.750000238418579,12.25,4.100510238418579,12.25,7.000000238418579ZM11.08333,7.000000238418579C11.08333,4.744840238418579,9.25516,2.916670238418579,7,2.916670238418579C4.74484,2.916670238418579,2.91667,4.744840238418579,2.91667,7.000000238418579C2.91667,9.25516023841858,4.74484,11.08333023841858,7,11.08333023841858C9.25516,11.08333023841858,11.08333,9.25516023841858,11.08333,7.000000238418579ZM9.20146,6.202720238418579C9.28673,6.098500238418579,9.33333,5.9679902384185795,9.33333,5.833330238418579C9.33333,5.511170238418579,9.07217,5.250000238418579,8.75,5.250000238418579C8.575040000000001,5.250000238418579,8.4093,5.32853023841858,8.2984,5.464070238418579L6.37337,7.298400238418579L5.6624300000000005,6.587530238418579C5.55304,6.478130238418579,5.40471,6.416670238418579,5.25,6.416670238418579C4.92783,6.416670238418579,4.66667,6.677830238418579,4.66667,7.000000238418579C4.66667,7.154710238418579,4.72809,7.303090238418579,4.8377099999999995,7.412700238418579L6.00423,8.579140238418578C6.01794,8.59285023841858,6.03224,8.605870238418579,6.04724,8.61814023841858C6.29658,8.82215023841858,6.66412,8.785400238418578,6.86812,8.536060238418578L9.20146,6.202720238418579Z" fill="currentColor"></path></svg>
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const Send = () => {
|
|
25
|
-
return <svg viewBox="0 0 1024 1024" version="1.1"><path d="M24.65 399.36L965.485 7.314a29.257 29.257 0 0 1 39.643 34.085L770.78 978.87a29.257 29.257 0 0 1-47.104 15.36L520.192 824.686a29.257 29.257 0 0 0-39.424 1.828L376.393 930.816a29.257 29.257 0 0 1-49.883-20.626V689.737a29.257 29.257 0 0 1 8.557-20.7L759.515 244.59 258.414 620.47a29.257 29.257 0 0 1-36.28-0.95L17.19 448.805a29.257 29.257 0 0 1 7.46-49.445z" fill="currentColor" p-id="5126"></path></svg>
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const Delete = () => {
|
|
29
|
-
return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16298"><path d="M928.814545 405.783273a28.858182 28.858182 0 0 0 0-40.773818l-309.992727-309.992728a28.858182 28.858182 0 0 0-40.820363 0l-451.118546 451.118546a115.246545 115.246545 0 0 0 0 163.048727l244.968727 243.432727a115.432727 115.432727 0 0 0 81.221819 33.512728h370.501818a28.811636 28.811636 0 1 0 0-57.669819h-238.266182c-51.339636 0-77.079273-62.045091-40.820364-98.443636l384.325818-384.232727zM436.968727 816.174545a57.623273 57.623273 0 0 1-81.501091 0l-187.810909-187.717818a57.623273 57.623273 0 0 1 0-81.501091l115.2-115.2 269.312 269.312-115.2 115.106909z" p-id="16299" fill="currentColor"></path></svg>
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const Export = () => {
|
|
33
|
-
return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4683"><path d="M712.533333 371.2l-128 128-59.733333-59.733333 128-128L597.333333 256l-42.666666-42.666667h256v256l-42.666667-42.666666-55.466667-55.466667zM657.066667 256H768v110.933333V256h-110.933333zM298.666667 298.666667v426.666666h426.666666v-256l85.333334 85.333334v256H213.333333V213.333333h256l85.333334 85.333334H298.666667z" fill="currentColor" p-id="4684"></path></svg>
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const Chat = () => {
|
|
37
|
-
return <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5661"><path d="M767.424 130.032 256.576 130.032c-70.4 0-128 57.6-128 128l0 335.632c0 70.4 57.6 128 128 128l118.352 0 0 172.288 213.328-172.288 179.152 0c70.4 0 128-57.6 128-128L895.408 258.032C895.424 187.632 837.824 130.032 767.424 130.032zM815.424 593.664c0 26.016-21.984 48-48 48L588.272 641.664 560 641.664l-22 17.76-83.056 67.088 0-4.848 0-80-80 0-118.352 0c-26.016 0-48-21.984-48-48L208.592 258.032c0-26.016 21.984-48 48-48l510.848 0c26.016 0 48 21.984 48 48L815.44 593.664z" p-id="5662" fill="currentColor"></path><path d="M347.888 425.872m-46.608 0a2.913 2.913 0 1 0 93.216 0 2.913 2.913 0 1 0-93.216 0Z" p-id="5663" fill="currentColor"></path><path d="M512 425.872m-46.608 0a2.913 2.913 0 1 0 93.216 0 2.913 2.913 0 1 0-93.216 0Z" p-id="5664" fill="currentColor"></path><path d="M676.096 425.872m-46.608 0a2.913 2.913 0 1 0 93.216 0 2.913 2.913 0 1 0-93.216 0Z" p-id="5665" fill="currentColor"></path></svg>
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const Code = () => {
|
|
41
|
-
return <svg viewBox="0 0 1024 1024" p-id="4803"><path d="M318.578 819.2L17.067 512l301.51-307.2 45.512 45.511L96.71 512 364.09 773.689z m386.844 0l-45.51-45.511L927.288 512 659.91 250.311l45.511-45.511L1006.933 512zM540.786 221.867l55.75 11.15-113.379 569.116-55.75-11.093z" fill="currentColor" p-id="4804"></path></svg>
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { ArrowUp, Attachment, Loading, Close, Success, Send, Delete, Export, Chat, Code }
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
.scroll-bar() {
|
|
2
|
-
&::-webkit-scrollbar-thumb {
|
|
3
|
-
background-color: transparent !important;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
&:hover {
|
|
7
|
-
background: transparent; //防止没有激活
|
|
8
|
-
&::-webkit-scrollbar-thumb {
|
|
9
|
-
background-color: rgba(0, 0, 0, 0.3) !important;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.loading-shimmer {
|
|
15
|
-
-webkit-text-fill-color: transparent;
|
|
16
|
-
animation-duration: 3s;
|
|
17
|
-
animation-iteration-count: infinite;
|
|
18
|
-
animation-name: loading-shimmer;
|
|
19
|
-
background: #adadad linear-gradient(to right, #adadad 0, #1a1a1abf 40%, #1a1a1abf 60%, #adadad 100%);
|
|
20
|
-
-webkit-background-clip: text;
|
|
21
|
-
background-clip: text;
|
|
22
|
-
background-repeat: no-repeat;
|
|
23
|
-
background-size: 50% 200%;
|
|
24
|
-
display: inline-block;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@keyframes loading-shimmer {
|
|
28
|
-
0% {
|
|
29
|
-
background-position: -100% 0;
|
|
30
|
-
}
|
|
31
|
-
100% {
|
|
32
|
-
background-position: 250% 0;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.mention {
|
|
2
|
-
cursor: pointer;
|
|
3
|
-
color: var(--mybricks-color-primary);
|
|
4
|
-
font-size: 12px;
|
|
5
|
-
font-weight: 500;
|
|
6
|
-
line-height: 20px;
|
|
7
|
-
border-radius: 10px;
|
|
8
|
-
// max-width: 88px;
|
|
9
|
-
// width: fit-content;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
// white-space: nowrap;
|
|
12
|
-
// text-overflow: ellipsis;
|
|
13
|
-
height: 20px;
|
|
14
|
-
display: inline-flex;
|
|
15
|
-
max-width: 100%;
|
|
16
|
-
|
|
17
|
-
.text {
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
text-overflow: ellipsis;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
// padding: 0 5px; /* 添加内边距 */
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Mention } from "../types";
|
|
3
|
-
import css from "./index.less";
|
|
4
|
-
|
|
5
|
-
interface MentionTagProps {
|
|
6
|
-
mention: Mention
|
|
7
|
-
focusarea?: boolean;
|
|
8
|
-
onClick?: (mention: Mention) => void;
|
|
9
|
-
}
|
|
10
|
-
const MentionTag = (props: MentionTagProps) => {
|
|
11
|
-
const { mention, focusarea, onClick } = props;
|
|
12
|
-
return (
|
|
13
|
-
<div className={css.mention} onClick={() => onClick?.(mention)}>
|
|
14
|
-
<div className={css.text}>{`@${mention.title || mention.name}`}{focusarea && mention.focusArea ? `(${mention.focusArea.title || "区域"})` : ""}</div>
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { MentionTag }
|