@devalok/shilp-sutra 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/badge-group.js +123 -172
- package/dist/_chunks/document-preview.js +92 -0
- package/dist/_chunks/file-preview.js +511 -0
- package/dist/_chunks/image-preview.js +90 -0
- package/dist/_chunks/primitives.js +109 -109
- package/dist/_chunks/stat-row.js +144 -124
- package/dist/_chunks/use-calendar.js +558 -490
- package/dist/ai/block-renderer.d.ts +2 -1
- package/dist/ai/block-renderer.d.ts.map +1 -1
- package/dist/ai/block-renderer.js +30 -29
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/divider.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/info.d.ts.map +1 -1
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/blocks/stat-row.d.ts.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts +18 -0
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +126 -125
- package/dist/ai/conversation.d.ts +13 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +78 -78
- package/dist/ai/types.d.ts +0 -1
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/types.js +0 -1
- package/dist/composed/bulk-action-bar.d.ts +6 -4
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +102 -58
- package/dist/composed/command-palette.d.ts +9 -0
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +68 -68
- package/dist/composed/confirm-dialog.d.ts +1 -1
- package/dist/composed/confirm-dialog.d.ts.map +1 -1
- package/dist/composed/confirm-dialog.js +10 -10
- package/dist/composed/date-picker/date-picker.d.ts +11 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +39 -36
- package/dist/composed/emoji-picker.d.ts +6 -0
- package/dist/composed/emoji-picker.d.ts.map +1 -1
- package/dist/composed/emoji-picker.js +22 -20
- package/dist/composed/error-boundary.d.ts +21 -1
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +47 -32
- package/dist/composed/file-preview/audio-preview.d.ts +7 -0
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/document-preview.d.ts +7 -0
- package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/embed-preview.d.ts +7 -0
- package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/image-preview.d.ts +7 -0
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/shared.d.ts +20 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -0
- package/dist/composed/file-preview/video-preview.d.ts +6 -0
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +10 -662
- package/dist/composed/filter-bar.d.ts +10 -2
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +42 -43
- package/dist/composed/form-section.d.ts +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +22 -21
- package/dist/composed/index.d.ts +2 -2
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +58 -57
- package/dist/composed/inline-edit.d.ts +1 -1
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +33 -32
- package/dist/composed/markdown-viewer.d.ts +1 -1
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +60 -59
- package/dist/composed/master-detail.d.ts +11 -7
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +123 -84
- package/dist/composed/responsive-overlay.d.ts +8 -0
- package/dist/composed/responsive-overlay.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.d.ts +11 -3
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +21 -20
- package/dist/composed/schedule-view.d.ts +9 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -4
- package/dist/hooks/use-touch-device.d.ts +12 -0
- package/dist/hooks/use-touch-device.d.ts.map +1 -0
- package/dist/hooks/use-touch-device.js +13 -0
- package/dist/hooks/use-viewport-height.d.ts +11 -0
- package/dist/hooks/use-viewport-height.d.ts.map +1 -0
- package/dist/hooks/use-viewport-height.js +16 -0
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +72 -63
- package/dist/shell/command-registry.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +77 -77
- package/dist/shell/top-bar.d.ts +2 -2
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +61 -60
- package/dist/tailwind/index.cjs +51 -7
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +51 -7
- package/dist/tokens/primitives.css +3 -1
- package/dist/tokens/semantic.css +16 -13
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +38 -39
- package/dist/ui/badge.d.ts +104 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +8 -7
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +54 -74
- package/dist/ui/card.js +24 -24
- package/dist/ui/charts/area-chart.d.ts +2 -0
- package/dist/ui/charts/area-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +2 -0
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -0
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/index.js +583 -577
- package/dist/ui/charts/line-chart.d.ts +2 -0
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/pie-chart.d.ts +2 -0
- package/dist/ui/charts/pie-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts +2 -0
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts +2 -0
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +36 -27
- package/dist/ui/color-input.js +5 -5
- package/dist/ui/combobox.d.ts +6 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/data-table-body.d.ts +12 -0
- package/dist/ui/data-table-body.d.ts.map +1 -0
- package/dist/ui/data-table-body.js +219 -0
- package/dist/ui/data-table-bulk-actions.d.ts +19 -0
- package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
- package/dist/ui/data-table-bulk-actions.js +61 -0
- package/dist/ui/data-table-card.d.ts +9 -0
- package/dist/ui/data-table-card.d.ts.map +1 -0
- package/dist/ui/data-table-card.js +73 -0
- package/dist/ui/data-table-context.d.ts +62 -0
- package/dist/ui/data-table-context.d.ts.map +1 -0
- package/dist/ui/data-table-context.js +48 -0
- package/dist/ui/data-table-header.d.ts +10 -0
- package/dist/ui/data-table-header.d.ts.map +1 -0
- package/dist/ui/data-table-header.js +141 -0
- package/dist/ui/data-table-pagination.d.ts +13 -0
- package/dist/ui/data-table-pagination.d.ts.map +1 -0
- package/dist/ui/data-table-pagination.js +84 -0
- package/dist/ui/data-table.d.ts +11 -9
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +258 -573
- package/dist/ui/dialog.d.ts +6 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +84 -82
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +3 -3
- package/dist/ui/icon-group.d.ts +2 -4
- package/dist/ui/icon-group.d.ts.map +1 -1
- package/dist/ui/icon-group.js +22 -23
- package/dist/ui/index.d.ts +1 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +94 -99
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/bottom-sheet.d.ts +16 -0
- package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +64 -73
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +40 -44
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +19 -17
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +107 -32
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +80 -80
- package/dist/ui/progress.js +4 -4
- package/dist/ui/radio.d.ts +5 -2
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +29 -20
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +13 -12
- package/dist/ui/segmented-control.d.ts +6 -108
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +86 -272
- package/dist/ui/select.js +5 -5
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts +2 -0
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +102 -84
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +200 -175
- package/dist/ui/slider.js +14 -14
- package/dist/ui/status-dot.js +8 -8
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +33 -31
- package/dist/ui/switch.js +3 -3
- package/dist/ui/tabs.js +6 -6
- package/dist/ui/toast-types.d.ts +0 -1
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast-types.js +0 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +156 -150
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.js +3 -3
- package/docs/components/ui/data-table-body.md +13 -0
- package/docs/components/ui/data-table-bulk-actions.md +13 -0
- package/docs/components/ui/data-table-card.md +13 -0
- package/docs/components/ui/data-table-context.md +13 -0
- package/docs/components/ui/data-table-header.md +13 -0
- package/docs/components/ui/data-table-pagination.md +13 -0
- package/llms-full.txt +79 -48
- package/llms.txt +32 -0
- package/package.json +1 -6
- package/dist/ui/chip.d.ts +0 -19
- package/dist/ui/chip.d.ts.map +0 -1
- package/dist/ui/chip.js +0 -14
- package/dist/ui/lib/use-ripple.d.ts +0 -14
- package/dist/ui/lib/use-ripple.d.ts.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, Fragment as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { IconCheck as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { cn as
|
|
2
|
+
import { jsx as r, Fragment as w, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import * as d from "react";
|
|
4
|
+
import C from "react-markdown";
|
|
5
|
+
import S from "remark-gfm";
|
|
6
|
+
import { IconCheck as z, IconCopy as R } from "@tabler/icons-react";
|
|
7
|
+
import { Icon as b } from "../ui/icon.js";
|
|
8
|
+
import { cn as l } from "../ui/lib/utils.js";
|
|
9
9
|
import { Button as $ } from "../ui/button.js";
|
|
10
|
-
function
|
|
10
|
+
function h(t) {
|
|
11
11
|
return t.toLowerCase().replace(/[^\w]+/g, "-").replace(/(^-|-$)/g, "");
|
|
12
12
|
}
|
|
13
13
|
function m(t) {
|
|
14
14
|
return typeof t == "string" ? t : typeof t == "number" ? String(t) : t ? Array.isArray(t) ? t.map(m).join("") : typeof t == "object" && "props" in t ? m(t.props.children) : "" : "";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const [a, i] =
|
|
18
|
-
|
|
19
|
-
function
|
|
16
|
+
function y({ code: t }) {
|
|
17
|
+
const [a, i] = d.useState(!1), n = d.useRef(void 0);
|
|
18
|
+
d.useEffect(() => () => clearTimeout(n.current), []);
|
|
19
|
+
function c() {
|
|
20
20
|
navigator.clipboard.writeText(t).then(() => {
|
|
21
|
-
i(!0),
|
|
21
|
+
i(!0), n.current = setTimeout(() => i(!1), 2e3);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
return /* @__PURE__ */ r(
|
|
@@ -27,37 +27,37 @@ function b({ code: t }) {
|
|
|
27
27
|
variant: "ghost",
|
|
28
28
|
size: "icon-xs",
|
|
29
29
|
className: "absolute top-ds-02 right-ds-02 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
30
|
-
onClick:
|
|
30
|
+
onClick: c,
|
|
31
31
|
"aria-label": a ? "Copied" : "Copy code",
|
|
32
|
-
children: a ? /* @__PURE__ */ r(
|
|
32
|
+
children: a ? /* @__PURE__ */ r(b, { icon: z, size: "xs" }) : /* @__PURE__ */ r(b, { icon: R, size: "xs" })
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
function j({ language: t, code: a, mb: i }) {
|
|
37
|
-
const [
|
|
38
|
-
if (
|
|
39
|
-
let
|
|
37
|
+
const [n, c] = d.useState(null);
|
|
38
|
+
if (d.useEffect(() => {
|
|
39
|
+
let o = !1;
|
|
40
40
|
return Promise.all([
|
|
41
41
|
import("react-syntax-highlighter"),
|
|
42
42
|
import("react-syntax-highlighter/dist/esm/styles/prism/one-dark")
|
|
43
|
-
]).then(([
|
|
44
|
-
|
|
43
|
+
]).then(([f, e]) => {
|
|
44
|
+
o || c({ Highlighter: f.Prism ?? f.default, style: e.default });
|
|
45
45
|
}).catch(() => {
|
|
46
46
|
}), () => {
|
|
47
|
-
|
|
47
|
+
o = !0;
|
|
48
48
|
};
|
|
49
|
-
}, []), !
|
|
50
|
-
return /* @__PURE__ */
|
|
49
|
+
}, []), !n)
|
|
50
|
+
return /* @__PURE__ */ u("div", { className: l("group relative", i), children: [
|
|
51
51
|
/* @__PURE__ */ r("pre", { className: "bg-surface-sunken rounded-ds-md p-ds-04 overflow-x-auto text-ds-sm font-mono", children: /* @__PURE__ */ r("code", { children: a }) }),
|
|
52
|
-
/* @__PURE__ */ r(
|
|
52
|
+
/* @__PURE__ */ r(y, { code: a })
|
|
53
53
|
] });
|
|
54
|
-
const { Highlighter: p, style:
|
|
55
|
-
return /* @__PURE__ */
|
|
54
|
+
const { Highlighter: p, style: g } = n;
|
|
55
|
+
return /* @__PURE__ */ u("div", { className: l("group relative", i), children: [
|
|
56
56
|
/* @__PURE__ */ r(
|
|
57
57
|
p,
|
|
58
58
|
{
|
|
59
59
|
language: t,
|
|
60
|
-
style:
|
|
60
|
+
style: g,
|
|
61
61
|
customStyle: {
|
|
62
62
|
margin: 0,
|
|
63
63
|
borderRadius: "var(--radius-md)",
|
|
@@ -67,78 +67,79 @@ function j({ language: t, code: a, mb: i }) {
|
|
|
67
67
|
children: a
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
|
-
/* @__PURE__ */ r(
|
|
70
|
+
/* @__PURE__ */ r(y, { code: a })
|
|
71
71
|
] });
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
const M = d.forwardRef(({
|
|
74
74
|
content: t,
|
|
75
75
|
compact: a = !1,
|
|
76
76
|
allowHtml: i = !1,
|
|
77
|
-
linkTarget:
|
|
78
|
-
className:
|
|
77
|
+
linkTarget: n = "_blank",
|
|
78
|
+
className: c,
|
|
79
79
|
...p
|
|
80
|
-
}) {
|
|
81
|
-
const
|
|
82
|
-
return /* @__PURE__ */ r("div", { className:
|
|
83
|
-
|
|
80
|
+
}, g) => {
|
|
81
|
+
const o = a ? "mb-ds-02" : "mb-ds-03", f = a ? "mt-ds-03" : "mt-ds-05";
|
|
82
|
+
return /* @__PURE__ */ r("div", { ref: g, className: l("font-sans text-surface-fg", c), ...p, children: /* @__PURE__ */ r(
|
|
83
|
+
C,
|
|
84
84
|
{
|
|
85
|
-
remarkPlugins: [
|
|
85
|
+
remarkPlugins: [S],
|
|
86
86
|
skipHtml: !i,
|
|
87
87
|
components: {
|
|
88
88
|
h1: ({ children: e }) => {
|
|
89
|
-
const s =
|
|
90
|
-
return /* @__PURE__ */
|
|
89
|
+
const s = h(m(e));
|
|
90
|
+
return /* @__PURE__ */ u("h1", { id: s, className: l("group", a ? "text-ds-md" : "text-ds-lg", "font-semibold text-surface-fg", f, o), children: [
|
|
91
91
|
/* @__PURE__ */ r("a", { href: `#${s}`, className: "opacity-0 group-hover:opacity-100 text-surface-fg-subtle mr-ds-02 no-underline", "aria-hidden": "true", children: "#" }),
|
|
92
92
|
e
|
|
93
93
|
] });
|
|
94
94
|
},
|
|
95
95
|
h2: ({ children: e }) => {
|
|
96
|
-
const s =
|
|
97
|
-
return /* @__PURE__ */
|
|
96
|
+
const s = h(m(e));
|
|
97
|
+
return /* @__PURE__ */ u("h2", { id: s, className: l("group", "text-ds-md font-semibold text-surface-fg", a ? "mt-ds-03" : "mt-ds-04", o), children: [
|
|
98
98
|
/* @__PURE__ */ r("a", { href: `#${s}`, className: "opacity-0 group-hover:opacity-100 text-surface-fg-subtle mr-ds-02 no-underline", "aria-hidden": "true", children: "#" }),
|
|
99
99
|
e
|
|
100
100
|
] });
|
|
101
101
|
},
|
|
102
102
|
h3: ({ children: e }) => {
|
|
103
|
-
const s =
|
|
104
|
-
return /* @__PURE__ */
|
|
103
|
+
const s = h(m(e));
|
|
104
|
+
return /* @__PURE__ */ u("h3", { id: s, className: l("group", "text-ds-md font-semibold text-surface-fg", "mt-ds-03", o), children: [
|
|
105
105
|
/* @__PURE__ */ r("a", { href: `#${s}`, className: "opacity-0 group-hover:opacity-100 text-surface-fg-subtle mr-ds-02 no-underline", "aria-hidden": "true", children: "#" }),
|
|
106
106
|
e
|
|
107
107
|
] });
|
|
108
108
|
},
|
|
109
|
-
p: ({ children: e }) => /* @__PURE__ */ r("p", { className:
|
|
109
|
+
p: ({ children: e }) => /* @__PURE__ */ r("p", { className: l("text-ds-md text-surface-fg leading-ds-relaxed", o), children: e }),
|
|
110
110
|
a: ({ href: e, children: s }) => /* @__PURE__ */ r(
|
|
111
111
|
"a",
|
|
112
112
|
{
|
|
113
113
|
href: e,
|
|
114
|
-
target:
|
|
115
|
-
rel:
|
|
114
|
+
target: n,
|
|
115
|
+
rel: n === "_blank" ? "noopener noreferrer" : void 0,
|
|
116
116
|
className: "text-accent-11 hover:underline",
|
|
117
117
|
children: s
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
code: ({ className: e, children: s, ...
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const
|
|
124
|
-
return /* @__PURE__ */ r(j, { language:
|
|
120
|
+
code: ({ className: e, children: s, ...N }) => {
|
|
121
|
+
const x = e ? /language-(\w+)/.exec(e) : null;
|
|
122
|
+
if (x) {
|
|
123
|
+
const v = x[1], k = String(s).replace(/\n$/, "");
|
|
124
|
+
return /* @__PURE__ */ r(j, { language: v, code: k, mb: o });
|
|
125
125
|
}
|
|
126
|
-
return /* @__PURE__ */ r("code", { className: "bg-surface-sunken rounded-ds-sm px-1.5 py-0.5 text-ds-sm font-mono text-surface-fg", ...
|
|
126
|
+
return /* @__PURE__ */ r("code", { className: "bg-surface-sunken rounded-ds-sm px-1.5 py-0.5 text-ds-sm font-mono text-surface-fg", ...N, children: s });
|
|
127
127
|
},
|
|
128
|
-
pre: ({ children: e }) => /* @__PURE__ */ r(
|
|
129
|
-
blockquote: ({ children: e }) => /* @__PURE__ */ r("blockquote", { className:
|
|
130
|
-
ul: ({ children: e }) => /* @__PURE__ */ r("ul", { className:
|
|
131
|
-
ol: ({ children: e }) => /* @__PURE__ */ r("ol", { className:
|
|
132
|
-
table: ({ children: e }) => /* @__PURE__ */ r("div", { className:
|
|
128
|
+
pre: ({ children: e }) => /* @__PURE__ */ r(w, { children: e }),
|
|
129
|
+
blockquote: ({ children: e }) => /* @__PURE__ */ r("blockquote", { className: l("border-l-2 border-surface-border-subtle pl-ds-04 text-surface-fg-muted italic", o), children: e }),
|
|
130
|
+
ul: ({ children: e }) => /* @__PURE__ */ r("ul", { className: l("list-disc pl-ds-06 text-ds-md text-surface-fg space-y-ds-01", o), children: e }),
|
|
131
|
+
ol: ({ children: e }) => /* @__PURE__ */ r("ol", { className: l("list-decimal pl-ds-06 text-ds-md text-surface-fg space-y-ds-01", o), children: e }),
|
|
132
|
+
table: ({ children: e }) => /* @__PURE__ */ r("div", { className: l("overflow-x-auto", o), children: /* @__PURE__ */ r("table", { className: "w-full border-collapse", children: e }) }),
|
|
133
133
|
th: ({ children: e }) => /* @__PURE__ */ r("th", { className: "border border-surface-border-subtle px-ds-03 py-ds-02 text-left text-ds-sm font-semibold bg-surface-sunken", children: e }),
|
|
134
134
|
td: ({ children: e }) => /* @__PURE__ */ r("td", { className: "border border-surface-border-subtle px-ds-03 py-ds-02 text-ds-sm", children: e }),
|
|
135
|
-
hr: () => /* @__PURE__ */ r("hr", { className:
|
|
135
|
+
hr: () => /* @__PURE__ */ r("hr", { className: l("border-surface-border-subtle", a ? "my-ds-03" : "my-ds-04") }),
|
|
136
136
|
img: ({ src: e, alt: s }) => /* @__PURE__ */ r("img", { src: e, alt: s ?? "", className: "rounded-ds-md max-w-full", loading: "lazy" })
|
|
137
137
|
},
|
|
138
138
|
children: t
|
|
139
139
|
}
|
|
140
140
|
) });
|
|
141
|
-
}
|
|
141
|
+
});
|
|
142
|
+
M.displayName = "MarkdownViewer";
|
|
142
143
|
export {
|
|
143
|
-
|
|
144
|
+
M as MarkdownViewer
|
|
144
145
|
};
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A responsive master-detail layout. On desktop, shows a fixed-width list panel
|
|
5
|
+
* alongside a detail panel. Below the breakpoint, switches to a stacked view
|
|
6
|
+
* with animated transitions and a back button.
|
|
7
|
+
*/
|
|
3
8
|
export interface MasterDetailProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
9
|
/** ID of currently selected item. null = no selection (show list on mobile). */
|
|
5
10
|
selected?: string | null;
|
|
6
|
-
/** Called when mobile back button is pressed */
|
|
11
|
+
/** Called when mobile back button is pressed. */
|
|
7
12
|
onBack?: () => void;
|
|
8
|
-
/** Master panel width on desktop @default '280px' */
|
|
13
|
+
/** Master panel width on desktop. @default '280px' */
|
|
9
14
|
masterWidth?: string;
|
|
10
|
-
/** Breakpoint below which stacked mode activates @default 'md' */
|
|
15
|
+
/** Breakpoint below which stacked mode activates. @default 'md' */
|
|
11
16
|
breakpoint?: 'sm' | 'md' | 'lg';
|
|
12
|
-
/** Content to show in the detail pane when nothing is selected */
|
|
17
|
+
/** Content to show in the detail pane when nothing is selected. */
|
|
13
18
|
emptyState?: React.ReactNode;
|
|
14
|
-
/** Called when user presses ArrowUp/ArrowDown while the list has focus */
|
|
19
|
+
/** Called when user presses ArrowUp/ArrowDown while the list has focus. */
|
|
15
20
|
onNavigate?: (direction: 'up' | 'down') => void;
|
|
16
21
|
}
|
|
17
22
|
interface MasterDetailListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -23,12 +28,11 @@ interface MasterDetailListItemProps extends React.ButtonHTMLAttributes<HTMLButto
|
|
|
23
28
|
}
|
|
24
29
|
declare function MasterDetailList({ children, className, ...props }: MasterDetailListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
30
|
declare function MasterDetailDetail({ children, className, ...props }: MasterDetailDetailProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
-
declare function MasterDetailListItem({ active, children, className, ...props }: MasterDetailListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
27
31
|
declare function MasterDetailRoot({ selected, onBack, masterWidth, breakpoint, emptyState, onNavigate, children, className, style, ...props }: MasterDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
28
32
|
declare const MasterDetail: typeof MasterDetailRoot & {
|
|
29
33
|
List: typeof MasterDetailList;
|
|
30
34
|
Detail: typeof MasterDetailDetail;
|
|
31
|
-
ListItem:
|
|
35
|
+
ListItem: React.ForwardRefExoticComponent<MasterDetailListItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
36
|
};
|
|
33
37
|
export { MasterDetail };
|
|
34
38
|
export type { MasterDetailListItemProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master-detail.d.ts","sourceRoot":"","sources":["../../src/composed/master-detail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,
|
|
1
|
+
{"version":3,"file":"master-detail.d.ts","sourceRoot":"","sources":["../../src/composed/master-detail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mEAAmE;IACnE,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IAC/B,mEAAmE;IACnE,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAA;CAChD;AAED,UAAU,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE/E,UAAU,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAEjF,UAAU,yBAA0B,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACvF,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AA0DD,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,kDA8DjF;AAED,iBAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,kDA4BrF;AAwCD,iBAAS,gBAAgB,CAAC,EACxB,QAAe,EACf,MAAM,EACN,WAAqB,EACrB,UAAiB,EACjB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,2CA4BnB;AAED,QAAA,MAAM,YAAY;;;;CAIhB,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -1,125 +1,164 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { IconArrowLeft as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { springs as
|
|
9
|
-
import { A as
|
|
10
|
-
const
|
|
2
|
+
import { jsx as d, jsxs as D } from "react/jsx-runtime";
|
|
3
|
+
import * as e from "react";
|
|
4
|
+
import { IconArrowLeft as M } from "@tabler/icons-react";
|
|
5
|
+
import { cn as b } from "../ui/lib/utils.js";
|
|
6
|
+
import { Button as C } from "../ui/button.js";
|
|
7
|
+
import { Icon as k } from "../ui/icon.js";
|
|
8
|
+
import { springs as R } from "../ui/lib/motion.js";
|
|
9
|
+
import { A as L, m as A } from "../_chunks/framer.js";
|
|
10
|
+
const E = {
|
|
11
11
|
sm: "640px",
|
|
12
12
|
md: "768px",
|
|
13
13
|
lg: "1024px"
|
|
14
14
|
};
|
|
15
|
-
function
|
|
16
|
-
const [
|
|
17
|
-
return
|
|
15
|
+
function N(s) {
|
|
16
|
+
const [i, c] = e.useState(!1);
|
|
17
|
+
return e.useEffect(() => {
|
|
18
18
|
if (typeof window > "u") return;
|
|
19
|
-
const
|
|
20
|
-
r
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
}, [
|
|
19
|
+
const r = window.matchMedia(s);
|
|
20
|
+
c(r.matches);
|
|
21
|
+
const t = (a) => c(a.matches);
|
|
22
|
+
return r.addEventListener("change", t), () => r.removeEventListener("change", t);
|
|
23
|
+
}, [s]), i;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const y = e.createContext({
|
|
26
26
|
selected: null,
|
|
27
|
-
isMobile: !1
|
|
27
|
+
isMobile: !1,
|
|
28
|
+
activeIndex: 0,
|
|
29
|
+
setActiveIndex: () => {
|
|
30
|
+
},
|
|
31
|
+
registerItemRef: () => {
|
|
32
|
+
},
|
|
33
|
+
itemCount: 0,
|
|
34
|
+
setItemCount: () => {
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
|
-
function
|
|
30
|
-
const { selected:
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
function K({ children: s, className: i, ...c }) {
|
|
38
|
+
const { selected: r, isMobile: t, onNavigate: a, activeIndex: l, setActiveIndex: m, registerItemRef: u, setItemCount: x } = e.useContext(y), f = e.useRef([]), p = e.Children.count(s);
|
|
39
|
+
if (e.useEffect(() => {
|
|
40
|
+
x(p);
|
|
41
|
+
}, [p, x]), t && r) return null;
|
|
42
|
+
function h(n) {
|
|
43
|
+
if (n.key === "ArrowDown") {
|
|
44
|
+
n.preventDefault();
|
|
45
|
+
const o = Math.min(l + 1, p - 1);
|
|
46
|
+
m(o), f.current[o]?.focus(), a?.("down");
|
|
47
|
+
} else if (n.key === "ArrowUp") {
|
|
48
|
+
n.preventDefault();
|
|
49
|
+
const o = Math.max(l - 1, 0);
|
|
50
|
+
m(o), f.current[o]?.focus(), a?.("up");
|
|
51
|
+
} else if (n.key === "Home")
|
|
52
|
+
n.preventDefault(), m(0), f.current[0]?.focus();
|
|
53
|
+
else if (n.key === "End") {
|
|
54
|
+
n.preventDefault();
|
|
55
|
+
const o = p - 1;
|
|
56
|
+
m(o), f.current[o]?.focus();
|
|
57
|
+
}
|
|
34
58
|
}
|
|
35
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ d(
|
|
36
60
|
"div",
|
|
37
61
|
{
|
|
38
62
|
role: "listbox",
|
|
39
|
-
tabIndex:
|
|
40
|
-
className:
|
|
63
|
+
tabIndex: -1,
|
|
64
|
+
className: b(
|
|
41
65
|
"overflow-y-auto focus-visible:outline-none",
|
|
42
|
-
!
|
|
43
|
-
|
|
66
|
+
!t && "border-r border-surface-border",
|
|
67
|
+
i
|
|
44
68
|
),
|
|
45
|
-
onKeyDown:
|
|
46
|
-
...
|
|
47
|
-
children: e
|
|
69
|
+
onKeyDown: h,
|
|
70
|
+
...c,
|
|
71
|
+
children: e.Children.map(s, (n, o) => e.isValidElement(n) ? e.cloneElement(n, {
|
|
72
|
+
ref: (v) => {
|
|
73
|
+
f.current[o] = v, u(o, v);
|
|
74
|
+
},
|
|
75
|
+
tabIndex: o === l ? 0 : -1
|
|
76
|
+
}) : n)
|
|
48
77
|
}
|
|
49
78
|
);
|
|
50
79
|
}
|
|
51
|
-
function
|
|
52
|
-
const { selected:
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
80
|
+
function S({ children: s, className: i, ...c }) {
|
|
81
|
+
const { selected: r, isMobile: t, onBack: a, emptyState: l } = e.useContext(y);
|
|
82
|
+
return t && !r ? null : /* @__PURE__ */ D("div", { className: b("flex-1 overflow-y-auto", i), ...c, children: [
|
|
83
|
+
t && a && /* @__PURE__ */ d("div", { className: "border-b border-surface-border px-ds-04 py-ds-03", children: /* @__PURE__ */ d(C, { variant: "ghost", size: "xs", onClick: a, startIcon: /* @__PURE__ */ d(k, { icon: M }), children: "Back" }) }),
|
|
84
|
+
/* @__PURE__ */ d(L, { mode: "wait", children: /* @__PURE__ */ d(
|
|
85
|
+
A.div,
|
|
57
86
|
{
|
|
58
|
-
initial:
|
|
87
|
+
initial: t ? { x: 20, opacity: 0 } : !1,
|
|
59
88
|
animate: { x: 0, opacity: 1 },
|
|
60
|
-
exit:
|
|
61
|
-
transition:
|
|
62
|
-
children:
|
|
89
|
+
exit: t ? { x: -20, opacity: 0 } : void 0,
|
|
90
|
+
transition: R.snappy,
|
|
91
|
+
children: r ? s : l ?? s
|
|
63
92
|
},
|
|
64
|
-
|
|
93
|
+
r ?? "empty"
|
|
65
94
|
) })
|
|
66
95
|
] });
|
|
67
96
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
type: "button",
|
|
73
|
-
role: "option",
|
|
74
|
-
"aria-selected": e,
|
|
75
|
-
"data-active": e || void 0,
|
|
76
|
-
className: d(
|
|
77
|
-
"flex w-full items-center px-ds-04 py-ds-03 text-left text-ds-md font-sans text-surface-fg",
|
|
78
|
-
"transition-colors duration-fast-01 ease-productive-standard",
|
|
79
|
-
"hover:bg-surface-raised-hover",
|
|
80
|
-
e && "bg-accent-2 text-accent-11 border-l-2 border-accent-9",
|
|
81
|
-
r
|
|
82
|
-
),
|
|
83
|
-
...t,
|
|
84
|
-
children: n
|
|
97
|
+
const j = e.forwardRef(
|
|
98
|
+
function({ active: i = !1, children: c, className: r, onKeyDown: t, ...a }, l) {
|
|
99
|
+
function m(u) {
|
|
100
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.target.click()), t?.(u);
|
|
85
101
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
return /* @__PURE__ */ d(
|
|
103
|
+
"button",
|
|
104
|
+
{
|
|
105
|
+
ref: l,
|
|
106
|
+
type: "button",
|
|
107
|
+
role: "option",
|
|
108
|
+
"aria-selected": i,
|
|
109
|
+
"data-active": i || void 0,
|
|
110
|
+
onKeyDown: m,
|
|
111
|
+
className: b(
|
|
112
|
+
"flex w-full items-center px-ds-04 py-ds-03 text-left text-ds-md font-sans text-surface-fg",
|
|
113
|
+
"transition-colors duration-fast-01 ease-productive-standard",
|
|
114
|
+
"hover:bg-surface-raised-hover",
|
|
115
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-7 focus-visible:ring-inset",
|
|
116
|
+
i && "bg-accent-2 text-accent-11 border-l-2 border-accent-9",
|
|
117
|
+
r
|
|
118
|
+
),
|
|
119
|
+
...a,
|
|
120
|
+
children: c
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
function B({
|
|
126
|
+
selected: s = null,
|
|
127
|
+
onBack: i,
|
|
128
|
+
masterWidth: c = "280px",
|
|
129
|
+
breakpoint: r = "md",
|
|
130
|
+
emptyState: t,
|
|
131
|
+
onNavigate: a,
|
|
95
132
|
children: l,
|
|
96
|
-
className:
|
|
97
|
-
style:
|
|
98
|
-
...
|
|
133
|
+
className: m,
|
|
134
|
+
style: u,
|
|
135
|
+
...x
|
|
99
136
|
}) {
|
|
100
|
-
const f =
|
|
101
|
-
|
|
137
|
+
const f = N(`(max-width: ${E[r]})`), [p, h] = e.useState(0), [n, o] = e.useState(0), v = e.useRef([]), I = e.useCallback((g, w) => {
|
|
138
|
+
v.current[g] = w;
|
|
139
|
+
}, []);
|
|
140
|
+
return /* @__PURE__ */ d(y.Provider, { value: { selected: s, isMobile: f, onBack: i, emptyState: t, onNavigate: a, activeIndex: p, setActiveIndex: h, registerItemRef: I, itemCount: n, setItemCount: o }, children: /* @__PURE__ */ d(
|
|
102
141
|
"div",
|
|
103
142
|
{
|
|
104
|
-
className:
|
|
143
|
+
className: b(
|
|
105
144
|
"flex h-full",
|
|
106
145
|
!f && "grid",
|
|
107
|
-
|
|
146
|
+
m
|
|
108
147
|
),
|
|
109
148
|
style: {
|
|
110
|
-
...
|
|
111
|
-
...f ? {} : { gridTemplateColumns: `${
|
|
149
|
+
...u,
|
|
150
|
+
...f ? {} : { gridTemplateColumns: `${c} 1fr` }
|
|
112
151
|
},
|
|
113
|
-
...
|
|
152
|
+
...x,
|
|
114
153
|
children: l
|
|
115
154
|
}
|
|
116
155
|
) });
|
|
117
156
|
}
|
|
118
|
-
const
|
|
119
|
-
List:
|
|
120
|
-
Detail:
|
|
121
|
-
ListItem:
|
|
157
|
+
const U = Object.assign(B, {
|
|
158
|
+
List: K,
|
|
159
|
+
Detail: S,
|
|
160
|
+
ListItem: j
|
|
122
161
|
});
|
|
123
162
|
export {
|
|
124
|
-
|
|
163
|
+
U as MasterDetail
|
|
125
164
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Dialog and Sheet now auto-adapt to mobile viewports.
|
|
5
|
+
* Use Dialog directly (fullScreens on mobile) or Sheet directly (becomes bottom sheet on mobile).
|
|
6
|
+
* This component will be removed in a future major version.
|
|
7
|
+
*/
|
|
3
8
|
export interface ResponsiveOverlayProps {
|
|
4
9
|
open: boolean;
|
|
5
10
|
onOpenChange: (open: boolean) => void;
|
|
@@ -10,6 +15,9 @@ export interface ResponsiveOverlayProps {
|
|
|
10
15
|
children: React.ReactNode;
|
|
11
16
|
className?: string;
|
|
12
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use Dialog or Sheet directly — they are now individually mobile-responsive.
|
|
20
|
+
*/
|
|
13
21
|
declare function ResponsiveOverlay({ open, onOpenChange, title, description, breakpoint, children, className, }: ResponsiveOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
14
22
|
export { ResponsiveOverlay };
|
|
15
23
|
//# sourceMappingURL=responsive-overlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive-overlay.d.ts","sourceRoot":"","sources":["../../src/composed/responsive-overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAoB9B,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kEAAkE;IAClE,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA8BD,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,UAAiB,EACjB,QAAQ,EACR,SAAS,GACV,EAAE,sBAAsB,2CAgCxB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"responsive-overlay.d.ts","sourceRoot":"","sources":["../../src/composed/responsive-overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAoB9B;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kEAAkE;IAClE,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA8BD;;GAEG;AACH,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,UAAiB,EACjB,QAAQ,EACR,SAAS,GACV,EAAE,sBAAsB,2CAgCxB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -6,11 +6,19 @@ export interface MentionItem {
|
|
|
6
6
|
label: string;
|
|
7
7
|
avatar?: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* A Tiptap-powered rich text editor with a configurable toolbar, @mentions,
|
|
11
|
+
* emoji suggestions, file/image uploads, and task lists.
|
|
12
|
+
* Outputs sanitized HTML via `onChange`.
|
|
13
|
+
*/
|
|
9
14
|
export interface RichTextEditorProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'content'> {
|
|
15
|
+
/** Initial HTML content. Updates are NOT reactive — use `onChange` for controlled state. */
|
|
10
16
|
content?: string;
|
|
11
17
|
placeholder?: string;
|
|
18
|
+
/** Called with the editor's HTML string whenever content changes. */
|
|
12
19
|
onChange?: (html: string) => void;
|
|
13
20
|
className?: string;
|
|
21
|
+
/** Set to false to render in read-only mode (e.g. for previewing). */
|
|
14
22
|
editable?: boolean;
|
|
15
23
|
/** Called when an image is pasted/dropped. Return a URL. If not provided, images inline as base64. */
|
|
16
24
|
onImageUpload?: (file: File) => Promise<string>;
|
|
@@ -22,11 +30,11 @@ export interface RichTextEditorProps extends Omit<React.ComponentPropsWithoutRef
|
|
|
22
30
|
}>;
|
|
23
31
|
/** Whitelist of toolbar items to display. Omit to show all. */
|
|
24
32
|
toolbar?: ToolbarItem[];
|
|
25
|
-
/** Static list of mentionable items */
|
|
33
|
+
/** Static list of mentionable items (shown when user types @). */
|
|
26
34
|
mentions?: MentionItem[];
|
|
27
|
-
/** Async mention search. Takes precedence over static list. */
|
|
35
|
+
/** Async mention search. Takes precedence over static `mentions` list. */
|
|
28
36
|
onMentionSearch?: (query: string) => Promise<MentionItem[]>;
|
|
29
|
-
/** Called when a mention is selected from the suggestion dropdown */
|
|
37
|
+
/** Called when a mention is selected from the suggestion dropdown. */
|
|
30
38
|
onMentionSelect?: (item: MentionItem) => void;
|
|
31
39
|
}
|
|
32
40
|
declare const RichTextEditor: React.ForwardRefExoticComponent<RichTextEditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.d.ts","sourceRoot":"","sources":["../../src/composed/rich-text-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"rich-text-editor.d.ts","sourceRoot":"","sources":["../../src/composed/rich-text-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA2V9B,MAAM,MAAM,WAAW,GACnB,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GACxD,IAAI,GAAG,IAAI,GAAG,YAAY,GAC1B,YAAY,GAAG,aAAa,GAAG,UAAU,GAAG,WAAW,GACvD,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAChC,WAAW,GAAG,aAAa,GAAG,YAAY,GAC1C,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAE7B,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9G,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sGAAsG;IACtG,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/C,oGAAoG;IACpG,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACnF,+DAA+D;IAC/D,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;IAC3D,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;CAC9C;AAED,QAAA,MAAM,cAAc,4FA0OnB,CAAA;AAID,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IACjG,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,cAAc,4FAiDnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA"}
|