@object-ui/plugin-ai 17.6.0 → 17.7.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.
package/dist/index.js CHANGED
@@ -2,384 +2,399 @@ import { ComponentRegistry as e } from "@object-ui/core";
2
2
  import { useState as t } from "react";
3
3
  import { Badge as n, Button as r, Card as i, CardContent as a, CardHeader as o, CardTitle as s, Input as c } from "@object-ui/components";
4
4
  import { ArrowRight as l, Check as u, Clock as d, ExternalLink as f, Lightbulb as p, Loader2 as m, RefreshCw as h, Search as g, Sparkles as _, Star as v, Table as y, ThumbsDown as b, ThumbsUp as x, X as S } from "lucide-react";
5
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
5
+ import { createSafeTranslation as C, useDisplayLocale as w } from "@object-ui/i18n";
6
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
7
+ var O = C({
8
+ "ai.nlQuery.placeholder": "Ask a question about your data…",
9
+ "ai.nlQuery.ask": "Ask",
10
+ "ai.nlQuery.results": "Results",
11
+ "ai.nlQuery.match": "{{percent}} match",
12
+ "ai.nlQuery.simulatedSummary": "Results for: {{query}}",
13
+ "ai.nlQuery.noResults": "No matching records found",
14
+ "ai.nlQuery.recentQueries": "Recent Queries",
15
+ "ai.formAssist.title": "AI Suggestions",
16
+ "ai.formAssist.suggestionCount": "{{count}} suggestions",
17
+ "ai.formAssist.suggestionCount_one": "{{count}} suggestion",
18
+ "ai.formAssist.suggestionCount_other": "{{count}} suggestions",
19
+ "ai.formAssist.applyAll": "Apply All",
20
+ "ai.formAssist.confidence": "{{percent}} confidence",
21
+ "ai.formAssist.appliedCount": "{{count}} suggestions applied",
22
+ "ai.formAssist.appliedCount_one": "{{count}} suggestion applied",
23
+ "ai.formAssist.appliedCount_other": "{{count}} suggestions applied",
24
+ "ai.recommendations.title": "Recommendations",
25
+ "ai.recommendations.generating": "Generating recommendations…",
26
+ "ai.recommendations.empty": "No recommendations available"
27
+ }, "ai.nlQuery.ask");
28
+ function k(e, t) {
29
+ return new Intl.NumberFormat(t, {
30
+ style: "percent",
31
+ maximumFractionDigits: 0
32
+ }).format(e);
33
+ }
34
+ //#endregion
6
35
  //#region src/AIFormAssist.tsx
