bhd-components 0.10.36 → 0.10.38

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.
@@ -365,6 +365,43 @@
365
365
  .content_child {
366
366
  padding: 0;
367
367
  line-height: 1;
368
+ img {
369
+ width: 100%;
370
+ }
371
+ :global {
372
+ .think-block {
373
+ padding: 12px;
374
+ padding-top: 12px !important;
375
+ border-left: 1px solid rgba(0, 0, 0, 0.15);
376
+ background: rgba(0, 0, 0, 0.04);
377
+ // display: inline-block;
378
+ margin-bottom: 8px;
379
+ width: 100%;
380
+ font-weight: 400;
381
+ font-size: 12px;
382
+ line-height: 1.5;
383
+ color: rgba(0, 0, 0, 0.45);
384
+ * {
385
+ color: rgba(0, 0, 0, 0.45);
386
+ font-weight: 400;
387
+ font-size: 12px;
388
+ line-height: 150%;
389
+ }
390
+ &:not(:first-of-type, :last-of-type){
391
+ padding-top:0;
392
+ padding-bottom: 0;
393
+ }
394
+ &:first-of-type{
395
+ padding-top: 12px !important;
396
+ }
397
+ &:last-of-type{
398
+ padding-bottom: 12px !important;
399
+ }
400
+ &+.think-block{
401
+ margin-top: -8px;
402
+ }
403
+ }
404
+ }
368
405
  p{
369
406
  word-break: break-all;
370
407
  white-space: break-spaces;
@@ -436,7 +473,7 @@
436
473
  // > ul + *, > ol + * {
437
474
  // margin-top:16px;
438
475
  // }
439
- > *:not(pre){
476
+ > *:not(pre):not(:global(.think-block)){
440
477
  word-break: break-all;
441
478
  padding-top: 8px;
442
479
  padding-bottom: 8px;
@@ -2217,3 +2254,23 @@
2217
2254
  strong {
2218
2255
  font-weight: bold !important;
2219
2256
  }
2257
+
2258
+ .content_put {
2259
+ display: flex;
2260
+ padding: 4px 16px;
2261
+ margin-bottom: 8px;
2262
+ border-radius: 100px;
2263
+ background: rgba(0, 0, 0, 0.04);
2264
+ width: max-content;
2265
+ align-items: center;
2266
+ cursor: pointer;
2267
+ span {
2268
+ color: rgba(0, 0, 0, 0.65);
2269
+ font-size: 12px;
2270
+ font-weight: 400;
2271
+ line-height: 150%;
2272
+ }
2273
+ i {
2274
+ margin-left: 8px;
2275
+ }
2276
+ }
@@ -1,5 +1,9 @@
1
1
  const parseDate = (dateStr)=>{
2
- const date = new Date(dateStr); // 创建一个日期对象,表示当前时间
2
+ let date = new Date(dateStr); // 创建一个日期对象,表示当前时间
3
+ // @ts-ignore
4
+ if (date == "Invalid Date") {
5
+ date = new Date();
6
+ }
3
7
  const year = date.getFullYear().toString(); // 获取年份
4
8
  const month = String(date.getMonth() + 1).padStart(2, "0"); // 获取月份,并补齐两位数
5
9
  const day = String(date.getDate()).padStart(2, "0"); // 获取日期,并补齐两位数
@@ -254,7 +254,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
254
254
  apiRef.contentApi.addMsg({
255
255
  id: msgId,
256
256
  createTime: createTime,
257
- content: "正在输入...",
257
+ content: "正在思考...",
258
258
  location: "left",
259
259
  reference: recordObj.reference || null,
260
260
  source: null,
@@ -264,7 +264,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
264
264
  apiRef.contentApi.addMsg({
265
265
  id: msgId,
266
266
  createTime: createTime,
267
- content: "正在输入...",
267
+ content: "正在思考...",
268
268
  location: "left",
269
269
  reference: null,
270
270
  source: null,
@@ -587,8 +587,17 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
587
587
  } else {
588
588
  // 没有跨天 判断是否相隔超过10分钟
589
589
  if (timeObj.timestamp - beforeTimeObj.timestamp > 10 * 60 * 1000) {
590
- // 超过10分钟 显示 时分
591
- time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
590
+ // 超过10分钟 显示
591
+ var now = new Date();
592
+ // 当天的日期
593
+ var nowTimeStr = "".concat(now.getFullYear(), "-").concat(String(now.getMonth() + 1).padStart(2, "0"), "-").concat(String(now.getDate()).padStart(2, "0"));
594
+ if (nowTimeStr === "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day)) {
595
+ // 是当天 显示 时分
596
+ time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
597
+ } else {
598
+ // 不是当天 显示 年月日 时分
599
+ time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
600
+ }
592
601
  }
593
602
  }
594
603
  }
@@ -463,6 +463,9 @@
463
463
  padding: 8px;
464
464
  border-radius: 2px;
465
465
  background: #e7e7e7;
466
+ img {
467
+ width: 100%;
468
+ }
466
469
  p {
467
470
  color: @color-text-Secondary-Tr;
468
471
  font-size: 12px;
@@ -140,9 +140,12 @@ var getBase64Image = function(src) {
140
140
  };
141
141
  var formatDate = function(dateStr) {
142
142
  var today = new Date();
143
+ today.setHours(0, 0, 0, 0); // 将时间部分设为0,只比较日期
143
144
  var date = new Date(dateStr);
145
+ var cloneDate = new Date(dateStr);
146
+ cloneDate.setHours(0, 0, 0, 0); // 将时间部分设为0,只比较日期
144
147
  var isSameDay = today.getFullYear() === date.getFullYear() && today.getMonth() === date.getMonth() && today.getDate() === date.getDate();
145
- var dayDiff = Math.ceil((today - date) / (1000 * 60 * 60 * 24)); // 计算天数差
148
+ var dayDiff = Math.ceil((today - cloneDate) / (1000 * 60 * 60 * 24)); // 计算天数差
146
149
  // 判断当前的日期 是否于传入的日期为同一天 同一天则显示时间 不是同一天则判断是否超过一周
147
150
  // console.log(dayDiff,'dayDiffdayDiff',today,'___',date);
148
151
  if (isSameDay) {
@@ -150,7 +153,7 @@ var formatDate = function(dateStr) {
150
153
  return date.toLocaleTimeString("zh-CN", {
151
154
  hour12: false
152
155
  }).substring(0, 5);
153
- } else if (dayDiff <= 7) {
156
+ } else if (dayDiff < 7) {
154
157
  // 一周内
155
158
  return date.toLocaleString("zh-CN", {
156
159
  weekday: "short"