@haluo/biz 2.0.42-next.0 → 2.0.42-next.2
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/haluo-biz.js +8 -0
- package/dist/haluo-biz.umd.cjs +8 -0
- package/package.json +1 -1
package/dist/haluo-biz.js
CHANGED
|
@@ -4487,6 +4487,7 @@ const _sfc_main$3 = {
|
|
|
4487
4487
|
// 话题输入处理
|
|
4488
4488
|
handleTopicInput(event) {
|
|
4489
4489
|
var _a;
|
|
4490
|
+
console.log(111, event.key, event);
|
|
4490
4491
|
const activeElement = document.activeElement;
|
|
4491
4492
|
if (activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA")) {
|
|
4492
4493
|
return;
|
|
@@ -4532,6 +4533,7 @@ const _sfc_main$3 = {
|
|
|
4532
4533
|
this.showTopicPopover("hot", position, "", triggerInfo);
|
|
4533
4534
|
}, 10);
|
|
4534
4535
|
} else if (this.shouldTriggerSearch(event.key)) {
|
|
4536
|
+
console.log(222);
|
|
4535
4537
|
setTimeout(() => {
|
|
4536
4538
|
this.checkAndTriggerSearch(paragraph);
|
|
4537
4539
|
}, 10);
|
|
@@ -4540,12 +4542,14 @@ const _sfc_main$3 = {
|
|
|
4540
4542
|
}
|
|
4541
4543
|
},
|
|
4542
4544
|
shouldTriggerSearch(key) {
|
|
4545
|
+
console.log(key);
|
|
4543
4546
|
return key.length === 1 || key === "Backspace" || key === "Delete";
|
|
4544
4547
|
},
|
|
4545
4548
|
checkAndTriggerSearch(paragraph) {
|
|
4546
4549
|
const selection = window.getSelection();
|
|
4547
4550
|
if (selection.rangeCount === 0)
|
|
4548
4551
|
return;
|
|
4552
|
+
console.log(333);
|
|
4549
4553
|
const range = selection.getRangeAt(0);
|
|
4550
4554
|
let currentNode = range.startContainer;
|
|
4551
4555
|
while (currentNode && currentNode !== paragraph) {
|
|
@@ -4558,8 +4562,10 @@ const _sfc_main$3 = {
|
|
|
4558
4562
|
const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
|
|
4559
4563
|
const beforeCursor = paragraphText.substring(0, cursorPosition);
|
|
4560
4564
|
const hashIndex = beforeCursor.lastIndexOf("#");
|
|
4565
|
+
console.log("search content", beforeCursor, beforeCursor.substring(hashIndex + 1));
|
|
4561
4566
|
if (hashIndex !== -1) {
|
|
4562
4567
|
const afterHash = beforeCursor.substring(hashIndex + 1).replace(/\u00A0/g, " ");
|
|
4568
|
+
console.log(444);
|
|
4563
4569
|
if (afterHash.indexOf(" ") === -1) {
|
|
4564
4570
|
if (afterHash.length <= 15) {
|
|
4565
4571
|
const position = this.getCaretPosition();
|
|
@@ -4568,6 +4574,7 @@ const _sfc_main$3 = {
|
|
|
4568
4574
|
hashIndex,
|
|
4569
4575
|
cursorPosition
|
|
4570
4576
|
};
|
|
4577
|
+
console.log(555);
|
|
4571
4578
|
if (afterHash.length === 0) {
|
|
4572
4579
|
this.showTopicPopover("hot", position, "", triggerInfo);
|
|
4573
4580
|
} else {
|
|
@@ -4660,6 +4667,7 @@ const _sfc_main$3 = {
|
|
|
4660
4667
|
},
|
|
4661
4668
|
// 话题弹框相关方法
|
|
4662
4669
|
showTopicPopover(type, position, searchKeyword = "", triggerInfo = null) {
|
|
4670
|
+
console.log(666);
|
|
4663
4671
|
if (!this.request || !this.request.getTopic) {
|
|
4664
4672
|
console.warn("话题功能需要提供 request.getTopic 方法");
|
|
4665
4673
|
return;
|
package/dist/haluo-biz.umd.cjs
CHANGED
|
@@ -4486,6 +4486,7 @@
|
|
|
4486
4486
|
// 话题输入处理
|
|
4487
4487
|
handleTopicInput(event) {
|
|
4488
4488
|
var _a;
|
|
4489
|
+
console.log(111, event.key, event);
|
|
4489
4490
|
const activeElement = document.activeElement;
|
|
4490
4491
|
if (activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA")) {
|
|
4491
4492
|
return;
|
|
@@ -4531,6 +4532,7 @@
|
|
|
4531
4532
|
this.showTopicPopover("hot", position, "", triggerInfo);
|
|
4532
4533
|
}, 10);
|
|
4533
4534
|
} else if (this.shouldTriggerSearch(event.key)) {
|
|
4535
|
+
console.log(222);
|
|
4534
4536
|
setTimeout(() => {
|
|
4535
4537
|
this.checkAndTriggerSearch(paragraph);
|
|
4536
4538
|
}, 10);
|
|
@@ -4539,12 +4541,14 @@
|
|
|
4539
4541
|
}
|
|
4540
4542
|
},
|
|
4541
4543
|
shouldTriggerSearch(key) {
|
|
4544
|
+
console.log(key);
|
|
4542
4545
|
return key.length === 1 || key === "Backspace" || key === "Delete";
|
|
4543
4546
|
},
|
|
4544
4547
|
checkAndTriggerSearch(paragraph) {
|
|
4545
4548
|
const selection = window.getSelection();
|
|
4546
4549
|
if (selection.rangeCount === 0)
|
|
4547
4550
|
return;
|
|
4551
|
+
console.log(333);
|
|
4548
4552
|
const range = selection.getRangeAt(0);
|
|
4549
4553
|
let currentNode = range.startContainer;
|
|
4550
4554
|
while (currentNode && currentNode !== paragraph) {
|
|
@@ -4557,8 +4561,10 @@
|
|
|
4557
4561
|
const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
|
|
4558
4562
|
const beforeCursor = paragraphText.substring(0, cursorPosition);
|
|
4559
4563
|
const hashIndex = beforeCursor.lastIndexOf("#");
|
|
4564
|
+
console.log("search content", beforeCursor, beforeCursor.substring(hashIndex + 1));
|
|
4560
4565
|
if (hashIndex !== -1) {
|
|
4561
4566
|
const afterHash = beforeCursor.substring(hashIndex + 1).replace(/\u00A0/g, " ");
|
|
4567
|
+
console.log(444);
|
|
4562
4568
|
if (afterHash.indexOf(" ") === -1) {
|
|
4563
4569
|
if (afterHash.length <= 15) {
|
|
4564
4570
|
const position = this.getCaretPosition();
|
|
@@ -4567,6 +4573,7 @@
|
|
|
4567
4573
|
hashIndex,
|
|
4568
4574
|
cursorPosition
|
|
4569
4575
|
};
|
|
4576
|
+
console.log(555);
|
|
4570
4577
|
if (afterHash.length === 0) {
|
|
4571
4578
|
this.showTopicPopover("hot", position, "", triggerInfo);
|
|
4572
4579
|
} else {
|
|
@@ -4659,6 +4666,7 @@
|
|
|
4659
4666
|
},
|
|
4660
4667
|
// 话题弹框相关方法
|
|
4661
4668
|
showTopicPopover(type, position, searchKeyword = "", triggerInfo = null) {
|
|
4669
|
+
console.log(666);
|
|
4662
4670
|
if (!this.request || !this.request.getTopic) {
|
|
4663
4671
|
console.warn("话题功能需要提供 request.getTopic 方法");
|
|
4664
4672
|
return;
|