7
- var E = ({ schema: e, onApply: c, onRefresh: l }) => {
8
- let { suggestions: d = [], showConfidence: f = !0, showReasoning: m = !1, autoFill: g = !1 } = e, [v, y] = t(d), [b, x] = t(/* @__PURE__ */ new Set()), [C, E] = t(!1), [D, O] = t(!1), k = (e) => {
9
- c?.(e), x((t) => new Set(t).add(e.fieldName));
10
- }, A = () => {
11
- v.forEach((e) => c?.(e)), x(new Set(v.map((e) => e.fieldName)));
12
- }, j = (e) => {
13
- y((t) => t.filter((t) => t.fieldName !== e));
14
- }, M = () => {
15
- O(!0), l && l(), setTimeout(() => O(!1), 1e3);
36
+ var A = ({ schema: e, onApply: c, onRefresh: l }) => {
37
+ let { t: d } = O(), f = w(), { suggestions: m = [], showConfidence: g = !0, showReasoning: v = !1 } = e, [y, b] = t(m), [x, C] = t(/* @__PURE__ */ new Set()), [T, A] = t(!1), [j, M] = t(!1), N = (e) => {
38
+ c?.(e), C((t) => new Set(t).add(e.fieldName));
39
+ }, P = () => {
40
+ y.forEach((e) => c?.(e)), C(new Set(y.map((e) => e.fieldName)));
41
+ }, F = (e) => {
42
+ b((t) => t.filter((t) => t.fieldName !== e));
43
+ }, I = () => {
44
+ M(!0), l && l(), setTimeout(() => M(!1), 1e3);
16
45
  };
17
- if (C || v.length === 0) return null;
18
- let N = v.filter((e) => !b.has(e.fieldName)), P = (e) => e >= .8 ? "text-green-600" : e >= .5 ? "text-yellow-600" : "text-red-600";
19
- return /* @__PURE__ */ T(i, {
46
+ if (T || y.length === 0) return null;
47
+ let L = y.filter((e) => !x.has(e.fieldName)), R = (e) => e >= .8 ? "text-green-600" : e >= .5 ? "text-yellow-600" : "text-red-600";
48
+ return /* @__PURE__ */ D(i, {
20
49
  className: "border-blue-200 bg-blue-50/30",
21
- children: [/* @__PURE__ */ w(o, {
50
+ children: [/* @__PURE__ */ E(o, {
22
51
  className: "pb-2",
23
- children: /* @__PURE__ */ T("div", {
52
+ children: /* @__PURE__ */ D("div", {
24
53
  className: "flex items-center justify-between",
25
- children: [/* @__PURE__ */ T(s, {
54
+ children: [/* @__PURE__ */ D(s, {
26
55
  className: "text-sm flex items-center gap-2",
27
56
  children: [
28
- /* @__PURE__ */ w(_, { className: "h-4 w-4 text-blue-500" }),
29
- "AI Suggestions",
30
- /* @__PURE__ */ T(n, {
57
+ /* @__PURE__ */ E(_, { className: "h-4 w-4 text-blue-500" }),
58
+ d("ai.formAssist.title"),
59
+ /* @__PURE__ */ E(n, {
31
60
  variant: "secondary",
32
61
  className: "text-xs",
33
- children: [
34
- N.length,
35
- " suggestion",
36
- N.length === 1 ? "" : "s"
37
- ]
62
+ children: d("ai.formAssist.suggestionCount", { count: L.length })
38
63
  })
39
64
  ]
40
- }), /* @__PURE__ */ T("div", {
65
+ }), /* @__PURE__ */ D("div", {
41
66
  className: "flex items-center gap-1",
42
67
  children: [
43
- /* @__PURE__ */ w(r, {
68
+ /* @__PURE__ */ E(r, {
44
69
  variant: "ghost",
45
70
  size: "sm",
46
- onClick: M,
47
- disabled: D,
71
+ onClick: I,
72
+ disabled: j,
48
73
  className: "h-7",
49
- children: /* @__PURE__ */ w(h, { className: `h-3 w-3 ${D ? "animate-spin" : ""}` })
74
+ children: /* @__PURE__ */ E(h, { className: `h-3 w-3 ${j ? "animate-spin" : ""}` })
50
75
  }),
51
- N.length > 1 && /* @__PURE__ */ w(r, {
76
+ L.length > 1 && /* @__PURE__ */ E(r, {
52
77
  variant: "outline",
53
78
  size: "sm",
54
- onClick: A,
79
+ onClick: P,
55
80
  className: "h-7 text-xs",
56
- children: "Apply All"
81
+ children: d("ai.formAssist.applyAll")
57
82
  }),
58
- /* @__PURE__ */ w(r, {
83
+ /* @__PURE__ */ E(r, {
59
84
  variant: "ghost",
60
85
  size: "sm",
61
- onClick: () => E(!0),
86
+ onClick: () => A(!0),
62
87
  className: "h-7",
63
- children: /* @__PURE__ */ w(S, { className: "h-3 w-3" })
88
+ children: /* @__PURE__ */ E(S, { className: "h-3 w-3" })
64
89
  })
65
90
  ]
66
91
  })]
67
92
  })
68
- }), /* @__PURE__ */ T(a, {
93
+ }), /* @__PURE__ */ D(a, {
69
94
  className: "space-y-2 pt-0",
70
- children: [N.map((e) => /* @__PURE__ */ T("div", {
95
+ children: [L.map((e) => /* @__PURE__ */ D("div", {
71
96
  className: "flex items-center gap-3 p-2 rounded-md bg-white border text-sm",
72
97
  children: [
73
- /* @__PURE__ */ w(p, { className: "h-4 w-4 text-yellow-500 shrink-0" }),
74
- /* @__PURE__ */ T("div", {
98
+ /* @__PURE__ */ E(p, { className: "h-4 w-4 text-yellow-500 shrink-0" }),
99
+ /* @__PURE__ */ D("div", {
75
100
  className: "flex-1 min-w-0",
76
101
  children: [
77
- /* @__PURE__ */ T("div", {
102
+ /* @__PURE__ */ D("div", {
78
103
  className: "flex items-center gap-2",
79
104
  children: [
80
- /* @__PURE__ */ w("span", {
105
+ /* @__PURE__ */ E("span", {
81
106
  className: "font-medium",
82
107
  children: e.fieldName
83
108
  }),
84
- /* @__PURE__ */ w("span", {
109
+ /* @__PURE__ */ E("span", {
85
110
  className: "text-muted-foreground",
86
111
  children: "→"
87
112
  }),
88
- /* @__PURE__ */ w("span", {
113
+ /* @__PURE__ */ E("span", {
89
114
  className: "font-mono text-blue-600 truncate",
90
115
  children: typeof e.value == "object" ? JSON.stringify(e.value) : String(e.value)
91
116
  })
92
117
  ]
93
118
  }),
94
- f && /* @__PURE__ */ T("div", {
95
- className: `text-xs ${P(e.confidence)}`,
96
- children: [Math.round(e.confidence * 100), "% confidence"]
119
+ g && /* @__PURE__ */ E("div", {
120
+ className: `text-xs ${R(e.confidence)}`,
121
+ children: d("ai.formAssist.confidence", { percent: k(e.confidence, f) })
97
122
  }),
98
- m && e.reasoning && /* @__PURE__ */ w("div", {
123
+ v && e.reasoning && /* @__PURE__ */ E("div", {
99
124
  className: "text-xs text-muted-foreground mt-1",
100
125
  children: e.reasoning
101
126
  })
102
127
  ]
103
128
  }),
104
- /* @__PURE__ */ T("div", {
129
+ /* @__PURE__ */ D("div", {
105
130
  className: "flex items-center gap-1 shrink-0",
106
- children: [/* @__PURE__ */ w(r, {
131
+ children: [/* @__PURE__ */ E(r, {
107
132
  variant: "ghost",
108
133
  size: "sm",
109
134
  className: "h-7 w-7 p-0 text-green-600 hover:text-green-700 hover:bg-green-50",
110
- onClick: () => k(e),
111
- children: /* @__PURE__ */ w(u, { className: "h-3.5 w-3.5" })
112
- }), /* @__PURE__ */ w(r, {
135
+ onClick: () => N(e),
136
+ children: /* @__PURE__ */ E(u, { className: "h-3.5 w-3.5" })
137
+ }), /* @__PURE__ */ E(r, {
113
138
  variant: "ghost",
114
139
  size: "sm",
115
140
  className: "h-7 w-7 p-0 text-red-500 hover:text-red-700 hover:bg-red-50",
116
- onClick: () => j(e.fieldName),
117
- children: /* @__PURE__ */ w(S, { className: "h-3.5 w-3.5" })
141
+ onClick: () => F(e.fieldName),
142
+ children: /* @__PURE__ */ E(S, { className: "h-3.5 w-3.5" })
118
143
  })]
119
144
  })
120
145
  ]
121
- }, e.fieldName)), b.size > 0 && /* @__PURE__ */ T("div", {
146
+ }, e.fieldName)), x.size > 0 && /* @__PURE__ */ D("div", {
122
147
  className: "text-xs text-green-600 flex items-center gap-1 pt-1",
123
- children: [
124
- /* @__PURE__ */ w(u, { className: "h-3 w-3" }),
125
- b.size,
126
- " suggestion",
127
- b.size === 1 ? "" : "s",
128
- " applied"
129
- ]
148
+ children: [/* @__PURE__ */ E(u, { className: "h-3 w-3" }), d("ai.formAssist.appliedCount", { count: x.size })]
130
149
  })]
131
150
  })]
132
151
  });
133
- }, D = ({ schema: e, onSelect: t, onDismiss: c }) => {
134
- let { recommendations: l = [], showScores: u = !1, layout: d = "list", loading: p = !1, emptyMessage: m = "No recommendations available" } = e, h = (e) => {
152
+ }, j = ({ schema: e, onSelect: t, onDismiss: c }) => {
153
+ let { t: l } = O(), u = w(), { recommendations: d = [], showScores: p = !1, layout: m = "list", loading: h = !1, emptyMessage: g = l("ai.recommendations.empty") } = e, y = (e) => {
135
154
  t?.(e);
136
- }, g = (e) => {
155
+ }, C = (e) => {
137
156
  c?.(e);
138
157
  };
139
- if (p) return /* @__PURE__ */ w(i, { children: /* @__PURE__ */ T(a, {
158
+ if (h) return /* @__PURE__ */ E(i, { children: /* @__PURE__ */ D(a, {
140
159
  className: "p-8 text-center",
141
- children: [/* @__PURE__ */ w(_, { className: "h-8 w-8 text-blue-500 mx-auto mb-3 animate-pulse" }), /* @__PURE__ */ w("p", {
160
+ children: [/* @__PURE__ */ E(_, { className: "h-8 w-8 text-blue-500 mx-auto mb-3 animate-pulse" }), /* @__PURE__ */ E("p", {
142
161
  className: "text-sm text-muted-foreground",
143
- children: "Generating recommendations..."
162
+ children: l("ai.recommendations.generating")
144
163
  })]
145
164
  }) });
146
- if (l.length === 0) return /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(a, {
165
+ if (d.length === 0) return /* @__PURE__ */ E(i, { children: /* @__PURE__ */ E(a, {
147
166
  className: "p-8 text-center text-muted-foreground",
148
- children: m
167
+ children: g
149
168
  }) });
150
- let y = (e) => {
151
- if (!u) return null;
152
- let t = Math.round(e * 100);
153
- return /* @__PURE__ */ T(n, {
154
- variant: e >= .7 ? "default" : e >= .4 ? "secondary" : "outline",
155
- className: "text-xs",
156
- children: [t, "%"]
157
- });
158
- };
159
- return /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(o, { children: /* @__PURE__ */ T(s, {
169
+ let T = (e) => p ? /* @__PURE__ */ E(n, {
170
+ variant: e >= .7 ? "default" : e >= .4 ? "secondary" : "outline",
171
+ className: "text-xs",
172
+ children: k(e, u)
173
+ }) : null;
174
+ return /* @__PURE__ */ D(i, { children: [/* @__PURE__ */ E(o, { children: /* @__PURE__ */ D(s, {
160
175
  className: "flex items-center gap-2 text-sm",
161
176
  children: [
162
- /* @__PURE__ */ w(_, { className: "h-4 w-4 text-blue-500" }),
163
- "Recommendations",
164
- /* @__PURE__ */ w(n, {
177
+ /* @__PURE__ */ E(_, { className: "h-4 w-4 text-blue-500" }),
178
+ l("ai.recommendations.title"),
179
+ /* @__PURE__ */ E(n, {
165
180
  variant: "secondary",
166
181
  className: "text-xs",
167
- children: l.length
182
+ children: d.length
168
183
  })
169
184
  ]
170
- }) }), /* @__PURE__ */ w(a, { children: d === "grid" ? /* @__PURE__ */ w("div", {
185
+ }) }), /* @__PURE__ */ E(a, { children: m === "grid" ? /* @__PURE__ */ E("div", {
171
186
  className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",
172
- children: l.map((e) => /* @__PURE__ */ w(i, {
187
+ children: d.map((e) => /* @__PURE__ */ E(i, {
173
188
  className: "cursor-pointer hover:shadow-md transition-shadow",
174
- onClick: () => h(e),
175
- children: /* @__PURE__ */ T(a, {
189
+ onClick: () => y(e),
190
+ children: /* @__PURE__ */ D(a, {
176
191
  className: "p-4",
177
192
  children: [
178
- /* @__PURE__ */ T("div", {
193
+ /* @__PURE__ */ D("div", {
179
194
  className: "flex items-start justify-between mb-2",
180
- children: [/* @__PURE__ */ w(v, { className: "h-4 w-4 text-yellow-500" }), y(e.score)]
195
+ children: [/* @__PURE__ */ E(v, { className: "h-4 w-4 text-yellow-500" }), T(e.score)]
181
196
  }),
182
- /* @__PURE__ */ w("h4", {
197
+ /* @__PURE__ */ E("h4", {
183
198
  className: "font-medium text-sm mb-1",
184
199
  children: e.title
185
200
  }),
186
- e.description && /* @__PURE__ */ w("p", {
201
+ e.description && /* @__PURE__ */ E("p", {
187
202
  className: "text-xs text-muted-foreground line-clamp-3",
188
203
  children: e.description
189
204
  }),
190
- e.category && /* @__PURE__ */ w(n, {
205
+ e.category && /* @__PURE__ */ E(n, {
191
206
  variant: "outline",
192
207
  className: "text-xs mt-2",
193
208
  children: e.category
194
209
  }),
195
- /* @__PURE__ */ T("div", {
210
+ /* @__PURE__ */ D("div", {
196
211
  className: "flex items-center gap-1 mt-3",
197
- children: [/* @__PURE__ */ w(r, {
212
+ children: [/* @__PURE__ */ E(r, {
198
213
  variant: "ghost",
199
214
  size: "sm",
200
215
  className: "h-6 w-6 p-0 text-green-600",
201
- children: /* @__PURE__ */ w(x, { className: "h-3 w-3" })
202
- }), /* @__PURE__ */ w(r, {
216
+ children: /* @__PURE__ */ E(x, { className: "h-3 w-3" })
217
+ }), /* @__PURE__ */ E(r, {
203
218
  variant: "ghost",
204
219
  size: "sm",
205
220
  className: "h-6 w-6 p-0 text-red-500",
206
- children: /* @__PURE__ */ w(b, { className: "h-3 w-3" })
221
+ children: /* @__PURE__ */ E(b, { className: "h-3 w-3" })
207
222
  })]
208
223
  })
209
224
  ]
210
225
  })
211
226
  }, e.id))
212
- }) : /* @__PURE__ */ w("div", {
227
+ }) : /* @__PURE__ */ E("div", {
213
228
  className: "space-y-2",
214
- children: l.map((e) => /* @__PURE__ */ T("div", {
229
+ children: d.map((e) => /* @__PURE__ */ D("div", {
215
230
  className: "flex items-start gap-3 p-3 rounded-lg border hover:bg-muted/30 transition-colors cursor-pointer",
216
- onClick: () => h(e),
231
+ onClick: () => y(e),
217
232
  children: [
218
- /* @__PURE__ */ w("div", {
233
+ /* @__PURE__ */ E("div", {
219
234
  className: "mt-1 shrink-0",
220
- children: /* @__PURE__ */ w(v, { className: "h-4 w-4 text-yellow-500" })
235
+ children: /* @__PURE__ */ E(v, { className: "h-4 w-4 text-yellow-500" })
221
236
  }),
222
- /* @__PURE__ */ T("div", {
237
+ /* @__PURE__ */ D("div", {
223
238
  className: "flex-1 min-w-0",
224
- children: [/* @__PURE__ */ T("div", {
239
+ children: [/* @__PURE__ */ D("div", {
225
240
  className: "flex items-center gap-2 mb-1",
226
241
  children: [
227
- /* @__PURE__ */ w("span", {
242
+ /* @__PURE__ */ E("span", {
228
243
  className: "font-medium text-sm",
229
244
  children: e.title
230
245
  }),
231
- e.category && /* @__PURE__ */ w(n, {
246
+ e.category && /* @__PURE__ */ E(n, {
232
247
  variant: "outline",
233
248
  className: "text-xs",
234
249
  children: e.category
235
250
  }),
236
- y(e.score)
251
+ T(e.score)
237
252
  ]
238
- }), e.description && /* @__PURE__ */ w("p", {
253
+ }), e.description && /* @__PURE__ */ E("p", {
239
254
  className: "text-xs text-muted-foreground line-clamp-2",
240
255
  children: e.description
241
256
  })]
242
257
  }),
243
- /* @__PURE__ */ T("div", {
258
+ /* @__PURE__ */ D("div", {
244
259
  className: "flex items-center gap-1 shrink-0",
245
- children: [e.action && /* @__PURE__ */ w(r, {
260
+ children: [e.action && /* @__PURE__ */ E(r, {
246
261
  variant: "ghost",
247
262
  size: "sm",
248
263
  className: "h-7 w-7 p-0",
249
- children: /* @__PURE__ */ w(f, { className: "h-3.5 w-3.5" })
250
- }), /* @__PURE__ */ w(r, {
264
+ children: /* @__PURE__ */ E(f, { className: "h-3.5 w-3.5" })
265
+ }), /* @__PURE__ */ E(r, {
251
266
  variant: "ghost",
252
267
  size: "sm",
253
268
  className: "h-7 w-7 p-0 text-muted-foreground",
254
269
  onClick: (t) => {
255
- t.stopPropagation(), g(e);
270
+ t.stopPropagation(), C(e);
256
271
  },
257
- children: /* @__PURE__ */ w(S, { className: "h-3.5 w-3.5" })
272
+ children: /* @__PURE__ */ E(S, { className: "h-3.5 w-3.5" })
258
273
  })]
259
274
  })
260
275
  ]
261
276
  }, e.id))
262
277
  }) })] });
263
- }, O = ({ schema: e, onSubmit: u }) => {
264
- let { placeholder: f = "Ask a question about your data...", result: p, suggestions: h = [], showHistory: v = !1, history: b = [], loading: x = !1 } = e, [S, E] = t(""), [D, O] = t(p), [k, A] = t(!1), j = k || x, M = (e) => {
265
- let t = e || S;
266
- t.trim() && (A(!0), u?.(t), u ? A(!1) : setTimeout(() => {
267
- O({
278
+ }, M = ({ schema: e, onSubmit: u }) => {
279
+ let { t: f } = O(), p = w(), { placeholder: h = f("ai.nlQuery.placeholder"), result: v, suggestions: b = [], showHistory: x = !1, history: S = [], loading: C = !1 } = e, [A, j] = t(""), [M, N] = t(v), [P, F] = t(!1), I = P || C, L = (e) => {
280
+ let t = e || A;
281
+ t.trim() && (F(!0), u?.(t), u ? F(!1) : setTimeout(() => {
282
+ N({
268
283
  query: t,
269
- summary: `Results for: "${t}"`,
284
+ summary: f("ai.nlQuery.simulatedSummary", { query: t }),
270
285
  confidence: .85,
271
286
  data: [],
272
287
  columns: []
273
- }), A(!1);
288
+ }), F(!1);
274
289
  }, 1e3));
275
- }, N = (e) => {
276
- E(e), M(e);
290
+ }, R = (e) => {
291
+ j(e), L(e);
277
292
  };
278
- return /* @__PURE__ */ T("div", {
293
+ return /* @__PURE__ */ D("div", {
279
294
  className: "space-y-4",
280
295
  children: [
281
- /* @__PURE__ */ w(i, { children: /* @__PURE__ */ T(a, {
296
+ /* @__PURE__ */ E(i, { children: /* @__PURE__ */ D(a, {
282
297
  className: "p-4",
283
- children: [/* @__PURE__ */ w("div", {
298
+ children: [/* @__PURE__ */ E("div", {
284
299
  className: "flex items-center gap-2",
285
- children: /* @__PURE__ */ T("div", {
300
+ children: /* @__PURE__ */ D("div", {
286
301
  className: "relative flex-1",
287
302
  children: [
288
- /* @__PURE__ */ w(g, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
289
- /* @__PURE__ */ w(c, {
290
- value: S,
291
- onChange: (e) => E(e.target.value),
292
- onKeyDown: (e) => e.key === "Enter" && M(),
293
- placeholder: f,
303
+ /* @__PURE__ */ E(g, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
304
+ /* @__PURE__ */ E(c, {
305
+ value: A,
306
+ onChange: (e) => j(e.target.value),
307
+ onKeyDown: (e) => e.key === "Enter" && L(),
308
+ placeholder: h,
294
309
  className: "pl-10 pr-20",
295
- disabled: j
310
+ disabled: I
296
311
  }),
297
- /* @__PURE__ */ w("div", {
312
+ /* @__PURE__ */ E("div", {
298
313
  className: "absolute right-2 top-1/2 -translate-y-1/2",
299
- children: /* @__PURE__ */ w(r, {
314
+ children: /* @__PURE__ */ E(r, {
300
315
  size: "sm",
301
- onClick: () => M(),
302
- disabled: j || !S.trim(),
316
+ onClick: () => L(),
317
+ disabled: I || !A.trim(),
303
318
  className: "h-7",
304
- children: j ? /* @__PURE__ */ w(m, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(_, { className: "h-3.5 w-3.5 mr-1" }), "Ask"] })
319
+ children: I ? /* @__PURE__ */ E(m, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(_, { className: "h-3.5 w-3.5 mr-1" }), f("ai.nlQuery.ask")] })
305
320
  })
306
321
  })
307
322
  ]
308
323
  })
309
- }), h.length > 0 && !D && /* @__PURE__ */ w("div", {
324
+ }), b.length > 0 && !M && /* @__PURE__ */ E("div", {
310
325
  className: "mt-3 flex flex-wrap gap-2",
311
- children: h.map((e, t) => /* @__PURE__ */ w("button", {
326
+ children: b.map((e, t) => /* @__PURE__ */ E("button", {
312
327
  type: "button",
313
- onClick: () => N(e),
328
+ onClick: () => R(e),
314
329
  className: "text-xs px-2.5 py-1 rounded-full border bg-muted/30 hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",
315
- disabled: j,
330
+ disabled: I,
316
331
  children: e
317
332
  }, t))
318
333
  })]
319
334
  }) }),
320
- D && /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(o, {
335
+ M && /* @__PURE__ */ D(i, { children: [/* @__PURE__ */ E(o, {
321
336
  className: "pb-2",
322
- children: /* @__PURE__ */ T("div", {
337
+ children: /* @__PURE__ */ D("div", {
323
338
  className: "flex items-center justify-between",
324
- children: [/* @__PURE__ */ T(s, {
339
+ children: [/* @__PURE__ */ D(s, {
325
340
  className: "text-sm flex items-center gap-2",
326
- children: [/* @__PURE__ */ w(y, { className: "h-4 w-4" }), "Results"]
327
- }), D.confidence !== void 0 && /* @__PURE__ */ T(n, {
328
- variant: D.confidence >= .7 ? "default" : "secondary",
341
+ children: [/* @__PURE__ */ E(y, { className: "h-4 w-4" }), f("ai.nlQuery.results")]
342
+ }), M.confidence !== void 0 && /* @__PURE__ */ E(n, {
343
+ variant: M.confidence >= .7 ? "default" : "secondary",
329
344
  className: "text-xs",
330
- children: [Math.round(D.confidence * 100), "% match"]
345
+ children: f("ai.nlQuery.match", { percent: k(M.confidence, p) })
331
346
  })]
332
347
  })
333
- }), /* @__PURE__ */ T(a, { children: [
334
- D.summary && /* @__PURE__ */ w("p", {
348
+ }), /* @__PURE__ */ D(a, { children: [
349
+ M.summary && /* @__PURE__ */ E("p", {
335
350
  className: "text-sm text-muted-foreground mb-3",
336
- children: D.summary
351
+ children: M.summary
337
352
  }),
338
- D.data && D.data.length > 0 && D.columns && /* @__PURE__ */ w("div", {
353
+ M.data && M.data.length > 0 && M.columns && /* @__PURE__ */ E("div", {
339
354
  className: "border rounded-lg overflow-hidden",
340
- children: /* @__PURE__ */ T("table", {
355
+ children: /* @__PURE__ */ D("table", {
341
356
  className: "w-full text-sm",
342
- children: [/* @__PURE__ */ w("thead", {
357
+ children: [/* @__PURE__ */ E("thead", {
343
358
  className: "bg-muted",
344
- children: /* @__PURE__ */ w("tr", { children: D.columns.map((e, t) => /* @__PURE__ */ w("th", {
359
+ children: /* @__PURE__ */ E("tr", { children: M.columns.map((e, t) => /* @__PURE__ */ E("th", {
345
360
  className: "px-4 py-2 text-left font-medium",
346
361
  children: e.label || e.name
347
362
  }, t)) })
348
- }), /* @__PURE__ */ w("tbody", { children: D.data.map((e, t) => /* @__PURE__ */ w("tr", {
363
+ }), /* @__PURE__ */ E("tbody", { children: M.data.map((e, t) => /* @__PURE__ */ E("tr", {
349
364
  className: "border-t",
350
- children: D.columns.map((t, n) => /* @__PURE__ */ w("td", {
365
+ children: M.columns.map((t, n) => /* @__PURE__ */ E("td", {
351
366
  className: "px-4 py-2",
352
367
  children: String(e[t.name] ?? "")
353
368
  }, n))
354
369
  }, t)) })]
355
370
  })
356
371
  }),
357
- (!D.data || D.data.length === 0) && /* @__PURE__ */ w("div", {
372
+ (!M.data || M.data.length === 0) && /* @__PURE__ */ E("div", {
358
373
  className: "text-center py-6 text-muted-foreground text-sm",
359
- children: "No matching records found"
374
+ children: f("ai.nlQuery.noResults")
360
375
  })
361
376
  ] })] }),
362
- v && b.length > 0 && /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(o, {
377
+ x && S.length > 0 && /* @__PURE__ */ D(i, { children: [/* @__PURE__ */ E(o, {
363
378
  className: "pb-2",
364
- children: /* @__PURE__ */ T(s, {
379
+ children: /* @__PURE__ */ D(s, {
365
380
  className: "text-xs text-muted-foreground flex items-center gap-1",
366
- children: [/* @__PURE__ */ w(d, { className: "h-3 w-3" }), "Recent Queries"]
381
+ children: [/* @__PURE__ */ E(d, { className: "h-3 w-3" }), f("ai.nlQuery.recentQueries")]
367
382
  })
368
- }), /* @__PURE__ */ w(a, {
383
+ }), /* @__PURE__ */ E(a, {
369
384
  className: "space-y-1",
370
- children: b.slice(0, 5).map((e, t) => /* @__PURE__ */ T("button", {
385
+ children: S.slice(0, 5).map((e, t) => /* @__PURE__ */ D("button", {
371
386
  type: "button",
372
- onClick: () => N(e.query),
387
+ onClick: () => R(e.query),
373
388
  className: "w-full flex items-center gap-2 p-2 rounded-md text-sm text-left hover:bg-muted/50 transition-colors",
374
389
  children: [
375
- /* @__PURE__ */ w(l, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
376
- /* @__PURE__ */ w("span", {
390
+ /* @__PURE__ */ E(l, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
391
+ /* @__PURE__ */ E("span", {
377
392
  className: "truncate",
378
393
  children: e.query
379
394
  }),
380
- /* @__PURE__ */ w("span", {
395
+ /* @__PURE__ */ E("span", {
381
396
  className: "text-xs text-muted-foreground shrink-0 ml-auto",
382
- children: new Date(e.timestamp).toLocaleDateString()
397
+ children: new Date(e.timestamp).toLocaleDateString(p)
383
398
  })
384
399
  ]
385
400
  }, t))
@@ -387,127 +402,68 @@ var E = ({ schema: e, onApply: c, onRefresh: l }) => {
387
402
  ]
388
403
  });
389
404
  };
390
- e.register("ai-form-assist", E, {
405
+ e.register("ai-form-assist", A, {
391
406
  label: "AI Form Assist",
392
407
  category: "AI",
393
408
  inputs: [
394
- {
395
- name: "formId",
396
- type: "string",
397
- label: "Form ID"
398
- },
399
- {
400
- name: "objectName",
401
- type: "string",
402
- label: "Object Name"
403
- },
404
- {
405
- name: "fields",
406
- type: "array",
407
- label: "Fields to suggest"
408
- },
409
409
  {
410
410
  name: "suggestions",
411
- type: "code",
412
- label: "Suggestions Data"
413
- },
414
- {
415
- name: "autoFill",
416
- type: "boolean",
417
- label: "Auto Fill",
418
- defaultValue: !1
411
+ type: "code"
419
412
  },
420
413
  {
421
414
  name: "showConfidence",
422
- type: "boolean",
423
- label: "Show Confidence",
424
- defaultValue: !0
415
+ type: "boolean"
425
416
  },
426
417
  {
427
418
  name: "showReasoning",
428
- type: "boolean",
429
- label: "Show Reasoning",
430
- defaultValue: !1
419
+ type: "boolean"
431
420
  }
432
421
  ]
433
- }), e.register("ai-recommendations", D, {
422
+ }), e.register("ai-recommendations", j, {
434
423
  label: "AI Recommendations",
435
424
  category: "AI",
436
425
  inputs: [
437
- {
438
- name: "objectName",
439
- type: "string",
440
- label: "Object Name"
441
- },
442
426
  {
443
427
  name: "recommendations",
444
- type: "code",
445
- label: "Recommendations Data"
446
- },
447
- {
448
- name: "maxResults",
449
- type: "number",
450
- label: "Max Results",
451
- defaultValue: 10
428
+ type: "code"
452
429
  },
453
430
  {
454
431
  name: "showScores",
455
- type: "boolean",
456
- label: "Show Scores",
457
- defaultValue: !1
432
+ type: "boolean"
458
433
  },
459
434
  {
460
435
  name: "layout",
461
436
  type: "enum",
462
- label: "Layout",
463
- enum: [
464
- {
465
- label: "List",
466
- value: "list"
467
- },
468
- {
469
- label: "Grid",
470
- value: "grid"
471
- },
472
- {
473
- label: "Carousel",
474
- value: "carousel"
475
- }
476
- ],
477
- defaultValue: "list"
437
+ enum: [{
438
+ label: "List",
439
+ value: "list"
440
+ }, {
441
+ label: "Grid",
442
+ value: "grid"
443
+ }]
478
444
  },
479
445
  {
480
446
  name: "emptyMessage",
481
- type: "string",
482
- label: "Empty Message"
447
+ type: "string"
483
448
  }
484
449
  ]
485
- }), e.register("nl-query", O, {
450
+ }), e.register("nl-query", M, {
486
451
  label: "Natural Language Query",
487
452
  category: "AI",
488
453
  inputs: [
489
- {
490
- name: "objectName",
491
- type: "string",
492
- label: "Object Name"
493
- },
494
454
  {
495
455
  name: "placeholder",
496
- type: "string",
497
- label: "Placeholder Text"
456
+ type: "string"
498
457
  },
499
458
  {
500
459
  name: "suggestions",
501
- type: "array",
502
- label: "Example Queries"
460
+ type: "array"
503
461
  },
504
462
  {
505
463
  name: "showHistory",
506
- type: "boolean",
507
- label: "Show History",
508
- defaultValue: !1
464
+ type: "boolean"
509
465
  }
510
466
  ]
511
467
  });
512
468
  //#endregion
513
- export { E as AIFormAssist, D as AIRecommendations, O as NLQueryInput };
469
+ export { A as AIFormAssist, j as AIRecommendations, M as NLQueryInput };