@haluo/biz 2.0.42-next.0 → 2.0.42-next.1

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 CHANGED
@@ -4487,6 +4487,7 @@ const _sfc_main$3 = {
4487
4487
  // 话题输入处理
4488
4488
  handleTopicInput(event) {
4489
4489
  var _a;
4490
+ console.log(111);
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);
@@ -4546,6 +4548,7 @@ const _sfc_main$3 = {
4546
4548
  const selection = window.getSelection();
4547
4549
  if (selection.rangeCount === 0)
4548
4550
  return;
4551
+ console.log(333);
4549
4552
  const range = selection.getRangeAt(0);
4550
4553
  let currentNode = range.startContainer;
4551
4554
  while (currentNode && currentNode !== paragraph) {
@@ -4558,8 +4561,10 @@ const _sfc_main$3 = {
4558
4561
  const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
4559
4562
  const beforeCursor = paragraphText.substring(0, cursorPosition);
4560
4563
  const hashIndex = beforeCursor.lastIndexOf("#");
4564
+ console.log("search content", beforeCursor, beforeCursor.substring(hashIndex + 1));
4561
4565
  if (hashIndex !== -1) {
4562
4566
  const afterHash = beforeCursor.substring(hashIndex + 1).replace(/\u00A0/g, " ");
4567
+ console.log(444);
4563
4568
  if (afterHash.indexOf(" ") === -1) {
4564
4569
  if (afterHash.length <= 15) {
4565
4570
  const position = this.getCaretPosition();
@@ -4568,6 +4573,7 @@ const _sfc_main$3 = {
4568
4573
  hashIndex,
4569
4574
  cursorPosition
4570
4575
  };
4576
+ console.log(555);
4571
4577
  if (afterHash.length === 0) {
4572
4578
  this.showTopicPopover("hot", position, "", triggerInfo);
4573
4579
  } else {
@@ -4660,6 +4666,7 @@ const _sfc_main$3 = {
4660
4666
  },
4661
4667
  // 话题弹框相关方法
4662
4668
  showTopicPopover(type, position, searchKeyword = "", triggerInfo = null) {
4669
+ console.log(666);
4663
4670
  if (!this.request || !this.request.getTopic) {
4664
4671
  console.warn("话题功能需要提供 request.getTopic 方法");
4665
4672
  return;
@@ -4486,6 +4486,7 @@
4486
4486
  // 话题输入处理
4487
4487
  handleTopicInput(event) {
4488
4488
  var _a;
4489
+ console.log(111);
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);
@@ -4545,6 +4547,7 @@
4545
4547
  const selection = window.getSelection();
4546
4548
  if (selection.rangeCount === 0)
4547
4549
  return;
4550
+ console.log(333);
4548
4551
  const range = selection.getRangeAt(0);
4549
4552
  let currentNode = range.startContainer;
4550
4553
  while (currentNode && currentNode !== paragraph) {
@@ -4557,8 +4560,10 @@
4557
4560
  const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
4558
4561
  const beforeCursor = paragraphText.substring(0, cursorPosition);
4559
4562
  const hashIndex = beforeCursor.lastIndexOf("#");
4563
+ console.log("search content", beforeCursor, beforeCursor.substring(hashIndex + 1));
4560
4564
  if (hashIndex !== -1) {
4561
4565
  const afterHash = beforeCursor.substring(hashIndex + 1).replace(/\u00A0/g, " ");
4566
+ console.log(444);
4562
4567
  if (afterHash.indexOf(" ") === -1) {
4563
4568
  if (afterHash.length <= 15) {
4564
4569
  const position = this.getCaretPosition();
@@ -4567,6 +4572,7 @@
4567
4572
  hashIndex,
4568
4573
  cursorPosition
4569
4574
  };
4575
+ console.log(555);
4570
4576
  if (afterHash.length === 0) {
4571
4577
  this.showTopicPopover("hot", position, "", triggerInfo);
4572
4578
  } else {
@@ -4659,6 +4665,7 @@
4659
4665
  },
4660
4666
  // 话题弹框相关方法
4661
4667
  showTopicPopover(type, position, searchKeyword = "", triggerInfo = null) {
4668
+ console.log(666);
4662
4669
  if (!this.request || !this.request.getTopic) {
4663
4670
  console.warn("话题功能需要提供 request.getTopic 方法");
4664
4671
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@haluo/biz",
3
3
  "description": "rich text",
4
- "version": "2.0.42-next.0",
4
+ "version": "2.0.42-next.1",
5
5
  "type": "module",
6
6
  "module": "./dist/haluo-biz.js",
7
7
  "main": "./dist/haluo-biz.umd.cjs",