vite-plugin-ai-annotator 1.1.32 → 1.1.39

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.
@@ -50,6 +50,7 @@ export declare class AnnotatorToolbar extends LitElement {
50
50
  private removeSelectedElement;
51
51
  private showCommentPopoverForElement;
52
52
  private handlePopoverKeydown;
53
+ private handleClickOutside;
53
54
  private handlePopoverInputKeydown;
54
55
  private hideCommentPopover;
55
56
  private handlePopoverInput;
@@ -6744,7 +6744,7 @@
6744
6744
  document.head.appendChild(hoverKeyframesStyleElement);
6745
6745
  }
6746
6746
  const overlay = document.createElement("div");
6747
- overlay.className = "annotator-hover-overlay annotator-ignore";
6747
+ overlay.className = "annotator-hover-overlay";
6748
6748
  const rect = element.getBoundingClientRect();
6749
6749
  overlay.style.cssText = `
6750
6750
  position: fixed;
@@ -7537,6 +7537,14 @@
7537
7537
  this.hideCommentPopover();
7538
7538
  }
7539
7539
  };
7540
+ this.handleClickOutside = (e5) => {
7541
+ if (!this.commentPopover.visible) return;
7542
+ const popoverEl = this.shadowRoot?.querySelector(".popover");
7543
+ if (!popoverEl) return;
7544
+ const path = e5.composedPath();
7545
+ if (path.includes(popoverEl)) return;
7546
+ this.hideCommentPopover();
7547
+ };
7540
7548
  }
7541
7549
  connectedCallback() {
7542
7550
  super.connectedCallback();
@@ -7861,6 +7869,7 @@
7861
7869
  comment: existingComment
7862
7870
  };
7863
7871
  document.addEventListener("keydown", this.handlePopoverKeydown);
7872
+ setTimeout(() => document.addEventListener("click", this.handleClickOutside, true), 0);
7864
7873
  this.updateComplete.then(() => {
7865
7874
  const popoverEl = this.shadowRoot?.querySelector(".popover");
7866
7875
  const textareaEl = this.shadowRoot?.querySelector(".popover-input");
@@ -7900,6 +7909,7 @@
7900
7909
  }
7901
7910
  hideCommentPopover() {
7902
7911
  document.removeEventListener("keydown", this.handlePopoverKeydown);
7912
+ document.removeEventListener("click", this.handleClickOutside, true);
7903
7913
  if (this.popoverCleanup) {
7904
7914
  this.popoverCleanup();
7905
7915
  this.popoverCleanup = null;
@@ -7911,7 +7921,7 @@
7911
7921
  const comment = target.value;
7912
7922
  const element = this.commentPopover.element;
7913
7923
  target.style.height = "auto";
7914
- target.style.height = Math.min(target.scrollHeight, 37) + "px";
7924
+ target.style.height = Math.min(target.scrollHeight, 120) + "px";
7915
7925
  this.commentPopover = { ...this.commentPopover, comment };
7916
7926
  if (element) {
7917
7927
  if (comment.trim().length > 0) {
@@ -8300,6 +8310,8 @@
8300
8310
  top: 0;
8301
8311
  left: 0;
8302
8312
  z-index: 1000000;
8313
+ display: flex;
8314
+ flex-direction: column;
8303
8315
  background: var(--cyber-black);
8304
8316
  border: 2px solid var(--cyber-cyan);
8305
8317
  box-shadow: 4px 4px 0px rgba(0, 255, 255, 0.3), 0 0 30px rgba(0, 255, 255, 0.2);
@@ -8333,9 +8345,8 @@
8333
8345
 
8334
8346
  .popover-input {
8335
8347
  width: 240px;
8336
- min-height: 24px;
8337
- max-height: 37px;
8338
- padding: 10px 12px;
8348
+ max-height: 120px;
8349
+ padding: 8px 12px;
8339
8350
  border: none;
8340
8351
  background: transparent;
8341
8352
  color: var(--cyber-yellow);
@@ -8345,6 +8356,7 @@
8345
8356
  resize: none;
8346
8357
  overflow-y: auto;
8347
8358
  line-height: 1.4;
8359
+ box-sizing: border-box;
8348
8360
  }
8349
8361
 
8350
8362
  .popover-input::placeholder {
@@ -8352,20 +8364,20 @@
8352
8364
  }
8353
8365
 
8354
8366
  .popover-actions {
8355
- position: absolute;
8356
- bottom: 6px;
8357
- right: 6px;
8358
8367
  display: flex;
8359
8368
  align-items: center;
8360
- gap: 2px;
8369
+ justify-content: flex-end;
8370
+ gap: 4px;
8371
+ padding: 6px 8px;
8372
+ border-top: 1px solid rgba(0, 255, 255, 0.2);
8361
8373
  }
8362
8374
 
8363
8375
  .popover-btn {
8364
8376
  display: flex;
8365
8377
  align-items: center;
8366
8378
  justify-content: center;
8367
- width: 22px;
8368
- height: 22px;
8379
+ width: 26px;
8380
+ height: 26px;
8369
8381
  border: 1px solid rgba(0, 255, 255, 0.3);
8370
8382
  background: transparent;
8371
8383
  color: rgba(0, 255, 255, 0.6);
@@ -8386,8 +8398,8 @@
8386
8398
  }
8387
8399
 
8388
8400
  .popover-btn svg {
8389
- width: 12px;
8390
- height: 12px;
8401
+ width: 14px;
8402
+ height: 14px;
8391
8403
  }
8392
8404
 
8393
8405
  .hidden {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-ai-annotator",
3
- "version": "1.1.32",
3
+ "version": "1.1.39",
4
4
  "description": "AI-powered element annotator for Vite - Pick elements and get instant AI code modifications",
5
5
  "type": "module",
6
6
  "main": "dist/vite-plugin.js",