seatable-html-page-sdk 0.0.13-beta.3 → 0.0.13-beta.4

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/index.js CHANGED
@@ -4622,6 +4622,7 @@
4622
4622
  this.mouseEvents.forEach(eventType => {
4623
4623
  window.addEventListener(eventType, this._handleEvent, true);
4624
4624
  });
4625
+ this.addCommentModeStyle();
4625
4626
  }
4626
4627
  disable() {
4627
4628
  if (!this.isActive) return;
@@ -4629,6 +4630,20 @@
4629
4630
  this.mouseEvents.forEach(eventType => {
4630
4631
  window.removeEventListener(eventType, this._handleEvent, true);
4631
4632
  });
4633
+ this.removeCommentStyle();
4634
+ }
4635
+ addCommentModeStyle() {
4636
+ let style = document.getElementById('ai-comment-cursor-style');
4637
+ if (!style) {
4638
+ style = document.createElement('style');
4639
+ style.id = 'ai-comment-cursor-style';
4640
+ style.innerHTML = '* { cursor: crosshair !important; }';
4641
+ document.head.appendChild(style);
4642
+ }
4643
+ }
4644
+ removeCommentStyle() {
4645
+ const style = document.getElementById('ai-comment-cursor-style');
4646
+ if (style) style.remove();
4632
4647
  }
4633
4648
  _handleEvent(event) {
4634
4649
  if (!this.isActive) return;
@@ -4891,12 +4906,10 @@
4891
4906
  this.emitEvent(eventType, payload);
4892
4907
  } else if (type === POST_MESSAGE_TYPE.HTML_PAGE_ENABLE_COMMENT_MODE) {
4893
4908
  this.isCommentMode = true;
4894
- document.body.style.cursor = 'crosshair';
4895
4909
  this.unbindInteractiveEvents();
4896
4910
  if (this.commentModeAdapter) this.commentModeAdapter.enable();
4897
4911
  } else if (type === POST_MESSAGE_TYPE.HTML_PAGE_DISABLE_COMMENT_MODE) {
4898
4912
  this.isCommentMode = false;
4899
- document.body.style.cursor = '';
4900
4913
  if (this.commentModeAdapter) this.commentModeAdapter.disable();
4901
4914
  this.bindInteractiveEvents();
4902
4915
  } else if (type === POST_MESSAGE_TYPE.WINDOW_EVENT) {