@ctrl-ui/react 0.9.5 → 0.9.6
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 +2 -2
- package/dist/action-bar.js +16 -8
- package/dist/activity.d.ts +1 -1
- package/dist/activity.js +3 -1
- package/dist/audio-visualizer.js +1 -1
- package/dist/blocks/agent-run-clock.d.ts +5 -0
- package/dist/blocks/agent-run-clock.js +52 -0
- package/dist/blocks/agent-run-sidebar.d.ts +13 -0
- package/dist/blocks/agent-run-sidebar.js +100 -0
- package/dist/blocks/agent-run-status.d.ts +32 -0
- package/dist/blocks/agent-run-status.js +27 -0
- package/dist/blocks/agent-run.d.ts +80 -0
- package/dist/blocks/agent-run.js +254 -0
- package/dist/blocks/coding-agent.d.ts +1 -1
- package/dist/blocks/design-canvas-data.d.ts +1 -1
- package/dist/blocks/design-canvas.d.ts +2 -1
- package/dist/blocks/design-canvas.js +15 -8
- package/dist/chat-message.js +33 -39
- package/dist/knob-contracts/infinite-canvas-knobs.d.ts +1 -1
- package/dist/knob-contracts/infinite-canvas-knobs.js +1 -7
- package/dist/knob-contracts/swap-knobs.d.ts +4 -0
- package/dist/knob-contracts/swap-knobs.js +9 -0
- package/dist/knob-contracts/timeline-knobs.d.ts +1 -1
- package/dist/knob-contracts/timeline-knobs.js +1 -0
- package/dist/knob-contracts/tool-approval-knobs.d.ts +4 -0
- package/dist/knob-contracts/tool-approval-knobs.js +32 -0
- package/dist/lib/infinite-canvas-camera-store.d.ts +65 -0
- package/dist/lib/infinite-canvas-camera-store.js +233 -0
- package/dist/lib/infinite-canvas-camera.d.ts +33 -0
- package/dist/lib/infinite-canvas-camera.js +98 -0
- package/dist/lib/infinite-canvas-navigation.d.ts +19 -0
- package/dist/lib/infinite-canvas-navigation.js +395 -0
- package/dist/markdown-editor/bubble-menu.d.ts +6 -0
- package/dist/markdown-editor/bubble-menu.js +45 -0
- package/dist/markdown-editor/toolbar.d.ts +17 -1
- package/dist/markdown-editor/toolbar.js +103 -81
- package/dist/styles/index.css +10 -8
- package/dist/styles/recipes/activity.css +8 -0
- package/dist/styles/recipes/button-group.css +12 -6
- package/dist/styles/recipes/button.css +12 -2
- package/dist/styles/recipes/chat-message-edit.css +6 -21
- package/dist/styles/recipes/infinite-canvas.css +17 -57
- package/dist/styles/recipes/markdown-editor.css +12 -0
- package/dist/styles/recipes/swap.css +143 -0
- package/dist/styles/recipes/timeline.css +11 -0
- package/dist/styles/recipes/tool-approval.css +267 -0
- package/dist/styles/recipes/track-highlight.css +19 -6
- package/dist/styles/theme.css +6 -5
- package/dist/styles/type-scale.css +1 -1
- package/dist/tool-approval.d.ts +49 -0
- package/dist/tool-approval.js +260 -0
- package/dist/ui/code.js +13 -3
- package/dist/ui/command.js +1 -0
- package/dist/ui/infinite-canvas.d.ts +19 -22
- package/dist/ui/infinite-canvas.js +264 -325
- package/dist/ui/rich-tooltip.d.ts +2 -1
- package/dist/ui/rich-tooltip.js +32 -29
- package/dist/ui/swap.d.ts +14 -0
- package/dist/ui/swap.js +69 -0
- package/dist/ui/timeline.d.ts +1 -1
- package/dist/ui/timeline.js +1 -1
- package/dist/user-ask.js +1 -1
- package/lint/no-raw-type-classes.grit +2 -2
- package/package.json +2 -2
|
@@ -17,80 +17,110 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
import { BoldIcon, ChevronDownIcon, CodeIcon, ImageIcon, ItalicIcon, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, QuoteIcon, RedoIcon, SquareCodeIcon, StrikethroughIcon, UndoIcon } from "lucide-react";
|
|
18
18
|
import { useEditorState } from "@tiptap/react";
|
|
19
19
|
//#region src/markdown-editor/toolbar.tsx
|
|
20
|
+
function useMarkdownEditorFormatActions() {
|
|
21
|
+
const { editor } = useMarkdownEditor();
|
|
22
|
+
const state = useEditorState({
|
|
23
|
+
editor,
|
|
24
|
+
selector: ({ editor: current }) => ({
|
|
25
|
+
bold: Boolean(current?.isActive("bold")),
|
|
26
|
+
italic: Boolean(current?.isActive("italic")),
|
|
27
|
+
strike: Boolean(current?.isActive("strike")),
|
|
28
|
+
code: Boolean(current?.isActive("code")),
|
|
29
|
+
bulletList: Boolean(current?.isActive("bulletList")),
|
|
30
|
+
orderedList: Boolean(current?.isActive("orderedList")),
|
|
31
|
+
taskList: Boolean(current?.isActive("taskList")),
|
|
32
|
+
blockquote: Boolean(current?.isActive("blockquote")),
|
|
33
|
+
codeBlock: Boolean(current?.isActive("codeBlock"))
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
const focused = () => editor?.chain().focus();
|
|
37
|
+
return {
|
|
38
|
+
marks: [
|
|
39
|
+
{
|
|
40
|
+
label: "Bold",
|
|
41
|
+
Icon: BoldIcon,
|
|
42
|
+
active: Boolean(state?.bold),
|
|
43
|
+
run: () => focused()?.toggleBold().run()
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Italic",
|
|
47
|
+
Icon: ItalicIcon,
|
|
48
|
+
active: Boolean(state?.italic),
|
|
49
|
+
run: () => focused()?.toggleItalic().run()
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "Strikethrough",
|
|
53
|
+
Icon: StrikethroughIcon,
|
|
54
|
+
active: Boolean(state?.strike),
|
|
55
|
+
run: () => focused()?.toggleStrike().run()
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Inline code",
|
|
59
|
+
Icon: CodeIcon,
|
|
60
|
+
active: Boolean(state?.code),
|
|
61
|
+
run: () => focused()?.toggleCode().run()
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
blocks: [
|
|
65
|
+
{
|
|
66
|
+
label: "Bullet list",
|
|
67
|
+
Icon: ListIcon,
|
|
68
|
+
active: Boolean(state?.bulletList),
|
|
69
|
+
run: () => focused()?.toggleBulletList().run()
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "Numbered list",
|
|
73
|
+
Icon: ListOrderedIcon,
|
|
74
|
+
active: Boolean(state?.orderedList),
|
|
75
|
+
run: () => focused()?.toggleOrderedList().run()
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "Task list",
|
|
79
|
+
Icon: ListChecksIcon,
|
|
80
|
+
active: Boolean(state?.taskList),
|
|
81
|
+
run: () => focused()?.toggleTaskList().run()
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: "Quote",
|
|
85
|
+
Icon: QuoteIcon,
|
|
86
|
+
active: Boolean(state?.blockquote),
|
|
87
|
+
run: () => focused()?.toggleBlockquote().run()
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: "Code block",
|
|
91
|
+
Icon: SquareCodeIcon,
|
|
92
|
+
active: Boolean(state?.codeBlock),
|
|
93
|
+
run: () => focused()?.toggleCodeBlock().run()
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function MarkdownEditorFormatButton({ action, onMouseDown }) {
|
|
99
|
+
const { editor, disabled, source } = useMarkdownEditor();
|
|
100
|
+
const { label, Icon, active, run } = action;
|
|
101
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
102
|
+
render: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
103
|
+
type: "button",
|
|
104
|
+
iconOnly: true,
|
|
105
|
+
"aria-label": label,
|
|
106
|
+
"aria-pressed": active,
|
|
107
|
+
disabled: disabled || source || !editor,
|
|
108
|
+
onMouseDown,
|
|
109
|
+
onClick: run
|
|
110
|
+
}),
|
|
111
|
+
children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" })
|
|
112
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: label })] });
|
|
113
|
+
}
|
|
20
114
|
function MarkdownEditorToolbar({ children }) {
|
|
21
115
|
const { editor, disabled, source, sourceRequired, setSource, uploads } = useMarkdownEditor();
|
|
22
|
-
const
|
|
116
|
+
const { marks, blocks } = useMarkdownEditorFormatActions();
|
|
117
|
+
const history = useEditorState({
|
|
23
118
|
editor,
|
|
24
119
|
selector: ({ editor: current }) => ({
|
|
25
|
-
bold: current?.isActive("bold"),
|
|
26
|
-
italic: current?.isActive("italic"),
|
|
27
|
-
strike: current?.isActive("strike"),
|
|
28
|
-
code: current?.isActive("code"),
|
|
29
|
-
bulletList: current?.isActive("bulletList"),
|
|
30
|
-
orderedList: current?.isActive("orderedList"),
|
|
31
|
-
taskList: current?.isActive("taskList"),
|
|
32
|
-
blockquote: current?.isActive("blockquote"),
|
|
33
|
-
codeBlock: current?.isActive("codeBlock"),
|
|
34
120
|
undo: current?.can().undo(),
|
|
35
121
|
redo: current?.can().redo()
|
|
36
122
|
})
|
|
37
123
|
});
|
|
38
|
-
const actions = [
|
|
39
|
-
{
|
|
40
|
-
label: "Bold",
|
|
41
|
-
Icon: BoldIcon,
|
|
42
|
-
active: state?.bold,
|
|
43
|
-
run: () => editor?.chain().focus().toggleBold().run()
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
label: "Italic",
|
|
47
|
-
Icon: ItalicIcon,
|
|
48
|
-
active: state?.italic,
|
|
49
|
-
run: () => editor?.chain().focus().toggleItalic().run()
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: "Strikethrough",
|
|
53
|
-
Icon: StrikethroughIcon,
|
|
54
|
-
active: state?.strike,
|
|
55
|
-
run: () => editor?.chain().focus().toggleStrike().run()
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: "Inline code",
|
|
59
|
-
Icon: CodeIcon,
|
|
60
|
-
active: state?.code,
|
|
61
|
-
run: () => editor?.chain().focus().toggleCode().run()
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: "Bullet list",
|
|
65
|
-
Icon: ListIcon,
|
|
66
|
-
active: state?.bulletList,
|
|
67
|
-
run: () => editor?.chain().focus().toggleBulletList().run()
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
label: "Numbered list",
|
|
71
|
-
Icon: ListOrderedIcon,
|
|
72
|
-
active: state?.orderedList,
|
|
73
|
-
run: () => editor?.chain().focus().toggleOrderedList().run()
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "Task list",
|
|
77
|
-
Icon: ListChecksIcon,
|
|
78
|
-
active: state?.taskList,
|
|
79
|
-
run: () => editor?.chain().focus().toggleTaskList().run()
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
label: "Quote",
|
|
83
|
-
Icon: QuoteIcon,
|
|
84
|
-
active: state?.blockquote,
|
|
85
|
-
run: () => editor?.chain().focus().toggleBlockquote().run()
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
label: "Code block",
|
|
89
|
-
Icon: SquareCodeIcon,
|
|
90
|
-
active: state?.codeBlock,
|
|
91
|
-
run: () => editor?.chain().focus().toggleCodeBlock().run()
|
|
92
|
-
}
|
|
93
|
-
];
|
|
94
124
|
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx("div", {
|
|
95
125
|
"data-control-ui": "markdown-editor",
|
|
96
126
|
"data-control-family": "markdown-editor",
|
|
@@ -106,18 +136,10 @@ function MarkdownEditorToolbar({ children }) {
|
|
|
106
136
|
children: [
|
|
107
137
|
/* @__PURE__ */ jsx(MarkdownEditorHeading, {}),
|
|
108
138
|
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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)),
|
|
139
|
+
[...marks, ...blocks].map((action) => /* @__PURE__ */ jsx(MarkdownEditorFormatButton, {
|
|
140
|
+
action,
|
|
141
|
+
onMouseDown: (event) => event.preventDefault()
|
|
142
|
+
}, action.label)),
|
|
121
143
|
/* @__PURE__ */ jsx(MarkdownEditorLink, {}),
|
|
122
144
|
/* @__PURE__ */ jsx(MarkdownEditorImage, {}),
|
|
123
145
|
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
@@ -125,7 +147,7 @@ function MarkdownEditorToolbar({ children }) {
|
|
|
125
147
|
type: "button",
|
|
126
148
|
iconOnly: true,
|
|
127
149
|
"aria-label": "Undo",
|
|
128
|
-
disabled: disabled || source || !
|
|
150
|
+
disabled: disabled || source || !history?.undo,
|
|
129
151
|
onClick: () => editor?.chain().focus().undo().run(),
|
|
130
152
|
children: /* @__PURE__ */ jsx(UndoIcon, { "aria-hidden": "true" })
|
|
131
153
|
}),
|
|
@@ -133,7 +155,7 @@ function MarkdownEditorToolbar({ children }) {
|
|
|
133
155
|
type: "button",
|
|
134
156
|
iconOnly: true,
|
|
135
157
|
"aria-label": "Redo",
|
|
136
|
-
disabled: disabled || source || !
|
|
158
|
+
disabled: disabled || source || !history?.redo,
|
|
137
159
|
onClick: () => editor?.chain().focus().redo().run(),
|
|
138
160
|
children: /* @__PURE__ */ jsx(RedoIcon, { "aria-hidden": "true" })
|
|
139
161
|
}),
|
|
@@ -395,4 +417,4 @@ function MarkdownEditorUploads() {
|
|
|
395
417
|
}) : null] });
|
|
396
418
|
}
|
|
397
419
|
//#endregion
|
|
398
|
-
export { MarkdownEditorImage, MarkdownEditorLink, MarkdownEditorToolbar, MarkdownEditorUploads };
|
|
420
|
+
export { MarkdownEditorFormatButton, MarkdownEditorHeading, MarkdownEditorImage, MarkdownEditorLink, MarkdownEditorToolbar, MarkdownEditorUploads, useMarkdownEditorFormatActions };
|
package/dist/styles/index.css
CHANGED
|
@@ -2,37 +2,39 @@
|
|
|
2
2
|
@import "./recipes/accordion.css";
|
|
3
3
|
@import "./recipes/button.css";
|
|
4
4
|
@import "./recipes/button-states.css";
|
|
5
|
+
@import "./recipes/swap.css";
|
|
5
6
|
@import "./recipes/action-bar.css";
|
|
6
7
|
@import "./recipes/collapsible.css";
|
|
7
8
|
@import "./effects.css";
|
|
8
9
|
@import "./recipes/progressive-blur.css";
|
|
9
10
|
@import "./recipes/scroll-area.css";
|
|
10
11
|
@import "./recipes/activity.css";
|
|
11
|
-
@import "./recipes/
|
|
12
|
+
@import "./recipes/badge.css";
|
|
13
|
+
@import "./recipes/card.css";
|
|
12
14
|
@import "./recipes/popup.css";
|
|
13
15
|
@import "./recipes/popup-controls.css";
|
|
16
|
+
@import "./recipes/popup-drawer.css";
|
|
14
17
|
@import "./recipes/popup-lists.css";
|
|
15
18
|
@import "./recipes/popup-motion.css";
|
|
16
|
-
@import "./recipes/page-layout.css";
|
|
17
|
-
@import "./recipes/popup-drawer.css";
|
|
18
19
|
@import "./recipes/track-highlight.css";
|
|
19
20
|
@import "./recipes/sidebar.css";
|
|
20
21
|
@import "./recipes/sidebar-menu.css";
|
|
21
22
|
@import "./recipes/sidebar-mobile.css";
|
|
22
23
|
@import "./recipes/sidebar-parts.css";
|
|
24
|
+
@import "./recipes/timeline.css";
|
|
25
|
+
@import "./type-scale.css";
|
|
26
|
+
@import "./recipes/alert.css";
|
|
27
|
+
@import "./recipes/page-layout.css";
|
|
23
28
|
@import "./recipes/app-shell-header.css";
|
|
24
29
|
@import "./recipes/field.css";
|
|
25
30
|
@import "./recipes/field-parts.css";
|
|
26
|
-
@import "./type-scale.css";
|
|
27
31
|
@import "./recipes/audio-device-select.css";
|
|
28
32
|
@import "./recipes/audio-visualizer.css";
|
|
29
33
|
@import "./recipes/audio-recorder.css";
|
|
30
34
|
@import "./recipes/avatar.css";
|
|
31
|
-
@import "./recipes/badge.css";
|
|
32
35
|
@import "./recipes/breadcrumb.css";
|
|
33
36
|
@import "./recipes/button-group.css";
|
|
34
37
|
@import "./recipes/calendar.css";
|
|
35
|
-
@import "./recipes/card.css";
|
|
36
38
|
@import "./recipes/channel-strip.css";
|
|
37
39
|
@import "./recipes/chart.css";
|
|
38
40
|
@import "./recipes/chat-message.css";
|
|
@@ -53,10 +55,10 @@
|
|
|
53
55
|
@import "./recipes/gradient-editor.css";
|
|
54
56
|
@import "./recipes/empty.css";
|
|
55
57
|
@import "./recipes/context.css";
|
|
58
|
+
@import "./recipes/toolbar.css";
|
|
56
59
|
@import "./recipes/infinite-canvas.css";
|
|
57
60
|
@import "./recipes/resizable.css";
|
|
58
61
|
@import "./recipes/separator.css";
|
|
59
|
-
@import "./recipes/toolbar.css";
|
|
60
62
|
@import "./recipes/kbd.css";
|
|
61
63
|
@import "./recipes/markdown.css";
|
|
62
64
|
@import "./recipes/label.css";
|
|
@@ -91,8 +93,8 @@
|
|
|
91
93
|
@import "./recipes/table-of-contents.css";
|
|
92
94
|
@import "./recipes/task-list.css";
|
|
93
95
|
@import "./recipes/thread-rail.css";
|
|
94
|
-
@import "./recipes/timeline.css";
|
|
95
96
|
@import "./recipes/popup-toast.css";
|
|
97
|
+
@import "./recipes/tool-approval.css";
|
|
96
98
|
@import "./recipes/transcript-divider.css";
|
|
97
99
|
@import "./recipes/tree.css";
|
|
98
100
|
@import "./recipes/user-ask.css";
|
|
@@ -72,6 +72,10 @@
|
|
|
72
72
|
color: var(--destructive-text);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
:where([data-control-family="activity"][data-slot="root"][data-activity-state="waiting"] [data-slot="icon"]) {
|
|
76
|
+
color: var(--warning-text);
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
:where([data-control-family="activity"][data-slot="title"]) {
|
|
76
80
|
color: currentColor;
|
|
77
81
|
font-size: var(--text-label);
|
|
@@ -87,6 +91,10 @@
|
|
|
87
91
|
color: var(--destructive-text);
|
|
88
92
|
}
|
|
89
93
|
|
|
94
|
+
:where([data-control-family="activity"][data-slot="status"][data-status="waiting"]) {
|
|
95
|
+
color: var(--warning-text);
|
|
96
|
+
}
|
|
97
|
+
|
|
90
98
|
:where([data-control-family="activity"][data-slot="detail-label"]) {
|
|
91
99
|
color: var(--muted-foreground);
|
|
92
100
|
font-size: var(--text-micro);
|
|
@@ -44,30 +44,36 @@
|
|
|
44
44
|
|
|
45
45
|
:where(
|
|
46
46
|
[data-control-family="button-group"][data-orientation="horizontal"]
|
|
47
|
-
> :not([data-control-family="track-highlight"])
|
|
48
|
-
|
|
47
|
+
> :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])
|
|
48
|
+
~ :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])
|
|
49
49
|
) {
|
|
50
50
|
margin-inline-start: -1px;
|
|
51
51
|
border-start-start-radius: 0;
|
|
52
52
|
border-end-start-radius: 0;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
:where(
|
|
55
|
+
:where(
|
|
56
|
+
[data-control-family="button-group"][data-orientation="horizontal"]
|
|
57
|
+
> :has(~ :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns]))
|
|
58
|
+
) {
|
|
56
59
|
border-start-end-radius: 0;
|
|
57
60
|
border-end-end-radius: 0;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
:where(
|
|
61
64
|
[data-control-family="button-group"][data-orientation="vertical"]
|
|
62
|
-
> :not([data-control-family="track-highlight"])
|
|
63
|
-
|
|
65
|
+
> :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])
|
|
66
|
+
~ :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])
|
|
64
67
|
) {
|
|
65
68
|
margin-block-start: -1px;
|
|
66
69
|
border-start-start-radius: 0;
|
|
67
70
|
border-start-end-radius: 0;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
|
-
:where(
|
|
73
|
+
:where(
|
|
74
|
+
[data-control-family="button-group"][data-orientation="vertical"]
|
|
75
|
+
> :has(~ :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns]))
|
|
76
|
+
) {
|
|
71
77
|
border-end-start-radius: 0;
|
|
72
78
|
border-end-end-radius: 0;
|
|
73
79
|
}
|
|
@@ -95,7 +95,12 @@
|
|
|
95
95
|
:where(
|
|
96
96
|
[data-control-family="button"][data-control="true"][data-size]:not([data-icon-only="true"]):has(
|
|
97
97
|
> :is(svg, [data-slot="icon"]):first-child:not(:only-child),
|
|
98
|
-
> [data-slot="content"] > :is(svg, [data-slot="icon"]):first-child:not(:only-child)
|
|
98
|
+
> [data-slot="content"] > :is(svg, [data-slot="icon"]):first-child:not(:only-child),
|
|
99
|
+
> [data-control-family="swap"]:first-child > [data-state="active"] > :is(svg, [data-slot="icon"]):first-child:not(:only-child),
|
|
100
|
+
> [data-slot="content"]
|
|
101
|
+
> [data-control-family="swap"]:first-child
|
|
102
|
+
> [data-state="active"]
|
|
103
|
+
> :is(svg, [data-slot="icon"]):first-child:not(:only-child)
|
|
99
104
|
)
|
|
100
105
|
) {
|
|
101
106
|
padding-inline-start: var(--cui-button-icon-padding-inline);
|
|
@@ -104,7 +109,12 @@
|
|
|
104
109
|
:where(
|
|
105
110
|
[data-control-family="button"][data-control="true"][data-size]:not([data-icon-only="true"]):has(
|
|
106
111
|
> :is(svg, [data-slot="icon"]):last-child:not(:only-child),
|
|
107
|
-
> [data-slot="content"] > :is(svg, [data-slot="icon"]):last-child:not(:only-child)
|
|
112
|
+
> [data-slot="content"] > :is(svg, [data-slot="icon"]):last-child:not(:only-child),
|
|
113
|
+
> [data-control-family="swap"]:last-child > [data-state="active"] > :is(svg, [data-slot="icon"]):last-child:not(:only-child),
|
|
114
|
+
> [data-slot="content"]
|
|
115
|
+
> [data-control-family="swap"]:last-child
|
|
116
|
+
> [data-state="active"]
|
|
117
|
+
> :is(svg, [data-slot="icon"]):last-child:not(:only-child)
|
|
108
118
|
)
|
|
109
119
|
) {
|
|
110
120
|
padding-inline-end: var(--cui-button-icon-padding-inline);
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
:where([data-control-family="chat-message"][data-slot="content"][data-editable]) {
|
|
8
|
+
--focus-ring-offset: calc(var(--focus-ring-width) * -1);
|
|
8
9
|
position: relative;
|
|
9
10
|
display: grid;
|
|
10
|
-
outline: var(--focus-ring-width) var(--focus-ring-style) transparent;
|
|
11
|
-
outline-offset: calc(var(--focus-ring-width) * -1);
|
|
12
|
-
transition: outline-color var(--duration-fast) var(--ease-standard);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
:where([data-control-family="chat-message"][data-slot="content"][data-editable]:focus-within) {
|
|
16
|
-
outline-color: var(--focus-ring);
|
|
17
11
|
}
|
|
18
12
|
|
|
19
13
|
:where([data-control-family="chat-message"][data-slot="editable"] :is([data-slot="edit-value"], [data-slot="edit-sizer"])) {
|
|
@@ -63,7 +57,6 @@
|
|
|
63
57
|
white-space: pre-wrap;
|
|
64
58
|
overflow-wrap: anywhere;
|
|
65
59
|
scrollbar-width: thin;
|
|
66
|
-
outline: none;
|
|
67
60
|
visibility: hidden;
|
|
68
61
|
}
|
|
69
62
|
|
|
@@ -75,21 +68,13 @@
|
|
|
75
68
|
visibility: hidden;
|
|
76
69
|
}
|
|
77
70
|
|
|
78
|
-
:where([data-control-family="chat-message"][data-slot="editable"] [data-slot="edit-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
:where([data-control-family="chat-message"][data-slot="editable"] [data-slot="edit-toolbar"]) {
|
|
83
|
-
grid-area: 1 / 1;
|
|
84
|
-
min-inline-size: 0;
|
|
85
|
-
visibility: hidden;
|
|
86
|
-
opacity: 0;
|
|
87
|
-
transition: opacity var(--duration-fast) var(--ease-standard);
|
|
71
|
+
:where([data-control-family="chat-message"][data-slot="editable"] :is([data-slot="read-actions"], [data-slot="edit-actions"])) {
|
|
72
|
+
contain: inline-size;
|
|
88
73
|
}
|
|
89
74
|
|
|
90
|
-
:where([data-control-family="chat-message"][data-slot="editable"] [data-slot="
|
|
91
|
-
|
|
92
|
-
|
|
75
|
+
:where([data-control-family="chat-message"][data-slot="editable"][data-editing] [data-slot="read-actions"]),
|
|
76
|
+
:where([data-control-family="chat-message"][data-slot="editable"]:not([data-editing]) [data-slot="edit-actions"]) {
|
|
77
|
+
display: none;
|
|
93
78
|
}
|
|
94
79
|
|
|
95
80
|
:where([data-control-family="chat-message"][data-slot="editable"] [data-slot="edit-error"]) {
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
:where([data-control-family="infinite-canvas"][data-slot="root"]) {
|
|
3
|
+
--_infinite-canvas-controls-item-radius: min(var(--radius-sm), calc(var(--control-h-sm) / 2));
|
|
4
|
+
--_infinite-canvas-controls-radius: calc(
|
|
5
|
+
var(--_infinite-canvas-controls-item-radius) +
|
|
6
|
+
clamp(0px, calc(var(--_infinite-canvas-controls-item-radius) * 1000), var(--spacing))
|
|
7
|
+
);
|
|
3
8
|
--cui-infinite-canvas-background: var(--canvas);
|
|
4
9
|
--cui-infinite-canvas-grid-dot-color: var(--canvas-grid-dot);
|
|
5
10
|
--cui-infinite-canvas-border-color: var(--border);
|
|
6
|
-
--cui-infinite-canvas-controls-item-radius: min(var(--radius-sm), calc(var(--control-h-sm) / 2));
|
|
7
|
-
--cui-infinite-canvas-controls-padding: calc(var(--spacing) * 1);
|
|
8
|
-
--cui-infinite-canvas-controls-radius: calc(
|
|
9
|
-
var(--cui-infinite-canvas-controls-item-radius) +
|
|
10
|
-
clamp(0px, calc(var(--cui-infinite-canvas-controls-item-radius) * 1000), var(--cui-infinite-canvas-controls-padding))
|
|
11
|
-
);
|
|
12
11
|
--cui-infinite-canvas-radius: max(
|
|
13
12
|
var(--radius-panel),
|
|
14
|
-
calc(
|
|
15
|
-
var(--cui-infinite-canvas-controls-radius) +
|
|
16
|
-
clamp(0px, calc(var(--cui-infinite-canvas-controls-radius) * 1000), var(--spacing) * 2)
|
|
17
|
-
)
|
|
13
|
+
calc(var(--_infinite-canvas-controls-radius) + clamp(0px, calc(var(--_infinite-canvas-controls-radius) * 1000), var(--spacing) * 2))
|
|
18
14
|
);
|
|
19
15
|
--cui-infinite-canvas-padding: max(
|
|
20
16
|
calc(var(--spacing) * 2),
|
|
21
|
-
calc(var(--cui-infinite-canvas-radius) - var(--
|
|
17
|
+
calc(var(--cui-infinite-canvas-radius) - var(--_infinite-canvas-controls-radius))
|
|
22
18
|
);
|
|
23
|
-
--cui-infinite-canvas-controls-background: var(--card);
|
|
24
|
-
--cui-infinite-canvas-controls-border-color: var(--border);
|
|
25
|
-
--cui-infinite-canvas-controls-shadow: var(--shadow-sm);
|
|
26
19
|
border-radius: var(--cui-infinite-canvas-radius);
|
|
27
20
|
background-color: var(--cui-infinite-canvas-background);
|
|
28
21
|
background-image: radial-gradient(circle at center, var(--cui-infinite-canvas-grid-dot-color) 1px, transparent 1px);
|
|
29
22
|
box-shadow: 0 0 0 1px var(--cui-infinite-canvas-border-color);
|
|
30
23
|
}
|
|
31
24
|
|
|
25
|
+
:where([data-control-family="infinite-canvas"][data-slot="root"]:focus-visible) {
|
|
26
|
+
--focus-ring-offset: calc(var(--focus-ring-width) * -1);
|
|
27
|
+
}
|
|
28
|
+
|
|
32
29
|
:where([data-control-family="infinite-canvas"][data-slot="root"][data-easing]) {
|
|
33
30
|
transition-property: background-position, background-size;
|
|
34
31
|
transition-duration: var(--duration-base);
|
|
@@ -41,17 +38,15 @@
|
|
|
41
38
|
transition: transform var(--duration-base) var(--ease-standard);
|
|
42
39
|
}
|
|
43
40
|
|
|
41
|
+
:where(
|
|
42
|
+
[data-control-family="infinite-canvas"][data-slot="root"][data-moving] [data-control-family="infinite-canvas"][data-slot="content"]
|
|
43
|
+
) {
|
|
44
|
+
will-change: transform;
|
|
45
|
+
}
|
|
46
|
+
|
|
44
47
|
:where([data-control-family="infinite-canvas"][data-slot="controls"]) {
|
|
45
|
-
--nest-radius: var(--cui-infinite-canvas-controls-item-radius);
|
|
46
48
|
inset-inline-end: var(--cui-infinite-canvas-padding);
|
|
47
49
|
inset-block-end: var(--cui-infinite-canvas-padding);
|
|
48
|
-
gap: calc(var(--spacing) * 0.5);
|
|
49
|
-
padding: var(--cui-infinite-canvas-controls-padding);
|
|
50
|
-
border-radius: var(--cui-infinite-canvas-controls-radius);
|
|
51
|
-
background-color: var(--cui-infinite-canvas-controls-background);
|
|
52
|
-
box-shadow:
|
|
53
|
-
var(--cui-infinite-canvas-controls-shadow),
|
|
54
|
-
0 0 0 1px var(--cui-infinite-canvas-controls-border-color);
|
|
55
50
|
}
|
|
56
51
|
|
|
57
52
|
:where([data-control-family="infinite-canvas"][data-slot="content"]) {
|
|
@@ -88,38 +83,3 @@
|
|
|
88
83
|
inherits: true;
|
|
89
84
|
initial-value: 0px;
|
|
90
85
|
}
|
|
91
|
-
|
|
92
|
-
@property --cui-infinite-canvas-controls-item-radius {
|
|
93
|
-
syntax: "<length-percentage>";
|
|
94
|
-
inherits: true;
|
|
95
|
-
initial-value: 0px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@property --cui-infinite-canvas-controls-padding {
|
|
99
|
-
syntax: "<length-percentage>";
|
|
100
|
-
inherits: true;
|
|
101
|
-
initial-value: 0px;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@property --cui-infinite-canvas-controls-radius {
|
|
105
|
-
syntax: "<length-percentage>";
|
|
106
|
-
inherits: true;
|
|
107
|
-
initial-value: 0px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@property --cui-infinite-canvas-controls-background {
|
|
111
|
-
syntax: "<color>";
|
|
112
|
-
inherits: true;
|
|
113
|
-
initial-value: transparent;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@property --cui-infinite-canvas-controls-border-color {
|
|
117
|
-
syntax: "<color>";
|
|
118
|
-
inherits: true;
|
|
119
|
-
initial-value: transparent;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
@property --cui-infinite-canvas-controls-shadow {
|
|
123
|
-
syntax: "*";
|
|
124
|
-
inherits: true;
|
|
125
|
-
}
|
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
padding-inline: var(--cui-markdown-editor-padding);
|
|
42
42
|
white-space: nowrap;
|
|
43
43
|
}
|
|
44
|
+
:where([data-control-family="markdown-editor"][data-slot="bubble-menu"]) {
|
|
45
|
+
z-index: 1;
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
transform-origin: bottom center;
|
|
48
|
+
animation: cui-markdown-editor-bubble-enter var(--duration-fast) var(--ease-emphasized);
|
|
49
|
+
}
|
|
44
50
|
:where([data-control-family="markdown-editor"] [data-markdown-drag-handle]) {
|
|
45
51
|
position: absolute;
|
|
46
52
|
inset-inline-start: calc(var(--cui-markdown-editor-padding) / 2);
|
|
@@ -170,6 +176,12 @@
|
|
|
170
176
|
border: var(--cui-markdown-editor-border-width) solid var(--cui-markdown-editor-border-color);
|
|
171
177
|
padding: var(--cui-markdown-editor-padding);
|
|
172
178
|
}
|
|
179
|
+
@keyframes cui-markdown-editor-bubble-enter {
|
|
180
|
+
from {
|
|
181
|
+
opacity: 0;
|
|
182
|
+
scale: 0.96;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
173
185
|
}
|
|
174
186
|
|
|
175
187
|
@property --cui-markdown-editor-background {
|