@mieweb/ui 0.11.0-dev.35 → 0.11.0-dev.37
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/MIGRATION.md +45 -11
- package/agent/skills/mieweb-ui-catalog/SKILL.md +5 -3
- package/agent/skills/mieweb-ui-catalog/selection-guidance.md +6 -3
- package/dist/{EncounterMdyEditor-73PTTIRY.cjs → EncounterMdyEditor-46WMYRFI.cjs} +6 -6
- package/dist/{EncounterMdyEditor-73PTTIRY.cjs.map → EncounterMdyEditor-46WMYRFI.cjs.map} +1 -1
- package/dist/{EncounterMdyEditor-3SQY4MK2.js → EncounterMdyEditor-L7RBLE7B.js} +3 -3
- package/dist/{EncounterMdyEditor-3SQY4MK2.js.map → EncounterMdyEditor-L7RBLE7B.js.map} +1 -1
- package/dist/{chunk-4SUEBKTY.js → chunk-2OTPQPJS.js} +52 -44
- package/dist/chunk-2OTPQPJS.js.map +1 -0
- package/dist/{chunk-MZR634HI.cjs → chunk-3M2BBOXF.cjs} +9 -9
- package/dist/{chunk-MZR634HI.cjs.map → chunk-3M2BBOXF.cjs.map} +1 -1
- package/dist/{chunk-TUYWCUKH.js → chunk-4LKAZW2W.js} +7 -3
- package/dist/chunk-4LKAZW2W.js.map +1 -0
- package/dist/{chunk-JEXEFWEM.js → chunk-5WA6IYZD.js} +68 -2
- package/dist/chunk-5WA6IYZD.js.map +1 -0
- package/dist/{chunk-DXNVQQYN.cjs → chunk-6L7CTEX2.cjs} +51 -44
- package/dist/chunk-6L7CTEX2.cjs.map +1 -0
- package/dist/{chunk-DT3X3RBM.js → chunk-7U7SONM5.js} +3 -3
- package/dist/{chunk-DT3X3RBM.js.map → chunk-7U7SONM5.js.map} +1 -1
- package/dist/{chunk-4M2KE4O5.cjs → chunk-AHYDJN4H.cjs} +506 -125
- package/dist/chunk-AHYDJN4H.cjs.map +1 -0
- package/dist/{chunk-EX7Q5545.js → chunk-AKC677ZF.js} +5 -5
- package/dist/{chunk-EX7Q5545.js.map → chunk-AKC677ZF.js.map} +1 -1
- package/dist/{chunk-C4GEPUE7.js → chunk-CKECOCYJ.js} +2 -2
- package/dist/{chunk-C4GEPUE7.js.map → chunk-CKECOCYJ.js.map} +1 -1
- package/dist/{chunk-V5VPECJI.js → chunk-CRR7AE5D.js} +11 -7
- package/dist/chunk-CRR7AE5D.js.map +1 -0
- package/dist/chunk-D3FNZMOB.cjs +4 -0
- package/dist/{chunk-GLXTVCHN.cjs.map → chunk-D3FNZMOB.cjs.map} +1 -1
- package/dist/{chunk-ZK2R6UGF.cjs → chunk-DCV34MEF.cjs} +4 -4
- package/dist/{chunk-ZK2R6UGF.cjs.map → chunk-DCV34MEF.cjs.map} +1 -1
- package/dist/{chunk-XEHD2HA5.cjs → chunk-FRPELUI5.cjs} +3 -3
- package/dist/{chunk-XEHD2HA5.cjs.map → chunk-FRPELUI5.cjs.map} +1 -1
- package/dist/chunk-G4VQEQGW.js +3 -0
- package/dist/{chunk-RISZWWEQ.js.map → chunk-G4VQEQGW.js.map} +1 -1
- package/dist/{chunk-3O3Q3DX7.cjs → chunk-GG3IK5TL.cjs} +26 -26
- package/dist/{chunk-3O3Q3DX7.cjs.map → chunk-GG3IK5TL.cjs.map} +1 -1
- package/dist/{chunk-DGHS5IVD.js → chunk-GJSLKD4Q.js} +3 -3
- package/dist/{chunk-DGHS5IVD.js.map → chunk-GJSLKD4Q.js.map} +1 -1
- package/dist/{chunk-VMEVLBI3.js → chunk-GKMMDKYY.js} +3 -3
- package/dist/{chunk-VMEVLBI3.js.map → chunk-GKMMDKYY.js.map} +1 -1
- package/dist/{chunk-46RYJYN2.cjs → chunk-GU6TPVXF.cjs} +6 -6
- package/dist/{chunk-46RYJYN2.cjs.map → chunk-GU6TPVXF.cjs.map} +1 -1
- package/dist/{chunk-QHCAWDMG.cjs → chunk-HDZQLTBP.cjs} +7 -3
- package/dist/chunk-HDZQLTBP.cjs.map +1 -0
- package/dist/chunk-IALTKN3Y.js +1017 -0
- package/dist/chunk-IALTKN3Y.js.map +1 -0
- package/dist/{chunk-33Y3KQWL.js → chunk-IGRHPZOJ.js} +3 -3
- package/dist/{chunk-33Y3KQWL.js.map → chunk-IGRHPZOJ.js.map} +1 -1
- package/dist/chunk-JCIQIR5V.js +546 -0
- package/dist/chunk-JCIQIR5V.js.map +1 -0
- package/dist/{chunk-RTADGBBN.js → chunk-JUY2JLFL.js} +502 -121
- package/dist/chunk-JUY2JLFL.js.map +1 -0
- package/dist/{chunk-2S76TRBJ.cjs → chunk-JUYBJLPI.cjs} +4 -4
- package/dist/{chunk-2S76TRBJ.cjs.map → chunk-JUYBJLPI.cjs.map} +1 -1
- package/dist/{chunk-UDUYZDTA.js → chunk-JWMMWNTT.js} +3 -3
- package/dist/{chunk-UDUYZDTA.js.map → chunk-JWMMWNTT.js.map} +1 -1
- package/dist/{chunk-PLBWZW4F.js → chunk-KAQNYX7B.js} +3 -3
- package/dist/{chunk-PLBWZW4F.js.map → chunk-KAQNYX7B.js.map} +1 -1
- package/dist/{chunk-SPGP252Q.js → chunk-KB2PLV5Q.js} +4 -4
- package/dist/{chunk-SPGP252Q.js.map → chunk-KB2PLV5Q.js.map} +1 -1
- package/dist/{chunk-NCPDUJKJ.cjs → chunk-KQXD6BFO.cjs} +4 -4
- package/dist/{chunk-NCPDUJKJ.cjs.map → chunk-KQXD6BFO.cjs.map} +1 -1
- package/dist/{chunk-4VSK3EE5.cjs → chunk-L77XJPKC.cjs} +3 -3
- package/dist/{chunk-4VSK3EE5.cjs.map → chunk-L77XJPKC.cjs.map} +1 -1
- package/dist/{chunk-PGJLW2NO.cjs → chunk-LLIG4X6M.cjs} +7 -7
- package/dist/{chunk-PGJLW2NO.cjs.map → chunk-LLIG4X6M.cjs.map} +1 -1
- package/dist/{chunk-YGSPIDE4.js → chunk-LQ22CY7X.js} +5 -5
- package/dist/{chunk-YGSPIDE4.js.map → chunk-LQ22CY7X.js.map} +1 -1
- package/dist/{chunk-AKMTPCLC.cjs → chunk-LTCHD3K5.cjs} +2 -2
- package/dist/{chunk-AKMTPCLC.cjs.map → chunk-LTCHD3K5.cjs.map} +1 -1
- package/dist/{chunk-NW6D6AFL.js → chunk-LWLHCUDP.js} +10 -10
- package/dist/{chunk-NW6D6AFL.js.map → chunk-LWLHCUDP.js.map} +1 -1
- package/dist/{chunk-YR45POH2.js → chunk-MAEANAAJ.js} +3 -3
- package/dist/{chunk-YR45POH2.js.map → chunk-MAEANAAJ.js.map} +1 -1
- package/dist/{chunk-X5HLVACK.js → chunk-MLCIINXT.js} +4 -4
- package/dist/{chunk-X5HLVACK.js.map → chunk-MLCIINXT.js.map} +1 -1
- package/dist/{chunk-PHUTJKHL.cjs → chunk-MXIIPFTA.cjs} +3 -3
- package/dist/{chunk-PHUTJKHL.cjs.map → chunk-MXIIPFTA.cjs.map} +1 -1
- package/dist/{chunk-QO4A6U73.cjs → chunk-NCG7NJAW.cjs} +93 -30
- package/dist/chunk-NCG7NJAW.cjs.map +1 -0
- package/dist/{chunk-25MPUVTM.js → chunk-NIE3WBJH.js} +94 -31
- package/dist/chunk-NIE3WBJH.js.map +1 -0
- package/dist/{chunk-4GSFVD5V.js → chunk-NUHHWELE.js} +3 -3
- package/dist/{chunk-4GSFVD5V.js.map → chunk-NUHHWELE.js.map} +1 -1
- package/dist/{chunk-GDKOYVX3.cjs → chunk-NZUQL42A.cjs} +11 -7
- package/dist/chunk-NZUQL42A.cjs.map +1 -0
- package/dist/{chunk-YSIFPHLX.js → chunk-OJQMC426.js} +2 -2
- package/dist/{chunk-YSIFPHLX.js.map → chunk-OJQMC426.js.map} +1 -1
- package/dist/{chunk-SVC7NPQ6.cjs → chunk-PDLVSJMZ.cjs} +6 -6
- package/dist/{chunk-SVC7NPQ6.cjs.map → chunk-PDLVSJMZ.cjs.map} +1 -1
- package/dist/chunk-QAEAC7HO.cjs +4 -0
- package/dist/chunk-QAEAC7HO.cjs.map +1 -0
- package/dist/{chunk-KD7YD6US.cjs → chunk-QOQQVNP3.cjs} +2 -2
- package/dist/{chunk-KD7YD6US.cjs.map → chunk-QOQQVNP3.cjs.map} +1 -1
- package/dist/{chunk-6O6EYKOG.cjs → chunk-R4QWCP2T.cjs} +65 -65
- package/dist/{chunk-6O6EYKOG.cjs.map → chunk-R4QWCP2T.cjs.map} +1 -1
- package/dist/chunk-RCTIPBLU.cjs +1039 -0
- package/dist/chunk-RCTIPBLU.cjs.map +1 -0
- package/dist/{chunk-FSWHZY3T.cjs → chunk-RD2I67C4.cjs} +3 -3
- package/dist/{chunk-FSWHZY3T.cjs.map → chunk-RD2I67C4.cjs.map} +1 -1
- package/dist/chunk-SCGXD334.js +3 -0
- package/dist/chunk-SCGXD334.js.map +1 -0
- package/dist/{chunk-2OXNJJHJ.cjs → chunk-TERHGQ73.cjs} +3 -3
- package/dist/{chunk-2OXNJJHJ.cjs.map → chunk-TERHGQ73.cjs.map} +1 -1
- package/dist/chunk-TZKBW4GA.cjs +578 -0
- package/dist/chunk-TZKBW4GA.cjs.map +1 -0
- package/dist/{chunk-DO7EED3B.cjs → chunk-WZ7WTIVU.cjs} +3 -3
- package/dist/{chunk-DO7EED3B.cjs.map → chunk-WZ7WTIVU.cjs.map} +1 -1
- package/dist/{chunk-6UYMO3PF.cjs → chunk-XX6PNPF2.cjs} +68 -2
- package/dist/chunk-XX6PNPF2.cjs.map +1 -0
- package/dist/{chunk-566FIEPE.js → chunk-YFZNSP7F.js} +3 -3
- package/dist/{chunk-566FIEPE.js.map → chunk-YFZNSP7F.js.map} +1 -1
- package/dist/{chunk-I6Y2KLTZ.js → chunk-ZP4H5HA4.js} +3 -3
- package/dist/{chunk-I6Y2KLTZ.js.map → chunk-ZP4H5HA4.js.map} +1 -1
- package/dist/components/ActionPlan/index.cjs +1 -1
- package/dist/components/ActionPlan/index.js +1 -1
- package/dist/components/AlertDialog/index.cjs +7 -7
- package/dist/components/AlertDialog/index.js +3 -3
- package/dist/components/AudioPlayer/index.cjs +7 -6
- package/dist/components/AudioPlayer/index.js +2 -1
- package/dist/components/CustomizableDashboard/index.cjs +1 -1
- package/dist/components/CustomizableDashboard/index.js +1 -1
- package/dist/components/DateInput/index.cjs +3 -3
- package/dist/components/DateInput/index.js +2 -2
- package/dist/components/EmailEditor/index.cjs +16 -13
- package/dist/components/EmailEditor/index.js +7 -4
- package/dist/components/KeyboardShortcutsOverlay/index.cjs +5 -5
- package/dist/components/KeyboardShortcutsOverlay/index.js +3 -3
- package/dist/components/Markdown/index.cjs +10 -10
- package/dist/components/Markdown/index.js +2 -2
- package/dist/components/MediaEditor/index.cjs +13 -12
- package/dist/components/MediaEditor/index.js +8 -7
- package/dist/components/MediaFeed/index.cjs +10 -7
- package/dist/components/MediaFeed/index.d.cts +33 -0
- package/dist/components/MediaFeed/index.d.ts +33 -0
- package/dist/components/MediaFeed/index.js +9 -6
- package/dist/components/MediaPlayer/index.cjs +13 -6
- package/dist/components/MediaPlayer/index.d.cts +103 -5
- package/dist/components/MediaPlayer/index.d.ts +103 -5
- package/dist/components/MediaPlayer/index.js +6 -3
- package/dist/components/Modal/index.cjs +10 -10
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/RadialExplorer/index.cjs +3 -3
- package/dist/components/RadialExplorer/index.js +2 -2
- package/dist/components/RecordHeader/index.cjs +4 -4
- package/dist/components/RecordHeader/index.js +2 -2
- package/dist/components/RecordLayout/index.cjs +1 -1
- package/dist/components/RecordLayout/index.js +1 -1
- package/dist/components/Sheet/index.cjs +1 -1
- package/dist/components/Sheet/index.js +1 -1
- package/dist/components/Slider/index.cjs +5 -5
- package/dist/components/Slider/index.d.cts +6 -0
- package/dist/components/Slider/index.d.ts +6 -0
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/SliderCalculator/index.cjs +4 -4
- package/dist/components/SliderCalculator/index.js +2 -2
- package/dist/components/SuperChat/index.cjs +20 -18
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.d.cts +2 -2
- package/dist/components/SuperChat/index.d.ts +2 -2
- package/dist/components/SuperChat/index.js +12 -10
- package/dist/components/SuperChat/index.js.map +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +1 -1
- package/dist/components/SuperChat/plugins/index.d.cts +2 -2
- package/dist/components/SuperChat/plugins/index.d.ts +2 -2
- package/dist/components/SuperChat/plugins/index.js +1 -1
- package/dist/components/TagEditor/index.cjs +4 -4
- package/dist/components/TagEditor/index.js +2 -2
- package/dist/components/Textarea/index.cjs +7 -4
- package/dist/components/Textarea/index.js +4 -1
- package/dist/esheet.cjs +122 -123
- package/dist/esheet.cjs.map +1 -1
- package/dist/esheet.js +25 -26
- package/dist/esheet.js.map +1 -1
- package/dist/hooks/index.cjs +17 -17
- package/dist/hooks/index.js +4 -4
- package/dist/index.cjs +518 -482
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +204 -98
- package/dist/index.d.ts +204 -98
- package/dist/index.js +91 -52
- package/dist/index.js.map +1 -1
- package/dist/kerebron.cjs +32 -62
- package/dist/kerebron.cjs.map +1 -1
- package/dist/kerebron.css +145 -8
- package/dist/kerebron.d.cts +299 -1
- package/dist/kerebron.d.ts +299 -1
- package/dist/kerebron.js +22 -63
- package/dist/kerebron.js.map +1 -1
- package/dist/{model-EFXX5JZN.cjs → model-5PB6KNYH.cjs} +20 -20
- package/dist/{model-EFXX5JZN.cjs.map → model-5PB6KNYH.cjs.map} +1 -1
- package/dist/{model-TAARSYDY.js → model-OGWTZEXR.js} +6 -6
- package/dist/{model-TAARSYDY.js.map → model-OGWTZEXR.js.map} +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/templates.cjs +31 -31
- package/dist/templates.js +2 -2
- package/dist/{types-DSWbrVkM.d.ts → types-BfVolads.d.cts} +33 -0
- package/dist/{types-DSWbrVkM.d.cts → types-BfVolads.d.ts} +33 -0
- package/dist/utils/index.cjs +5 -5
- package/dist/utils/index.d.cts +12 -12
- package/dist/utils/index.d.ts +12 -12
- package/dist/utils/index.js +1 -1
- package/package.json +3 -13
- package/dist/chunk-25MPUVTM.js.map +0 -1
- package/dist/chunk-4M2KE4O5.cjs.map +0 -1
- package/dist/chunk-4SUEBKTY.js.map +0 -1
- package/dist/chunk-6UYMO3PF.cjs.map +0 -1
- package/dist/chunk-DXNVQQYN.cjs.map +0 -1
- package/dist/chunk-ECKIFQSD.cjs +0 -183
- package/dist/chunk-ECKIFQSD.cjs.map +0 -1
- package/dist/chunk-GDKOYVX3.cjs.map +0 -1
- package/dist/chunk-GLXTVCHN.cjs +0 -4
- package/dist/chunk-JEXEFWEM.js.map +0 -1
- package/dist/chunk-QHCAWDMG.cjs.map +0 -1
- package/dist/chunk-QO4A6U73.cjs.map +0 -1
- package/dist/chunk-R5P7NAJQ.js +0 -159
- package/dist/chunk-R5P7NAJQ.js.map +0 -1
- package/dist/chunk-RISZWWEQ.js +0 -3
- package/dist/chunk-RTADGBBN.js.map +0 -1
- package/dist/chunk-TUYWCUKH.js.map +0 -1
- package/dist/chunk-V5VPECJI.js.map +0 -1
package/dist/kerebron.cjs
CHANGED
|
@@ -1,73 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRCTIPBLU_cjs = require('./chunk-RCTIPBLU.cjs');
|
|
4
|
+
var chunkNCG7NJAW_cjs = require('./chunk-NCG7NJAW.cjs');
|
|
5
|
+
require('./chunk-S2CJ57BX.cjs');
|
|
6
|
+
require('./chunk-FSLI5IKP.cjs');
|
|
7
|
+
require('./chunk-YP5T6NZD.cjs');
|
|
8
|
+
require('./chunk-ZNUMOJOI.cjs');
|
|
9
|
+
require('./chunk-PINIBEIU.cjs');
|
|
10
|
+
require('./chunk-I44YNYI6.cjs');
|
|
11
|
+
require('./chunk-Z5S5JEJD.cjs');
|
|
4
12
|
require('./chunk-NMBYU7D7.cjs');
|
|
13
|
+
require('./chunk-PHYQSCP6.cjs');
|
|
14
|
+
require('./chunk-FHY3K6PL.cjs');
|
|
15
|
+
require('./chunk-FSGEDDF2.cjs');
|
|
16
|
+
require('./chunk-AOHJILLU.cjs');
|
|
17
|
+
require('./chunk-C7RVKV25.cjs');
|
|
18
|
+
require('./chunk-L7L5S2HO.cjs');
|
|
19
|
+
require('./chunk-YW2AKBLS.cjs');
|
|
20
|
+
require('./chunk-Z3WMDVMR.cjs');
|
|
21
|
+
require('./chunk-EACNRR3C.cjs');
|
|
22
|
+
require('./chunk-FSARTLUE.cjs');
|
|
23
|
+
require('./chunk-HGJHWI7W.cjs');
|
|
24
|
+
require('./chunk-IEY3ZJIT.cjs');
|
|
25
|
+
require('./chunk-S5RVSXDV.cjs');
|
|
5
26
|
require('./chunk-EUAMEVVI.cjs');
|
|
6
|
-
var react = require('react');
|
|
7
|
-
var editor = require('@kerebron/editor');
|
|
8
|
-
var CodeEditorKit = require('@kerebron/editor-kits/CodeEditorKit');
|
|
9
|
-
var web = require('@kerebron/wasm/web');
|
|
10
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
11
27
|
|
|
12
|
-
var CodeEditor = ({
|
|
13
|
-
value = "",
|
|
14
|
-
onChange,
|
|
15
|
-
lang = "typescript"
|
|
16
|
-
}) => {
|
|
17
|
-
const editorRef = react.useRef(null);
|
|
18
|
-
const editorInstance = react.useRef(null);
|
|
19
|
-
const onChangeRef = react.useRef(onChange);
|
|
20
|
-
onChangeRef.current = onChange;
|
|
21
|
-
react.useEffect(() => {
|
|
22
|
-
const root = editorRef.current;
|
|
23
|
-
if (!root) return;
|
|
24
|
-
const applySelectLabel = () => {
|
|
25
|
-
root.querySelectorAll("select.codejar-select").forEach((element) => {
|
|
26
|
-
if (!element.getAttribute("aria-label")) {
|
|
27
|
-
element.setAttribute("aria-label", "Code editor language");
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
applySelectLabel();
|
|
32
|
-
const observer = new MutationObserver(() => applySelectLabel());
|
|
33
|
-
observer.observe(root, { childList: true, subtree: true });
|
|
34
|
-
return () => observer.disconnect();
|
|
35
|
-
}, []);
|
|
36
|
-
react.useEffect(() => {
|
|
37
|
-
if (!editorRef.current) return;
|
|
38
|
-
const editor$1 = editor.CoreEditor.create({
|
|
39
|
-
element: editorRef.current,
|
|
40
|
-
uri: "file:///untitled.ts",
|
|
41
|
-
assetLoad: web.createAssetLoad("/kerebron-wasm"),
|
|
42
|
-
editorKits: [new CodeEditorKit.CodeEditorKit(lang)]
|
|
43
|
-
});
|
|
44
|
-
editorInstance.current = editor$1;
|
|
45
|
-
const onTransaction = async () => {
|
|
46
|
-
if (!editorInstance.current) return;
|
|
47
|
-
try {
|
|
48
|
-
const buffer = await editorInstance.current.saveDocument("text/plain");
|
|
49
|
-
onChangeRef.current?.(new globalThis.TextDecoder().decode(buffer));
|
|
50
|
-
} catch (err) {
|
|
51
|
-
console.error("Failed to read code:", err);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
editor$1.addEventListener("transaction", onTransaction);
|
|
55
|
-
if (value) {
|
|
56
|
-
editor$1.loadDocumentText("text/plain", value).catch((err) => console.error("Failed to load code:", err));
|
|
57
|
-
}
|
|
58
|
-
return () => {
|
|
59
|
-
editor$1.removeEventListener("transaction", onTransaction);
|
|
60
|
-
editor$1.destroy();
|
|
61
|
-
};
|
|
62
|
-
}, []);
|
|
63
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: editorRef, className: "kb-component" }) }) });
|
|
64
|
-
};
|
|
65
|
-
CodeEditor.displayName = "CodeEditor";
|
|
66
28
|
|
|
29
|
+
|
|
30
|
+
Object.defineProperty(exports, "CodeEditor", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkRCTIPBLU_cjs.CodeEditor; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "TextAreaRich", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkRCTIPBLU_cjs.TextAreaRichKerebron; }
|
|
37
|
+
});
|
|
67
38
|
Object.defineProperty(exports, "RichEditor", {
|
|
68
39
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkNCG7NJAW_cjs.RichEditor; }
|
|
70
41
|
});
|
|
71
|
-
exports.CodeEditor = CodeEditor;
|
|
72
42
|
//# sourceMappingURL=kerebron.cjs.map
|
|
73
43
|
//# sourceMappingURL=kerebron.cjs.map
|
package/dist/kerebron.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"kerebron.cjs"}
|
package/dist/kerebron.css
CHANGED
|
@@ -92,15 +92,25 @@
|
|
|
92
92
|
color: var(--kb-color-icon);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
/* The "…" overflow popup is deliberately NOT in the dropdown group below:
|
|
96
|
+
* it holds the same buttons that didn't fit in the bar, so it keeps the
|
|
97
|
+
* toolbar's own surface (stock Kerebron already paints both with
|
|
98
|
+
* --kb-color-surface-elevated) instead of the floating-menu card color.
|
|
99
|
+
* Stock also flips it to the dropdown color under an OS-level
|
|
100
|
+
* `prefers-color-scheme: dark` — but our themes are class-driven, so on a
|
|
101
|
+
* dark OS with a light app theme that turned the popup card-white.
|
|
102
|
+
* Re-assert the toolbar surface unconditionally (same specificity, later
|
|
103
|
+
* in the cascade, and media queries add none). */
|
|
104
|
+
.kb-custom-menu__overflow-menu {
|
|
105
|
+
background: var(--kb-color-surface-elevated);
|
|
106
|
+
}
|
|
107
|
+
|
|
95
108
|
[data-theme='light'] .kb-dropdown__menu,
|
|
96
109
|
[data-theme='light'] .kb-submenu__content,
|
|
97
|
-
[data-theme='light'] .kb-custom-menu__overflow-menu,
|
|
98
110
|
[data-theme='dark'] .kb-dropdown__menu,
|
|
99
111
|
[data-theme='dark'] .kb-submenu__content,
|
|
100
|
-
[data-theme='dark'] .kb-custom-menu__overflow-menu,
|
|
101
112
|
.dark .kb-dropdown__menu,
|
|
102
|
-
.dark .kb-submenu__content
|
|
103
|
-
.dark .kb-custom-menu__overflow-menu {
|
|
113
|
+
.dark .kb-submenu__content {
|
|
104
114
|
background: var(--kb-menu-dropdown-bg) !important;
|
|
105
115
|
border-color: var(--kb-menu-dropdown-border) !important;
|
|
106
116
|
color: var(--kb-menu-dropdown-text) !important;
|
|
@@ -108,13 +118,10 @@
|
|
|
108
118
|
|
|
109
119
|
[data-theme='light'] .kb-custom-menu .kb-dropdown__item .kb-menu__button:hover,
|
|
110
120
|
[data-theme='light'] .kb-custom-menu .kb-submenu__label:hover,
|
|
111
|
-
[data-theme='light'] .kb-custom-menu__overflow-item:hover,
|
|
112
121
|
[data-theme='dark'] .kb-custom-menu .kb-dropdown__item .kb-menu__button:hover,
|
|
113
122
|
[data-theme='dark'] .kb-custom-menu .kb-submenu__label:hover,
|
|
114
|
-
[data-theme='dark'] .kb-custom-menu__overflow-item:hover,
|
|
115
123
|
.dark .kb-custom-menu .kb-dropdown__item .kb-menu__button:hover,
|
|
116
|
-
.dark .kb-custom-menu .kb-submenu__label:hover
|
|
117
|
-
.dark .kb-custom-menu__overflow-item:hover {
|
|
124
|
+
.dark .kb-custom-menu .kb-submenu__label:hover {
|
|
118
125
|
background: var(--kb-menu-dropdown-hover) !important;
|
|
119
126
|
color: var(--kb-menu-dropdown-text) !important;
|
|
120
127
|
}
|
|
@@ -254,6 +261,16 @@
|
|
|
254
261
|
line-height: 1;
|
|
255
262
|
}
|
|
256
263
|
|
|
264
|
+
/* The toolbar collapses extras into its “…” overflow, but that width math
|
|
265
|
+
* can lag injected buttons and window resizes. It lays out nowrap with
|
|
266
|
+
* overflow visible, so without a wrap fallback the tail buttons spill out
|
|
267
|
+
* of the bar and paint (it is z-index 1000) over the editable and the
|
|
268
|
+
* docked macro panel below. Wrapping lets the bar grow a row instead;
|
|
269
|
+
* content reflows under it. */
|
|
270
|
+
.kb-custom-menu {
|
|
271
|
+
flex-wrap: wrap;
|
|
272
|
+
}
|
|
273
|
+
|
|
257
274
|
/*
|
|
258
275
|
* RTL (#319) — Kerebron's content.css/prosemirror.css use physical-direction
|
|
259
276
|
* properties, so these parts don't mirror under dir="rtl". Restate them as
|
|
@@ -295,3 +312,123 @@
|
|
|
295
312
|
.kb-editor .codecrock-root {
|
|
296
313
|
direction: ltr;
|
|
297
314
|
}
|
|
315
|
+
|
|
316
|
+
/*
|
|
317
|
+
* TextAreaRich (Kerebron surface) — the component wrapper supplies the
|
|
318
|
+
* Textarea chrome (border, radius, focus ring), so the stock kb-component
|
|
319
|
+
* frame is neutralized and the editable is resized to Textarea metrics:
|
|
320
|
+
* one Input row tall (24px line + 7px padding + the wrapper's 1px borders
|
|
321
|
+
* = h-10), auto-growing with content.
|
|
322
|
+
*/
|
|
323
|
+
[data-slot='textarea-rich'] .kb-component {
|
|
324
|
+
border: 0;
|
|
325
|
+
border-radius: inherit;
|
|
326
|
+
background: transparent;
|
|
327
|
+
padding: 0;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
[data-slot='textarea-rich'] .kb-editor {
|
|
331
|
+
min-height: 38px;
|
|
332
|
+
padding: 7px 12px;
|
|
333
|
+
/* Unlayered package CSS (this rule, Kerebron's base.css) outranks
|
|
334
|
+
Tailwind utilities on the editable, so sized hosts (Textarea `size`)
|
|
335
|
+
override through the variables instead. The 1rem/1.5rem defaults make
|
|
336
|
+
a one-line editable 24px + 14px padding = the 38px md Input row. */
|
|
337
|
+
font-size: var(--textarea-rich-font-size, 1rem);
|
|
338
|
+
line-height: var(--textarea-rich-line-height, 1.5rem);
|
|
339
|
+
overflow-y: auto;
|
|
340
|
+
transition:
|
|
341
|
+
min-height 0.2s ease-out,
|
|
342
|
+
padding 0.2s ease-out;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
@media (prefers-reduced-motion: reduce) {
|
|
346
|
+
[data-slot='textarea-rich'] .kb-editor {
|
|
347
|
+
transition: none;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* Kerebron's stock mobile toolbar is fixed to the bottom of the viewport, so
|
|
352
|
+
* menu.css clears it with `padding-bottom: 60px !important` on every editable
|
|
353
|
+
* under 768px. TextAreaRich replaces that toolbar with its own top-anchored
|
|
354
|
+
* kb-custom-menu, so on phones the clearance is just a dead band under the
|
|
355
|
+
* text — restore the Textarea metrics (!important to beat the library's). */
|
|
356
|
+
@media (max-width: 767px) {
|
|
357
|
+
[data-slot='textarea-rich'] .kb-component {
|
|
358
|
+
padding-bottom: 0 !important;
|
|
359
|
+
}
|
|
360
|
+
[data-slot='textarea-rich'] .kb-editor {
|
|
361
|
+
padding-bottom: 7px !important;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* Indent past the block gutter's floating + trigger only while the writer
|
|
366
|
+
* is engaged (hovering, focused, or using the + menu) — at rest the text
|
|
367
|
+
* slides back flush with the Textarea padding. */
|
|
368
|
+
[data-slot='textarea-rich'][data-gutter]
|
|
369
|
+
[data-slot='textarea-rich-body']:hover
|
|
370
|
+
.kb-editor,
|
|
371
|
+
[data-slot='textarea-rich'][data-gutter]:focus-within .kb-editor,
|
|
372
|
+
[data-slot='textarea-rich'][data-gutter][data-block-menu] .kb-editor {
|
|
373
|
+
padding-inline-start: 2.5rem;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* On touch devices the + trigger is always visible (no hover to reveal it),
|
|
377
|
+
* so the indent must be permanent — otherwise an unfocused field starts its
|
|
378
|
+
* text under the trigger. */
|
|
379
|
+
@media (hover: none) {
|
|
380
|
+
[data-slot='textarea-rich'][data-gutter] .kb-editor {
|
|
381
|
+
padding-inline-start: 2.5rem;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/* The toolbar stays mounted (its buttons carry live editor state) but is
|
|
386
|
+
* chrome the field reveals on demand. Only the menu bar itself is hidden —
|
|
387
|
+
* its wrapper also contains the editable surface. */
|
|
388
|
+
[data-slot='textarea-rich'][data-toolbar='hidden'] .kb-custom-menu,
|
|
389
|
+
[data-slot='textarea-rich'][data-toolbar='hidden']
|
|
390
|
+
.kb-custom-menu__overflow-menu {
|
|
391
|
+
display: none;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/* Disabled/readOnly: the toolbar is made `inert` (see TextAreaRichKerebron);
|
|
395
|
+
* dim it so it also reads as unavailable. */
|
|
396
|
+
[data-slot='textarea-rich'][data-inert] .kb-custom-menu {
|
|
397
|
+
opacity: 0.5;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* Working space while the docked macro panel is open. The panel docks
|
|
401
|
+
* below the toolbar (which keeps its full width), so only the editable
|
|
402
|
+
* sidesteps it; tall enough for search plus a few rows, far less when the
|
|
403
|
+
* compact panel is just rows. */
|
|
404
|
+
@media (min-width: 768px) {
|
|
405
|
+
[data-slot='textarea-rich'][data-macros-open] .kb-editor {
|
|
406
|
+
min-height: 250px;
|
|
407
|
+
margin-inline-end: 18rem;
|
|
408
|
+
}
|
|
409
|
+
[data-slot='textarea-rich'][data-macros-open][data-compact-macros]
|
|
410
|
+
.kb-editor {
|
|
411
|
+
min-height: 140px;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* RichEditor isolates `.kb-component` (inline style) so the toolbar's
|
|
416
|
+
* z-index:1000 can't escape into the page — but the docked macro panel is
|
|
417
|
+
* a later sibling OUTSIDE that boundary, so it painted over the toolbar's
|
|
418
|
+
* dropdowns and its "…" overflow popup. Move the isolation boundary up to
|
|
419
|
+
* the field root: the toolbar and its popups now rise above the docked
|
|
420
|
+
* panel (and the panel stays above the editable by DOM order), while
|
|
421
|
+
* their z-index still can't leak past the field. */
|
|
422
|
+
[data-slot='textarea-rich'] {
|
|
423
|
+
isolation: isolate;
|
|
424
|
+
}
|
|
425
|
+
[data-slot='textarea-rich'] .kb-component {
|
|
426
|
+
isolation: auto !important;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* Kerebron caps the "…" overflow popup at 320px, which wraps the grid onto
|
|
430
|
+
* a second row once our Macros/Dictate items join it. Let it grow with its
|
|
431
|
+
* content, up to the field's width (minus its inset on both sides). */
|
|
432
|
+
[data-slot='textarea-rich'] .kb-custom-menu__overflow-menu {
|
|
433
|
+
max-width: calc(100% - 2 * var(--kb-space-xs, 4px));
|
|
434
|
+
}
|
package/dist/kerebron.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { CoreEditor, AssetLoad, EditorKit } from '@kerebron/editor';
|
|
4
|
+
import { MenuElement } from '@kerebron/extension-menu';
|
|
5
|
+
export { MenuElement } from '@kerebron/extension-menu';
|
|
4
6
|
import { MediaUploadOptions } from '@kerebron/extension-basic-editor/ExtensionMediaUpload';
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -16,6 +18,12 @@ import { MediaUploadOptions } from '@kerebron/extension-basic-editor/ExtensionMe
|
|
|
16
18
|
* peers — plain-mode consumers never load them.
|
|
17
19
|
*/
|
|
18
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Reshape the toolbar menu before it renders: receives the stock menu's
|
|
23
|
+
* item groups and returns the groups to render. Append custom
|
|
24
|
+
* {@link MenuElement}s (e.g. a Macros toggle) or drop stock groups.
|
|
25
|
+
*/
|
|
26
|
+
type ModifyMenu = (menus: MenuElement[][]) => MenuElement[][];
|
|
19
27
|
interface CollabConfig {
|
|
20
28
|
/** Room id — one shared document per room (e.g. a post id). */
|
|
21
29
|
room: string;
|
|
@@ -81,6 +89,12 @@ interface RichEditorProps {
|
|
|
81
89
|
collab?: CollabConfig;
|
|
82
90
|
/** Read-only surface: no typing, and the content dims. */
|
|
83
91
|
disabled?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Lock edits while keeping the surface focusable and selectable, without
|
|
94
|
+
* the dimmed `disabled` styling. Applied from creation, so the document
|
|
95
|
+
* cannot be edited even while the initial load is still in flight.
|
|
96
|
+
*/
|
|
97
|
+
readOnly?: boolean;
|
|
84
98
|
/**
|
|
85
99
|
* Id for the editor host element — an `aria-labelledby`/`aria-describedby`
|
|
86
100
|
* anchor. The host is a `div`, not a labelable control, so a
|
|
@@ -120,6 +134,28 @@ interface RichEditorProps {
|
|
|
120
134
|
mediaUpload?: MediaUploadOptions;
|
|
121
135
|
/** Additional editor kits, installed once when the editor mounts. */
|
|
122
136
|
editorKits?: EditorKit[];
|
|
137
|
+
/**
|
|
138
|
+
* Reshape the stock toolbar before it renders: receives the menu's item
|
|
139
|
+
* groups and returns the groups to render — append custom controls (a
|
|
140
|
+
* macros toggle, dictation) or drop stock ones. Read once, when the editor
|
|
141
|
+
* mounts — like {@link collab}, remount via `key` to change it.
|
|
142
|
+
*/
|
|
143
|
+
modifyMenu?: ModifyMenu;
|
|
144
|
+
/**
|
|
145
|
+
* MIME type of the `value`/`onChange` contract (`'text/x-markdown'` by
|
|
146
|
+
* default; pass `'text/html'` for an HTML-valued surface). Governs both
|
|
147
|
+
* how `value` is parsed and what `onChange`/`getContent()` emit.
|
|
148
|
+
*/
|
|
149
|
+
valueType?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Converge the document to `value` on every render, not only when the
|
|
152
|
+
* prop changes — native controlled-input semantics: when a host's
|
|
153
|
+
* `onChange` does not echo an edit back into `value`, the edit reverts.
|
|
154
|
+
* A rejected edit leaves the prop identity unchanged while the document
|
|
155
|
+
* moved on, which a change-gated reload can never see. Off by default,
|
|
156
|
+
* which tolerates read-once hosts that call `getContent()` on submit.
|
|
157
|
+
*/
|
|
158
|
+
strictValue?: boolean;
|
|
123
159
|
}
|
|
124
160
|
interface RichEditorHandle {
|
|
125
161
|
/**
|
|
@@ -150,4 +186,266 @@ interface CodeEditorProps {
|
|
|
150
186
|
}
|
|
151
187
|
declare const CodeEditor: React__default.FC<CodeEditorProps>;
|
|
152
188
|
|
|
153
|
-
|
|
189
|
+
interface Macro {
|
|
190
|
+
/** Stable identifier. */
|
|
191
|
+
id: string;
|
|
192
|
+
/** Human-readable name shown in the list. */
|
|
193
|
+
label: string;
|
|
194
|
+
/** Plain text inserted into the editor. `\n` is preserved. */
|
|
195
|
+
content: string;
|
|
196
|
+
/** Optional shortcut identifier shown as a badge (e.g. `.b`). */
|
|
197
|
+
shortcut?: string;
|
|
198
|
+
/** Extra search terms that are not displayed. */
|
|
199
|
+
keywords?: string[];
|
|
200
|
+
}
|
|
201
|
+
interface MacroGroup {
|
|
202
|
+
/** Stable identifier. */
|
|
203
|
+
id: string;
|
|
204
|
+
/** Group heading (e.g. "Default library"). */
|
|
205
|
+
label: string;
|
|
206
|
+
/**
|
|
207
|
+
* `previous` renders the group visually distinct from library macros
|
|
208
|
+
* (history icon, muted header) so prior values are never mistaken for
|
|
209
|
+
* predefined content. Defaults to `library`.
|
|
210
|
+
*/
|
|
211
|
+
kind?: 'library' | 'previous';
|
|
212
|
+
/** Macros belonging to the group. */
|
|
213
|
+
macros: Macro[];
|
|
214
|
+
}
|
|
215
|
+
interface MacroLibraryProps {
|
|
216
|
+
/** Grouped macros supplied by the application. */
|
|
217
|
+
groups: MacroGroup[];
|
|
218
|
+
/** Called with the chosen macro. The caller performs the insertion. */
|
|
219
|
+
onSelect: (macro: Macro) => void;
|
|
220
|
+
/** Id for the panel root (e.g. the target of a toggle's aria-controls). */
|
|
221
|
+
id?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Name of the insertion target shown in the header (e.g. the editor's
|
|
224
|
+
* label), rendered as "Insert into <target>".
|
|
225
|
+
*/
|
|
226
|
+
targetLabel?: string;
|
|
227
|
+
/** When provided, renders a close button and enables Escape-to-close. */
|
|
228
|
+
onClose?: () => void;
|
|
229
|
+
/** When provided, renders a "Save as macro" action in the footer. */
|
|
230
|
+
onCreateMacro?: () => void;
|
|
231
|
+
/** Autofocus the search input on mount. Defaults to false. */
|
|
232
|
+
autoFocusSearch?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Minimal chrome for short, space-constrained lists: hides the header,
|
|
235
|
+
* the search input, and library group headings so the panel is just the
|
|
236
|
+
* macro rows. Previous-value groups keep their heading so prior answers
|
|
237
|
+
* stay visually distinct. Escape-to-close still works when `onClose` is
|
|
238
|
+
* provided. Defaults to false.
|
|
239
|
+
*/
|
|
240
|
+
compact?: boolean;
|
|
241
|
+
/** Additional class for the panel root. */
|
|
242
|
+
className?: string;
|
|
243
|
+
/** Overridable labels for i18n. */
|
|
244
|
+
labels?: Partial<typeof DEFAULT_LABELS>;
|
|
245
|
+
}
|
|
246
|
+
declare const DEFAULT_LABELS: {
|
|
247
|
+
insertInto: string;
|
|
248
|
+
macros: string;
|
|
249
|
+
searchPlaceholder: string;
|
|
250
|
+
searchLabel: string;
|
|
251
|
+
close: string;
|
|
252
|
+
createMacro: string;
|
|
253
|
+
empty: string;
|
|
254
|
+
emptyHint: string;
|
|
255
|
+
noResults: string;
|
|
256
|
+
clearSearch: string;
|
|
257
|
+
showMore: string;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
interface RichTextVariable {
|
|
261
|
+
/** Human-readable label shown in the variable menu. */
|
|
262
|
+
label: string;
|
|
263
|
+
/** The token displayed for the variable (e.g. `{{employee.name}}`). */
|
|
264
|
+
value: string;
|
|
265
|
+
/** Optional text inserted instead of `value` (e.g. an expanded group). */
|
|
266
|
+
insertValue?: string;
|
|
267
|
+
}
|
|
268
|
+
interface RichTextVariableGroup {
|
|
269
|
+
/** Group heading shown in the variable menu. */
|
|
270
|
+
label: string;
|
|
271
|
+
/** Variables belonging to the group. */
|
|
272
|
+
variables: RichTextVariable[];
|
|
273
|
+
}
|
|
274
|
+
interface RichTextEditorBlockMenuLabels {
|
|
275
|
+
/** Accessible label for the gutter `+` button. Defaults to "Block menu". */
|
|
276
|
+
blockMenu?: string;
|
|
277
|
+
/** "Text" (normal paragraph) menu item. */
|
|
278
|
+
text?: string;
|
|
279
|
+
/** "Heading 1" menu item. */
|
|
280
|
+
heading1?: string;
|
|
281
|
+
/** "Heading 2" menu item. */
|
|
282
|
+
heading2?: string;
|
|
283
|
+
/** "Heading 3" menu item. */
|
|
284
|
+
heading3?: string;
|
|
285
|
+
/** "Bullet list" menu item. */
|
|
286
|
+
bulletList?: string;
|
|
287
|
+
/** "Numbered list" menu item. */
|
|
288
|
+
numberedList?: string;
|
|
289
|
+
/** "Quote" menu item. */
|
|
290
|
+
quote?: string;
|
|
291
|
+
/** "Insert macro" submenu parent (shown when `macros` is provided). */
|
|
292
|
+
insertMacro?: string;
|
|
293
|
+
/** "Show macro library" menu item (shown when `macros` is provided). */
|
|
294
|
+
showMacroLibrary?: string;
|
|
295
|
+
/** Toolbar toggle item while the toolbar is hidden. */
|
|
296
|
+
showToolbar?: string;
|
|
297
|
+
/** Toolbar toggle item while the toolbar is visible. */
|
|
298
|
+
hideToolbar?: string;
|
|
299
|
+
}
|
|
300
|
+
interface RichTextEditorProps {
|
|
301
|
+
/** Current HTML value of the editor. */
|
|
302
|
+
value: string;
|
|
303
|
+
/** Called with the updated HTML whenever the content changes. */
|
|
304
|
+
onChange: (value: string) => void;
|
|
305
|
+
/** Placeholder shown when the editor is empty. */
|
|
306
|
+
placeholder?: string;
|
|
307
|
+
/** Additional class for the editor wrapper. */
|
|
308
|
+
className?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Variable groups for the "Insert variable" menu. When omitted the variable
|
|
311
|
+
* menu and the `<< >>` → `{{ }}` convert button are hidden.
|
|
312
|
+
*/
|
|
313
|
+
variableGroups?: RichTextVariableGroup[];
|
|
314
|
+
/** Enable the speech-to-text dictation button. Defaults to true. */
|
|
315
|
+
enableDictation?: boolean;
|
|
316
|
+
/** Called when dictation cannot start (replaces native alerts). */
|
|
317
|
+
onDictationError?: (message: string) => void;
|
|
318
|
+
/** Disable editing and toolbar actions. */
|
|
319
|
+
disabled?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* Sanitises HTML introduced by paste or drop before it reaches the editable
|
|
322
|
+
* DOM. Without it, pasted markup is inserted as the browser provides it.
|
|
323
|
+
*/
|
|
324
|
+
sanitizeHtml?: (html: string) => string;
|
|
325
|
+
/**
|
|
326
|
+
* Grouped macros for the optional macro addon. When omitted the editor is
|
|
327
|
+
* unchanged. When provided, a "Macros" toolbar toggle docks a searchable
|
|
328
|
+
* macro panel inside the editor; selecting a macro inserts its content at
|
|
329
|
+
* the retained caret position. Typing a macro shortcut (e.g. `.b`)
|
|
330
|
+
* followed by a space expands it in place, panel open or not.
|
|
331
|
+
*/
|
|
332
|
+
macros?: MacroGroup[];
|
|
333
|
+
/** Open the macro panel initially. Defaults to false. */
|
|
334
|
+
defaultMacrosOpen?: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Focus-driven macro panel: the field rests as a plain input, the panel
|
|
337
|
+
* animates in while focus is anywhere inside the editor frame (editable,
|
|
338
|
+
* toolbar, gutter or the panel itself) and animates away when focus
|
|
339
|
+
* leaves. Overrides `defaultMacrosOpen`; Escape-to-close is disabled since
|
|
340
|
+
* visibility follows focus. Pairs well with `compactMacros`. Defaults to
|
|
341
|
+
* false.
|
|
342
|
+
*/
|
|
343
|
+
macrosOnFocus?: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Dock the macro panel in `MacroLibrary`'s compact mode (no header,
|
|
346
|
+
* search, or library group headings) and shrink the macros-open working
|
|
347
|
+
* space to match — for short lists in dense forms. Defaults to false.
|
|
348
|
+
*/
|
|
349
|
+
compactMacros?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* Called on any explicit macro invocation: a pick from the macro panel or
|
|
352
|
+
* the block gutter flyout, or a typed `.shortcut` expansion. Return `true`
|
|
353
|
+
* to take over the insertion: the editor skips its caret insertion and the
|
|
354
|
+
* host applies the content through its own value update (e.g. appending a
|
|
355
|
+
* coded finding as its own line). For typed shortcuts the editor removes
|
|
356
|
+
* the typed token (and publishes that edit) before consulting the
|
|
357
|
+
* callback, so a host that takes over computes from a token-free value.
|
|
358
|
+
*/
|
|
359
|
+
onMacroInsert?: (macro: Macro) => boolean | void;
|
|
360
|
+
/**
|
|
361
|
+
* Overridable labels for the macro addon (i18n). Panel labels are
|
|
362
|
+
* forwarded to the docked `MacroLibrary`; `macros` doubles as the toolbar
|
|
363
|
+
* toggle text, and `showMacros`/`hideMacros` set the toggle's title.
|
|
364
|
+
*/
|
|
365
|
+
macroLabels?: MacroLibraryProps['labels'] & {
|
|
366
|
+
/** Toggle title while the panel is closed. Defaults to "Show macros". */
|
|
367
|
+
showMacros?: string;
|
|
368
|
+
/** Toggle title while the panel is open. Defaults to "Hide macros". */
|
|
369
|
+
hideMacros?: string;
|
|
370
|
+
};
|
|
371
|
+
/** Forwarded to the macro panel's "Save as macro" action. */
|
|
372
|
+
onCreateMacro?: () => void;
|
|
373
|
+
/**
|
|
374
|
+
* Controlled toolbar visibility. `'hidden'` removes the toolbar entirely
|
|
375
|
+
* for chromeless surfaces (typed shortcuts keep working; pair with
|
|
376
|
+
* `markdownShortcuts` or `blockMenu` so formatting stays reachable). When
|
|
377
|
+
* omitted the editor manages visibility itself, starting from
|
|
378
|
+
* `defaultToolbar` — existing consumers are unchanged.
|
|
379
|
+
*/
|
|
380
|
+
toolbar?: 'visible' | 'hidden';
|
|
381
|
+
/**
|
|
382
|
+
* Initial toolbar visibility when `toolbar` is uncontrolled. Defaults to
|
|
383
|
+
* `'visible'`.
|
|
384
|
+
*/
|
|
385
|
+
defaultToolbar?: 'visible' | 'hidden';
|
|
386
|
+
/**
|
|
387
|
+
* Called when the block gutter menu toggles the toolbar ("Show toolbar" /
|
|
388
|
+
* "Hide toolbar"), so hosts can persist the preference or drive the
|
|
389
|
+
* controlled `toolbar` prop.
|
|
390
|
+
*/
|
|
391
|
+
onToolbarChange?: (toolbar: 'visible' | 'hidden') => void;
|
|
392
|
+
/**
|
|
393
|
+
* Notion-style block gutter menu. Hovering a text row reveals a `+`
|
|
394
|
+
* button in the start gutter whose menu applies block formats to that
|
|
395
|
+
* row, opens the macro panel (when `macros` is provided) and toggles the
|
|
396
|
+
* toolbar. Also reachable from the keyboard with Ctrl/Cmd+/ on the
|
|
397
|
+
* caret's block. Defaults to false.
|
|
398
|
+
*/
|
|
399
|
+
blockMenu?: boolean;
|
|
400
|
+
/** Overridable labels for the block gutter menu (i18n). */
|
|
401
|
+
blockMenuLabels?: RichTextEditorBlockMenuLabels;
|
|
402
|
+
/**
|
|
403
|
+
* Expand markdown-style block shortcuts typed at the start of a line and
|
|
404
|
+
* followed by a space: `#`/`##`/`###` → headings, `-`/`*` → bullet list,
|
|
405
|
+
* `1.` → numbered list, `>` → block quote. Inline rules (`**bold**`) are
|
|
406
|
+
* not interpreted. Defaults to false.
|
|
407
|
+
*/
|
|
408
|
+
markdownShortcuts?: boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Textarea-like surface: removes the wrapper border/radius and starts the
|
|
411
|
+
* editable at a single Input-row height that auto-grows with content
|
|
412
|
+
* (matching `Textarea`'s `md` metrics). The host supplies the chrome —
|
|
413
|
+
* `TextAreaRich` is the packaged pairing. Defaults to false.
|
|
414
|
+
*/
|
|
415
|
+
chromeless?: boolean;
|
|
416
|
+
/** Id applied to the editable region (deep links, `aria-labelledby`). */
|
|
417
|
+
id?: string;
|
|
418
|
+
/**
|
|
419
|
+
* Prevent editing and formatting while keeping the region focusable and
|
|
420
|
+
* its text selectable — the contenteditable analogue of a native
|
|
421
|
+
* textarea's `readOnly`. The block gutter menu is hidden.
|
|
422
|
+
*/
|
|
423
|
+
readOnly?: boolean;
|
|
424
|
+
/** Extra class for the editable region itself (fonts, whitespace). */
|
|
425
|
+
editorClassName?: string;
|
|
426
|
+
/** Inline style for the editable region (e.g. a row-derived min-height). */
|
|
427
|
+
editorStyle?: React.CSSProperties;
|
|
428
|
+
/** Accessible label for the editable region. */
|
|
429
|
+
'aria-label'?: string;
|
|
430
|
+
/** Id(s) of element(s) labelling the editable region. */
|
|
431
|
+
'aria-labelledby'?: string;
|
|
432
|
+
/** Ids of elements describing the editable region (errors, helper text). */
|
|
433
|
+
'aria-describedby'?: string;
|
|
434
|
+
/** Marks the editable region invalid for assistive technology. */
|
|
435
|
+
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
436
|
+
/** Marks the editable region required for assistive technology. */
|
|
437
|
+
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
interface TextAreaRichProps extends Omit<RichTextEditorProps, 'chromeless' | 'blockMenu' | 'defaultToolbar'> {
|
|
441
|
+
/**
|
|
442
|
+
* Initial toolbar visibility when `toolbar` is uncontrolled. TextAreaRich
|
|
443
|
+
* is chromeless, so this defaults to `'hidden'`; the block gutter menu's
|
|
444
|
+
* "Show toolbar" reveals it on demand.
|
|
445
|
+
*/
|
|
446
|
+
defaultToolbar?: 'visible' | 'hidden';
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
declare const TextAreaRichKerebron: React.ForwardRefExoticComponent<TextAreaRichProps & React.RefAttributes<HTMLDivElement>>;
|
|
450
|
+
|
|
451
|
+
export { CodeEditor, type CodeEditorProps, type CollabConfig, type ModifyMenu, RichEditor, type RichEditorHandle, type RichEditorProps, TextAreaRichKerebron as TextAreaRich, type TextAreaRichProps };
|