@object-ui/plugin-ai 3.0.2 → 3.1.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.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './src/index'
1
+ export * from './plugin-ai/src/index'
2
2
  export {}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ComponentRegistry as Q } from "@object-ui/core";
2
2
  import ue, { useState as A } from "react";
3
- import { Card as T, CardHeader as Y, CardTitle as $, Badge as O, Button as y, CardContent as S, Input as xe } from "@object-ui/components";
3
+ import { Card as S, CardHeader as Y, CardTitle as $, Badge as O, Button as y, CardContent as T, Input as xe } from "@object-ui/components";
4
4
  import { Sparkles as M, RefreshCw as fe, X as H, Lightbulb as he, Check as te, Star as ae, ThumbsUp as pe, ThumbsDown as ge, ExternalLink as je, Search as be, Loader2 as Ne, Table as ve, Clock as ye, ArrowRight as we } from "lucide-react";
5
5
  var z = { exports: {} }, F = {};
6
6
  var re;
@@ -280,7 +280,7 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
280
280
  if (R || f.length === 0)
281
281
  return null;
282
282
  const k = f.filter((r) => !N.has(r.fieldName)), P = (r) => r >= 0.8 ? "text-green-600" : r >= 0.5 ? "text-yellow-600" : "text-red-600";
283
- return /* @__PURE__ */ e.jsxs(T, { className: "border-blue-200 bg-blue-50/30", children: [
283
+ return /* @__PURE__ */ e.jsxs(S, { className: "border-blue-200 bg-blue-50/30", children: [
284
284
  /* @__PURE__ */ e.jsx(Y, { className: "pb-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
285
285
  /* @__PURE__ */ e.jsxs($, { className: "text-sm flex items-center gap-2", children: [
286
286
  /* @__PURE__ */ e.jsx(M, { className: "h-4 w-4 text-blue-500" }),
@@ -325,7 +325,7 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
325
325
  )
326
326
  ] })
327
327
  ] }) }),
328
- /* @__PURE__ */ e.jsxs(S, { className: "space-y-2 pt-0", children: [
328
+ /* @__PURE__ */ e.jsxs(T, { className: "space-y-2 pt-0", children: [
329
329
  k.map((r) => /* @__PURE__ */ e.jsxs(
330
330
  "div",
331
331
  {
@@ -379,7 +379,7 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
379
379
  ] })
380
380
  ] })
381
381
  ] });
382
- }, Te = ({ schema: p, onSelect: g, onDismiss: j }) => {
382
+ }, Se = ({ schema: p, onSelect: g, onDismiss: j }) => {
383
383
  const {
384
384
  recommendations: x = [],
385
385
  showScores: d = !1,
@@ -392,12 +392,12 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
392
392
  j?.(t);
393
393
  };
394
394
  if (b)
395
- return /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsxs(S, { className: "p-8 text-center", children: [
395
+ return /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsxs(T, { className: "p-8 text-center", children: [
396
396
  /* @__PURE__ */ e.jsx(M, { className: "h-8 w-8 text-blue-500 mx-auto mb-3 animate-pulse" }),
397
397
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Generating recommendations..." })
398
398
  ] }) });
399
399
  if (x.length === 0)
400
- return /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsx(S, { className: "p-8 text-center text-muted-foreground", children: f }) });
400
+ return /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsx(T, { className: "p-8 text-center text-muted-foreground", children: f }) });
401
401
  const n = (t) => {
402
402
  if (!d) return null;
403
403
  const h = Math.round(t * 100), w = t >= 0.7 ? "default" : t >= 0.4 ? "secondary" : "outline";
@@ -439,11 +439,11 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
439
439
  },
440
440
  t.id
