site-operator-react 0.1.0 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,6 +26,8 @@ function App() {
26
26
  backendUrl="http://localhost:8001/ag_ui"
27
27
  appName="My React App"
28
28
  agentAvatar="/avatar.png"
29
+ disclaimer="Agent puede cometer errores. Verifica la información importante"
30
+ emptyText="¿Cómo puedo ayudarte hoy?"
29
31
  />
30
32
  </div>
31
33
  );
package/dist/index.d.ts CHANGED
@@ -10,7 +10,10 @@ export declare interface AgentChatProps {
10
10
  backendUrl?: string;
11
11
  appName?: string;
12
12
  agentAvatar?: string;
13
+ disclaimer?: string;
14
+ emptyText?: string;
13
15
  inspector?: boolean;
16
+ interceptor?: boolean;
14
17
  appContext?: AgentState;
15
18
  className?: string;
16
19
  }
@@ -1,6 +1,6 @@
1
- import ee, { useRef as re, useEffect as D } from "react";
1
+ import ee, { useRef as re, useEffect as M } from "react";
2
2
  import { chatPortalService as te } from "site-operator";
3
- var b = { exports: {} }, E = {};
3
+ var p = { exports: {} }, _ = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ var b = { exports: {} }, E = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var $;
13
+ var F;
14
14
  function ne() {
15
- if ($) return E;
16
- $ = 1;
17
- var s = Symbol.for("react.transitional.element"), f = Symbol.for("react.fragment");
15
+ if (F) return _;
16
+ F = 1;
17
+ var s = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
18
18
  function c(i, o, u) {
19
- var l = null;
20
- if (u !== void 0 && (l = "" + u), o.key !== void 0 && (l = "" + o.key), "key" in o) {
19
+ var f = null;
20
+ if (u !== void 0 && (f = "" + u), o.key !== void 0 && (f = "" + o.key), "key" in o) {
21
21
  u = {};
22
- for (var d in o)
23
- d !== "key" && (u[d] = o[d]);
22
+ for (var l in o)
23
+ l !== "key" && (u[l] = o[l]);
24
24
  } else u = o;
25
25
  return o = u.ref, {
26
26
  $$typeof: s,
27
27
  type: i,
28
- key: l,
28
+ key: f,
29
29
  ref: o !== void 0 ? o : null,
30
30
  props: u
31
31
  };
32
32
  }
33
- return E.Fragment = f, E.jsx = c, E.jsxs = c, E;
33
+ return _.Fragment = m, _.jsx = c, _.jsxs = c, _;
34
34
  }
35
- var _ = {};
35
+ var R = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,16 +42,16 @@ var _ = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var I;
45
+ var D;
46
46
  function ae() {
47
- return I || (I = 1, process.env.NODE_ENV !== "production" && (function() {
47
+ return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
48
48
  function s(e) {
49
49
  if (e == null) return null;
50
50
  if (typeof e == "function")
51
51
  return e.$$typeof === Z ? null : e.displayName || e.name || null;
52
52
  if (typeof e == "string") return e;
53
53
  switch (e) {
54
- case p:
54
+ case k:
55
55
  return "Fragment";
56
56
  case q:
57
57
  return "Profiler";
@@ -79,7 +79,7 @@ function ae() {
79
79
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
80
  case B:
81
81
  return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
82
- case T:
82
+ case A:
83
83
  r = e._payload, e = e._init;
84
84
  try {
85
85
  return s(e(r));
@@ -88,12 +88,12 @@ function ae() {
88
88
  }
89
89
  return null;
90
90
  }
91
- function f(e) {
91
+ function m(e) {
92
92
  return "" + e;
93
93
  }
94
94
  function c(e) {
95
95
  try {
96
- f(e);
96
+ m(e);
97
97
  var r = !1;
98
98
  } catch {
99
99
  r = !0;
@@ -105,12 +105,12 @@ function ae() {
105
105
  r,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
107
  n
108
- ), f(e);
108
+ ), m(e);
109
109
  }
110
110
  }
111
111
  function i(e) {
112
- if (e === p) return "<>";
113
- if (typeof e == "object" && e !== null && e.$$typeof === T)
112
+ if (e === k) return "<>";
113
+ if (typeof e == "object" && e !== null && e.$$typeof === A)
114
114
  return "<...>";
115
115
  try {
116
116
  var r = s(e);
@@ -120,22 +120,22 @@ function ae() {
120
120
  }
121
121
  }
122
122
  function o() {
123
- var e = k.A;
123
+ var e = O.A;
124
124
  return e === null ? null : e.getOwner();
125
125
  }
126
126
  function u() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function l(e) {
130
- if (y.call(e, "key")) {
129
+ function f(e) {
130
+ if (j.call(e, "key")) {
131
131
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
132
132
  if (r && r.isReactWarning) return !1;
133
133
  }
134
134
  return e.key !== void 0;
135
135
  }
136
- function d(e, r) {
136
+ function l(e, r) {
137
137
  function t() {
138
- j || (j = !0, console.error(
138
+ N || (N = !0, console.error(
139
139
  "%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)",
140
140
  r
141
141
  ));
@@ -145,23 +145,23 @@ function ae() {
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function L() {
148
+ function T() {
149
149
  var e = s(this.type);
150
- return x[e] || (x[e] = !0, console.error(
150
+ return C[e] || (C[e] = !0, console.error(
151
151
  "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."
152
152
  )), e = this.props.ref, e !== void 0 ? e : null;
153
153
  }
154
- function M(e, r, t, n, v, O) {
154
+ function E(e, r, t, n, b, S) {
155
155
  var a = t.ref;
156
156
  return e = {
157
- $$typeof: w,
157
+ $$typeof: x,
158
158
  type: e,
159
159
  key: r,
160
160
  props: t,
161
161
  _owner: n
162
162
  }, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
163
163
  enumerable: !1,
164
- get: L
164
+ get: T
165
165
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
@@ -176,33 +176,33 @@ function ae() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: v
179
+ value: b
180
180
  }), Object.defineProperty(e, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: O
184
+ value: S
185
185
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
186
186
  }
187
- function S(e, r, t, n, v, O) {
187
+ function y(e, r, t, n, b, S) {
188
188
  var a = r.children;
189
189
  if (a !== void 0)
190
190
  if (n)
191
191
  if (Q(a)) {
192
192
  for (n = 0; n < a.length; n++)
193
- g(a[n]);
193
+ h(a[n]);
194
194
  Object.freeze && Object.freeze(a);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else g(a);
200
- if (y.call(r, "key")) {
199
+ else h(a);
200
+ if (j.call(r, "key")) {
201
201
  a = s(e);
202
- var m = Object.keys(r).filter(function(K) {
202
+ var d = Object.keys(r).filter(function(K) {
203
203
  return K !== "key";
204
204
  });
205
- n = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", Y[a + n] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ n = 0 < d.length ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (d = 0 < d.length ? "{" + d.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
@@ -211,98 +211,104 @@ React keys must be passed directly to JSX without using spread:
211
211
  <%s key={someKey} {...props} />`,
212
212
  n,
213
213
  a,
214
- m,
214
+ d,
215
215
  a
216
- ), Y[a + n] = !0);
216
+ ), I[a + n] = !0);
217
217
  }
218
- if (a = null, t !== void 0 && (c(t), a = "" + t), l(r) && (c(r.key), a = "" + r.key), "key" in r) {
218
+ if (a = null, t !== void 0 && (c(t), a = "" + t), f(r) && (c(r.key), a = "" + r.key), "key" in r) {
219
219
  t = {};
220
- for (var P in r)
221
- P !== "key" && (t[P] = r[P]);
220
+ for (var g in r)
221
+ g !== "key" && (t[g] = r[g]);
222
222
  } else t = r;
223
- return a && d(
223
+ return a && l(
224
224
  t,
225
225
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
226
- ), M(
226
+ ), E(
227
227
  e,
228
228
  a,
229
229
  t,
230
230
  o(),
231
- v,
232
- O
231
+ b,
232
+ S
233
233
  );
234
234
  }
235
- function g(e) {
236
- h(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? h(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
237
- }
238
235
  function h(e) {
239
- return typeof e == "object" && e !== null && e.$$typeof === w;
236
+ w(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === A && (e._payload.status === "fulfilled" ? w(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
237
+ }
238
+ function w(e) {
239
+ return typeof e == "object" && e !== null && e.$$typeof === x;
240
240
  }
241
- var R = ee, w = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), V = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), k = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, y = Object.prototype.hasOwnProperty, Q = Array.isArray, A = console.createTask ? console.createTask : function() {
241
+ var v = ee, x = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), V = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), O = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, Q = Array.isArray, P = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- R = {
244
+ v = {
245
245
  react_stack_bottom_frame: function(e) {
246
246
  return e();
247
247
  }
248
248
  };
249
- var j, x = {}, N = R.react_stack_bottom_frame.bind(
250
- R,
249
+ var N, C = {}, Y = v.react_stack_bottom_frame.bind(
250
+ v,
251
251
  u
252
- )(), C = A(i(u)), Y = {};
253
- _.Fragment = p, _.jsx = function(e, r, t) {
254
- var n = 1e4 > k.recentlyCreatedOwnerStacks++;
255
- return S(
252
+ )(), $ = P(i(u)), I = {};
253
+ R.Fragment = k, R.jsx = function(e, r, t) {
254
+ var n = 1e4 > O.recentlyCreatedOwnerStacks++;
255
+ return y(
256
256
  e,
257
257
  r,
258
258
  t,
259
259
  !1,
260
- n ? Error("react-stack-top-frame") : N,
261
- n ? A(i(e)) : C
260
+ n ? Error("react-stack-top-frame") : Y,
261
+ n ? P(i(e)) : $
262
262
  );
263
- }, _.jsxs = function(e, r, t) {
264
- var n = 1e4 > k.recentlyCreatedOwnerStacks++;
265
- return S(
263
+ }, R.jsxs = function(e, r, t) {
264
+ var n = 1e4 > O.recentlyCreatedOwnerStacks++;
265
+ return y(
266
266
  e,
267
267
  r,
268
268
  t,
269
269
  !0,
270
- n ? Error("react-stack-top-frame") : N,
271
- n ? A(i(e)) : C
270
+ n ? Error("react-stack-top-frame") : Y,
271
+ n ? P(i(e)) : $
272
272
  );
273
273
  };
274
- })()), _;
274
+ })()), R;
275
275
  }
276
- var F;
276
+ var L;
277
277
  function oe() {
278
- return F || (F = 1, process.env.NODE_ENV === "production" ? b.exports = ne() : b.exports = ae()), b.exports;
278
+ return L || (L = 1, process.env.NODE_ENV === "production" ? p.exports = ne() : p.exports = ae()), p.exports;
279
279
  }
280
280
  var se = oe();
281
281
  const ce = ({
282
282
  backendUrl: s,
283
- appName: f,
283
+ appName: m,
284
284
  agentAvatar: c,
285
- inspector: i,
286
- appContext: o,
287
- className: u
285
+ disclaimer: i,
286
+ emptyText: o,
287
+ inspector: u,
288
+ interceptor: f,
289
+ appContext: l,
290
+ className: T
288
291
  }) => {
289
- const l = re(null);
290
- return D(() => {
291
- l.current && o && l.current.setAppContext(o);
292
- }, [o]), /* @__PURE__ */ se.jsx(
292
+ const E = re(null);
293
+ return M(() => {
294
+ E.current && l && E.current.setAppContext(l);
295
+ }, [l]), /* @__PURE__ */ se.jsx(
293
296
  "agent-chat",
294
297
  {
295
- ref: l,
298
+ ref: E,
296
299
  "backend-url": s,
297
- "app-name": f,
300
+ "app-name": m,
298
301
  "agent-avatar": c,
299
- inspector: i ? "true" : void 0,
300
- class: u
302
+ disclaimer: i,
303
+ "empty-text": o,
304
+ inspector: u ? "true" : void 0,
305
+ interceptor: f ? !0 : void 0,
306
+ class: T
301
307
  }
302
308
  );
303
309
  };
304
310
  function ie(s) {
305
- D(() => {
311
+ M(() => {
306
312
  te.registerPortal(s);
307
313
  }, [s]);
308
314
  }
@@ -1,4 +1,4 @@
1
- (function(l,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("site-operator")):typeof define=="function"&&define.amd?define(["exports","react","site-operator"],i):(l=typeof globalThis<"u"?globalThis:l||self,i(l.SiteOperatorReact={},l.React,l.SiteOperator))})(this,(function(l,i,W){"use strict";var v={exports:{}},_={};/**
1
+ (function(l,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("site-operator")):typeof define=="function"&&define.amd?define(["exports","react","site-operator"],i):(l=typeof globalThis<"u"?globalThis:l||self,i(l.SiteOperatorReact={},l.React,l.SiteOperator))})(this,(function(l,i,$){"use strict";var b={exports:{}},p={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var y;function U(){if(y)return _;y=1;var s=Symbol.for("react.transitional.element"),m=Symbol.for("react.fragment");function f(d,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:s,type:d,key:c,ref:o!==void 0?o:null,props:u}}return _.Fragment=m,_.jsx=f,_.jsxs=f,_}var R={};/**
9
+ */var j;function J(){if(j)return p;j=1;var s=Symbol.for("react.transitional.element"),E=Symbol.for("react.fragment");function f(d,o,u){var m=null;if(u!==void 0&&(m=""+u),o.key!==void 0&&(m=""+o.key),"key"in o){u={};for(var c in o)c!=="key"&&(u[c]=o[c])}else u=o;return o=u.ref,{$$typeof:s,type:d,key:m,ref:o!==void 0?o:null,props:u}}return p.Fragment=E,p.jsx=f,p.jsxs=f,p}var R={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,9 +14,9 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var g;function $(){return g||(g=1,process.env.NODE_ENV!=="production"&&(function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case Z:return"Profiler";case H:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case B:return"Portal";case K:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function m(e){return""+e}function f(e){try{m(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),m(e)}}function d(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=s(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function o(){var e=S.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function c(e){if(Y.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function p(e,r){function t(){I||(I=!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))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function G(){var e=s(this.type);return F[e]||(F[e]=!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.")),e=this.props.ref,e!==void 0?e:null}function X(e,r,t,n,T,P){var a=t.ref;return e={$$typeof:C,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:G}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,r,t,n,T,P){var a=r.children;if(a!==void 0)if(n)if(se(a)){for(n=0;n<a.length;n++)x(a[n]);Object.freeze&&Object.freeze(a)}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 x(a);if(Y.call(r,"key")){a=s(e);var E=Object.keys(r).filter(function(ue){return ue!=="key"});n=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",L[a+n]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var w;function V(){return w||(w=1,process.env.NODE_ENV!=="production"&&(function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case Z:return"Profiler";case H:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case B:return"Portal";case K:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case A:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function E(e){return""+e}function f(e){try{E(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),E(e)}}function d(e){if(e===S)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===A)return"<...>";try{var r=s(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function o(){var e=P.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function m(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function c(e,r){function t(){D||(D=!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))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function O(){var e=s(this.type);return M[e]||(M[e]=!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.")),e=this.props.ref,e!==void 0?e:null}function v(e,r,t,n,k,y){var a=t.ref;return e={$$typeof:I,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:O}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,r,t,n,k,y){var a=r.children;if(a!==void 0)if(n)if(se(a)){for(n=0;n<a.length;n++)C(a[n]);Object.freeze&&Object.freeze(a)}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 C(a);if(F.call(r,"key")){a=s(e);var _=Object.keys(r).filter(function(ue){return ue!=="key"});n=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",U[a+n]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,n,a,E,a),L[a+n]=!0)}if(a=null,t!==void 0&&(f(t),a=""+t),c(r)&&(f(r.key),a=""+r.key),"key"in r){t={};for(var h in r)h!=="key"&&(t[h]=r[h])}else t=r;return a&&p(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),X(e,a,t,o(),T,P)}function x(e){N(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?N(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function N(e){return typeof e=="object"&&e!==null&&e.$$typeof===C}var b=i,C=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),S=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,se=Array.isArray,A=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(e){return e()}};var I,F={},D=b.react_stack_bottom_frame.bind(b,u)(),M=A(d(u)),L={};R.Fragment=k,R.jsx=function(e,r,t){var n=1e4>S.recentlyCreatedOwnerStacks++;return w(e,r,t,!1,n?Error("react-stack-top-frame"):D,n?A(d(e)):M)},R.jsxs=function(e,r,t){var n=1e4>S.recentlyCreatedOwnerStacks++;return w(e,r,t,!0,n?Error("react-stack-top-frame"):D,n?A(d(e)):M)}})()),R}var j;function J(){return j||(j=1,process.env.NODE_ENV==="production"?v.exports=U():v.exports=$()),v.exports}var V=J();const z=({backendUrl:s,appName:m,agentAvatar:f,inspector:d,appContext:o,className:u})=>{const c=i.useRef(null);return i.useEffect(()=>{c.current&&o&&c.current.setAppContext(o)},[o]),V.jsx("agent-chat",{ref:c,"backend-url":s,"app-name":m,"agent-avatar":f,inspector:d?"true":void 0,class:u})};function q(s){i.useEffect(()=>{W.chatPortalService.registerPortal(s)},[s])}l.AgentChat=z,l.useChatPortal=q,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
22
+ <%s key={someKey} {...props} />`,n,a,_,a),U[a+n]=!0)}if(a=null,t!==void 0&&(f(t),a=""+t),m(r)&&(f(r.key),a=""+r.key),"key"in r){t={};for(var g in r)g!=="key"&&(t[g]=r[g])}else t=r;return a&&c(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),v(e,a,t,o(),k,y)}function C(e){Y(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===A&&(e._payload.status==="fulfilled"?Y(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function Y(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}var T=i,I=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),P=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,se=Array.isArray,h=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var D,M={},L=T.react_stack_bottom_frame.bind(T,u)(),W=h(d(u)),U={};R.Fragment=S,R.jsx=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return N(e,r,t,!1,n?Error("react-stack-top-frame"):L,n?h(d(e)):W)},R.jsxs=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return N(e,r,t,!0,n?Error("react-stack-top-frame"):L,n?h(d(e)):W)}})()),R}var x;function z(){return x||(x=1,process.env.NODE_ENV==="production"?b.exports=J():b.exports=V()),b.exports}var q=z();const G=({backendUrl:s,appName:E,agentAvatar:f,disclaimer:d,emptyText:o,inspector:u,interceptor:m,appContext:c,className:O})=>{const v=i.useRef(null);return i.useEffect(()=>{v.current&&c&&v.current.setAppContext(c)},[c]),q.jsx("agent-chat",{ref:v,"backend-url":s,"app-name":E,"agent-avatar":f,disclaimer:d,"empty-text":o,inspector:u?"true":void 0,interceptor:m?!0:void 0,class:O})};function X(s){i.useEffect(()=>{$.chatPortalService.registerPortal(s)},[s])}l.AgentChat=G,l.useChatPortal=X,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "site-operator-react",
3
- "version": "0.1.0",
3
+ "version": "0.1.4",
4
4
  "description": "React wrapper for site-operator, providing AgentChat component and hooks.",
5
5
  "type": "module",
6
- "author": "jostvian-agent",
6
+ "author": "jostvian",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "react-dom": "^19.0.0",
44
44
  "@types/react": "^19.0.0",
45
45
  "@types/react-dom": "^19.0.0",
46
- "typescript": "~5.9.3",
46
+ "typescript": "^5.7.0",
47
47
  "vite": "^6.0.0",
48
48
  "vite-plugin-dts": "^4.5.0"
49
49
  }