site-operator-react 0.1.4 → 0.1.9

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
@@ -24,10 +24,20 @@ function App() {
24
24
  <div className="App">
25
25
  <AgentChat
26
26
  backendUrl="http://localhost:8001/ag_ui"
27
+ conversationUrl="http://localhost:8003"
27
28
  appName="My React App"
28
29
  agentAvatar="/avatar.png"
29
- disclaimer="Agent puede cometer errores. Verifica la información importante"
30
- emptyText="¿Cómo puedo ayudarte hoy?"
30
+ header={{
31
+ title: "Mi Asistente",
32
+ hide: false
33
+ }}
34
+ composer={{
35
+ disclaimer: "Agent puede cometer errores. Verifica la información importante",
36
+ placeholder: "Enviar un mensaje a Agent"
37
+ }}
38
+ thread={{
39
+ emptyText: "¿Cómo puedo ayudarte hoy?"
40
+ }}
31
41
  />
32
42
  </div>
33
43
  );
package/dist/index.d.ts CHANGED
@@ -8,24 +8,44 @@ export declare const AgentChat: default_2.FC<AgentChatProps>;
8
8
 
9
9
  export declare interface AgentChatProps {
10
10
  backendUrl?: string;
11
+ conversationUrl?: string;
11
12
  appName?: string;
12
13
  agentAvatar?: string;
13
- disclaimer?: string;
14
- emptyText?: string;
15
14
  inspector?: boolean;
16
15
  interceptor?: boolean;
17
- appContext?: AgentState;
18
16
  className?: string;
17
+ composer?: ComposerProps;
18
+ thread?: ThreadViewProps;
19
+ header?: HeaderProps;
20
+ context?: ContextProps;
19
21
  }
20
22
 
21
23
  export { AgentState }
22
24
 
25
+ export declare interface ComposerProps {
26
+ disclaimer?: string;
27
+ placeholder?: string;
28
+ }
29
+
30
+ export declare interface ContextProps {
31
+ appContext?: AgentState;
32
+ }
33
+
34
+ export declare interface HeaderProps {
35
+ title?: string;
36
+ hide?: boolean;
37
+ }
38
+
23
39
  export { NavGraph }
24
40
 
25
41
  export { NavNode }
26
42
 
27
43
  export { PortalSpec }
28
44
 
45
+ export declare interface ThreadViewProps {
46
+ emptyText?: string;
47
+ }
48
+
29
49
  /**
30
50
  * A hook to register a Chat Portal specification for the agent.
31
51
  * This allows the agent to navigate and control the host application.
@@ -1,6 +1,6 @@
1
1
  import ee, { useRef as re, useEffect as M } from "react";
2
2
  import { chatPortalService as te } from "site-operator";
3
- var p = { exports: {} }, _ = {};
3
+ var A = { exports: {} }, p = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -12,27 +12,27 @@ var p = { exports: {} }, _ = {};
12
12
  */
13
13
  var F;
