@juspay/svelte-ui-components 4.53.1 → 4.54.0

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.
@@ -134,15 +134,27 @@
134
134
  let slashSelected = $state(0);
135
135
  let slashList: HTMLUListElement | null = $state(null);
136
136
 
137
+ // A command opens on the first character of its name: "/model" on "/",
138
+ // "@support" on "@". Letters, digits and whitespace never trigger, so a
139
+ // plain word typed into the composer never opens the menu. Read as a whole
140
+ // code point, so an emoji trigger is never split into half a surrogate pair.
141
+ function slashTrigger(text: string): string | null {
142
+ const [first = ''] = text;
143
+ return /^[^\p{L}\p{N}\s]$/u.test(first) ? first : null;
144
+ }
145
+
137
146
  const slashMatches = $derived.by((): ChatComposerSlashCommand[] => {
138
- if (slashCommands === null || slashDismissed || !/^\/\S*$/.test(value)) {
147
+ const trigger = slashTrigger(value);
148
+ if (slashCommands === null || slashDismissed || trigger === null || /\s/.test(value)) {
139
149
  return [];
140
150
  }
141
151
  const query = value.toLowerCase();
142
152
  return slashCommands.filter(
143
153
  (command) =>
144
- command.name.toLowerCase().startsWith(query) ||
145
- (query.length > 1 && (command.description ?? '').toLowerCase().includes(query.slice(1)))
154
+ slashTrigger(command.name) === trigger &&
155
+ (command.name.toLowerCase().startsWith(query) ||
156
+ (query.length > trigger.length &&
157
+ (command.description ?? '').toLowerCase().includes(query.slice(trigger.length))))
146
158
  );
147
159
  });
148
160
  const slashArg = $derived.by(
@@ -150,8 +162,8 @@
150
162
  if (slashCommands === null || slashDismissed) {
151
163
  return null;
152
164
  }
153
- const parsed = /^(\/\S+)\s(\S*)$/.exec(value);
154
- if (parsed === null) {
165
+ const parsed = /^(\S+)\s(\S*)$/.exec(value);
166
+ if (parsed === null || slashTrigger(parsed[1] ?? '') === null) {
155
167
  return null;
156
168
  }
157
169
  const name = (parsed[1] ?? '').toLowerCase();
@@ -100,9 +100,11 @@ export type OptionalChatComposerProperties = {
100
100
  /** Test id on the status region (see `statusText`). */
101
101
  statusTestId?: string;
102
102
  /**
103
- * Opt-in slash-command menu. With commands passed, typing "/" opens a
104
- * listbox of the ones that match (name prefix, or the text after "/" found
105
- * in a description); arrows move, Tab completes, Enter picks (Enter on a
103
+ * Opt-in slash-command menu. With commands passed, typing a command's
104
+ * trigger -- the first character of its name, "/" for "/model" or "@" for
105
+ * "@support" -- opens a listbox of the commands sharing that trigger that
106
+ * match (name prefix, or the text after the trigger found in a
107
+ * description); arrows move, Tab completes, Enter picks (Enter on a
106
108
  * complete match submits), Escape dismisses -- through the shared
107
109
  * dismissible stack, so an overlay above the composer closes first. A
108
110
  * command with `choices` keeps the menu open past the space for a second
@@ -197,7 +199,11 @@ export type ChatComposerSlashCommandChoice = {
197
199
  };
198
200
  /** One entry of ChatComposer's slash-command menu. */
199
201
  export type ChatComposerSlashCommand = {
200
- /** Including the slash, e.g. "/model". */
202
+ /**
203
+ * Including its trigger character, e.g. "/model" or "@support". The first
204
+ * character opens the menu, so it must be punctuation or a symbol: a name
205
+ * starting with a letter, digit or space is never offered.
206
+ */
201
207
  name: string;
202
208
  description?: string;
203
209
  /** Shown after the name, e.g. "[model]". */
package/dist-wc/index.js CHANGED
@@ -54780,7 +54780,7 @@ function ChatComposer(e, t) {
54780
54780
  var i = sibling(n, 2);
54781
54781
  bind_this(i, (e) => set(mn, e), () => get(mn)), reset(t), template_effect(() => {
54782
54782
  set_attribute(i, "accept", mt()), i.multiple = ht();
54783
- }), delegated("change", i, Un), append(e, t);
54783
+ }), delegated("change", i, Wn), append(e, t);
54784
54784
  };
54785
54785
  if_block(n, (e) => {
54786
54786
  get(vn) && e(i);
@@ -54794,9 +54794,9 @@ function ChatComposer(e, t) {
54794
54794
  }), append(e, t);
54795
54795
  }, a = (e) => {
54796
54796
  var t = root_3$6();
54797
- remove_textarea_child(t), bind_this(t, (e) => set(hn, e), () => get(hn)), effect(() => bind_value(t, s)), action(t, (e, t) => Gn?.(e, t), s), template_effect(() => {
54798
- set_attribute(t, "data-pw", an() ?? null), set_attribute(t, "placeholder", u()), t.disabled = get(bn), set_attribute(t, "aria-label", on() ?? (u().length > 0 ? u() : "Message")), set_attribute(t, "role", jt() === null ? null : "combobox"), set_attribute(t, "aria-expanded", jt() === null ? null : get(jn)), set_attribute(t, "aria-controls", get(jn) ? Nn : null), set_attribute(t, "aria-autocomplete", jt() === null ? null : "list"), set_attribute(t, "aria-activedescendant", get(Pn)), set_attribute(t, "maxlength", k() > 0 ? k() : null);
54799
- }), delegated("input", t, Hn), event("focus", t, (e) => Ht()?.(e)), delegated("keydown", t, Vn), event("paste", t, (e) => qt()?.(e)), append(e, t);
54797
+ remove_textarea_child(t), bind_this(t, (e) => set(hn, e), () => get(hn)), effect(() => bind_value(t, s)), action(t, (e, t) => Kn?.(e, t), s), template_effect(() => {
54798
+ set_attribute(t, "data-pw", an() ?? null), set_attribute(t, "placeholder", u()), t.disabled = get(bn), set_attribute(t, "aria-label", on() ?? (u().length > 0 ? u() : "Message")), set_attribute(t, "role", jt() === null ? null : "combobox"), set_attribute(t, "aria-expanded", jt() === null ? null : get(Mn)), set_attribute(t, "aria-controls", get(Mn) ? Pn : null), set_attribute(t, "aria-autocomplete", jt() === null ? null : "list"), set_attribute(t, "aria-activedescendant", get(Fn)), set_attribute(t, "maxlength", k() > 0 ? k() : null);
54799
+ }), delegated("input", t, Un), event("focus", t, (e) => Ht()?.(e)), delegated("keydown", t, Hn), event("paste", t, (e) => qt()?.(e)), append(e, t);
54800
54800
  }, o = (e) => {
54801
54801
  var t = root_8$4(), n = first_child(t), i = (e) => {
54802
54802
  var t = root_4$5();
@@ -54900,7 +54900,7 @@ function ChatComposer(e, t) {
54900
54900
  {
54901
54901
  let e = /* @__PURE__ */ user_derived(() => !get(wn));
54902
54902
  Button(n, {
54903
- onclick: Bn,
54903
+ onclick: Vn,
54904
54904
  get disabled() {
54905
54905
  return get(e);
54906
54906
  },
@@ -54939,14 +54939,20 @@ function ChatComposer(e, t) {
54939
54939
  }), append(e, t);
54940
54940
  }, s = prop(t, "value", 15, ""), c = prop(t, "layout", 7, "row"), l = prop(t, "variant", 7, "default"), u = prop(t, "placeholder", 7, ""), f = prop(t, "disabled", 7, !1), p = prop(t, "textDisabled", 7, null), h = prop(t, "voiceDisabled", 7, null), S = prop(t, "sendDisabled", 7, null), C = prop(t, "submitOnEnter", 7, !0), k = prop(t, "maxLength", 7, 0), R = prop(t, "streaming", 7, !1), G = prop(t, "recording", 7, !1), te = prop(t, "attachments", 31, () => proxy([])), ne = prop(t, "attachmentsPreview", 7), re = prop(t, "richImages", 23, () => []), be = prop(t, "richFiles", 23, () => []), Me = prop(t, "richVideos", 23, () => []), Re = prop(t, "richImageTooltip", 7), Ue = prop(t, "richVideoTooltip", 7), it = prop(t, "richRemoveIcon", 7), at = prop(t, "richFileIcon", 7), ot = prop(t, "onremoverichimage", 7), ct = prop(t, "onremoverichfile", 7), lt = prop(t, "onremoverichvideo", 7), ut = prop(t, "onopenrichimage", 7), dt = prop(t, "onopenrichvideo", 7), ft = prop(t, "onopenrichfile", 7), pt = prop(t, "sendable", 7, null), mt = prop(t, "accept", 7, ""), ht = prop(t, "multiple", 7, !1), gt = prop(t, "sendLabel", 7, "Send message"), _t = prop(t, "stopLabel", 7, "Stop generating"), vt = prop(t, "voiceLabel", 7, "Voice input"), yt = prop(t, "attachLabel", 7, "Attach files"), bt = prop(t, "sendIcon", 7), xt = prop(t, "stopIcon", 7), St = prop(t, "voiceIcon", 7), Ct = prop(t, "attachIcon", 7), wt = prop(t, "actionIcon", 7), Tt = prop(t, "actionLabel", 7, "Voice conversation"), Et = prop(t, "actionText", 7), Dt = prop(t, "leading", 7), Ot = prop(t, "trailing", 7), kt = prop(t, "statusText", 7), At = prop(t, "statusTestId", 7), jt = prop(t, "slashCommands", 7, null), Mt = prop(t, "slashMenuAriaLabel", 7, "slash commands"), Nt = prop(t, "slashMenuHint", 7, "↑↓ move · tab complete · ↵ select · esc dismiss"), Pt = prop(t, "slashMenuClasses", 7), It = prop(t, "slashItemClasses", 7), Lt = prop(t, "slashSelectedItemClasses", 7), Rt = prop(t, "slashItem", 7), zt = prop(t, "onsubmit", 7), Bt = prop(t, "oninput", 7), Ht = prop(t, "oninputfocus", 7), Gt = prop(t, "onkeydown", 7), qt = prop(t, "onpaste", 7), Zt = prop(t, "onstop", 7), Qt = prop(t, "onvoice", 7), $t = prop(t, "oncanceldictation", 7), en = prop(t, "onattach", 7), tn = prop(t, "onattachclick", 7), nn = prop(t, "onaction", 7), rn = prop(t, "testId", 7), an = prop(t, "inputTestId", 7), on = prop(t, "inputAriaLabel", 7), sn = prop(t, "sendTestId", 7), cn = prop(t, "sendSlotTestId", 7), ln = prop(t, "stopTestId", 7), un = prop(t, "voiceTestId", 7), dn = prop(t, "attachTestId", 7), fn = prop(t, "actionTestId", 7), pn = prop(t, "classes", 7), mn = /* @__PURE__ */ state(null), hn = /* @__PURE__ */ state(null), gn = (e) => {
54941
54941
  get(hn)?.focus(e);
54942
- }, _n = /* @__PURE__ */ user_derived(() => typeof Qt() == "function"), vn = /* @__PURE__ */ user_derived(() => typeof en() == "function" || typeof tn() == "function"), yn = /* @__PURE__ */ user_derived(() => re().length > 0 || Me().length > 0 || be().length > 0), bn = /* @__PURE__ */ user_derived(() => resolveControlDisabled(p(), f())), xn = /* @__PURE__ */ user_derived(() => normalizeDictationState(G())), Sn = /* @__PURE__ */ user_derived(() => resolveControlDisabled(h(), f()) || get(xn) === "busy"), Cn = /* @__PURE__ */ user_derived(() => resolveControlDisabled(S(), f())), wn = /* @__PURE__ */ user_derived(() => !get(Cn) && (pt() ?? (s().trim().length > 0 || te().length > 0 || get(yn)))), Tn = /* @__PURE__ */ state(!1), En = /* @__PURE__ */ state(0), Dn = /* @__PURE__ */ state(null), On = /* @__PURE__ */ user_derived(() => {
54943
- if (jt() === null || get(Tn) || !/^\/\S*$/.test(s())) return [];
54944
- let e = s().toLowerCase();
54945
- return jt().filter((t) => t.name.toLowerCase().startsWith(e) || e.length > 1 && (t.description ?? "").toLowerCase().includes(e.slice(1)));
54946
- }), kn = /* @__PURE__ */ user_derived(() => {
54942
+ }, _n = /* @__PURE__ */ user_derived(() => typeof Qt() == "function"), vn = /* @__PURE__ */ user_derived(() => typeof en() == "function" || typeof tn() == "function"), yn = /* @__PURE__ */ user_derived(() => re().length > 0 || Me().length > 0 || be().length > 0), bn = /* @__PURE__ */ user_derived(() => resolveControlDisabled(p(), f())), xn = /* @__PURE__ */ user_derived(() => normalizeDictationState(G())), Sn = /* @__PURE__ */ user_derived(() => resolveControlDisabled(h(), f()) || get(xn) === "busy"), Cn = /* @__PURE__ */ user_derived(() => resolveControlDisabled(S(), f())), wn = /* @__PURE__ */ user_derived(() => !get(Cn) && (pt() ?? (s().trim().length > 0 || te().length > 0 || get(yn)))), Tn = /* @__PURE__ */ state(!1), En = /* @__PURE__ */ state(0), Dn = /* @__PURE__ */ state(null);
54943
+ function On(e) {
54944
+ let [t = ""] = e;
54945
+ return /^[^\p{L}\p{N}\s]$/u.test(t) ? t : null;
54946
+ }
54947
+ let kn = /* @__PURE__ */ user_derived(() => {
54948
+ let e = On(s());
54949
+ if (jt() === null || get(Tn) || e === null || /\s/.test(s())) return [];
54950
+ let t = s().toLowerCase();
54951
+ return jt().filter((n) => On(n.name) === e && (n.name.toLowerCase().startsWith(t) || t.length > e.length && (n.description ?? "").toLowerCase().includes(t.slice(e.length))));
54952
+ }), An = /* @__PURE__ */ user_derived(() => {
54947
54953
  if (jt() === null || get(Tn)) return null;
54948
- let e = /^(\/\S+)\s(\S*)$/.exec(s());
54949
- if (e === null) return null;
54954
+ let e = /^(\S+)\s(\S*)$/.exec(s());
54955
+ if (e === null || On(e[1] ?? "") === null) return null;
54950
54956
  let t = (e[1] ?? "").toLowerCase(), n = jt().find((e) => e.name.toLowerCase() === t && (e.choices?.length ?? 0) > 0);
54951
54957
  if (typeof n != "object") return null;
54952
54958
  let i = (e[2] ?? "").toLowerCase();
@@ -54954,35 +54960,35 @@ function ChatComposer(e, t) {
54954
54960
  command: n,
54955
54961
  choices: (n.choices ?? []).filter((e) => e.value.toLowerCase().startsWith(i))
54956
54962
  };
54957
- }), An = /* @__PURE__ */ user_derived(() => get(kn) === null ? get(On) : get(kn).choices.map((e) => typeof e.description == "string" ? {
54963
+ }), jn = /* @__PURE__ */ user_derived(() => get(An) === null ? get(kn) : get(An).choices.map((e) => typeof e.description == "string" ? {
54958
54964
  name: e.value,
54959
54965
  description: e.description
54960
- } : { name: e.value })), jn = /* @__PURE__ */ user_derived(() => get(An).length > 0), Mn = /* @__PURE__ */ user_derived(() => Math.min(get(En), Math.max(0, get(An).length - 1))), Nn = `chat-composer-slash-listbox-${n}`, Pn = /* @__PURE__ */ user_derived(() => get(jn) ? `chat-composer-slash-option-${n}-${get(Mn)}` : null);
54961
- function Fn(e) {
54962
- if (get(kn) !== null) {
54963
- let t = get(kn).choices.at(e);
54964
- return typeof t == "object" ? `${get(kn).command.name} ${t.value}` : null;
54966
+ } : { name: e.value })), Mn = /* @__PURE__ */ user_derived(() => get(jn).length > 0), Nn = /* @__PURE__ */ user_derived(() => Math.min(get(En), Math.max(0, get(jn).length - 1))), Pn = `chat-composer-slash-listbox-${n}`, Fn = /* @__PURE__ */ user_derived(() => get(Mn) ? `chat-composer-slash-option-${n}-${get(Nn)}` : null);
54967
+ function In(e) {
54968
+ if (get(An) !== null) {
54969
+ let t = get(An).choices.at(e);
54970
+ return typeof t == "object" ? `${get(An).command.name} ${t.value}` : null;
54965
54971
  }
54966
- return get(An).at(e)?.name ?? null;
54972
+ return get(jn).at(e)?.name ?? null;
54967
54973
  }
54968
- function In(e) {
54969
- if (get(kn) !== null) {
54970
- let t = get(kn).choices.at(e);
54971
- typeof t == "object" && (s(`${get(kn).command.name} ${t.value}`), set(En, 0));
54974
+ function Ln(e) {
54975
+ if (get(An) !== null) {
54976
+ let t = get(An).choices.at(e);
54977
+ typeof t == "object" && (s(`${get(An).command.name} ${t.value}`), set(En, 0));
54972
54978
  return;
54973
54979
  }
54974
- let t = get(On).at(e);
54980
+ let t = get(kn).at(e);
54975
54981
  typeof t == "object" && (s(`${t.name} `), set(Tn, (t.choices?.length ?? 0) === 0), set(En, 0));
54976
54982
  }
54977
- function Ln() {
54983
+ function Rn() {
54978
54984
  tick().then(() => {
54979
- (get(Dn)?.children.item(get(Mn)))?.scrollIntoView({ block: "nearest" });
54985
+ (get(Dn)?.children.item(get(Nn)))?.scrollIntoView({ block: "nearest" });
54980
54986
  });
54981
54987
  }
54982
- function Rn(e) {
54983
- return e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), set(En, e.key === "ArrowDown" ? Math.min(get(Mn) + 1, get(An).length - 1) : Math.max(get(Mn) - 1, 0), !0), Ln(), !0) : e.key === "Tab" && !e.shiftKey ? (e.preventDefault(), In(get(Mn)), !0) : e.key === "Enter" && !e.shiftKey && !e.isComposing ? (e.preventDefault(), s().trim() === Fn(get(Mn)) ? Bn() : In(get(Mn)), !0) : !1;
54984
- }
54985
54988
  function zn(e) {
54989
+ return e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), set(En, e.key === "ArrowDown" ? Math.min(get(Nn) + 1, get(jn).length - 1) : Math.max(get(Nn) - 1, 0), !0), Rn(), !0) : e.key === "Tab" && !e.shiftKey ? (e.preventDefault(), Ln(get(Nn)), !0) : e.key === "Enter" && !e.shiftKey && !e.isComposing ? (e.preventDefault(), s().trim() === In(get(Nn)) ? Vn() : Ln(get(Nn)), !0) : !1;
54990
+ }
54991
+ function Bn(e) {
54986
54992
  return { destroy: registerDismissible({
54987
54993
  element: () => e,
54988
54994
  onEscape: () => {
@@ -54990,7 +54996,7 @@ function ChatComposer(e, t) {
54990
54996
  }
54991
54997
  }) };
54992
54998
  }
54993
- function Bn() {
54999
+ function Vn() {
54994
55000
  if (!get(wn)) return;
54995
55001
  set(Tn, !1);
54996
55002
  let e = {
@@ -55011,26 +55017,26 @@ function ChatComposer(e, t) {
55011
55017
  attachments: te()
55012
55018
  }) && (s(""), te([]));
55013
55019
  }
55014
- function Vn(e) {
55015
- !(get(jn) && Rn(e)) && C() && e.key === "Enter" && !e.shiftKey && !e.isComposing && !R() && (e.preventDefault(), Bn()), e.key === "Escape" && get(xn) === "recording" && (e.preventDefault(), $t()?.()), Gt()?.(e);
55016
- }
55017
55020
  function Hn(e) {
55018
- set(Tn, !1), set(En, 0), Bt()?.(e.currentTarget.value, e);
55021
+ !(get(Mn) && zn(e)) && C() && e.key === "Enter" && !e.shiftKey && !e.isComposing && !R() && (e.preventDefault(), Vn()), e.key === "Escape" && get(xn) === "recording" && (e.preventDefault(), $t()?.()), Gt()?.(e);
55019
55022
  }
55020
55023
  function Un(e) {
55024
+ set(Tn, !1), set(En, 0), Bt()?.(e.currentTarget.value, e);
55025
+ }
55026
+ function Wn(e) {
55021
55027
  let t = Array.from(e.currentTarget.files ?? []);
55022
55028
  t.length > 0 && (te([...te(), ...t]), en()?.(t)), e.currentTarget.value = "";
55023
55029
  }
55024
- function Wn(e) {
55030
+ function Gn(e) {
55025
55031
  te(te().filter((t, n) => n !== e));
55026
55032
  }
55027
- let Gn = (e) => {
55033
+ let Kn = (e) => {
55028
55034
  function t() {
55029
55035
  e.style.height = "0px", e.style.height = `${e.scrollHeight}px`;
55030
55036
  }
55031
55037
  return t(), { update: t };
55032
55038
  };
55033
- var Kn = {
55039
+ var qn = {
55034
55040
  focus: gn,
55035
55041
  get value() {
55036
55042
  return s();
@@ -55470,26 +55476,26 @@ function ChatComposer(e, t) {
55470
55476
  set classes(e) {
55471
55477
  pn(e), flushSync();
55472
55478
  }
55473
- }, qn = root_19$2();
55474
- let Jn;
55475
- var Yn = child(qn), Xn = (e) => {
55479
+ }, Jn = root_19$2();
55480
+ let Yn;
55481
+ var Xn = child(Jn), Zn = (e) => {
55476
55482
  var t = root_14$2(), i = child(t);
55477
- each(i, 23, () => get(An), (e) => e.name, (e, t, i) => {
55483
+ each(i, 23, () => get(jn), (e) => e.name, (e, t, i) => {
55478
55484
  var a = root_13$2();
55479
55485
  let o;
55480
55486
  var s = child(a);
55481
55487
  {
55482
- let e = /* @__PURE__ */ user_derived(() => [It(), get(i) === get(Mn) ? Lt() : ""].filter((e) => typeof e == "string" && e.length > 0).join(" "));
55488
+ let e = /* @__PURE__ */ user_derived(() => [It(), get(i) === get(Nn) ? Lt() : ""].filter((e) => typeof e == "string" && e.length > 0).join(" "));
55483
55489
  Button(s, {
55484
55490
  type: "button",
55485
55491
  get classes() {
55486
55492
  return get(e);
55487
55493
  },
55488
- onclick: () => In(get(i)),
55494
+ onclick: () => Ln(get(i)),
55489
55495
  children: (e, n) => {
55490
55496
  var a = comment(), o = first_child(a), s = (e) => {
55491
55497
  var n = comment();
55492
- snippet(first_child(n), Rt, () => get(t), () => get(i) === get(Mn)), append(e, n);
55498
+ snippet(first_child(n), Rt, () => get(t), () => get(i) === get(Nn)), append(e, n);
55493
55499
  }, c = (e) => {
55494
55500
  var n = root_12$2(), i = first_child(n), a = child(i, !0);
55495
55501
  reset(i);
@@ -55523,30 +55529,30 @@ function ChatComposer(e, t) {
55523
55529
  });
55524
55530
  }
55525
55531
  reset(a), template_effect(() => {
55526
- set_attribute(a, "id", `chat-composer-slash-option-${n}-${get(i)}`), set_attribute(a, "aria-selected", get(i) === get(Mn)), o = set_class(a, 1, "svelte-xpd394", null, o, { "slash-item-selected-default": get(i) === get(Mn) && typeof Lt() != "string" });
55532
+ set_attribute(a, "id", `chat-composer-slash-option-${n}-${get(i)}`), set_attribute(a, "aria-selected", get(i) === get(Nn)), o = set_class(a, 1, "svelte-xpd394", null, o, { "slash-item-selected-default": get(i) === get(Nn) && typeof Lt() != "string" });
55527
55533
  }), event("mouseenter", a, () => set(En, get(i), !0)), append(e, a);
55528
55534
  }), reset(i), bind_this(i, (e) => set(Dn, e), () => get(Dn));
55529
55535
  var a = sibling(i, 2), o = child(a, !0);
55530
- reset(a), reset(t), action(t, (e) => zn?.(e)), template_effect(() => {
55531
- set_class(t, 1, `slash-menu ${Pt() ?? "" ?? ""}`, "svelte-xpd394"), set_attribute(t, "id", Nn), set_attribute(t, "aria-label", Mt()), set_text(o, Nt());
55536
+ reset(a), reset(t), action(t, (e) => Bn?.(e)), template_effect(() => {
55537
+ set_class(t, 1, `slash-menu ${Pt() ?? "" ?? ""}`, "svelte-xpd394"), set_attribute(t, "id", Pn), set_attribute(t, "aria-label", Mt()), set_text(o, Nt());
55532
55538
  }), append(e, t);
55533
55539
  };
55534
- if_block(Yn, (e) => {
55535
- get(jn) && e(Xn);
55540
+ if_block(Xn, (e) => {
55541
+ get(Mn) && e(Zn);
55536
55542
  });
55537
- var Zn = sibling(Yn, 2), Qn = (e) => {
55543
+ var Qn = sibling(Xn, 2), $n = (e) => {
55538
55544
  var t = root_15$2(), n = child(t, !0);
55539
55545
  reset(t), template_effect(() => {
55540
55546
  set_attribute(t, "data-pw", At() ?? null), set_text(n, kt());
55541
55547
  }), append(e, t);
55542
55548
  };
55543
- if_block(Zn, (e) => {
55544
- typeof kt() == "string" && e(Qn);
55549
+ if_block(Qn, (e) => {
55550
+ typeof kt() == "string" && e($n);
55545
55551
  });
55546
- var $n = sibling(Zn, 2), er = (e) => {
55552
+ var er = sibling(Qn, 2), tr = (e) => {
55547
55553
  var t = comment();
55548
55554
  snippet(first_child(t), ne), append(e, t);
55549
- }, tr = (e) => {
55555
+ }, nr = (e) => {
55550
55556
  var t = root_16$2(), n = child(t);
55551
55557
  {
55552
55558
  let e = /* @__PURE__ */ user_derived(() => rn() && `${rn()}-rich-attachments`);
@@ -55596,7 +55602,7 @@ function ChatComposer(e, t) {
55596
55602
  });
55597
55603
  }
55598
55604
  reset(t), append(e, t);
55599
- }, nr = (e) => {
55605
+ }, rr = (e) => {
55600
55606
  var t = root_17$2();
55601
55607
  each(t, 23, te, (e, t) => e.name + t, (e, t, n) => {
55602
55608
  Pill(e, {
@@ -55604,34 +55610,34 @@ function ChatComposer(e, t) {
55604
55610
  return get(t).name;
55605
55611
  },
55606
55612
  dismissible: !0,
55607
- ondismiss: () => Wn(get(n))
55613
+ ondismiss: () => Gn(get(n))
55608
55614
  });
55609
55615
  }), reset(t), append(e, t);
55610
55616
  };
55611
- if_block($n, (e) => {
55612
- typeof ne() == "function" ? e(er) : get(yn) ? e(tr, 1) : te().length > 0 && e(nr, 2);
55617
+ if_block(er, (e) => {
55618
+ typeof ne() == "function" ? e(tr) : get(yn) ? e(nr, 1) : te().length > 0 && e(rr, 2);
55613
55619
  });
55614
- var rr = sibling($n, 2);
55615
- let ir;
55616
- var ar = child(rr), or = (e) => {
55620
+ var ir = sibling(er, 2);
55621
+ let ar;
55622
+ var or = child(ir), sr = (e) => {
55617
55623
  var t = root_18$2(), n = first_child(t);
55618
55624
  a(child(n)), reset(n);
55619
55625
  var s = sibling(n, 2), c = child(s);
55620
55626
  i(c), o(sibling(c, 4)), reset(s), append(e, t);
55621
- }, sr = (e) => {
55627
+ }, cr = (e) => {
55622
55628
  var t = root_8$4(), n = first_child(t);
55623
55629
  i(n);
55624
55630
  var s = sibling(n, 2);
55625
55631
  a(s), o(sibling(s, 2)), append(e, t);
55626
55632
  };
55627
- return if_block(ar, (e) => {
55628
- c() === "stacked" ? e(or) : e(sr, -1);
55629
- }), reset(rr), reset(qn), template_effect(() => {
55630
- Jn = set_class(qn, 1, `chat-composer ${pn() ?? "" ?? ""}`, "svelte-xpd394", Jn, {
55633
+ return if_block(or, (e) => {
55634
+ c() === "stacked" ? e(sr) : e(cr, -1);
55635
+ }), reset(ir), reset(Jn), template_effect(() => {
55636
+ Yn = set_class(Jn, 1, `chat-composer ${pn() ?? "" ?? ""}`, "svelte-xpd394", Yn, {
55631
55637
  disabled: f(),
55632
55638
  pill: l() === "pill"
55633
- }), set_attribute(qn, "data-has-slash", jt() === null ? null : ""), set_attribute(qn, "data-pw", typeof rn() == "string" ? rn() : null), set_attribute(qn, "testid", typeof rn() == "string" ? rn() : null), ir = set_class(rr, 1, "input-row svelte-xpd394", null, ir, { stacked: c() === "stacked" });
55634
- }), append(e, qn), pop(Kn);
55639
+ }), set_attribute(Jn, "data-has-slash", jt() === null ? null : ""), set_attribute(Jn, "data-pw", typeof rn() == "string" ? rn() : null), set_attribute(Jn, "testid", typeof rn() == "string" ? rn() : null), ar = set_class(ir, 1, "input-row svelte-xpd394", null, ar, { stacked: c() === "stacked" });
55640
+ }), append(e, Jn), pop(qn);
55635
55641
  }
55636
55642
  delegate([
55637
55643
  "change",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "4.53.1",
3
+ "version": "4.54.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",