@scalio-cloud/ui 0.109.0 → 0.110.0
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/app-kit/ScalioFactoryReset.d.ts +15 -0
- package/dist/app-kit/ScalioFactoryReset.d.ts.map +1 -0
- package/dist/app-kit/ScalioLicensePanel.d.ts +23 -0
- package/dist/app-kit/ScalioLicensePanel.d.ts.map +1 -0
- package/dist/app-kit/ScalioLoginPage.d.ts +1 -1
- package/dist/app-kit/ScalioLoginPage.d.ts.map +1 -1
- package/dist/app-kit/ScalioMailSettings.d.ts +13 -0
- package/dist/app-kit/ScalioMailSettings.d.ts.map +1 -0
- package/dist/app-kit/ScalioRoleTenants.d.ts +22 -0
- package/dist/app-kit/ScalioRoleTenants.d.ts.map +1 -0
- package/dist/app-kit/_uiReact.d.ts +307 -0
- package/dist/app-kit/_uiReact.d.ts.map +1 -0
- package/dist/app-kit/index.d.ts +4 -0
- package/dist/app-kit/index.d.ts.map +1 -1
- package/dist/app-kit/index.js +303 -106
- package/dist/app-kit/index.js.map +1 -1
- package/dist/app-kit/index.mjs +213 -40
- package/dist/app-kit/index.mjs.map +1 -1
- package/dist/config/i18nCheck.d.ts +49 -0
- package/dist/config/i18nCheck.d.ts.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +187 -4
- package/dist/config/index.js.map +1 -1
- package/dist/config/index.mjs +178 -3
- package/dist/config/index.mjs.map +1 -1
- package/dist/config/openapi.d.ts +34 -0
- package/dist/config/openapi.d.ts.map +1 -0
- package/dist/editor/RichTextEditor.d.ts +58 -0
- package/dist/editor/RichTextEditor.d.ts.map +1 -0
- package/dist/editor/index.d.ts +5 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +350 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/index.mjs +324 -0
- package/dist/editor/index.mjs.map +1 -0
- package/package.json +22 -1
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// src/editor/RichTextEditor.tsx
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { EditorContent, useEditor } from "@tiptap/react";
|
|
4
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
5
|
+
import {
|
|
6
|
+
Bold,
|
|
7
|
+
Code2,
|
|
8
|
+
Eye,
|
|
9
|
+
Heading1,
|
|
10
|
+
Heading2,
|
|
11
|
+
Heading3,
|
|
12
|
+
Italic,
|
|
13
|
+
Link2,
|
|
14
|
+
List,
|
|
15
|
+
ListOrdered,
|
|
16
|
+
RemoveFormatting,
|
|
17
|
+
Underline,
|
|
18
|
+
Unlink
|
|
19
|
+
} from "lucide-react";
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var DEFAULT_RICH_TEXT_LABELS = {
|
|
22
|
+
en: {
|
|
23
|
+
richText: "Rich text",
|
|
24
|
+
html: "HTML",
|
|
25
|
+
toolbarLabel: "Formatting toolbar",
|
|
26
|
+
heading1: "Heading 1",
|
|
27
|
+
heading2: "Heading 2",
|
|
28
|
+
heading3: "Heading 3",
|
|
29
|
+
bold: "Bold",
|
|
30
|
+
italic: "Italic",
|
|
31
|
+
underline: "Underline",
|
|
32
|
+
bulletList: "Bullet list",
|
|
33
|
+
orderedList: "Numbered list",
|
|
34
|
+
link: "Insert link",
|
|
35
|
+
unlink: "Remove link",
|
|
36
|
+
clearFormatting: "Clear formatting",
|
|
37
|
+
linkUrlPlaceholder: "https://example.com",
|
|
38
|
+
applyLink: "Apply",
|
|
39
|
+
cancel: "Cancel"
|
|
40
|
+
},
|
|
41
|
+
de: {
|
|
42
|
+
richText: "Formatierter Text",
|
|
43
|
+
html: "HTML",
|
|
44
|
+
toolbarLabel: "Formatierungsleiste",
|
|
45
|
+
heading1: "\xDCberschrift 1",
|
|
46
|
+
heading2: "\xDCberschrift 2",
|
|
47
|
+
heading3: "\xDCberschrift 3",
|
|
48
|
+
bold: "Fett",
|
|
49
|
+
italic: "Kursiv",
|
|
50
|
+
underline: "Unterstrichen",
|
|
51
|
+
bulletList: "Aufz\xE4hlung",
|
|
52
|
+
orderedList: "Nummerierte Liste",
|
|
53
|
+
link: "Link einf\xFCgen",
|
|
54
|
+
unlink: "Link entfernen",
|
|
55
|
+
clearFormatting: "Formatierung entfernen",
|
|
56
|
+
linkUrlPlaceholder: "https://beispiel.ch",
|
|
57
|
+
applyLink: "\xDCbernehmen",
|
|
58
|
+
cancel: "Abbrechen"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var SAFE_LINK_RE = /^(?:https?:\/\/|mailto:|\/|#)/i;
|
|
62
|
+
function sanitizeLinkUrl(raw) {
|
|
63
|
+
const trimmed = raw.trim();
|
|
64
|
+
if (!trimmed) return null;
|
|
65
|
+
if (SAFE_LINK_RE.test(trimmed)) return trimmed;
|
|
66
|
+
if (/^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(trimmed)) return `https://${trimmed}`;
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
function RichTextEditor({
|
|
70
|
+
value,
|
|
71
|
+
onChange,
|
|
72
|
+
testId = "rich-text-editor",
|
|
73
|
+
lang = "en",
|
|
74
|
+
labels: labelOverrides,
|
|
75
|
+
disabled = false,
|
|
76
|
+
allowHtmlMode = true,
|
|
77
|
+
minHeightClass = "min-h-[320px]",
|
|
78
|
+
className = ""
|
|
79
|
+
}) {
|
|
80
|
+
const L = { ...DEFAULT_RICH_TEXT_LABELS[lang], ...labelOverrides };
|
|
81
|
+
const [htmlMode, setHtmlMode] = useState(false);
|
|
82
|
+
const [linkOpen, setLinkOpen] = useState(false);
|
|
83
|
+
const [linkDraft, setLinkDraft] = useState("");
|
|
84
|
+
const editor = useEditor({
|
|
85
|
+
extensions: [
|
|
86
|
+
StarterKit.configure({
|
|
87
|
+
heading: { levels: [1, 2, 3] },
|
|
88
|
+
link: {
|
|
89
|
+
openOnClick: false,
|
|
90
|
+
autolink: true,
|
|
91
|
+
HTMLAttributes: {
|
|
92
|
+
rel: "noopener noreferrer",
|
|
93
|
+
class: "underline text-primary"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
],
|
|
98
|
+
content: value || "",
|
|
99
|
+
editable: !disabled,
|
|
100
|
+
editorProps: {
|
|
101
|
+
attributes: {
|
|
102
|
+
class: `${minHeightClass} p-3 text-sm leading-relaxed text-foreground bg-background outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-b-md prose prose-sm dark:prose-invert max-w-none`,
|
|
103
|
+
"data-testid": `${testId}-content`
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
onUpdate: ({ editor: instance }) => {
|
|
107
|
+
onChange(instance.getHTML());
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (!editor) return;
|
|
112
|
+
editor.setEditable(!disabled);
|
|
113
|
+
}, [editor, disabled]);
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (!editor) return;
|
|
116
|
+
const incoming = value || "";
|
|
117
|
+
if (incoming !== editor.getHTML()) {
|
|
118
|
+
editor.commands.setContent(incoming, { emitUpdate: false });
|
|
119
|
+
}
|
|
120
|
+
}, [editor, value]);
|
|
121
|
+
const openLinkBar = () => {
|
|
122
|
+
if (!editor) return;
|
|
123
|
+
const current = editor.getAttributes("link").href ?? "";
|
|
124
|
+
setLinkDraft(current);
|
|
125
|
+
setLinkOpen(true);
|
|
126
|
+
};
|
|
127
|
+
const applyLink = () => {
|
|
128
|
+
if (!editor) return;
|
|
129
|
+
const safe = sanitizeLinkUrl(linkDraft);
|
|
130
|
+
if (!safe) {
|
|
131
|
+
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
132
|
+
} else {
|
|
133
|
+
editor.chain().focus().extendMarkRange("link").setLink({ href: safe }).run();
|
|
134
|
+
}
|
|
135
|
+
setLinkOpen(false);
|
|
136
|
+
setLinkDraft("");
|
|
137
|
+
};
|
|
138
|
+
const modeTab = (active, onClick, Icon, label, id) => /* @__PURE__ */ jsxs(
|
|
139
|
+
"button",
|
|
140
|
+
{
|
|
141
|
+
type: "button",
|
|
142
|
+
onClick,
|
|
143
|
+
"aria-pressed": active,
|
|
144
|
+
"data-testid": `${testId}-mode-${id}`,
|
|
145
|
+
className: `text-xs px-2.5 py-1 rounded-md border inline-flex items-center gap-1.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${active ? "bg-primary text-primary-foreground border-primary" : "bg-background text-muted-foreground border-border hover:bg-muted"}`,
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(Icon, { className: "w-3.5 h-3.5" }),
|
|
148
|
+
label
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
const toolBtn = (active, onClick, Icon, label, id) => /* @__PURE__ */ jsx(
|
|
153
|
+
"button",
|
|
154
|
+
{
|
|
155
|
+
type: "button",
|
|
156
|
+
onClick,
|
|
157
|
+
disabled: disabled || !editor,
|
|
158
|
+
"aria-label": label,
|
|
159
|
+
title: label,
|
|
160
|
+
"aria-pressed": active,
|
|
161
|
+
"data-testid": `${testId}-tool-${id}`,
|
|
162
|
+
className: `h-7 w-7 inline-flex items-center justify-center rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 ${active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"}`,
|
|
163
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "w-3.5 h-3.5" })
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
return /* @__PURE__ */ jsxs("div", { className: `scalio-rich-editor ${className}`.trim(), "data-testid": testId, children: [
|
|
167
|
+
allowHtmlMode && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 mb-1.5", children: [
|
|
168
|
+
modeTab(!htmlMode, () => setHtmlMode(false), Eye, L.richText, "rich"),
|
|
169
|
+
modeTab(htmlMode, () => setHtmlMode(true), Code2, L.html, "html")
|
|
170
|
+
] }),
|
|
171
|
+
htmlMode ? /* @__PURE__ */ jsx(
|
|
172
|
+
"textarea",
|
|
173
|
+
{
|
|
174
|
+
value: value || "",
|
|
175
|
+
onChange: (e) => onChange(e.target.value),
|
|
176
|
+
disabled,
|
|
177
|
+
spellCheck: false,
|
|
178
|
+
"data-testid": `${testId}-html`,
|
|
179
|
+
className: `w-full ${minHeightClass} font-mono text-xs leading-relaxed p-3 border border-border rounded-md bg-background text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring`
|
|
180
|
+
}
|
|
181
|
+
) : /* @__PURE__ */ jsxs("div", { className: "border border-border rounded-md bg-background overflow-hidden", children: [
|
|
182
|
+
/* @__PURE__ */ jsxs(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
role: "toolbar",
|
|
186
|
+
"aria-label": L.toolbarLabel,
|
|
187
|
+
className: "flex flex-wrap items-center gap-1 px-2 py-1.5 border-b border-border bg-muted/40",
|
|
188
|
+
children: [
|
|
189
|
+
toolBtn(
|
|
190
|
+
Boolean(editor?.isActive("heading", { level: 1 })),
|
|
191
|
+
() => editor?.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
192
|
+
Heading1,
|
|
193
|
+
L.heading1,
|
|
194
|
+
"h1"
|
|
195
|
+
),
|
|
196
|
+
toolBtn(
|
|
197
|
+
Boolean(editor?.isActive("heading", { level: 2 })),
|
|
198
|
+
() => editor?.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
199
|
+
Heading2,
|
|
200
|
+
L.heading2,
|
|
201
|
+
"h2"
|
|
202
|
+
),
|
|
203
|
+
toolBtn(
|
|
204
|
+
Boolean(editor?.isActive("heading", { level: 3 })),
|
|
205
|
+
() => editor?.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
206
|
+
Heading3,
|
|
207
|
+
L.heading3,
|
|
208
|
+
"h3"
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ jsx("span", { className: "w-px h-4 bg-border mx-1", "aria-hidden": "true" }),
|
|
211
|
+
toolBtn(
|
|
212
|
+
Boolean(editor?.isActive("bold")),
|
|
213
|
+
() => editor?.chain().focus().toggleBold().run(),
|
|
214
|
+
Bold,
|
|
215
|
+
L.bold,
|
|
216
|
+
"bold"
|
|
217
|
+
),
|
|
218
|
+
toolBtn(
|
|
219
|
+
Boolean(editor?.isActive("italic")),
|
|
220
|
+
() => editor?.chain().focus().toggleItalic().run(),
|
|
221
|
+
Italic,
|
|
222
|
+
L.italic,
|
|
223
|
+
"italic"
|
|
224
|
+
),
|
|
225
|
+
toolBtn(
|
|
226
|
+
Boolean(editor?.isActive("underline")),
|
|
227
|
+
() => editor?.chain().focus().toggleUnderline().run(),
|
|
228
|
+
Underline,
|
|
229
|
+
L.underline,
|
|
230
|
+
"underline"
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ jsx("span", { className: "w-px h-4 bg-border mx-1", "aria-hidden": "true" }),
|
|
233
|
+
toolBtn(
|
|
234
|
+
Boolean(editor?.isActive("bulletList")),
|
|
235
|
+
() => editor?.chain().focus().toggleBulletList().run(),
|
|
236
|
+
List,
|
|
237
|
+
L.bulletList,
|
|
238
|
+
"bullet-list"
|
|
239
|
+
),
|
|
240
|
+
toolBtn(
|
|
241
|
+
Boolean(editor?.isActive("orderedList")),
|
|
242
|
+
() => editor?.chain().focus().toggleOrderedList().run(),
|
|
243
|
+
ListOrdered,
|
|
244
|
+
L.orderedList,
|
|
245
|
+
"ordered-list"
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ jsx("span", { className: "w-px h-4 bg-border mx-1", "aria-hidden": "true" }),
|
|
248
|
+
toolBtn(Boolean(editor?.isActive("link")), openLinkBar, Link2, L.link, "link"),
|
|
249
|
+
editor?.isActive("link") && toolBtn(
|
|
250
|
+
false,
|
|
251
|
+
() => editor.chain().focus().extendMarkRange("link").unsetLink().run(),
|
|
252
|
+
Unlink,
|
|
253
|
+
L.unlink,
|
|
254
|
+
"unlink"
|
|
255
|
+
),
|
|
256
|
+
toolBtn(
|
|
257
|
+
false,
|
|
258
|
+
() => editor?.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
259
|
+
RemoveFormatting,
|
|
260
|
+
L.clearFormatting,
|
|
261
|
+
"clear"
|
|
262
|
+
)
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
linkOpen && /* @__PURE__ */ jsxs(
|
|
267
|
+
"div",
|
|
268
|
+
{
|
|
269
|
+
className: "flex items-center gap-2 px-2 py-1.5 border-b border-border bg-muted/20",
|
|
270
|
+
"data-testid": `${testId}-link-bar`,
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ jsx(
|
|
273
|
+
"input",
|
|
274
|
+
{
|
|
275
|
+
type: "url",
|
|
276
|
+
value: linkDraft,
|
|
277
|
+
onChange: (e) => setLinkDraft(e.target.value),
|
|
278
|
+
onKeyDown: (e) => {
|
|
279
|
+
if (e.key === "Enter") {
|
|
280
|
+
e.preventDefault();
|
|
281
|
+
applyLink();
|
|
282
|
+
} else if (e.key === "Escape") {
|
|
283
|
+
setLinkOpen(false);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
placeholder: L.linkUrlPlaceholder,
|
|
287
|
+
"data-testid": `${testId}-link-input`,
|
|
288
|
+
className: "flex-1 h-7 px-2 text-xs bg-background border border-input rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
289
|
+
}
|
|
290
|
+
),
|
|
291
|
+
/* @__PURE__ */ jsx(
|
|
292
|
+
"button",
|
|
293
|
+
{
|
|
294
|
+
type: "button",
|
|
295
|
+
onClick: applyLink,
|
|
296
|
+
"data-testid": `${testId}-link-apply`,
|
|
297
|
+
className: "h-7 px-2.5 text-xs font-medium bg-primary text-primary-foreground rounded-sm hover:bg-primary/90",
|
|
298
|
+
children: L.applyLink
|
|
299
|
+
}
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ jsx(
|
|
302
|
+
"button",
|
|
303
|
+
{
|
|
304
|
+
type: "button",
|
|
305
|
+
onClick: () => setLinkOpen(false),
|
|
306
|
+
className: "h-7 px-2 text-xs text-muted-foreground hover:text-foreground",
|
|
307
|
+
children: L.cancel
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
),
|
|
313
|
+
/* @__PURE__ */ jsx(EditorContent, { editor })
|
|
314
|
+
] })
|
|
315
|
+
] });
|
|
316
|
+
}
|
|
317
|
+
var ScalioRichTextEditor = RichTextEditor;
|
|
318
|
+
export {
|
|
319
|
+
DEFAULT_RICH_TEXT_LABELS,
|
|
320
|
+
RichTextEditor,
|
|
321
|
+
ScalioRichTextEditor,
|
|
322
|
+
sanitizeLinkUrl
|
|
323
|
+
};
|
|
324
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/editor/RichTextEditor.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport {\n Bold,\n Code2,\n Eye,\n Heading1,\n Heading2,\n Heading3,\n Italic,\n Link2,\n List,\n ListOrdered,\n RemoveFormatting,\n Underline,\n Unlink,\n} from \"lucide-react\";\nimport type { ScalioLang } from \"../core/index.js\";\n\nexport interface RichTextEditorLabels {\n readonly richText: string;\n readonly html: string;\n readonly toolbarLabel: string;\n readonly heading1: string;\n readonly heading2: string;\n readonly heading3: string;\n readonly bold: string;\n readonly italic: string;\n readonly underline: string;\n readonly bulletList: string;\n readonly orderedList: string;\n readonly link: string;\n readonly unlink: string;\n readonly clearFormatting: string;\n readonly linkUrlPlaceholder: string;\n readonly applyLink: string;\n readonly cancel: string;\n}\n\nexport const DEFAULT_RICH_TEXT_LABELS: Readonly<Record<ScalioLang, RichTextEditorLabels>> = {\n en: {\n richText: \"Rich text\",\n html: \"HTML\",\n toolbarLabel: \"Formatting toolbar\",\n heading1: \"Heading 1\",\n heading2: \"Heading 2\",\n heading3: \"Heading 3\",\n bold: \"Bold\",\n italic: \"Italic\",\n underline: \"Underline\",\n bulletList: \"Bullet list\",\n orderedList: \"Numbered list\",\n link: \"Insert link\",\n unlink: \"Remove link\",\n clearFormatting: \"Clear formatting\",\n linkUrlPlaceholder: \"https://example.com\",\n applyLink: \"Apply\",\n cancel: \"Cancel\",\n },\n de: {\n richText: \"Formatierter Text\",\n html: \"HTML\",\n toolbarLabel: \"Formatierungsleiste\",\n heading1: \"Überschrift 1\",\n heading2: \"Überschrift 2\",\n heading3: \"Überschrift 3\",\n bold: \"Fett\",\n italic: \"Kursiv\",\n underline: \"Unterstrichen\",\n bulletList: \"Aufzählung\",\n orderedList: \"Nummerierte Liste\",\n link: \"Link einfügen\",\n unlink: \"Link entfernen\",\n clearFormatting: \"Formatierung entfernen\",\n linkUrlPlaceholder: \"https://beispiel.ch\",\n applyLink: \"Übernehmen\",\n cancel: \"Abbrechen\",\n },\n};\n\nexport interface RichTextEditorProps {\n /** Controlled HTML value. */\n readonly value: string;\n /** Called with updated HTML on every edit. */\n readonly onChange: (html: string) => void;\n /** Test identifier prefix (matches legacy `RichTextEditor` test IDs). */\n readonly testId?: string;\n /** UI language for toolbar tooltips and tabs (`\"en\"` default, `\"de\"` uses Swiss spelling). */\n readonly lang?: ScalioLang;\n /** Optional label overrides. */\n readonly labels?: Partial<RichTextEditorLabels>;\n /** Disable editing (read-only view). */\n readonly disabled?: boolean;\n /** Allow switching to raw HTML mode (default: `true`). */\n readonly allowHtmlMode?: boolean;\n /** Minimum height CSS class for editor area (default: `\"min-h-[320px]\"`). */\n readonly minHeightClass?: string;\n /** Optional extra container class name. */\n readonly className?: string;\n}\n\nconst SAFE_LINK_RE = /^(?:https?:\\/\\/|mailto:|\\/|#)/i;\n\n/**\n * Normalize and validate a user-entered link URL. Rejects `javascript:` and similar schemes.\n */\nexport function sanitizeLinkUrl(raw: string): string | null {\n const trimmed = raw.trim();\n if (!trimmed) return null;\n if (SAFE_LINK_RE.test(trimmed)) return trimmed;\n if (/^[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}/.test(trimmed)) return `https://${trimmed}`;\n return null;\n}\n\n/**\n * Standardized, accessible Rich-Text Editor on `@tiptap/react` (ADR 0151 fe/F10).\n *\n * 1:1 drop-in replacement for `react-quill-new` across Scalio frontends:\n * - Semantic `@scalio-cloud/ui` tokens (light and dark mode)\n * - WCAG 2.2 AA toolbar (`role=\"toolbar\"`, `aria-pressed`, keyboard focus rings)\n * - Inline link input (no browser `window.prompt()` popups)\n * - Optional raw HTML view (`data-testid=\"${testId}-mode-html\"` / `${testId}-html`)\n */\nexport function RichTextEditor({\n value,\n onChange,\n testId = \"rich-text-editor\",\n lang = \"en\",\n labels: labelOverrides,\n disabled = false,\n allowHtmlMode = true,\n minHeightClass = \"min-h-[320px]\",\n className = \"\",\n}: RichTextEditorProps): React.ReactElement {\n const L: RichTextEditorLabels = { ...DEFAULT_RICH_TEXT_LABELS[lang], ...labelOverrides };\n const [htmlMode, setHtmlMode] = useState(false);\n const [linkOpen, setLinkOpen] = useState(false);\n const [linkDraft, setLinkDraft] = useState(\"\");\n\n const editor = useEditor({\n extensions: [\n StarterKit.configure({\n heading: { levels: [1, 2, 3] },\n link: {\n openOnClick: false,\n autolink: true,\n HTMLAttributes: {\n rel: \"noopener noreferrer\",\n class: \"underline text-primary\",\n },\n },\n }),\n ],\n content: value || \"\",\n editable: !disabled,\n editorProps: {\n attributes: {\n class: `${minHeightClass} p-3 text-sm leading-relaxed text-foreground bg-background outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-b-md prose prose-sm dark:prose-invert max-w-none`,\n \"data-testid\": `${testId}-content`,\n },\n },\n onUpdate: ({ editor: instance }) => {\n onChange(instance.getHTML());\n },\n });\n\n useEffect(() => {\n if (!editor) return;\n editor.setEditable(!disabled);\n }, [editor, disabled]);\n\n useEffect(() => {\n if (!editor) return;\n const incoming = value || \"\";\n if (incoming !== editor.getHTML()) {\n editor.commands.setContent(incoming, { emitUpdate: false });\n }\n }, [editor, value]);\n\n const openLinkBar = (): void => {\n if (!editor) return;\n const current = (editor.getAttributes(\"link\").href as string | undefined) ?? \"\";\n setLinkDraft(current);\n setLinkOpen(true);\n };\n\n const applyLink = (): void => {\n if (!editor) return;\n const safe = sanitizeLinkUrl(linkDraft);\n if (!safe) {\n editor.chain().focus().extendMarkRange(\"link\").unsetLink().run();\n } else {\n editor.chain().focus().extendMarkRange(\"link\").setLink({ href: safe }).run();\n }\n setLinkOpen(false);\n setLinkDraft(\"\");\n };\n\n const modeTab = (\n active: boolean,\n onClick: () => void,\n Icon: React.ComponentType<{ className?: string }>,\n label: string,\n id: string,\n ): React.ReactElement => (\n <button\n type=\"button\"\n onClick={onClick}\n aria-pressed={active}\n data-testid={`${testId}-mode-${id}`}\n className={`text-xs px-2.5 py-1 rounded-md border inline-flex items-center gap-1.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${\n active\n ? \"bg-primary text-primary-foreground border-primary\"\n : \"bg-background text-muted-foreground border-border hover:bg-muted\"\n }`}\n >\n <Icon className=\"w-3.5 h-3.5\" />\n {label}\n </button>\n );\n\n const toolBtn = (\n active: boolean,\n onClick: () => void,\n Icon: React.ComponentType<{ className?: string }>,\n label: string,\n id: string,\n ): React.ReactElement => (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled || !editor}\n aria-label={label}\n title={label}\n aria-pressed={active}\n data-testid={`${testId}-tool-${id}`}\n className={`h-7 w-7 inline-flex items-center justify-center rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 ${\n active ? \"bg-primary text-primary-foreground\" : \"text-muted-foreground hover:bg-muted hover:text-foreground\"\n }`}\n >\n <Icon className=\"w-3.5 h-3.5\" />\n </button>\n );\n\n return (\n <div className={`scalio-rich-editor ${className}`.trim()} data-testid={testId}>\n {allowHtmlMode && (\n <div className=\"flex items-center gap-1.5 mb-1.5\">\n {modeTab(!htmlMode, () => setHtmlMode(false), Eye, L.richText, \"rich\")}\n {modeTab(htmlMode, () => setHtmlMode(true), Code2, L.html, \"html\")}\n </div>\n )}\n\n {htmlMode ? (\n <textarea\n value={value || \"\"}\n onChange={(e) => onChange(e.target.value)}\n disabled={disabled}\n spellCheck={false}\n data-testid={`${testId}-html`}\n className={`w-full ${minHeightClass} font-mono text-xs leading-relaxed p-3 border border-border rounded-md bg-background text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring`}\n />\n ) : (\n <div className=\"border border-border rounded-md bg-background overflow-hidden\">\n <div\n role=\"toolbar\"\n aria-label={L.toolbarLabel}\n className=\"flex flex-wrap items-center gap-1 px-2 py-1.5 border-b border-border bg-muted/40\"\n >\n {toolBtn(\n Boolean(editor?.isActive(\"heading\", { level: 1 })),\n () => editor?.chain().focus().toggleHeading({ level: 1 }).run(),\n Heading1,\n L.heading1,\n \"h1\",\n )}\n {toolBtn(\n Boolean(editor?.isActive(\"heading\", { level: 2 })),\n () => editor?.chain().focus().toggleHeading({ level: 2 }).run(),\n Heading2,\n L.heading2,\n \"h2\",\n )}\n {toolBtn(\n Boolean(editor?.isActive(\"heading\", { level: 3 })),\n () => editor?.chain().focus().toggleHeading({ level: 3 }).run(),\n Heading3,\n L.heading3,\n \"h3\",\n )}\n\n <span className=\"w-px h-4 bg-border mx-1\" aria-hidden=\"true\" />\n\n {toolBtn(\n Boolean(editor?.isActive(\"bold\")),\n () => editor?.chain().focus().toggleBold().run(),\n Bold,\n L.bold,\n \"bold\",\n )}\n {toolBtn(\n Boolean(editor?.isActive(\"italic\")),\n () => editor?.chain().focus().toggleItalic().run(),\n Italic,\n L.italic,\n \"italic\",\n )}\n {toolBtn(\n Boolean(editor?.isActive(\"underline\")),\n () => editor?.chain().focus().toggleUnderline().run(),\n Underline,\n L.underline,\n \"underline\",\n )}\n\n <span className=\"w-px h-4 bg-border mx-1\" aria-hidden=\"true\" />\n\n {toolBtn(\n Boolean(editor?.isActive(\"bulletList\")),\n () => editor?.chain().focus().toggleBulletList().run(),\n List,\n L.bulletList,\n \"bullet-list\",\n )}\n {toolBtn(\n Boolean(editor?.isActive(\"orderedList\")),\n () => editor?.chain().focus().toggleOrderedList().run(),\n ListOrdered,\n L.orderedList,\n \"ordered-list\",\n )}\n\n <span className=\"w-px h-4 bg-border mx-1\" aria-hidden=\"true\" />\n\n {toolBtn(Boolean(editor?.isActive(\"link\")), openLinkBar, Link2, L.link, \"link\")}\n {editor?.isActive(\"link\") &&\n toolBtn(\n false,\n () => editor.chain().focus().extendMarkRange(\"link\").unsetLink().run(),\n Unlink,\n L.unlink,\n \"unlink\",\n )}\n {toolBtn(\n false,\n () => editor?.chain().focus().unsetAllMarks().clearNodes().run(),\n RemoveFormatting,\n L.clearFormatting,\n \"clear\",\n )}\n </div>\n\n {linkOpen && (\n <div\n className=\"flex items-center gap-2 px-2 py-1.5 border-b border-border bg-muted/20\"\n data-testid={`${testId}-link-bar`}\n >\n <input\n type=\"url\"\n value={linkDraft}\n onChange={(e) => setLinkDraft(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n applyLink();\n } else if (e.key === \"Escape\") {\n setLinkOpen(false);\n }\n }}\n placeholder={L.linkUrlPlaceholder}\n data-testid={`${testId}-link-input`}\n className=\"flex-1 h-7 px-2 text-xs bg-background border border-input rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <button\n type=\"button\"\n onClick={applyLink}\n data-testid={`${testId}-link-apply`}\n className=\"h-7 px-2.5 text-xs font-medium bg-primary text-primary-foreground rounded-sm hover:bg-primary/90\"\n >\n {L.applyLink}\n </button>\n <button\n type=\"button\"\n onClick={() => setLinkOpen(false)}\n className=\"h-7 px-2 text-xs text-muted-foreground hover:text-foreground\"\n >\n {L.cancel}\n </button>\n </div>\n )}\n\n <EditorContent editor={editor} />\n </div>\n )}\n </div>\n );\n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;AAAA,YACD;AAAA,cACC;AAAA,cACA,MAAM,QAAQ,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,IAAI;AAAA,cAC/D;AAAA,cACA,EAAE;AAAA,cACF;AAAA,YACF;AAAA;AAAA;AAAA,MACF;AAAA,MAEC,YACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,eAAa,GAAG,MAAM;AAAA,UAEtB;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,OAAO;AAAA,gBACP,UAAU,CAAC,MAAM,aAAa,EAAE,OAAO,KAAK;AAAA,gBAC5C,WAAW,CAAC,MAAM;AAChB,sBAAI,EAAE,QAAQ,SAAS;AACrB,sBAAE,eAAe;AACjB,8BAAU;AAAA,kBACZ,WAAW,EAAE,QAAQ,UAAU;AAC7B,gCAAY,KAAK;AAAA,kBACnB;AAAA,gBACF;AAAA,gBACA,aAAa,EAAE;AAAA,gBACf,eAAa,GAAG,MAAM;AAAA,gBACtB,WAAU;AAAA;AAAA,YACZ;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,eAAa,GAAG,MAAM;AAAA,gBACtB,WAAU;AAAA,gBAET,YAAE;AAAA;AAAA,YACL;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS,MAAM,YAAY,KAAK;AAAA,gBAChC,WAAU;AAAA,gBAET,YAAE;AAAA;AAAA,YACL;AAAA;AAAA;AAAA,MACF;AAAA,MAGF,oBAAC,iBAAc,QAAgB;AAAA,OACjC;AAAA,KAEJ;AAEJ;AAEO,IAAM,uBAAuB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.110.0",
|
|
4
4
|
"description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
|
|
5
5
|
"license": "SEE LICENSE IN README.md",
|
|
6
6
|
"private": false,
|
|
@@ -61,6 +61,12 @@
|
|
|
61
61
|
"import": "./dist/config/index.mjs",
|
|
62
62
|
"require": "./dist/config/index.js",
|
|
63
63
|
"default": "./dist/config/index.mjs"
|
|
64
|
+
},
|
|
65
|
+
"./editor": {
|
|
66
|
+
"types": "./dist/editor/index.d.ts",
|
|
67
|
+
"import": "./dist/editor/index.mjs",
|
|
68
|
+
"require": "./dist/editor/index.js",
|
|
69
|
+
"default": "./dist/editor/index.mjs"
|
|
64
70
|
}
|
|
65
71
|
},
|
|
66
72
|
"files": [
|
|
@@ -101,6 +107,9 @@
|
|
|
101
107
|
"@radix-ui/react-switch": "^1.1.0",
|
|
102
108
|
"@radix-ui/react-tabs": "^1.1.0",
|
|
103
109
|
"@tanstack/react-query": "^5.0.0",
|
|
110
|
+
"@tiptap/pm": "^3.0.0",
|
|
111
|
+
"@tiptap/react": "^3.0.0",
|
|
112
|
+
"@tiptap/starter-kit": "^3.0.0",
|
|
104
113
|
"axios": ">=1.7.0 <2",
|
|
105
114
|
"class-variance-authority": "^0.7.0",
|
|
106
115
|
"clsx": "^2.1.0",
|
|
@@ -150,6 +159,15 @@
|
|
|
150
159
|
"@tanstack/react-query": {
|
|
151
160
|
"optional": true
|
|
152
161
|
},
|
|
162
|
+
"@tiptap/pm": {
|
|
163
|
+
"optional": true
|
|
164
|
+
},
|
|
165
|
+
"@tiptap/react": {
|
|
166
|
+
"optional": true
|
|
167
|
+
},
|
|
168
|
+
"@tiptap/starter-kit": {
|
|
169
|
+
"optional": true
|
|
170
|
+
},
|
|
153
171
|
"axios": {
|
|
154
172
|
"optional": true
|
|
155
173
|
},
|
|
@@ -207,6 +225,9 @@
|
|
|
207
225
|
"@radix-ui/react-slot": "1.5.0",
|
|
208
226
|
"@radix-ui/react-switch": "1.4.1",
|
|
209
227
|
"@radix-ui/react-tabs": "1.2.1",
|
|
228
|
+
"@tiptap/pm": "^3.35.1",
|
|
229
|
+
"@tiptap/react": "^3.35.1",
|
|
230
|
+
"@tiptap/starter-kit": "^3.35.1",
|
|
210
231
|
"@types/node": "^26.6.11",
|
|
211
232
|
"@types/react": "^19.3.3",
|
|
212
233
|
"@types/react-dom": "^19.3.0",
|