bunnyquery 1.5.4 → 1.5.5

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.
Files changed (2) hide show
  1. package/bunnyquery.js +17 -20
  2. package/package.json +1 -1
package/bunnyquery.js CHANGED
@@ -2214,7 +2214,7 @@ ${options.inlineContentPlaceholder}
2214
2214
  (function() {
2215
2215
  var MCP_PROD = "https://mcp.broadwayinc.computer";
2216
2216
  var MCP_DEV = "https://mcp-dev.broadwayinc.computer";
2217
- var BQ_VERSION = "1.5.4" ;
2217
+ var BQ_VERSION = "1.5.5" ;
2218
2218
  var ATTACHMENT_URL_EXPIRES_SECONDS = 600;
2219
2219
  var GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
2220
2220
  var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
@@ -3814,8 +3814,8 @@ ${options.inlineContentPlaceholder}
3814
3814
  // [{ id, name, file, status, progress, uploadedUrl, storagePath, errorMessage }]
3815
3815
  uploadingAttachments: false,
3816
3816
  attachmentWarning: "",
3817
- attachmentCapHit: false,
3818
- // true once an add hit MAX_ATTACHMENT_FILE_COUNT; blocks the composer
3817
+ attachmentCapNotice: "",
3818
+ // informational "N files not added" when an add hit MAX_ATTACHMENT_FILE_COUNT
3819
3819
  attachmentsRow: null,
3820
3820
  // .bq-attachments DOM node
3821
3821
  attachBtnEl: null,
@@ -4333,7 +4333,7 @@ ${options.inlineContentPlaceholder}
4333
4333
  var FILE_ICON_SVG = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>';
4334
4334
  var FOLDER_ICON_SVG = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>';
4335
4335
  var MAX_CHATBOX_FILE_COUNT = 20;
4336
- var MAX_ATTACHMENT_FILE_COUNT = 100;
4336
+ var MAX_ATTACHMENT_FILE_COUNT = 20;
4337
4337
  var VISIBLE_CHIP_CAP = 30;
4338
4338
  var ESTIMATED_BYTES_PER_TOKEN = 3;
4339
4339
  var ESTIMATED_PDF_BYTES_PER_TOKEN = 5e3;
@@ -4387,10 +4387,6 @@ ${options.inlineContentPlaceholder}
4387
4387
  return el ? (el.value || "").trim() : "";
4388
4388
  }
4389
4389
  function recomputeAttachmentWarning() {
4390
- if (CS.attachmentCapHit) {
4391
- CS.attachmentWarning = "You can attach up to " + MAX_ATTACHMENT_FILE_COUNT + " files per message.";
4392
- return;
4393
- }
4394
4390
  if (!currentChatInputText()) {
4395
4391
  CS.attachmentWarning = "";
4396
4392
  return;
@@ -4455,13 +4451,12 @@ ${options.inlineContentPlaceholder}
4455
4451
  remaining -= count;
4456
4452
  changed = true;
4457
4453
  });
4458
- if (dropped > 0) CS.attachmentCapHit = true;
4454
+ CS.attachmentCapNotice = dropped > 0 ? "You can attach up to " + MAX_ATTACHMENT_FILE_COUNT + " files per message. " + dropped + " file" + (dropped === 1 ? " was" : "s were") + " not added." : "";
4459
4455
  if (changed) {
4460
4456
  recomputeAttachmentWarning();
4461
4457
  renderAttachmentChips();
4462
4458
  scheduleAttachmentOverflowRecompute();
4463
4459
  } else if (dropped > 0) {
4464
- recomputeAttachmentWarning();
4465
4460
  renderAttachmentChips();
4466
4461
  }
4467
4462
  updateComposerControls();
@@ -4566,7 +4561,7 @@ ${options.inlineContentPlaceholder}
4566
4561
  return true;
4567
4562
  });
4568
4563
  CS.visibleAttachmentCount = Infinity;
4569
- CS.attachmentCapHit = false;
4564
+ CS.attachmentCapNotice = "";
4570
4565
  recomputeAttachmentWarning();
4571
4566
  renderAttachmentChips();
