laif-ds 1.1.2 → 1.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/dist/CHANGELOG.md +33 -0
- package/dist/agent-docs/adoption-report.json +39 -45
- package/dist/agent-docs/components/AppEditor.md +51 -13
- package/dist/agent-docs/components/AppSelect.md +305 -90
- package/dist/agent-docs/manifest.json +33 -17
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +34 -30
- package/dist/components/editor/plugins/toolbar/link-toolbar-plugin.js +99 -0
- package/dist/components/editor/themes/editor-theme.js +5 -2
- package/dist/components/ui/app-editor.js +162 -138
- package/dist/components/ui/app-select.js +566 -366
- package/dist/index.d.ts +52 -29
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +3 -1
|
@@ -1,207 +1,231 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
|
|
2
|
+
import { jsx as r, jsxs as n, Fragment as u } from "react/jsx-runtime";
|
|
3
|
+
import { LinkNode as U } from "../../node_modules/@lexical/link/dist/LexicalLink.prod.js";
|
|
4
|
+
import { ListNode as _, ListItemNode as Q } from "../../node_modules/@lexical/list/dist/LexicalList.prod.js";
|
|
5
|
+
import { TRANSFORMERS as K, $convertToMarkdownString as W, $convertFromMarkdownString as Z } from "../../node_modules/@lexical/markdown/dist/LexicalMarkdown.prod.js";
|
|
6
|
+
import { CheckListPlugin as q } from "../../node_modules/@lexical/react/dist/LexicalCheckListPlugin.prod.js";
|
|
7
|
+
import { ClearEditorPlugin as G } from "../../node_modules/@lexical/react/dist/LexicalClearEditorPlugin.prod.js";
|
|
8
|
+
import { LexicalComposer as J } from "../../node_modules/@lexical/react/dist/LexicalComposer.prod.js";
|
|
9
|
+
import { useLexicalComposerContext as L } from "../../node_modules/@lexical/react/dist/LexicalComposerContext.prod.js";
|
|
10
|
+
import { LexicalErrorBoundary as X } from "../../node_modules/@lexical/react/dist/LexicalErrorBoundary.prod.js";
|
|
11
|
+
import { HistoryPlugin as Y } from "../../node_modules/@lexical/react/dist/LexicalHistoryPlugin.prod.js";
|
|
12
|
+
import { ListPlugin as V } from "../../node_modules/@lexical/react/dist/LexicalListPlugin.prod.js";
|
|
13
|
+
import { OnChangePlugin as rr } from "../../node_modules/@lexical/react/dist/LexicalOnChangePlugin.prod.js";
|
|
14
|
+
import { RichTextPlugin as or } from "../../node_modules/@lexical/react/dist/LexicalRichTextPlugin.prod.js";
|
|
15
|
+
import { HeadingNode as er, QuoteNode as tr } from "../../node_modules/@lexical/rich-text/dist/LexicalRichText.prod.js";
|
|
16
|
+
import { ParagraphNode as g, TextNode as h, $nodesOfType as ir, $getRoot as N } from "../../node_modules/lexical/dist/Lexical.prod.js";
|
|
17
|
+
import { forwardRef as nr, useState as lr, useMemo as ar, useImperativeHandle as sr, useEffect as mr } from "react";
|
|
18
|
+
import { ContentEditable as cr } from "../editor/editor-ui/content-editable.js";
|
|
19
|
+
import { MentionNode as k } from "../editor/nodes/mention-node.js";
|
|
20
|
+
import { ActionsPlugin as dr } from "../editor/plugins/actions/actions-plugin.js";
|
|
21
|
+
import { ClearEditorActionPlugin as pr } from "../editor/plugins/actions/clear-editor-plugin.js";
|
|
22
|
+
import { CounterCharacterPlugin as fr } from "../editor/plugins/actions/counter-character-plugin.js";
|
|
23
|
+
import { MENTION_TRANSFORMER as ur, MentionPlugin as gr, collectMentions as hr } from "../editor/plugins/mention-plugin.js";
|
|
24
|
+
import { FormatBulletedList as Nr } from "../editor/plugins/toolbar/block-format/format-bulleted-list.js";
|
|
25
|
+
import { FormatCheckList as br } from "../editor/plugins/toolbar/block-format/format-check-list.js";
|
|
26
|
+
import { FormatHeading as vr } from "../editor/plugins/toolbar/block-format/format-heading.js";
|
|
27
|
+
import { FormatNumberedList as xr } from "../editor/plugins/toolbar/block-format/format-numbered-list.js";
|
|
28
|
+
import { FormatParagraph as Er } from "../editor/plugins/toolbar/block-format/format-paragraph.js";
|
|
29
|
+
import { FormatQuote as Fr } from "../editor/plugins/toolbar/block-format/format-quote.js";
|
|
30
|
+
import { BlockFormatDropDown as Pr } from "../editor/plugins/toolbar/block-format-toolbar-plugin.js";
|
|
31
|
+
import { FontFormatToolbarPlugin as m } from "../editor/plugins/toolbar/font-format-toolbar-plugin.js";
|
|
32
|
+
import { LinkToolbarPlugin as yr, $insertLink as Rr } from "../editor/plugins/toolbar/link-toolbar-plugin.js";
|
|
33
|
+
import { MentionInsertToolbarPlugin as Cr } from "../editor/plugins/toolbar/mention-insert-toolbar-plugin.js";
|
|
34
|
+
import { ToolbarPlugin as f } from "../editor/plugins/toolbar/toolbar-plugin.js";
|
|
35
|
+
import { editorTheme as Tr } from "../editor/themes/editor-theme.js";
|
|
36
|
+
import { TooltipProvider as kr } from "./tooltip.js";
|
|
37
|
+
import { HistoryToolbarPlugin as wr } from "../editor/plugins/toolbar/history-toolbar-plugin.js";
|
|
38
|
+
import { cn as Lr } from "../../lib/utils.js";
|
|
39
|
+
const Sr = "Start typing...", Ar = {
|
|
38
40
|
format: ["underline"],
|
|
39
41
|
tag: "++",
|
|
40
42
|
type: "text-format"
|
|
41
|
-
},
|
|
42
|
-
...
|
|
43
|
-
|
|
44
|
-
],
|
|
45
|
-
function
|
|
43
|
+
}, w = [
|
|
44
|
+
...K,
|
|
45
|
+
Ar
|
|
46
|
+
], Mr = (o) => o.replace(/<u>(.*?)<\/u>/g, "++$1++"), $r = (o) => o.replace(/\+\+(.+?)\+\+/g, "<u>$1</u>");
|
|
47
|
+
function Ir({
|
|
48
|
+
handleRef: o
|
|
49
|
+
}) {
|
|
50
|
+
const [e] = L();
|
|
51
|
+
return sr(
|
|
52
|
+
o,
|
|
53
|
+
() => ({
|
|
54
|
+
insertLink: (t, a) => {
|
|
55
|
+
e.focus(), e.update(() => Rr(t, a));
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
[e]
|
|
59
|
+
), null;
|
|
60
|
+
}
|
|
61
|
+
function Or({
|
|
46
62
|
defaultValue: o,
|
|
47
|
-
onlyMarkdown:
|
|
48
|
-
transformers:
|
|
63
|
+
onlyMarkdown: e,
|
|
64
|
+
transformers: t
|
|
49
65
|
}) {
|
|
50
|
-
const [
|
|
51
|
-
return
|
|
52
|
-
o &&
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
) :
|
|
66
|
+
const [a] = L();
|
|
67
|
+
return mr(() => {
|
|
68
|
+
o && a.update(() => {
|
|
69
|
+
e ? Z(
|
|
70
|
+
Mr(o),
|
|
71
|
+
t
|
|
72
|
+
) : N().append(
|
|
57
73
|
new g().append(new h(o))
|
|
58
74
|
);
|
|
59
|
-
const
|
|
60
|
-
(
|
|
75
|
+
const c = N();
|
|
76
|
+
(c.getFirstChild() ?? c).selectStart();
|
|
61
77
|
});
|
|
62
|
-
}, [
|
|
78
|
+
}, [a, o, e, t]), null;
|
|
63
79
|
}
|
|
64
|
-
function
|
|
80
|
+
function Hr({
|
|
65
81
|
defaultValue: o,
|
|
66
|
-
onMarkdownEdit:
|
|
67
|
-
onValueChange:
|
|
68
|
-
plugins:
|
|
69
|
-
toolbars:
|
|
70
|
-
placeholder:
|
|
71
|
-
onlyMarkdown:
|
|
72
|
-
className:
|
|
73
|
-
wrpClassName:
|
|
74
|
-
mentions:
|
|
75
|
-
mentionTrigger:
|
|
76
|
-
}) {
|
|
77
|
-
const [,
|
|
78
|
-
() =>
|
|
79
|
-
[
|
|
82
|
+
onMarkdownEdit: e,
|
|
83
|
+
onValueChange: t,
|
|
84
|
+
plugins: a = [],
|
|
85
|
+
toolbars: c = [],
|
|
86
|
+
placeholder: S = Sr,
|
|
87
|
+
onlyMarkdown: b = !0,
|
|
88
|
+
className: A = "rounded-lg border border-d-border",
|
|
89
|
+
wrpClassName: M = "",
|
|
90
|
+
mentions: d,
|
|
91
|
+
mentionTrigger: v = "@"
|
|
92
|
+
}, $) {
|
|
93
|
+
const [, I] = lr(null), s = d !== void 0, x = ar(
|
|
94
|
+
() => s ? [ur, ...w] : w,
|
|
95
|
+
[s]
|
|
80
96
|
), O = {
|
|
81
97
|
namespace: "AppEditor",
|
|
82
|
-
theme:
|
|
98
|
+
theme: Tr,
|
|
83
99
|
nodes: [
|
|
84
|
-
|
|
100
|
+
er,
|
|
85
101
|
g,
|
|
86
102
|
h,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
103
|
+
tr,
|
|
104
|
+
_,
|
|
105
|
+
Q,
|
|
106
|
+
// TRANSFORMERS includes the Markdown LINK transformer, which needs this
|
|
107
|
+
// node to import `[text](url)` from `defaultValue`.
|
|
108
|
+
U,
|
|
109
|
+
...s ? [k] : []
|
|
91
110
|
],
|
|
92
|
-
onError: (
|
|
93
|
-
console.error(
|
|
111
|
+
onError: (i) => {
|
|
112
|
+
console.error(i);
|
|
94
113
|
},
|
|
95
|
-
...o && !
|
|
114
|
+
...o && !b ? {
|
|
96
115
|
editorState: () => {
|
|
97
|
-
|
|
116
|
+
N().append(
|
|
98
117
|
new g().append(new h(o))
|
|
99
118
|
);
|
|
100
119
|
}
|
|
101
120
|
} : {}
|
|
102
|
-
}, E = (
|
|
103
|
-
return /* @__PURE__ */ r("div", { className:
|
|
121
|
+
}, E = (i) => a.includes(i), p = (i) => c.includes(i), F = E("clear"), P = E("counter"), y = p("block-format"), H = p("font-format"), R = p("history"), j = p("link");
|
|
122
|
+
return /* @__PURE__ */ r("div", { className: Lr("bg-d-background flex h-96 flex-col", M), children: /* @__PURE__ */ r(J, { initialConfig: O, children: /* @__PURE__ */ n(kr, { children: [
|
|
123
|
+
/* @__PURE__ */ r(Ir, { handleRef: $ }),
|
|
104
124
|
o && /* @__PURE__ */ r(
|
|
105
|
-
|
|
125
|
+
Or,
|
|
106
126
|
{
|
|
107
127
|
defaultValue: o,
|
|
108
|
-
onlyMarkdown:
|
|
109
|
-
transformers:
|
|
128
|
+
onlyMarkdown: b,
|
|
129
|
+
transformers: x
|
|
110
130
|
}
|
|
111
131
|
),
|
|
112
|
-
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/* @__PURE__ */ r(
|
|
117
|
-
/* @__PURE__ */ r(
|
|
118
|
-
/* @__PURE__ */ r(
|
|
119
|
-
/* @__PURE__ */ r(
|
|
120
|
-
/* @__PURE__ */ r(
|
|
121
|
-
/* @__PURE__ */ r(
|
|
132
|
+
s && /* @__PURE__ */ r(gr, { source: d, trigger: v }),
|
|
133
|
+
/* @__PURE__ */ n("div", { className: "border-d-border flex items-center border-b", children: [
|
|
134
|
+
R && /* @__PURE__ */ r(f, { children: () => /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */ r(wr, {}) }) }),
|
|
135
|
+
y && /* @__PURE__ */ r(f, { children: () => /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */ n(Pr, { children: [
|
|
136
|
+
/* @__PURE__ */ r(Er, {}),
|
|
137
|
+
/* @__PURE__ */ r(vr, { levels: ["h1", "h2", "h3"] }),
|
|
138
|
+
/* @__PURE__ */ r(xr, {}),
|
|
139
|
+
/* @__PURE__ */ r(Nr, {}),
|
|
140
|
+
/* @__PURE__ */ r(br, {}),
|
|
141
|
+
/* @__PURE__ */ r(Fr, {})
|
|
122
142
|
] }) }) }) }),
|
|
123
|
-
|
|
124
|
-
/* @__PURE__ */ r(
|
|
125
|
-
/* @__PURE__ */ r(
|
|
126
|
-
/* @__PURE__ */ r(
|
|
127
|
-
/* @__PURE__ */ r(
|
|
128
|
-
|
|
129
|
-
|
|
143
|
+
H && /* @__PURE__ */ r(f, { children: () => /* @__PURE__ */ n("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: [
|
|
144
|
+
/* @__PURE__ */ r(m, { format: "bold" }),
|
|
145
|
+
/* @__PURE__ */ r(m, { format: "italic" }),
|
|
146
|
+
/* @__PURE__ */ r(m, { format: "underline" }),
|
|
147
|
+
/* @__PURE__ */ r(m, { format: "strikethrough" }),
|
|
148
|
+
/* @__PURE__ */ r(m, { format: "code" }),
|
|
149
|
+
s && /* @__PURE__ */ r(
|
|
150
|
+
Cr,
|
|
130
151
|
{
|
|
131
|
-
trigger:
|
|
152
|
+
trigger: v ?? "@"
|
|
132
153
|
}
|
|
133
154
|
)
|
|
134
|
-
] }) })
|
|
155
|
+
] }) }),
|
|
156
|
+
j && /* @__PURE__ */ r(f, { children: () => /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */ r(yr, {}) }) })
|
|
135
157
|
] }),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
|
|
158
|
+
/* @__PURE__ */ n("div", { className: "relative flex min-h-0 w-full flex-1 flex-col", children: [
|
|
159
|
+
R && /* @__PURE__ */ r(Y, {}),
|
|
138
160
|
/* @__PURE__ */ r(
|
|
139
|
-
|
|
161
|
+
or,
|
|
140
162
|
{
|
|
141
|
-
ErrorBoundary:
|
|
163
|
+
ErrorBoundary: X,
|
|
142
164
|
contentEditable: /* @__PURE__ */ r(
|
|
143
165
|
"div",
|
|
144
166
|
{
|
|
145
|
-
ref:
|
|
167
|
+
ref: I,
|
|
146
168
|
className: "flex min-h-0 w-full flex-1 overflow-auto",
|
|
147
169
|
children: /* @__PURE__ */ r(
|
|
148
|
-
|
|
170
|
+
cr,
|
|
149
171
|
{
|
|
150
|
-
placeholder:
|
|
151
|
-
className: `border-d-border w-full rounded-none border-b ${
|
|
172
|
+
placeholder: S,
|
|
173
|
+
className: `border-d-border w-full rounded-none border-b ${A}`
|
|
152
174
|
}
|
|
153
175
|
)
|
|
154
176
|
}
|
|
155
177
|
)
|
|
156
178
|
}
|
|
157
179
|
),
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */ r(
|
|
160
|
-
/* @__PURE__ */ r(
|
|
180
|
+
y && /* @__PURE__ */ n(u, { children: [
|
|
181
|
+
/* @__PURE__ */ r(V, {}),
|
|
182
|
+
/* @__PURE__ */ r(q, {})
|
|
161
183
|
] }),
|
|
162
|
-
(F ||
|
|
184
|
+
(F || P) && /* @__PURE__ */ r(dr, { children: /* @__PURE__ */ n("div", { className: "clear-both flex items-center justify-between gap-2 p-1", children: [
|
|
163
185
|
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-start" }),
|
|
164
|
-
/* @__PURE__ */ r("div", { children:
|
|
165
|
-
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-end gap-2", children: F && /* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */ r(
|
|
167
|
-
/* @__PURE__ */ r(
|
|
186
|
+
/* @__PURE__ */ r("div", { children: P && /* @__PURE__ */ r(fr, { charset: "UTF-16" }) }),
|
|
187
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-end gap-2", children: F && /* @__PURE__ */ n(u, { children: [
|
|
188
|
+
/* @__PURE__ */ r(pr, {}),
|
|
189
|
+
/* @__PURE__ */ r(G, {})
|
|
168
190
|
] }) })
|
|
169
191
|
] }) })
|
|
170
192
|
] }),
|
|
171
193
|
/* @__PURE__ */ r(
|
|
172
|
-
|
|
194
|
+
rr,
|
|
173
195
|
{
|
|
174
196
|
ignoreSelectionChange: !0,
|
|
175
|
-
onChange: (
|
|
176
|
-
if (!
|
|
177
|
-
const
|
|
178
|
-
|
|
197
|
+
onChange: (i) => {
|
|
198
|
+
if (!t && !e) return;
|
|
199
|
+
const C = $r(
|
|
200
|
+
i.read(() => W(x))
|
|
179
201
|
);
|
|
180
|
-
if (!
|
|
181
|
-
|
|
202
|
+
if (!t) {
|
|
203
|
+
e?.(C);
|
|
182
204
|
return;
|
|
183
205
|
}
|
|
184
|
-
let
|
|
185
|
-
if (
|
|
186
|
-
const
|
|
187
|
-
() =>
|
|
188
|
-
),
|
|
189
|
-
|
|
206
|
+
let T = [];
|
|
207
|
+
if (s) {
|
|
208
|
+
const B = i.read(
|
|
209
|
+
() => hr(ir(k))
|
|
210
|
+
), z = Array.isArray(d) ? d : [], D = new Map(
|
|
211
|
+
z.map((l) => [String(l.id), l])
|
|
190
212
|
);
|
|
191
|
-
|
|
192
|
-
(
|
|
193
|
-
id:
|
|
194
|
-
label:
|
|
195
|
-
value:
|
|
213
|
+
T = B.map(
|
|
214
|
+
(l) => D.get(String(l.id)) ?? {
|
|
215
|
+
id: l.id,
|
|
216
|
+
label: l.label,
|
|
217
|
+
value: l.value
|
|
196
218
|
}
|
|
197
219
|
);
|
|
198
220
|
}
|
|
199
|
-
|
|
221
|
+
t(C, { mentions: T });
|
|
200
222
|
}
|
|
201
223
|
}
|
|
202
224
|
)
|
|
203
225
|
] }) }) });
|
|
204
226
|
}
|
|
227
|
+
const jr = nr(Hr);
|
|
228
|
+
jr.displayName = "AppEditor";
|
|
205
229
|
export {
|
|
206
|
-
|
|
230
|
+
jr as AppEditor
|
|
207
231
|
};
|