@ctrl-ui/react 0.8.20 → 0.9.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 +1 -0
- package/dist/action-bar.d.ts +1 -2
- package/dist/action-bar.js +7 -8
- package/dist/blocks/design-canvas-inspector.js +4 -1
- package/dist/blocks/file-explorer.js +1 -1
- package/dist/chat-message.js +4 -13
- package/dist/hooks/use-textarea-trigger-menu.d.ts +21 -3
- package/dist/hooks/use-textarea-trigger-menu.js +36 -40
- package/dist/hooks/use-user-ask.d.ts +1 -0
- package/dist/hooks/use-user-ask.js +5 -1
- package/dist/knob-contracts/audio-recorder-knobs.d.ts +1 -1
- package/dist/knob-contracts/audio-recorder-knobs.js +2 -1
- package/dist/knob-contracts/chart-knobs.d.ts +4 -0
- package/dist/knob-contracts/chart-knobs.js +24 -0
- package/dist/knob-contracts/choice-knobs.d.ts +1 -1
- package/dist/knob-contracts/choice-knobs.js +1 -0
- package/dist/knob-contracts/dockable-panel-knobs.d.ts +1 -1
- package/dist/knob-contracts/dockable-panel-knobs.js +2 -1
- package/dist/knob-contracts/emoji-picker-knobs.d.ts +1 -1
- package/dist/knob-contracts/emoji-picker-knobs.js +1 -0
- package/dist/knob-contracts/empty-knobs.d.ts +1 -1
- package/dist/knob-contracts/empty-knobs.js +2 -1
- package/dist/knob-contracts/icon-picker-knobs.d.ts +1 -1
- package/dist/knob-contracts/icon-picker-knobs.js +3 -1
- package/dist/knob-contracts/resizable-knobs.d.ts +1 -1
- package/dist/knob-contracts/resizable-knobs.js +2 -2
- package/dist/knob-contracts/sidebar-knobs.d.ts +1 -1
- package/dist/knob-contracts/sidebar-knobs.js +3 -1
- package/dist/knob-contracts/tabs-knobs.d.ts +1 -1
- package/dist/knob-contracts/tabs-knobs.js +2 -1
- package/dist/knob-contracts/tree-knobs.d.ts +1 -1
- package/dist/knob-contracts/tree-knobs.js +2 -1
- package/dist/lib/color.d.ts +2 -6
- package/dist/lib/color.js +45 -28
- package/dist/lib/contrast.d.ts +6 -0
- package/dist/lib/contrast.js +33 -1
- package/dist/lib/gradient.d.ts +17 -0
- package/dist/lib/gradient.js +69 -0
- package/dist/markdown-editor/drag-handle.js +73 -10
- package/dist/markdown-editor/drag-preview.d.ts +3 -0
- package/dist/markdown-editor/drag-preview.js +31 -0
- package/dist/markdown-editor/extensions.d.ts +2 -2
- package/dist/markdown-editor/extensions.js +25 -3
- package/dist/markdown-editor/suggestions.js +5 -5
- package/dist/markdown-editor/task-item.d.ts +3 -0
- package/dist/markdown-editor/task-item.js +50 -0
- package/dist/markdown-editor/toolbar.js +122 -63
- package/dist/markdown-editor.js +3 -3
- package/dist/skin.d.ts +0 -1
- package/dist/styles/index.css +3 -2
- package/dist/styles/recipes/action-bar.css +1 -1
- package/dist/styles/recipes/activity.css +1 -1
- package/dist/styles/recipes/alert.css +9 -10
- package/dist/styles/recipes/app-shell-header.css +2 -2
- package/dist/styles/recipes/audio-recorder.css +15 -4
- package/dist/styles/recipes/audio-visualizer.css +4 -4
- package/dist/styles/recipes/avatar.css +3 -3
- package/dist/styles/recipes/badge.css +2 -2
- package/dist/styles/recipes/button.css +2 -5
- package/dist/styles/recipes/card.css +0 -2
- package/dist/styles/recipes/chart.css +378 -0
- package/dist/styles/recipes/chat-composer-attachment.css +3 -3
- package/dist/styles/recipes/chat-composer.css +3 -3
- package/dist/styles/recipes/chat-layout.css +2 -2
- package/dist/styles/recipes/chat-message-social.css +1 -1
- package/dist/styles/recipes/chat-message.css +1 -1
- package/dist/styles/recipes/choice.css +9 -3
- package/dist/styles/recipes/code-diff.css +1 -1
- package/dist/styles/recipes/code.css +1 -1
- package/dist/styles/recipes/color-picker-details.css +17 -11
- package/dist/styles/recipes/color-picker-values.css +17 -7
- package/dist/styles/recipes/color-picker.css +88 -70
- package/dist/styles/recipes/context.css +2 -2
- package/dist/styles/recipes/dockable-panel.css +9 -2
- package/dist/styles/recipes/dynamic-notification-motion.css +1 -55
- package/dist/styles/recipes/dynamic-notification.css +0 -1
- package/dist/styles/recipes/emoji-picker.css +35 -19
- package/dist/styles/recipes/empty.css +19 -14
- package/dist/styles/recipes/field-parts.css +2 -2
- package/dist/styles/recipes/field.css +6 -4
- package/dist/styles/recipes/filter-bar.css +10 -10
- package/dist/styles/recipes/flow.css +5 -3
- package/dist/styles/recipes/gradient-editor.css +8 -0
- package/dist/styles/recipes/icon-picker.css +45 -10
- package/dist/styles/recipes/inline-attachment.css +4 -4
- package/dist/styles/recipes/inline-citation.css +2 -2
- package/dist/styles/recipes/item.css +4 -4
- package/dist/styles/recipes/markdown-editor.css +35 -24
- package/dist/styles/recipes/markdown.css +23 -27
- package/dist/styles/recipes/page-layout.css +13 -11
- package/dist/styles/recipes/popup-controls.css +2 -2
- package/dist/styles/recipes/popup-lists.css +3 -3
- package/dist/styles/recipes/popup.css +11 -9
- package/dist/styles/recipes/range.css +4 -5
- package/dist/styles/recipes/resizable.css +15 -10
- package/dist/styles/recipes/resize-handle.css +2 -2
- package/dist/styles/recipes/scroll-area.css +1 -1
- package/dist/styles/recipes/sidebar-menu.css +5 -15
- package/dist/styles/recipes/sidebar-mobile.css +4 -4
- package/dist/styles/recipes/sidebar-parts.css +26 -1
- package/dist/styles/recipes/sidebar.css +18 -31
- package/dist/styles/recipes/skeleton.css +10 -5
- package/dist/styles/recipes/stepper.css +1 -1
- package/dist/styles/recipes/switch.css +12 -11
- package/dist/styles/recipes/table-of-contents.css +6 -8
- package/dist/styles/recipes/table.css +4 -4
- package/dist/styles/recipes/tabs.css +10 -5
- package/dist/styles/recipes/task-list.css +3 -3
- package/dist/styles/recipes/tree.css +10 -3
- package/dist/styles/recipes/user-ask-details.css +5 -4
- package/dist/styles/recipes/user-ask.css +5 -5
- package/dist/styles/theme.css +158 -177
- package/dist/ui/chart-cartesian.d.ts +801 -0
- package/dist/ui/chart-cartesian.js +420 -0
- package/dist/ui/chart-colors.d.ts +7 -0
- package/dist/ui/chart-colors.js +27 -0
- package/dist/ui/chart-curves.d.ts +7 -0
- package/dist/ui/chart-curves.js +87 -0
- package/dist/ui/chart-marks.d.ts +68 -0
- package/dist/ui/chart-marks.js +227 -0
- package/dist/ui/chart-polar.d.ts +103 -0
- package/dist/ui/chart-polar.js +124 -0
- package/dist/ui/chart-series.d.ts +36 -0
- package/dist/ui/chart-series.js +71 -0
- package/dist/ui/chart.d.ts +32 -0
- package/dist/ui/chart.js +257 -0
- package/dist/ui/color-picker-area.d.ts +16 -0
- package/dist/ui/color-picker-area.js +175 -0
- package/dist/ui/color-picker-context.d.ts +27 -0
- package/dist/ui/color-picker-context.js +87 -0
- package/dist/ui/color-picker-contrast.d.ts +20 -0
- package/dist/ui/color-picker-contrast.js +129 -0
- package/dist/ui/color-picker-sliders.d.ts +15 -0
- package/dist/ui/color-picker-sliders.js +146 -0
- package/dist/ui/color-picker-swatches.d.ts +23 -0
- package/dist/ui/color-picker-swatches.js +94 -0
- package/dist/ui/color-picker-values.d.ts +59 -0
- package/dist/ui/color-picker-values.js +244 -0
- package/dist/ui/color-picker.d.ts +15 -110
- package/dist/ui/color-picker.js +30 -759
- package/dist/ui/emoji-picker.d.ts +10 -1
- package/dist/ui/emoji-picker.js +71 -14
- package/dist/ui/flow.js +1 -1
- package/dist/ui/gradient-editor-controls.d.ts +19 -0
- package/dist/ui/gradient-editor-controls.js +75 -0
- package/dist/ui/gradient-editor.d.ts +23 -22
- package/dist/ui/gradient-editor.js +77 -123
- package/dist/ui/icon-picker.d.ts +1 -1
- package/dist/ui/icon-picker.js +11 -6
- package/dist/ui/markdown-elements.d.ts +3 -1
- package/dist/ui/markdown-elements.js +62 -22
- package/dist/ui/markdown-heading.d.ts +9 -0
- package/dist/ui/markdown-heading.js +25 -0
- package/dist/ui/resizable.js +24 -9
- package/dist/ui/sidebar-provider.js +3 -12
- package/dist/ui/typography.d.ts +1 -0
- package/dist/ui/typography.js +12 -3
- package/dist/user-ask.js +4 -8
- package/package.json +7 -3
- package/dist/ui/emoji-icon-picker.d.ts +0 -13
- package/dist/ui/emoji-icon-picker.js +0 -50
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Button } from "../ui/button.js";
|
|
3
|
+
import { ScrollArea } from "../ui/scroll-area.js";
|
|
3
4
|
import { Text } from "../ui/typography.js";
|
|
4
5
|
import { ChatComposerAttachment, ChatComposerAttachments } from "../chat-composer-attachment.js";
|
|
5
6
|
import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from "../ui/popover.js";
|
|
@@ -9,10 +10,11 @@ import { isEditorUrl } from "./extensions.js";
|
|
|
9
10
|
import { markdownImageTypes } from "./uploads.js";
|
|
10
11
|
import { Input } from "../ui/input.js";
|
|
11
12
|
import { Toolbar, ToolbarButton, ToolbarSeparator } from "../ui/toolbar.js";
|
|
13
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
|
|
12
14
|
import { Label } from "../ui/label.js";
|
|
13
15
|
import { useId, useRef, useState } from "react";
|
|
14
16
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { BoldIcon,
|
|
17
|
+
import { BoldIcon, ChevronDownIcon, CodeIcon, ImageIcon, ItalicIcon, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, QuoteIcon, RedoIcon, SquareCodeIcon, StrikethroughIcon, UndoIcon } from "lucide-react";
|
|
16
18
|
import { useEditorState } from "@tiptap/react";
|
|
17
19
|
//#region src/markdown-editor/toolbar.tsx
|
|
18
20
|
function MarkdownEditorToolbar({ children }) {
|
|
@@ -24,7 +26,6 @@ function MarkdownEditorToolbar({ children }) {
|
|
|
24
26
|
italic: current?.isActive("italic"),
|
|
25
27
|
strike: current?.isActive("strike"),
|
|
26
28
|
code: current?.isActive("code"),
|
|
27
|
-
heading: current?.isActive("heading", { level: 2 }),
|
|
28
29
|
bulletList: current?.isActive("bulletList"),
|
|
29
30
|
orderedList: current?.isActive("orderedList"),
|
|
30
31
|
taskList: current?.isActive("taskList"),
|
|
@@ -59,12 +60,6 @@ function MarkdownEditorToolbar({ children }) {
|
|
|
59
60
|
active: state?.code,
|
|
60
61
|
run: () => editor?.chain().focus().toggleCode().run()
|
|
61
62
|
},
|
|
62
|
-
{
|
|
63
|
-
label: "Heading",
|
|
64
|
-
Icon: Heading2Icon,
|
|
65
|
-
active: state?.heading,
|
|
66
|
-
run: () => editor?.chain().focus().toggleHeading({ level: 2 }).run()
|
|
67
|
-
},
|
|
68
63
|
{
|
|
69
64
|
label: "Bullet list",
|
|
70
65
|
Icon: ListIcon,
|
|
@@ -96,53 +91,113 @@ function MarkdownEditorToolbar({ children }) {
|
|
|
96
91
|
run: () => editor?.chain().focus().toggleCodeBlock().run()
|
|
97
92
|
}
|
|
98
93
|
];
|
|
99
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
children:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
94
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx("div", {
|
|
95
|
+
"data-control-ui": "markdown-editor",
|
|
96
|
+
"data-control-family": "markdown-editor",
|
|
97
|
+
"data-slot": "toolbar",
|
|
98
|
+
children: /* @__PURE__ */ jsx(ScrollArea, {
|
|
99
|
+
lockAxis: "y",
|
|
100
|
+
mask: false,
|
|
101
|
+
blur: false,
|
|
102
|
+
children: /* @__PURE__ */ jsxs(Toolbar, {
|
|
103
|
+
"aria-label": "Markdown formatting",
|
|
104
|
+
chrome: "embedded",
|
|
105
|
+
className: "flex w-max min-w-full",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx(MarkdownEditorHeading, {}),
|
|
108
|
+
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
109
|
+
actions.map(({ label, Icon, active, run }) => /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
110
|
+
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
111
|
+
type: "button",
|
|
112
|
+
iconOnly: true,
|
|
113
|
+
"aria-label": label,
|
|
114
|
+
"aria-pressed": Boolean(active),
|
|
115
|
+
disabled: disabled || source || !editor,
|
|
116
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
117
|
+
onClick: run
|
|
118
|
+
}),
|
|
119
|
+
children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" })
|
|
120
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: label })] }, label)),
|
|
121
|
+
/* @__PURE__ */ jsx(MarkdownEditorLink, {}),
|
|
122
|
+
/* @__PURE__ */ jsx(MarkdownEditorImage, {}),
|
|
123
|
+
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
124
|
+
/* @__PURE__ */ jsx(ToolbarButton, {
|
|
125
|
+
type: "button",
|
|
126
|
+
iconOnly: true,
|
|
127
|
+
"aria-label": "Undo",
|
|
128
|
+
disabled: disabled || source || !state?.undo,
|
|
129
|
+
onClick: () => editor?.chain().focus().undo().run(),
|
|
130
|
+
children: /* @__PURE__ */ jsx(UndoIcon, { "aria-hidden": "true" })
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ jsx(ToolbarButton, {
|
|
133
|
+
type: "button",
|
|
134
|
+
iconOnly: true,
|
|
135
|
+
"aria-label": "Redo",
|
|
136
|
+
disabled: disabled || source || !state?.redo,
|
|
137
|
+
onClick: () => editor?.chain().focus().redo().run(),
|
|
138
|
+
children: /* @__PURE__ */ jsx(RedoIcon, { "aria-hidden": "true" })
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ jsx(ToolbarButton, {
|
|
141
|
+
type: "button",
|
|
142
|
+
"aria-pressed": source,
|
|
143
|
+
disabled: disabled || !editor || sourceRequired || uploads.length > 0,
|
|
144
|
+
onClick: () => setSource(!source),
|
|
145
|
+
children: "Markdown source"
|
|
146
|
+
}),
|
|
147
|
+
children
|
|
148
|
+
]
|
|
149
|
+
})
|
|
150
|
+
})
|
|
144
151
|
}) });
|
|
145
152
|
}
|
|
153
|
+
function MarkdownEditorHeading() {
|
|
154
|
+
const { editor, disabled, source } = useMarkdownEditor();
|
|
155
|
+
const level = useEditorState({
|
|
156
|
+
editor,
|
|
157
|
+
selector: ({ editor: current }) => current?.isActive("heading") ? String(current.getAttributes("heading").level) : "paragraph"
|
|
158
|
+
});
|
|
159
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(ToolbarButton, {
|
|
160
|
+
type: "button",
|
|
161
|
+
"aria-label": "Text style",
|
|
162
|
+
disabled: disabled || source || !editor,
|
|
163
|
+
render: /* @__PURE__ */ jsx(DropdownMenuTrigger, {}),
|
|
164
|
+
children: [/* @__PURE__ */ jsx("span", { children: level && level !== "paragraph" ? `H${level}` : "Text" }), /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" })]
|
|
165
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
166
|
+
finalFocus: () => editor?.view.dom ?? true,
|
|
167
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuRadioGroup, {
|
|
168
|
+
value: level ?? "paragraph",
|
|
169
|
+
onValueChange: (value) => {
|
|
170
|
+
if (!editor || disabled || source) return;
|
|
171
|
+
const heading = [
|
|
172
|
+
1,
|
|
173
|
+
2,
|
|
174
|
+
3,
|
|
175
|
+
4,
|
|
176
|
+
5,
|
|
177
|
+
6
|
|
178
|
+
].find((item) => String(item) === value);
|
|
179
|
+
if (heading) editor.chain().focus().setHeading({ level: heading }).run();
|
|
180
|
+
else editor.chain().focus().setParagraph().run();
|
|
181
|
+
},
|
|
182
|
+
children: [/* @__PURE__ */ jsx(DropdownMenuRadioItem, {
|
|
183
|
+
value: "paragraph",
|
|
184
|
+
closeOnClick: true,
|
|
185
|
+
children: "Paragraph"
|
|
186
|
+
}), [
|
|
187
|
+
1,
|
|
188
|
+
2,
|
|
189
|
+
3,
|
|
190
|
+
4,
|
|
191
|
+
5,
|
|
192
|
+
6
|
|
193
|
+
].map((item) => /* @__PURE__ */ jsxs(DropdownMenuRadioItem, {
|
|
194
|
+
value: String(item),
|
|
195
|
+
closeOnClick: true,
|
|
196
|
+
children: ["Heading ", item]
|
|
197
|
+
}, item))]
|
|
198
|
+
})
|
|
199
|
+
})] });
|
|
200
|
+
}
|
|
146
201
|
function MarkdownEditorLink() {
|
|
147
202
|
const { editor, disabled, source } = useMarkdownEditor();
|
|
148
203
|
const [open, setOpen] = useState(false);
|
|
@@ -160,18 +215,20 @@ function MarkdownEditorLink() {
|
|
|
160
215
|
setOpen(next);
|
|
161
216
|
if (next) setUrl(editor?.getAttributes("link").href ?? "");
|
|
162
217
|
},
|
|
163
|
-
children: [/* @__PURE__ */ jsx(
|
|
164
|
-
disabled: disabled || source || !editor,
|
|
218
|
+
children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
165
219
|
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
166
220
|
type: "button",
|
|
167
221
|
iconOnly: true,
|
|
168
|
-
"aria-label": "Edit link"
|
|
222
|
+
"aria-label": "Edit link",
|
|
223
|
+
disabled: disabled || source || !editor,
|
|
224
|
+
render: /* @__PURE__ */ jsx(PopoverTrigger, {})
|
|
169
225
|
}),
|
|
170
226
|
children: /* @__PURE__ */ jsx(LinkIcon, { "aria-hidden": "true" })
|
|
171
|
-
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
227
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: "Edit link" })] }), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
228
|
+
finalFocus: () => editor?.view.dom ?? true,
|
|
172
229
|
className: "grid gap-3",
|
|
173
230
|
onKeyDown: (event) => {
|
|
174
|
-
if (event.key === "Enter") {
|
|
231
|
+
if (event.key === "Enter" && event.target instanceof HTMLInputElement && !event.nativeEvent.isComposing) {
|
|
175
232
|
event.preventDefault();
|
|
176
233
|
event.stopPropagation();
|
|
177
234
|
apply();
|
|
@@ -233,18 +290,20 @@ function MarkdownEditorImage() {
|
|
|
233
290
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
234
291
|
open,
|
|
235
292
|
onOpenChange: setOpen,
|
|
236
|
-
children: [/* @__PURE__ */ jsx(
|
|
237
|
-
disabled: disabled || source || !editor,
|
|
293
|
+
children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
238
294
|
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
239
295
|
type: "button",
|
|
240
296
|
iconOnly: true,
|
|
241
|
-
"aria-label": "Insert image"
|
|
297
|
+
"aria-label": "Insert image",
|
|
298
|
+
disabled: disabled || source || !editor,
|
|
299
|
+
render: /* @__PURE__ */ jsx(PopoverTrigger, {})
|
|
242
300
|
}),
|
|
243
301
|
children: /* @__PURE__ */ jsx(ImageIcon, { "aria-hidden": "true" })
|
|
244
|
-
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
302
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: "Insert image" })] }), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
303
|
+
finalFocus: () => editor?.view.dom ?? true,
|
|
245
304
|
className: "grid gap-3",
|
|
246
305
|
onKeyDown: (event) => {
|
|
247
|
-
if (event.key === "Enter") {
|
|
306
|
+
if (event.key === "Enter" && event.target instanceof HTMLInputElement && !event.nativeEvent.isComposing) {
|
|
248
307
|
event.preventDefault();
|
|
249
308
|
event.stopPropagation();
|
|
250
309
|
insert();
|
package/dist/markdown-editor.js
CHANGED
|
@@ -73,11 +73,11 @@ function MarkdownEditor({ value, defaultValue = "", onValueChange, disabled = fa
|
|
|
73
73
|
handlers.current = imageUploads;
|
|
74
74
|
});
|
|
75
75
|
useEffect(() => {
|
|
76
|
-
if (!editor) return;
|
|
76
|
+
if (!editor || editor.isDestroyed) return;
|
|
77
77
|
editor.setEditable(!disabled, false);
|
|
78
78
|
}, [editor, disabled]);
|
|
79
79
|
useEffect(() => {
|
|
80
|
-
if (!editor) return;
|
|
80
|
+
if (!editor || editor.isDestroyed) return;
|
|
81
81
|
const externalReset = lastValue.current !== markdown;
|
|
82
82
|
if (externalReset) handlers.current?.cancelAll();
|
|
83
83
|
if (source) {
|
|
@@ -158,7 +158,7 @@ function MarkdownEditorContent({ label, placeholder, autoFocus = false, classNam
|
|
|
158
158
|
placeholder
|
|
159
159
|
]);
|
|
160
160
|
useEffect(() => {
|
|
161
|
-
if (editor && autoFocus && !source && !disabled) editor.commands.focus("end");
|
|
161
|
+
if (editor && !editor.isDestroyed && autoFocus && !source && !disabled) editor.commands.focus("end");
|
|
162
162
|
}, [
|
|
163
163
|
editor,
|
|
164
164
|
autoFocus,
|
package/dist/skin.d.ts
CHANGED
|
@@ -41,7 +41,6 @@ export type ControlUiSkin = {
|
|
|
41
41
|
scrollAreaScrollbarVisibility?: "scroll" | "hover" | "always";
|
|
42
42
|
scrollAreaScrollbarGutter?: "auto" | "stable";
|
|
43
43
|
indicators?: SkinIndicators;
|
|
44
|
-
sidebarWidth?: string;
|
|
45
44
|
effects?: ControlEffect[];
|
|
46
45
|
adornments?: { [Scope in SkinAdornmentScope]?: { [Part in SkinAdornmentPart<Scope>]?: AdornmentEntry<SkinAdornmentContexts[Scope][Part]>; }; };
|
|
47
46
|
};
|
package/dist/styles/index.css
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
@import "./recipes/button-group.css";
|
|
34
34
|
@import "./recipes/calendar.css";
|
|
35
35
|
@import "./recipes/card.css";
|
|
36
|
+
@import "./recipes/chart.css";
|
|
36
37
|
@import "./recipes/chat-message.css";
|
|
37
38
|
@import "./recipes/chat-message-edit.css";
|
|
38
39
|
@import "./recipes/chat-message-social.css";
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
@import "./recipes/color-picker.css";
|
|
49
50
|
@import "./recipes/color-picker-details.css";
|
|
50
51
|
@import "./recipes/color-picker-values.css";
|
|
52
|
+
@import "./recipes/gradient-editor.css";
|
|
51
53
|
@import "./recipes/empty.css";
|
|
52
54
|
@import "./recipes/context.css";
|
|
53
55
|
@import "./recipes/infinite-canvas.css";
|
|
@@ -64,13 +66,12 @@
|
|
|
64
66
|
@import "./recipes/dynamic-notification.css";
|
|
65
67
|
@import "./recipes/dynamic-notification-input.css";
|
|
66
68
|
@import "./recipes/dynamic-notification-motion.css";
|
|
67
|
-
@import "./recipes/emoji-picker.css";
|
|
68
69
|
@import "./recipes/icon-picker.css";
|
|
69
70
|
@import "./recipes/tabs.css";
|
|
70
71
|
@import "./recipes/tabs-motion.css";
|
|
72
|
+
@import "./recipes/emoji-picker.css";
|
|
71
73
|
@import "./recipes/filter-bar.css";
|
|
72
74
|
@import "./recipes/flow.css";
|
|
73
|
-
@import "./recipes/gradient-editor.css";
|
|
74
75
|
@import "./recipes/inline-attachment.css";
|
|
75
76
|
@import "./recipes/source-badge.css";
|
|
76
77
|
@import "./recipes/inline-citation.css";
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
@property --cui-alert-background {
|
|
75
|
-
syntax: "
|
|
75
|
+
syntax: "<color>";
|
|
76
76
|
inherits: true;
|
|
77
77
|
initial-value: transparent;
|
|
78
78
|
}
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
@property --cui-alert-shadow {
|
|
87
87
|
syntax: "*";
|
|
88
88
|
inherits: true;
|
|
89
|
-
initial-value: none;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
@property --cui-alert-foreground {
|
|
@@ -108,43 +107,43 @@
|
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
@property --cui-alert-padding {
|
|
111
|
-
syntax: "<length>";
|
|
110
|
+
syntax: "<length-percentage>";
|
|
112
111
|
inherits: true;
|
|
113
112
|
initial-value: 0px;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
@property --cui-alert-padding-inline {
|
|
117
|
-
syntax: "<length>";
|
|
116
|
+
syntax: "<length-percentage>";
|
|
118
117
|
inherits: true;
|
|
119
118
|
initial-value: 0px;
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
@property --cui-alert-gap {
|
|
123
|
-
syntax: "<length>";
|
|
122
|
+
syntax: "<length-percentage>";
|
|
124
123
|
inherits: true;
|
|
125
124
|
initial-value: 0px;
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
@property --cui-alert-icon-gap {
|
|
129
|
-
syntax: "<length>";
|
|
128
|
+
syntax: "<length-percentage>";
|
|
130
129
|
inherits: true;
|
|
131
130
|
initial-value: 0px;
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
@property --cui-alert-icon-size {
|
|
135
|
-
syntax: "<length>";
|
|
134
|
+
syntax: "<length-percentage>";
|
|
136
135
|
inherits: true;
|
|
137
136
|
initial-value: 0px;
|
|
138
137
|
}
|
|
139
138
|
|
|
140
139
|
@property --cui-alert-font-size {
|
|
141
|
-
syntax: "<length>";
|
|
140
|
+
syntax: "<length-percentage>";
|
|
142
141
|
inherits: true;
|
|
143
142
|
initial-value: 0px;
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
@property --cui-alert-description-gap {
|
|
147
|
-
syntax: "<length>";
|
|
146
|
+
syntax: "<length-percentage>";
|
|
148
147
|
inherits: true;
|
|
149
148
|
initial-value: 0px;
|
|
150
149
|
}
|
|
@@ -152,5 +151,5 @@
|
|
|
152
151
|
@property --cui-alert-title-font-weight {
|
|
153
152
|
syntax: "<number>";
|
|
154
153
|
inherits: true;
|
|
155
|
-
initial-value:
|
|
154
|
+
initial-value: 400;
|
|
156
155
|
}
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@property --cui-app-shell-header-height {
|
|
16
|
-
syntax: "<length>";
|
|
16
|
+
syntax: "<length-percentage>";
|
|
17
17
|
inherits: true;
|
|
18
18
|
initial-value: 0px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
@property --cui-app-shell-header-padding-inline {
|
|
22
|
-
syntax: "<length>";
|
|
22
|
+
syntax: "<length-percentage>";
|
|
23
23
|
inherits: true;
|
|
24
24
|
initial-value: 0px;
|
|
25
25
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
:where([data-control-ui="audio-recorder"][data-slot="root"]) {
|
|
3
|
-
--cui-audio-recorder-
|
|
3
|
+
--cui-audio-recorder-recording-foreground: var(--foreground);
|
|
4
|
+
--cui-audio-recorder-recorded-foreground: var(--foreground);
|
|
4
5
|
--cui-audio-recorder-foreground: var(--muted-foreground);
|
|
5
6
|
--cui-audio-recorder-recording-ring-color: oklch(from var(--destructive) l c h / 0.25);
|
|
6
7
|
--cui-audio-recorder-error-foreground: var(--destructive-text);
|
|
@@ -16,8 +17,12 @@
|
|
|
16
17
|
gap: calc(var(--spacing) * 1);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
:where([data-control-ui="audio-recorder"][data-slot="root"]
|
|
20
|
-
color: var(--cui-audio-recorder-
|
|
20
|
+
:where([data-control-ui="audio-recorder"][data-slot="root"][data-state="recording"]) {
|
|
21
|
+
color: var(--cui-audio-recorder-recording-foreground);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where([data-control-ui="audio-recorder"][data-slot="root"][data-state="recorded"]) {
|
|
25
|
+
color: var(--cui-audio-recorder-recorded-foreground);
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
:where([data-control-ui="audio-recorder"][data-slot="trigger"][data-recorder-state="recording"]) {
|
|
@@ -89,7 +94,13 @@
|
|
|
89
94
|
initial-value: transparent;
|
|
90
95
|
}
|
|
91
96
|
|
|
92
|
-
@property --cui-audio-recorder-
|
|
97
|
+
@property --cui-audio-recorder-recording-foreground {
|
|
98
|
+
syntax: "<color>";
|
|
99
|
+
inherits: true;
|
|
100
|
+
initial-value: transparent;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@property --cui-audio-recorder-recorded-foreground {
|
|
93
104
|
syntax: "<color>";
|
|
94
105
|
inherits: true;
|
|
95
106
|
initial-value: transparent;
|
|
@@ -155,15 +155,15 @@
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
@property --cui-audio-visualizer-bar-size {
|
|
158
|
-
syntax: "<length>";
|
|
158
|
+
syntax: "<length-percentage>";
|
|
159
159
|
inherits: true;
|
|
160
|
-
initial-value:
|
|
160
|
+
initial-value: 0px;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
@property --cui-audio-visualizer-bar-gap {
|
|
164
|
-
syntax: "<length>";
|
|
164
|
+
syntax: "<length-percentage>";
|
|
165
165
|
inherits: true;
|
|
166
|
-
initial-value:
|
|
166
|
+
initial-value: 0px;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
@property --cui-audio-visualizer-radius {
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
:where([data-control-family="avatar"][data-slot="badge"][data-status="online"]) {
|
|
63
|
-
--cui-avatar-badge-background: var(--success
|
|
63
|
+
--cui-avatar-badge-background: var(--success);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
:where([data-control-family="avatar"][data-slot="badge"][data-status="away"]) {
|
|
67
|
-
--cui-avatar-badge-background: var(--warning
|
|
67
|
+
--cui-avatar-badge-background: var(--warning);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
:where([data-control-family="avatar"][data-slot="badge"][data-status="busy"]) {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
@property --cui-avatar-badge-ring-size {
|
|
124
|
-
syntax: "<length>";
|
|
124
|
+
syntax: "<length-percentage>";
|
|
125
125
|
inherits: true;
|
|
126
126
|
initial-value: 0px;
|
|
127
127
|
}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
@property --cui-badge-background {
|
|
99
|
-
syntax: "
|
|
99
|
+
syntax: "<color>";
|
|
100
100
|
inherits: true;
|
|
101
101
|
initial-value: transparent;
|
|
102
102
|
}
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
@property --cui-badge-font-size {
|
|
117
|
-
syntax: "<length>";
|
|
117
|
+
syntax: "<length-percentage>";
|
|
118
118
|
inherits: true;
|
|
119
119
|
initial-value: 0px;
|
|
120
120
|
}
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
@property --cui-button-icon {
|
|
221
221
|
syntax: "<length>";
|
|
222
222
|
inherits: true;
|
|
223
|
-
initial-value:
|
|
223
|
+
initial-value: 0px;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
@property --cui-button-height {
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
@property --cui-button-font-size {
|
|
245
245
|
syntax: "<length-percentage>";
|
|
246
246
|
inherits: true;
|
|
247
|
-
initial-value:
|
|
247
|
+
initial-value: 0px;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
@property --cui-button-background {
|
|
@@ -319,13 +319,11 @@
|
|
|
319
319
|
@property --cui-button-hover-shadow {
|
|
320
320
|
syntax: "*";
|
|
321
321
|
inherits: true;
|
|
322
|
-
initial-value: none;
|
|
323
322
|
}
|
|
324
323
|
|
|
325
324
|
@property --cui-button-press-shadow {
|
|
326
325
|
syntax: "*";
|
|
327
326
|
inherits: true;
|
|
328
|
-
initial-value: none;
|
|
329
327
|
}
|
|
330
328
|
|
|
331
329
|
@property --cui-button-active-shadow {
|
|
@@ -348,5 +346,4 @@
|
|
|
348
346
|
@property --cui-button-open-shadow {
|
|
349
347
|
syntax: "*";
|
|
350
348
|
inherits: true;
|
|
351
|
-
initial-value: none;
|
|
352
349
|
}
|