@fencyai/react 0.1.123 → 0.1.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +93 -93
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as k, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { createStream as K,
|
|
2
|
+
import { createStream as K, isStreamTimeoutEvent as _, isStreamNotFoundEvent as J, isAgentTaskProgressItemUpdatedEvent as V, createAgentTask as q } from "@fencyai/js";
|
|
3
3
|
import { createContext as G, useState as w, useRef as A, useEffect as E, useCallback as W, useContext as X, useMemo as U } from "react";
|
|
4
4
|
import { useInView as Q, motion as v, AnimatePresence as L } from "motion/react";
|
|
5
5
|
import Y from "react-markdown";
|
|
@@ -22,8 +22,8 @@ function te(e) {
|
|
|
22
22
|
let d = 0;
|
|
23
23
|
for (; r < c; ) {
|
|
24
24
|
l && (t[r] === 10 && (d = ++r), l = !1);
|
|
25
|
-
let
|
|
26
|
-
for (; r < c &&
|
|
25
|
+
let a = -1;
|
|
26
|
+
for (; r < c && a === -1; ++r)
|
|
27
27
|
switch (t[r]) {
|
|
28
28
|
case 58:
|
|
29
29
|
n === -1 && (n = r - d);
|
|
@@ -31,12 +31,12 @@ function te(e) {
|
|
|
31
31
|
case 13:
|
|
32
32
|
l = !0;
|
|
33
33
|
case 10:
|
|
34
|
-
|
|
34
|
+
a = r;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if (a === -1)
|
|
38
38
|
break;
|
|
39
|
-
e(t.subarray(d,
|
|
39
|
+
e(t.subarray(d, a), n), d = r, n = -1;
|
|
40
40
|
}
|
|
41
41
|
d === c ? t = void 0 : d !== 0 && (t = t.subarray(d), r -= d);
|
|
42
42
|
};
|
|
@@ -48,20 +48,20 @@ function ne(e, t, r) {
|
|
|
48
48
|
if (s.length === 0)
|
|
49
49
|
r == null || r(n), n = P();
|
|
50
50
|
else if (c > 0) {
|
|
51
|
-
const d = l.decode(s.subarray(0, c)),
|
|
51
|
+
const d = l.decode(s.subarray(0, c)), a = c + (s[c + 1] === 32 ? 2 : 1), o = l.decode(s.subarray(a));
|
|
52
52
|
switch (d) {
|
|
53
53
|
case "data":
|
|
54
54
|
n.data = n.data ? n.data + `
|
|
55
|
-
` +
|
|
55
|
+
` + o : o;
|
|
56
56
|
break;
|
|
57
57
|
case "event":
|
|
58
|
-
n.event =
|
|
58
|
+
n.event = o;
|
|
59
59
|
break;
|
|
60
60
|
case "id":
|
|
61
|
-
e(n.id =
|
|
61
|
+
e(n.id = o);
|
|
62
62
|
break;
|
|
63
63
|
case "retry":
|
|
64
|
-
const y = parseInt(
|
|
64
|
+
const y = parseInt(o, 10);
|
|
65
65
|
isNaN(y) || t(n.retry = y);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
@@ -80,7 +80,7 @@ function P() {
|
|
|
80
80
|
retry: void 0
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var ae = function(e, t) {
|
|
84
84
|
var r = {};
|
|
85
85
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
86
86
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -88,9 +88,9 @@ var oe = function(e, t) {
|
|
|
88
88
|
t.indexOf(n[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[l]) && (r[n[l]] = e[n[l]]);
|
|
89
89
|
return r;
|
|
90
90
|
};
|
|
91
|
-
const R = "text/event-stream",
|
|
91
|
+
const R = "text/event-stream", oe = 1e3, O = "last-event-id";
|
|
92
92
|
function ie(e, t) {
|
|
93
|
-
var { signal: r, headers: n, onopen: l, onmessage: u, onclose: s, onerror: c, openWhenHidden: d, fetch:
|
|
93
|
+
var { signal: r, headers: n, onopen: l, onmessage: u, onclose: s, onerror: c, openWhenHidden: d, fetch: a } = t, o = ae(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
94
94
|
return new Promise((y, g) => {
|
|
95
95
|
const h = Object.assign({}, n);
|
|
96
96
|
h.accept || (h.accept = R);
|
|
@@ -99,19 +99,19 @@ function ie(e, t) {
|
|
|
99
99
|
m.abort(), document.hidden || I();
|
|
100
100
|
}
|
|
101
101
|
d || document.addEventListener("visibilitychange", S);
|
|
102
|
-
let f =
|
|
102
|
+
let f = oe, b = 0;
|
|
103
103
|
function C() {
|
|
104
104
|
document.removeEventListener("visibilitychange", S), window.clearTimeout(b), m.abort();
|
|
105
105
|
}
|
|
106
106
|
r == null || r.addEventListener("abort", () => {
|
|
107
107
|
C(), y();
|
|
108
108
|
});
|
|
109
|
-
const p =
|
|
109
|
+
const p = a ?? window.fetch, x = l ?? se;
|
|
110
110
|
async function I() {
|
|
111
111
|
var D;
|
|
112
112
|
m = new AbortController();
|
|
113
113
|
try {
|
|
114
|
-
const M = await p(e, Object.assign(Object.assign({},
|
|
114
|
+
const M = await p(e, Object.assign(Object.assign({}, o), { headers: h, signal: m.signal }));
|
|
115
115
|
await x(M), await ee(M.body, te(ne((T) => {
|
|
116
116
|
T ? h[O] = T : delete h[O];
|
|
117
117
|
}, (T) => {
|
|
@@ -219,7 +219,7 @@ const de = 12e4, ue = (e) => {
|
|
|
219
219
|
function We({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
|
|
220
220
|
const [n, l] = w(
|
|
221
221
|
null
|
|
222
|
-
), [u, s] = w(!0), [c, d] = w(null), [
|
|
222
|
+
), [u, s] = w(!0), [c, d] = w(null), [a, o] = w([]), y = A(null), g = A(null);
|
|
223
223
|
E(() => {
|
|
224
224
|
e.then((f) => {
|
|
225
225
|
l(f), s(!1);
|
|
@@ -229,8 +229,8 @@ function We({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
|
|
|
229
229
|
}, [e]), E(() => {
|
|
230
230
|
n && !g.current && (g.current = new ce(n));
|
|
231
231
|
}, [n]), E(() => {
|
|
232
|
-
g.current && g.current.updateStreams(
|
|
233
|
-
}, [
|
|
232
|
+
g.current && g.current.updateStreams(a);
|
|
233
|
+
}, [a]), E(() => () => {
|
|
234
234
|
var f;
|
|
235
235
|
(f = g.current) == null || f.cleanup();
|
|
236
236
|
}, []);
|
|
@@ -238,7 +238,7 @@ function We({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
|
|
|
238
238
|
async (f = 3e4) => {
|
|
239
239
|
if (y.current)
|
|
240
240
|
return y.current;
|
|
241
|
-
const b = Date.now(), C =
|
|
241
|
+
const b = Date.now(), C = a.length > 0 ? a[a.length - 1] : null;
|
|
242
242
|
if (C && b - C.createdAt < f)
|
|
243
243
|
return C.stream;
|
|
244
244
|
const p = (async () => {
|
|
@@ -254,7 +254,7 @@ function We({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
|
|
|
254
254
|
stream: I.stream,
|
|
255
255
|
createdAt: Date.now()
|
|
256
256
|
};
|
|
257
|
-
return
|
|
257
|
+
return o((M) => {
|
|
258
258
|
const T = [...M, D];
|
|
259
259
|
return ue(T);
|
|
260
260
|
}), y.current = null, I.stream;
|
|
@@ -263,7 +263,7 @@ function We({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
|
|
|
263
263
|
})();
|
|
264
264
|
return y.current = p, p;
|
|
265
265
|
},
|
|
266
|
-
[n,
|
|
266
|
+
[n, a]
|
|
267
267
|
);
|
|
268
268
|
if (c)
|
|
269
269
|
return /* @__PURE__ */ k("div", { children: [
|
|
@@ -272,11 +272,11 @@ function We({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
|
|
|
272
272
|
] });
|
|
273
273
|
if (!n)
|
|
274
274
|
return null;
|
|
275
|
-
const m =
|
|
275
|
+
const m = a.length > 0 ? a[a.length - 1] : null, S = {
|
|
276
276
|
fency: n,
|
|
277
277
|
loading: u,
|
|
278
278
|
error: c,
|
|
279
|
-
activeStreams:
|
|
279
|
+
activeStreams: a,
|
|
280
280
|
latestStream: m,
|
|
281
281
|
eventManager: g.current,
|
|
282
282
|
getOrCreateStream: h
|
|
@@ -317,46 +317,46 @@ const me = (e) => {
|
|
|
317
317
|
return E(() => {
|
|
318
318
|
if (!t.eventManager) return;
|
|
319
319
|
const s = {
|
|
320
|
-
onMessage: (d,
|
|
320
|
+
onMessage: (d, a) => {
|
|
321
321
|
var y, g, h, m, S, f, b, C, p, x;
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
switch (
|
|
322
|
+
const o = me(d);
|
|
323
|
+
if (o)
|
|
324
|
+
switch (o.type) {
|
|
325
325
|
case "NewChatCompletionStreamChunk":
|
|
326
|
-
(y = e == null ? void 0 : e.onNewChatCompletionStreamChunk) == null || y.call(e,
|
|
326
|
+
(y = e == null ? void 0 : e.onNewChatCompletionStreamChunk) == null || y.call(e, o);
|
|
327
327
|
break;
|
|
328
328
|
case "ChatCompletionStreamCompleted":
|
|
329
|
-
(g = e == null ? void 0 : e.onChatCompletionStreamCompleted) == null || g.call(e,
|
|
329
|
+
(g = e == null ? void 0 : e.onChatCompletionStreamCompleted) == null || g.call(e, o);
|
|
330
330
|
break;
|
|
331
331
|
case "StreamTimeout":
|
|
332
|
-
(h = e == null ? void 0 : e.onStreamTimeout) == null || h.call(e,
|
|
332
|
+
(h = e == null ? void 0 : e.onStreamTimeout) == null || h.call(e, o);
|
|
333
333
|
break;
|
|
334
334
|
case "StreamNotFound":
|
|
335
|
-
(m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e,
|
|
335
|
+
(m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e, o);
|
|
336
336
|
break;
|
|
337
337
|
case "FileUploadCompleted":
|
|
338
|
-
(S = e == null ? void 0 : e.onFileUploadCompleted) == null || S.call(e,
|
|
338
|
+
(S = e == null ? void 0 : e.onFileUploadCompleted) == null || S.call(e, o);
|
|
339
339
|
break;
|
|
340
340
|
case "FileTextContentReady":
|
|
341
|
-
(f = e == null ? void 0 : e.onFileTextContentReady) == null || f.call(e,
|
|
341
|
+
(f = e == null ? void 0 : e.onFileTextContentReady) == null || f.call(e, o);
|
|
342
342
|
break;
|
|
343
343
|
case "WebsiteHtmlContentReady":
|
|
344
|
-
(b = e == null ? void 0 : e.onWebsiteHtmlContentReady) == null || b.call(e,
|
|
344
|
+
(b = e == null ? void 0 : e.onWebsiteHtmlContentReady) == null || b.call(e, o);
|
|
345
345
|
break;
|
|
346
346
|
case "WebsiteTextContentReady":
|
|
347
|
-
(C = e == null ? void 0 : e.onWebsiteTextContentReady) == null || C.call(e,
|
|
347
|
+
(C = e == null ? void 0 : e.onWebsiteTextContentReady) == null || C.call(e, o);
|
|
348
348
|
break;
|
|
349
349
|
case "FileSearchIndexReady":
|
|
350
|
-
(p = e == null ? void 0 : e.onFileSearchIndexReady) == null || p.call(e,
|
|
350
|
+
(p = e == null ? void 0 : e.onFileSearchIndexReady) == null || p.call(e, o);
|
|
351
351
|
break;
|
|
352
352
|
case "AgentTaskProgressItemUpdated":
|
|
353
|
-
(x = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || x.call(e,
|
|
353
|
+
(x = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || x.call(e, o);
|
|
354
354
|
break;
|
|
355
355
|
}
|
|
356
356
|
},
|
|
357
357
|
onError: (d) => {
|
|
358
|
-
var
|
|
359
|
-
(
|
|
358
|
+
var a;
|
|
359
|
+
(a = e == null ? void 0 : e.onStreamError) == null || a.call(e, {
|
|
360
360
|
streamId: d,
|
|
361
361
|
error: {
|
|
362
362
|
code: "UnknownError",
|
|
@@ -391,55 +391,55 @@ const me = (e) => {
|
|
|
391
391
|
};
|
|
392
392
|
}, Ue = (e) => {
|
|
393
393
|
const t = H(), [r, n] = w([]), l = A(/* @__PURE__ */ new Set()), u = A(/* @__PURE__ */ new Map()), { createStream: s } = Se({
|
|
394
|
-
onAgentTaskProgressItemUpdated: (
|
|
394
|
+
onAgentTaskProgressItemUpdated: (a) => {
|
|
395
395
|
var g;
|
|
396
|
-
if (!l.current.has(
|
|
397
|
-
const
|
|
398
|
-
if (
|
|
396
|
+
if (!l.current.has(a.agentTaskId)) return;
|
|
397
|
+
const o = a.data;
|
|
398
|
+
if (o.taskType === "StreamingChatCompletion" && o.eventType === "Completed" || o.taskType === "StructuredChatCompletion" && o.eventType === "Completed" || o.taskType === "StreamingMemoryTypeChatCompletion" && o.eventType === "Completed") {
|
|
399
399
|
const h = u.current.get(
|
|
400
|
-
|
|
400
|
+
a.agentTaskId
|
|
401
401
|
);
|
|
402
|
-
h && (u.current.delete(
|
|
402
|
+
h && (u.current.delete(a.agentTaskId), h(o));
|
|
403
403
|
return;
|
|
404
404
|
}
|
|
405
|
-
(g = e.onAgentTaskProgressItemUpdated) == null || g.call(e,
|
|
405
|
+
(g = e.onAgentTaskProgressItemUpdated) == null || g.call(e, a), n(
|
|
406
406
|
(h) => h.map((m) => {
|
|
407
407
|
var b;
|
|
408
|
-
if (((b = m.confirmedData) == null ? void 0 : b.taskId) !==
|
|
408
|
+
if (((b = m.confirmedData) == null ? void 0 : b.taskId) !== a.agentTaskId)
|
|
409
409
|
return m;
|
|
410
410
|
const f = m.progressItems.some(
|
|
411
|
-
(C) => C.progressItemId ===
|
|
411
|
+
(C) => C.progressItemId === a.progressItemId
|
|
412
412
|
) ? m.progressItems.map(
|
|
413
|
-
(C) => C.progressItemId ===
|
|
414
|
-
) : [...m.progressItems,
|
|
413
|
+
(C) => C.progressItemId === a.progressItemId ? a : C
|
|
414
|
+
) : [...m.progressItems, a];
|
|
415
415
|
return { ...m, progressItems: f };
|
|
416
416
|
})
|
|
417
417
|
);
|
|
418
418
|
},
|
|
419
|
-
onStreamError: (
|
|
420
|
-
var
|
|
421
|
-
(
|
|
422
|
-
const g = y.find((h) => h.streamId ===
|
|
419
|
+
onStreamError: (a) => {
|
|
420
|
+
var o;
|
|
421
|
+
(o = e == null ? void 0 : e.onStreamError) == null || o.call(e, a), n((y) => {
|
|
422
|
+
const g = y.find((h) => h.streamId === a.streamId);
|
|
423
423
|
return g ? [
|
|
424
|
-
...y.filter((h) => h.streamId !==
|
|
424
|
+
...y.filter((h) => h.streamId !== a.streamId),
|
|
425
425
|
{
|
|
426
426
|
...g,
|
|
427
427
|
loading: !1,
|
|
428
|
-
error:
|
|
428
|
+
error: a.error
|
|
429
429
|
}
|
|
430
430
|
] : y;
|
|
431
431
|
});
|
|
432
432
|
},
|
|
433
|
-
onStreamNotFound: (
|
|
434
|
-
var
|
|
435
|
-
(
|
|
433
|
+
onStreamNotFound: (a) => {
|
|
434
|
+
var o;
|
|
435
|
+
(o = e == null ? void 0 : e.onStreamNotFound) == null || o.call(e, a);
|
|
436
436
|
},
|
|
437
|
-
onStreamTimeout: (
|
|
438
|
-
var
|
|
439
|
-
(
|
|
437
|
+
onStreamTimeout: (a) => {
|
|
438
|
+
var o;
|
|
439
|
+
(o = e == null ? void 0 : e.onStreamTimeout) == null || o.call(e, a);
|
|
440
440
|
}
|
|
441
441
|
}), c = W(
|
|
442
|
-
async (
|
|
442
|
+
async (a, o) => {
|
|
443
443
|
const y = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, g = await s();
|
|
444
444
|
if (g.type === "success") {
|
|
445
445
|
n([
|
|
@@ -450,31 +450,31 @@ const me = (e) => {
|
|
|
450
450
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
451
451
|
confirmedData: null,
|
|
452
452
|
error: null,
|
|
453
|
-
params:
|
|
453
|
+
params: a,
|
|
454
454
|
progressItems: [],
|
|
455
455
|
loading: !0,
|
|
456
456
|
doneStreaming: !1,
|
|
457
|
-
loadingText:
|
|
457
|
+
loadingText: o == null ? void 0 : o.loadingText
|
|
458
458
|
}
|
|
459
459
|
]);
|
|
460
|
-
const { clientToken: h } = await e.fetchCreateAgentTaskClientToken(
|
|
460
|
+
const { clientToken: h } = await e.fetchCreateAgentTaskClientToken(a.type), m = await q({
|
|
461
461
|
pk: t.fency.publishableKey,
|
|
462
462
|
baseUrl: t.fency.baseUrl,
|
|
463
463
|
clientToken: h,
|
|
464
464
|
streamToken: g.stream.token,
|
|
465
465
|
request: {
|
|
466
|
-
streamingChatCompletionTask:
|
|
467
|
-
messages:
|
|
468
|
-
model:
|
|
466
|
+
streamingChatCompletionTask: a.type === "streamingChatCompletion" ? {
|
|
467
|
+
messages: a.messages,
|
|
468
|
+
model: a.model
|
|
469
469
|
} : void 0,
|
|
470
|
-
structuredChatCompletionTask:
|
|
471
|
-
messages:
|
|
472
|
-
jsonSchema:
|
|
473
|
-
model:
|
|
470
|
+
structuredChatCompletionTask: a.type === "structuredChatCompletion" ? {
|
|
471
|
+
messages: a.messages,
|
|
472
|
+
jsonSchema: a.jsonSchema,
|
|
473
|
+
model: a.model
|
|
474
474
|
} : void 0,
|
|
475
|
-
streamingMemoryTypeChatCompletionTask:
|
|
476
|
-
messages:
|
|
477
|
-
model:
|
|
475
|
+
streamingMemoryTypeChatCompletionTask: a.type === "streamingMemoryTypeChatCompletion" ? {
|
|
476
|
+
messages: a.messages,
|
|
477
|
+
model: a.model
|
|
478
478
|
} : void 0
|
|
479
479
|
}
|
|
480
480
|
});
|
|
@@ -490,11 +490,11 @@ const me = (e) => {
|
|
|
490
490
|
taskId: m.agentTask.id,
|
|
491
491
|
createdAt: m.agentTask.createdAt,
|
|
492
492
|
error: null,
|
|
493
|
-
params:
|
|
493
|
+
params: a,
|
|
494
494
|
progressItems: [],
|
|
495
495
|
doneStreaming: !1,
|
|
496
496
|
loading: !0,
|
|
497
|
-
loadingText:
|
|
497
|
+
loadingText: o == null ? void 0 : o.loadingText,
|
|
498
498
|
confirmedData: {
|
|
499
499
|
taskId: m.agentTask.id,
|
|
500
500
|
createdAt: m.agentTask.createdAt
|
|
@@ -521,12 +521,12 @@ const me = (e) => {
|
|
|
521
521
|
taskKey: y,
|
|
522
522
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
523
523
|
streamId: g.stream.id,
|
|
524
|
-
params:
|
|
524
|
+
params: a,
|
|
525
525
|
error: m.error,
|
|
526
526
|
progressItems: [],
|
|
527
527
|
loading: !1,
|
|
528
528
|
doneStreaming: !1,
|
|
529
|
-
loadingText:
|
|
529
|
+
loadingText: o == null ? void 0 : o.loadingText,
|
|
530
530
|
confirmedData: null
|
|
531
531
|
}
|
|
532
532
|
]), {
|
|
@@ -545,11 +545,11 @@ const me = (e) => {
|
|
|
545
545
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
546
546
|
streamId: g.stream.id,
|
|
547
547
|
error: S,
|
|
548
|
-
params:
|
|
548
|
+
params: a,
|
|
549
549
|
progressItems: [],
|
|
550
550
|
loading: !1,
|
|
551
551
|
doneStreaming: !1,
|
|
552
|
-
loadingText:
|
|
552
|
+
loadingText: o == null ? void 0 : o.loadingText,
|
|
553
553
|
confirmedData: null
|
|
554
554
|
}
|
|
555
555
|
]), {
|
|
@@ -564,7 +564,7 @@ const me = (e) => {
|
|
|
564
564
|
[t, r, s]
|
|
565
565
|
), d = U(() => {
|
|
566
566
|
if (r.length !== 0)
|
|
567
|
-
return [...r].sort((
|
|
567
|
+
return [...r].sort((a, o) => new Date(o.triggeredAt).getTime() - new Date(a.triggeredAt).getTime())[0];
|
|
568
568
|
}, [r]);
|
|
569
569
|
return E(() => () => {
|
|
570
570
|
l.current.clear(), u.current.clear();
|
|
@@ -600,12 +600,12 @@ function F({
|
|
|
600
600
|
startOnView: s = !1,
|
|
601
601
|
once: c = !1,
|
|
602
602
|
inViewMargin: d,
|
|
603
|
-
spread:
|
|
604
|
-
color:
|
|
603
|
+
spread: a = 2,
|
|
604
|
+
color: o = "#999",
|
|
605
605
|
shimmerColor: y = "#000",
|
|
606
606
|
direction: g = "fromBottom"
|
|
607
607
|
}) {
|
|
608
|
-
const h = A(null), m = Q(h, { once: c, margin: d }), S = U(() => e.length *
|
|
608
|
+
const h = A(null), m = Q(h, { once: c, margin: d }), S = U(() => e.length * a, [e, a]), f = !s || m, b = g === "fromBottom" ? "100% center" : "-100% center", C = g === "fromBottom" ? "0% center" : "200% center";
|
|
609
609
|
return /* @__PURE__ */ i(
|
|
610
610
|
v.span,
|
|
611
611
|
{
|
|
@@ -621,7 +621,7 @@ function F({
|
|
|
621
621
|
WebkitTextFillColor: "transparent",
|
|
622
622
|
backgroundRepeat: "no-repeat, padding-box",
|
|
623
623
|
"--spread": `${S}px`,
|
|
624
|
-
"--base-color":
|
|
624
|
+
"--base-color": o,
|
|
625
625
|
"--shimmer-color": y,
|
|
626
626
|
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
627
627
|
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
@@ -1071,7 +1071,7 @@ function Ee({
|
|
|
1071
1071
|
const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
1072
1072
|
const [n, l] = w(!1), u = e.eventType === "ExploreMemoryResult" ? e.result : void 0, s = u != null && u.length > B, c = u != null ? n || !s ? u : `${u.slice(0, B)}...` : void 0, d = s;
|
|
1073
1073
|
if (e.eventType === "ExploreMemoryStart" && !t) {
|
|
1074
|
-
const
|
|
1074
|
+
const o = `Exploring ${e.memoryTitle}...`;
|
|
1075
1075
|
return /* @__PURE__ */ i(
|
|
1076
1076
|
"div",
|
|
1077
1077
|
{
|
|
@@ -1083,13 +1083,13 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1083
1083
|
children: r ? /* @__PURE__ */ i(
|
|
1084
1084
|
F,
|
|
1085
1085
|
{
|
|
1086
|
-
text:
|
|
1086
|
+
text: o,
|
|
1087
1087
|
duration: 2.5,
|
|
1088
1088
|
repeat: !0,
|
|
1089
1089
|
color: "#999",
|
|
1090
1090
|
shimmerColor: "#000"
|
|
1091
1091
|
}
|
|
1092
|
-
) : /* @__PURE__ */ i("span", { style: { fontSize: 13, color: "#999" }, children:
|
|
1092
|
+
) : /* @__PURE__ */ i("span", { style: { fontSize: 13, color: "#999" }, children: o })
|
|
1093
1093
|
}
|
|
1094
1094
|
);
|
|
1095
1095
|
}
|
|
@@ -1099,7 +1099,7 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1099
1099
|
initial: { opacity: 0 },
|
|
1100
1100
|
animate: { opacity: 1 },
|
|
1101
1101
|
transition: { duration: 0.25 },
|
|
1102
|
-
onClick: d ? () => l((
|
|
1102
|
+
onClick: d ? () => l((o) => !o) : void 0,
|
|
1103
1103
|
style: {
|
|
1104
1104
|
paddingBottom: "12px",
|
|
1105
1105
|
borderBottom: "1px solid #eee",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.124",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@microsoft/fetch-event-source": "^2.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@fencyai/js": "^0.1.
|
|
40
|
+
"@fencyai/js": "^0.1.124",
|
|
41
41
|
"@testing-library/react": "^16.3.2",
|
|
42
42
|
"@types/jest": "^29.5.11",
|
|
43
43
|
"@types/node": "^20.10.5",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@emotion/is-prop-valid": "^1.3.0",
|
|
57
|
-
"@fencyai/js": "^0.1.
|
|
57
|
+
"@fencyai/js": "^0.1.124",
|
|
58
58
|
"@radix-ui/react-popover": "^1.1.15",
|
|
59
59
|
"motion": "^11.15.0",
|
|
60
60
|
"react": ">=16.8.0",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"optional": false
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "277a6a14145ee48036b64dd9b40c90dbb0d9d945"
|
|
73
73
|
}
|