jenosize-ui 0.2.2 → 0.3.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/README.md +183 -63
- package/THIRD-PARTY-NOTICES.md +15 -0
- package/dist/GradientPicker-CQm3GT7F.d.ts +144 -0
- package/dist/{PaymentInput-Dn5WVQVy.d.ts → PaymentInput-Cz5jFB3p.d.ts} +1 -1
- package/dist/{Select-Dt5ARIH8.d.ts → Select-CXOAMlk7.d.ts} +15 -1
- package/dist/{TagInput-BaBeve6L.d.ts → TagInput-CzIrONr-.d.ts} +1 -1
- package/dist/area-chart.d.ts +2 -2
- package/dist/area-chart.js +7 -6
- package/dist/at-least-one-BZ2dsck-.d.ts +18 -0
- package/dist/avatar.d.ts +1 -1
- package/dist/avatar.js +11 -10
- package/dist/badge.d.ts +1 -1
- package/dist/badge.js +6 -6
- package/dist/bar-chart.d.ts +2 -2
- package/dist/bar-chart.js +7 -6
- package/dist/breadcrumb.d.ts +1 -1
- package/dist/breadcrumb.js +4 -4
- package/dist/button.d.ts +1 -1
- package/dist/button.js +11 -10
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +15 -14
- package/dist/callout.d.ts +4 -2
- package/dist/callout.js +12 -11
- package/dist/card.d.ts +59 -3
- package/dist/card.js +3 -3
- package/dist/carousel.d.ts +169 -0
- package/dist/carousel.js +9 -0
- package/dist/catalog.json +11180 -0
- package/dist/checkbox.js +8 -7
- package/dist/{chunk-R4Z7BINC.js → chunk-26XQU3TC.js} +8 -8
- package/dist/{chunk-AIARANKE.js → chunk-3JQKVC2K.js} +4 -4
- package/dist/chunk-3P3QZPHV.js +109 -0
- package/dist/{chunk-GLKFFA7N.js → chunk-44AWXIQK.js} +5 -5
- package/dist/{chunk-FWRHBMWT.js → chunk-4Y32RIC7.js} +5 -19
- package/dist/{chunk-5XPMY2LF.js → chunk-5ECTNYKU.js} +5 -5
- package/dist/{chunk-ZD3MOLIB.js → chunk-5GBA6X6A.js} +4 -4
- package/dist/{chunk-LE44X5GS.js → chunk-5SGF47TZ.js} +9 -9
- package/dist/{chunk-POQTE7JI.js → chunk-5XSR757T.js} +7 -7
- package/dist/{chunk-3HOHLQVP.js → chunk-6FGLABYH.js} +3 -3
- package/dist/{chunk-MCQG4H6T.js → chunk-6T3QAO5K.js} +12 -4
- package/dist/{chunk-SKRR3ZMP.js → chunk-737A4YNC.js} +3 -3
- package/dist/{chunk-AFYXSZGW.js → chunk-7LSUUEAF.js} +7 -5
- package/dist/{chunk-7VLYQR4D.js → chunk-7OFGPDYJ.js} +3 -3
- package/dist/{chunk-54SIZR63.js → chunk-7UCKFULR.js} +7 -7
- package/dist/{chunk-LQURV7HQ.js → chunk-7ZA3QZRP.js} +4 -4
- package/dist/{chunk-X2VMIBK5.js → chunk-A4YPUS6C.js} +4 -4
- package/dist/{chunk-5ZEUTSCV.js → chunk-B4OVIE2X.js} +6 -6
- package/dist/{chunk-P6CON2R2.js → chunk-BH32X25C.js} +3 -3
- package/dist/{chunk-7QXOGAN6.js → chunk-BJHLW25G.js} +85 -538
- package/dist/{chunk-ULGCGKOE.js → chunk-BKBINQJZ.js} +4 -4
- package/dist/{chunk-CFFWYXDW.js → chunk-BXQFBFT7.js} +5 -5
- package/dist/{chunk-I6WMNXC7.js → chunk-CQGMOPLG.js} +6 -6
- package/dist/{chunk-FNQJJO63.js → chunk-CUONE6LA.js} +4 -4
- package/dist/{chunk-D6XO4JVM.js → chunk-CVCS5G3E.js} +42 -20
- package/dist/{chunk-33TOK7ES.js → chunk-DCKVNHV5.js} +5 -5
- package/dist/{chunk-ZR6HNKSN.js → chunk-DYRGHXT5.js} +3 -3
- package/dist/{chunk-T4ZFZTY6.js → chunk-EHML2DLR.js} +4 -4
- package/dist/{chunk-N3RVMBPX.js → chunk-EJKQGUUM.js} +4 -4
- package/dist/{chunk-E2YZ7IMT.js → chunk-ESDSTS5N.js} +6 -6
- package/dist/{chunk-LCG34A5T.js → chunk-EVINS473.js} +5 -3
- package/dist/chunk-EXRVOGJ5.js +325 -0
- package/dist/{chunk-YHBI52P2.js → chunk-GDW6NFYN.js} +3 -3
- package/dist/chunk-GOCO45FF.js +619 -0
- package/dist/{chunk-7ZM7SNCZ.js → chunk-GPHGPY6T.js} +3 -3
- package/dist/{chunk-CGZXQ7PA.js → chunk-HNNNJP3A.js} +3 -3
- package/dist/{chunk-ZZSNTCCL.js → chunk-IESEBPYA.js} +4 -4
- package/dist/{chunk-74AIU53R.js → chunk-JZ4HGFWK.js} +3 -3
- package/dist/chunk-KBQJIVUB.js +33 -0
- package/dist/{chunk-QNIKRB62.js → chunk-KCM4KEZ2.js} +4 -4
- package/dist/{chunk-3QXLIZIX.js → chunk-KNGJ3CSB.js} +3 -3
- package/dist/{chunk-5YWH2ANQ.js → chunk-KNW3IUWX.js} +11 -10
- package/dist/{chunk-KZP6B6B3.js → chunk-KTWTYK5U.js} +16 -5
- package/dist/{chunk-LYXPJERB.js → chunk-L7Z6XGBU.js} +5 -5
- package/dist/{chunk-TX57TNJS.js → chunk-LLUWBQK6.js} +9 -9
- package/dist/{chunk-NC63TYNW.js → chunk-MDKVYC6R.js} +7 -7
- package/dist/{chunk-22M75A3N.js → chunk-MS6DY4CE.js} +14 -11
- package/dist/{chunk-LLPWQDF7.js → chunk-MTOTPAYZ.js} +3 -3
- package/dist/{chunk-AZ7DKRBY.js → chunk-MVF7FA4D.js} +5 -5
- package/dist/{chunk-AIGYMTCU.js → chunk-MVUNB43J.js} +3 -3
- package/dist/{chunk-UGBNYSBN.js → chunk-O24HHIQG.js} +20 -34
- package/dist/{chunk-NKG4N6HA.js → chunk-O5EHNNPS.js} +4 -4
- package/dist/{chunk-5DP7W5HX.js → chunk-OIPFTJS6.js} +3 -3
- package/dist/{chunk-DD5KJVFV.js → chunk-OXNIEIOY.js} +19 -19
- package/dist/chunk-P2BGR77C.js +344 -0
- package/dist/{chunk-CGHYXWTT.js → chunk-PFAFTLN3.js} +4 -4
- package/dist/{chunk-4RBIWI2Q.js → chunk-Q2KR7PSX.js} +3 -3
- package/dist/{chunk-7GUPNTAH.js → chunk-QSOLK2I2.js} +7 -7
- package/dist/chunk-QTWRR7IS.js +1129 -0
- package/dist/{chunk-OLLD2BZN.js → chunk-QZHAL4BL.js} +3 -3
- package/dist/{chunk-OACWA4TC.js → chunk-R25NHHYT.js} +6 -6
- package/dist/{chunk-QDKETK7D.js → chunk-S55JKMG7.js} +5 -5
- package/dist/{chunk-HV2W6HUR.js → chunk-S5LLA36K.js} +10 -10
- package/dist/{chunk-QDYE5LVT.js → chunk-SF3HCW4G.js} +45 -4
- package/dist/{chunk-KHGW72BM.js → chunk-SGMVB7HD.js} +3 -3
- package/dist/chunk-SKPKL47Y.js +5671 -0
- package/dist/{chunk-6MMBQVRO.js → chunk-TCTTZHUS.js} +9 -9
- package/dist/chunk-U5X3MLM5.js +67 -0
- package/dist/chunk-UHSGD4CD.js +364 -0
- package/dist/chunk-UJ4WEQHR.js +525 -0
- package/dist/{chunk-IEAWNA3V.js → chunk-VDFWWWLL.js} +3 -3
- package/dist/{chunk-5KSD4WKN.js → chunk-VIKV25VP.js} +5 -5
- package/dist/chunk-WJB5GWAZ.js +20 -0
- package/dist/{chunk-HHYEAFCL.js → chunk-XAQQ4LYL.js} +11 -11
- package/dist/{chunk-KJ5JUS53.js → chunk-XCFFM2C7.js} +9 -9
- package/dist/chunk-XKTD3X6Z.js +183 -0
- package/dist/{chunk-GQRSABRN.js → chunk-XWXXKEG6.js} +4 -4
- package/dist/chunk-YGFTNICV.js +110 -0
- package/dist/{chunk-T5574MXM.js → chunk-YGJL7QS7.js} +8 -8
- package/dist/{chunk-SB3DG572.js → chunk-YKPTUANT.js} +6 -6
- package/dist/{chunk-YPNL2NBD.js → chunk-YQAYAJ2T.js} +33 -11
- package/dist/chunk-YXYZW6WU.js +998 -0
- package/dist/{chunk-IQNVSQRK.js → chunk-Z6NSOC6T.js} +5 -5
- package/dist/{chunk-BBKE4W3B.js → chunk-ZAWGG4H2.js} +7 -7
- package/dist/{chunk-MFFA5MXY.js → chunk-ZF362B2X.js} +5 -5
- package/dist/{chunk-RJTVCA62.js → chunk-ZJIY642R.js} +3 -3
- package/dist/color-input.d.ts +93 -0
- package/dist/color-input.js +35 -0
- package/dist/color-picker.d.ts +268 -0
- package/dist/color-picker.js +28 -0
- package/dist/color-value-DYzChVOW.d.ts +129 -0
- package/dist/combobox.d.ts +1 -1
- package/dist/combobox.js +13 -12
- package/dist/date-calendar.d.ts +49 -0
- package/dist/date-calendar.js +12 -0
- package/dist/date-input.d.ts +1 -1
- package/dist/date-input.js +11 -10
- package/dist/date-picker.d.ts +15 -131
- package/dist/date-picker.js +25 -21
- package/dist/date-types-DrDdF6WJ.d.ts +100 -0
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +9 -9
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +8 -8
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +4 -4
- package/dist/dropzone.d.ts +3 -3
- package/dist/dropzone.js +17 -16
- package/dist/form.d.ts +15 -5
- package/dist/form.js +74 -35
- package/dist/header-navigation.d.ts +2 -2
- package/dist/header-navigation.js +19 -18
- package/dist/helper.d.ts +1 -1
- package/dist/index.d.ts +25 -11
- package/dist/index.js +90 -77
- package/dist/indicator.js +4 -4
- package/dist/inline-banner.d.ts +68 -0
- package/dist/inline-banner.js +20 -0
- package/dist/input.d.ts +1 -1
- package/dist/input.js +10 -9
- package/dist/kanban-board.d.ts +2 -2
- package/dist/kanban-board.js +14 -13
- package/dist/labels-C992bt7G.d.ts +1160 -0
- package/dist/line-chart.d.ts +2 -2
- package/dist/line-chart.js +7 -6
- package/dist/mcp.js +231 -0
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +10 -9
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +14 -13
- package/dist/{card-D56VxyAe.d.ts → panel-CUGm_Mxy.d.ts} +9 -57
- package/dist/payment-input.d.ts +3 -3
- package/dist/payment-input.js +10 -9
- package/dist/picker-draft-BPV3MUPY.d.ts +9 -0
- package/dist/pie-chart.d.ts +2 -2
- package/dist/pie-chart.js +7 -6
- package/dist/popover.d.ts +65 -4
- package/dist/popover.js +8 -8
- package/dist/progress-steps.js +4 -4
- package/dist/progress.js +3 -3
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +3 -3
- package/dist/qr-code.d.ts +227 -0
- package/dist/qr-code.js +19 -0
- package/dist/radar-chart.d.ts +2 -2
- package/dist/radar-chart.js +7 -6
- package/dist/radial-chart.d.ts +2 -2
- package/dist/radial-chart.js +7 -6
- package/dist/radio.js +8 -7
- package/dist/rich-text-editor.d.ts +624 -0
- package/dist/rich-text-editor.js +51 -0
- package/dist/rich-text-highlight.d.ts +11 -0
- package/dist/rich-text-highlight.js +65 -0
- package/dist/rich-text-sanitize.d.ts +17 -0
- package/dist/rich-text-sanitize.js +176 -0
- package/dist/select.d.ts +2 -2
- package/dist/select.js +16 -15
- package/dist/separator.js +2 -2
- package/dist/shared-CGf2D8ZX.d.ts +20 -0
- package/dist/sidebar-navigation.d.ts +73 -32
- package/dist/sidebar-navigation.js +14 -13
- package/dist/sidebar-state.d.ts +76 -0
- package/dist/sidebar-state.js +27 -0
- package/dist/skeleton.js +2 -2
- package/dist/slider.d.ts +321 -0
- package/dist/slider.js +13 -0
- package/dist/styles.css +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +2 -2
- package/dist/table.d.ts +3 -19
- package/dist/table.js +33 -32
- package/dist/tabs.js +2 -2
- package/dist/tag-input.d.ts +3 -3
- package/dist/tag-input.js +13 -12
- package/dist/tag.d.ts +1 -1
- package/dist/tag.js +4 -4
- package/dist/textarea.js +8 -7
- package/dist/theme.css +965 -0
- package/dist/theme.js +12 -11
- package/dist/toast.d.ts +1 -1
- package/dist/toast.js +12 -11
- package/dist/tooltip.js +4 -3
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +6 -6
- package/dist/{types-DR9rAEy1.d.ts → types-DYFl0CEB.d.ts} +1 -1
- package/dist/{use-uploads-KaPqDklo.d.ts → use-uploads-2E7n0PWT.d.ts} +1 -1
- package/dist/verification-code-input.js +10 -9
- package/package.json +92 -8
- package/dist/chunk-BLIZ3CL3.js +0 -49
- package/dist/labels-DPrh0se9.d.ts +0 -627
- package/dist/panel-El4oI68p.d.ts +0 -9
- package/dist/shared-BYXJPnsN.d.ts +0 -11
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";export { RichTextContent, RichTextEditor } from './chunk-SKPKL47Y.js';
|
|
2
|
+
import './chunk-BH32X25C.js';
|
|
3
|
+
import './chunk-5GBA6X6A.js';
|
|
4
|
+
import './chunk-7OFGPDYJ.js';
|
|
5
|
+
import './chunk-QTWRR7IS.js';
|
|
6
|
+
import './chunk-UHSGD4CD.js';
|
|
7
|
+
import './chunk-YQAYAJ2T.js';
|
|
8
|
+
import './chunk-KCM4KEZ2.js';
|
|
9
|
+
import './chunk-HNNNJP3A.js';
|
|
10
|
+
import './chunk-MVUNB43J.js';
|
|
11
|
+
import './chunk-EVINS473.js';
|
|
12
|
+
import './chunk-CVCS5G3E.js';
|
|
13
|
+
import './chunk-GWYDOZGQ.js';
|
|
14
|
+
import './chunk-CQGMOPLG.js';
|
|
15
|
+
import './chunk-S7NNXWIN.js';
|
|
16
|
+
import './chunk-L7Z6XGBU.js';
|
|
17
|
+
import './chunk-Q2KR7PSX.js';
|
|
18
|
+
import './chunk-SKJC2KYD.js';
|
|
19
|
+
import './chunk-VDFWWWLL.js';
|
|
20
|
+
import './chunk-4P2NBLBW.js';
|
|
21
|
+
import './chunk-5ECTNYKU.js';
|
|
22
|
+
import './chunk-7JBNLEJ7.js';
|
|
23
|
+
import './chunk-D7EE5GWU.js';
|
|
24
|
+
import './chunk-45Y2ZGNK.js';
|
|
25
|
+
import './chunk-7S2TBALK.js';
|
|
26
|
+
import './chunk-5AZKP4KZ.js';
|
|
27
|
+
import './chunk-YIHKQ63K.js';
|
|
28
|
+
import './chunk-R25NHHYT.js';
|
|
29
|
+
import './chunk-PFAFTLN3.js';
|
|
30
|
+
import './chunk-MVF7FA4D.js';
|
|
31
|
+
import './chunk-6T3QAO5K.js';
|
|
32
|
+
import './chunk-DWKILXHE.js';
|
|
33
|
+
import './chunk-QSOLK2I2.js';
|
|
34
|
+
import './chunk-ZAWGG4H2.js';
|
|
35
|
+
import './chunk-7EUAMHMU.js';
|
|
36
|
+
import './chunk-A4YPUS6C.js';
|
|
37
|
+
import './chunk-O2LG3PNI.js';
|
|
38
|
+
import './chunk-EDSK6FEH.js';
|
|
39
|
+
import './chunk-VIKV25VP.js';
|
|
40
|
+
import './chunk-GPHGPY6T.js';
|
|
41
|
+
import './chunk-52IFGFTL.js';
|
|
42
|
+
import './chunk-KTWTYK5U.js';
|
|
43
|
+
import './chunk-7LSUUEAF.js';
|
|
44
|
+
import './chunk-O4GRKO3I.js';
|
|
45
|
+
import './chunk-YGFTNICV.js';
|
|
46
|
+
import './chunk-ZSNJ6UA3.js';
|
|
47
|
+
import './chunk-ZJIY642R.js';
|
|
48
|
+
import './chunk-SF3HCW4G.js';
|
|
49
|
+
import './chunk-3ZEEGXYF.js';
|
|
50
|
+
//# sourceMappingURL=rich-text-editor.js.map
|
|
51
|
+
//# sourceMappingURL=rich-text-editor.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bake syntax highlighting into every code block of a stored document.
|
|
3
|
+
*
|
|
4
|
+
* @param html - a document as produced by `<RichTextEditor>`'s `onChange` (ideally already through
|
|
5
|
+
* `sanitizeRichText`).
|
|
6
|
+
* @returns the same document with `<span class="hljs-…">` runs inside its highlightable code blocks.
|
|
7
|
+
* Every other byte is unchanged, and a document with no code block comes back identical.
|
|
8
|
+
*/
|
|
9
|
+
declare function highlightRichText(html: string): string;
|
|
10
|
+
|
|
11
|
+
export { highlightRichText };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import bash from 'highlight.js/lib/languages/bash';
|
|
2
|
+
import css from 'highlight.js/lib/languages/css';
|
|
3
|
+
import javascript from 'highlight.js/lib/languages/javascript';
|
|
4
|
+
import json from 'highlight.js/lib/languages/json';
|
|
5
|
+
import markdown from 'highlight.js/lib/languages/markdown';
|
|
6
|
+
import python from 'highlight.js/lib/languages/python';
|
|
7
|
+
import sql from 'highlight.js/lib/languages/sql';
|
|
8
|
+
import typescript from 'highlight.js/lib/languages/typescript';
|
|
9
|
+
import xml from 'highlight.js/lib/languages/xml';
|
|
10
|
+
import { createLowlight } from 'lowlight';
|
|
11
|
+
|
|
12
|
+
// src/components/rich-text-editor/highlighter.ts
|
|
13
|
+
var lowlight = createLowlight({
|
|
14
|
+
bash,
|
|
15
|
+
css,
|
|
16
|
+
javascript,
|
|
17
|
+
json,
|
|
18
|
+
markdown,
|
|
19
|
+
python,
|
|
20
|
+
sql,
|
|
21
|
+
typescript,
|
|
22
|
+
xml
|
|
23
|
+
});
|
|
24
|
+
var codeHighlighter = {
|
|
25
|
+
...lowlight,
|
|
26
|
+
/** No guessing — see the block above. An empty root is "highlight nothing", which is what both
|
|
27
|
+
* `plain` and an unrecognised `language-*` must render as. */
|
|
28
|
+
highlightAuto: () => ({ type: "root", children: [] })
|
|
29
|
+
};
|
|
30
|
+
function flattenHighlight(nodes, inherited = []) {
|
|
31
|
+
return nodes.flatMap((node) => {
|
|
32
|
+
const element = node;
|
|
33
|
+
const classes = [...inherited, ...element.properties?.className ?? []];
|
|
34
|
+
if (element.children) return flattenHighlight(element.children, classes);
|
|
35
|
+
return [{ text: element.value ?? "", classes }];
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function highlightRuns(language, code) {
|
|
39
|
+
if (!codeHighlighter.registered(language)) return null;
|
|
40
|
+
const tree = codeHighlighter.highlight(language, code);
|
|
41
|
+
return flattenHighlight(tree.children ?? []);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/components/rich-text-editor/bake.ts
|
|
45
|
+
var CODE_BLOCK = /<pre><code class="language-([\w-]+)">([\S\s]*?)<\/code><\/pre>/g;
|
|
46
|
+
var ALREADY_BAKED = /<span class="hljs-/;
|
|
47
|
+
function decodeText(html) {
|
|
48
|
+
return html.replaceAll("<", "<").replaceAll(">", ">").replaceAll(""", '"').replaceAll("'", "'").replaceAll("&", "&");
|
|
49
|
+
}
|
|
50
|
+
function encodeText(text) {
|
|
51
|
+
return text.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
52
|
+
}
|
|
53
|
+
function highlightRichText(html) {
|
|
54
|
+
return html.replaceAll(CODE_BLOCK, (whole, language, body) => {
|
|
55
|
+
if (ALREADY_BAKED.test(body)) return whole;
|
|
56
|
+
const runs = highlightRuns(language, decodeText(body));
|
|
57
|
+
if (runs === null) return whole;
|
|
58
|
+
const painted = runs.map((run) => run.classes.length > 0 ? `<span class="${run.classes.join(" ")}">${encodeText(run.text)}</span>` : encodeText(run.text)).join("");
|
|
59
|
+
return `<pre><code class="language-${language}">${painted}</code></pre>`;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { highlightRichText };
|
|
64
|
+
//# sourceMappingURL=rich-text-highlight.js.map
|
|
65
|
+
//# sourceMappingURL=rich-text-highlight.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip anything a stored `RichTextEditor` document cannot legitimately contain.
|
|
3
|
+
*
|
|
4
|
+
* Server-safe: no DOM, no React, no `@tiptap/*` — which is why it ships from its own entry
|
|
5
|
+
* (`jenosize-ui/rich-text-sanitize`) rather than from the component's. Importing it must not drag the
|
|
6
|
+
* editor into a server bundle.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // in the CMS, on write — once per document
|
|
11
|
+
* import { sanitizeRichText } from "jenosize-ui/rich-text-sanitize";
|
|
12
|
+
* await db.posts.update({ body: sanitizeRichText(submitted) });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare function sanitizeRichText(html: string): string;
|
|
16
|
+
|
|
17
|
+
export { sanitizeRichText };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import sanitizeHtml from 'sanitize-html';
|
|
2
|
+
|
|
3
|
+
// src/components/rich-text-editor/sanitize.ts
|
|
4
|
+
var ALLOWED_TAGS = [
|
|
5
|
+
// StarterKit — structure
|
|
6
|
+
"p",
|
|
7
|
+
"h1",
|
|
8
|
+
"h2",
|
|
9
|
+
"h3",
|
|
10
|
+
"h4",
|
|
11
|
+
"h5",
|
|
12
|
+
"h6",
|
|
13
|
+
"ul",
|
|
14
|
+
"ol",
|
|
15
|
+
"li",
|
|
16
|
+
"blockquote",
|
|
17
|
+
"pre",
|
|
18
|
+
"hr",
|
|
19
|
+
"br",
|
|
20
|
+
// StarterKit — marks
|
|
21
|
+
"strong",
|
|
22
|
+
"b",
|
|
23
|
+
"em",
|
|
24
|
+
"i",
|
|
25
|
+
"s",
|
|
26
|
+
"del",
|
|
27
|
+
"u",
|
|
28
|
+
"code",
|
|
29
|
+
"a",
|
|
30
|
+
// phase 9 — the highlight mark. The COLOUR mark is a `span`, already present below.
|
|
31
|
+
"mark",
|
|
32
|
+
// phase 3 — Tier 2
|
|
33
|
+
"sup",
|
|
34
|
+
"sub",
|
|
35
|
+
"img",
|
|
36
|
+
"table",
|
|
37
|
+
"colgroup",
|
|
38
|
+
"col",
|
|
39
|
+
"thead",
|
|
40
|
+
"tbody",
|
|
41
|
+
"tr",
|
|
42
|
+
"th",
|
|
43
|
+
"td",
|
|
44
|
+
// task list + mention both render as attribute-marked generic elements
|
|
45
|
+
"div",
|
|
46
|
+
"label",
|
|
47
|
+
"input",
|
|
48
|
+
"span"
|
|
49
|
+
];
|
|
50
|
+
var ALLOWED_ATTRIBUTES = {
|
|
51
|
+
a: ["href", "target", "rel"],
|
|
52
|
+
// **`data-align` / `data-width`, NOT `width`/`height`, and the swap is deliberate.** The schema
|
|
53
|
+
// declares those two `data-*` attributes and nothing else (`extensions.ts`), so a presentational
|
|
54
|
+
// `width="640"` is dropped the moment a document is opened in the editor — allowing it here would
|
|
55
|
+
// mean a stored document that renders one way through `<RichTextContent>` and another way after a
|
|
56
|
+
// round-trip. The values are then bounded by the STYLESHEET rather than by this list: `jz-prose`
|
|
57
|
+
// paints seventeen `data-width` steps and two alignments, so anything else is inert.
|
|
58
|
+
img: ["src", "alt", "title", "data-align", "data-width"],
|
|
59
|
+
// `textAlign` is configured for `heading` and `paragraph` only, and it stores as an inline style —
|
|
60
|
+
// which is why `allowedStyles` below exists and is limited to that one property.
|
|
61
|
+
p: ["style"],
|
|
62
|
+
h1: ["style"],
|
|
63
|
+
h2: ["style"],
|
|
64
|
+
h3: ["style"],
|
|
65
|
+
h4: ["style"],
|
|
66
|
+
h5: ["style"],
|
|
67
|
+
h6: ["style"],
|
|
68
|
+
// The table's own treatment — a closed `data-*` set the STYLESHEET is the only interpreter of,
|
|
69
|
+
// exactly as the divider's texture is. An out-of-set value paints nothing and falls back to the
|
|
70
|
+
// hairline grid, so the allowlist bounds the ATTRIBUTE and `jz-prose` bounds the values.
|
|
71
|
+
table: ["data-treatment"],
|
|
72
|
+
// tables: spans are content, and `colwidth` is what makes a resized column round-trip.
|
|
73
|
+
//
|
|
74
|
+
// `data-valign` is the cell's vertical alignment, on the same closed-set terms as `data-treatment`.
|
|
75
|
+
// `class` + `style` are the cell FILL and nothing else: it stores in the same `jz-cell` cascade a
|
|
76
|
+
// coloured run stores in, so there is ONE spelling of a stored colour in the document rather than a
|
|
77
|
+
// second `data-fill` that could disagree with it. `allowedClasses` and `allowedStyles` below are
|
|
78
|
+
// what bound both.
|
|
79
|
+
//
|
|
80
|
+
// Allowing `style` here also lets a cell's own `text-align` survive, which is a fix rather than a
|
|
81
|
+
// side effect: `@tiptap/extension-table` declares an `align` attribute on both cell types (it is
|
|
82
|
+
// how a pasted markdown table carries its column alignment) and renders it as an inline style — so
|
|
83
|
+
// before this line a pasted alignment rendered in the editor and vanished the first time the
|
|
84
|
+
// document was written. The `*` rule in `allowedStyles` is what bounds it to four values.
|
|
85
|
+
th: ["colspan", "rowspan", "colwidth", "data-valign", "class", "style"],
|
|
86
|
+
td: ["colspan", "rowspan", "colwidth", "data-valign", "class", "style"],
|
|
87
|
+
col: ["style", "width"],
|
|
88
|
+
// task list: the node writes `data-type` on the list and `data-checked` on each item
|
|
89
|
+
ul: ["data-type"],
|
|
90
|
+
li: ["data-checked", "data-type"],
|
|
91
|
+
input: ["type", "checked", "disabled"],
|
|
92
|
+
// mention: the marker attribute plus the two the node stores. `data-mention-label` is what makes a
|
|
93
|
+
// name survive without a lookup, so dropping it would silently corrupt the document.
|
|
94
|
+
// code blocks store their language as a class, which is what lets a consuming site highlight them
|
|
95
|
+
pre: ["class"],
|
|
96
|
+
code: ["class"],
|
|
97
|
+
// phase 9 — the colour marks store their NAME as a class, so `class` is the document's own
|
|
98
|
+
// vocabulary here and not paint. `allowedClasses` below is what bounds the values.
|
|
99
|
+
// `style` is here for the 2026-08-16 hybrid and for nothing else: a CUSTOM colour stores its value
|
|
100
|
+
// on `--jz-color` / `--jz-mark`, which `allowedStyles` below narrows to two properties and a
|
|
101
|
+
// grammar. Everything a `style` attribute is normally dangerous for — `position`, `background:
|
|
102
|
+
// url(…)`, a second `color` beating the sheet — is unreachable, because the property allowlist is
|
|
103
|
+
// an allowlist of CUSTOM properties only.
|
|
104
|
+
span: ["data-mention", "data-mention-id", "data-mention-label", "class", "style"],
|
|
105
|
+
mark: ["class", "style"],
|
|
106
|
+
// The divider's layout. `data-texture` / `data-weight` are closed sets the STYLESHEET bounds — an
|
|
107
|
+
// out-of-set value paints nothing and falls back to the resting rule — exactly as `img`'s two are.
|
|
108
|
+
// `class` + `style` are here for the colour, and for nothing else: a rule stores its colour in the
|
|
109
|
+
// same `jz-color` cascade a coloured run does, so there is one spelling of a stored colour in the
|
|
110
|
+
// document rather than a second `data-color` that could disagree with it. `allowedClasses` below
|
|
111
|
+
// is what bounds the class, and it deliberately refuses `--gradient` — see `hr.ts`.
|
|
112
|
+
hr: ["data-texture", "data-weight", "class", "style"]
|
|
113
|
+
};
|
|
114
|
+
var CSS_COLOR = /^#[\da-f]{3,8}$|^(rgb|hsl)a?\([\d\s.,%/-]+\)$/i;
|
|
115
|
+
var CSS_GRADIENT = /^(?!.*url\()(linear|radial|conic)-gradient\([\w\s.,%()#/-]*\)$/i;
|
|
116
|
+
var ALLOWED_STYLES = {
|
|
117
|
+
"*": { "text-align": [/^(left|right|center|justify)$/] },
|
|
118
|
+
col: { width: [/^\d+(\.\d+)?(px|%)$/] },
|
|
119
|
+
span: { "--jz-color": [CSS_COLOR], "--jz-color-gradient": [CSS_GRADIENT] },
|
|
120
|
+
mark: { "--jz-mark": [CSS_COLOR], "--jz-mark-gradient": [CSS_GRADIENT] },
|
|
121
|
+
// A custom-coloured divider — the solid half only. There is no `--jz-color-gradient` counterpart
|
|
122
|
+
// and there must not be: a gradient paints through `background-image`, which on a rule is where the
|
|
123
|
+
// TEXTURE lives, so a stored one could never render. Refused here rather than allowed and ignored.
|
|
124
|
+
hr: { "--jz-color": [CSS_COLOR] },
|
|
125
|
+
// A custom-filled cell. BOTH halves, unlike the rule above: a cell has no texture competing for
|
|
126
|
+
// `background-image`, so a gradient fill is paintable and is therefore storable.
|
|
127
|
+
td: { "--jz-cell": [CSS_COLOR], "--jz-cell-gradient": [CSS_GRADIENT] },
|
|
128
|
+
th: { "--jz-cell": [CSS_COLOR], "--jz-cell-gradient": [CSS_GRADIENT] }
|
|
129
|
+
};
|
|
130
|
+
var OPTIONS = {
|
|
131
|
+
allowedTags: [...ALLOWED_TAGS],
|
|
132
|
+
allowedAttributes: ALLOWED_ATTRIBUTES,
|
|
133
|
+
allowedStyles: ALLOWED_STYLES,
|
|
134
|
+
allowedClasses: {
|
|
135
|
+
// Only the code-block language class, and only in the shape the editor writes it. An open `class`
|
|
136
|
+
// allowlist would let a document paint itself with the host page's own utility classes.
|
|
137
|
+
pre: [/^language-[\w-]+$/],
|
|
138
|
+
code: [/^language-[\w-]+$/],
|
|
139
|
+
// phase 9 — `jz-color jz-color--blue`, and nothing else. The MODIFIER is what a stored run means,
|
|
140
|
+
// so both halves have to survive; the pattern is what stops a document painting itself with the
|
|
141
|
+
// host page's own utility classes, which is why `class` is not simply allowed on a `span`.
|
|
142
|
+
span: [/^jz-color(--[A-Za-z][\w-]*)?$/],
|
|
143
|
+
mark: [/^jz-mark(--[A-Za-z][\w-]*)?$/],
|
|
144
|
+
// A divider borrows the same cascade, minus one member: the negative lookahead is what refuses
|
|
145
|
+
// `jz-color--gradient`, which `hr.ts` also refuses at parse time. Two boundaries for one rule,
|
|
146
|
+
// deliberately — a document reaches `<RichTextContent>` without ever passing through the editor.
|
|
147
|
+
hr: [/^jz-color(--(?!gradient$)[A-Za-z][\w-]*)?$/],
|
|
148
|
+
// The cell fill's own base-plus-modifier pair, on the same terms as `span`/`mark` — and with no
|
|
149
|
+
// gradient refusal, because a cell can paint one.
|
|
150
|
+
td: [/^jz-cell(--[A-Za-z][\w-]*)?$/],
|
|
151
|
+
th: [/^jz-cell(--[A-Za-z][\w-]*)?$/]
|
|
152
|
+
},
|
|
153
|
+
allowedSchemes: ["http", "https", "mailto", "tel"],
|
|
154
|
+
// Images are the one place a data URL is tempting; `Image.configure({ allowBase64: false })` already
|
|
155
|
+
// refuses them on the way in, and repeating that here keeps a document from a different authoring
|
|
156
|
+
// tool from smuggling one past.
|
|
157
|
+
allowedSchemesByTag: { img: ["http", "https"] },
|
|
158
|
+
// Drop the CONTENT of a disallowed tag as well as the tag, for the tags where the content is not
|
|
159
|
+
// prose. The default keeps inner text, which is right for `<form><p>x</p></form>` (the schema does
|
|
160
|
+
// the same) and wrong for a `<script>` body, which would otherwise be emitted as visible text.
|
|
161
|
+
nonTextTags: ["script", "style", "textarea", "option", "noscript"],
|
|
162
|
+
transformTags: {
|
|
163
|
+
// Whatever `rel` a document arrives with, ours is the one that ships — see the note above.
|
|
164
|
+
a: (tagName, attribs) => ({
|
|
165
|
+
tagName,
|
|
166
|
+
attribs: attribs.target === "_blank" ? { ...attribs, rel: "noopener noreferrer nofollow" } : attribs
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
function sanitizeRichText(html) {
|
|
171
|
+
return sanitizeHtml(html, OPTIONS);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export { sanitizeRichText };
|
|
175
|
+
//# sourceMappingURL=rich-text-sanitize.js.map
|
|
176
|
+
//# sourceMappingURL=rich-text-sanitize.js.map
|
package/dist/select.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { S as Select, a as SelectAction, b as SelectDisplay, c as SelectIndicator, d as SelectIndicatorAlign, e as SelectOption, f as SelectProps, g as SelectRootProps, h as SelectSize } from './Select-
|
|
1
|
+
export { S as Select, a as SelectAction, b as SelectDisplay, c as SelectIndicator, d as SelectIndicatorAlign, e as SelectOption, f as SelectProps, g as SelectRootProps, h as SelectSize } from './Select-CXOAMlk7.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { C as ControlSize } from './control-size-CaxQhkKh.js';
|
|
4
4
|
import '@base-ui/react/select';
|
|
5
5
|
import './multi-value-CJb_tnvi.js';
|
|
6
6
|
import './options-CPEIgjtd.js';
|
|
7
|
-
import './labels-
|
|
7
|
+
import './labels-C992bt7G.js';
|
|
8
8
|
|
|
9
9
|
type NativeSelectSize = ControlSize;
|
|
10
10
|
/** A native `<option>` row. The native element can only render plain text, so
|
package/dist/select.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
"use client";export { Select } from './chunk-
|
|
2
|
-
import './chunk-7S2TBALK.js';
|
|
3
|
-
export { NativeSelect } from './chunk-I6WMNXC7.js';
|
|
1
|
+
"use client";export { Select } from './chunk-CVCS5G3E.js';
|
|
4
2
|
import './chunk-GWYDOZGQ.js';
|
|
5
|
-
|
|
3
|
+
export { NativeSelect } from './chunk-CQGMOPLG.js';
|
|
6
4
|
import './chunk-S7NNXWIN.js';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-4P2NBLBW.js';
|
|
5
|
+
import './chunk-L7Z6XGBU.js';
|
|
6
|
+
import './chunk-Q2KR7PSX.js';
|
|
10
7
|
import './chunk-SKJC2KYD.js';
|
|
8
|
+
import './chunk-VDFWWWLL.js';
|
|
9
|
+
import './chunk-4P2NBLBW.js';
|
|
11
10
|
import './chunk-7JBNLEJ7.js';
|
|
11
|
+
import './chunk-7S2TBALK.js';
|
|
12
12
|
import './chunk-DWKILXHE.js';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-A4YPUS6C.js';
|
|
14
14
|
import './chunk-O2LG3PNI.js';
|
|
15
15
|
import './chunk-EDSK6FEH.js';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
16
|
+
import './chunk-VIKV25VP.js';
|
|
17
|
+
import './chunk-GPHGPY6T.js';
|
|
18
18
|
import './chunk-52IFGFTL.js';
|
|
19
|
-
import './chunk-
|
|
20
|
-
import './chunk-
|
|
19
|
+
import './chunk-KTWTYK5U.js';
|
|
20
|
+
import './chunk-7LSUUEAF.js';
|
|
21
21
|
import './chunk-O4GRKO3I.js';
|
|
22
|
-
import './chunk-
|
|
22
|
+
import './chunk-YGFTNICV.js';
|
|
23
23
|
import './chunk-ZSNJ6UA3.js';
|
|
24
|
-
import './chunk-
|
|
25
|
-
import './chunk-
|
|
24
|
+
import './chunk-ZJIY642R.js';
|
|
25
|
+
import './chunk-SF3HCW4G.js';
|
|
26
|
+
import './chunk-3ZEEGXYF.js';
|
|
26
27
|
//# sourceMappingURL=select.js.map
|
|
27
28
|
//# sourceMappingURL=select.js.map
|
package/dist/separator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use client";export { Separator } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
"use client";export { Separator } from './chunk-7OFGPDYJ.js';
|
|
2
|
+
import './chunk-EVINS473.js';
|
|
3
3
|
import './chunk-ZSNJ6UA3.js';
|
|
4
4
|
//# sourceMappingURL=separator.js.map
|
|
5
5
|
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Popover } from '@base-ui/react/popover';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type PopoverSize = "sm" | "md" | "lg" | "panel";
|
|
5
|
+
/** A footer is a plain node, or a render-fn given a `close()` helper — the latter lets
|
|
6
|
+
* footer buttons dismiss the popover in BOTH controlled and uncontrolled (`trigger`)
|
|
7
|
+
* modes without a `Popover.Close` part. Same contract as `DialogFooter`. */
|
|
8
|
+
type PopoverFooter = React.ReactNode | ((close: () => void) => React.ReactNode);
|
|
9
|
+
type PopoverSide = "top" | "right" | "bottom" | "left";
|
|
10
|
+
type PopoverAlign = "start" | "center" | "end";
|
|
11
|
+
/**
|
|
12
|
+
* What a trigger-less popover positions against.
|
|
13
|
+
*
|
|
14
|
+
* Derived from the primitive rather than re-typed, so an element, a ref, a getter and a virtual
|
|
15
|
+
* element (a `{ getBoundingClientRect }` object — how you anchor to a text range) all stay legal
|
|
16
|
+
* without this file owning that list.
|
|
17
|
+
*/
|
|
18
|
+
type PopoverAnchor = NonNullable<React.ComponentProps<typeof Popover.Positioner>["anchor"]>;
|
|
19
|
+
|
|
20
|
+
export type { PopoverAlign as P, PopoverAnchor as a, PopoverFooter as b, PopoverSide as c, PopoverSize as d };
|
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { b as NavItem, c as NavLink } from './nav-CKKqjBs6.js';
|
|
3
3
|
export { N as NavActionReveal, a as NavGroup, d as NavMatch, e as NavRowAction, f as NavSeparator } from './nav-CKKqjBs6.js';
|
|
4
|
-
import {
|
|
4
|
+
import { m as SidebarNavigationLabels } from './labels-C992bt7G.js';
|
|
5
5
|
import './rule-BqzaIwJy.js';
|
|
6
6
|
import './dropdown-menu.js';
|
|
7
|
-
import './panel-
|
|
7
|
+
import './panel-CUGm_Mxy.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The rail's persisted state, as read on the server (or before the first client render).
|
|
11
|
+
*
|
|
12
|
+
* **Produced by {@link readSidebarState} and nothing else, and that is the point.** The key travels
|
|
13
|
+
* INSIDE the value, so the name the server reads and the name the client writes back cannot drift
|
|
14
|
+
* apart — a hand-written `{ key, collapsed }` is a type error, so there is no second place to spell
|
|
15
|
+
* `"app-sidebar"` and get it wrong.
|
|
16
|
+
*/
|
|
17
|
+
interface SidebarState {
|
|
18
|
+
/** The cookie name this was read from, and the one the provider writes back to. */
|
|
19
|
+
readonly key: string;
|
|
20
|
+
/** Whether the rail should render as the icon rail. */
|
|
21
|
+
readonly collapsed: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Brand. Never present at runtime, never written by a caller.
|
|
24
|
+
*
|
|
25
|
+
* A STRING key, not the `declare const BRAND: unique symbol` this shipped as for an hour, because
|
|
26
|
+
* that brand does not survive the package boundary: tsup emits one `.d.ts` per entry, each with
|
|
27
|
+
* its OWN `unique symbol` declaration, and TypeScript treats two of those as different types. So
|
|
28
|
+
* the `SidebarState` returned by `jenosize-ui/sidebar-state` was not assignable to the `state` prop
|
|
29
|
+
* declared in `jenosize-ui/sidebar-navigation` — the one call this whole design prescribes, broken
|
|
30
|
+
* for every consumer and invisible in-repo, where `pnpm typecheck` resolves both from this file.
|
|
31
|
+
* A structural marker is identical in both copies. It buys slightly less (a caller CAN type this
|
|
32
|
+
* key out) in exchange for working at all, and typing it out is sabotage rather than a slip.
|
|
33
|
+
*/
|
|
34
|
+
readonly "~jenosize.sidebarState": true;
|
|
35
|
+
}
|
|
8
36
|
|
|
9
37
|
interface SidebarContextValue {
|
|
10
38
|
/** Whether the sidebar is showing its icon rail. */
|
|
11
39
|
collapsed: boolean;
|
|
12
|
-
/** Set the state directly. Persists when the provider
|
|
40
|
+
/** Set the state directly. Persists when the provider was given a `state`. */
|
|
13
41
|
setCollapsed: (collapsed: boolean) => void;
|
|
14
|
-
/** Flip the state. Persists when the provider
|
|
42
|
+
/** Flip the state. Persists when the provider was given a `state`. */
|
|
15
43
|
toggle: () => void;
|
|
16
44
|
}
|
|
17
45
|
/**
|
|
@@ -24,46 +52,59 @@ interface SidebarContextValue {
|
|
|
24
52
|
declare function useSidebar(): SidebarContextValue;
|
|
25
53
|
/** Viewport width under which the sidebar collapses itself. Tailwind's own steps. */
|
|
26
54
|
type SidebarBreakpoint = "sm" | "md" | "lg" | "xl";
|
|
27
|
-
|
|
55
|
+
type SidebarPersistence = {
|
|
28
56
|
/**
|
|
29
|
-
*
|
|
57
|
+
* The remembered choice, from `readSidebarState()` — **the only way to persist the rail, and
|
|
58
|
+
* the only thing that gives a server-rendered app a correct first paint.**
|
|
59
|
+
*
|
|
60
|
+
* ```tsx
|
|
61
|
+
* import { readSidebarState } from "jenosize-ui/sidebar-state";
|
|
30
62
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
63
|
+
* // server component — the cookie is readable where the HTML is made
|
|
64
|
+
* <SidebarProvider state={readSidebarState(await cookies(), { key: "app-sidebar" })}>
|
|
65
|
+
*
|
|
66
|
+
* // client-only app — same call, synchronously, before the first render
|
|
67
|
+
* <SidebarProvider state={readSidebarState(document.cookie, { key: "app-sidebar" })}>
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* It is a cookie and not `localStorage` because a server cannot read `localStorage`: a
|
|
71
|
+
* preference kept there can only be applied AFTER hydration, i.e. after the browser has
|
|
72
|
+
* already painted a rail the user did not ask for. The key travels inside this value, so the
|
|
73
|
+
* provider writes back to the same name it was read from — there is no second place to spell
|
|
74
|
+
* it.
|
|
34
75
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
76
|
+
state: SidebarState;
|
|
77
|
+
defaultCollapsed?: never;
|
|
78
|
+
} | {
|
|
79
|
+
state?: never;
|
|
80
|
+
/** Where an UNPERSISTED rail starts. To remember the choice, pass `state` instead. @default false */
|
|
38
81
|
defaultCollapsed?: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
82
|
+
};
|
|
83
|
+
type SidebarProviderProps = SidebarPersistence & {
|
|
84
|
+
/** Controlled collapse state — the app owns it entirely. Omit to let the provider own it. */
|
|
85
|
+
collapsed?: boolean;
|
|
86
|
+
/** Fires on every change, including the responsive and keyboard ones. */
|
|
41
87
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
42
|
-
/**
|
|
43
|
-
* `localStorage` key to remember the user's choice across reloads. Omit for no persistence.
|
|
44
|
-
*
|
|
45
|
-
* **Client-only, by nature.** The server cannot read it, so it is applied in a layout effect
|
|
46
|
-
* (before paint, after hydration) rather than during the first render — which keeps hydration
|
|
47
|
-
* clean at the cost of the server's HTML always showing `defaultCollapsed`. For a correct first
|
|
48
|
-
* byte, use {@link SidebarProviderProps.collapsed} with a cookie instead.
|
|
49
|
-
*/
|
|
50
|
-
storageKey?: string;
|
|
51
88
|
/** Bind ⌘B (⌃B off macOS) to the toggle. @default true */
|
|
52
89
|
shortcut?: boolean;
|
|
53
90
|
/**
|
|
54
|
-
* Collapse automatically below this viewport width. Omit to never auto-collapse.
|
|
55
|
-
* the same reason as `storageKey` — the server cannot measure a viewport — and applied the same
|
|
56
|
-
* way, before paint.
|
|
91
|
+
* Collapse automatically below this viewport width. Omit to never auto-collapse.
|
|
57
92
|
*
|
|
58
|
-
* **
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
93
|
+
* **Client-only, and the ONE thing here that a cookie cannot fix.** A server cannot measure a
|
|
94
|
+
* viewport, so between this breakpoint and the next one up, a visitor whose stored choice is
|
|
95
|
+
* "expanded" still sees the rail corrected just after hydration. A width cookie does not help —
|
|
96
|
+
* it is stale on a first visit and on every new device. Everything ABOVE the breakpoint is exact,
|
|
97
|
+
* because that is where `state` decides.
|
|
98
|
+
*
|
|
99
|
+
* **Composes with `state`.** While the viewport is narrower than the breakpoint this wins: there
|
|
100
|
+
* is no room for a full rail, whatever was chosen on a desktop. Above it the rule has no opinion
|
|
101
|
+
* at all, so the stored choice stands — and crossing back UP hands back exactly what the narrow
|
|
102
|
+
* viewport took (the rail it collapsed), never more: a rail the user chose themself is left
|
|
62
103
|
* collapsed, because that is their preference rather than a leftover.
|
|
63
104
|
*/
|
|
64
105
|
collapseBelow?: SidebarBreakpoint;
|
|
65
106
|
children?: React.ReactNode;
|
|
66
|
-
}
|
|
107
|
+
};
|
|
67
108
|
/**
|
|
68
109
|
* Owns collapse state for every `<SidebarNavigation>` and `<SidebarTrigger>` beneath it,
|
|
69
110
|
* with optional persistence, a ⌘B shortcut, and responsive auto-collapse.
|
|
@@ -202,4 +243,4 @@ declare namespace SidebarNavigation {
|
|
|
202
243
|
var displayName: string;
|
|
203
244
|
}
|
|
204
245
|
|
|
205
|
-
export { NavItem, NavLink, type SidebarBreakpoint, type SidebarContextValue, SidebarNavigation, type SidebarNavigationAccent, type SidebarNavigationBrand, type SidebarNavigationGuide, type SidebarNavigationProps, type SidebarNavigationSlot, SidebarProvider, type SidebarProviderProps, SidebarTrigger, type SidebarTriggerProps, useSidebar };
|
|
246
|
+
export { NavItem, NavLink, type SidebarBreakpoint, type SidebarContextValue, SidebarNavigation, type SidebarNavigationAccent, type SidebarNavigationBrand, type SidebarNavigationGuide, type SidebarNavigationProps, type SidebarNavigationSlot, SidebarProvider, type SidebarProviderProps, type SidebarState, SidebarTrigger, type SidebarTriggerProps, useSidebar };
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
"use client";export { SidebarNavigation, SidebarProvider, SidebarTrigger, useSidebar } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
"use client";export { SidebarNavigation, SidebarProvider, SidebarTrigger, useSidebar } from './chunk-O24HHIQG.js';
|
|
2
|
+
import './chunk-MTOTPAYZ.js';
|
|
3
|
+
import './chunk-5GBA6X6A.js';
|
|
4
|
+
import './chunk-7OFGPDYJ.js';
|
|
5
|
+
import './chunk-HNNNJP3A.js';
|
|
6
|
+
import './chunk-EVINS473.js';
|
|
5
7
|
import './chunk-GWYDOZGQ.js';
|
|
6
8
|
import './chunk-SKJC2KYD.js';
|
|
7
9
|
import './chunk-45Y2ZGNK.js';
|
|
8
|
-
import './chunk-7VLYQR4D.js';
|
|
9
|
-
import './chunk-LCG34A5T.js';
|
|
10
10
|
import './chunk-5AZKP4KZ.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
11
|
+
import './chunk-MVF7FA4D.js';
|
|
12
|
+
import './chunk-6T3QAO5K.js';
|
|
13
13
|
import './chunk-O2LG3PNI.js';
|
|
14
14
|
import './chunk-EDSK6FEH.js';
|
|
15
15
|
import './chunk-52IFGFTL.js';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
16
|
+
import './chunk-KTWTYK5U.js';
|
|
17
|
+
import './chunk-7LSUUEAF.js';
|
|
18
18
|
import './chunk-O4GRKO3I.js';
|
|
19
|
-
import './chunk-
|
|
19
|
+
import './chunk-YGFTNICV.js';
|
|
20
20
|
import './chunk-ZSNJ6UA3.js';
|
|
21
|
-
import './chunk-
|
|
22
|
-
import './chunk-
|
|
21
|
+
import './chunk-ZJIY642R.js';
|
|
22
|
+
import './chunk-SF3HCW4G.js';
|
|
23
|
+
import './chunk-3ZEEGXYF.js';
|
|
23
24
|
//# sourceMappingURL=sidebar-navigation.js.map
|
|
24
25
|
//# sourceMappingURL=sidebar-navigation.js.map
|