laif-ds 0.2.80 → 0.2.84
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/CHANGELOG.md +40 -0
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.js +2 -5
- package/dist/agent-docs/adoption-report.json +17 -13
- package/dist/agent-docs/components/AppEditor.md +117 -7
- package/dist/agent-docs/components/Chat.md +1 -0
- package/dist/agent-docs/components/FileUploader.md +8 -3
- package/dist/agent-docs/manifest.json +125 -19
- package/dist/components/editor/nodes/mention-node.js +113 -0
- package/dist/components/editor/plugins/mention-plugin.js +215 -0
- package/dist/components/editor/plugins/toolbar/mention-insert-toolbar-plugin.js +41 -0
- package/dist/components/ui/app-editor.js +150 -112
- package/dist/components/ui/chat.js +35 -33
- package/dist/components/ui/file-previewer.js +66 -61
- package/dist/components/ui/file-uploader.js +116 -112
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/index.d.ts +44 -5
- package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +5 -5
- package/dist/node_modules/@lexical/react/LexicalTypeaheadMenuPlugin.prod.js +220 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/lexical/Lexical.prod.js +314 -303
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
- /package/dist/agent-docs/{truncated-cell.md → components/truncated-cell.md} +0 -0
|
@@ -1,112 +1,117 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as c } from "react";
|
|
4
|
-
import { createAsk as
|
|
5
|
-
import {
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { SecurePdfViewer as
|
|
8
|
-
import { guessKind as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function h(e) {
|
|
4
|
+
import { createAsk as v } from "../../node_modules/use-ask/dist/index.js";
|
|
5
|
+
import { AppDialog as x } from "./app-dialog.js";
|
|
6
|
+
import { Icon as g } from "./icon.js";
|
|
7
|
+
import { SecurePdfViewer as N } from "./secure-pdf-viewer.js";
|
|
8
|
+
import { guessKind as y, isHttpUrl as P, getOfficeEmbedUrl as b } from "../../lib/file-preview.js";
|
|
9
|
+
const [d, A] = v({});
|
|
10
|
+
function p(e) {
|
|
12
11
|
return typeof e == "string" ? { url: e } : e || {};
|
|
13
12
|
}
|
|
14
|
-
async function
|
|
15
|
-
return
|
|
13
|
+
async function S(e) {
|
|
14
|
+
return d.ask(p(e));
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
16
|
+
function U(e) {
|
|
17
|
+
return d.safeAsk(p(e));
|
|
19
18
|
}
|
|
20
|
-
const
|
|
21
|
-
const [{ payload: e }, { asking:
|
|
19
|
+
const _ = () => {
|
|
20
|
+
const [{ payload: e }, { asking: l, ok: i }] = A(), n = e?.url, s = e?.readOnly, t = e?.page, o = c(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), u = c(() => {
|
|
22
21
|
if (!e?.url) return null;
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
mimeType:
|
|
22
|
+
const a = new URL(e?.url), m = a.searchParams.get("response-content-type") || a.searchParams.get("content-type"), f = e?.mimeType || m || "";
|
|
23
|
+
return y({
|
|
24
|
+
mimeType: f,
|
|
26
25
|
filename: o,
|
|
27
26
|
url: e?.url
|
|
28
27
|
});
|
|
29
|
-
}, [e?.mimeType, o, e?.url]),
|
|
30
|
-
() => /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */ r(
|
|
28
|
+
}, [e?.mimeType, o, e?.url]), w = c(
|
|
29
|
+
() => /* @__PURE__ */ h("span", { className: "flex items-center gap-2", children: [
|
|
30
|
+
/* @__PURE__ */ r(g, { name: "File", className: "h-4 w-4" }),
|
|
32
31
|
e?.title || o
|
|
33
32
|
] }),
|
|
34
33
|
[e?.title, o]
|
|
35
34
|
);
|
|
36
|
-
return /* @__PURE__ */ r(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
return /* @__PURE__ */ r(
|
|
36
|
+
x,
|
|
37
|
+
{
|
|
38
|
+
open: l,
|
|
39
|
+
onOpenChange: (a) => !a && i(),
|
|
40
|
+
title: w,
|
|
41
|
+
size: e?.size ?? "xl",
|
|
42
|
+
children: u && n ? /* @__PURE__ */ r(
|
|
43
|
+
O,
|
|
44
|
+
{
|
|
45
|
+
kind: u,
|
|
46
|
+
src: n,
|
|
47
|
+
officeUrl: n,
|
|
48
|
+
readOnly: s,
|
|
49
|
+
page: t
|
|
50
|
+
}
|
|
51
|
+
) : null
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}, O = ({
|
|
50
55
|
kind: e,
|
|
51
|
-
src:
|
|
52
|
-
officeUrl:
|
|
53
|
-
readOnly:
|
|
54
|
-
page:
|
|
56
|
+
src: l,
|
|
57
|
+
officeUrl: i,
|
|
58
|
+
readOnly: n = !1,
|
|
59
|
+
page: s = 0
|
|
55
60
|
}) => {
|
|
56
|
-
if (!
|
|
61
|
+
if (!l && e !== "text" && e !== "office")
|
|
57
62
|
return /* @__PURE__ */ r("div", { className: "text-d-secondary-foreground", children: "Nessuna sorgente disponibile" });
|
|
58
63
|
switch (e) {
|
|
59
64
|
case "image":
|
|
60
|
-
return /* @__PURE__ */ r("div", { className: "
|
|
65
|
+
return /* @__PURE__ */ r("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ r(
|
|
61
66
|
"img",
|
|
62
67
|
{
|
|
63
|
-
src:
|
|
68
|
+
src: l,
|
|
64
69
|
alt: "preview",
|
|
65
|
-
className: "max-h-
|
|
70
|
+
className: "max-h-full w-auto max-w-full object-contain"
|
|
66
71
|
}
|
|
67
72
|
) });
|
|
68
73
|
case "pdf": {
|
|
69
|
-
if (
|
|
74
|
+
if (n && l)
|
|
70
75
|
return /* @__PURE__ */ r(
|
|
71
|
-
|
|
76
|
+
N,
|
|
72
77
|
{
|
|
73
|
-
url:
|
|
74
|
-
initialPage:
|
|
75
|
-
className: "w-full"
|
|
78
|
+
url: l,
|
|
79
|
+
initialPage: s || 1,
|
|
80
|
+
className: "h-full w-full"
|
|
76
81
|
}
|
|
77
82
|
);
|
|
78
|
-
let t =
|
|
79
|
-
return
|
|
83
|
+
let t = l;
|
|
84
|
+
return s > 0 && (t += "#page=" + s), /* @__PURE__ */ r(
|
|
80
85
|
"iframe",
|
|
81
86
|
{
|
|
82
87
|
src: t,
|
|
83
88
|
title: "PDF Preview",
|
|
84
|
-
className: "h-
|
|
89
|
+
className: "h-full w-full rounded"
|
|
85
90
|
}
|
|
86
91
|
);
|
|
87
92
|
}
|
|
88
93
|
case "audio":
|
|
89
|
-
return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r("audio", { controls: !0, className: "w-full max-w-2xl", children: /* @__PURE__ */ r("source", { src:
|
|
94
|
+
return /* @__PURE__ */ r("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ r("audio", { controls: !0, className: "w-full max-w-2xl", children: /* @__PURE__ */ r("source", { src: l }) }) });
|
|
90
95
|
case "video":
|
|
91
|
-
return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r("video", { controls: !0, className: "max-h-
|
|
96
|
+
return /* @__PURE__ */ r("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ r("video", { controls: !0, className: "max-h-full w-full max-w-3xl rounded", children: /* @__PURE__ */ r("source", { src: l }) }) });
|
|
92
97
|
case "text":
|
|
93
98
|
return /* @__PURE__ */ r(
|
|
94
99
|
"iframe",
|
|
95
100
|
{
|
|
96
|
-
src:
|
|
101
|
+
src: l,
|
|
97
102
|
title: "Text Preview",
|
|
98
|
-
className: "h-
|
|
103
|
+
className: "h-full w-full rounded"
|
|
99
104
|
}
|
|
100
105
|
);
|
|
101
106
|
case "office": {
|
|
102
|
-
if (
|
|
103
|
-
const t =
|
|
107
|
+
if (i && P(i)) {
|
|
108
|
+
const t = b(i);
|
|
104
109
|
return /* @__PURE__ */ r(
|
|
105
110
|
"iframe",
|
|
106
111
|
{
|
|
107
112
|
src: t,
|
|
108
113
|
title: "Office Preview",
|
|
109
|
-
className: "h-
|
|
114
|
+
className: "h-full w-full rounded"
|
|
110
115
|
}
|
|
111
116
|
);
|
|
112
117
|
}
|
|
@@ -117,7 +122,7 @@ const E = () => {
|
|
|
117
122
|
}
|
|
118
123
|
};
|
|
119
124
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
_ as FilePreviewer,
|
|
126
|
+
S as previewFileModal,
|
|
127
|
+
U as safePreviewFileModal
|
|
123
128
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as z, jsx as i, Fragment as P } from "react/jsx-runtime";
|
|
3
3
|
import l from "react";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Card as
|
|
6
|
-
import { FilePreview as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { Input as
|
|
9
|
-
const
|
|
4
|
+
import { Button as _ } from "./button.js";
|
|
5
|
+
import { Card as U, CardHeader as W, CardTitle as H, CardContent as K } from "./card.js";
|
|
6
|
+
import { FilePreview as R } from "./file-preview/index.js";
|
|
7
|
+
import { Icon as O } from "./icon.js";
|
|
8
|
+
import { Input as V } from "./input.js";
|
|
9
|
+
const Z = {
|
|
10
10
|
pdf: "application/pdf",
|
|
11
11
|
doc: ".doc",
|
|
12
12
|
docx: ".docx",
|
|
@@ -31,161 +31,165 @@ const U = {
|
|
|
31
31
|
tar: ".tar,application/x-tar",
|
|
32
32
|
gz: ".gz,application/gzip,application/x-gzip",
|
|
33
33
|
tgz: ".tgz,.tar.gz,application/gzip,application/x-compressed-tar"
|
|
34
|
-
},
|
|
35
|
-
extensions:
|
|
36
|
-
multiple:
|
|
37
|
-
onUpload:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
}, A = (f) => Math.ceil(f / (1024 * 1024)), re = ({
|
|
35
|
+
extensions: f = ["pdf", "image", "video", "audio"],
|
|
36
|
+
multiple: d = !1,
|
|
37
|
+
onUpload: D,
|
|
38
|
+
onRemove: b,
|
|
39
|
+
description: w = "Trascina un file o clicca per selezionare",
|
|
40
|
+
formatDescription: I = "Formato accettato: PDF, Immagini, Video, Audio",
|
|
41
|
+
selectedLabel: u = "File selezionati",
|
|
42
|
+
maxTotalSize: p,
|
|
43
|
+
removeAllLabel: y = "rimuovi tutto",
|
|
44
|
+
maxFiles: o,
|
|
45
|
+
id: N,
|
|
46
|
+
"data-testid": g
|
|
46
47
|
}) => {
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
(
|
|
48
|
+
const x = f.map((e) => Z[e]).join(","), [t, m] = l.useState([]), [j, n] = l.useState(""), C = (e) => {
|
|
49
|
+
const s = Array.from(e).filter(
|
|
50
|
+
(r) => x.split(",").some((a) => (a = a.trim(), r.type.startsWith(a.replace("/*", "")) || r.name.toLowerCase().endsWith(a.replace("*", ""))))
|
|
50
51
|
);
|
|
51
|
-
let
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
let
|
|
55
|
-
if (typeof
|
|
56
|
-
const
|
|
57
|
-
|
|
52
|
+
let c = [];
|
|
53
|
+
const h = [];
|
|
54
|
+
if (d) {
|
|
55
|
+
let r = s;
|
|
56
|
+
if (typeof o == "number") {
|
|
57
|
+
const a = Math.max(o - t.length, 0);
|
|
58
|
+
a < s.length && (r = s.slice(0, a), h.push(`Max ${o} file`));
|
|
58
59
|
}
|
|
59
|
-
if (typeof
|
|
60
|
-
const
|
|
61
|
-
let F =
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
for (const
|
|
65
|
-
F + (
|
|
66
|
-
|
|
60
|
+
if (typeof p == "number") {
|
|
61
|
+
const a = p;
|
|
62
|
+
let F = t.reduce((v, S) => v + (S.size || 0), 0);
|
|
63
|
+
const $ = [];
|
|
64
|
+
let k = !1;
|
|
65
|
+
for (const v of r)
|
|
66
|
+
F + (v.size || 0) <= a ? ($.push(v), F += v.size || 0) : k || (h.push(`Max ${A(a)} MB`), k = !0);
|
|
67
|
+
r = $;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
c = [...t, ...r];
|
|
69
70
|
} else {
|
|
70
|
-
const
|
|
71
|
-
if (typeof
|
|
72
|
-
const
|
|
73
|
-
(
|
|
71
|
+
const r = s[0] ? [s[0]] : [];
|
|
72
|
+
if (typeof p == "number" && r[0]) {
|
|
73
|
+
const a = p;
|
|
74
|
+
(r[0].size || 0) > a ? (h.push(`Max ${A(a)} MB`), c = t) : c = r;
|
|
74
75
|
} else
|
|
75
|
-
|
|
76
|
+
c = r;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
m(c), n(h.join(" • ")), D?.(c);
|
|
78
79
|
}, E = (e) => {
|
|
79
|
-
e.target.files &&
|
|
80
|
+
e.target.files && C(e.target.files), e.target.value = "";
|
|
80
81
|
}, L = (e) => {
|
|
81
|
-
e.preventDefault(),
|
|
82
|
-
},
|
|
83
|
-
const
|
|
84
|
-
|
|
82
|
+
e.preventDefault(), C(e.dataTransfer.files);
|
|
83
|
+
}, M = (e) => {
|
|
84
|
+
const s = t[e], c = t.filter((h, r) => r !== e);
|
|
85
|
+
m(c), n(""), b?.(s ? [s] : [], c);
|
|
86
|
+
}, B = () => {
|
|
87
|
+
const e = t;
|
|
88
|
+
m([]), n(""), b?.(e, []);
|
|
85
89
|
};
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
(
|
|
88
|
-
|
|
90
|
+
return /* @__PURE__ */ z("div", { className: "mx-auto w-full space-y-4", children: [
|
|
91
|
+
(d || t.length === 0) && /* @__PURE__ */ i(
|
|
92
|
+
q,
|
|
89
93
|
{
|
|
90
|
-
accept:
|
|
91
|
-
multiple:
|
|
94
|
+
accept: x,
|
|
95
|
+
multiple: d,
|
|
92
96
|
onDrop: L,
|
|
93
97
|
onChange: E,
|
|
94
|
-
description:
|
|
95
|
-
formatDescription:
|
|
96
|
-
errorCaption:
|
|
97
|
-
id:
|
|
98
|
-
"data-testid":
|
|
98
|
+
description: w,
|
|
99
|
+
formatDescription: I,
|
|
100
|
+
errorCaption: j,
|
|
101
|
+
id: N,
|
|
102
|
+
"data-testid": g
|
|
99
103
|
}
|
|
100
104
|
),
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
105
|
+
t.length > 0 && /* @__PURE__ */ i(P, { children: /* @__PURE__ */ z(U, { size: "sm", className: "shadow-none", children: [
|
|
106
|
+
/* @__PURE__ */ z(W, { className: "flex justify-between", children: [
|
|
107
|
+
/* @__PURE__ */ i(H, { children: u }),
|
|
108
|
+
/* @__PURE__ */ i(
|
|
109
|
+
_,
|
|
106
110
|
{
|
|
107
111
|
size: "sm",
|
|
108
112
|
variant: "ghost",
|
|
109
113
|
className: "text-xs",
|
|
110
|
-
onClick:
|
|
111
|
-
children:
|
|
114
|
+
onClick: B,
|
|
115
|
+
children: y
|
|
112
116
|
}
|
|
113
117
|
)
|
|
114
118
|
] }),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
119
|
+
/* @__PURE__ */ i(K, { children: d ? /* @__PURE__ */ i("div", { className: "flex flex-nowrap gap-2 overflow-x-auto py-2", children: t.map((e, s) => /* @__PURE__ */ i(
|
|
120
|
+
R,
|
|
117
121
|
{
|
|
118
122
|
file: e,
|
|
119
|
-
onRemove: () =>
|
|
123
|
+
onRemove: () => M(s)
|
|
120
124
|
},
|
|
121
|
-
e.name +
|
|
122
|
-
)) }) : /* @__PURE__ */
|
|
125
|
+
e.name + s
|
|
126
|
+
)) }) : /* @__PURE__ */ i(R, { file: t[0], onRemove: () => M(0) }) })
|
|
123
127
|
] }) })
|
|
124
128
|
] });
|
|
125
|
-
},
|
|
126
|
-
accept:
|
|
127
|
-
multiple:
|
|
128
|
-
onDrop:
|
|
129
|
-
onChange:
|
|
130
|
-
description:
|
|
131
|
-
formatDescription:
|
|
132
|
-
errorCaption:
|
|
133
|
-
id:
|
|
134
|
-
"data-testid":
|
|
129
|
+
}, q = ({
|
|
130
|
+
accept: f,
|
|
131
|
+
multiple: d,
|
|
132
|
+
onDrop: D,
|
|
133
|
+
onChange: b,
|
|
134
|
+
description: w,
|
|
135
|
+
formatDescription: I,
|
|
136
|
+
errorCaption: u,
|
|
137
|
+
id: p,
|
|
138
|
+
"data-testid": y
|
|
135
139
|
}) => {
|
|
136
|
-
const
|
|
137
|
-
return /* @__PURE__ */
|
|
140
|
+
const o = l.useRef(null), [N, g] = l.useState(!1), x = l.useId(), t = l.useId(), m = l.useId(), j = l.useId();
|
|
141
|
+
return /* @__PURE__ */ z(
|
|
138
142
|
"div",
|
|
139
143
|
{
|
|
140
|
-
id:
|
|
141
|
-
"data-testid":
|
|
144
|
+
id: p,
|
|
145
|
+
"data-testid": y,
|
|
142
146
|
role: "button",
|
|
143
147
|
tabIndex: 0,
|
|
144
|
-
"aria-label":
|
|
145
|
-
"aria-describedby": `${
|
|
146
|
-
onKeyDown: (
|
|
147
|
-
(
|
|
148
|
+
"aria-label": w || "Seleziona file",
|
|
149
|
+
"aria-describedby": `${x} ${t}${u ? ` ${m}` : ""}`,
|
|
150
|
+
onKeyDown: (n) => {
|
|
151
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), o.current && (o.current.value = "", o.current.click()));
|
|
148
152
|
},
|
|
149
153
|
onClick: () => {
|
|
150
|
-
|
|
154
|
+
o.current && (o.current.value = "", o.current.click());
|
|
151
155
|
},
|
|
152
|
-
onDragEnter: () =>
|
|
153
|
-
onDragOver: (
|
|
154
|
-
onDragLeave: () =>
|
|
155
|
-
onDrop: (
|
|
156
|
-
|
|
156
|
+
onDragEnter: () => g(!0),
|
|
157
|
+
onDragOver: (n) => n.preventDefault(),
|
|
158
|
+
onDragLeave: () => g(!1),
|
|
159
|
+
onDrop: (n) => {
|
|
160
|
+
g(!1), D(n);
|
|
157
161
|
},
|
|
158
|
-
className: `border-d-border flex w-full cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed px-4 py-8 ${
|
|
162
|
+
className: `border-d-border flex w-full cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed px-4 py-8 ${N ? "bg-muted/40" : ""}`,
|
|
159
163
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
|
|
164
|
+
/* @__PURE__ */ i(
|
|
165
|
+
O,
|
|
162
166
|
{
|
|
163
167
|
name: "ArrowUpFromLine",
|
|
164
168
|
className: "text-d-muted-foreground h-10 w-10"
|
|
165
169
|
}
|
|
166
170
|
),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ z("div", { className: "max-w-xs text-center", children: [
|
|
172
|
+
/* @__PURE__ */ i("p", { id: x, className: "text-d-muted-foreground text-sm font-medium", children: w }),
|
|
173
|
+
/* @__PURE__ */ i(
|
|
170
174
|
"p",
|
|
171
175
|
{
|
|
172
|
-
id:
|
|
176
|
+
id: t,
|
|
173
177
|
className: "text-d-muted-foreground text-muted-foreground mt-1 text-xs",
|
|
174
|
-
children:
|
|
178
|
+
children: I
|
|
175
179
|
}
|
|
176
180
|
),
|
|
177
|
-
|
|
181
|
+
u ? /* @__PURE__ */ i("p", { id: m, className: "mt-2 text-xs font-medium text-red-600", children: u }) : null
|
|
178
182
|
] }),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
|
|
183
|
+
/* @__PURE__ */ i(
|
|
184
|
+
V,
|
|
181
185
|
{
|
|
182
|
-
ref:
|
|
183
|
-
id:
|
|
186
|
+
ref: o,
|
|
187
|
+
id: j,
|
|
184
188
|
type: "file",
|
|
185
189
|
className: "hidden",
|
|
186
|
-
accept:
|
|
187
|
-
multiple:
|
|
188
|
-
onChange:
|
|
190
|
+
accept: f,
|
|
191
|
+
multiple: d,
|
|
192
|
+
onChange: b
|
|
189
193
|
}
|
|
190
194
|
)
|
|
191
195
|
]
|
|
@@ -193,5 +197,5 @@ const U = {
|
|
|
193
197
|
);
|
|
194
198
|
};
|
|
195
199
|
export {
|
|
196
|
-
|
|
200
|
+
re as FileUploader
|
|
197
201
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n, jsxs as b, Fragment as G } from "react/jsx-runtime";
|
|
3
|
-
import L from "../../../../../_virtual/
|
|
3
|
+
import L from "../../../../../_virtual/index7.js";
|
|
4
4
|
import _ from "../../../../../_virtual/debounce3.js";
|
|
5
5
|
import { useContext as j, useRef as l, useState as o, useCallback as M, useMemo as N, useEffect as a } from "react";
|
|
6
6
|
import { GanttContext as O } from "../Gantt/GanttContext.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -260,22 +260,49 @@ export declare interface AppDialogProps extends Omit<DialogContentProps, "title"
|
|
|
260
260
|
preventClose?: "overlay" | "all";
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
export declare function AppEditor({ defaultValue, onMarkdownEdit, plugins, toolbars, placeholder, onlyMarkdown, className, wrpClassName, }: AppEditorProps): JSX.Element;
|
|
263
|
+
export declare function AppEditor({ defaultValue, onMarkdownEdit, onValueChange, plugins, toolbars, placeholder, onlyMarkdown, className, wrpClassName, mentions, mentionTrigger, }: AppEditorProps): JSX.Element;
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
/** Metadata emitted alongside the markdown on every change. */
|
|
266
|
+
export declare interface AppEditorChangeMeta {
|
|
267
|
+
/** Deduped list (by `String(id)`) of mentions currently present in the text. */
|
|
268
|
+
mentions: MentionItem[];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export declare type AppEditorPlugin = "clear" | "counter";
|
|
266
272
|
|
|
267
|
-
declare interface AppEditorProps {
|
|
273
|
+
export declare interface AppEditorProps {
|
|
268
274
|
defaultValue?: string;
|
|
275
|
+
/**
|
|
276
|
+
* @deprecated Use `onValueChange` instead. Still honored as a fallback when
|
|
277
|
+
* `onValueChange` is not provided, but it never receives mention metadata.
|
|
278
|
+
*/
|
|
269
279
|
onMarkdownEdit?: (markdown: string) => void;
|
|
280
|
+
/**
|
|
281
|
+
* Fires on every edit with the current markdown and a metadata object.
|
|
282
|
+
* `meta.mentions` is the deduped (by `id`) list of mentions in the text —
|
|
283
|
+
* empty when mentions are disabled. Takes precedence over `onMarkdownEdit`.
|
|
284
|
+
*/
|
|
285
|
+
onValueChange?: (markdown: string, meta: AppEditorChangeMeta) => void;
|
|
270
286
|
plugins?: AppEditorPlugin[];
|
|
271
287
|
toolbars?: AppEditorToolbar[];
|
|
272
288
|
placeholder?: string;
|
|
273
289
|
onlyMarkdown?: boolean;
|
|
274
290
|
className?: string;
|
|
275
291
|
wrpClassName?: string;
|
|
292
|
+
/**
|
|
293
|
+
* Enables @mention support when provided. Either a ready `MentionItem[]`
|
|
294
|
+
* (filtered client-side) or a loader called ONCE the first time the menu
|
|
295
|
+
* opens — so a large list is never preloaded on mount. The typeahead menu
|
|
296
|
+
* filters by label (case-insensitive, word-prefix). When undefined, the
|
|
297
|
+
* MentionNode, mention plugin and mention transformer are NOT registered and
|
|
298
|
+
* behavior/output is identical to a mention-less editor.
|
|
299
|
+
*/
|
|
300
|
+
mentions?: MentionSource;
|
|
301
|
+
/** Single character that opens the mention menu. Default "@". */
|
|
302
|
+
mentionTrigger?: string;
|
|
276
303
|
}
|
|
277
304
|
|
|
278
|
-
declare type AppEditorToolbar = "block-format" | "font-format" | "history";
|
|
305
|
+
export declare type AppEditorToolbar = "block-format" | "font-format" | "history";
|
|
279
306
|
|
|
280
307
|
export declare const AppForm: <TFormValues extends FieldValues = FieldValues, TAsyncOption = unknown>({ items, cols, form, submitText, onSubmit, isSubmitting, showSubmitButton, }: AppFormProps<TFormValues, TAsyncOption>) => JSX.Element;
|
|
281
308
|
|
|
@@ -979,7 +1006,7 @@ export declare function ChartTooltipContent({ active, payload, className, indica
|
|
|
979
1006
|
labelKey?: string;
|
|
980
1007
|
} & React_2.HTMLAttributes<HTMLDivElement>): JSX.Element | null;
|
|
981
1008
|
|
|
982
|
-
export declare function Chat({ messages, welcomeTitle, handleSubmit, input, handleInputChange, stop, isGenerating, append, suggestions, className, onRateResponse, setMessages, transcribeAudio, allowAttachments, onEdit, onMessageSave, }: ChatProps): JSX.Element;
|
|
1009
|
+
export declare function Chat({ messages, welcomeTitle, handleSubmit, input, handleInputChange, stop, isGenerating, append, suggestions, className, onRateResponse, setMessages, transcribeAudio, allowAttachments, onEdit, onMessageSave, placeholder, }: ChatProps): JSX.Element;
|
|
983
1010
|
|
|
984
1011
|
export declare namespace Chat {
|
|
985
1012
|
var displayName: string;
|
|
@@ -1042,6 +1069,7 @@ declare interface ChatPropsBase {
|
|
|
1042
1069
|
onEdit?: (messageId: string, newContent: string) => void;
|
|
1043
1070
|
onMessageSave?: (messageId: string, content: string) => void;
|
|
1044
1071
|
welcomeTitle?: string;
|
|
1072
|
+
placeholder?: string;
|
|
1045
1073
|
}
|
|
1046
1074
|
|
|
1047
1075
|
declare interface ChatPropsWithoutSuggestions extends ChatPropsBase {
|
|
@@ -2092,6 +2120,7 @@ declare interface FileUploaderProps {
|
|
|
2092
2120
|
extensions?: AcceptItem[];
|
|
2093
2121
|
multiple?: boolean;
|
|
2094
2122
|
onUpload?: (files: File[]) => void;
|
|
2123
|
+
onRemove?: (removed: File[], remaining: File[]) => void;
|
|
2095
2124
|
description?: string;
|
|
2096
2125
|
formatDescription?: string;
|
|
2097
2126
|
selectedLabel?: string;
|
|
@@ -2403,6 +2432,15 @@ declare interface MarkdownRendererProps {
|
|
|
2403
2432
|
children: string;
|
|
2404
2433
|
}
|
|
2405
2434
|
|
|
2435
|
+
export declare interface MentionItem {
|
|
2436
|
+
id: string | number;
|
|
2437
|
+
label: string;
|
|
2438
|
+
value?: string;
|
|
2439
|
+
sublabel?: string;
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
export declare type MentionSource = MentionItem[] | (() => MentionItem[] | Promise<MentionItem[]>);
|
|
2443
|
+
|
|
2406
2444
|
export declare function Menubar({ className, ...props }: React_2.ComponentProps<typeof MenubarPrimitive.Root>): JSX.Element;
|
|
2407
2445
|
|
|
2408
2446
|
export declare function MenubarCheckboxItem({ className, children, checked, ...props }: React_2.ComponentProps<typeof MenubarPrimitive.CheckboxItem>): JSX.Element;
|
|
@@ -2736,6 +2774,7 @@ declare interface PreviewOptions {
|
|
|
2736
2774
|
title?: default_2.ReactNode;
|
|
2737
2775
|
readOnly?: boolean;
|
|
2738
2776
|
page?: number;
|
|
2777
|
+
size?: "sm" | "default" | "lg" | "xl" | "full";
|
|
2739
2778
|
}
|
|
2740
2779
|
|
|
2741
2780
|
export declare function Progress({ className, value, ...props }: React_2.ComponentProps<typeof ProgressPrimitive.Root>): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $
|
|
2
|
+
import { $createLineBreakNode as O, $createTextNode as y, $getRoot as D, $isElementNode as I, $isDecoratorNode as B, $isParagraphNode as k, $isTextNode as N, $getSelection as J, $isLineBreakNode as V, $createParagraphNode as Y } from "../../lexical/Lexical.prod.js";
|
|
3
3
|
import { ListNode as w, ListItemNode as P, $isListNode as $, $createListItemNode as Z, $createListNode as tt, $isListItemNode as j } from "../list/LexicalList.prod.js";
|
|
4
4
|
import { HeadingNode as et, QuoteNode as nt, $isHeadingNode as ot, $isQuoteNode as L, $createQuoteNode as rt, $createHeadingNode as st } from "../rich-text/LexicalRichText.prod.js";
|
|
5
5
|
import { $findMatchingParent as it } from "../utils/LexicalUtils.prod.js";
|
|
@@ -160,7 +160,7 @@ function xt(t, e = !1) {
|
|
|
160
160
|
})(r.textFormat);
|
|
161
161
|
return (n, f) => {
|
|
162
162
|
const o = n.split(`
|
|
163
|
-
`), a = o.length, u = f ||
|
|
163
|
+
`), a = o.length, u = f || D();
|
|
164
164
|
u.clear();
|
|
165
165
|
for (let i = 0; i < a; i++) {
|
|
166
166
|
const g = o[i], [l, d] = $t(o, i, r.multilineElement, u);
|
|
@@ -223,7 +223,7 @@ function Et(t, e, r, s, n, f) {
|
|
|
223
223
|
const i = u.getLastDescendant();
|
|
224
224
|
c = i == null ? null : it(i, j);
|
|
225
225
|
}
|
|
226
|
-
c != null && c.getTextContentSize() > 0 && (c.splice(c.getChildrenSize(), 0, [
|
|
226
|
+
c != null && c.getTextContentSize() > 0 && (c.splice(c.getChildrenSize(), 0, [O(), ...a.getChildren()]), a.remove());
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
}
|
|
@@ -280,7 +280,7 @@ const U = /^(\s*)(\d{1,})\.\s/, z = /^(\s*)[-*+]\s/, Nt = /^(\s*)(?:-\s)?\s?(\[(
|
|
|
280
280
|
}, regExp: Q, replace: (t, e, r, s) => {
|
|
281
281
|
if (s) {
|
|
282
282
|
const f = t.getPreviousSibling();
|
|
283
|
-
if (L(f)) return f.splice(f.getChildrenSize(), 0, [
|
|
283
|
+
if (L(f)) return f.splice(f.getChildrenSize(), 0, [O(), ...e]), void t.remove();
|
|
284
284
|
}
|
|
285
285
|
const n = rt();
|
|
286
286
|
n.append(...e), t.replace(n), s || n.select(0, 0);
|
|
@@ -330,7 +330,7 @@ function Jt(t = q, e, r = !1) {
|
|
|
330
330
|
return (function(n, f = !1) {
|
|
331
331
|
const o = H(n), a = [...o.multilineElement, ...o.element], u = !f, c = o.textFormat.filter(((i) => i.format.length === 1)).sort(((i, g) => Number(i.format.includes("code")) - Number(g.format.includes("code"))));
|
|
332
332
|
return (i) => {
|
|
333
|
-
const g = [], l = (i ||
|
|
333
|
+
const g = [], l = (i || D()).getChildren();
|
|
334
334
|
for (let d = 0; d < l.length; d++) {
|
|
335
335
|
const p = l[d], m = mt(p, a, c, o.textMatch);
|
|
336
336
|
m != null && g.push(u && d > 0 && !b(p) && !b(l[d - 1]) ? `
|