441
441
  ), E = (t) => /* @__PURE__ */ e.jsx(
442
- T,
442
+ S,
443
443
  {
444
444
  className: "cursor-pointer hover:shadow-md transition-shadow",
445
445
  onClick: () => v(t),
446
- children: /* @__PURE__ */ e.jsxs(S, { className: "p-4", children: [
446
+ children: /* @__PURE__ */ e.jsxs(T, { className: "p-4", children: [
447
447
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between mb-2", children: [
448
448
  /* @__PURE__ */ e.jsx(ae, { className: "h-4 w-4 text-yellow-500" }),
449
449
  n(t.score)
@@ -459,15 +459,15 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
459
459
  },
460
460
  t.id
461
461
  );
462
- return /* @__PURE__ */ e.jsxs(T, { children: [
462
+ return /* @__PURE__ */ e.jsxs(S, { children: [
463
463
  /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsxs($, { className: "flex items-center gap-2 text-sm", children: [
464
464
  /* @__PURE__ */ e.jsx(M, { className: "h-4 w-4 text-blue-500" }),
465
465
  "Recommendations",
466
466
  /* @__PURE__ */ e.jsx(O, { variant: "secondary", className: "text-xs", children: x.length })
467
467
  ] }) }),
468
- /* @__PURE__ */ e.jsx(S, { children: m === "grid" ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3", children: x.map(E) }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: x.map(R) }) })
468
+ /* @__PURE__ */ e.jsx(T, { children: m === "grid" ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3", children: x.map(E) }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: x.map(R) }) })
469
469
  ] });
470
- }, Se = ({ schema: p, onSubmit: g }) => {
470
+ }, Te = ({ schema: p, onSubmit: g }) => {
471
471
  const {
472
472
  placeholder: j = "Ask a question about your data...",
473
473
  result: x,
@@ -490,7 +490,7 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
490
490
  N(l), w(l);
491
491
  };
492
492
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
493
- /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsxs(S, { className: "p-4", children: [
493
+ /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsxs(T, { className: "p-4", children: [
494
494
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex-1", children: [
495
495
  /* @__PURE__ */ e.jsx(be, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
496
496
  /* @__PURE__ */ e.jsx(
@@ -529,7 +529,7 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
529
529
  u
530
530
  )) })
531
531
  ] }) }),
532
- n && /* @__PURE__ */ e.jsxs(T, { children: [
532
+ n && /* @__PURE__ */ e.jsxs(S, { children: [
533
533
  /* @__PURE__ */ e.jsx(Y, { className: "pb-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
534
534
  /* @__PURE__ */ e.jsxs($, { className: "text-sm flex items-center gap-2", children: [
535
535
  /* @__PURE__ */ e.jsx(ve, { className: "h-4 w-4" }),
@@ -540,21 +540,21 @@ const ke = ({ schema: p, onApply: g, onRefresh: j }) => {
540
540
  "% match"
541
541
  ] })
542
542
  ] }) }),
543
- /* @__PURE__ */ e.jsxs(S, { children: [
543
+ /* @__PURE__ */ e.jsxs(T, { children: [
544
544
  n.summary && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground mb-3", children: n.summary }),
545
545
  n.data && n.data.length > 0 && n.columns && /* @__PURE__ */ e.jsx("div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full text-sm", children: [
546
546
  /* @__PURE__ */ e.jsx("thead", { className: "bg-muted", children: /* @__PURE__ */ e.jsx("tr", { children: n.columns.map((l, u) => /* @__PURE__ */ e.jsx("th", { className: "px-4 py-2 text-left font-medium", children: l.label || l.name }, u)) }) }),
547
- /* @__PURE__ */ e.jsx("tbody", { children: n.data.map((l, u) => /* @__PURE__ */ e.jsx("tr", { className: "border-t", children: n.columns.map((k, P) => /* @__PURE__ */ e.jsx("td", { className: "px-4 py-2", children: l[k.name] }, P)) }, u)) })
547
+ /* @__PURE__ */ e.jsx("tbody", { children: n.data.map((l, u) => /* @__PURE__ */ e.jsx("tr", { className: "border-t", children: n.columns.map((k, P) => /* @__PURE__ */ e.jsx("td", { className: "px-4 py-2", children: String(l[k.name] ?? "") }, P)) }, u)) })
548
548
  ] }) }),
549
549
  (!n.data || n.data.length === 0) && /* @__PURE__ */ e.jsx("div", { className: "text-center py-6 text-muted-foreground text-sm", children: "No matching records found" })
550
550
  ] })
551
551
  ] }),
552
- m && b.length > 0 && /* @__PURE__ */ e.jsxs(T, { children: [
552
+ m && b.length > 0 && /* @__PURE__ */ e.jsxs(S, { children: [
553
553
  /* @__PURE__ */ e.jsx(Y, { className: "pb-2", children: /* @__PURE__ */ e.jsxs($, { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
554
554
  /* @__PURE__ */ e.jsx(ye, { className: "h-3 w-3" }),
555
555
  "Recent Queries"
556
556
  ] }) }),
557
- /* @__PURE__ */ e.jsx(S, { className: "space-y-1", children: b.slice(0, 5).map((l, u) => /* @__PURE__ */ e.jsxs(
557
+ /* @__PURE__ */ e.jsx(T, { className: "space-y-1", children: b.slice(0, 5).map((l, u) => /* @__PURE__ */ e.jsxs(
558
558
  "button",
559
559
  {
560
560
  onClick: () => _(l.query),
@@ -589,7 +589,7 @@ Q.register(
589
589
  );
590
590
  Q.register(
591
591
  "ai-recommendations",
592
- Te,
592
+ Se,
593
593
  {
594
594
  label: "AI Recommendations",
595
595
  category: "AI",
@@ -609,7 +609,7 @@ Q.register(
609
609
  );
610
610
  Q.register(
611
611
  "nl-query",
612
- Se,
612
+ Te,
613
613
  {
614
614
  label: "Natural Language Query",
615
615
  category: "AI",
@@ -623,6 +623,6 @@ Q.register(
623
623
  );
624
624
  export {
625
625
  ke as AIFormAssist,
626
- Te as AIRecommendations,
627
- Se as NLQueryInput
626
+ Se as AIRecommendations,
627
+ Te as NLQueryInput
628
628
  };
@@ -1,6 +1,6 @@
1
- (function(b,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","@object-ui/components","lucide-react"],A):(b=typeof globalThis<"u"?globalThis:b||self,A(b.ObjectUIPluginAI={},b.ObjectUICore,b.React,b.ObjectUIComponents,b.lucideReact))})(this,(function(b,A,S,t,c){"use strict";var D={exports:{}},P={};var W;function ae(){if(W)return P;W=1;var p=Symbol.for("react.transitional.element"),N=Symbol.for("react.fragment");function v(h,m,f){var y=null;if(f!==void 0&&(y=""+f),m.key!==void 0&&(y=""+m.key),"key"in m){f={};for(var g in m)g!=="key"&&(f[g]=m[g])}else f=m;return m=f.ref,{$$typeof:p,type:h,key:y,ref:m!==void 0?m:null,props:f}}return P.Fragment=N,P.jsx=v,P.jsxs=v,P}var I={};var G;function re(){return G||(G=1,process.env.NODE_ENV!=="production"&&(function(){function p(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===oe?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case T:return"Fragment";case x:return"Profiler";case i:return"StrictMode";case L:return"Suspense";case Y:return"SuspenseList";case ie:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case E:return"Portal";case F:return s.displayName||"Context";case R:return(s._context.displayName||"Context")+".Consumer";case n:var r=s.render;return s=s.displayName,s||(s=r.displayName||r.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case le:return r=s.displayName||null,r!==null?r:p(s.type)||"Memo";case B:r=s._payload,s=s._init;try{return p(s(r))}catch{}}return null}function N(s){return""+s}function v(s){try{N(s);var r=!1}catch{r=!0}if(r){r=console;var o=r.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return o.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),N(s)}}function h(s){if(s===T)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===B)return"<...>";try{var r=p(s);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function m(){var s=M.A;return s===null?null:s.getOwner()}function f(){return Error("react-stack-top-frame")}function y(s){if($.call(s,"key")){var r=Object.getOwnPropertyDescriptor(s,"key").get;if(r&&r.isReactWarning)return!1}return s.key!==void 0}function g(s,r){function o(){Z||(Z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}o.isReactWarning=!0,Object.defineProperty(s,"key",{get:o,configurable:!0})}function C(){var s=p(this.type);return K[s]||(K[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function w(s,r,o,d,z,U){var u=o.ref;return s={$$typeof:j,type:s,key:r,props:o,_owner:d},(u!==void 0?u:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:C}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function l(s,r,o,d,z,U){var u=r.children;if(u!==void 0)if(d)if(ce(u)){for(d=0;d<u.length;d++)_(u[d]);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(u);if($.call(r,"key")){u=p(s);var O=Object.keys(r).filter(function(de){return de!=="key"});d=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",te[u+d]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(b,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","@object-ui/components","lucide-react"],A):(b=typeof globalThis<"u"?globalThis:b||self,A(b.ObjectUIPluginAI={},b.ObjectUICore,b.React,b.ObjectUIComponents,b.lucideReact))})(this,(function(b,A,S,s,c){"use strict";var D={exports:{}},P={};var W;function ae(){if(W)return P;W=1;var p=Symbol.for("react.transitional.element"),N=Symbol.for("react.fragment");function v(h,m,f){var y=null;if(f!==void 0&&(y=""+f),m.key!==void 0&&(y=""+m.key),"key"in m){f={};for(var g in m)g!=="key"&&(f[g]=m[g])}else f=m;return m=f.ref,{$$typeof:p,type:h,key:y,ref:m!==void 0?m:null,props:f}}return P.Fragment=N,P.jsx=v,P.jsxs=v,P}var I={};var G;function re(){return G||(G=1,process.env.NODE_ENV!=="production"&&(function(){function p(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case T:return"Fragment";case x:return"Profiler";case i:return"StrictMode";case L:return"Suspense";case Y:return"SuspenseList";case ie:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case E:return"Portal";case F:return t.displayName||"Context";case R:return(t._context.displayName||"Context")+".Consumer";case n:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case le:return r=t.displayName||null,r!==null?r:p(t.type)||"Memo";case B:r=t._payload,t=t._init;try{return p(t(r))}catch{}}return null}function N(t){return""+t}function v(t){try{N(t);var r=!1}catch{r=!0}if(r){r=console;var o=r.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return o.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),N(t)}}function h(t){if(t===T)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===B)return"<...>";try{var r=p(t);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function m(){var t=M.A;return t===null?null:t.getOwner()}function f(){return Error("react-stack-top-frame")}function y(t){if($.call(t,"key")){var r=Object.getOwnPropertyDescriptor(t,"key").get;if(r&&r.isReactWarning)return!1}return t.key!==void 0}function g(t,r){function o(){Z||(Z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}o.isReactWarning=!0,Object.defineProperty(t,"key",{get:o,configurable:!0})}function C(){var t=p(this.type);return K[t]||(K[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function w(t,r,o,d,z,U){var u=o.ref;return t={$$typeof:j,type:t,key:r,props:o,_owner:d},(u!==void 0?u:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:C}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function l(t,r,o,d,z,U){var u=r.children;if(u!==void 0)if(d)if(ce(u)){for(d=0;d<u.length;d++)_(u[d]);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(u);if($.call(r,"key")){u=p(t);var O=Object.keys(r).filter(function(de){return de!=="key"});d=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",se[u+d]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,d,u,O,u),te[u+d]=!0)}if(u=null,o!==void 0&&(v(o),u=""+o),y(r)&&(v(r.key),u=""+r.key),"key"in r){o={};for(var q in r)q!=="key"&&(o[q]=r[q])}else o=r;return u&&g(o,typeof s=="function"?s.displayName||s.name||"Unknown":s),w(s,u,o,m(),z,U)}function _(s){k(s)?s._store&&(s._store.validated=1):typeof s=="object"&&s!==null&&s.$$typeof===B&&(s._payload.status==="fulfilled"?k(s._payload.value)&&s._payload.value._store&&(s._payload.value._store.validated=1):s._store&&(s._store.validated=1))}function k(s){return typeof s=="object"&&s!==null&&s.$$typeof===j}var a=S,j=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),F=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),M=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,ce=Array.isArray,V=console.createTask?console.createTask:function(){return null};a={react_stack_bottom_frame:function(s){return s()}};var Z,K={},ee=a.react_stack_bottom_frame.bind(a,f)(),se=V(h(f)),te={};I.Fragment=T,I.jsx=function(s,r,o){var d=1e4>M.recentlyCreatedOwnerStacks++;return l(s,r,o,!1,d?Error("react-stack-top-frame"):ee,d?V(h(s)):se)},I.jsxs=function(s,r,o){var d=1e4>M.recentlyCreatedOwnerStacks++;return l(s,r,o,!0,d?Error("react-stack-top-frame"):ee,d?V(h(s)):se)}})()),I}var H;function ne(){return H||(H=1,process.env.NODE_ENV==="production"?D.exports=ae():D.exports=re()),D.exports}var e=ne();const J=({schema:p,onApply:N,onRefresh:v})=>{const{suggestions:h=[],showConfidence:m=!0,showReasoning:f=!1,autoFill:y=!1}=p,[g,C]=S.useState(h),[w,l]=S.useState(new Set),[_,k]=S.useState(!1),[a,j]=S.useState(!1),E=n=>{N?.(n),l(L=>new Set(L).add(n.fieldName))},T=()=>{g.forEach(n=>N?.(n)),l(new Set(g.map(n=>n.fieldName)))},i=n=>{C(L=>L.filter(Y=>Y.fieldName!==n))},x=()=>{j(!0),v&&v(),setTimeout(()=>j(!1),1e3)};if(_||g.length===0)return null;const R=g.filter(n=>!w.has(n.fieldName)),F=n=>n>=.8?"text-green-600":n>=.5?"text-yellow-600":"text-red-600";return e.jsxs(t.Card,{className:"border-blue-200 bg-blue-50/30",children:[e.jsx(t.CardHeader,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(t.CardTitle,{className:"text-sm flex items-center gap-2",children:[e.jsx(c.Sparkles,{className:"h-4 w-4 text-blue-500"}),"AI Suggestions",e.jsxs(t.Badge,{variant:"secondary",className:"text-xs",children:[R.length," suggestion",R.length!==1?"s":""]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(t.Button,{variant:"ghost",size:"sm",onClick:x,disabled:a,className:"h-7",children:e.jsx(c.RefreshCw,{className:`h-3 w-3 ${a?"animate-spin":""}`})}),R.length>1&&e.jsx(t.Button,{variant:"outline",size:"sm",onClick:T,className:"h-7 text-xs",children:"Apply All"}),e.jsx(t.Button,{variant:"ghost",size:"sm",onClick:()=>k(!0),className:"h-7",children:e.jsx(c.X,{className:"h-3 w-3"})})]})]})}),e.jsxs(t.CardContent,{className:"space-y-2 pt-0",children:[R.map(n=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-white border text-sm",children:[e.jsx(c.Lightbulb,{className:"h-4 w-4 text-yellow-500 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.fieldName}),e.jsx("span",{className:"text-muted-foreground",children:"→"}),e.jsx("span",{className:"font-mono text-blue-600 truncate",children:typeof n.value=="object"?JSON.stringify(n.value):String(n.value)})]}),m&&e.jsxs("div",{className:`text-xs ${F(n.confidence)}`,children:[Math.round(n.confidence*100),"% confidence"]}),f&&n.reasoning&&e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.reasoning})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx(t.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-green-600 hover:text-green-700 hover:bg-green-50",onClick:()=>E(n),children:e.jsx(c.Check,{className:"h-3.5 w-3.5"})}),e.jsx(t.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-red-500 hover:text-red-700 hover:bg-red-50",onClick:()=>i(n.fieldName),children:e.jsx(c.X,{className:"h-3.5 w-3.5"})})]})]},n.fieldName)),w.size>0&&e.jsxs("div",{className:"text-xs text-green-600 flex items-center gap-1 pt-1",children:[e.jsx(c.Check,{className:"h-3 w-3"}),w.size," suggestion",w.size!==1?"s":""," applied"]})]})]})},X=({schema:p,onSelect:N,onDismiss:v})=>{const{recommendations:h=[],showScores:m=!1,layout:f="list",loading:y=!1,emptyMessage:g="No recommendations available"}=p,C=a=>{N?.(a)},w=a=>{v?.(a)};if(y)return e.jsx(t.Card,{children:e.jsxs(t.CardContent,{className:"p-8 text-center",children:[e.jsx(c.Sparkles,{className:"h-8 w-8 text-blue-500 mx-auto mb-3 animate-pulse"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Generating recommendations..."})]})});if(h.length===0)return e.jsx(t.Card,{children:e.jsx(t.CardContent,{className:"p-8 text-center text-muted-foreground",children:g})});const l=a=>{if(!m)return null;const j=Math.round(a*100),E=a>=.7?"default":a>=.4?"secondary":"outline";return e.jsxs(t.Badge,{variant:E,className:"text-xs",children:[j,"%"]})},_=a=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border hover:bg-muted/30 transition-colors cursor-pointer",onClick:()=>C(a),children:[e.jsx("div",{className:"mt-1 shrink-0",children:e.jsx(c.Star,{className:"h-4 w-4 text-yellow-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-medium text-sm",children:a.title}),a.category&&e.jsx(t.Badge,{variant:"outline",className:"text-xs",children:a.category}),l(a.score)]}),a.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.description})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[a.action&&e.jsx(t.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",children:e.jsx(c.ExternalLink,{className:"h-3.5 w-3.5"})}),e.jsx(t.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground",onClick:j=>{j.stopPropagation(),w(a)},children:e.jsx(c.X,{className:"h-3.5 w-3.5"})})]})]},a.id),k=a=>e.jsx(t.Card,{className:"cursor-pointer hover:shadow-md transition-shadow",onClick:()=>C(a),children:e.jsxs(t.CardContent,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx(c.Star,{className:"h-4 w-4 text-yellow-500"}),l(a.score)]}),e.jsx("h4",{className:"font-medium text-sm mb-1",children:a.title}),a.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3",children:a.description}),a.category&&e.jsx(t.Badge,{variant:"outline",className:"text-xs mt-2",children:a.category}),e.jsxs("div",{className:"flex items-center gap-1 mt-3",children:[e.jsx(t.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-green-600",children:e.jsx(c.ThumbsUp,{className:"h-3 w-3"})}),e.jsx(t.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-red-500",children:e.jsx(c.ThumbsDown,{className:"h-3 w-3"})})]})]})},a.id);return e.jsxs(t.Card,{children:[e.jsx(t.CardHeader,{children:e.jsxs(t.CardTitle,{className:"flex items-center gap-2 text-sm",children:[e.jsx(c.Sparkles,{className:"h-4 w-4 text-blue-500"}),"Recommendations",e.jsx(t.Badge,{variant:"secondary",className:"text-xs",children:h.length})]})}),e.jsx(t.CardContent,{children:f==="grid"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:h.map(k)}):e.jsx("div",{className:"space-y-2",children:h.map(_)})})]})},Q=({schema:p,onSubmit:N})=>{const{placeholder:v="Ask a question about your data...",result:h,suggestions:m=[],showHistory:f=!1,history:y=[],loading:g=!1}=p,[C,w]=S.useState(""),[l,_]=S.useState(h),[k,a]=S.useState(!1),j=k||g,E=i=>{const x=i||C;x.trim()&&(a(!0),N?.(x),N?a(!1):setTimeout(()=>{_({query:x,summary:`Results for: "${x}"`,confidence:.85,data:[],columns:[]}),a(!1)},1e3))},T=i=>{w(i),E(i)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(t.Card,{children:e.jsxs(t.CardContent,{className:"p-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(c.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(t.Input,{value:C,onChange:i=>w(i.target.value),onKeyDown:i=>i.key==="Enter"&&E(),placeholder:v,className:"pl-10 pr-20",disabled:j}),e.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(t.Button,{size:"sm",onClick:()=>E(),disabled:j||!C.trim(),className:"h-7",children:j?e.jsx(c.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(c.Sparkles,{className:"h-3.5 w-3.5 mr-1"}),"Ask"]})})})]})}),m.length>0&&!l&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:m.map((i,x)=>e.jsx("button",{onClick:()=>T(i),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",disabled:j,children:i},x))})]})}),l&&e.jsxs(t.Card,{children:[e.jsx(t.CardHeader,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(t.CardTitle,{className:"text-sm flex items-center gap-2",children:[e.jsx(c.Table,{className:"h-4 w-4"}),"Results"]}),l.confidence!==void 0&&e.jsxs(t.Badge,{variant:l.confidence>=.7?"default":"secondary",className:"text-xs",children:[Math.round(l.confidence*100),"% match"]})]})}),e.jsxs(t.CardContent,{children:[l.summary&&e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:l.summary}),l.data&&l.data.length>0&&l.columns&&e.jsx("div",{className:"border rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted",children:e.jsx("tr",{children:l.columns.map((i,x)=>e.jsx("th",{className:"px-4 py-2 text-left font-medium",children:i.label||i.name},x))})}),e.jsx("tbody",{children:l.data.map((i,x)=>e.jsx("tr",{className:"border-t",children:l.columns.map((R,F)=>e.jsx("td",{className:"px-4 py-2",children:i[R.name]},F))},x))})]})}),(!l.data||l.data.length===0)&&e.jsx("div",{className:"text-center py-6 text-muted-foreground text-sm",children:"No matching records found"})]})]}),f&&y.length>0&&e.jsxs(t.Card,{children:[e.jsx(t.CardHeader,{className:"pb-2",children:e.jsxs(t.CardTitle,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(c.Clock,{className:"h-3 w-3"}),"Recent Queries"]})}),e.jsx(t.CardContent,{className:"space-y-1",children:y.slice(0,5).map((i,x)=>e.jsxs("button",{onClick:()=>T(i.query),className:"w-full flex items-center gap-2 p-2 rounded-md text-sm text-left hover:bg-muted/50 transition-colors",children:[e.jsx(c.ArrowRight,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate",children:i.query}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0 ml-auto",children:new Date(i.timestamp).toLocaleDateString()})]},x))})]})]})};A.ComponentRegistry.register("ai-form-assist",J,{label:"AI Form Assist",category:"AI",inputs:[{name:"formId",type:"string",label:"Form ID"},{name:"objectName",type:"string",label:"Object Name"},{name:"fields",type:"array",label:"Fields to suggest"},{name:"suggestions",type:"code",label:"Suggestions Data"},{name:"autoFill",type:"boolean",label:"Auto Fill",defaultValue:!1},{name:"showConfidence",type:"boolean",label:"Show Confidence",defaultValue:!0},{name:"showReasoning",type:"boolean",label:"Show Reasoning",defaultValue:!1}]}),A.ComponentRegistry.register("ai-recommendations",X,{label:"AI Recommendations",category:"AI",inputs:[{name:"objectName",type:"string",label:"Object Name"},{name:"recommendations",type:"code",label:"Recommendations Data"},{name:"maxResults",type:"number",label:"Max Results",defaultValue:10},{name:"showScores",type:"boolean",label:"Show Scores",defaultValue:!1},{name:"layout",type:"enum",label:"Layout",enum:[{label:"List",value:"list"},{label:"Grid",value:"grid"},{label:"Carousel",value:"carousel"}],defaultValue:"list"},{name:"emptyMessage",type:"string",label:"Empty Message"}]}),A.ComponentRegistry.register("nl-query",Q,{label:"Natural Language Query",category:"AI",inputs:[{name:"objectName",type:"string",label:"Object Name"},{name:"placeholder",type:"string",label:"Placeholder Text"},{name:"suggestions",type:"array",label:"Example Queries"},{name:"showHistory",type:"boolean",label:"Show History",defaultValue:!1}]}),b.AIFormAssist=J,b.AIRecommendations=X,b.NLQueryInput=Q,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,d,u,O,u),se[u+d]=!0)}if(u=null,o!==void 0&&(v(o),u=""+o),y(r)&&(v(r.key),u=""+r.key),"key"in r){o={};for(var q in r)q!=="key"&&(o[q]=r[q])}else o=r;return u&&g(o,typeof t=="function"?t.displayName||t.name||"Unknown":t),w(t,u,o,m(),z,U)}function _(t){k(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===B&&(t._payload.status==="fulfilled"?k(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function k(t){return typeof t=="object"&&t!==null&&t.$$typeof===j}var a=S,j=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),F=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),M=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,ce=Array.isArray,V=console.createTask?console.createTask:function(){return null};a={react_stack_bottom_frame:function(t){return t()}};var Z,K={},ee=a.react_stack_bottom_frame.bind(a,f)(),te=V(h(f)),se={};I.Fragment=T,I.jsx=function(t,r,o){var d=1e4>M.recentlyCreatedOwnerStacks++;return l(t,r,o,!1,d?Error("react-stack-top-frame"):ee,d?V(h(t)):te)},I.jsxs=function(t,r,o){var d=1e4>M.recentlyCreatedOwnerStacks++;return l(t,r,o,!0,d?Error("react-stack-top-frame"):ee,d?V(h(t)):te)}})()),I}var H;function ne(){return H||(H=1,process.env.NODE_ENV==="production"?D.exports=ae():D.exports=re()),D.exports}var e=ne();const J=({schema:p,onApply:N,onRefresh:v})=>{const{suggestions:h=[],showConfidence:m=!0,showReasoning:f=!1,autoFill:y=!1}=p,[g,C]=S.useState(h),[w,l]=S.useState(new Set),[_,k]=S.useState(!1),[a,j]=S.useState(!1),E=n=>{N?.(n),l(L=>new Set(L).add(n.fieldName))},T=()=>{g.forEach(n=>N?.(n)),l(new Set(g.map(n=>n.fieldName)))},i=n=>{C(L=>L.filter(Y=>Y.fieldName!==n))},x=()=>{j(!0),v&&v(),setTimeout(()=>j(!1),1e3)};if(_||g.length===0)return null;const R=g.filter(n=>!w.has(n.fieldName)),F=n=>n>=.8?"text-green-600":n>=.5?"text-yellow-600":"text-red-600";return e.jsxs(s.Card,{className:"border-blue-200 bg-blue-50/30",children:[e.jsx(s.CardHeader,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(s.CardTitle,{className:"text-sm flex items-center gap-2",children:[e.jsx(c.Sparkles,{className:"h-4 w-4 text-blue-500"}),"AI Suggestions",e.jsxs(s.Badge,{variant:"secondary",className:"text-xs",children:[R.length," suggestion",R.length!==1?"s":""]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(s.Button,{variant:"ghost",size:"sm",onClick:x,disabled:a,className:"h-7",children:e.jsx(c.RefreshCw,{className:`h-3 w-3 ${a?"animate-spin":""}`})}),R.length>1&&e.jsx(s.Button,{variant:"outline",size:"sm",onClick:T,className:"h-7 text-xs",children:"Apply All"}),e.jsx(s.Button,{variant:"ghost",size:"sm",onClick:()=>k(!0),className:"h-7",children:e.jsx(c.X,{className:"h-3 w-3"})})]})]})}),e.jsxs(s.CardContent,{className:"space-y-2 pt-0",children:[R.map(n=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-white border text-sm",children:[e.jsx(c.Lightbulb,{className:"h-4 w-4 text-yellow-500 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.fieldName}),e.jsx("span",{className:"text-muted-foreground",children:"→"}),e.jsx("span",{className:"font-mono text-blue-600 truncate",children:typeof n.value=="object"?JSON.stringify(n.value):String(n.value)})]}),m&&e.jsxs("div",{className:`text-xs ${F(n.confidence)}`,children:[Math.round(n.confidence*100),"% confidence"]}),f&&n.reasoning&&e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.reasoning})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx(s.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-green-600 hover:text-green-700 hover:bg-green-50",onClick:()=>E(n),children:e.jsx(c.Check,{className:"h-3.5 w-3.5"})}),e.jsx(s.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-red-500 hover:text-red-700 hover:bg-red-50",onClick:()=>i(n.fieldName),children:e.jsx(c.X,{className:"h-3.5 w-3.5"})})]})]},n.fieldName)),w.size>0&&e.jsxs("div",{className:"text-xs text-green-600 flex items-center gap-1 pt-1",children:[e.jsx(c.Check,{className:"h-3 w-3"}),w.size," suggestion",w.size!==1?"s":""," applied"]})]})]})},X=({schema:p,onSelect:N,onDismiss:v})=>{const{recommendations:h=[],showScores:m=!1,layout:f="list",loading:y=!1,emptyMessage:g="No recommendations available"}=p,C=a=>{N?.(a)},w=a=>{v?.(a)};if(y)return e.jsx(s.Card,{children:e.jsxs(s.CardContent,{className:"p-8 text-center",children:[e.jsx(c.Sparkles,{className:"h-8 w-8 text-blue-500 mx-auto mb-3 animate-pulse"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Generating recommendations..."})]})});if(h.length===0)return e.jsx(s.Card,{children:e.jsx(s.CardContent,{className:"p-8 text-center text-muted-foreground",children:g})});const l=a=>{if(!m)return null;const j=Math.round(a*100),E=a>=.7?"default":a>=.4?"secondary":"outline";return e.jsxs(s.Badge,{variant:E,className:"text-xs",children:[j,"%"]})},_=a=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border hover:bg-muted/30 transition-colors cursor-pointer",onClick:()=>C(a),children:[e.jsx("div",{className:"mt-1 shrink-0",children:e.jsx(c.Star,{className:"h-4 w-4 text-yellow-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-medium text-sm",children:a.title}),a.category&&e.jsx(s.Badge,{variant:"outline",className:"text-xs",children:a.category}),l(a.score)]}),a.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.description})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[a.action&&e.jsx(s.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",children:e.jsx(c.ExternalLink,{className:"h-3.5 w-3.5"})}),e.jsx(s.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground",onClick:j=>{j.stopPropagation(),w(a)},children:e.jsx(c.X,{className:"h-3.5 w-3.5"})})]})]},a.id),k=a=>e.jsx(s.Card,{className:"cursor-pointer hover:shadow-md transition-shadow",onClick:()=>C(a),children:e.jsxs(s.CardContent,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx(c.Star,{className:"h-4 w-4 text-yellow-500"}),l(a.score)]}),e.jsx("h4",{className:"font-medium text-sm mb-1",children:a.title}),a.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3",children:a.description}),a.category&&e.jsx(s.Badge,{variant:"outline",className:"text-xs mt-2",children:a.category}),e.jsxs("div",{className:"flex items-center gap-1 mt-3",children:[e.jsx(s.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-green-600",children:e.jsx(c.ThumbsUp,{className:"h-3 w-3"})}),e.jsx(s.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-red-500",children:e.jsx(c.ThumbsDown,{className:"h-3 w-3"})})]})]})},a.id);return e.jsxs(s.Card,{children:[e.jsx(s.CardHeader,{children:e.jsxs(s.CardTitle,{className:"flex items-center gap-2 text-sm",children:[e.jsx(c.Sparkles,{className:"h-4 w-4 text-blue-500"}),"Recommendations",e.jsx(s.Badge,{variant:"secondary",className:"text-xs",children:h.length})]})}),e.jsx(s.CardContent,{children:f==="grid"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:h.map(k)}):e.jsx("div",{className:"space-y-2",children:h.map(_)})})]})},Q=({schema:p,onSubmit:N})=>{const{placeholder:v="Ask a question about your data...",result:h,suggestions:m=[],showHistory:f=!1,history:y=[],loading:g=!1}=p,[C,w]=S.useState(""),[l,_]=S.useState(h),[k,a]=S.useState(!1),j=k||g,E=i=>{const x=i||C;x.trim()&&(a(!0),N?.(x),N?a(!1):setTimeout(()=>{_({query:x,summary:`Results for: "${x}"`,confidence:.85,data:[],columns:[]}),a(!1)},1e3))},T=i=>{w(i),E(i)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(s.Card,{children:e.jsxs(s.CardContent,{className:"p-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(c.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(s.Input,{value:C,onChange:i=>w(i.target.value),onKeyDown:i=>i.key==="Enter"&&E(),placeholder:v,className:"pl-10 pr-20",disabled:j}),e.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(s.Button,{size:"sm",onClick:()=>E(),disabled:j||!C.trim(),className:"h-7",children:j?e.jsx(c.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(c.Sparkles,{className:"h-3.5 w-3.5 mr-1"}),"Ask"]})})})]})}),m.length>0&&!l&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:m.map((i,x)=>e.jsx("button",{onClick:()=>T(i),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",disabled:j,children:i},x))})]})}),l&&e.jsxs(s.Card,{children:[e.jsx(s.CardHeader,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(s.CardTitle,{className:"text-sm flex items-center gap-2",children:[e.jsx(c.Table,{className:"h-4 w-4"}),"Results"]}),l.confidence!==void 0&&e.jsxs(s.Badge,{variant:l.confidence>=.7?"default":"secondary",className:"text-xs",children:[Math.round(l.confidence*100),"% match"]})]})}),e.jsxs(s.CardContent,{children:[l.summary&&e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:l.summary}),l.data&&l.data.length>0&&l.columns&&e.jsx("div",{className:"border rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted",children:e.jsx("tr",{children:l.columns.map((i,x)=>e.jsx("th",{className:"px-4 py-2 text-left font-medium",children:i.label||i.name},x))})}),e.jsx("tbody",{children:l.data.map((i,x)=>e.jsx("tr",{className:"border-t",children:l.columns.map((R,F)=>e.jsx("td",{className:"px-4 py-2",children:String(i[R.name]??"")},F))},x))})]})}),(!l.data||l.data.length===0)&&e.jsx("div",{className:"text-center py-6 text-muted-foreground text-sm",children:"No matching records found"})]})]}),f&&y.length>0&&e.jsxs(s.Card,{children:[e.jsx(s.CardHeader,{className:"pb-2",children:e.jsxs(s.CardTitle,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(c.Clock,{className:"h-3 w-3"}),"Recent Queries"]})}),e.jsx(s.CardContent,{className:"space-y-1",children:y.slice(0,5).map((i,x)=>e.jsxs("button",{onClick:()=>T(i.query),className:"w-full flex items-center gap-2 p-2 rounded-md text-sm text-left hover:bg-muted/50 transition-colors",children:[e.jsx(c.ArrowRight,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate",children:i.query}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0 ml-auto",children:new Date(i.timestamp).toLocaleDateString()})]},x))})]})]})};A.ComponentRegistry.register("ai-form-assist",J,{label:"AI Form Assist",category:"AI",inputs:[{name:"formId",type:"string",label:"Form ID"},{name:"objectName",type:"string",label:"Object Name"},{name:"fields",type:"array",label:"Fields to suggest"},{name:"suggestions",type:"code",label:"Suggestions Data"},{name:"autoFill",type:"boolean",label:"Auto Fill",defaultValue:!1},{name:"showConfidence",type:"boolean",label:"Show Confidence",defaultValue:!0},{name:"showReasoning",type:"boolean",label:"Show Reasoning",defaultValue:!1}]}),A.ComponentRegistry.register("ai-recommendations",X,{label:"AI Recommendations",category:"AI",inputs:[{name:"objectName",type:"string",label:"Object Name"},{name:"recommendations",type:"code",label:"Recommendations Data"},{name:"maxResults",type:"number",label:"Max Results",defaultValue:10},{name:"showScores",type:"boolean",label:"Show Scores",defaultValue:!1},{name:"layout",type:"enum",label:"Layout",enum:[{label:"List",value:"list"},{label:"Grid",value:"grid"},{label:"Carousel",value:"carousel"}],defaultValue:"list"},{name:"emptyMessage",type:"string",label:"Empty Message"}]}),A.ComponentRegistry.register("nl-query",Q,{label:"Natural Language Query",category:"AI",inputs:[{name:"objectName",type:"string",label:"Object Name"},{name:"placeholder",type:"string",label:"Placeholder Text"},{name:"suggestions",type:"array",label:"Example Queries"},{name:"showHistory",type:"boolean",label:"Show History",defaultValue:!1}]}),b.AIFormAssist=J,b.AIRecommendations=X,b.NLQueryInput=Q,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
@@ -12,4 +12,3 @@ export interface AIFormAssistProps {
12
12
  * Provides intelligent field suggestions based on context and historical data.
13
13
  */
14
14
  export declare const AIFormAssist: React.FC<AIFormAssistProps>;
15
- //# sourceMappingURL=AIFormAssist.d.ts.map
@@ -12,4 +12,3 @@ export interface AIRecommendationsProps {
12
12
  * Displays intelligent recommendations based on context and user behavior.
13
13
  */
14
14
  export declare const AIRecommendations: React.FC<AIRecommendationsProps>;
15
- //# sourceMappingURL=AIRecommendations.d.ts.map
@@ -10,4 +10,3 @@ export interface NLQueryInputProps {
10
10
  * Allows users to query data using natural language, with AI-powered parsing.
11
11
  */
12
12
  export declare const NLQueryInput: React.FC<NLQueryInputProps>;
13
- //# sourceMappingURL=NLQueryInput.d.ts.map
@@ -2,4 +2,3 @@ import { AIFormAssist } from './AIFormAssist';
2
2
  import { AIRecommendations } from './AIRecommendations';
3
3
  import { NLQueryInput } from './NLQueryInput';
4
4
  export { AIFormAssist, AIRecommendations, NLQueryInput };
5
- //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-ai",
3
- "version": "3.0.2",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.cjs",
6
6
  "module": "dist/index.js",
@@ -17,20 +17,20 @@
17
17
  ],
18
18
  "peerDependencies": {
19
19
  "react": "^18.0.0 || ^19.0.0",
20
- "react-dom": "^18.0.0 || ^19.0.0",
21
- "@object-ui/components": "3.0.2",
22
- "@object-ui/core": "3.0.2",
23
- "@object-ui/react": "3.0.2",
24
- "@object-ui/types": "3.0.2"
20
+ "react-dom": "^18.0.0 || ^19.0.0"
25
21
  },
26
22
  "dependencies": {
27
23
  "clsx": "^2.1.1",
28
- "lucide-react": "^0.344.0",
29
- "tailwind-merge": "^2.6.1"
24
+ "lucide-react": "^0.576.0",
25
+ "tailwind-merge": "^3.5.0",
26
+ "@object-ui/components": "3.1.0",
27
+ "@object-ui/core": "3.1.0",
28
+ "@object-ui/react": "3.1.0",
29
+ "@object-ui/types": "3.1.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@types/node": "^25.2.3",
33
- "@types/react": "19.2.13",
32
+ "@types/node": "^25.3.3",
33
+ "@types/react": "19.2.14",
34
34
  "@types/react-dom": "19.2.3",
35
35
  "@vitejs/plugin-react": "^5.1.4",
36
36
  "vite": "^7.3.1",
@@ -1 +0,0 @@
1
- {"version":3,"file":"AIFormAssist.d.ts","sourceRoot":"","sources":["../../src/AIFormAssist.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG9E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,4CAA4C;IAC5C,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0JpD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AIRecommendations.d.ts","sourceRoot":"","sources":["../../src/AIRecommendations.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGtF,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,uBAAuB,CAAC;IAChC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChD,kDAAkD;IAClD,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAClD;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwI9D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NLQueryInput.d.ts","sourceRoot":"","sources":["../../src/NLQueryInput.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAGrE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,aAAa,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0LpD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}