laif-ds 0.2.74 → 0.2.76
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/CHANGELOG.md +446 -0
- package/dist/agent-docs/adoption-report.json +615 -0
- package/dist/agent-docs/components/Accordion.md +46 -16
- package/dist/agent-docs/components/Alert.md +90 -95
- package/dist/agent-docs/components/AlertDialog.md +132 -126
- package/dist/agent-docs/components/AppEditor.md +90 -90
- package/dist/agent-docs/components/AppRadioGroup.md +18 -18
- package/dist/agent-docs/components/AppSidebar.md +129 -122
- package/dist/agent-docs/components/AppStepper.md +81 -77
- package/dist/agent-docs/components/AspectRatio.md +70 -62
- package/dist/agent-docs/components/AudioVisualizer.md +5 -5
- package/dist/agent-docs/components/Avatar.md +112 -113
- package/dist/agent-docs/components/Badge.md +123 -118
- package/dist/agent-docs/components/Breadcrumb.md +8 -1
- package/dist/agent-docs/components/Button.md +131 -129
- package/dist/agent-docs/components/Card.md +172 -147
- package/dist/agent-docs/components/Carousel.md +148 -129
- package/dist/agent-docs/components/Chat.md +121 -109
- package/dist/agent-docs/components/ChatMessage.md +72 -61
- package/dist/agent-docs/components/Checkbox.md +150 -135
- package/dist/agent-docs/components/CircularProgress.md +53 -49
- package/dist/agent-docs/components/CodeHighlighter.md +4 -4
- package/dist/agent-docs/components/Collapsible.md +114 -95
- package/dist/agent-docs/components/Command.md +141 -142
- package/dist/agent-docs/components/Confirmer.md +182 -175
- package/dist/agent-docs/components/ContextMenu.md +196 -191
- package/dist/agent-docs/components/DataCrossTable.md +114 -94
- package/dist/agent-docs/components/DataTable.md +32 -24
- package/dist/agent-docs/components/Dialog.md +130 -125
- package/dist/agent-docs/components/Drawer.md +141 -127
- package/dist/agent-docs/components/FilePreviewer.md +138 -139
- package/dist/agent-docs/components/FileUploader.md +149 -129
- package/dist/agent-docs/components/Form.md +3 -1
- package/dist/agent-docs/components/FormComposer.md +163 -137
- package/dist/agent-docs/components/GanttChart.md +125 -122
- package/dist/agent-docs/components/HoverCard.md +1 -1
- package/dist/agent-docs/components/Icon.md +98 -99
- package/dist/agent-docs/components/Input.md +173 -138
- package/dist/agent-docs/components/InputOtp.md +6 -1
- package/dist/agent-docs/components/InputSelector.md +94 -97
- package/dist/agent-docs/components/InterruptPrompt.md +4 -4
- package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
- package/dist/agent-docs/components/Menubar.md +60 -57
- package/dist/agent-docs/components/MessageInput.md +134 -131
- package/dist/agent-docs/components/MessageList.md +110 -96
- package/dist/agent-docs/components/MultipleSelector.md +147 -146
- package/dist/agent-docs/components/NavigationMenu.md +6 -2
- package/dist/agent-docs/components/Popover.md +112 -103
- package/dist/agent-docs/components/PromptSuggestions.md +5 -5
- package/dist/agent-docs/components/RadioGroup.md +97 -90
- package/dist/agent-docs/components/Resizable.md +4 -1
- package/dist/agent-docs/components/ResizePrompt.md +12 -13
- package/dist/agent-docs/components/ScrollArea.md +6 -2
- package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
- package/dist/agent-docs/components/Select.md +131 -132
- package/dist/agent-docs/components/Sheet.md +8 -1
- package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
- package/dist/agent-docs/components/Sidebar.md +94 -85
- package/dist/agent-docs/components/Slider.md +62 -58
- package/dist/agent-docs/components/Sonner.md +1 -0
- package/dist/agent-docs/components/Spinner.md +14 -14
- package/dist/agent-docs/components/Stepper.md +93 -67
- package/dist/agent-docs/components/Switch.md +41 -42
- package/dist/agent-docs/components/TableSkeleton.md +8 -8
- package/dist/agent-docs/components/Tabs.md +106 -86
- package/dist/agent-docs/components/TextArea.md +51 -52
- package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
- package/dist/agent-docs/components/Toaster.md +1 -0
- package/dist/agent-docs/components/Tooltip.md +102 -91
- package/dist/agent-docs/components/Typo.md +68 -65
- package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
- package/dist/agent-docs/components-list.md +1 -0
- package/dist/agent-docs/manifest.json +5981 -0
- package/dist/agent-docs/truncated-cell.md +342 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
- package/dist/components/ui/app-checkbox.js +1 -1
- package/dist/components/ui/app-dialog.js +70 -64
- package/dist/components/ui/app-editor.js +51 -51
- package/dist/components/ui/app-form.js +81 -81
- package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
- package/dist/components/ui/app-select.js +109 -104
- package/dist/components/ui/app-sidebar.js +41 -41
- package/dist/components/ui/app-stepper.js +1 -1
- package/dist/components/ui/app-time-picker.js +18 -18
- package/dist/components/ui/app-tooltip.js +1 -1
- package/dist/components/ui/async-select.js +5 -5
- package/dist/components/ui/audio-visualizer.js +61 -58
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chat-message.js +8 -8
- package/dist/components/ui/chat.js +86 -88
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/date-picker.js +20 -20
- package/dist/components/ui/file-preview/index.js +13 -13
- package/dist/components/ui/file-previewer.js +12 -11
- package/dist/components/ui/file-uploader.js +86 -78
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
- package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
- package/dist/components/ui/input-selector.js +1 -1
- package/dist/components/ui/input.js +23 -23
- package/dist/components/ui/kanban.js +8 -9
- package/dist/components/ui/markdown-renderer.js +41 -35
- package/dist/components/ui/message-input.js +45 -44
- package/dist/components/ui/multiple-selector.js +91 -82
- package/dist/components/ui/secure-pdf-viewer.js +19 -7
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +4 -4
- package/dist/components/ui/stepper.js +157 -138
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
- package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
- package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
- package/dist/components/ui/tables/data-table/data-table.js +258 -250
- package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
- package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/truncated-cell.js +100 -0
- package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
- package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
- package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
- package/dist/components/ui/weekly-calendar/day-column.js +16 -16
- package/dist/components/ui/weekly-calendar/time-column.js +4 -4
- package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
- package/dist/hooks/use-audio-recording.js +1 -1
- package/dist/hooks/use-auto-scroll.js +18 -18
- package/dist/hooks/use-autosize-textarea.js +12 -13
- package/dist/index.d.ts +100 -45
- package/dist/index.js +362 -360
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import C from "
|
|
5
|
-
const r =
|
|
3
|
+
import u from "../../../_virtual/dayjs.min.js";
|
|
4
|
+
import { useState as t, useEffect as c, createContext as m, useContext as C } from "react";
|
|
5
|
+
const r = m(
|
|
6
6
|
void 0
|
|
7
7
|
), x = () => {
|
|
8
|
-
const e =
|
|
8
|
+
const e = C(r);
|
|
9
9
|
if (!e)
|
|
10
10
|
throw new Error("useCalendar must be used within a CalendarProvider");
|
|
11
11
|
return e;
|
|
12
12
|
}, I = ({ children: e, value: n }) => {
|
|
13
13
|
const [o, s] = t(null), [a, l] = t(null);
|
|
14
|
-
return
|
|
14
|
+
return c(() => {
|
|
15
15
|
const d = setInterval(() => {
|
|
16
|
-
l(
|
|
16
|
+
l(u().format("HH:mm"));
|
|
17
17
|
}, 1e3);
|
|
18
18
|
return () => clearInterval(d);
|
|
19
19
|
}, []), /* @__PURE__ */ i(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
import d from "../../../_virtual/dayjs.min.js";
|
|
4
3
|
import "../../../_virtual/it.js";
|
|
5
|
-
import
|
|
6
|
-
import { l as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import d from "../../../_virtual/dayjs.min.js";
|
|
5
|
+
import { l as h } from "../../../_virtual/lodash.js";
|
|
6
|
+
import { Button as g } from "../button.js";
|
|
7
|
+
import { Icon as a } from "../icon.js";
|
|
8
|
+
import { Typo as s } from "../typo.js";
|
|
9
|
+
import { useCalendar as v } from "./calendar-context.js";
|
|
10
10
|
d.locale("it");
|
|
11
11
|
const O = () => {
|
|
12
12
|
const {
|
|
@@ -17,11 +17,11 @@ const O = () => {
|
|
|
17
17
|
goToPreviousWeek: c,
|
|
18
18
|
goToNextWeek: m,
|
|
19
19
|
goToCurrentWeek: f
|
|
20
|
-
} =
|
|
20
|
+
} = v(), o = d().startOf("isoWeek").add(n, "week"), p = o.endOf("isoWeek"), u = n === 0;
|
|
21
21
|
return !i && !t ? null : /* @__PURE__ */ e("div", { className: "border-d-border bg-d-card border-t border-r border-l px-4 py-2", children: i && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
|
|
22
22
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
23
23
|
/* @__PURE__ */ e(
|
|
24
|
-
|
|
24
|
+
g,
|
|
25
25
|
{
|
|
26
26
|
onClick: f,
|
|
27
27
|
variant: "ghost",
|
|
@@ -31,12 +31,12 @@ const O = () => {
|
|
|
31
31
|
children: l
|
|
32
32
|
}
|
|
33
33
|
),
|
|
34
|
-
/* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(
|
|
35
|
-
/* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(
|
|
34
|
+
/* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(a, { onClick: c, name: "ChevronLeft" }) }),
|
|
35
|
+
/* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(a, { onClick: m, name: "ChevronRight" }) })
|
|
36
36
|
] }),
|
|
37
37
|
/* @__PURE__ */ r("div", { className: "flex flex-col items-center py-2 text-center leading-tight", children: [
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
/* @__PURE__ */ r(
|
|
38
|
+
/* @__PURE__ */ e(s, { variant: "h5", children: h.upperFirst(o.format("MMMM YYYY")) }),
|
|
39
|
+
/* @__PURE__ */ r(s, { variant: "small", className: "text-d-muted-foreground", children: [
|
|
40
40
|
o.format("D"),
|
|
41
41
|
" – ",
|
|
42
42
|
p.format("D MMM")
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import A from "react";
|
|
4
3
|
import N from "../../../_virtual/dayjs.min.js";
|
|
5
|
-
import
|
|
6
|
-
import { AppointmentCard as W } from "./appointment-card.js";
|
|
7
|
-
import { Typo as g } from "../typo.js";
|
|
8
|
-
import { Badge as n } from "../badge.js";
|
|
4
|
+
import A from "react";
|
|
9
5
|
import { cn as m } from "../../../lib/utils.js";
|
|
10
|
-
import {
|
|
6
|
+
import { Badge as n } from "../badge.js";
|
|
7
|
+
import { Tooltip as g, TooltipTrigger as M, TooltipContent as T } from "../tooltip.js";
|
|
8
|
+
import { Typo as w } from "../typo.js";
|
|
9
|
+
import { AppointmentCard as I } from "./appointment-card.js";
|
|
10
|
+
import { useCalendar as W } from "./calendar-context.js";
|
|
11
11
|
const F = ({ date: d, weekdayInfo: h }) => {
|
|
12
12
|
const {
|
|
13
13
|
calendarStartHour: l,
|
|
@@ -15,7 +15,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
15
15
|
enableGrouping: f,
|
|
16
16
|
appointmentsByDay: j,
|
|
17
17
|
groupedAppointmentsByDay: D
|
|
18
|
-
} =
|
|
18
|
+
} = W(), O = A.useMemo(() => Array.from(
|
|
19
19
|
{ length: p - l + 1 },
|
|
20
20
|
(e, a) => `${(a + l).toString().padStart(2, "0")}:00`
|
|
21
21
|
), [l, p]), u = d.format("YYYY-MM-DD"), o = f ? D[u] || {} : { default: j[u] || [] }, s = d.isSame(N(), "day"), t = Object.keys(o), c = t.length > 1, b = (e) => {
|
|
@@ -29,7 +29,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
29
29
|
height: `${k}px`,
|
|
30
30
|
zIndex: 10
|
|
31
31
|
},
|
|
32
|
-
children: /* @__PURE__ */ r(
|
|
32
|
+
children: /* @__PURE__ */ r(I, { appointment: e })
|
|
33
33
|
},
|
|
34
34
|
e.id
|
|
35
35
|
);
|
|
@@ -53,7 +53,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
53
53
|
),
|
|
54
54
|
children: /* @__PURE__ */ i("div", { className: "flex flex-col items-start justify-center gap-0", children: [
|
|
55
55
|
/* @__PURE__ */ r(
|
|
56
|
-
|
|
56
|
+
w,
|
|
57
57
|
{
|
|
58
58
|
variant: "h5",
|
|
59
59
|
className: m("mb-0", s ? "text-d-primary" : ""),
|
|
@@ -61,7 +61,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
/* @__PURE__ */ r(
|
|
64
|
-
|
|
64
|
+
w,
|
|
65
65
|
{
|
|
66
66
|
variant: "small",
|
|
67
67
|
className: m(
|
|
@@ -79,8 +79,8 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
79
79
|
{
|
|
80
80
|
className: "border-d-border flex flex-1 items-center justify-center border-r px-2 py-1.5 last:border-r-0",
|
|
81
81
|
style: { minWidth: "120px" },
|
|
82
|
-
children: e.length > 10 ? /* @__PURE__ */ i(
|
|
83
|
-
/* @__PURE__ */ r(
|
|
82
|
+
children: e.length > 10 ? /* @__PURE__ */ i(g, { children: [
|
|
83
|
+
/* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(
|
|
84
84
|
n,
|
|
85
85
|
{
|
|
86
86
|
variant: s ? "outline-primary" : "outline",
|
|
@@ -89,7 +89,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
89
89
|
}
|
|
90
90
|
) }),
|
|
91
91
|
/* @__PURE__ */ r(
|
|
92
|
-
|
|
92
|
+
T,
|
|
93
93
|
{
|
|
94
94
|
sideOffset: 4,
|
|
95
95
|
className: "max-w-xs text-center break-words",
|
|
@@ -106,8 +106,8 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
106
106
|
)
|
|
107
107
|
},
|
|
108
108
|
e
|
|
109
|
-
)) : /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center px-2 py-1.5", children: t[0].length > 15 ? /* @__PURE__ */ i(
|
|
110
|
-
/* @__PURE__ */ r(
|
|
109
|
+
)) : /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center px-2 py-1.5", children: t[0].length > 15 ? /* @__PURE__ */ i(g, { children: [
|
|
110
|
+
/* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(
|
|
111
111
|
n,
|
|
112
112
|
{
|
|
113
113
|
variant: s ? "outline-primary" : "outline",
|
|
@@ -116,7 +116,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
116
116
|
}
|
|
117
117
|
) }),
|
|
118
118
|
/* @__PURE__ */ r(
|
|
119
|
-
|
|
119
|
+
T,
|
|
120
120
|
{
|
|
121
121
|
sideOffset: 4,
|
|
122
122
|
className: "max-w-xs text-center break-words",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import u from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Badge as b } from "../badge.js";
|
|
5
|
+
import { useCalendar as p } from "./calendar-context.js";
|
|
6
6
|
const N = () => {
|
|
7
7
|
const {
|
|
8
8
|
calendarStartHour: t = 6,
|
|
9
9
|
calendarEndHour: d = 18,
|
|
10
10
|
enableGrouping: s,
|
|
11
11
|
groupLabel: i
|
|
12
|
-
} =
|
|
12
|
+
} = p(), c = u.useMemo(() => {
|
|
13
13
|
const e = d - t + 1;
|
|
14
14
|
return Array.from({ length: e }, (n, m) => {
|
|
15
15
|
const o = m + t, l = o < 12 ? "AM" : "PM";
|
|
@@ -21,7 +21,7 @@ const N = () => {
|
|
|
21
21
|
}, [t, d]);
|
|
22
22
|
return /* @__PURE__ */ a("div", { className: "border-d-border bg-d-card z-20 flex-shrink-0 border-r px-2", children: [
|
|
23
23
|
/* @__PURE__ */ r("div", { className: "border-d-border h-14 border-b" }),
|
|
24
|
-
s && /* @__PURE__ */ r("div", { className: "border-d-border flex min-h-[2.5rem] items-center justify-center border-b", children: /* @__PURE__ */ r(
|
|
24
|
+
s && /* @__PURE__ */ r("div", { className: "border-d-border flex min-h-[2.5rem] items-center justify-center border-b", children: /* @__PURE__ */ r(b, { variant: "outline", children: i }) }),
|
|
25
25
|
/* @__PURE__ */ r("div", { className: "relative", children: c.map(({ label: e, ampm: n }) => /* @__PURE__ */ a(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as f, jsxs as y } from "react/jsx-runtime";
|
|
3
|
-
import d from "react";
|
|
4
3
|
import a from "../../../_virtual/dayjs.min.js";
|
|
5
4
|
import N from "../../../_virtual/isoWeek.js";
|
|
5
|
+
import d from "react";
|
|
6
6
|
import { CalendarProvider as h } from "./calendar-context.js";
|
|
7
7
|
import { CalendarHeader as B } from "./calendar-header.js";
|
|
8
|
-
import {
|
|
8
|
+
import { CurrentTimeLine as C } from "./current-timeline.js";
|
|
9
9
|
import { DayColumn as V } from "./day-column.js";
|
|
10
|
-
import {
|
|
10
|
+
import { TimeColumn as z } from "./time-column.js";
|
|
11
11
|
a.extend(N);
|
|
12
12
|
const L = [
|
|
13
13
|
{ key: "monday", label: "Lunedì", dayjs: 1 },
|
|
@@ -102,8 +102,8 @@ function Q({
|
|
|
102
102
|
}, children: /* @__PURE__ */ y("div", { className: "flex h-full flex-col", children: [
|
|
103
103
|
/* @__PURE__ */ f(B, {}),
|
|
104
104
|
/* @__PURE__ */ y("div", { className: "border-d-border relative flex flex-1 border-t border-l", children: [
|
|
105
|
-
/* @__PURE__ */ f(C, {}),
|
|
106
105
|
/* @__PURE__ */ f(z, {}),
|
|
106
|
+
/* @__PURE__ */ f(C, {}),
|
|
107
107
|
/* @__PURE__ */ f("div", { className: "flex flex-1 overflow-x-auto", children: k.map((e, t) => /* @__PURE__ */ f(
|
|
108
108
|
V,
|
|
109
109
|
{
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef as l, useState as h, useEffect as s } from "react";
|
|
2
|
+
import { useRef as l, useState as w, useCallback as h, useEffect as s } from "react";
|
|
3
3
|
const H = 50, m = 10;
|
|
4
|
-
function D(
|
|
5
|
-
const e = l(null), t = l(null), [
|
|
4
|
+
function D() {
|
|
5
|
+
const e = l(null), t = l(null), [r, n] = w(!0), c = h(() => {
|
|
6
6
|
typeof window > "u" || e.current && (e.current.scrollTop = e.current.scrollHeight);
|
|
7
|
-
},
|
|
7
|
+
}, []), u = () => {
|
|
8
8
|
if (!(typeof window > "u") && e.current) {
|
|
9
|
-
const { scrollTop: o, scrollHeight:
|
|
10
|
-
|
|
11
|
-
),
|
|
12
|
-
if (
|
|
13
|
-
|
|
9
|
+
const { scrollTop: o, scrollHeight: f, clientHeight: d } = e.current, a = Math.abs(
|
|
10
|
+
f - o - d
|
|
11
|
+
), p = t.current ? o < t.current : !1, S = t.current ? t.current - o : 0;
|
|
12
|
+
if (p && S > m)
|
|
13
|
+
n(!1);
|
|
14
14
|
else {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const T = a < H;
|
|
16
|
+
n(T);
|
|
17
17
|
}
|
|
18
18
|
t.current = o;
|
|
19
19
|
}
|
|
20
|
-
},
|
|
21
|
-
typeof window > "u" ||
|
|
20
|
+
}, i = () => {
|
|
21
|
+
typeof window > "u" || n(!1);
|
|
22
22
|
};
|
|
23
23
|
return s(() => {
|
|
24
24
|
typeof window > "u" || e.current && (t.current = e.current.scrollTop);
|
|
25
25
|
}, []), s(() => {
|
|
26
|
-
typeof window > "u" ||
|
|
27
|
-
},
|
|
26
|
+
typeof window > "u" || r && c();
|
|
27
|
+
}, [r, c]), {
|
|
28
28
|
containerRef: e,
|
|
29
29
|
scrollToBottom: c,
|
|
30
|
-
handleScroll:
|
|
31
|
-
shouldAutoScroll:
|
|
32
|
-
handleTouchStart:
|
|
30
|
+
handleScroll: u,
|
|
31
|
+
shouldAutoScroll: r,
|
|
32
|
+
handleTouchStart: i
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef as
|
|
3
|
-
const
|
|
2
|
+
import { useRef as l, useLayoutEffect as f } from "react";
|
|
3
|
+
const a = typeof window < "u" ? f : () => {
|
|
4
4
|
};
|
|
5
|
-
function
|
|
5
|
+
function h({
|
|
6
6
|
ref: t,
|
|
7
7
|
maxHeight: o = Number.MAX_SAFE_INTEGER,
|
|
8
|
-
borderWidth:
|
|
9
|
-
dependencies: c
|
|
8
|
+
borderWidth: r = 0
|
|
10
9
|
}) {
|
|
11
|
-
const n =
|
|
12
|
-
|
|
10
|
+
const n = l(null);
|
|
11
|
+
a(() => {
|
|
13
12
|
if (typeof window > "u" || !t.current) return;
|
|
14
|
-
const e = t.current,
|
|
15
|
-
n.current === null && (n.current = e.scrollHeight -
|
|
16
|
-
const
|
|
17
|
-
e.style.height = `${
|
|
18
|
-
}, [o, t,
|
|
13
|
+
const e = t.current, u = r * 2;
|
|
14
|
+
n.current === null && (n.current = e.scrollHeight - u), e.style.removeProperty("height");
|
|
15
|
+
const c = e.scrollHeight, s = Math.min(c, o), i = Math.max(s, n.current);
|
|
16
|
+
e.style.height = `${i + u}px`;
|
|
17
|
+
}, [o, t, r]);
|
|
19
18
|
}
|
|
20
19
|
export {
|
|
21
|
-
|
|
20
|
+
h as useAutosizeTextArea
|
|
22
21
|
};
|