@tellaro/tql 0.1.12 → 0.1.13

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.
@@ -629,9 +629,21 @@ function W(e) {
629
629
  return D.filter((t) => !e || t.toLowerCase().includes(e.toLowerCase())).map(
630
630
  (t, a) => {
631
631
  const i = z[t] || { detail: "Field mutator", documentation: "" };
632
+ // Check if this is an enrichment mutator that supports parameters
633
+ const isEnrichment = ENRICHMENT_MUTATORS.includes(t);
634
+ const hasParams = MUTATOR_PARAMETERS[t] && MUTATOR_PARAMETERS[t].length > 0;
635
+ // Enrichment mutators with params get () inserted, cursor inside
636
+ // Enrichment mutators without params get () inserted, cursor after
637
+ // Regular mutators get no parens
638
+ let insertText = t;
639
+ if (isEnrichment && hasParams) {
640
+ insertText = `${t}($1)`;
641
+ } else if (isEnrichment) {
642
+ insertText = `${t}()`;
643
+ }
632
644
  return {
633
645
  label: t,
634
- insertText: t,
646
+ insertText: insertText,
635
647
  kind: "mutator",
636
648
  detail: i.detail,
637
649
  documentation: i.documentation,
@@ -104,8 +104,7 @@ const U = ["id", "aria-activedescendant"], V = { class: "tql-completion-list" },
104
104
  role: "listbox",
105
105
  "aria-label": "TQL completions",
106
106
  "aria-activedescendant": o.items[e.value] ? `${o.id}-option-${e.value}` : void 0,
107
- onPointerdown: r[0] || (r[0] = A(() => {
108
- }, ["stop"]))
107
+ onPointerdown: r[0] || (r[0] = A((evt) => { evt.preventDefault(); }, ["stop", "prevent"]))
109
108
  }, [
110
109
  u("div", V, [
111
110
  (l(!0), s(I, null, K(o.items, (n, p) => (l(), s("div", {
@@ -114,7 +113,7 @@ const U = ["id", "aria-activedescendant"], V = { class: "tql-completion-list" },
114
113
  class: f(["tql-completion-item", { selected: p === e.value }]),
115
114
  role: "option",
116
115
  "aria-selected": p === e.value,
117
- onClick: (E) => a("select", n),
116
+ onClick: (E) => { E.preventDefault(); E.stopPropagation(); a("select", n); },
118
117
  onMouseenter: (E) => e.value = p
119
118
  }, [
120
119
  u("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellaro/tql",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Tellaro Query Language (TQL) parser, validator, and autocomplete for JavaScript/TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",