@tempots/beatui 0.94.0 → 0.95.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/{ar-8Cko5i-Z.js → ar-B4jDJwHQ.js} +2 -1
- package/dist/{ar-D2DjoXta.cjs → ar-BVXPzVJB.cjs} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-Rt0WDKAe.js → auth-divider-BPwKk8MW.js} +7 -7
- package/dist/{auth-divider-C3E16pml.cjs → auth-divider-BgaQ8ifw.cjs} +1 -1
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +5 -5
- package/dist/{de-Cdf3432J.cjs → de-BdfPZskW.cjs} +1 -1
- package/dist/{de-Bt-d2iKj.js → de-Dd33yWzb.js} +2 -1
- package/dist/{deep-merge-CoLO4id0.js → deep-merge-C8dSqIXI.js} +4 -4
- package/dist/{deep-merge-Blrucd-E.cjs → deep-merge-ChJQbUKq.cjs} +1 -1
- package/dist/{duration-input-DrVonjKK.js → duration-input-DFZwkg6M.js} +4 -4
- package/dist/{duration-input-47x7nbGh.cjs → duration-input-IuFWywO5.cjs} +1 -1
- package/dist/{editor-toolbar-group-DhKJdqER.cjs → editor-toolbar-group-BCBfu8pG.cjs} +1 -1
- package/dist/{editor-toolbar-group-CzdBZ1yr.js → editor-toolbar-group-DiJFgGcI.js} +2 -2
- package/dist/{es-6fFPkKHL.cjs → es-C8TpneCm.cjs} +1 -1
- package/dist/{es-2llfNFX2.js → es-jHMT3_7O.js} +2 -1
- package/dist/{fa-GXyNzAXz.cjs → fa-BXnP4pbN.cjs} +1 -1
- package/dist/{fa-CQVIBjKP.js → fa-eX3_BAZR.js} +2 -1
- package/dist/{fr-CC3smTlW.js → fr-Bj-GjMJm.js} +2 -1
- package/dist/{fr-C6EYTwSH.cjs → fr-HJDhGjI2.cjs} +1 -1
- package/dist/{he-CJUgxvi8.cjs → he-C6nEVZhN.cjs} +1 -1
- package/dist/{he-CZilsN75.js → he-DYgmPPkG.js} +2 -1
- package/dist/{hi-CAZjwGv-.js → hi-CgYLonE9.js} +2 -1
- package/dist/{hi-DqIR4VtX.cjs → hi-DMVSXAJt.cjs} +1 -1
- package/dist/{index-BOC0cVoY.cjs → index-D_zOXmU5.cjs} +2 -2
- package/dist/{index-DJ9YIJcG.js → index-vowHNIPH.js} +5 -5
- package/dist/{index-BFzxpY7y.js → index-yOU4Ceaq.js} +1 -1
- package/dist/{index-B-cwxUsP.cjs → index-zQ3IYJFH.cjs} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +19 -19
- package/dist/{input-container-DiYEl_y8.cjs → input-container-BWYHj0Iq.cjs} +1 -1
- package/dist/{input-container-9r1F3KuX.js → input-container-DMoVdH6E.js} +1 -1
- package/dist/{it-D6RXFIL6.js → it-CO2BPqah.js} +2 -1
- package/dist/{it-BvHsJ7fH.cjs → it-DhfVcjKb.cjs} +1 -1
- package/dist/{ja-D7zsz4Ij.js → ja-BrzwjH8T.js} +3 -2
- package/dist/{ja-B2gP7OHY.cjs → ja-Bt6fGS_Q.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +10 -10
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +5 -5
- package/dist/{ko-taN2Npr4.js → ko-D-lJ4wYQ.js} +4 -3
- package/dist/{ko-BddhddIA.cjs → ko-DfAaBGrz.cjs} +1 -1
- package/dist/lexical/index.cjs.js +30 -30
- package/dist/lexical/index.es.js +4940 -4789
- package/dist/{modal-DUlqGUW7.cjs → modal-CiGmgsOI.cjs} +1 -1
- package/dist/{modal-ZitwUeXx.js → modal-CwZuWiSK.js} +3 -3
- package/dist/{nl-COrtZUnH.cjs → nl-CNWBQjK5.cjs} +1 -1
- package/dist/{nl-CRC6r4Q4.js → nl-ClsworIe.js} +2 -1
- package/dist/{notice-DAVOTnfA.cjs → notice-CPZQuxcA.cjs} +1 -1
- package/dist/{notice-E_p2hg1G.js → notice-D7hYFM5A.js} +4 -4
- package/dist/{oneof-branch-detection-D6Xa8qNR.cjs → oneof-branch-detection-BFxukD63.cjs} +1 -1
- package/dist/{oneof-branch-detection-DCPwyutI.js → oneof-branch-detection-izpPjBCR.js} +1 -1
- package/dist/{pl-BHI4zBgV.cjs → pl-CqHTeu3-.cjs} +1 -1
- package/dist/{pl-C6qNs0Lq.js → pl-WTwLAxnV.js} +2 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-BGzC9MhU.cjs → pt-BQmsiqbo.cjs} +1 -1
- package/dist/{pt-CcWPLqBh.js → pt-CgkjJnsG.js} +2 -1
- package/dist/{ru-CXeFbIPb.cjs → ru-CG56A2To.cjs} +1 -1
- package/dist/{ru-Dt9-9m0E.js → ru-CtgH7OY9.js} +2 -1
- package/dist/{text-input-BgPx8BbG.js → text-input-BLupB3cU.js} +1 -1
- package/dist/{text-input-DUnhBUd6.cjs → text-input-M6WBhhVj.cjs} +1 -1
- package/dist/{toolbar-DKOh_gbA.js → toolbar-Be1eU0qU.js} +1 -1
- package/dist/{toolbar-Dkc2y1dI.cjs → toolbar-WWv5kcYG.cjs} +1 -1
- package/dist/{tr-CDTWeRY0.js → tr-D1O1vEmr.js} +4 -3
- package/dist/{tr-CdOtQAtA.cjs → tr-DE7_VtKu.cjs} +1 -1
- package/dist/{translations-BdCtLBZt.cjs → translations-DBxIjvWR.cjs} +1 -1
- package/dist/{translations-CiBhB2FV.js → translations-DyCmyLE_.js} +59 -58
- package/dist/translations-OOsMRpX9.cjs +1 -0
- package/dist/{translations-NBY7SubC.js → translations-yu4gNqlP.js} +1 -1
- package/dist/types/beatui-i18n/default.d.ts +1 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +1 -0
- package/dist/types/beatui-i18n/translations.d.ts +1 -0
- package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +2 -1
- package/dist/types/lexical/index.d.ts +2 -2
- package/dist/types/lexical/plugins/index.d.ts +1 -1
- package/dist/types/lexical/plugins/text.d.ts +5 -0
- package/dist/types/lexical/types.d.ts +126 -5
- package/dist/types/lexical-i18n/default.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +1 -0
- package/dist/{ur-CLrK5FPQ.js → ur-BcuB7IqE.js} +2 -1
- package/dist/{ur-C7itXvnC.cjs → ur-ZJgsSpG2.cjs} +1 -1
- package/dist/{use-form-BQRVnIp9.js → use-form-CfxvyTfd.js} +2 -2
- package/dist/{use-form-DTyNw0kM.cjs → use-form-ClA0ZRco.cjs} +1 -1
- package/dist/{vi-CQrUWB3y.cjs → vi-BOgLRkuK.cjs} +1 -1
- package/dist/{vi-B1_QDUQJ.js → vi-D0rQ3dIx.js} +2 -1
- package/dist/{widget-customization-C-fSx3RB.js → widget-customization-CLZNGavL.js} +5 -5
- package/dist/{widget-customization-xEBfEPhQ.cjs → widget-customization-DtEEo35Y.cjs} +1 -1
- package/dist/{zh-DWswYYTS.cjs → zh-BTZ8OZ4H.cjs} +1 -1
- package/dist/{zh-rDtQ92Pp.js → zh-DoYqiZO1.js} +2 -1
- package/package.json +9 -9
- package/dist/translations-Cy9hoMGV.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { localStorageProp as w, computedOf as p, makeProviderMark as B, Use as R, html as g, attr as u, When as k, Fragment as v, aria as f, coalesce as T, style as I, prop as
|
|
1
|
+
import { localStorageProp as w, computedOf as p, makeProviderMark as B, Use as R, html as g, attr as u, When as k, Fragment as v, aria as f, coalesce as T, style as I, prop as L } from "@tempots/dom";
|
|
2
2
|
import { WhenInViewport as M, Query as N } from "@tempots/ui";
|
|
3
3
|
import { b as $, g as V } from "./colors-BY0Ja_bf.js";
|
|
4
4
|
function O(e, {
|
|
@@ -15,9 +15,9 @@ function O(e, {
|
|
|
15
15
|
}).format(0).replace("byte", t[0]);
|
|
16
16
|
let r, n;
|
|
17
17
|
if (typeof e == "bigint") {
|
|
18
|
-
let
|
|
19
|
-
for (r = 0;
|
|
20
|
-
|
|
18
|
+
let l = e < 0n ? -e : e;
|
|
19
|
+
for (r = 0; l >= 1024n && r < t.length - 1; )
|
|
20
|
+
l = l / 1024n, r++;
|
|
21
21
|
n = Number(e) / Math.pow(1024, r);
|
|
22
22
|
} else
|
|
23
23
|
r = Math.floor(Math.log(Math.abs(e)) / Math.log(1024)), r = Math.min(r, t.length - 1), n = e / Math.pow(1024, r);
|
|
@@ -143,6 +143,7 @@ const U = {
|
|
|
143
143
|
lexical: {
|
|
144
144
|
fontFamily: "Font Family",
|
|
145
145
|
fontSize: "Font Size",
|
|
146
|
+
lineHeight: "Line Height",
|
|
146
147
|
fontColor: "Font Color",
|
|
147
148
|
highlightColor: "Highlight Color",
|
|
148
149
|
backgroundColor: "Background Color",
|
|
@@ -207,7 +208,7 @@ const U = {
|
|
|
207
208
|
pageOutOfRange: (e, t) => `Page ${e} is out of range (1-${t})`,
|
|
208
209
|
renderFailed: "Failed to render PDF page"
|
|
209
210
|
}
|
|
210
|
-
}, C = U,
|
|
211
|
+
}, C = U, P = "en", A = /* @__PURE__ */ new Set([
|
|
211
212
|
"ar",
|
|
212
213
|
// Arabic
|
|
213
214
|
"he",
|
|
@@ -267,7 +268,7 @@ const E = {
|
|
|
267
268
|
function he(e, t) {
|
|
268
269
|
return E[t][e];
|
|
269
270
|
}
|
|
270
|
-
const
|
|
271
|
+
const H = {
|
|
271
272
|
mark: B("Locale"),
|
|
272
273
|
create: (e) => {
|
|
273
274
|
const t = w({
|
|
@@ -280,7 +281,7 @@ const z = {
|
|
|
280
281
|
t,
|
|
281
282
|
o
|
|
282
283
|
)(
|
|
283
|
-
(n,
|
|
284
|
+
(n, i) => j(i, n)
|
|
284
285
|
);
|
|
285
286
|
return {
|
|
286
287
|
value: {
|
|
@@ -296,7 +297,7 @@ const z = {
|
|
|
296
297
|
};
|
|
297
298
|
}
|
|
298
299
|
}, {
|
|
299
|
-
variants:
|
|
300
|
+
variants: z,
|
|
300
301
|
special: _,
|
|
301
302
|
overrides: y
|
|
302
303
|
} = $;
|
|
@@ -335,7 +336,7 @@ function ge(e, t, o) {
|
|
|
335
336
|
textColor: n.color
|
|
336
337
|
};
|
|
337
338
|
}
|
|
338
|
-
const r =
|
|
339
|
+
const r = z[t][o];
|
|
339
340
|
return {
|
|
340
341
|
backgroundColor: d(e, r.bgShade),
|
|
341
342
|
textColor: r.textColor
|
|
@@ -365,10 +366,10 @@ function pe(e, t, o) {
|
|
|
365
366
|
backgroundColor: n.backgroundColor,
|
|
366
367
|
textColor: n.color
|
|
367
368
|
};
|
|
368
|
-
const
|
|
369
|
+
const i = q[o];
|
|
369
370
|
return {
|
|
370
|
-
backgroundColor: d(e,
|
|
371
|
-
textColor:
|
|
371
|
+
backgroundColor: d(e, i.shade),
|
|
372
|
+
textColor: i.textColor
|
|
372
373
|
};
|
|
373
374
|
}
|
|
374
375
|
const r = t === "light" ? G[o] : K[o];
|
|
@@ -393,7 +394,7 @@ function me(e, t) {
|
|
|
393
394
|
function be(e, t) {
|
|
394
395
|
return e === "white" ? "var(--color-white)" : e === "black" ? "var(--color-black)" : e === "transparent" ? "inherit" : d(e, t === "light" ? 800 : 200);
|
|
395
396
|
}
|
|
396
|
-
function
|
|
397
|
+
function x(e, t, o) {
|
|
397
398
|
return t === "soft" ? d(e, o === "light" ? 300 : 700) : d(e, o === "light" ? 500 : 600);
|
|
398
399
|
}
|
|
399
400
|
const W = "bui-icons", m = /* @__PURE__ */ new Map(), F = (() => {
|
|
@@ -436,10 +437,10 @@ async function Y(e) {
|
|
|
436
437
|
if (b) {
|
|
437
438
|
const t = await b;
|
|
438
439
|
return new Promise((o, a) => {
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
o(
|
|
442
|
-
},
|
|
440
|
+
const i = t.transaction("icons", "readonly").objectStore("icons").get(e);
|
|
441
|
+
i.onsuccess = function() {
|
|
442
|
+
o(i.result);
|
|
443
|
+
}, i.onerror = a;
|
|
443
444
|
});
|
|
444
445
|
} else
|
|
445
446
|
return m.get(e) || null;
|
|
@@ -467,7 +468,7 @@ function ee(e) {
|
|
|
467
468
|
}
|
|
468
469
|
function te(e, t = "solid") {
|
|
469
470
|
if (!e) return "";
|
|
470
|
-
const o =
|
|
471
|
+
const o = x(e, t, "light"), a = x(e, t, "dark");
|
|
471
472
|
return `--icon-color: ${o}; --icon-color-dark: ${a}`;
|
|
472
473
|
}
|
|
473
474
|
function ke({
|
|
@@ -477,14 +478,14 @@ function ke({
|
|
|
477
478
|
title: a,
|
|
478
479
|
accessibility: r = "auto",
|
|
479
480
|
tone: n = "solid"
|
|
480
|
-
}, ...
|
|
481
|
+
}, ...i) {
|
|
481
482
|
const c = p(
|
|
482
483
|
r,
|
|
483
484
|
a
|
|
484
|
-
)((
|
|
485
|
+
)((l, s) => l === "decorative" ? !1 : l === "informative" ? !0 : s != null && s !== "");
|
|
485
486
|
return R(
|
|
486
|
-
|
|
487
|
-
(
|
|
487
|
+
ie,
|
|
488
|
+
(l) => g.span(
|
|
488
489
|
u.class(
|
|
489
490
|
p(t, o)((s) => ee(s ?? "md"))
|
|
490
491
|
),
|
|
@@ -501,7 +502,7 @@ function ke({
|
|
|
501
502
|
c,
|
|
502
503
|
() => v(
|
|
503
504
|
u.role("img"),
|
|
504
|
-
f.label(T(a,
|
|
505
|
+
f.label(T(a, l.$.iconDescription))
|
|
505
506
|
),
|
|
506
507
|
() => f.hidden(!0)
|
|
507
508
|
),
|
|
@@ -521,7 +522,7 @@ function ke({
|
|
|
521
522
|
// Loading state accessibility
|
|
522
523
|
k(
|
|
523
524
|
c,
|
|
524
|
-
() => v(u.role("img"), f.label(
|
|
525
|
+
() => v(u.role("img"), f.label(l.$.loadingIcon)),
|
|
525
526
|
() => f.hidden(!0)
|
|
526
527
|
),
|
|
527
528
|
"↻"
|
|
@@ -532,14 +533,14 @@ function ke({
|
|
|
532
533
|
// Error state accessibility
|
|
533
534
|
k(
|
|
534
535
|
c,
|
|
535
|
-
() => v(u.role("img"), f.label(
|
|
536
|
+
() => v(u.role("img"), f.label(l.$.failedToLoadIcon)),
|
|
536
537
|
() => f.hidden(!0)
|
|
537
538
|
),
|
|
538
539
|
"🚫"
|
|
539
540
|
)
|
|
540
541
|
})
|
|
541
542
|
),
|
|
542
|
-
...
|
|
543
|
+
...i
|
|
543
544
|
)
|
|
544
545
|
);
|
|
545
546
|
}
|
|
@@ -553,11 +554,11 @@ function ne({
|
|
|
553
554
|
defaultMessages: o,
|
|
554
555
|
localeLoader: a
|
|
555
556
|
}) {
|
|
556
|
-
const r =
|
|
557
|
+
const r = L(t), n = L(o), i = e.on(async (c) => {
|
|
557
558
|
if (c === r.value) return;
|
|
558
559
|
r.set(c);
|
|
559
|
-
const
|
|
560
|
-
for (const s of
|
|
560
|
+
const l = oe(c);
|
|
561
|
+
for (const s of l)
|
|
561
562
|
try {
|
|
562
563
|
const h = await a(s);
|
|
563
564
|
if (
|
|
@@ -581,7 +582,7 @@ function ne({
|
|
|
581
582
|
return {
|
|
582
583
|
/** Clean up all resources and event listeners */
|
|
583
584
|
dispose: () => {
|
|
584
|
-
|
|
585
|
+
i(), r.dispose(), n.dispose();
|
|
585
586
|
},
|
|
586
587
|
/** Translation functions that return reactive signals */
|
|
587
588
|
t: n
|
|
@@ -597,58 +598,58 @@ function re({
|
|
|
597
598
|
mark: B(a),
|
|
598
599
|
create: (r, n) => {
|
|
599
600
|
const {
|
|
600
|
-
value: { locale:
|
|
601
|
-
} = n.getProvider(
|
|
602
|
-
locale:
|
|
601
|
+
value: { locale: i }
|
|
602
|
+
} = n.getProvider(H.mark), { t: c, dispose: l } = ne({
|
|
603
|
+
locale: i,
|
|
603
604
|
defaultMessages: t,
|
|
604
605
|
defaultLocale: e,
|
|
605
606
|
localeLoader: o
|
|
606
607
|
});
|
|
607
608
|
return {
|
|
608
609
|
value: c,
|
|
609
|
-
dispose:
|
|
610
|
+
dispose: l
|
|
610
611
|
};
|
|
611
612
|
}
|
|
612
613
|
};
|
|
613
614
|
}
|
|
614
615
|
const ae = /* @__PURE__ */ Object.assign({
|
|
615
|
-
"./locales/ar.ts": () => import("./ar-
|
|
616
|
-
"./locales/de.ts": () => import("./de-
|
|
617
|
-
"./locales/es.ts": () => import("./es-
|
|
618
|
-
"./locales/fa.ts": () => import("./fa-
|
|
619
|
-
"./locales/fr.ts": () => import("./fr-
|
|
620
|
-
"./locales/he.ts": () => import("./he-
|
|
621
|
-
"./locales/hi.ts": () => import("./hi-
|
|
622
|
-
"./locales/it.ts": () => import("./it-
|
|
623
|
-
"./locales/ja.ts": () => import("./ja-
|
|
624
|
-
"./locales/ko.ts": () => import("./ko-
|
|
625
|
-
"./locales/nl.ts": () => import("./nl-
|
|
626
|
-
"./locales/pl.ts": () => import("./pl-
|
|
627
|
-
"./locales/pt.ts": () => import("./pt-
|
|
628
|
-
"./locales/ru.ts": () => import("./ru-
|
|
629
|
-
"./locales/tr.ts": () => import("./tr-
|
|
630
|
-
"./locales/ur.ts": () => import("./ur-
|
|
631
|
-
"./locales/vi.ts": () => import("./vi-
|
|
632
|
-
"./locales/zh.ts": () => import("./zh-
|
|
633
|
-
}),
|
|
634
|
-
defaultLocale:
|
|
616
|
+
"./locales/ar.ts": () => import("./ar-B4jDJwHQ.js").then((e) => e.default),
|
|
617
|
+
"./locales/de.ts": () => import("./de-Dd33yWzb.js").then((e) => e.default),
|
|
618
|
+
"./locales/es.ts": () => import("./es-jHMT3_7O.js").then((e) => e.default),
|
|
619
|
+
"./locales/fa.ts": () => import("./fa-eX3_BAZR.js").then((e) => e.default),
|
|
620
|
+
"./locales/fr.ts": () => import("./fr-Bj-GjMJm.js").then((e) => e.default),
|
|
621
|
+
"./locales/he.ts": () => import("./he-DYgmPPkG.js").then((e) => e.default),
|
|
622
|
+
"./locales/hi.ts": () => import("./hi-CgYLonE9.js").then((e) => e.default),
|
|
623
|
+
"./locales/it.ts": () => import("./it-CO2BPqah.js").then((e) => e.default),
|
|
624
|
+
"./locales/ja.ts": () => import("./ja-BrzwjH8T.js").then((e) => e.default),
|
|
625
|
+
"./locales/ko.ts": () => import("./ko-D-lJ4wYQ.js").then((e) => e.default),
|
|
626
|
+
"./locales/nl.ts": () => import("./nl-ClsworIe.js").then((e) => e.default),
|
|
627
|
+
"./locales/pl.ts": () => import("./pl-WTwLAxnV.js").then((e) => e.default),
|
|
628
|
+
"./locales/pt.ts": () => import("./pt-CgkjJnsG.js").then((e) => e.default),
|
|
629
|
+
"./locales/ru.ts": () => import("./ru-CtgH7OY9.js").then((e) => e.default),
|
|
630
|
+
"./locales/tr.ts": () => import("./tr-D1O1vEmr.js").then((e) => e.default),
|
|
631
|
+
"./locales/ur.ts": () => import("./ur-BcuB7IqE.js").then((e) => e.default),
|
|
632
|
+
"./locales/vi.ts": () => import("./vi-D0rQ3dIx.js").then((e) => e.default),
|
|
633
|
+
"./locales/zh.ts": () => import("./zh-DoYqiZO1.js").then((e) => e.default)
|
|
634
|
+
}), ie = re({
|
|
635
|
+
defaultLocale: P,
|
|
635
636
|
defaultMessages: C,
|
|
636
637
|
localeLoader: async (e) => {
|
|
637
|
-
if (e ===
|
|
638
|
+
if (e === P) return C;
|
|
638
639
|
const t = ae[`./locales/${e}.ts`];
|
|
639
640
|
return t ? await t() : C;
|
|
640
641
|
},
|
|
641
642
|
providerName: "BeatUII18n"
|
|
642
643
|
});
|
|
643
644
|
export {
|
|
644
|
-
|
|
645
|
+
ie as B,
|
|
645
646
|
ke as I,
|
|
646
|
-
|
|
647
|
+
H as L,
|
|
647
648
|
me as a,
|
|
648
649
|
ge as b,
|
|
649
650
|
E as c,
|
|
650
651
|
C as d,
|
|
651
|
-
|
|
652
|
+
P as e,
|
|
652
653
|
O as f,
|
|
653
654
|
ue as g,
|
|
654
655
|
pe as h,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("@tempots/dom"),C=require("@tempots/ui"),y=require("./colors-BI0YhONJ.cjs");function w(e,{units:t=["B","KB","MB","GB","TB"],decimalPlaces:o=0,locale:l}={}){if(e===0||e===0n)return new Intl.NumberFormat(l,{style:"unit",unit:"byte",unitDisplay:"short",maximumFractionDigits:0}).format(0).replace("byte",t[0]);let n,r;if(typeof e=="bigint"){let s=e<0n?-e:e;for(n=0;s>=1024n&&n<t.length-1;)s=s/1024n,n++;r=Number(e)/Math.pow(1024,n)}else n=Math.floor(Math.log(Math.abs(e))/Math.log(1024)),n=Math.min(n,t.length-1),r=e/Math.pow(1024,n);return new Intl.NumberFormat(l,{style:"unit",unit:"byte",unitDisplay:"short",minimumFractionDigits:n===0?0:o,maximumFractionDigits:n===0?0:o}).format(r).replace("byte",t[n])}const T={loadingExtended:"Loading, please wait",loadingShort:"Loading...",locale:"Locale",iconDescription:"Icon",loadingIcon:"Loading icon",failedToLoadIcon:"Failed to load icon",editLabel:"Edit",selectOne:"Select one",selectNone:"None",selectMany:"Select many",noResults:"No results",passwordPlaceholderText:"Secret Password",togglePasswordVisibility:"Toggle password visibility",toggleMenu:"Toggle menu",toggleAside:"Toggle aside",mainNavigation:"Main navigation",sidebar:"Sidebar",closeDrawer:"Close drawer",closeModal:"Close modal",confirm:"Confirm",cancel:"Cancel",addLabel:"Add",removeItem:"Remove item",currentLocale:"English",ar:"Arabic",de:"German",en:"English",es:"Spanish",fr:"French",hi:"Hindi",it:"Italian",ja:"Japanese",ko:"Korean",nl:"Dutch",pl:"Polish",pt:"Portuguese",ru:"Russian",tr:"Turkish",vi:"Vietnamese",zh:"Chinese",he:"Hebrew",fa:"Persian",ur:"Urdu",emailPlaceholderText:"Enter your email",incrementValue:"Increment value",decrementValue:"Decrement value",dropZoneInstructions:e=>e?"Click to choose or drag files here, or press Enter or Space to open file selector":"Drag files here",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Remove file",clearAllFiles:"Clear all files",clearValue:"Reset",unknownType:"Unknown type",filesInputInstructions:(e,t,o)=>{let l=e==null||e>1?"Click to choose or drag files here":"Click to choose or drag a file here";if(e||t){const n=[];if(e!=null&&e>1&&n.push(`up to ${e} files`),t&&o){const r=w(t,{units:o});n.push(`max ${r} each`)}n.length>0&&(l+=` (${n.join(", ")})`)}return l},paginationLabel:"Pagination",firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",breadcrumbs:"Breadcrumbs",commandPalette:"Command palette",typeACommand:"Type a command...",noResultsFound:"No results found",noMatchingCommands:"No matching commands",appearanceSystem:"System",appearanceLight:"Light",appearanceDark:"Dark",ok:"OK",changeTypeConfirmation:"Changing type will clear the current value. Continue?",notifications:"Notifications",markAllAsRead:"Mark all as read",noNotifications:"No notifications",schemaConflictsDetected:"Schema Conflicts Detected",schemaViolationsDetected:"Schema Violations Detected",properties:"Properties",uploading:"Uploading...",dropFilesOrBrowse:"Drop files here or click to browse",acceptedTypes:e=>`Accepted types: ${e}`,enterUrlPrompt:"Enter URL:",exceeded:"(exceeded)",pdfPreview:"PDF Preview",lexical:{fontFamily:"Font Family",fontSize:"Font Size",lineHeight:"Line Height",fontColor:"Font Color",highlightColor:"Highlight Color",backgroundColor:"Background Color",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Code",clearFormatting:"Clear Formatting",normal:"Normal",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",checkList:"Check List",indent:"Indent",outdent:"Outdent",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",insertTable:"Insert Table",link:"Link",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",defaultOption:"Default",slashCommands:"Slash commands",noCommandsFound:"No commands found",changeBlockType:"Change block type",blockTypes:"Block types",enterUrl:"Enter URL:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},prosemirror:{bold:"Bold",italic:"Italic",code:"Inline code",link:"Insert link",removeLink:"Remove link",heading:e=>`Heading ${e}`,bulletList:"Bullet list",orderedList:"Ordered list",blockquote:"Blockquote",codeBlock:"Code block",horizontalRule:"Horizontal rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,t)=>`Page ${e} is out of range (1-${t})`,renderFailed:"Failed to render PDF page"}},f=T,p="en",M=new Set(["ar","he","fa","ur","ps","sd","ku","dv","yi","ji","iw","in"]);function v(e){if(!e)return"ltr";const t=e.split(/[-_]/)[0].toLowerCase();return M.has(t)?"rtl":"ltr"}function I(e,t){return e==="auto"?v(t):e}function O(e){return`b-${e}`}function V(e){return v(e)==="rtl"}function N(e){return e==="ltr"?"rtl":"ltr"}const L={ltr:{"inline-start":"left","inline-end":"right","block-start":"top","block-end":"bottom"},rtl:{"inline-start":"right","inline-end":"left","block-start":"top","block-end":"bottom"}};function $(e,t){return L[t][e]}const x={mark:a.makeProviderMark("Locale"),create:e=>{const t=a.localStorageProp({defaultValue:navigator.language??"en-US",key:"beatui-locale"}),o=a.localStorageProp({defaultValue:"auto",key:"beatui-direction-preference"}),l=a.computedOf(t,o)((r,i)=>I(i,r));return{value:{locale:t,setLocale:r=>t.set(r),direction:l,directionPreference:o,setDirectionPreference:r=>o.set(r)},dispose:()=>{t.dispose(),o.dispose(),l.dispose()}}}},{variants:A,special:U,overrides:k}=y.backgroundConfig;function d(e,t){switch(e){case"white":return"var(--color-white)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return y.getColorVar(e,t)}}function D(e,t){const o=U[e];if(!o)return;if(t==="light")return o;const l=k[e];return l?l[t]:o}function E(e,t,o){const l=k[e];if(l){const r=l[o];if(r)return{backgroundColor:r.backgroundColor,textColor:r.color}}if(t==="solid"){const r=D(e,o);if(r)return{backgroundColor:r.backgroundColor,textColor:r.color}}const n=A[t][o];return{backgroundColor:d(e,n.bgShade),textColor:n.textColor}}const j={light:{shade:700,textColor:"var(--color-white)"},dark:{shade:500,textColor:"var(--text-inverted-dark)"}},H={light:{shade:200,textColor:"var(--text-normal-light)"},dark:{shade:700,textColor:"var(--text-normal-dark)"}},_={light:{shade:400,textColor:"var(--text-normal-light)"},dark:{shade:600,textColor:"var(--text-normal-dark)"}};function z(e,t,o){const l=k[e];if(l){const r=l[o];if(r)return{backgroundColor:r.backgroundColor,textColor:r.color}}if(t==="solid"){const r=D(e,o);if(r)return{backgroundColor:r.backgroundColor,textColor:r.color};const i=j[o];return{backgroundColor:d(e,i.shade),textColor:i.textColor}}const n=t==="light"?H[o]:_[o];return{backgroundColor:d(e,n.shade),textColor:n.textColor}}function G(e,t){const o=t==="light"?500:600;switch(e){case"white":return t==="light"?"var(--text-inverse-light)":"var(--text-inverted-dark)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return d(e,o)}}function K(e,t){return e==="white"?"var(--color-white)":e==="black"?"var(--color-black)":e==="transparent"?"inherit":d(e,t==="light"?800:200)}function P(e,t,o){return t==="soft"?d(e,o==="light"?300:700):d(e,o==="light"?500:600)}const W="bui-icons",g=new Map,b=(()=>{try{return typeof indexedDB<"u"&&indexedDB!==null}catch{return!1}})();function Y(){return b?new Promise((e,t)=>{const o=indexedDB.open(W,1);o.onupgradeneeded=function(l){const n=l.target.result;n.objectStoreNames.contains("icons")||n.createObjectStore("icons")},o.onsuccess=function(){e(o.result)},o.onerror=function(){t(o.error)}}):Promise.reject(new Error("IndexedDB not available"))}const m=b?Y():null;async function B(e,t){try{if(m){const o=await m;return new Promise((l,n)=>{const r=o.transaction("icons","readwrite");r.objectStore("icons").put(t,e),r.oncomplete=()=>l(),r.onerror=n})}else g.set(e,t)}catch{g.set(e,t)}}async function S(e){try{if(m){const t=await m;return new Promise((o,l)=>{const i=t.transaction("icons","readonly").objectStore("icons").get(e);i.onsuccess=function(){o(i.result)},i.onerror=l})}else return g.get(e)||null}catch{return g.get(e)||null}}async function J(e){const t=`https://api.iconify.design/${e}.svg`;return fetch(t).then(o=>{if(o.status===200)return o.text();throw new Error(`Failed to load icon: ${e}`)})}async function Q(e){const t=e.replace(":","/"),o=await S(t);if(o)return o;const l=await J(t);return await B(t,l),l}function Z(e){return["bc-icon",`bc-icon--${e}`].join(" ")}function X(e,t="solid"){if(!e)return"";const o=P(e,t,"light"),l=P(e,t,"dark");return`--icon-color: ${o}; --icon-color-dark: ${l}`}function ee({icon:e,size:t="md",color:o,title:l,accessibility:n="auto",tone:r="solid"},...i){const u=a.computedOf(n,l)((s,c)=>s==="decorative"?!1:s==="informative"?!0:c!=null&&c!=="");return a.Use(R,s=>a.html.span(a.attr.class(a.computedOf(t,o)(c=>Z(c??"md"))),a.attr.style(a.computedOf(o,r)((c,h)=>X(c??void 0,h??"solid"))),a.When(u,()=>a.Fragment(a.attr.role("img"),a.aria.label(a.coalesce(l,s.$.iconDescription))),()=>a.aria.hidden(!0)),C.WhenInViewport({once:!0},()=>C.Query({request:e,load:({request:c})=>Q(c),convertError:String,success:({value:c})=>a.html.span(a.style.width("100%"),a.style.height("100%"),a.attr.innerHTML(c)),pending:()=>a.html.span(a.attr.class("animate-spin"),a.When(u,()=>a.Fragment(a.attr.role("img"),a.aria.label(s.$.loadingIcon)),()=>a.aria.hidden(!0)),"↻"),failure:({error:c})=>a.html.span(a.attr.title(c),a.attr.class("text-red-500"),a.When(u,()=>a.Fragment(a.attr.role("img"),a.aria.label(s.$.failedToLoadIcon)),()=>a.aria.hidden(!0)),"🚫")})),...i))}function te(e){const t=e.split("-"),o=[e];return t.length>1&&o.push(t[0]),o}function F({locale:e,defaultLocale:t="en-US",defaultMessages:o,localeLoader:l}){const n=a.prop(t),r=a.prop(o),i=e.on(async u=>{if(u===n.value)return;n.set(u);const s=te(u);for(const c of s)try{const h=await l(c);if(typeof h.default=="object"&&Object.keys(h).length===1){console.error("It appears that you are trying to load a translation module without referencing the default export. Please use `(await import(...)).default` in your loader function.");return}if(u===n.value){r.set(h);return}}catch{continue}console.warn(`No locale found for "${e.value}", using fallback`),u===n.value&&r.set(o)});return{dispose:()=>{i(),n.dispose(),r.dispose()},t:r}}function q({defaultLocale:e,defaultMessages:t,localeLoader:o,providerName:l="I18nProvider"}){return{mark:a.makeProviderMark(l),create:(n,r)=>{const{value:{locale:i}}=r.getProvider(x.mark),{t:u,dispose:s}=F({locale:i,defaultMessages:t,defaultLocale:e,localeLoader:o});return{value:u,dispose:s}}}}const oe=Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./ar-BVXPzVJB.cjs")).then(e=>e.default),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./de-BdfPZskW.cjs")).then(e=>e.default),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./es-C8TpneCm.cjs")).then(e=>e.default),"./locales/fa.ts":()=>Promise.resolve().then(()=>require("./fa-BXnP4pbN.cjs")).then(e=>e.default),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./fr-HJDhGjI2.cjs")).then(e=>e.default),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./he-C6nEVZhN.cjs")).then(e=>e.default),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./hi-DMVSXAJt.cjs")).then(e=>e.default),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./it-DhfVcjKb.cjs")).then(e=>e.default),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./ja-Bt6fGS_Q.cjs")).then(e=>e.default),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./ko-DfAaBGrz.cjs")).then(e=>e.default),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./nl-CNWBQjK5.cjs")).then(e=>e.default),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./pl-CqHTeu3-.cjs")).then(e=>e.default),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./pt-BQmsiqbo.cjs")).then(e=>e.default),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./ru-CG56A2To.cjs")).then(e=>e.default),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./tr-DE7_VtKu.cjs")).then(e=>e.default),"./locales/ur.ts":()=>Promise.resolve().then(()=>require("./ur-ZJgsSpG2.cjs")).then(e=>e.default),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./vi-BOgLRkuK.cjs")).then(e=>e.default),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./zh-BTZ8OZ4H.cjs")).then(e=>e.default)}),R=q({defaultLocale:p,defaultMessages:f,localeLoader:async e=>{if(e===p)return f;const t=oe[`./locales/${e}.ts`];return t?await t():f},providerName:"BeatUII18n"});exports.BeatUII18n=R;exports.Icon=ee;exports.LOGICAL_PROPERTY_MAP=L;exports.Locale=x;exports.backgroundValue=E;exports.borderColorValue=G;exports.defaultLocale=p;exports.defaultMessages=f;exports.formatFileSize=w;exports.getDirectionClassName=O;exports.getDirectionFromLocale=v;exports.getIconLocally=S;exports.getOppositeDirection=N;exports.getPhysicalProperty=$;exports.hoverBackgroundValue=z;exports.isIndexedDBAvailable=b;exports.isRTLLocale=V;exports.makeI18nProvider=q;exports.makeMessages=F;exports.resolveDirection=I;exports.storeIconLocally=B;exports.textColorValue=K;
|
|
@@ -11,6 +11,7 @@ export declare function getDefaultLayout(): ToolbarLayoutEntry[];
|
|
|
11
11
|
/**
|
|
12
12
|
* Resolves a ToolbarConfig into a concrete layout.
|
|
13
13
|
* - If `layout` is provided, returns it directly.
|
|
14
|
-
* - Otherwise, applies visibleGroups/hiddenGroups filtering to the default layout
|
|
14
|
+
* - Otherwise, applies visibleGroups/hiddenGroups filtering to the default layout
|
|
15
|
+
* and appends any custom groups at the end.
|
|
15
16
|
*/
|
|
16
17
|
export declare function resolveLayout(config: ToolbarConfig): ToolbarLayoutEntry[];
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* pre-configured presets (Bare, Docked, Contextual), full plugin coverage,
|
|
7
7
|
* multi-format I/O, form integration, and theme/i18n support.
|
|
8
8
|
*/
|
|
9
|
-
export type { ContentFormatType, JsonContent, LexicalPluginDefinition, PluginConfig, HistoryPluginOptions, TablePluginOptions, AutoLinkPluginOptions, AutoLinkMatcher, CodePluginOptions, HashtagPluginOptions, OverflowPluginOptions, SlashCommandPluginOptions, SlashCommandDefinition, ToolbarGroupId, ToolbarButtonId, ToolbarConfig, ToolbarLayoutGroup, ToolbarLayoutSeparator, ToolbarLayoutEntry, MarkMetadata, MarkPluginCallbacks, CollaborationConfig, CollaborationUser, LexicalEditorBaseOptions, BareEditorOptions, DockedEditorOptions, ContextualEditorOptions, LexicalStringInputOptions, LexicalJsonInputOptions, LexicalInputOptions, HeadlessEditorOptions, CharacterCountInfo, SelectionInfo, EditorPresetType, EditorHeightMode, } from './types';
|
|
9
|
+
export type { ContentFormatType, JsonContent, LexicalPluginDefinition, PluginConfig, HistoryPluginOptions, TablePluginOptions, AutoLinkPluginOptions, AutoLinkMatcher, CodePluginOptions, HashtagPluginOptions, OverflowPluginOptions, SlashCommandPluginOptions, SlashCommandDefinition, ToolbarGroupId, ToolbarButtonId, ToolbarConfig, ToolbarLayoutGroup, ToolbarLayoutSeparator, ToolbarLayoutCustomGroup, ToolbarLayoutEntry, MarkMetadata, MarkPluginCallbacks, CollaborationConfig, CollaborationUser, LexicalEditorBaseOptions, BareEditorOptions, DockedEditorOptions, ContextualEditorOptions, LexicalStringInputOptions, LexicalJsonInputOptions, LexicalInputOptions, HeadlessEditorOptions, CharacterCountInfo, SelectionInfo, EditorPresetType, EditorHeightMode, ToolbarItemContext, ToolbarButtonItem, ToolbarSelectOption, ToolbarSelectItem, ToolbarCustomItem, CustomToolbarItem, CustomToolbarGroup, } from './types';
|
|
10
10
|
export { TOOLBAR_SEPARATOR } from './types';
|
|
11
11
|
export { getNodesForPlugins, createDefaultPluginConfig } from './nodes';
|
|
12
12
|
export { HorizontalRuleNode, $createHorizontalRuleNode, $isHorizontalRuleNode, } from './horizontal-rule-node';
|
|
13
13
|
export type { SerializedHorizontalRuleNode } from './horizontal-rule-node';
|
|
14
14
|
export { loadLexicalCore } from './lazy-loader';
|
|
15
|
-
export { registerRichTextPlugin, registerPlainTextPlugin, registerHistoryPlugin, registerClipboardPlugin, registerListPlugin, registerLinkPlugin, registerSlashCommandsPlugin, executeSlashCommand, exportToMarkdown, importFromMarkdown, getMarkdownTransformers, exportToHtml, importFromHtml, exportEditorToFile, importFileToEditor, registerTablePlugin, insertTable, registerCodePlugin, registerCodeShikiPlugin, registerHashtagPlugin, registerAutoLinkPlugin, registerMarkPlugin, applyMark, removeMark, registerOverflowPlugin, registerDragonPlugin, registerYjsPlugin, getSelectionInfo, getTextContent, getCharacterCount, getWordCount, loadOffsetUtils, registerHorizontalRulePlugin, HR_TRANSFORMER, buildInlineStyleImportMap, buildStyleImportMap, DEFAULT_INLINE_STYLE_PROPERTIES, } from './plugins';
|
|
15
|
+
export { registerRichTextPlugin, registerPlainTextPlugin, registerHistoryPlugin, registerClipboardPlugin, registerListPlugin, registerLinkPlugin, registerSlashCommandsPlugin, executeSlashCommand, exportToMarkdown, importFromMarkdown, getMarkdownTransformers, exportToHtml, importFromHtml, exportEditorToFile, importFileToEditor, registerTablePlugin, insertTable, registerCodePlugin, registerCodeShikiPlugin, registerHashtagPlugin, registerAutoLinkPlugin, registerMarkPlugin, applyMark, removeMark, registerOverflowPlugin, registerDragonPlugin, registerYjsPlugin, getSelectionInfo, getTextContent, getCharacterCount, getWordCount, insertTextAtCursor, loadOffsetUtils, registerHorizontalRulePlugin, HR_TRANSFORMER, buildInlineStyleImportMap, buildStyleImportMap, DEFAULT_INLINE_STYLE_PROPERTIES, } from './plugins';
|
|
16
16
|
export type { SlashCommandState, SlashCommandCallbacks } from './plugins';
|
|
17
17
|
export { createHeadlessEditor, markdownToLexicalJson, lexicalJsonToMarkdown, htmlToLexicalJson, lexicalJsonToHtml, } from './headless';
|
|
18
18
|
export { createCommand, ElementNode, DecoratorNode, TextNode, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_CRITICAL, } from 'lexical';
|
|
@@ -19,7 +19,7 @@ export { registerOverflowPlugin } from './overflow';
|
|
|
19
19
|
export { registerDragonPlugin } from './dragon';
|
|
20
20
|
export { registerYjsPlugin } from './yjs';
|
|
21
21
|
export { getSelectionInfo } from './selection';
|
|
22
|
-
export { getTextContent, getCharacterCount, getWordCount } from './text';
|
|
22
|
+
export { getTextContent, getCharacterCount, getWordCount, insertTextAtCursor, } from './text';
|
|
23
23
|
export { loadOffsetUtils } from './offset';
|
|
24
24
|
export { registerHorizontalRulePlugin, HR_TRANSFORMER } from './horizontal-rule';
|
|
25
25
|
export { registerElementStylePlugin, buildElementStyleExportMap, buildElementStyleImportMap, buildInlineStyleImportMap, buildStyleImportMap, DEFAULT_INLINE_STYLE_PROPERTIES, mergeElementStyle, getElementStyleProperty, } from './element-style';
|
|
@@ -11,3 +11,8 @@ export declare function getCharacterCount(editor: LexicalEditor): number;
|
|
|
11
11
|
* Get the word count of the editor content.
|
|
12
12
|
*/
|
|
13
13
|
export declare function getWordCount(editor: LexicalEditor): number;
|
|
14
|
+
/**
|
|
15
|
+
* Insert text at the current cursor position, replacing any selected text.
|
|
16
|
+
* Designed for use as a snippet `onSelect` callback helper.
|
|
17
|
+
*/
|
|
18
|
+
export declare function insertTextAtCursor(editor: LexicalEditor, text: string): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Renderable, TNode, Value } from '@tempots/dom';
|
|
1
|
+
import type { Renderable, Signal, TNode, Value } from '@tempots/dom';
|
|
2
2
|
import type { Merge } from '@tempots/std';
|
|
3
3
|
import type { LexicalEditor, LexicalNode, Klass } from 'lexical';
|
|
4
4
|
import type { InputOptions } from '../components/form/input/input-options';
|
|
5
|
+
import type { ControlSize } from '../components/theme';
|
|
5
6
|
/**
|
|
6
7
|
* Content format types supported by the editor
|
|
7
8
|
*/
|
|
@@ -282,7 +283,99 @@ export type ToolbarGroupId = 'text-formatting' | 'headings' | 'lists' | 'indent'
|
|
|
282
283
|
* Stable identifiers for individual toolbar buttons/controls.
|
|
283
284
|
* Each ID corresponds to a single button or widget within a toolbar group.
|
|
284
285
|
*/
|
|
285
|
-
export type ToolbarButtonId = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'clear-formatting' | 'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' | 'heading-6' | 'bullet-list' | 'ordered-list' | 'check-list' | 'indent' | 'outdent' | 'blockquote' | 'code-block' | 'horizontal-rule' | 'insert-table' | 'link' | 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'font-family' | 'font-size' | 'font-color' | 'highlight-color' | 'background-color';
|
|
286
|
+
export type ToolbarButtonId = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'clear-formatting' | 'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' | 'heading-6' | 'bullet-list' | 'ordered-list' | 'check-list' | 'indent' | 'outdent' | 'blockquote' | 'code-block' | 'horizontal-rule' | 'insert-table' | 'link' | 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'font-family' | 'font-size' | 'line-height' | 'font-color' | 'highlight-color' | 'background-color';
|
|
287
|
+
/**
|
|
288
|
+
* Context passed to custom toolbar items, providing access to editor state,
|
|
289
|
+
* reactive signals, and the built-in button factory.
|
|
290
|
+
*/
|
|
291
|
+
export interface ToolbarItemContext {
|
|
292
|
+
/** Editor signal (guaranteed non-null inside the toolbar) */
|
|
293
|
+
editor: Signal<LexicalEditor>;
|
|
294
|
+
/** Incremented on every editor state update — use in `.map()` for reactive queries */
|
|
295
|
+
stateUpdate: Signal<number>;
|
|
296
|
+
/** Whether the editor is read-only */
|
|
297
|
+
readOnly: Signal<boolean>;
|
|
298
|
+
/** Control size */
|
|
299
|
+
size: Value<ControlSize>;
|
|
300
|
+
/** Create a toolbar button matching built-in styling */
|
|
301
|
+
button: (opts: {
|
|
302
|
+
active?: Signal<boolean>;
|
|
303
|
+
onClick: () => void;
|
|
304
|
+
label: Value<string>;
|
|
305
|
+
icon: string;
|
|
306
|
+
}) => TNode;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* A custom icon button toolbar item, rendered identically to built-in buttons.
|
|
310
|
+
*/
|
|
311
|
+
export interface ToolbarButtonItem {
|
|
312
|
+
type: 'button';
|
|
313
|
+
/** Unique id (must not collide with built-in ToolbarButtonId values) */
|
|
314
|
+
id: string;
|
|
315
|
+
/** Accessible tooltip label */
|
|
316
|
+
label: string;
|
|
317
|
+
/** Iconify icon identifier (e.g. 'mdi:variable') */
|
|
318
|
+
icon: string;
|
|
319
|
+
/** Called when the button is clicked */
|
|
320
|
+
onClick: (editor: LexicalEditor) => void;
|
|
321
|
+
/** Optional reactive active state. Return a signal that tracks whether this button is "on". */
|
|
322
|
+
active?: (ctx: ToolbarItemContext) => Signal<boolean>;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* A single option in a select dropdown toolbar item.
|
|
326
|
+
*/
|
|
327
|
+
export interface ToolbarSelectOption {
|
|
328
|
+
/** Value passed to onSelect when this option is chosen */
|
|
329
|
+
value: string;
|
|
330
|
+
/** Display label in the dropdown */
|
|
331
|
+
label: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* A select dropdown toolbar item: renders a `<select>` and calls
|
|
335
|
+
* `onSelect(value, editor)` when the user picks an option.
|
|
336
|
+
*/
|
|
337
|
+
export interface ToolbarSelectItem {
|
|
338
|
+
type: 'select';
|
|
339
|
+
/** Unique id (must not collide with built-in ToolbarButtonId values) */
|
|
340
|
+
id: string;
|
|
341
|
+
/** Accessible tooltip / placeholder label */
|
|
342
|
+
label: string;
|
|
343
|
+
/** Dropdown options */
|
|
344
|
+
options: ToolbarSelectOption[];
|
|
345
|
+
/** Called when the user picks an option */
|
|
346
|
+
onSelect: (value: string, editor: LexicalEditor) => void;
|
|
347
|
+
/**
|
|
348
|
+
* Reset the dropdown to its placeholder after each selection.
|
|
349
|
+
* Use `true` for action menus (e.g. "Insert snippet"), `false` for
|
|
350
|
+
* stateful selections where the current value should remain visible.
|
|
351
|
+
* @default true
|
|
352
|
+
*/
|
|
353
|
+
resetOnSelect?: boolean;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* A fully custom toolbar item where the user supplies a render function
|
|
357
|
+
* that receives the full toolbar context.
|
|
358
|
+
*/
|
|
359
|
+
export interface ToolbarCustomItem {
|
|
360
|
+
type: 'custom';
|
|
361
|
+
/** Unique id (must not collide with built-in ToolbarButtonId values) */
|
|
362
|
+
id: string;
|
|
363
|
+
/** Render function. Receives the full toolbar context. */
|
|
364
|
+
render: (ctx: ToolbarItemContext) => TNode;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Union of all custom toolbar item types.
|
|
368
|
+
*/
|
|
369
|
+
export type CustomToolbarItem = ToolbarButtonItem | ToolbarSelectItem | ToolbarCustomItem;
|
|
370
|
+
/**
|
|
371
|
+
* A custom group definition containing one or more custom items.
|
|
372
|
+
*/
|
|
373
|
+
export interface CustomToolbarGroup {
|
|
374
|
+
/** Unique group id (must not collide with built-in ToolbarGroupId values) */
|
|
375
|
+
id: string;
|
|
376
|
+
/** Custom toolbar items in this group */
|
|
377
|
+
items: CustomToolbarItem[];
|
|
378
|
+
}
|
|
286
379
|
/**
|
|
287
380
|
* A group entry in the toolbar layout.
|
|
288
381
|
* Specifies which group to render, optionally restricting to specific buttons.
|
|
@@ -292,9 +385,10 @@ export interface ToolbarLayoutGroup {
|
|
|
292
385
|
group: ToolbarGroupId;
|
|
293
386
|
/**
|
|
294
387
|
* Optional subset of buttons/controls to include within this group.
|
|
388
|
+
* Accepts built-in `ToolbarButtonId` values and custom item IDs (strings).
|
|
295
389
|
* When omitted, all buttons in the group are shown (respecting maxHeadingLevel).
|
|
296
390
|
*/
|
|
297
|
-
items?: ToolbarButtonId[];
|
|
391
|
+
items?: (ToolbarButtonId | string)[];
|
|
298
392
|
}
|
|
299
393
|
/**
|
|
300
394
|
* A visual separator between toolbar groups.
|
|
@@ -302,11 +396,18 @@ export interface ToolbarLayoutGroup {
|
|
|
302
396
|
export interface ToolbarLayoutSeparator {
|
|
303
397
|
separator: true;
|
|
304
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* A layout entry referencing a custom group by its id.
|
|
401
|
+
*/
|
|
402
|
+
export interface ToolbarLayoutCustomGroup {
|
|
403
|
+
/** References a CustomToolbarGroup.id from ToolbarConfig.customGroups */
|
|
404
|
+
customGroup: string;
|
|
405
|
+
}
|
|
305
406
|
/**
|
|
306
407
|
* A single entry in the toolbar layout.
|
|
307
|
-
* Either a group
|
|
408
|
+
* Either a built-in group, a custom group, or a visual separator.
|
|
308
409
|
*/
|
|
309
|
-
export type ToolbarLayoutEntry = ToolbarLayoutGroup | ToolbarLayoutSeparator;
|
|
410
|
+
export type ToolbarLayoutEntry = ToolbarLayoutGroup | ToolbarLayoutCustomGroup | ToolbarLayoutSeparator;
|
|
310
411
|
/**
|
|
311
412
|
* Convenience constant for inserting a separator in a toolbar layout.
|
|
312
413
|
*/
|
|
@@ -347,12 +448,32 @@ export interface ToolbarConfig {
|
|
|
347
448
|
* A `{ value: '', label: 'Default' }` entry is always prepended automatically.
|
|
348
449
|
*/
|
|
349
450
|
fontSizes?: FontOption[];
|
|
451
|
+
/**
|
|
452
|
+
* Custom line-height options for the line-height dropdown.
|
|
453
|
+
* Each entry has a unitless CSS `value` (e.g. '1.5') and a display `label`.
|
|
454
|
+
* A `{ value: '', label: 'Default' }` entry is always prepended automatically.
|
|
455
|
+
*/
|
|
456
|
+
lineHeights?: FontOption[];
|
|
350
457
|
/**
|
|
351
458
|
* Declarative toolbar layout. When provided, takes full control over
|
|
352
459
|
* which groups/buttons appear and in what order.
|
|
353
460
|
* `visibleGroups` and `hiddenGroups` are ignored when `layout` is set.
|
|
461
|
+
* Use `{ customGroup: '<id>' }` entries to place custom groups.
|
|
354
462
|
*/
|
|
355
463
|
layout?: ToolbarLayoutEntry[];
|
|
464
|
+
/**
|
|
465
|
+
* Standalone custom toolbar items, registered by their `id`.
|
|
466
|
+
* Place them in built-in groups via `layout[].items` arrays.
|
|
467
|
+
*/
|
|
468
|
+
customItems?: CustomToolbarItem[];
|
|
469
|
+
/**
|
|
470
|
+
* Custom toolbar groups with user-defined buttons/dropdowns.
|
|
471
|
+
* When `layout` is not specified, custom groups are appended
|
|
472
|
+
* at the end of the default toolbar layout.
|
|
473
|
+
* When `layout` is specified, use `{ customGroup: '<id>' }` entries
|
|
474
|
+
* to place them.
|
|
475
|
+
*/
|
|
476
|
+
customGroups?: CustomToolbarGroup[];
|
|
356
477
|
}
|
|
357
478
|
/**
|
|
358
479
|
* Mark/annotation metadata
|