14
14
  function ne() {
15
- if (F) return _;
15
+ if (F) return p;
16
16
  F = 1;
17
- var s = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
18
- function c(i, o, u) {
19
- var f = null;
20
- if (u !== void 0 && (f = "" + u), o.key !== void 0 && (f = "" + o.key), "key" in o) {
17
+ var l = Symbol.for("react.transitional.element"), E = Symbol.for("react.fragment");
18
+ function f(d, o, u) {
19
+ var m = null;
20
+ if (u !== void 0 && (m = "" + u), o.key !== void 0 && (m = "" + o.key), "key" in o) {
21
21
  u = {};
22
- for (var l in o)
23
- l !== "key" && (u[l] = o[l]);
22
+ for (var s in o)
23
+ s !== "key" && (u[s] = o[s]);
24
24
  } else u = o;
25
25
  return o = u.ref, {
26
- $$typeof: s,
27
- type: i,
28
- key: f,
26
+ $$typeof: l,
27
+ type: d,
28
+ key: m,
29
29
  ref: o !== void 0 ? o : null,
30
30
  props: u
31
31
  };
32
32
  }
33
- return _.Fragment = m, _.jsx = c, _.jsxs = c, _;
33
+ return p.Fragment = E, p.jsx = f, p.jsxs = f, p;
34
34
  }
35
- var R = {};
35
+ var b = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -45,13 +45,13 @@ var R = {};
45
45
  var D;
46
46
  function ae() {
47
47
  return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
48
- function s(e) {
48
+ function l(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 k:
54
+ case O:
55
55
  return "Fragment";
56
56
  case q:
57
57
  return "Profiler";
@@ -78,22 +78,22 @@ function ae() {
78
78
  var r = e.render;
79
79
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
80
  case B:
81
- return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
82
- case A:
81
+ return r = e.displayName || null, r !== null ? r : l(e.type) || "Memo";
82
+ case P:
83
83
  r = e._payload, e = e._init;
84
84
  try {
85
- return s(e(r));
85
+ return l(e(r));
86
86
  } catch {
87
87
  }
88
88
  }
89
89
  return null;
90
90
  }
91
- function m(e) {
91
+ function E(e) {
92
92
  return "" + e;
93
93
  }
94
- function c(e) {
94
+ function f(e) {
95
95
  try {
96
- m(e);
96
+ E(e);
97
97
  var r = !1;
98
98
  } catch {
99
99
  r = !0;
@@ -105,37 +105,37 @@ 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
- ), m(e);
108
+ ), E(e);
109
109
  }
110
110
  }
111
- function i(e) {
112
- if (e === k) return "<>";
113
- if (typeof e == "object" && e !== null && e.$$typeof === A)
111
+ function d(e) {
112
+ if (e === O) return "<>";
113
+ if (typeof e == "object" && e !== null && e.$$typeof === P)
114
114
  return "<...>";
115
115
  try {
116
- var r = s(e);
116
+ var r = l(e);
117
117
  return r ? "<" + r + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
122
  function o() {
123
- var e = O.A;
123
+ var e = S.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 f(e) {
130
- if (j.call(e, "key")) {
129
+ function m(e) {
130
+ if (h.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 l(e, r) {
136
+ function s(e, r) {
137
137
  function t() {
138
- N || (N = !0, console.error(
138
+ C || (C = !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,13 +145,13 @@ function ae() {
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function T() {
149
- var e = s(this.type);
150
- return C[e] || (C[e] = !0, console.error(
148
+ function R() {
149
+ var e = l(this.type);
150
+ return N[e] || (N[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 E(e, r, t, n, b, S) {
154
+ function c(e, r, t, n, k, g) {
155
155
  var a = t.ref;
156
156
  return e = {
157
157
  $$typeof: x,
@@ -161,7 +161,7 @@ function ae() {
161
161
  _owner: n
162
162
  }, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
163
163
  enumerable: !1,
164
- get: T
164
+ get: R
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: b
179
+ value: k
180
180
  }), Object.defineProperty(e, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: S
184
+ value: g
185
185
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
186
186
  }
187
- function y(e, r, t, n, b, S) {
187
+ function i(e, r, t, n, k, g) {
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
- h(a[n]);
193
+ _(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 h(a);
200
- if (j.call(r, "key")) {
201
- a = s(e);
202
- var d = Object.keys(r).filter(function(K) {
199
+ else _(a);
200
+ if (h.call(r, "key")) {
201
+ a = l(e);
202
+ var v = Object.keys(r).filter(function(K) {
203
203
  return K !== "key";
204
204
  });
205
- n = 0 < d.length ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (d = 0 < d.length ? "{" + d.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ n = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (v = 0 < v.length ? "{" + v.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,108 +211,114 @@ React keys must be passed directly to JSX without using spread:
211
211
  <%s key={someKey} {...props} />`,
212
212
  n,
213
213
  a,
214
- d,
214
+ v,
215
215
  a
216
216
  ), I[a + n] = !0);
217
217
  }
218
- if (a = null, t !== void 0 && (c(t), a = "" + t), f(r) && (c(r.key), a = "" + r.key), "key" in r) {
218
+ if (a = null, t !== void 0 && (f(t), a = "" + t), m(r) && (f(r.key), a = "" + r.key), "key" in r) {
219
219
  t = {};
220
- for (var g in r)
221
- g !== "key" && (t[g] = r[g]);
220
+ for (var w in r)
221
+ w !== "key" && (t[w] = r[w]);
222
222
  } else t = r;
223
- return a && l(
223
+ return a && s(
224
224
  t,
225
225
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
226
- ), E(
226
+ ), c(
227
227
  e,
228
228
  a,
229
229
  t,
230
230
  o(),
231
- b,
232
- S
231
+ k,
232
+ g
233
233
  );
234
234
  }
235
- function h(e) {
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));
235
+ function _(e) {
236
+ j(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === P && (e._payload.status === "fulfilled" ? j(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
237
237
  }
238
- function w(e) {
238
+ function j(e) {
239
239
  return typeof e == "object" && e !== null && e.$$typeof === x;
240
240
  }
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() {
241
+ var T = ee, x = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), O = 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"), P = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), S = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, h = Object.prototype.hasOwnProperty, Q = Array.isArray, y = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- v = {
244
+ T = {
245
245
  react_stack_bottom_frame: function(e) {
246
246
  return e();
247
247
  }
248
248
  };
249
- var N, C = {}, Y = v.react_stack_bottom_frame.bind(
250
- v,
249
+ var C, N = {}, Y = T.react_stack_bottom_frame.bind(
250
+ T,
251
251
  u
252
- )(), $ = P(i(u)), I = {};
253
- R.Fragment = k, R.jsx = function(e, r, t) {
254
- var n = 1e4 > O.recentlyCreatedOwnerStacks++;
255
- return y(
252
+ )(), $ = y(d(u)), I = {};
253
+ b.Fragment = O, b.jsx = function(e, r, t) {
254
+ var n = 1e4 > S.recentlyCreatedOwnerStacks++;
255
+ return i(
256
256
  e,
257
257
  r,
258
258
  t,
259
259
  !1,
260
260
  n ? Error("react-stack-top-frame") : Y,
261
- n ? P(i(e)) : $
261
+ n ? y(d(e)) : $
262
262
  );
263
- }, R.jsxs = function(e, r, t) {
264
- var n = 1e4 > O.recentlyCreatedOwnerStacks++;
265
- return y(
263
+ }, b.jsxs = function(e, r, t) {
264
+ var n = 1e4 > S.recentlyCreatedOwnerStacks++;
265
+ return i(
266
266
  e,
267
267
  r,
268
268
  t,
269
269
  !0,
270
270
  n ? Error("react-stack-top-frame") : Y,
271
- n ? P(i(e)) : $
271
+ n ? y(d(e)) : $
272
272
  );
273
273
  };
274
- })()), R;
274
+ })()), b;
275
275
  }
276
276
  var L;
277
277
  function oe() {
278
- return L || (L = 1, process.env.NODE_ENV === "production" ? p.exports = ne() : p.exports = ae()), p.exports;
278
+ return L || (L = 1, process.env.NODE_ENV === "production" ? A.exports = ne() : A.exports = ae()), A.exports;
279
279
  }
280
- var se = oe();
281
- const ce = ({
282
- backendUrl: s,
283
- appName: m,
284
- agentAvatar: c,
285
- disclaimer: i,
286
- emptyText: o,
287
- inspector: u,
288
- interceptor: f,
289
- appContext: l,
290
- className: T
280
+ var le = oe();
281
+ const ie = ({
282
+ backendUrl: l,
283
+ conversationUrl: E,
284
+ appName: f,
285
+ agentAvatar: d,
286
+ inspector: o,
287
+ interceptor: u,
288
+ className: m,
289
+ composer: s,
290
+ thread: R,
291
+ header: c,
292
+ context: i
291
293
  }) => {
292
- const E = re(null);
294
+ const _ = re(null);
293
295
  return M(() => {
294
- E.current && l && E.current.setAppContext(l);
295
- }, [l]), /* @__PURE__ */ se.jsx(
296
+ _.current && (i != null && i.appContext) && _.current.setAppContext(i.appContext);
297
+ }, [i == null ? void 0 : i.appContext]), /* @__PURE__ */ le.jsx(
296
298
  "agent-chat",
297
299
  {
298
- ref: E,
299
- "backend-url": s,
300
- "app-name": m,
301
- "agent-avatar": c,
302
- disclaimer: i,
303
- "empty-text": o,
304
- inspector: u ? "true" : void 0,
305
- interceptor: f ? !0 : void 0,
306
- class: T
300
+ ref: _,
301
+ "backend-url": l,
302
+ "conversation-url": E,
303
+ "app-name": f,
304
+ "agent-avatar": d,
305
+ disclaimer: s == null ? void 0 : s.disclaimer,
306
+ placeholder: s == null ? void 0 : s.placeholder,
307
+ "empty-text": R == null ? void 0 : R.emptyText,
308
+ "header-title": c == null ? void 0 : c.title,
309
+ "hide-header": c == null ? void 0 : c.hide,
310
+ inspector: o ? "true" : void 0,
311
+ interceptor: u ? !0 : void 0,
312
+ class: m
307
313
  }
308
314
  );
309
315
  };
310
- function ie(s) {
316
+ function ce(l) {
311
317
  M(() => {
312
- te.registerPortal(s);
313
- }, [s]);
318
+ te.registerPortal(l);
319
+ }, [l]);
314
320
  }
315
321
  export {
316
- ce as AgentChat,
317
- ie as useChatPortal
322
+ ie as AgentChat,
323
+ ce as useChatPortal
318
324
  };
@@ -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,$){"use strict";var b={exports:{}},p={};/**
1
+ (function(c,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("site-operator")):typeof define=="function"&&define.amd?define(["exports","react","site-operator"],f):(c=typeof globalThis<"u"?globalThis:c||self,f(c.SiteOperatorReact={},c.React,c.SiteOperator))})(this,(function(c,f,$){"use strict";var O={exports:{}},b={};/**
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 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={};/**
9
+ */var x;function J(){if(x)return b;x=1;var u=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function E(m,o,s){var _=null;if(s!==void 0&&(_=""+s),o.key!==void 0&&(_=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:u,type:m,key:_,ref:o!==void 0?o:null,props:s}}return b.Fragment=p,b.jsx=E,b.jsxs=E,b}var T={};/**
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 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:
17
+ */var C;function V(){return C||(C=1,process.env.NODE_ENV!=="production"&&(function(){function u(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 P: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:u(e.type)||"Memo";case y:r=e._payload,e=e._init;try{return u(e(r))}catch{}}return null}function p(e){return""+e}function E(e){try{p(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),p(e)}}function m(e){if(e===P)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===y)return"<...>";try{var r=u(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function o(){var e=g.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function _(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 l(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 k(){var e=u(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 d(e,r,t,n,A,w){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:k}):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:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function i(e,r,t,n,A,w){var a=r.children;if(a!==void 0)if(n)if(ue(a)){for(n=0;n<a.length;n++)R(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 R(a);if(F.call(r,"key")){a=u(e);var v=Object.keys(r).filter(function(se){return se!=="key"});n=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",U[a+n]||(v=0<v.length?"{"+v.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,_,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"})}));
22
+ <%s key={someKey} {...props} />`,n,a,v,a),U[a+n]=!0)}if(a=null,t!==void 0&&(E(t),a=""+t),_(r)&&(E(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&&l(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),d(e,a,t,o(),A,w)}function R(e){Y(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===y&&(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 S=f,I=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),P=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"),y=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),g=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,ue=Array.isArray,j=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(e){return e()}};var D,M={},L=S.react_stack_bottom_frame.bind(S,s)(),W=j(m(s)),U={};T.Fragment=P,T.jsx=function(e,r,t){var n=1e4>g.recentlyCreatedOwnerStacks++;return i(e,r,t,!1,n?Error("react-stack-top-frame"):L,n?j(m(e)):W)},T.jsxs=function(e,r,t){var n=1e4>g.recentlyCreatedOwnerStacks++;return i(e,r,t,!0,n?Error("react-stack-top-frame"):L,n?j(m(e)):W)}})()),T}var N;function z(){return N||(N=1,process.env.NODE_ENV==="production"?O.exports=J():O.exports=V()),O.exports}var q=z();const G=({backendUrl:u,conversationUrl:p,appName:E,agentAvatar:m,inspector:o,interceptor:s,className:_,composer:l,thread:k,header:d,context:i})=>{const R=f.useRef(null);return f.useEffect(()=>{R.current&&(i!=null&&i.appContext)&&R.current.setAppContext(i.appContext)},[i==null?void 0:i.appContext]),q.jsx("agent-chat",{ref:R,"backend-url":u,"conversation-url":p,"app-name":E,"agent-avatar":m,disclaimer:l==null?void 0:l.disclaimer,placeholder:l==null?void 0:l.placeholder,"empty-text":k==null?void 0:k.emptyText,"header-title":d==null?void 0:d.title,"hide-header":d==null?void 0:d.hide,inspector:o?"true":void 0,interceptor:s?!0:void 0,class:_})};function X(u){f.useEffect(()=>{$.chatPortalService.registerPortal(u)},[u])}c.AgentChat=G,c.useChatPortal=X,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "site-operator-react",
3
- "version": "0.1.4",
3
+ "version": "0.1.9",
4
4
  "description": "React wrapper for site-operator, providing AgentChat component and hooks.",
5
5
  "type": "module",
6
6
  "author": "jostvian",