@alfadocs/ui-kit 0.58.0 → 0.59.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/_chunks/{bishop-score-CMQxsdy4.js → bishop-score-B9tvgoIq.js} +2 -2
- package/dist/_chunks/{bmi-calculator-DuUneHuZ.js → bmi-calculator-DA2NGmVK.js} +2 -2
- package/dist/_chunks/{calendar-oYWOCrnf.js → calendar-CkuJIg3s.js} +1 -1
- package/dist/_chunks/{cycle-calculator-vTtZZAmn.js → cycle-calculator-C_t1Hs8V.js} +2 -2
- package/dist/_chunks/{due-date-calculator-CUm5KJbf.js → due-date-calculator-Q8MIwEVV.js} +2 -2
- package/dist/_chunks/{fetal-weight-Xf8-ZoDy.js → fetal-weight-D1a6BmM-.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-830KJql3.js → gestational-age-calculator-AkNFfZYs.js} +2 -2
- package/dist/_chunks/{hcg-doubling-kVOpDfny.js → hcg-doubling-Dg0Hr7ey.js} +2 -2
- package/dist/_chunks/{insert-result-njqBthzT.js → insert-result-C1SYdueh.js} +125 -115
- package/dist/_chunks/{pregnancy-dating-BA37LSkF.js → pregnancy-dating-Dg6dTe1p.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-BMRBeA8V.js → pregnancy-weight-gain-DI7X-0JX.js} +2 -2
- package/dist/_chunks/rich-text-editor-B03qM22-.js +334 -0
- package/dist/_chunks/{unit-converter-BQ6lEYvd.js → unit-converter-3sINXO3m.js} +2 -2
- package/dist/agent-catalog.json +2 -2
- package/dist/components/_shared/safe-html.d.ts +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/rich-text-editor/index.d.ts +2 -2
- package/dist/components/rich-text-editor/index.js +4 -7
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +21 -15
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.js +1 -0
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.js +1 -0
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.js +1 -0
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.js +1 -0
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.js +1 -0
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.js +1 -0
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.js +1 -0
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.js +1 -0
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.js +1 -0
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.js +1 -0
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.js +1 -0
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.js +1 -0
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.js +1 -0
- package/dist/index.js +143 -146
- package/dist/locales/ar.json +1 -0
- package/dist/locales/de.json +1 -0
- package/dist/locales/el.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/hi.json +1 -0
- package/dist/locales/it.json +1 -0
- package/dist/locales/ja.json +1 -0
- package/dist/locales/nl.json +1 -0
- package/dist/locales/pl.json +1 -0
- package/dist/locales/pt.json +1 -0
- package/dist/locales/ro.json +1 -0
- package/dist/locales/ru.json +1 -0
- package/dist/locales/sq.json +1 -0
- package/dist/locales/sv.json +1 -0
- package/dist/locales/tr.json +1 -0
- package/dist/locales/zh.json +1 -0
- package/dist/tokens.css +23 -25
- package/package.json +2 -52
- package/dist/_chunks/image-C6RM5hfF.js +0 -16
- package/dist/_chunks/rich-text-editor-DhGIBd4a.js +0 -921
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Y, useId as K, useMemo as N, useRef as l, useState as ee, useEffect as p, useImperativeHandle as te, useCallback as re } from "react";
|
|
3
|
+
import { c as A } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ne } from "react-i18next";
|
|
5
|
+
import { sanitiseHtml as oe } from "../safe-html/index.js";
|
|
6
|
+
import { u as ie } from "./registry-nPAVE19X.js";
|
|
7
|
+
const se = {
|
|
8
|
+
id: "rich-text-editor",
|
|
9
|
+
capabilities: ["edit_inline"],
|
|
10
|
+
state: {
|
|
11
|
+
html: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "Sanitised HTML representation of the editor content.",
|
|
14
|
+
read: (t) => t.getHTML()
|
|
15
|
+
},
|
|
16
|
+
markdown: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
|
|
19
|
+
read: (t) => t.getMarkdown()
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
actions: {
|
|
23
|
+
set_content: {
|
|
24
|
+
safety: "destructive",
|
|
25
|
+
argsType: "{ html: string }",
|
|
26
|
+
description: "Replace the editor content. Loses unsaved input.",
|
|
27
|
+
invoke: (t, n) => {
|
|
28
|
+
t.setContent(n.html);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
clear: {
|
|
32
|
+
safety: "destructive",
|
|
33
|
+
description: "Empty the editor. Loses unsaved input.",
|
|
34
|
+
invoke: (t) => {
|
|
35
|
+
t.clear();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
focus: {
|
|
39
|
+
safety: "read",
|
|
40
|
+
description: "Move keyboard focus to the editor surface.",
|
|
41
|
+
invoke: (t) => {
|
|
42
|
+
t.focus();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
domHooks: {
|
|
47
|
+
root: { attr: "data-component", value: "rich-text-editor" },
|
|
48
|
+
instanceId: {
|
|
49
|
+
attr: "data-component-id",
|
|
50
|
+
sourceProp: "id",
|
|
51
|
+
description: "Sourced from the id prop."
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function u(t) {
|
|
56
|
+
return oe(t, "rich-text");
|
|
57
|
+
}
|
|
58
|
+
function z(t = "") {
|
|
59
|
+
const n = String(t).trim();
|
|
60
|
+
if (n === "" || n === "<p><br></p>" || n === "<p> </p>")
|
|
61
|
+
return "";
|
|
62
|
+
const i = n.replace(/<br\s*\/?>/gi, "").replace(/ /gi, "").replace(/<[^>]+>/g, "").trim();
|
|
63
|
+
return i === "" && /<img\b[^>]*>/i.test(n) ? n : i === "" ? "" : n;
|
|
64
|
+
}
|
|
65
|
+
function ae(t) {
|
|
66
|
+
return t.replace(
|
|
67
|
+
/<img(?![^>]*\sloading=)([^>]*)>/gi,
|
|
68
|
+
'<img loading="lazy"$1>'
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function ce(t) {
|
|
72
|
+
if (t) return t;
|
|
73
|
+
if (typeof window > "u") return null;
|
|
74
|
+
const n = window;
|
|
75
|
+
return n.$R ?? n.Redactor ?? null;
|
|
76
|
+
}
|
|
77
|
+
const de = {
|
|
78
|
+
minimal: ["bold", "italic", "link"],
|
|
79
|
+
standard: ["format", "bold", "italic", "link", "lists"],
|
|
80
|
+
full: [
|
|
81
|
+
"format",
|
|
82
|
+
"bold",
|
|
83
|
+
"italic",
|
|
84
|
+
"deleted",
|
|
85
|
+
"link",
|
|
86
|
+
"lists",
|
|
87
|
+
"image",
|
|
88
|
+
"table",
|
|
89
|
+
"line"
|
|
90
|
+
]
|
|
91
|
+
}, le = {
|
|
92
|
+
sm: "8rem",
|
|
93
|
+
md: "16rem",
|
|
94
|
+
lg: "24rem"
|
|
95
|
+
}, ue = {
|
|
96
|
+
zh: "zh_cn",
|
|
97
|
+
pt: "pt_br"
|
|
98
|
+
};
|
|
99
|
+
function fe(t) {
|
|
100
|
+
const n = t.split("-")[0];
|
|
101
|
+
return ue[n] ?? n ?? "en";
|
|
102
|
+
}
|
|
103
|
+
const me = A(
|
|
104
|
+
"redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
105
|
+
), pe = A(
|
|
106
|
+
[
|
|
107
|
+
"ds:block ds:[inline-size:100%]",
|
|
108
|
+
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
109
|
+
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
110
|
+
"ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
|
|
111
|
+
"ds:p-[var(--spacing-md)] ds:[min-block-size:10rem]",
|
|
112
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
113
|
+
"ds:focus-visible:outline-solid",
|
|
114
|
+
"ds:focus-visible:outline-[var(--ring)]",
|
|
115
|
+
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
116
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
117
|
+
].join(" ")
|
|
118
|
+
), ge = Y(
|
|
119
|
+
({
|
|
120
|
+
id: t,
|
|
121
|
+
defaultValue: n,
|
|
122
|
+
value: i,
|
|
123
|
+
onChange: R,
|
|
124
|
+
toolbar: $ = "standard",
|
|
125
|
+
placeholder: E,
|
|
126
|
+
readOnly: g = !1,
|
|
127
|
+
ariaLabel: O,
|
|
128
|
+
minHeight: H,
|
|
129
|
+
className: B,
|
|
130
|
+
redactor: P,
|
|
131
|
+
options: h,
|
|
132
|
+
plugins: V,
|
|
133
|
+
lang: j,
|
|
134
|
+
imageUploadUrl: L,
|
|
135
|
+
onKeyDown: y
|
|
136
|
+
}, G) => {
|
|
137
|
+
const { t: k, i18n: D } = ne(), M = K(), C = N(
|
|
138
|
+
() => `rte-${M.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
139
|
+
[M]
|
|
140
|
+
), o = `#${C}`, s = l(null), a = l(null), T = l(!1), [f, _] = ee(!1), m = l(null), c = l(R), b = l(y);
|
|
141
|
+
p(() => {
|
|
142
|
+
c.current = R, b.current = y;
|
|
143
|
+
}, [R, y]);
|
|
144
|
+
const F = l(
|
|
145
|
+
(() => {
|
|
146
|
+
const e = i ?? n ?? "";
|
|
147
|
+
return e ? u(e) : "";
|
|
148
|
+
})()
|
|
149
|
+
);
|
|
150
|
+
p(() => {
|
|
151
|
+
const e = s.current;
|
|
152
|
+
if (!e) return;
|
|
153
|
+
e.value = F.current;
|
|
154
|
+
const r = ce(P);
|
|
155
|
+
if (!r) {
|
|
156
|
+
_(!0);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
a.current = r;
|
|
160
|
+
const d = {
|
|
161
|
+
lang: j ?? fe(D.language || "en"),
|
|
162
|
+
buttons: de[$],
|
|
163
|
+
buttonsHide: ["html"],
|
|
164
|
+
plugins: V ?? [],
|
|
165
|
+
placeholder: E ?? k("editor.placeholder"),
|
|
166
|
+
toolbarFixed: !1,
|
|
167
|
+
imageEditable: !1,
|
|
168
|
+
imageResizable: !0
|
|
169
|
+
};
|
|
170
|
+
H && (d.minHeight = le[H]);
|
|
171
|
+
const q = L ? { imageUpload: L } : {}, J = (h == null ? void 0 : h.callbacks) ?? {}, Q = {
|
|
172
|
+
...d,
|
|
173
|
+
...q,
|
|
174
|
+
...h ?? {},
|
|
175
|
+
// Re-pin safety-critical keys LAST so consumer `options` can't override
|
|
176
|
+
// the sanitising change handler or re-enable image editing.
|
|
177
|
+
imageEditable: !1,
|
|
178
|
+
callbacks: {
|
|
179
|
+
...J,
|
|
180
|
+
changed(w) {
|
|
181
|
+
const v = z(ae(w)), X = u(v);
|
|
182
|
+
T.current = !0, c.current && (m.current && clearTimeout(m.current), m.current = setTimeout(() => {
|
|
183
|
+
var I;
|
|
184
|
+
(I = c.current) == null || I.call(c, { html: X, markdown: "" });
|
|
185
|
+
}, 100));
|
|
186
|
+
},
|
|
187
|
+
keydown(w) {
|
|
188
|
+
var v;
|
|
189
|
+
(v = b.current) == null || v.call(b, w);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
try {
|
|
194
|
+
if (r(o, Q), g)
|
|
195
|
+
try {
|
|
196
|
+
r(o, "enableReadonly");
|
|
197
|
+
} catch {
|
|
198
|
+
}
|
|
199
|
+
} catch {
|
|
200
|
+
_(!0);
|
|
201
|
+
}
|
|
202
|
+
return () => {
|
|
203
|
+
m.current && clearTimeout(m.current);
|
|
204
|
+
try {
|
|
205
|
+
r(o, "destroy");
|
|
206
|
+
} catch {
|
|
207
|
+
}
|
|
208
|
+
a.current = null;
|
|
209
|
+
};
|
|
210
|
+
}, []), p(() => {
|
|
211
|
+
const e = a.current;
|
|
212
|
+
if (!e || i === void 0) return;
|
|
213
|
+
if (T.current) {
|
|
214
|
+
T.current = !1;
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const r = u(z(i));
|
|
218
|
+
let d = "";
|
|
219
|
+
try {
|
|
220
|
+
d = z(
|
|
221
|
+
String(e(o, "source.getCode") ?? "")
|
|
222
|
+
);
|
|
223
|
+
} catch {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (d !== r)
|
|
227
|
+
try {
|
|
228
|
+
e(o, "source.setCode", r);
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
}, [i, o]), p(() => {
|
|
232
|
+
const e = a.current;
|
|
233
|
+
if (e)
|
|
234
|
+
try {
|
|
235
|
+
e(o, g ? "enableReadonly" : "disableReadonly");
|
|
236
|
+
} catch {
|
|
237
|
+
}
|
|
238
|
+
}, [g, o]), p(() => {
|
|
239
|
+
if (!f || i === void 0) return;
|
|
240
|
+
const e = s.current;
|
|
241
|
+
if (!e) return;
|
|
242
|
+
const r = u(i);
|
|
243
|
+
e.value !== r && document.activeElement !== e && (e.value = r);
|
|
244
|
+
}, [f, i]);
|
|
245
|
+
const x = N(
|
|
246
|
+
() => ({
|
|
247
|
+
getHTML() {
|
|
248
|
+
var r;
|
|
249
|
+
const e = a.current;
|
|
250
|
+
if (e)
|
|
251
|
+
try {
|
|
252
|
+
return String(e(o, "source.getCode") ?? "");
|
|
253
|
+
} catch {
|
|
254
|
+
}
|
|
255
|
+
return ((r = s.current) == null ? void 0 : r.value) ?? "";
|
|
256
|
+
},
|
|
257
|
+
getMarkdown() {
|
|
258
|
+
return "";
|
|
259
|
+
},
|
|
260
|
+
setContent(e) {
|
|
261
|
+
const r = u(e), d = a.current;
|
|
262
|
+
if (d)
|
|
263
|
+
try {
|
|
264
|
+
d(o, "source.setCode", r);
|
|
265
|
+
return;
|
|
266
|
+
} catch {
|
|
267
|
+
}
|
|
268
|
+
s.current && (s.current.value = r);
|
|
269
|
+
},
|
|
270
|
+
focus() {
|
|
271
|
+
var r;
|
|
272
|
+
const e = a.current;
|
|
273
|
+
if (e)
|
|
274
|
+
try {
|
|
275
|
+
e(o, "editor.focus");
|
|
276
|
+
return;
|
|
277
|
+
} catch {
|
|
278
|
+
}
|
|
279
|
+
(r = s.current) == null || r.focus();
|
|
280
|
+
},
|
|
281
|
+
clear() {
|
|
282
|
+
const e = a.current;
|
|
283
|
+
if (e)
|
|
284
|
+
try {
|
|
285
|
+
e(o, "source.setCode", "");
|
|
286
|
+
return;
|
|
287
|
+
} catch {
|
|
288
|
+
}
|
|
289
|
+
s.current && (s.current.value = "");
|
|
290
|
+
}
|
|
291
|
+
}),
|
|
292
|
+
[o]
|
|
293
|
+
);
|
|
294
|
+
te(G, () => x, [x]), ie(se, x, t);
|
|
295
|
+
const U = re(
|
|
296
|
+
(e) => {
|
|
297
|
+
var r;
|
|
298
|
+
(r = c.current) == null || r.call(c, {
|
|
299
|
+
html: u(e.target.value),
|
|
300
|
+
markdown: ""
|
|
301
|
+
});
|
|
302
|
+
},
|
|
303
|
+
[]
|
|
304
|
+
), W = O ?? k("editor.regionLabel"), Z = E ?? k("editor.placeholder");
|
|
305
|
+
return /* @__PURE__ */ S(
|
|
306
|
+
"div",
|
|
307
|
+
{
|
|
308
|
+
className: [me(), B].filter(Boolean).join(" "),
|
|
309
|
+
"data-component": "rich-text-editor",
|
|
310
|
+
"data-component-id": t,
|
|
311
|
+
children: /* @__PURE__ */ S(
|
|
312
|
+
"textarea",
|
|
313
|
+
{
|
|
314
|
+
ref: s,
|
|
315
|
+
id: C,
|
|
316
|
+
"aria-label": W,
|
|
317
|
+
"aria-multiline": "true",
|
|
318
|
+
placeholder: Z,
|
|
319
|
+
onChange: f ? U : void 0,
|
|
320
|
+
readOnly: f ? g : void 0,
|
|
321
|
+
className: f ? pe() : void 0
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
ge.displayName = "RichTextEditor";
|
|
329
|
+
export {
|
|
330
|
+
ge as R,
|
|
331
|
+
se as r,
|
|
332
|
+
me as w
|
|
333
|
+
};
|
|
334
|
+
//# sourceMappingURL=rich-text-editor-B03qM22-.js.map
|
|
@@ -5,7 +5,7 @@ import { useTranslation as j } from "react-i18next";
|
|
|
5
5
|
import { F as v } from "./form-field-BOm9hK35.js";
|
|
6
6
|
import { N as B } from "./number-input-Dj5L3pXK.js";
|
|
7
7
|
import { S as C } from "./select-hsCaJSX3.js";
|
|
8
|
-
import { I as L } from "./insert-result-
|
|
8
|
+
import { I as L } from "./insert-result-C1SYdueh.js";
|
|
9
9
|
const _ = {
|
|
10
10
|
// weight → base kg
|
|
11
11
|
kg: { id: "kg", category: "weight", factor: 1, offset: 0 },
|
|
@@ -193,4 +193,4 @@ export {
|
|
|
193
193
|
P as b,
|
|
194
194
|
K as c
|
|
195
195
|
};
|
|
196
|
-
//# sourceMappingURL=unit-converter-
|
|
196
|
+
//# sourceMappingURL=unit-converter-3sINXO3m.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "0.
|
|
3
|
+
"packageVersion": "0.59.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -3587,7 +3587,7 @@
|
|
|
3587
3587
|
{
|
|
3588
3588
|
"name": "markdown",
|
|
3589
3589
|
"type": "string",
|
|
3590
|
-
"description": "Markdown representation of the editor content."
|
|
3590
|
+
"description": "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead."
|
|
3591
3591
|
}
|
|
3592
3592
|
],
|
|
3593
3593
|
"actions": [
|
|
@@ -11,7 +11,7 @@ import { type HTMLAttributes } from 'react';
|
|
|
11
11
|
* strong/em, simple code, lists). Used by ChatMessage's LLM output.
|
|
12
12
|
* - `email` — paragraphs + links only; everything else coerced to text.
|
|
13
13
|
* Used for rendering transactional email previews.
|
|
14
|
-
* - `rich-text`— full
|
|
14
|
+
* - `rich-text`— full Redactor-compatible HTML (headings, lists, tables,
|
|
15
15
|
* inline formatting, safe images, safe links). Used by RichTextEditor
|
|
16
16
|
* when setting / reading content programmatically.
|
|
17
17
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as m } from "../../_chunks/bmi-calculator-
|
|
1
|
+
import { B as m } from "../../_chunks/bmi-calculator-DA2NGmVK.js";
|
|
2
2
|
import { b as e, a as t, c as r, d as T, e as c, f as i, i as b, k as n, l as f } from "../../_chunks/bmi-BxD-tFzU.js";
|
|
3
3
|
export {
|
|
4
4
|
m as BmiCalculator,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as e } from "../../_chunks/due-date-calculator-
|
|
1
|
+
import { D as e } from "../../_chunks/due-date-calculator-Q8MIwEVV.js";
|
|
2
2
|
import { C as r, a as o, D, G as _, M as T, T as M, c as E, b as l, g as C, p as A, r as N, d as i, t as n } from "../../_chunks/antenatal-schedule-timeline-CdiqkF05.js";
|
|
3
3
|
export {
|
|
4
4
|
r as CRL_DATING_MAX_MM,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RichTextEditor,
|
|
2
|
-
export type { RichTextEditorHandle, RichTextEditorProps, RichTextEditorToolbar, } from './rich-text-editor';
|
|
1
|
+
export { RichTextEditor, wrapperVariants } from './rich-text-editor';
|
|
2
|
+
export type { RichTextEditorHandle, RichTextEditorProps, RichTextEditorToolbar, RedactorFactory, } from './rich-text-editor';
|
|
3
3
|
export { richTextEditorAgent } from './rich-text-editor.agent';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { R as
|
|
1
|
+
import { R as a, r as e, w as i } from "../../_chunks/rich-text-editor-B03qM22-.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
i as toolbarButtonVariants,
|
|
7
|
-
e as toolbarVariants,
|
|
8
|
-
n as wrapperVariants
|
|
3
|
+
a as RichTextEditor,
|
|
4
|
+
e as richTextEditorAgent,
|
|
5
|
+
i as wrapperVariants
|
|
9
6
|
};
|
|
10
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import '../../tokens/themes/bridges/
|
|
1
|
+
import '../../tokens/themes/bridges/redactor-theme.css';
|
|
2
|
+
export type RedactorFactory = (selector: string | HTMLElement, command?: unknown, ...args: unknown[]) => unknown;
|
|
2
3
|
export type RichTextEditorToolbar = 'minimal' | 'standard' | 'full';
|
|
3
4
|
export interface RichTextEditorProps {
|
|
4
5
|
/** Opaque instance id — emitted as `data-component-id` for the agent registry. */
|
|
5
6
|
id?: string;
|
|
6
|
-
/** HTML
|
|
7
|
+
/** HTML initial value (uncontrolled). Runs through DOMPurify. */
|
|
7
8
|
defaultValue?: string;
|
|
8
|
-
/** Controlled value (HTML). */
|
|
9
|
+
/** Controlled value (HTML). Sanitised; synced with a skip-once caret guard. */
|
|
9
10
|
value?: string;
|
|
10
|
-
/** Emits on every change — debounced
|
|
11
|
+
/** Emits on every change — debounced 100ms. `markdown` is '' (Redactor has no serializer). */
|
|
11
12
|
onChange?: (payload: {
|
|
12
13
|
html: string;
|
|
13
14
|
markdown: string;
|
|
14
15
|
}) => void;
|
|
15
|
-
/** Toolbar preset
|
|
16
|
+
/** Toolbar preset → Redactor `buttons`. */
|
|
16
17
|
toolbar?: RichTextEditorToolbar;
|
|
17
18
|
/** Placeholder text — translates via useTranslation if omitted. */
|
|
18
19
|
placeholder?: string;
|
|
@@ -24,24 +25,29 @@ export interface RichTextEditorProps {
|
|
|
24
25
|
minHeight?: 'sm' | 'md' | 'lg';
|
|
25
26
|
/** Extra class names on the wrapper. */
|
|
26
27
|
className?: string;
|
|
28
|
+
/** Inject the Redactor factory explicitly; else `window.$R` / `window.Redactor`. */
|
|
29
|
+
redactor?: RedactorFactory;
|
|
30
|
+
/** Raw Redactor options, deep-merged LAST over the kit defaults (callbacks reserved). */
|
|
31
|
+
options?: Record<string, unknown>;
|
|
32
|
+
/** Redactor plugin names to enable (the consumer must register/load them). */
|
|
33
|
+
plugins?: string[];
|
|
34
|
+
/** Redactor lang code; default derived from the active i18n locale. */
|
|
35
|
+
lang?: string;
|
|
36
|
+
/** Consumer image-upload endpoint → Redactor `imageUpload`. Omitted if absent. */
|
|
37
|
+
imageUploadUrl?: string;
|
|
38
|
+
/** App keyboard-shortcut seam (e.g. Ctrl/Cmd+Enter to save). */
|
|
39
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
27
40
|
}
|
|
28
41
|
export interface RichTextEditorHandle {
|
|
29
42
|
getHTML: () => string;
|
|
43
|
+
/** Always '' — Redactor has no native Markdown serializer (see MDX). */
|
|
30
44
|
getMarkdown: () => string;
|
|
31
|
-
/** HTML goes through DOMPurify before reaching
|
|
45
|
+
/** HTML goes through DOMPurify before reaching Redactor. */
|
|
32
46
|
setContent: (html: string) => void;
|
|
33
47
|
focus: () => void;
|
|
34
48
|
clear: () => void;
|
|
35
49
|
}
|
|
36
50
|
declare const wrapperVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
37
|
-
declare const toolbarVariants: (props?: ({
|
|
38
|
-
direction?: "ltr" | "rtl" | null | undefined;
|
|
39
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
40
|
-
declare const toolbarButtonVariants: (props?: ({
|
|
41
|
-
pressed?: boolean | null | undefined;
|
|
42
|
-
disabled?: boolean | null | undefined;
|
|
43
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
44
|
-
declare const editorSurfaceVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
45
51
|
export declare const RichTextEditor: import("react").ForwardRefExoticComponent<RichTextEditorProps & import("react").RefAttributes<RichTextEditorHandle>>;
|
|
46
|
-
export {
|
|
52
|
+
export { wrapperVariants };
|
|
47
53
|
//# sourceMappingURL=rich-text-editor.d.ts.map
|
|
@@ -1655,6 +1655,7 @@ export declare const arUi: {
|
|
|
1655
1655
|
};
|
|
1656
1656
|
readonly editor: {
|
|
1657
1657
|
readonly toolbarLabel: "تنسيق النص";
|
|
1658
|
+
readonly regionLabel: "محرر النص المنسق";
|
|
1658
1659
|
readonly placeholder: "ابدأ الكتابة…";
|
|
1659
1660
|
readonly bold: "غامق";
|
|
1660
1661
|
readonly italic: "مائل";
|
package/dist/i18n/locales/ar.js
CHANGED
|
@@ -1655,6 +1655,7 @@ export declare const deUi: {
|
|
|
1655
1655
|
};
|
|
1656
1656
|
readonly editor: {
|
|
1657
1657
|
readonly toolbarLabel: "Textformatierung";
|
|
1658
|
+
readonly regionLabel: "Rich-Text-Editor";
|
|
1658
1659
|
readonly placeholder: "Beginnen Sie zu schreiben …";
|
|
1659
1660
|
readonly bold: "Fett";
|
|
1660
1661
|
readonly italic: "Kursiv";
|
package/dist/i18n/locales/de.js
CHANGED
|
@@ -1652,6 +1652,7 @@ export declare const elUi: {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
readonly editor: {
|
|
1654
1654
|
readonly toolbarLabel: "Μορφοποίηση κειμένου";
|
|
1655
|
+
readonly regionLabel: "Επεξεργαστής εμπλουτισμένου κειμένου";
|
|
1655
1656
|
readonly placeholder: "Αρχίστε να γράφετε…";
|
|
1656
1657
|
readonly bold: "Έντονα";
|
|
1657
1658
|
readonly italic: "Πλάγια";
|
package/dist/i18n/locales/el.js
CHANGED
|
@@ -1652,6 +1652,7 @@ export declare const enUi: {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
readonly editor: {
|
|
1654
1654
|
readonly toolbarLabel: "Text formatting";
|
|
1655
|
+
readonly regionLabel: "Rich text editor";
|
|
1655
1656
|
readonly placeholder: "Start typing…";
|
|
1656
1657
|
readonly bold: "Bold";
|
|
1657
1658
|
readonly italic: "Italic";
|
package/dist/i18n/locales/en.js
CHANGED
|
@@ -1652,6 +1652,7 @@ export declare const esUi: {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
readonly editor: {
|
|
1654
1654
|
readonly toolbarLabel: "Formato de texto";
|
|
1655
|
+
readonly regionLabel: "Editor de texto enriquecido";
|
|
1655
1656
|
readonly placeholder: "Empiece a escribir…";
|
|
1656
1657
|
readonly bold: "Negrita";
|
|
1657
1658
|
readonly italic: "Cursiva";
|
package/dist/i18n/locales/es.js
CHANGED
|
@@ -1652,6 +1652,7 @@ export declare const frUi: {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
readonly editor: {
|
|
1654
1654
|
readonly toolbarLabel: "Mise en forme du texte";
|
|
1655
|
+
readonly regionLabel: "Éditeur de texte enrichi";
|
|
1655
1656
|
readonly placeholder: "Commencez à écrire…";
|
|
1656
1657
|
readonly bold: "Gras";
|
|
1657
1658
|
readonly italic: "Italique";
|
package/dist/i18n/locales/fr.js
CHANGED
|
@@ -1652,6 +1652,7 @@ export declare const hiUi: {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
readonly editor: {
|
|
1654
1654
|
readonly toolbarLabel: "टेक्स्ट फ़ॉर्मेटिंग";
|
|
1655
|
+
readonly regionLabel: "रिच टेक्स्ट एडिटर";
|
|
1655
1656
|
readonly placeholder: "लिखना शुरू करें…";
|
|
1656
1657
|
readonly bold: "बोल्ड";
|
|
1657
1658
|
readonly italic: "इटैलिक";
|