@reforma/components 0.2.2 → 0.3.1
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/Composer/RichField.d.ts +6 -2
- package/dist/Composer/RichField.d.ts.map +1 -1
- package/dist/Composer/RichField.js +107 -37
- package/dist/Composer/RichField.js.map +1 -1
- package/dist/Composer/context.d.ts +6 -2
- package/dist/Composer/context.d.ts.map +1 -1
- package/dist/Composer/context.js +158 -130
- package/dist/Composer/context.js.map +1 -1
- package/dist/Composer/index.d.ts +1 -1
- package/dist/Composer/index.d.ts.map +1 -1
- package/dist/Composer/parts.d.ts +18 -17
- package/dist/Composer/parts.d.ts.map +1 -1
- package/dist/Composer/parts.js +283 -187
- package/dist/Composer/parts.js.map +1 -1
- package/dist/Composer/reforma/Composer.module.css +1 -0
- package/dist/Composer/reforma/Composer.module.css.js +60 -0
- package/dist/Composer/reforma/Composer.module.css.js.map +1 -0
- package/dist/Composer/reforma/index.d.ts +4 -0
- package/dist/Composer/reforma/index.d.ts.map +1 -0
- package/dist/Composer/reforma/index.js +6 -0
- package/dist/Composer/reforma/index.js.map +1 -0
- package/dist/Composer/types.d.ts +6 -0
- package/dist/Composer/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/Composer/Composer.module.css +0 -1
- package/dist/Composer/Composer.module.css.js +0 -26
- package/dist/Composer/Composer.module.css.js.map +0 -1
package/dist/Composer/parts.js
CHANGED
|
@@ -1,231 +1,327 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cn as f } from "@reforma/lib";
|
|
1
|
+
import { Plus as P, Plan as D } from "@reforma/icons/14";
|
|
2
|
+
import { SendBold as x } from "@reforma/icons/16";
|
|
3
|
+
import { formatFileSize as S, cn as i } from "@reforma/lib";
|
|
5
4
|
import "react";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
import { For as F } from "../For/For.js";
|
|
6
|
+
import { Show as N } from "../Show/Show.js";
|
|
7
|
+
import { useComposer as h } from "./context.js";
|
|
8
|
+
import { jsx as a, jsxs as v, Fragment as k } from "react/jsx-runtime";
|
|
9
|
+
function j({
|
|
10
|
+
className: r,
|
|
11
|
+
classNames: t,
|
|
12
|
+
children: o,
|
|
13
|
+
onDragEnter: n,
|
|
14
|
+
onDragLeave: c,
|
|
15
|
+
onDragOver: p,
|
|
16
|
+
onDrop: u,
|
|
17
|
+
onPaste: s,
|
|
18
|
+
...e
|
|
18
19
|
}) {
|
|
19
20
|
const {
|
|
20
|
-
drag:
|
|
21
|
-
fileDragOver:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
drag: m,
|
|
22
|
+
fileDragOver: b,
|
|
23
|
+
classNames: f
|
|
24
|
+
} = h();
|
|
25
|
+
return /* @__PURE__ */ v("div", {
|
|
26
|
+
...e,
|
|
27
|
+
"data-slot": "composer-frame",
|
|
28
|
+
"data-drag-over": b || void 0,
|
|
29
|
+
className: i(f.root, r),
|
|
30
|
+
onDragEnter: (d) => {
|
|
31
|
+
n?.(d), m.onDragEnter(d);
|
|
32
|
+
},
|
|
33
|
+
onDragLeave: (d) => {
|
|
34
|
+
c?.(d), m.onDragLeave(d);
|
|
35
|
+
},
|
|
36
|
+
onDragOver: (d) => {
|
|
37
|
+
p?.(d), m.onDragOver(d);
|
|
38
|
+
},
|
|
39
|
+
onDrop: (d) => {
|
|
40
|
+
u?.(d), m.onDrop(d);
|
|
41
|
+
},
|
|
42
|
+
onPaste: (d) => {
|
|
43
|
+
s?.(d), m.onPaste(d);
|
|
44
|
+
},
|
|
45
|
+
children: [/* @__PURE__ */ a(N, {
|
|
46
|
+
when: b,
|
|
47
|
+
children: /* @__PURE__ */ a("div", {
|
|
48
|
+
"data-slot": "composer-drop-overlay",
|
|
49
|
+
className: i(f.dropOverlay, t?.dropOverlay),
|
|
50
|
+
role: "status",
|
|
51
|
+
children: /* @__PURE__ */ a("span", {
|
|
52
|
+
className: i(f.dropLabel, t?.dropLabel),
|
|
53
|
+
children: "Drop files to attach"
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
}), /* @__PURE__ */ a("div", {
|
|
57
|
+
"data-slot": "composer-shell",
|
|
58
|
+
className: i(f.shell, t?.shell),
|
|
59
|
+
children: o
|
|
36
60
|
})]
|
|
37
61
|
});
|
|
38
62
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
63
|
+
function K({
|
|
64
|
+
className: r,
|
|
65
|
+
children: t,
|
|
66
|
+
onPointerDown: o,
|
|
67
|
+
...n
|
|
41
68
|
}) {
|
|
42
69
|
const {
|
|
43
|
-
rows:
|
|
44
|
-
value:
|
|
45
|
-
focus:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"data-
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
rows: c,
|
|
71
|
+
value: p,
|
|
72
|
+
focus: u,
|
|
73
|
+
classNames: s
|
|
74
|
+
} = h(), e = c != null || p.prompt.includes(`
|
|
75
|
+
`) || p.prompt.length > 40;
|
|
76
|
+
return /* @__PURE__ */ a("div", {
|
|
77
|
+
...n,
|
|
78
|
+
"data-slot": "composer-surface",
|
|
79
|
+
className: i(s.main, r),
|
|
80
|
+
"data-expanded": e || void 0,
|
|
81
|
+
"data-min-rows": c != null || void 0,
|
|
82
|
+
onPointerDown: (m) => {
|
|
83
|
+
o?.(m), !m.defaultPrevented && m.target === m.currentTarget && u();
|
|
54
84
|
},
|
|
55
|
-
children:
|
|
85
|
+
children: t
|
|
56
86
|
});
|
|
57
87
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
88
|
+
function M({
|
|
89
|
+
className: r,
|
|
90
|
+
...t
|
|
60
91
|
}) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
92
|
+
const {
|
|
93
|
+
classNames: o
|
|
94
|
+
} = h();
|
|
95
|
+
return /* @__PURE__ */ a("div", {
|
|
96
|
+
...t,
|
|
97
|
+
"data-slot": "composer-tools",
|
|
98
|
+
className: i(o.addButton, r)
|
|
64
99
|
});
|
|
65
100
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
101
|
+
function z({
|
|
102
|
+
className: r,
|
|
103
|
+
children: t,
|
|
104
|
+
...o
|
|
68
105
|
}) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
106
|
+
const {
|
|
107
|
+
classNames: n
|
|
108
|
+
} = h();
|
|
109
|
+
return /* @__PURE__ */ a(N, {
|
|
110
|
+
when: t,
|
|
111
|
+
children: /* @__PURE__ */ a("div", {
|
|
112
|
+
...o,
|
|
113
|
+
"data-slot": "composer-toolbar",
|
|
114
|
+
className: i(n.toolbarEnd, r),
|
|
115
|
+
children: t
|
|
74
116
|
})
|
|
75
117
|
});
|
|
76
118
|
}
|
|
77
|
-
function
|
|
119
|
+
function W({
|
|
120
|
+
className: r,
|
|
121
|
+
classNames: t,
|
|
122
|
+
...o
|
|
123
|
+
}) {
|
|
78
124
|
const {
|
|
79
|
-
value:
|
|
80
|
-
removeAttachment:
|
|
81
|
-
retryAttachment:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
125
|
+
value: n,
|
|
126
|
+
removeAttachment: c,
|
|
127
|
+
retryAttachment: p,
|
|
128
|
+
classNames: u
|
|
129
|
+
} = h(), s = {
|
|
130
|
+
...u,
|
|
131
|
+
...t
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ a(N, {
|
|
134
|
+
when: n.attachments.length > 0,
|
|
135
|
+
children: /* @__PURE__ */ a("div", {
|
|
136
|
+
...o,
|
|
137
|
+
"data-slot": "composer-attachments",
|
|
138
|
+
className: i(s.attachments, r),
|
|
139
|
+
children: /* @__PURE__ */ a(F, {
|
|
140
|
+
each: n.attachments,
|
|
141
|
+
children: (e) => /* @__PURE__ */ v("div", {
|
|
142
|
+
"data-slot": "composer-attachment",
|
|
143
|
+
"data-status": e.uploadStatus,
|
|
144
|
+
className: s.attachment,
|
|
145
|
+
children: [/* @__PURE__ */ a(N, {
|
|
146
|
+
when: e.mediaType?.startsWith("image/") && (e.url ?? e.preview),
|
|
147
|
+
children: /* @__PURE__ */ a("img", {
|
|
148
|
+
src: e.url ?? e.preview,
|
|
149
|
+
alt: e.filename,
|
|
150
|
+
className: s.attachmentPreview
|
|
151
|
+
})
|
|
152
|
+
}), /* @__PURE__ */ a("span", {
|
|
153
|
+
className: s.attachmentName,
|
|
154
|
+
children: e.filename
|
|
155
|
+
}), /* @__PURE__ */ v("span", {
|
|
156
|
+
className: s.attachmentStatus,
|
|
157
|
+
role: "status",
|
|
158
|
+
children: [e.uploadStatus === "uploading" && "Uploading…", e.uploadStatus === "error" && (e.uploadError || "Upload failed"), e.uploadStatus === "ready" && e.size != null && S(e.size)]
|
|
159
|
+
}), /* @__PURE__ */ a(N, {
|
|
160
|
+
when: e.uploadStatus === "error",
|
|
161
|
+
children: /* @__PURE__ */ a("button", {
|
|
162
|
+
type: "button",
|
|
163
|
+
className: s.attachmentRetry,
|
|
164
|
+
"aria-label": `Retry ${e.filename}`,
|
|
165
|
+
onClick: () => p(e.clientId),
|
|
166
|
+
children: "Retry"
|
|
167
|
+
})
|
|
168
|
+
}), /* @__PURE__ */ a("button", {
|
|
169
|
+
type: "button",
|
|
170
|
+
className: s.attachmentRemove,
|
|
171
|
+
"aria-label": `Remove ${e.filename}`,
|
|
172
|
+
onClick: () => c(e.clientId),
|
|
173
|
+
children: "Remove"
|
|
174
|
+
})]
|
|
175
|
+
}, e.clientId)
|
|
106
176
|
})
|
|
107
177
|
})
|
|
108
178
|
});
|
|
109
179
|
}
|
|
110
|
-
function
|
|
180
|
+
function U({
|
|
181
|
+
className: r,
|
|
182
|
+
children: t,
|
|
183
|
+
...o
|
|
184
|
+
}) {
|
|
111
185
|
const {
|
|
112
|
-
openFilePicker:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
iconOnly: !0,
|
|
117
|
-
rounded: !0,
|
|
118
|
-
variant: "filling",
|
|
119
|
-
size: "sm",
|
|
120
|
-
tooltip: "Add files",
|
|
186
|
+
openFilePicker: n,
|
|
187
|
+
classNames: c
|
|
188
|
+
} = h();
|
|
189
|
+
return /* @__PURE__ */ a("button", {
|
|
121
190
|
"aria-label": "Add files",
|
|
122
|
-
|
|
123
|
-
|
|
191
|
+
title: "Add files",
|
|
192
|
+
...o,
|
|
193
|
+
"data-slot": "composer-file-button",
|
|
194
|
+
type: "button",
|
|
195
|
+
className: i(c.fileButton, r),
|
|
196
|
+
onClick: () => n(),
|
|
197
|
+
children: t ?? /* @__PURE__ */ a(P, {
|
|
198
|
+
fill: "currentColor"
|
|
199
|
+
})
|
|
124
200
|
});
|
|
125
201
|
}
|
|
126
|
-
function
|
|
202
|
+
function $({
|
|
203
|
+
className: r,
|
|
204
|
+
children: t,
|
|
205
|
+
classNames: o,
|
|
206
|
+
...n
|
|
207
|
+
}) {
|
|
127
208
|
const {
|
|
128
|
-
value:
|
|
129
|
-
setPlanMode:
|
|
130
|
-
focus:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
children: /* @__PURE__ */
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
209
|
+
value: c,
|
|
210
|
+
setPlanMode: p,
|
|
211
|
+
focus: u,
|
|
212
|
+
classNames: s
|
|
213
|
+
} = h();
|
|
214
|
+
return /* @__PURE__ */ a("button", {
|
|
215
|
+
"aria-label": "Plan mode",
|
|
216
|
+
title: "Plan mode",
|
|
217
|
+
...n,
|
|
218
|
+
"data-slot": "composer-plan",
|
|
219
|
+
type: "button",
|
|
220
|
+
"aria-pressed": c.planMode,
|
|
221
|
+
className: i(s.planButton, r),
|
|
222
|
+
onClick: () => {
|
|
223
|
+
p(!c.planMode), u();
|
|
224
|
+
},
|
|
225
|
+
children: t ?? /* @__PURE__ */ v(k, {
|
|
226
|
+
children: [/* @__PURE__ */ a("span", {
|
|
227
|
+
className: i(s.planIcon, o?.planIcon),
|
|
228
|
+
children: /* @__PURE__ */ a(D, {
|
|
229
|
+
fill: "currentColor"
|
|
230
|
+
})
|
|
231
|
+
}), /* @__PURE__ */ a(N, {
|
|
232
|
+
when: c.planMode,
|
|
233
|
+
children: /* @__PURE__ */ a("span", {
|
|
234
|
+
className: i(s.planLabel, o?.planLabel),
|
|
235
|
+
children: "Plan mode"
|
|
236
|
+
})
|
|
237
|
+
})]
|
|
157
238
|
})
|
|
158
239
|
});
|
|
159
240
|
}
|
|
160
|
-
function
|
|
241
|
+
function q({
|
|
242
|
+
className: r,
|
|
243
|
+
classNames: t,
|
|
244
|
+
style: o,
|
|
245
|
+
onKeyDown: n,
|
|
246
|
+
onPaste: c,
|
|
247
|
+
...p
|
|
248
|
+
}) {
|
|
161
249
|
const {
|
|
162
|
-
value:
|
|
163
|
-
setPrompt:
|
|
164
|
-
submit:
|
|
165
|
-
placeholder:
|
|
166
|
-
autoFocus:
|
|
167
|
-
submitOnEnter:
|
|
168
|
-
|
|
169
|
-
focusRef:
|
|
170
|
-
pasteTextAsFile:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
250
|
+
value: u,
|
|
251
|
+
setPrompt: s,
|
|
252
|
+
submit: e,
|
|
253
|
+
placeholder: m,
|
|
254
|
+
autoFocus: b,
|
|
255
|
+
submitOnEnter: f,
|
|
256
|
+
rows: d,
|
|
257
|
+
focusRef: y,
|
|
258
|
+
pasteTextAsFile: w,
|
|
259
|
+
classNames: g
|
|
260
|
+
} = h();
|
|
261
|
+
return /* @__PURE__ */ a("div", {
|
|
262
|
+
"data-slot": "composer-field-wrapper",
|
|
263
|
+
className: i(g.textareaWrap, t?.textareaWrap),
|
|
264
|
+
children: /* @__PURE__ */ a("textarea", {
|
|
265
|
+
placeholder: m,
|
|
266
|
+
"aria-label": m,
|
|
267
|
+
autoFocus: b,
|
|
268
|
+
rows: d || 1,
|
|
269
|
+
...p,
|
|
270
|
+
"data-slot": "composer-textarea",
|
|
271
|
+
ref: (l) => {
|
|
272
|
+
y.current = l;
|
|
182
273
|
},
|
|
183
|
-
className:
|
|
184
|
-
style:
|
|
185
|
-
|
|
274
|
+
className: i(g.textarea, g.plainField, r),
|
|
275
|
+
style: o,
|
|
276
|
+
value: u.prompt,
|
|
277
|
+
onChange: (l) => s(l.target.value),
|
|
278
|
+
onKeyDown: (l) => {
|
|
279
|
+
if (n?.(l), l.defaultPrevented || l.nativeEvent.isComposing || l.key !== "Enter")
|
|
280
|
+
return;
|
|
281
|
+
const C = l.metaKey || l.ctrlKey;
|
|
282
|
+
(f && !l.shiftKey && !C || C) && (l.preventDefault(), e());
|
|
186
283
|
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"aria-label": r,
|
|
190
|
-
autoFocus: m,
|
|
191
|
-
rows: Math.max(1, Math.round(u / 22)),
|
|
192
|
-
onChange: (a) => n(a.target.value),
|
|
193
|
-
onKeyDown: g,
|
|
194
|
-
onPaste: (a) => {
|
|
195
|
-
v(a.clipboardData.getData("text/plain")) && a.preventDefault();
|
|
284
|
+
onPaste: (l) => {
|
|
285
|
+
c?.(l), !l.defaultPrevented && w(l.clipboardData.getData("text/plain")) && l.preventDefault();
|
|
196
286
|
}
|
|
197
287
|
})
|
|
198
288
|
});
|
|
199
289
|
}
|
|
200
|
-
function
|
|
290
|
+
function G({
|
|
291
|
+
className: r,
|
|
292
|
+
children: t,
|
|
293
|
+
...o
|
|
294
|
+
}) {
|
|
201
295
|
const {
|
|
202
|
-
submit:
|
|
203
|
-
canSubmit:
|
|
204
|
-
busy:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
children: /* @__PURE__ */
|
|
296
|
+
submit: n,
|
|
297
|
+
canSubmit: c,
|
|
298
|
+
busy: p,
|
|
299
|
+
classNames: u
|
|
300
|
+
} = h();
|
|
301
|
+
return /* @__PURE__ */ a("button", {
|
|
302
|
+
"aria-label": "Create project",
|
|
303
|
+
title: "Create project",
|
|
304
|
+
...o,
|
|
305
|
+
"data-slot": "composer-submit",
|
|
306
|
+
type: "button",
|
|
307
|
+
className: i(u.sendButton, r),
|
|
308
|
+
disabled: !c,
|
|
309
|
+
"aria-busy": p,
|
|
310
|
+
onClick: () => n(),
|
|
311
|
+
children: t ?? /* @__PURE__ */ a(x, {
|
|
312
|
+
fill: "currentColor"
|
|
313
|
+
})
|
|
218
314
|
});
|
|
219
315
|
}
|
|
220
316
|
export {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
317
|
+
W as ComposerAttachments,
|
|
318
|
+
U as ComposerFileButton,
|
|
319
|
+
j as ComposerFrame,
|
|
320
|
+
$ as ComposerPlan,
|
|
321
|
+
G as ComposerSubmit,
|
|
322
|
+
K as ComposerSurface,
|
|
323
|
+
q as ComposerTextarea,
|
|
324
|
+
z as ComposerToolbar,
|
|
325
|
+
M as ComposerTools
|
|
230
326
|
};
|
|
231
327
|
//# sourceMappingURL=parts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sources":["../../src/Composer/parts.tsx"],"sourcesContent":["'use client';\n\nimport { Plan } from '@reforma/icons/12';\nimport { Plan as PlanIcon, Plus } from '@reforma/icons/14';\nimport { SendBold } from '@reforma/icons/16';\nimport { cn } from '@reforma/lib';\nimport { type KeyboardEvent, type ReactNode } from 'react';\n\nimport { Button } from '../Button';\nimport { Attachment, Attachments } from '../chat/Attachment';\nimport { FileDropOverlay } from '../FileDropOverlay';\nimport { For } from '../For';\nimport { Show } from '../Show';\nimport { Badge } from '../Tag';\nimport styles from './Composer.module.css';\nimport { useComposer } from './context';\n\nexport function ComposerFrame({\n className,\n children,\n}: {\n className?: string;\n children: ReactNode;\n}) {\n const { drag, fileDragOver } = useComposer();\n\n return (\n <div\n className={ cn(styles.root, className) }\n onDragEnter={ drag.onDragEnter }\n onDragLeave={ drag.onDragLeave }\n onDragOver={ drag.onDragOver }\n onDrop={ drag.onDrop }\n onPaste={ drag.onPaste }\n >\n <FileDropOverlay open={ fileDragOver } label=\"Drop files to attach\" />\n <div className={ styles.shell }>\n { children }\n </div>\n </div>\n );\n}\n\n/** Relative row that pins the tools and the submit button to the field. */\nexport function ComposerSurface({ children }: { children: ReactNode }) {\n const { rows, value, focus } = useComposer();\n const expanded = rows != null || value.prompt.includes('\\n') || value.prompt.length > 40;\n\n return (\n <div\n className={ styles.main }\n data-expanded={ expanded || undefined }\n data-min-rows={ rows != null || undefined }\n onPointerDown={ (event) => {\n if (event.target === event.currentTarget) {\n focus();\n }\n } }\n >\n { children }\n </div>\n );\n}\n\n/** Left cluster: file button, plan, whatever else you drop in. */\nexport function ComposerTools({ children }: { children: ReactNode }) {\n return (\n <div className={ styles.addButton }>\n { children }\n </div>\n );\n}\n\nexport function ComposerToolbar({ children }: { children?: ReactNode }) {\n return (\n <Show when={ children }>\n <div className={ styles.toolbarEnd }>\n { children }\n </div>\n </Show>\n );\n}\n\nexport function ComposerAttachments() {\n const { value, removeAttachment, retryAttachment } = useComposer();\n\n return (\n <Show when={ value.attachments.length > 0 }>\n <div className={ styles.attachments }>\n <Attachments size=\"sm\">\n <For each={ value.attachments }>\n { item => (\n <Attachment\n key={ item.clientId }\n data={ {\n id: item.id,\n url: item.url ?? item.preview,\n filename: item.filename,\n mediaType: item.mediaType,\n size: item.size,\n lastModified: item.lastModified,\n } }\n loading={ item.uploadStatus === 'uploading' }\n error={ item.uploadStatus === 'error' }\n onRetry={ () => retryAttachment(item.clientId) }\n onRemove={ () => removeAttachment(item.clientId) }\n />\n ) }\n </For>\n </Attachments>\n </div>\n </Show>\n );\n}\n\nexport function ComposerFileButton() {\n const { openFilePicker } = useComposer();\n\n return (\n <Button\n type=\"button\"\n iconOnly\n rounded\n variant=\"filling\"\n size=\"sm\"\n tooltip=\"Add files\"\n aria-label=\"Add files\"\n onPress={ () => openFilePicker() }\n >\n <Plus />\n </Button>\n );\n}\n\nexport function ComposerPlan() {\n const { value, setPlanMode, focus } = useComposer();\n\n return (\n <Show\n when={ value.planMode }\n fallback={ (\n <Button\n type=\"button\"\n iconOnly\n rounded\n variant=\"filling\"\n size=\"sm\"\n tooltip=\"Plan mode\"\n aria-label=\"Plan mode\"\n onPress={ () => {\n setPlanMode(true);\n focus();\n } }\n >\n <PlanIcon />\n </Button>\n ) }\n >\n <Badge\n size=\"sm\"\n color=\"success\"\n rounded\n textValue=\"Plan mode\"\n aria-label=\"Plan mode\"\n icon={ <Plan /> }\n removePlacement=\"leading\"\n onRemove={ () => setPlanMode(false) }\n >\n Plan mode\n </Badge>\n </Show>\n );\n}\n\nexport function ComposerTextarea() {\n const {\n value,\n setPrompt,\n submit,\n placeholder,\n autoFocus,\n submitOnEnter,\n minHeight,\n focusRef,\n pasteTextAsFile,\n } = useComposer();\n\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.nativeEvent.isComposing || event.key !== 'Enter') {\n return;\n }\n\n const command = event.metaKey || event.ctrlKey;\n const plainEnter = submitOnEnter && !event.shiftKey && !command;\n\n if (!plainEnter && !command) {\n return;\n }\n\n event.preventDefault();\n submit();\n };\n\n return (\n <div className={ styles.textareaWrap }>\n <textarea\n ref={ (node) => {\n focusRef.current = node;\n } }\n className={ cn(styles.textarea, styles.plainField) }\n style={ { minHeight } }\n value={ value.prompt }\n placeholder={ placeholder }\n aria-label={ placeholder }\n autoFocus={ autoFocus }\n rows={ Math.max(1, Math.round(minHeight / 22)) }\n onChange={ (event) => setPrompt(event.target.value) }\n onKeyDown={ onKeyDown }\n onPaste={ (event) => {\n if (!pasteTextAsFile(event.clipboardData.getData('text/plain'))) {\n return;\n }\n\n event.preventDefault();\n } }\n />\n </div>\n );\n}\n\nexport function ComposerSubmit() {\n const { submit, canSubmit, busy } = useComposer();\n\n return (\n <Button\n iconOnly\n rounded\n color=\"primary\"\n variant=\"filled\"\n size=\"sm\"\n className={ styles.sendButton }\n isDisabled={ !canSubmit }\n isPending={ busy }\n tooltip=\"Create project\"\n onPress={ () => submit() }\n >\n <SendBold />\n </Button>\n );\n}\n"],"names":["ComposerFrame","className","children","drag","fileDragOver","useComposer","cn","styles","_jsx","FileDropOverlay","ComposerSurface","rows","value","focus","expanded","event","ComposerTools","ComposerToolbar","Show","ComposerAttachments","removeAttachment","retryAttachment","Attachments","For","item","Attachment","ComposerFileButton","openFilePicker","Button","Plus","ComposerPlan","setPlanMode","PlanIcon","Badge","Plan","ComposerTextarea","setPrompt","submit","placeholder","autoFocus","submitOnEnter","minHeight","focusRef","pasteTextAsFile","onKeyDown","command","node","ComposerSubmit","canSubmit","busy","SendBold"],"mappings":";;;;;;;;;;;;;;AAgBO,SAASA,EAAc;AAAA,EAC5B,WAAAC;AAAA,EACA,UAAAC;AACF,GAAG;AACD,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACEC,EAAA;AACJ,2BAA0B,OAAO;AAAA,IAC/B,WAAWC,EAAGC,EAAO,MAAMN,CAAS;AAAA,IACpC,aAAaE,EAAK;AAAA,IAClB,aAAaA,EAAK;AAAA,IAClB,YAAYA,EAAK;AAAA,IACjB,QAAQA,EAAK;AAAA,IACb,SAASA,EAAK;AAAA,IACd,UAAU,CAAcK,gBAAAA,EAAKC,GAAiB;AAAA,MAC5C,MAAML;AAAA,MACN,OAAO;AAAA,IAAA,CACR,GAAgBI,gBAAAA,EAAK,OAAO;AAAA,MAC3B,WAAWD,EAAO;AAAA,MAClB,UAAAL;AAAA,IAAA,CACD,CAAC;AAAA,EAAA,CACH;AACH;AAGO,SAASQ,EAAgB;AAAA,EAC9B,UAAAR;AACF,GAAG;AACD,QAAM;AAAA,IACJ,MAAAS;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,EAAA,IACER,EAAA,GACES,IAAWH,KAAQ,QAAQC,EAAM,OAAO,SAAS;AAAA,CAAI,KAAKA,EAAM,OAAO,SAAS;AACtF,2BAAyB,OAAO;AAAA,IAC9B,WAAWL,EAAO;AAAA,IAClB,iBAAiBO,KAAY;AAAA,IAC7B,iBAAiBH,KAAQ,QAAQ;AAAA,IACjC,eAAe,CAAAI,MAAS;AACtB,MAAIA,EAAM,WAAWA,EAAM,iBACzBF,EAAA;AAAA,IAEJ;AAAA,IACA,UAAAX;AAAA,EAAA,CACD;AACH;AAGO,SAASc,EAAc;AAAA,EAC5B,UAAAd;AACF,GAAG;AACD,2BAAyB,OAAO;AAA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version":3,"file":"parts.js","sources":["../../src/Composer/parts.tsx"],"sourcesContent":["'use client';\n\nimport { Plan, Plus } from '@reforma/icons/14';\nimport { SendBold } from '@reforma/icons/16';\nimport { cn, formatFileSize } from '@reforma/lib';\nimport { type ButtonHTMLAttributes, type HTMLAttributes, type TextareaHTMLAttributes } from 'react';\n\nimport { For } from '../For';\nimport { Show } from '../Show';\nimport { useComposer } from './context';\n\nimport type { ComposerClassNames } from './types';\n\ntype ContainerProps = HTMLAttributes<HTMLDivElement>;\ntype ActionProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled' | 'type'>;\n\nexport function ComposerFrame({\n className,\n classNames: slots,\n children,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onPaste,\n ...props\n}: ContainerProps & { classNames?: Pick<ComposerClassNames, 'shell' | 'dropOverlay' | 'dropLabel'> }) {\n const { drag, fileDragOver, classNames } = useComposer();\n\n return (\n <div\n { ...props }\n data-slot=\"composer-frame\"\n data-drag-over={ fileDragOver || undefined }\n className={ cn(classNames.root, className) }\n onDragEnter={ (event) => {\n onDragEnter?.(event);\n drag.onDragEnter(event);\n } }\n onDragLeave={ (event) => {\n onDragLeave?.(event);\n drag.onDragLeave(event);\n } }\n onDragOver={ (event) => {\n onDragOver?.(event);\n drag.onDragOver(event);\n } }\n onDrop={ (event) => {\n onDrop?.(event);\n drag.onDrop(event);\n } }\n onPaste={ (event) => {\n onPaste?.(event);\n drag.onPaste(event);\n } }\n >\n <Show when={ fileDragOver }>\n <div\n data-slot=\"composer-drop-overlay\"\n className={ cn(classNames.dropOverlay, slots?.dropOverlay) }\n role=\"status\"\n >\n <span className={ cn(classNames.dropLabel, slots?.dropLabel) }>Drop files to attach</span>\n </div>\n </Show>\n <div data-slot=\"composer-shell\" className={ cn(classNames.shell, slots?.shell) }>\n { children }\n </div>\n </div>\n );\n}\n\nexport function ComposerSurface({ className, children, onPointerDown, ...props }: ContainerProps) {\n const { rows, value, focus, classNames } = useComposer();\n const expanded = rows != null || value.prompt.includes('\\n') || value.prompt.length > 40;\n\n return (\n <div\n { ...props }\n data-slot=\"composer-surface\"\n className={ cn(classNames.main, className) }\n data-expanded={ expanded || undefined }\n data-min-rows={ rows != null || undefined }\n onPointerDown={ (event) => {\n onPointerDown?.(event);\n if (!event.defaultPrevented && event.target === event.currentTarget) {\n focus();\n }\n } }\n >\n { children }\n </div>\n );\n}\n\nexport function ComposerTools({ className, ...props }: ContainerProps) {\n const { classNames } = useComposer();\n\n return <div { ...props } data-slot=\"composer-tools\" className={ cn(classNames.addButton, className) } />;\n}\n\nexport function ComposerToolbar({ className, children, ...props }: ContainerProps) {\n const { classNames } = useComposer();\n\n return (\n <Show when={ children }>\n <div { ...props } data-slot=\"composer-toolbar\" className={ cn(classNames.toolbarEnd, className) }>\n { children }\n </div>\n </Show>\n );\n}\n\nexport function ComposerAttachments({\n className,\n classNames: slots,\n ...props\n}: ContainerProps & {\n classNames?: Pick<ComposerClassNames,\n 'attachment' | 'attachmentPreview' | 'attachmentName' | 'attachmentStatus' | 'attachmentRetry' | 'attachmentRemove'>;\n}) {\n const { value, removeAttachment, retryAttachment, classNames: defaults } = useComposer();\n const classNames = { ...defaults, ...slots };\n\n return (\n <Show when={ value.attachments.length > 0 }>\n <div { ...props } data-slot=\"composer-attachments\" className={ cn(classNames.attachments, className) }>\n <For each={ value.attachments }>\n { item => (\n <div\n key={ item.clientId }\n data-slot=\"composer-attachment\"\n data-status={ item.uploadStatus }\n className={ classNames.attachment }\n >\n <Show when={ item.mediaType?.startsWith('image/') && (item.url ?? item.preview) }>\n <img\n src={ item.url ?? item.preview }\n alt={ item.filename }\n className={ classNames.attachmentPreview }\n />\n </Show>\n <span className={ classNames.attachmentName }>{ item.filename }</span>\n <span className={ classNames.attachmentStatus } role=\"status\">\n { item.uploadStatus === 'uploading' && 'Uploading…' }\n { item.uploadStatus === 'error' && (item.uploadError || 'Upload failed') }\n { item.uploadStatus === 'ready' && item.size != null && formatFileSize(item.size) }\n </span>\n <Show when={ item.uploadStatus === 'error' }>\n <button\n type=\"button\"\n className={ classNames.attachmentRetry }\n aria-label={ `Retry ${ item.filename }` }\n onClick={ () => retryAttachment(item.clientId) }\n >\n Retry\n </button>\n </Show>\n <button\n type=\"button\"\n className={ classNames.attachmentRemove }\n aria-label={ `Remove ${ item.filename }` }\n onClick={ () => removeAttachment(item.clientId) }\n >\n Remove\n </button>\n </div>\n ) }\n </For>\n </div>\n </Show>\n );\n}\n\nexport function ComposerFileButton({ className, children, ...props }: ActionProps) {\n const { openFilePicker, classNames } = useComposer();\n\n return (\n <button\n aria-label=\"Add files\"\n title=\"Add files\"\n { ...props }\n data-slot=\"composer-file-button\"\n type=\"button\"\n className={ cn(classNames.fileButton, className) }\n onClick={ () => openFilePicker() }\n >\n { children ?? <Plus fill=\"currentColor\" /> }\n </button>\n );\n}\n\nexport function ComposerPlan({\n className,\n children,\n classNames: slots,\n ...props\n}: ActionProps & { classNames?: Pick<ComposerClassNames, 'planIcon' | 'planLabel'> }) {\n const { value, setPlanMode, focus, classNames } = useComposer();\n\n return (\n <button\n aria-label=\"Plan mode\"\n title=\"Plan mode\"\n { ...props }\n data-slot=\"composer-plan\"\n type=\"button\"\n aria-pressed={ value.planMode }\n className={ cn(classNames.planButton, className) }\n onClick={ () => {\n setPlanMode(!value.planMode);\n focus();\n } }\n >\n { children ?? (\n <>\n <span className={ cn(classNames.planIcon, slots?.planIcon) }><Plan fill=\"currentColor\" /></span>\n <Show when={ value.planMode }>\n <span className={ cn(classNames.planLabel, slots?.planLabel) }>Plan mode</span>\n </Show>\n </>\n ) }\n </button>\n );\n}\n\nexport function ComposerTextarea({\n className,\n classNames: slots,\n style,\n onKeyDown,\n onPaste,\n ...props\n}: Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'defaultValue' | 'onChange' | 'ref'> & {\n classNames?: Pick<ComposerClassNames, 'textareaWrap'>;\n}) {\n const { value, setPrompt, submit, placeholder, autoFocus, submitOnEnter, rows, focusRef, pasteTextAsFile, classNames } = useComposer();\n\n return (\n <div data-slot=\"composer-field-wrapper\" className={ cn(classNames.textareaWrap, slots?.textareaWrap) }>\n <textarea\n placeholder={ placeholder }\n aria-label={ placeholder }\n autoFocus={ autoFocus }\n rows={ rows || 1 }\n { ...props }\n data-slot=\"composer-textarea\"\n ref={ (node) => {\n focusRef.current = node;\n } }\n className={ cn(classNames.textarea, classNames.plainField, className) }\n style={ style }\n value={ value.prompt }\n onChange={ event => setPrompt(event.target.value) }\n onKeyDown={ (event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.nativeEvent.isComposing || event.key !== 'Enter') {\n return;\n }\n const command = event.metaKey || event.ctrlKey;\n if ((submitOnEnter && !event.shiftKey && !command) || command) {\n event.preventDefault();\n submit();\n }\n } }\n onPaste={ (event) => {\n onPaste?.(event);\n if (!event.defaultPrevented && pasteTextAsFile(event.clipboardData.getData('text/plain'))) {\n event.preventDefault();\n }\n } }\n />\n </div>\n );\n}\n\nexport function ComposerSubmit({ className, children, ...props }: ActionProps) {\n const { submit, canSubmit, busy, classNames } = useComposer();\n\n return (\n <button\n aria-label=\"Create project\"\n title=\"Create project\"\n { ...props }\n data-slot=\"composer-submit\"\n type=\"button\"\n className={ cn(classNames.sendButton, className) }\n disabled={ !canSubmit }\n aria-busy={ busy }\n onClick={ () => submit() }\n >\n { children ?? <SendBold fill=\"currentColor\" /> }\n </button>\n );\n}\n"],"names":["ComposerFrame","className","slots","children","onDragEnter","onDragLeave","onDragOver","onDrop","onPaste","props","drag","fileDragOver","classNames","useComposer","cn","event","_jsx","Show","ComposerSurface","onPointerDown","rows","value","focus","expanded","ComposerTools","ComposerToolbar","ComposerAttachments","removeAttachment","retryAttachment","defaults","For","item","_jsxs","formatFileSize","ComposerFileButton","openFilePicker","Plus","ComposerPlan","setPlanMode","_Fragment","Plan","ComposerTextarea","style","onKeyDown","setPrompt","submit","placeholder","autoFocus","submitOnEnter","focusRef","pasteTextAsFile","node","command","ComposerS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IACjC,cAAc;AAAA,IACd,OAAO;AAAA,IACP,GAAGJ;AAAA,IACH,aAAa;AAAA,IACb,MAAM;AAAA,IACN,WAAWK,EAAGF,EAAW,YAAYX,CAAS;AAAA,IAC9C,UAAU,CAACqD;AAAA,IACX,aAAaC;AAAA,IACb,SAAS,MAAMV,EAAA;AAAA,IACf,UAAU1C,KAAyBa,gBAAAA,EAAKwC,GAAU;AAAA,MAChD,MAAM;AAAA,IAAA,CACP;AAAA,EAAA,CACF;AACH;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{@property --border-angle{syntax: "<angle>"; inherits: false; initial-value: 0deg;}@keyframes Composer_create-composer-border-spin_Ik8TZ9{to{--border-angle: 360deg}}.Composer_root_oK5RXF{display:flex;flex-direction:column;gap:var(--spacing-xl);width:100%}.Composer_shell_z36OYt{display:flex;position:relative;flex-direction:column;z-index:1;border-radius:calc(var(--radius-xl) * var(--squircle-radius-factor));padding:var(--spacing-6);width:100%;font-weight:400;font-size:var(--text-md);line-height:var(--leading-md);font-family:Onest,sans-serif;letter-spacing:0;corner-shape:superellipse(var(--squircle-value));--composer-border-coral: rgba(250, 136, 84, .16);--composer-border-blue: rgba(91, 141, 239, .28);--composer-border-pink: rgba(255, 161, 231, .26);transition:box-shadow var(--transition-duration) var(--ease-in-out);container-type:inline-size;background-color:var(--color-chat-composer);overflow:hidden;line-height:var(--spacing-20)}.dark .Composer_shell_z36OYt{--composer-border-coral: rgba(250, 136, 84, .15);--composer-border-blue: rgba(91, 141, 239, .2);--composer-border-pink: rgba(255, 161, 231, .18)}.Composer_shell_z36OYt:focus-within{box-shadow:0 0 var(--spacing-20) var(--spacing-1) var(--color-chat-shadow)}.Composer_shell_z36OYt:before{position:absolute;inset:0;border-radius:inherit;content:"";corner-shape:inherit;animation:Composer_create-composer-border-spin_Ik8TZ9 6s linear infinite;background-image:conic-gradient(from var(--border-angle),var(--composer-border-coral),var(--composer-border-blue) 50%,var(--composer-border-pink),var(--composer-border-coral));padding:2px;pointer-events:none;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.Composer_attachments_YHiboy{display:flex;flex-wrap:wrap;gap:var(--spacing-4);padding:var(--spacing-sm) var(--spacing-sm) var(--spacing-xxs)}.Composer_main_Y2cZOO{display:flex;position:relative;flex:1;flex-direction:column;z-index:0;cursor:text;padding:var(--spacing-sm);min-width:0;min-height:0}.Composer_main_Y2cZOO[data-expanded] .Composer_textarea_ED0vo8{margin-bottom:var(--spacing-sm);padding-bottom:var(--spacing-30);padding-inline:0}.Composer_main_Y2cZOO:not([data-expanded]){display:flex;align-items:center;min-height:var(--spacing-30)}.Composer_main_Y2cZOO:not([data-expanded]) .Composer_textareaWrap_20eG8b{display:flex;align-items:center;min-height:var(--spacing-30)}.Composer_main_Y2cZOO:not([data-expanded]) .Composer_textarea_ED0vo8{display:flex;flex:1;align-items:center;padding-right:var(--spacing-40);padding-left:var(--spacing-36);min-width:0;min-height:var(--spacing-30)!important}.Composer_main_Y2cZOO:not([data-expanded]) .Composer_textarea_ED0vo8 [contenteditable=true]{width:100%;min-height:0!important;overflow:hidden!important}.Composer_main_Y2cZOO[data-min-rows] .Composer_textarea_ED0vo8 [contenteditable=true]{width:100%}.Composer_main_Y2cZOO:not([data-expanded]) .Composer_addButton_Gr6lpT,.Composer_main_Y2cZOO:not([data-expanded]) .Composer_sendButton_261s9p,.Composer_main_Y2cZOO:not([data-expanded]) .Composer_toolbarEnd_zlFlGo{top:0;bottom:0;margin-block:auto}.Composer_textareaWrap_20eG8b{position:relative;flex:1;z-index:1;min-width:0}.Composer_textarea_ED0vo8{position:relative;border:0;width:100%;min-height:var(--spacing-30)!important}.Composer_plainField_BSucqo{display:block;outline:none;background:transparent;padding:0;max-height:280px;overflow:auto;resize:none;color:inherit;font:inherit;line-height:inherit}.Composer_addButton_Gr6lpT,.Composer_toolbarEnd_zlFlGo,.Composer_sendButton_261s9p{position:absolute;bottom:var(--spacing-xs);z-index:2}.Composer_addButton_Gr6lpT{display:flex;left:var(--spacing-xs);align-items:center;gap:var(--spacing-xs)}.Composer_toolbarEnd_zlFlGo{display:flex;right:calc(var(--spacing-xs) + var(--spacing-30) + var(--spacing-xs));align-items:center;gap:0;max-width:calc(100% - var(--spacing-80))}.Composer_sendButton_261s9p{right:var(--spacing-xs)}}@layer components{.Composer_root_oK5RXF{position:relative}.Composer_fileButton_7fa3cD,.Composer_planButton_FfQMTx,.Composer_sendButton_261s9p,.Composer_attachmentRetry_dE4e9U,.Composer_attachmentRemove_UJ8Ypt{display:inline-flex;flex-shrink:0;justify-content:center;align-items:center;gap:var(--spacing-xs);cursor:pointer;border:0;background:transparent;color:inherit;font:inherit}.Composer_fileButton_7fa3cD,.Composer_planButton_FfQMTx,.Composer_sendButton_261s9p{border-radius:var(--radius-full);padding:var(--spacing-sm);min-width:var(--spacing-30);height:var(--spacing-30)}.Composer_fileButton_7fa3cD:hover,.Composer_planButton_FfQMTx:hover{background:var(--color-secondary-muted-light)}.Composer_planButton_FfQMTx[aria-pressed=true]{background:var(--color-success-muted-light);padding-inline:var(--spacing-md);height:var(--spacing-24);color:var(--color-success)}.Composer_planIcon_speGCQ{display:inline-flex}.Composer_planLabel_QqsYmJ{font-size:var(--text-sm)}.Composer_sendButton_261s9p{background:var(--color-primary);color:var(--color-primary-content)}.Composer_sendButton_261s9p:hover:enabled{background:var(--color-primary-light)}.Composer_sendButton_261s9p:disabled{opacity:var(--opacity-disabled);cursor:default}.Composer_sendButton_261s9p[aria-busy=true] svg{animation:Composer_create-composer-pending_hGy5Ys 1s ease-in-out infinite alternate}.Composer_attachment_ze2E44{display:flex;align-items:center;gap:var(--spacing-sm);border-radius:calc(var(--radius-sm) * var(--squircle-radius-factor));padding:var(--spacing-sm);corner-shape:superellipse(var(--squircle-value));background:var(--color-secondary-muted-light);min-width:0;max-width:100%;font-size:var(--text-sm)}.Composer_attachmentPreview_st6nef{width:var(--spacing-30);height:var(--spacing-30);-o-object-fit:cover;border-radius:var(--radius-sm);object-fit:cover}.Composer_attachmentName_zdUej2{overflow:hidden;color:inherit;text-overflow:ellipsis;white-space:nowrap}.Composer_attachmentStatus_duB1GB{color:var(--color-secondary-muted-text)}.Composer_attachment_ze2E44[data-status=error] .Composer_attachmentStatus_duB1GB,.Composer_notice_4Qehyf{color:var(--color-danger)}.Composer_editor_L4tPFX{outline:none;min-height:var(--composer-min-height, 66px);max-height:280px;overflow-y:auto;white-space:pre-wrap;overflow-wrap:break-word}.Composer_editor_L4tPFX p{margin:0}.Composer_editor_L4tPFX ul,.Composer_editor_L4tPFX ol{margin:0;padding-inline-start:1.5em}.Composer_editor_L4tPFX ul{list-style-type:disc}.Composer_editor_L4tPFX ol{list-style-type:decimal}.Composer_editor_L4tPFX .is-editor-empty:first-child:before{float:left;height:0;pointer-events:none;content:attr(data-placeholder);color:var(--color-secondary-muted-text)}.Composer_dropOverlay_GuFoRm{display:grid;position:absolute;place-items:center;z-index:3;inset:0;border:1px dashed var(--color-primary);border-radius:var(--radius-xl);background:var(--color-surface);pointer-events:none}.Composer_dropLabel_BgNwlz{color:var(--color-primary)}@keyframes Composer_create-composer-pending_hGy5Ys{to{opacity:.4}}}.Composer_editor_L4tPFX:focus,.Composer_editor_L4tPFX:focus-visible{outline:none;box-shadow:none;border:none}
|