4572
4567
  updateComposerControls();
@@ -4585,7 +4580,7 @@ ${options.inlineContentPlaceholder}
4585
4580
  }
4586
4581
  }
4587
4582
  CS.attachments.splice(i, 1);
4588
- CS.attachmentCapHit = false;
4583
+ CS.attachmentCapNotice = "";
4589
4584
  recomputeAttachmentWarning();
4590
4585
  renderAttachmentChips();
4591
4586
  updateComposerControls();
@@ -4602,7 +4597,7 @@ ${options.inlineContentPlaceholder}
4602
4597
  });
4603
4598
  CS.attachments = [];
4604
4599
  CS.attachmentWarning = "";
4605
- CS.attachmentCapHit = false;
4600
+ CS.attachmentCapNotice = "";
4606
4601
  renderAttachmentChips();
4607
4602
  updateComposerControls();
4608
4603
  scheduleAttachmentOverflowRecompute();
@@ -4614,7 +4609,7 @@ ${options.inlineContentPlaceholder}
4614
4609
  CS.attachments.forEach(function(a) {
4615
4610
  a._abort = null;
4616
4611
  });
4617
- CS.attachmentCapHit = false;
4612
+ CS.attachmentCapNotice = "";
4618
4613
  recomputeAttachmentWarning();
4619
4614
  renderAttachmentChips();
4620
4615
  updateComposerControls();
@@ -4642,11 +4637,14 @@ ${options.inlineContentPlaceholder}
4642
4637
  var row = CS.attachmentsRow;
4643
4638
  if (!row) return;
4644
4639
  row.innerHTML = "";
4645
- if (!CS.attachments.length && !CS.attachmentWarning) {
4640
+ if (!CS.attachments.length && !CS.attachmentWarning && !CS.attachmentCapNotice) {
4646
4641
  row.style.display = "none";
4647
4642
  return;
4648
4643
  }
4649
4644
  row.style.display = "";
4645
+ if (CS.attachmentCapNotice) {
4646
+ row.appendChild(h("div", { class: "bq-attachment-warning" }, h("span", { text: CS.attachmentCapNotice })));
4647
+ }
4650
4648
  if (CS.attachmentWarning) {
4651
4649
  row.appendChild(h("div", { class: "bq-attachment-warning" }, h("span", { text: CS.attachmentWarning })));
4652
4650
  }
@@ -4731,10 +4729,9 @@ ${options.inlineContentPlaceholder}
4731
4729
  }
4732
4730
  function updateComposerControls() {
4733
4731
  var uploading = CS.uploadingAttachments;
4734
- var blocked = uploading || CS.attachmentCapHit;
4735
- if (CS.attachBtnEl) CS.attachBtnEl.disabled = blocked;
4736
- if (CS.inputEl) CS.inputEl.disabled = blocked;
4737
- if (CS.sendBtnEl) CS.sendBtnEl.disabled = blocked || !!CS.attachmentWarning;
4732
+ if (CS.attachBtnEl) CS.attachBtnEl.disabled = uploading;
4733
+ if (CS.inputEl) CS.inputEl.disabled = uploading;
4734
+ if (CS.sendBtnEl) CS.sendBtnEl.disabled = uploading || !!CS.attachmentWarning;
4738
4735
  }
4739
4736
  function onAttachInputChange(inputEl) {
4740
4737
  if (inputEl && inputEl.files && inputEl.files.length) addFilesToAttachments(inputEl.files);
@@ -5067,7 +5064,7 @@ ${options.inlineContentPlaceholder}
5067
5064
  CS.attachments = [];
5068
5065
  CS.uploadingAttachments = false;
5069
5066
  CS.attachmentWarning = "";
5070
- CS.attachmentCapHit = false;
5067
+ CS.attachmentCapNotice = "";
5071
5068
  CS.attachmentsRow = null;
5072
5069
  CS.attachBtnEl = null;
5073
5070
  CS.sendBtnEl = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunnyquery",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "Embeddable BunnyQuery AI chat widget + its framework-agnostic chat engine",
5
5
  "main": "bunnyquery.js",
6
6
  "exports": {