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,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.1.0",
|
|
3
|
-
"generatedAt": "2026-10-
|
|
3
|
+
"generatedAt": "2026-10-20T20:53:03.846Z",
|
|
4
4
|
"package": {
|
|
5
5
|
"name": "laif-ds",
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.4"
|
|
7
7
|
},
|
|
8
8
|
"stats": {
|
|
9
9
|
"documentedComponentCount": 97,
|
|
@@ -702,6 +702,7 @@
|
|
|
702
702
|
"hasPropsTable": true,
|
|
703
703
|
"hasExamples": true,
|
|
704
704
|
"exampleTitles": [
|
|
705
|
+
"AppEditorHandle",
|
|
705
706
|
"MentionItem",
|
|
706
707
|
"Mention markdown serialization",
|
|
707
708
|
"Dedup, reconciliation, and id types",
|
|
@@ -709,6 +710,7 @@
|
|
|
709
710
|
"Full Toolbar + Plugins",
|
|
710
711
|
"Markdown Default Value",
|
|
711
712
|
"Underline Support",
|
|
713
|
+
"Inserting a link from outside the editor",
|
|
712
714
|
"Mentions",
|
|
713
715
|
"Async mentions (lazy loader)"
|
|
714
716
|
],
|
|
@@ -717,10 +719,10 @@
|
|
|
717
719
|
},
|
|
718
720
|
"metadata": {
|
|
719
721
|
"props": {
|
|
720
|
-
"totalProps":
|
|
722
|
+
"totalProps": 11,
|
|
721
723
|
"requiredPropsCount": 0,
|
|
722
|
-
"typedPropsCount":
|
|
723
|
-
"describedPropsCount":
|
|
724
|
+
"typedPropsCount": 11,
|
|
725
|
+
"describedPropsCount": 11
|
|
724
726
|
},
|
|
725
727
|
"accessibility": {
|
|
726
728
|
"hasCoverage": true
|
|
@@ -741,9 +743,10 @@
|
|
|
741
743
|
},
|
|
742
744
|
"typeReferences": [
|
|
743
745
|
"interface AppEditorChangeMeta {\r",
|
|
746
|
+
"interface AppEditorHandle {\r",
|
|
744
747
|
"interface AppEditorProps {\r",
|
|
745
748
|
"type AppEditorPlugin = \"clear\" | \"counter\";\r",
|
|
746
|
-
"type AppEditorToolbar = \"block-format\" | \"font-format\" | \"history\";\r"
|
|
749
|
+
"type AppEditorToolbar = \"block-format\" | \"font-format\" | \"history\" | \"link\";\r"
|
|
747
750
|
]
|
|
748
751
|
},
|
|
749
752
|
{
|
|
@@ -1022,14 +1025,20 @@
|
|
|
1022
1025
|
"hasExamples": true,
|
|
1023
1026
|
"exampleTitles": [
|
|
1024
1027
|
"AppSelectOption",
|
|
1025
|
-
"
|
|
1026
|
-
"
|
|
1027
|
-
"
|
|
1028
|
-
"
|
|
1028
|
+
"Required",
|
|
1029
|
+
"Value",
|
|
1030
|
+
"Behaviour",
|
|
1031
|
+
"Label and form state",
|
|
1032
|
+
"Texts",
|
|
1033
|
+
"Appearance",
|
|
1034
|
+
"Accessibility and integration",
|
|
1035
|
+
"Types by mode",
|
|
1029
1036
|
"Size Variants",
|
|
1030
1037
|
"Custom Labels (JSX Support)",
|
|
1031
1038
|
"Controlled vs Uncontrolled",
|
|
1032
1039
|
"Selection Modes",
|
|
1040
|
+
"Popover Placement (Multiple)",
|
|
1041
|
+
"Selected Badges",
|
|
1033
1042
|
"Search Functionality",
|
|
1034
1043
|
"Creatable Options",
|
|
1035
1044
|
"Grouping",
|
|
@@ -1037,19 +1046,24 @@
|
|
|
1037
1046
|
"Max Selection Limit",
|
|
1038
1047
|
"Chips Display",
|
|
1039
1048
|
"Disabled Options",
|
|
1049
|
+
"Accessibility",
|
|
1050
|
+
"Form Label",
|
|
1040
1051
|
"Disabled Component",
|
|
1041
1052
|
"Basic Single Select",
|
|
1042
1053
|
"Multiple Select with Search and Chips",
|
|
1043
1054
|
"Grouped Options with Max Selection",
|
|
1044
1055
|
"Creatable Select",
|
|
1045
1056
|
"Custom JSX Labels",
|
|
1057
|
+
"Searchable JSX Labels",
|
|
1046
1058
|
"Clearable Single Select",
|
|
1059
|
+
"Required with Validation",
|
|
1047
1060
|
"With Disabled Options",
|
|
1048
1061
|
"Multiple with Select All / Deselect All",
|
|
1062
|
+
"Help Text via `aria-describedby`",
|
|
1049
1063
|
"Custom Render Value",
|
|
1050
1064
|
"Accessible name",
|
|
1051
|
-
"Keyboard",
|
|
1052
|
-
"The popover is
|
|
1065
|
+
"Keyboard and focus",
|
|
1066
|
+
"The popover is not modal",
|
|
1053
1067
|
"Residual limits"
|
|
1054
1068
|
],
|
|
1055
1069
|
"controlledPattern": "controlled-uncontrolled-documented",
|
|
@@ -1059,10 +1073,10 @@
|
|
|
1059
1073
|
},
|
|
1060
1074
|
"metadata": {
|
|
1061
1075
|
"props": {
|
|
1062
|
-
"totalProps":
|
|
1076
|
+
"totalProps": 33,
|
|
1063
1077
|
"requiredPropsCount": 1,
|
|
1064
|
-
"typedPropsCount":
|
|
1065
|
-
"describedPropsCount":
|
|
1078
|
+
"typedPropsCount": 33,
|
|
1079
|
+
"describedPropsCount": 33
|
|
1066
1080
|
},
|
|
1067
1081
|
"accessibility": {
|
|
1068
1082
|
"hasCoverage": true
|
|
@@ -1071,10 +1085,11 @@
|
|
|
1071
1085
|
"coveredStates": [
|
|
1072
1086
|
"focus",
|
|
1073
1087
|
"disabled",
|
|
1088
|
+
"error",
|
|
1074
1089
|
"empty",
|
|
1075
1090
|
"selected"
|
|
1076
1091
|
],
|
|
1077
|
-
"coveredStateCount":
|
|
1092
|
+
"coveredStateCount": 5
|
|
1078
1093
|
}
|
|
1079
1094
|
},
|
|
1080
1095
|
"aiReadiness": {
|
|
@@ -1083,6 +1098,7 @@
|
|
|
1083
1098
|
},
|
|
1084
1099
|
"typeReferences": [
|
|
1085
1100
|
"interface AppSelectOption {\r",
|
|
1101
|
+
"type AppSelectHTMLProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof OwnBaseProps | \"children\" | \"dangerouslySetInnerHTML\" | \"contentEditable\" | \"defaultValue\" | \"defaultChecked\" | \"onChange\" | \"role\" | \"tabIndex\" | \"aria-expanded\" | \"aria-haspopup\" | \"aria-controls\" | \"aria-disabled\" | \"aria-required\">;\r",
|
|
1086
1102
|
"type AppSelectProps = SingleSelectProps | MultiSelectProps;\r"
|
|
1087
1103
|
]
|
|
1088
1104
|
},
|
|
@@ -6536,5 +6552,5 @@
|
|
|
6536
6552
|
]
|
|
6537
6553
|
}
|
|
6538
6554
|
],
|
|
6539
|
-
"checksum": "
|
|
6555
|
+
"checksum": "34fc8ab2b8cfb6421c8b1c4cfbe8a792ee0a1bc846c62fc266a58d4b3a158fc2"
|
|
6540
6556
|
}
|
|
@@ -1,47 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { $isTableSelection as
|
|
4
|
-
import { FORMAT_TEXT_COMMAND as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { useToolbarContext as
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { $isTableSelection as n } from "../../../../node_modules/@lexical/table/dist/LexicalTable.prod.js";
|
|
4
|
+
import { FORMAT_TEXT_COMMAND as s, $isRangeSelection as m } from "../../../../node_modules/lexical/dist/Lexical.prod.js";
|
|
5
|
+
import { useState as c } from "react";
|
|
6
|
+
import { useToolbarContext as d } from "../../context/toolbar-context.js";
|
|
7
7
|
import { useUpdateToolbarHandler as p } from "../../editor-hooks/use-update-toolbar.js";
|
|
8
|
-
import { Toggle as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import { Toggle as u } from "../../../ui/toggle.js";
|
|
9
|
+
import f from "../../../../node_modules/lucide-react/dist/esm/icons/code.js";
|
|
10
|
+
import h from "../../../../node_modules/lucide-react/dist/esm/icons/strikethrough.js";
|
|
11
|
+
import b from "../../../../node_modules/lucide-react/dist/esm/icons/underline.js";
|
|
12
|
+
import T from "../../../../node_modules/lucide-react/dist/esm/icons/italic.js";
|
|
13
13
|
import g from "../../../../node_modules/lucide-react/dist/esm/icons/bold.js";
|
|
14
|
-
const
|
|
14
|
+
const S = {
|
|
15
15
|
bold: g,
|
|
16
|
-
italic:
|
|
17
|
-
underline:
|
|
18
|
-
strikethrough:
|
|
19
|
-
code:
|
|
16
|
+
italic: T,
|
|
17
|
+
underline: b,
|
|
18
|
+
strikethrough: h,
|
|
19
|
+
code: f
|
|
20
|
+
}, C = {
|
|
21
|
+
bold: "Bold",
|
|
22
|
+
italic: "Italic",
|
|
23
|
+
underline: "Underline",
|
|
24
|
+
strikethrough: "Strikethrough",
|
|
25
|
+
code: "Code"
|
|
20
26
|
};
|
|
21
27
|
function R({
|
|
22
|
-
format:
|
|
28
|
+
format: o
|
|
23
29
|
}) {
|
|
24
|
-
const { activeEditor:
|
|
25
|
-
p((
|
|
26
|
-
(
|
|
30
|
+
const { activeEditor: e } = d(), [i, a] = c(!1);
|
|
31
|
+
p((r) => {
|
|
32
|
+
(m(r) || n(r)) && "hasFormat" in r && a(r.hasFormat(o));
|
|
27
33
|
});
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
34
|
+
const l = S[o];
|
|
35
|
+
return /* @__PURE__ */ t(
|
|
36
|
+
u,
|
|
31
37
|
{
|
|
32
|
-
"aria-label":
|
|
38
|
+
"aria-label": C[o],
|
|
33
39
|
variant: "outline",
|
|
34
40
|
size: "sm",
|
|
35
|
-
|
|
36
|
-
pressed: e,
|
|
37
|
-
onPressedChange: t,
|
|
41
|
+
pressed: i,
|
|
38
42
|
onClick: () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
e.dispatchCommand(
|
|
44
|
+
s,
|
|
45
|
+
o
|
|
42
46
|
);
|
|
43
47
|
},
|
|
44
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ t(l, { className: "h-4 w-4" })
|
|
45
49
|
}
|
|
46
50
|
);
|
|
47
51
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { $createLinkNode as S, $isLinkNode as $ } from "../../../../node_modules/@lexical/link/dist/LexicalLink.prod.js";
|
|
4
|
+
import { $getSelection as m, $isRangeSelection as p, $getRoot as N, $createTextNode as b, $setSelection as T, $findMatchingParent as z } from "../../../../node_modules/lexical/dist/Lexical.prod.js";
|
|
5
|
+
import { useState as s } from "react";
|
|
6
|
+
import { useToolbarContext as U } from "../../context/toolbar-context.js";
|
|
7
|
+
import { useUpdateToolbarHandler as E } from "../../editor-hooks/use-update-toolbar.js";
|
|
8
|
+
import { Button as L } from "../../../ui/button.js";
|
|
9
|
+
import { Input as x } from "../../../ui/input.js";
|
|
10
|
+
import { Popover as P, PopoverTrigger as R, PopoverContent as y } from "../../../ui/popover.js";
|
|
11
|
+
import { Toggle as I } from "../../../ui/toggle.js";
|
|
12
|
+
import O from "../../../../node_modules/lucide-react/dist/esm/icons/link.js";
|
|
13
|
+
function f(e) {
|
|
14
|
+
return p(e) ? z(e.anchor.getNode(), $) : null;
|
|
15
|
+
}
|
|
16
|
+
function j(e, n) {
|
|
17
|
+
let o = m();
|
|
18
|
+
if (p(o) || (N().selectEnd(), o = m()), !p(o)) return;
|
|
19
|
+
const l = S(e).append(b(n || e)), r = f(o);
|
|
20
|
+
if (r) {
|
|
21
|
+
r.replace(l), l.selectNext(0, 0);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
o.insertNodes(
|
|
25
|
+
o.isCollapsed() ? [l, b(" ")] : [l]
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function w(e) {
|
|
29
|
+
const n = e.trim();
|
|
30
|
+
return /^[a-z][a-z\d+.-]*:/i.test(n) ? n : `https://${n}`;
|
|
31
|
+
}
|
|
32
|
+
function W() {
|
|
33
|
+
const { activeEditor: e } = U(), [n, o] = s(!1), [l, r] = s(!1), [a, g] = s(""), [c, h] = s(""), [k, C] = s(
|
|
34
|
+
null
|
|
35
|
+
);
|
|
36
|
+
return E((t) => {
|
|
37
|
+
o(f(t) !== null);
|
|
38
|
+
}), /* @__PURE__ */ u(P, { open: l, onOpenChange: (t) => {
|
|
39
|
+
t && e.getEditorState().read(() => {
|
|
40
|
+
const d = m(), v = f(d);
|
|
41
|
+
C(d?.clone() ?? null), g(v?.getURL() ?? ""), h(v?.getTextContent() ?? d?.getTextContent() ?? "");
|
|
42
|
+
}), r(t);
|
|
43
|
+
}, children: [
|
|
44
|
+
/* @__PURE__ */ i(R, { asChild: !0, children: /* @__PURE__ */ i(
|
|
45
|
+
I,
|
|
46
|
+
{
|
|
47
|
+
"aria-label": n ? "Edit link" : "Insert link",
|
|
48
|
+
variant: "outline",
|
|
49
|
+
size: "sm",
|
|
50
|
+
pressed: n,
|
|
51
|
+
children: /* @__PURE__ */ i(O, { className: "h-4 w-4" })
|
|
52
|
+
}
|
|
53
|
+
) }),
|
|
54
|
+
/* @__PURE__ */ i(y, { align: "start", className: "w-80 p-3", children: /* @__PURE__ */ u("form", { onSubmit: (t) => {
|
|
55
|
+
t.preventDefault(), a.trim() && (e.focus(), e.update(() => {
|
|
56
|
+
k && T(k.clone()), j(w(a), c.trim() ? c : void 0);
|
|
57
|
+
}), r(!1));
|
|
58
|
+
}, className: "flex flex-col gap-2", children: [
|
|
59
|
+
/* @__PURE__ */ i(
|
|
60
|
+
x,
|
|
61
|
+
{
|
|
62
|
+
label: "URL",
|
|
63
|
+
type: "text",
|
|
64
|
+
inputMode: "url",
|
|
65
|
+
placeholder: "https://",
|
|
66
|
+
value: a,
|
|
67
|
+
onChange: (t) => g(t.target.value),
|
|
68
|
+
autoFocus: !0
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ i(
|
|
72
|
+
x,
|
|
73
|
+
{
|
|
74
|
+
label: "Etichetta",
|
|
75
|
+
placeholder: "Testo mostrato al posto dell'URL",
|
|
76
|
+
value: c,
|
|
77
|
+
onChange: (t) => h(t.target.value)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2", children: [
|
|
81
|
+
/* @__PURE__ */ i(
|
|
82
|
+
L,
|
|
83
|
+
{
|
|
84
|
+
type: "button",
|
|
85
|
+
variant: "ghost",
|
|
86
|
+
size: "sm",
|
|
87
|
+
onClick: () => r(!1),
|
|
88
|
+
children: "Annulla"
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ i(L, { type: "submit", size: "sm", disabled: !a.trim(), children: n ? "Aggiorna link" : "Inserisci link" })
|
|
92
|
+
] })
|
|
93
|
+
] }) })
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
j as $insertLink,
|
|
98
|
+
W as LinkToolbarPlugin
|
|
99
|
+
};
|
|
@@ -35,13 +35,16 @@ const t = {
|
|
|
35
35
|
hashtag: "text-blue-600 bg-blue-100 rounded-md px-1",
|
|
36
36
|
text: {
|
|
37
37
|
bold: "font-bold",
|
|
38
|
-
code: "bg-
|
|
38
|
+
code: "bg-d-muted p-1 rounded-md",
|
|
39
39
|
italic: "italic",
|
|
40
40
|
strikethrough: "line-through",
|
|
41
41
|
subscript: "sub",
|
|
42
42
|
superscript: "sup",
|
|
43
43
|
underline: "underline",
|
|
44
|
-
|
|
44
|
+
// Single token, disjoint from `underline`/`line-through`: Lexical removes the
|
|
45
|
+
// individual format classes when both are set, and both utilities would
|
|
46
|
+
// otherwise override each other's `text-decoration-line`.
|
|
47
|
+
underlineStrikethrough: "[text-decoration-line:underline_line-through]"
|
|
45
48
|
},
|
|
46
49
|
image: "relative inline-block user-select-none cursor-default editor-image",
|
|
47
50
|
inlineImage: "relative inline-block user-select-none cursor-default inline-editor-image",
|