@aparte/core 0.27.2 → 0.27.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.
@@ -7218,7 +7218,7 @@ function el(tag, className, text) {
7218
7218
  return node;
7219
7219
  }
7220
7220
  let askSeq = 0;
7221
- function buildApprovalPanel(message, options, onChange, details) {
7221
+ function buildApprovalPanel(message, options, onChange, details, allowOther = true) {
7222
7222
  const cfg = contextConfig();
7223
7223
  const panel = el("div", "aparte-elic-panel aparte-approval-panel");
7224
7224
  const body = el("div", "aparte-elic-body");
@@ -7267,13 +7267,15 @@ function buildApprovalPanel(message, options, onChange, details) {
7267
7267
  labelled.push({ button, option });
7268
7268
  }
7269
7269
  body.appendChild(row);
7270
- const instruction = el("textarea", "aparte-approval-instruction");
7271
- instruction.rows = 1;
7272
- instruction.placeholder = cfg.t("approvalInstructionPlaceholder");
7273
- instruction.setAttribute("aria-label", cfg.t("approvalInstructionPlaceholder"));
7274
- instruction.addEventListener("input", onChange);
7275
- body.appendChild(instruction);
7276
- const typed = () => instruction.value.trim();
7270
+ const instruction = allowOther ? el("textarea", "aparte-approval-instruction") : null;
7271
+ if (instruction) {
7272
+ instruction.rows = 1;
7273
+ instruction.placeholder = cfg.t("approvalInstructionPlaceholder");
7274
+ instruction.setAttribute("aria-label", cfg.t("approvalInstructionPlaceholder"));
7275
+ instruction.addEventListener("input", onChange);
7276
+ body.appendChild(instruction);
7277
+ }
7278
+ const typed = () => instruction?.value.trim() ?? "";
7277
7279
  return {
7278
7280
  el: panel,
7279
7281
  dismiss,
@@ -7288,8 +7290,10 @@ function buildApprovalPanel(message, options, onChange, details) {
7288
7290
  relabel: () => {
7289
7291
  const now = contextConfig();
7290
7292
  const label = now.t("approvalInstructionPlaceholder");
7291
- instruction.placeholder = label;
7292
- instruction.setAttribute("aria-label", label);
7293
+ if (instruction) {
7294
+ instruction.placeholder = label;
7295
+ instruction.setAttribute("aria-label", label);
7296
+ }
7293
7297
  row.setAttribute("aria-label", now.t("approvalOptionsLabel"));
7294
7298
  if (ask) ask.textContent = askText();
7295
7299
  if (argsLabel) argsLabel.textContent = now.t("approvalArgsLabel");
@@ -9342,4 +9346,4 @@ export {
9342
9346
  collectRendererStyles as y,
9343
9347
  contentToText as z
9344
9348
  };
9345
- //# sourceMappingURL=defer-hydration-CcKxPqNM.js.map
9349
+ //# sourceMappingURL=defer-hydration-BlmPqEgs.js.map