@expcat/tigercat-vue 2.0.0-rc.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-EGIQPUEL.mjs → chunk-5C32WCQY.mjs} +8 -6
- package/dist/{chunk-QFG452MD.mjs → chunk-5RXYJWNA.mjs} +53 -28
- package/dist/{chunk-36TZA5BH.mjs → chunk-A5QYJSHK.mjs} +0 -3
- package/dist/{chunk-H26JXVJX.mjs → chunk-A7QIMKWQ.mjs} +1 -1
- package/dist/{chunk-7JT5ZIHC.mjs → chunk-BCU7GYF6.mjs} +16 -8
- package/dist/{chunk-7CPMXNLK.mjs → chunk-BNYA5IUB.mjs} +26 -2
- package/dist/{chunk-CFH5T3V2.mjs → chunk-DKMKJZ7A.mjs} +1 -1
- package/dist/{chunk-SUORTZUY.mjs → chunk-EZZD4OCV.mjs} +47 -19
- package/dist/{chunk-IMFHJEUX.mjs → chunk-JKPXJ3VB.mjs} +6 -1
- package/dist/{chunk-3NQUEQJT.mjs → chunk-NP6DZQ3O.mjs} +53 -37
- package/dist/{chunk-5KPO3EDM.mjs → chunk-OTHJIFDV.mjs} +28 -15
- package/dist/{chunk-BNNTDSLJ.mjs → chunk-SK2QJ66E.mjs} +0 -1
- package/dist/{chunk-JZCETBUV.mjs → chunk-WUQMFKQ6.mjs} +29 -16
- package/dist/{chunk-GWFVBG22.mjs → chunk-XGXZF27U.mjs} +28 -15
- package/dist/{chunk-JVQPU4M2.mjs → chunk-ZGA66PSG.mjs} +28 -15
- package/dist/components/ActivityFeed.d.mts +6 -6
- package/dist/components/ActivityFeed.mjs +1 -1
- package/dist/components/Alert.d.mts +3 -3
- package/dist/components/Anchor.d.mts +1 -1
- package/dist/components/AreaChart.d.mts +3 -3
- package/dist/components/AreaChart.mjs +1 -1
- package/dist/components/AutoComplete.d.mts +5 -5
- package/dist/components/Avatar.d.mts +1 -1
- package/dist/components/AvatarGroup.d.mts +2 -2
- package/dist/components/BackTop.d.mts +1 -1
- package/dist/components/Badge.d.mts +4 -4
- package/dist/components/BarChart.d.mts +2 -2
- package/dist/components/BarChart.mjs +1 -1
- package/dist/components/Breadcrumb.d.mts +3 -3
- package/dist/components/Button.d.mts +3 -3
- package/dist/components/ButtonGroup.d.mts +1 -1
- package/dist/components/Calendar.d.mts +2 -2
- package/dist/components/Card.d.mts +2 -2
- package/dist/components/Carousel.d.mts +2 -2
- package/dist/components/Cascader.d.mts +3 -3
- package/dist/components/ChartCanvas.d.mts +1 -1
- package/dist/components/ChartGrid.d.mts +1 -1
- package/dist/components/ChartLegend.d.mts +1 -1
- package/dist/components/ChatWindow.d.mts +4 -4
- package/dist/components/CodeEditor.d.mts +3 -3
- package/dist/components/Collapse.d.mts +1 -1
- package/dist/components/CollapsePanel.d.mts +1 -1
- package/dist/components/ColorSwatch.d.mts +2 -2
- package/dist/components/CommentThread.d.mts +2 -2
- package/dist/components/CommentThread.mjs +1 -1
- package/dist/components/ConfigProvider.d.mts +1 -1
- package/dist/components/Container.d.mts +1 -1
- package/dist/components/Countdown.d.mts +2 -2
- package/dist/components/CronEditor.d.mts +2 -2
- package/dist/components/CropUpload.d.mts +1 -1
- package/dist/components/CropUpload.mjs +2 -2
- package/dist/components/DataExport.d.mts +2 -2
- package/dist/components/DataExport.mjs +2 -2
- package/dist/components/DataTableWithToolbar.d.mts +11 -11
- package/dist/components/DatePicker.d.mts +3 -3
- package/dist/components/Descriptions.d.mts +2 -2
- package/dist/components/DonutChart.d.mts +3 -3
- package/dist/components/Drawer.d.mts +4 -4
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/FileManager.d.mts +2 -2
- package/dist/components/FloatButton.d.mts +4 -4
- package/dist/components/Form.d.mts +2 -2
- package/dist/components/FormWizard.d.mts +5 -5
- package/dist/components/FunnelChart.d.mts +3 -3
- package/dist/components/Gantt.d.mts +2 -2
- package/dist/components/GaugeChart.d.mts +2 -2
- package/dist/components/HeatmapChart.d.mts +3 -3
- package/dist/components/Icon.d.mts +2 -2
- package/dist/components/Image.d.mts +2 -2
- package/dist/components/Image.mjs +1 -1
- package/dist/components/ImageAnnotation.d.mts +5 -5
- package/dist/components/ImageCropper.d.mts +1 -1
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/ImageViewer.d.mts +1 -1
- package/dist/components/InfiniteScroll.d.mts +3 -3
- package/dist/components/InfiniteScroll.mjs +1 -1
- package/dist/components/Input.d.mts +4 -4
- package/dist/components/InputGroup.d.mts +1 -1
- package/dist/components/InputNumber.d.mts +1 -1
- package/dist/components/Kanban.d.mts +1 -1
- package/dist/components/LineChart.d.mts +2 -2
- package/dist/components/LineChart.mjs +1 -1
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/List.d.mts +7 -7
- package/dist/components/Loading.d.mts +6 -6
- package/dist/components/MarkdownEditor.d.mts +5 -5
- package/dist/components/Mentions.d.mts +3 -3
- package/dist/components/Menu.d.mts +4 -4
- package/dist/components/Modal.d.mts +7 -7
- package/dist/components/NotificationCenter.d.mts +5 -5
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NumberKeyboard.d.mts +5 -5
- package/dist/components/OrgChart.d.mts +3 -3
- package/dist/components/Pagination.d.mts +5 -5
- package/dist/components/PieChart.d.mts +3 -3
- package/dist/components/Popconfirm.d.mts +2 -2
- package/dist/components/Popover.d.mts +1 -1
- package/dist/components/Progress.d.mts +3 -3
- package/dist/components/QRCode.d.mts +3 -3
- package/dist/components/RadarChart.d.mts +3 -3
- package/dist/components/Rate.d.mts +2 -2
- package/dist/components/Result.d.mts +1 -1
- package/dist/components/RichTextEditor.d.mts +4 -4
- package/dist/components/Row.d.mts +1 -1
- package/dist/components/ScatterChart.d.mts +2 -2
- package/dist/components/ScatterChart.mjs +1 -1
- package/dist/components/ScrollSpy.d.mts +3 -3
- package/dist/components/Select.d.mts +3 -3
- package/dist/components/Signature.d.mts +5 -5
- package/dist/components/Skeleton.d.mts +1 -1
- package/dist/components/Space.d.mts +2 -2
- package/dist/components/Splitter.d.mts +1 -1
- package/dist/components/Spotlight.d.mts +4 -4
- package/dist/components/Steps.d.mts +3 -3
- package/dist/components/SunburstChart.d.mts +2 -2
- package/dist/components/Table.d.mts +5 -5
- package/dist/components/Tabs.d.mts +4 -4
- package/dist/components/Tag.d.mts +2 -2
- package/dist/components/TaskBoard.d.mts +2 -2
- package/dist/components/Text.d.mts +3 -3
- package/dist/components/Textarea.d.mts +3 -3
- package/dist/components/TimePicker.d.mts +4 -4
- package/dist/components/Timeline.d.mts +4 -4
- package/dist/components/Tooltip.d.mts +1 -1
- package/dist/components/Tour.d.mts +2 -2
- package/dist/components/Transfer.d.mts +3 -3
- package/dist/components/Tree.d.mts +4 -4
- package/dist/components/TreeMapChart.d.mts +2 -2
- package/dist/components/TreeSelect.d.mts +3 -3
- package/dist/components/Upload.d.mts +4 -4
- package/dist/components/Upload.mjs +1 -1
- package/dist/components/VirtualTable.d.mts +3 -3
- package/dist/components/VirtualTable.mjs +1 -1
- package/dist/components/Watermark.d.mts +1 -1
- package/dist/index.d.mts +1 -1
- package/package.json +2 -2
|
@@ -160,7 +160,7 @@ var VirtualTable = defineComponent({
|
|
|
160
160
|
),
|
|
161
161
|
style: { ...widthStyle, ...stickyStyle }
|
|
162
162
|
},
|
|
163
|
-
col.title ?? ""
|
|
163
|
+
[col.renderHeader ? col.renderHeader() : col.title ?? ""]
|
|
164
164
|
);
|
|
165
165
|
});
|
|
166
166
|
const headerRowChildren = [
|
|
@@ -195,8 +195,10 @@ var VirtualTable = defineComponent({
|
|
|
195
195
|
emit("row-click", row, globalIdx);
|
|
196
196
|
if (hasSelection.value) toggleRowSelection(key, row);
|
|
197
197
|
};
|
|
198
|
-
const cells = visibleColumns.map(
|
|
199
|
-
|
|
198
|
+
const cells = visibleColumns.map((col, colIdx) => {
|
|
199
|
+
const dataKey = col.dataKey || col.key;
|
|
200
|
+
const value = row[dataKey];
|
|
201
|
+
return h(
|
|
200
202
|
"td",
|
|
201
203
|
{
|
|
202
204
|
key: col.key,
|
|
@@ -218,9 +220,9 @@ var VirtualTable = defineComponent({
|
|
|
218
220
|
),
|
|
219
221
|
style: getVirtualTableFixedCellStyle(col.key, fi)
|
|
220
222
|
},
|
|
221
|
-
|
|
222
|
-
)
|
|
223
|
-
);
|
|
223
|
+
[col.render ? col.render(row, globalIdx) : value]
|
|
224
|
+
);
|
|
225
|
+
});
|
|
224
226
|
const rowChildren = [
|
|
225
227
|
colRange && colRange.leftPad > 0 ? h("td", {
|
|
226
228
|
key: "__left-pad",
|
|
@@ -24,6 +24,31 @@ import {
|
|
|
24
24
|
clipCommentTreeDepth,
|
|
25
25
|
formatCommentTime
|
|
26
26
|
} from "@expcat/tigercat-core";
|
|
27
|
+
|
|
28
|
+
// ../core/src/internal/comment-thread-styles.ts
|
|
29
|
+
var buttonBaseClasses = "tiger-motion-aware px-2 py-0.5 h-auto min-h-0 text-xs rounded-[var(--tiger-radius-md,0.5rem)] [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
30
|
+
var commentThreadActionButtonClasses = `${buttonBaseClasses} text-[var(--tiger-text-muted,#6b7280)] font-medium flex items-center gap-1.5`;
|
|
31
|
+
var commentThreadPrimaryButtonClasses = `${buttonBaseClasses} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] font-semibold hover:bg-[var(--tiger-outline-bg-hover,#eff6ff)]`;
|
|
32
|
+
var commentThreadLikeButtonClasses = "hover:text-[var(--tiger-primary,#2563eb)] hover:bg-[var(--tiger-outline-bg-hover,#eff6ff)]";
|
|
33
|
+
var commentThreadLikedButtonClasses = "text-[var(--tiger-primary,#2563eb)] bg-[var(--tiger-outline-bg-hover,#eff6ff)] font-semibold border-[var(--tiger-primary,#2563eb)]/40";
|
|
34
|
+
var commentThreadReplyButtonClasses = "hover:text-[var(--tiger-success,#16a34a)] hover:bg-[var(--tiger-surface-muted,#f9fafb)]";
|
|
35
|
+
var commentThreadNeutralButtonClasses = "hover:text-[var(--tiger-text,#111827)] hover:bg-[var(--tiger-surface-muted,#f3f4f6)]";
|
|
36
|
+
var commentThreadLikeIconClasses = "tiger-motion-aware w-3.5 h-3.5 transition-transform active:scale-125";
|
|
37
|
+
var commentThreadDividerClasses = "border-b border-[var(--tiger-border,#e5e7eb)]";
|
|
38
|
+
var commentThreadAvatarClasses = "tiger-motion-aware shrink-0 mt-0.5 ring-1 ring-[var(--tiger-border,#e5e7eb)] shadow-sm [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))] hover:scale-105";
|
|
39
|
+
var commentThreadAuthorClasses = "tiger-motion-aware text-[var(--tiger-text,#111827)] hover:text-[var(--tiger-primary,#2563eb)] transition-colors cursor-pointer";
|
|
40
|
+
var commentThreadUserTitleClasses = "bg-[var(--tiger-surface-muted,#f3f4f6)] px-1.5 py-0.5 rounded text-[var(--tiger-text-muted,#6b7280)] font-medium";
|
|
41
|
+
var commentThreadTimeClasses = "ml-auto text-[var(--tiger-text-muted,#6b7280)] font-normal";
|
|
42
|
+
var commentThreadContentClasses = "text-sm text-[var(--tiger-text-secondary,#4b5563)] leading-relaxed break-words mt-2 mb-3 pr-2";
|
|
43
|
+
var commentThreadReplyEditorClasses = "tiger-motion-aware mt-3 space-y-3 bg-[var(--tiger-surface-muted,#f9fafb)] border border-[var(--tiger-border,#e5e7eb)] p-4 rounded-[var(--tiger-radius-lg,0.75rem)] shadow-sm [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
44
|
+
var commentThreadReplyTextareaClasses = "tiger-motion-aware bg-[var(--tiger-surface,#ffffff)] border-[var(--tiger-border,#d1d5db)] focus:ring-2 focus:ring-[var(--tiger-primary,#2563eb)]/20 focus:border-[var(--tiger-primary,#2563eb)] rounded-[var(--tiger-radius-md,0.5rem)] shadow-inner [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
45
|
+
var commentThreadCancelButtonClasses = "tiger-motion-aware px-3 py-1.5 text-xs text-[var(--tiger-text-muted,#6b7280)] hover:text-[var(--tiger-text,#111827)] rounded-[var(--tiger-radius-md,0.5rem)] transition-colors";
|
|
46
|
+
var commentThreadSubmitButtonClasses = "tiger-motion-aware px-3 py-1.5 text-xs font-semibold shadow-sm hover:shadow rounded-[var(--tiger-radius-md,0.5rem)] [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
47
|
+
var commentThreadRepliesClasses = "tiger-motion-aware mt-4 ml-1 pl-4 border-l-2 border-[var(--tiger-border,#e5e7eb)] hover:border-[var(--tiger-primary,#2563eb)]/40 space-y-4 transition-colors";
|
|
48
|
+
var commentThreadEmptyClasses = "tiger-motion-aware flex flex-col items-center justify-center border border-dashed border-[var(--tiger-border,#d1d5db)] rounded-[var(--tiger-radius-lg,0.75rem)] py-12 px-4 bg-[var(--tiger-surface-muted,#f9fafb)] transition-colors";
|
|
49
|
+
var commentThreadEmptyIconClasses = "w-10 h-10 text-[var(--tiger-text-muted,#9ca3af)] mb-3";
|
|
50
|
+
|
|
51
|
+
// src/components/CommentThread.ts
|
|
27
52
|
var CommentThread = defineComponent({
|
|
28
53
|
name: "TigerCommentThread",
|
|
29
54
|
inheritAttrs: false,
|
|
@@ -163,9 +188,6 @@ var CommentThread = defineComponent({
|
|
|
163
188
|
updateExpandedKeys(next);
|
|
164
189
|
}
|
|
165
190
|
};
|
|
166
|
-
const BTN_BASE = "px-2 py-0.5 h-auto min-h-0 text-xs rounded-md transition-all duration-200 ease-out";
|
|
167
|
-
const ACTION_BTN = `${BTN_BASE} text-gray-500 dark:text-gray-400 font-medium flex items-center gap-1.5`;
|
|
168
|
-
const PRIMARY_BTN = `${BTN_BASE} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] dark:text-blue-400 dark:hover:text-blue-300 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10`;
|
|
169
191
|
const renderNode = (node, depth, isLast) => {
|
|
170
192
|
const children = node.children ?? [];
|
|
171
193
|
const hasChildren = children.length > 0;
|
|
@@ -187,9 +209,9 @@ var CommentThread = defineComponent({
|
|
|
187
209
|
size: "sm",
|
|
188
210
|
variant: "ghost",
|
|
189
211
|
className: classNames(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
node.liked &&
|
|
212
|
+
commentThreadActionButtonClasses,
|
|
213
|
+
commentThreadLikeButtonClasses,
|
|
214
|
+
node.liked && commentThreadLikedButtonClasses
|
|
193
215
|
),
|
|
194
216
|
onClick: () => emit("like", node, !node.liked)
|
|
195
217
|
},
|
|
@@ -199,7 +221,7 @@ var CommentThread = defineComponent({
|
|
|
199
221
|
"svg",
|
|
200
222
|
{
|
|
201
223
|
class: classNames(
|
|
202
|
-
|
|
224
|
+
commentThreadLikeIconClasses,
|
|
203
225
|
node.liked ? "fill-current" : "stroke-current fill-none"
|
|
204
226
|
),
|
|
205
227
|
viewBox: "0 0 24 24",
|
|
@@ -228,8 +250,8 @@ var CommentThread = defineComponent({
|
|
|
228
250
|
size: "sm",
|
|
229
251
|
variant: "ghost",
|
|
230
252
|
className: classNames(
|
|
231
|
-
|
|
232
|
-
|
|
253
|
+
commentThreadActionButtonClasses,
|
|
254
|
+
commentThreadReplyButtonClasses
|
|
233
255
|
),
|
|
234
256
|
onClick: () => {
|
|
235
257
|
replyingTo.value = replyingTo.value === node.id ? null : node.id;
|
|
@@ -270,8 +292,8 @@ var CommentThread = defineComponent({
|
|
|
270
292
|
size: "sm",
|
|
271
293
|
variant: "ghost",
|
|
272
294
|
className: classNames(
|
|
273
|
-
|
|
274
|
-
|
|
295
|
+
commentThreadActionButtonClasses,
|
|
296
|
+
commentThreadNeutralButtonClasses
|
|
275
297
|
),
|
|
276
298
|
onClick: () => emit("more", node)
|
|
277
299
|
},
|
|
@@ -310,7 +332,10 @@ var CommentThread = defineComponent({
|
|
|
310
332
|
key: actionKey,
|
|
311
333
|
size: "sm",
|
|
312
334
|
variant: action.variant ?? "ghost",
|
|
313
|
-
className: classNames(
|
|
335
|
+
className: classNames(
|
|
336
|
+
commentThreadActionButtonClasses,
|
|
337
|
+
commentThreadNeutralButtonClasses
|
|
338
|
+
),
|
|
314
339
|
disabled: action.disabled,
|
|
315
340
|
onClick: () => {
|
|
316
341
|
action.onClick?.(node, action);
|
|
@@ -328,7 +353,7 @@ var CommentThread = defineComponent({
|
|
|
328
353
|
class: classNames(
|
|
329
354
|
"tiger-comment-thread-item",
|
|
330
355
|
depth === 1 && "py-5",
|
|
331
|
-
depth === 1 && !isLast && props.showDivider &&
|
|
356
|
+
depth === 1 && !isLast && props.showDivider && commentThreadDividerClasses
|
|
332
357
|
),
|
|
333
358
|
key: node.id
|
|
334
359
|
},
|
|
@@ -338,7 +363,7 @@ var CommentThread = defineComponent({
|
|
|
338
363
|
size: depth === 1 ? "md" : "sm",
|
|
339
364
|
src: node.user.avatar,
|
|
340
365
|
text: node.user.name,
|
|
341
|
-
className:
|
|
366
|
+
className: commentThreadAvatarClasses
|
|
342
367
|
}) : null,
|
|
343
368
|
h("div", { class: "flex-1 min-w-0" }, [
|
|
344
369
|
h("div", { class: "flex items-center gap-2 flex-wrap" }, [
|
|
@@ -348,7 +373,7 @@ var CommentThread = defineComponent({
|
|
|
348
373
|
tag: "span",
|
|
349
374
|
size: "sm",
|
|
350
375
|
weight: "bold",
|
|
351
|
-
class:
|
|
376
|
+
class: commentThreadAuthorClasses
|
|
352
377
|
},
|
|
353
378
|
{ default: () => node.user?.name }
|
|
354
379
|
) : null,
|
|
@@ -358,7 +383,7 @@ var CommentThread = defineComponent({
|
|
|
358
383
|
tag: "span",
|
|
359
384
|
size: "xs",
|
|
360
385
|
color: "muted",
|
|
361
|
-
class:
|
|
386
|
+
class: commentThreadUserTitleClasses
|
|
362
387
|
},
|
|
363
388
|
{ default: () => node.user?.title }
|
|
364
389
|
) : null,
|
|
@@ -389,7 +414,7 @@ var CommentThread = defineComponent({
|
|
|
389
414
|
tag: "span",
|
|
390
415
|
size: "xs",
|
|
391
416
|
color: "muted",
|
|
392
|
-
class:
|
|
417
|
+
class: commentThreadTimeClasses
|
|
393
418
|
},
|
|
394
419
|
{ default: () => formatCommentTime(node.time) }
|
|
395
420
|
) : null
|
|
@@ -397,7 +422,7 @@ var CommentThread = defineComponent({
|
|
|
397
422
|
h(
|
|
398
423
|
"div",
|
|
399
424
|
{
|
|
400
|
-
class:
|
|
425
|
+
class: commentThreadContentClasses
|
|
401
426
|
},
|
|
402
427
|
String(node.content)
|
|
403
428
|
),
|
|
@@ -405,14 +430,14 @@ var CommentThread = defineComponent({
|
|
|
405
430
|
replyingTo.value === node.id ? h(
|
|
406
431
|
"div",
|
|
407
432
|
{
|
|
408
|
-
class:
|
|
433
|
+
class: commentThreadReplyEditorClasses
|
|
409
434
|
},
|
|
410
435
|
[
|
|
411
436
|
h(Textarea, {
|
|
412
437
|
rows: 3,
|
|
413
438
|
modelValue: replyValue.value,
|
|
414
439
|
placeholder: props.replyPlaceholder,
|
|
415
|
-
className:
|
|
440
|
+
className: commentThreadReplyTextareaClasses,
|
|
416
441
|
"onUpdate:modelValue": (value) => {
|
|
417
442
|
replyValue.value = value;
|
|
418
443
|
}
|
|
@@ -423,7 +448,7 @@ var CommentThread = defineComponent({
|
|
|
423
448
|
{
|
|
424
449
|
size: "sm",
|
|
425
450
|
variant: "ghost",
|
|
426
|
-
className:
|
|
451
|
+
className: commentThreadCancelButtonClasses,
|
|
427
452
|
onClick: () => {
|
|
428
453
|
replyingTo.value = null;
|
|
429
454
|
replyValue.value = "";
|
|
@@ -436,7 +461,7 @@ var CommentThread = defineComponent({
|
|
|
436
461
|
{
|
|
437
462
|
size: "sm",
|
|
438
463
|
variant: "primary",
|
|
439
|
-
className:
|
|
464
|
+
className: commentThreadSubmitButtonClasses,
|
|
440
465
|
onClick: () => handleReplySubmit(node)
|
|
441
466
|
},
|
|
442
467
|
{ default: () => props.replyButtonText }
|
|
@@ -450,8 +475,8 @@ var CommentThread = defineComponent({
|
|
|
450
475
|
size: "sm",
|
|
451
476
|
variant: "ghost",
|
|
452
477
|
className: classNames(
|
|
453
|
-
"mt-2 font-semibold
|
|
454
|
-
|
|
478
|
+
"mt-2 font-semibold",
|
|
479
|
+
commentThreadPrimaryButtonClasses
|
|
455
480
|
),
|
|
456
481
|
"aria-expanded": isExpanded,
|
|
457
482
|
"aria-controls": repliesId,
|
|
@@ -465,7 +490,7 @@ var CommentThread = defineComponent({
|
|
|
465
490
|
"div",
|
|
466
491
|
{
|
|
467
492
|
id: repliesId,
|
|
468
|
-
class:
|
|
493
|
+
class: commentThreadRepliesClasses
|
|
469
494
|
},
|
|
470
495
|
[
|
|
471
496
|
...visibleChildren.map(
|
|
@@ -476,7 +501,7 @@ var CommentThread = defineComponent({
|
|
|
476
501
|
{
|
|
477
502
|
size: "sm",
|
|
478
503
|
variant: "ghost",
|
|
479
|
-
className:
|
|
504
|
+
className: commentThreadPrimaryButtonClasses,
|
|
480
505
|
onClick: () => handleLoadMore(node)
|
|
481
506
|
},
|
|
482
507
|
{ default: () => props.loadMoreText }
|
|
@@ -494,13 +519,13 @@ var CommentThread = defineComponent({
|
|
|
494
519
|
h(
|
|
495
520
|
"div",
|
|
496
521
|
{
|
|
497
|
-
class:
|
|
522
|
+
class: commentThreadEmptyClasses
|
|
498
523
|
},
|
|
499
524
|
[
|
|
500
525
|
h(
|
|
501
526
|
"svg",
|
|
502
527
|
{
|
|
503
|
-
class:
|
|
528
|
+
class: commentThreadEmptyIconClasses,
|
|
504
529
|
fill: "none",
|
|
505
530
|
viewBox: "0 0 24 24",
|
|
506
531
|
stroke: "currentColor",
|
|
@@ -41,7 +41,6 @@ var InfiniteScroll = defineComponent({
|
|
|
41
41
|
const containerRef = ref(null);
|
|
42
42
|
const sentinelRef = ref(null);
|
|
43
43
|
let cleanupObserver = null;
|
|
44
|
-
let _usingFallback = false;
|
|
45
44
|
const containerClasses = computed(
|
|
46
45
|
() => classNames(
|
|
47
46
|
getInfiniteScrollContainerClasses(props.direction, props.className),
|
|
@@ -63,7 +62,6 @@ var InfiniteScroll = defineComponent({
|
|
|
63
62
|
function setupObserver() {
|
|
64
63
|
cleanupObserver?.();
|
|
65
64
|
cleanupObserver = null;
|
|
66
|
-
_usingFallback = false;
|
|
67
65
|
if (props.disabled || !props.hasMore) return;
|
|
68
66
|
const sentinel = sentinelRef.value;
|
|
69
67
|
if (!sentinel) return;
|
|
@@ -77,7 +75,6 @@ var InfiniteScroll = defineComponent({
|
|
|
77
75
|
if (teardown) {
|
|
78
76
|
cleanupObserver = teardown;
|
|
79
77
|
} else {
|
|
80
|
-
_usingFallback = true;
|
|
81
78
|
containerRef.value?.addEventListener("scroll", checkScroll, { passive: true });
|
|
82
79
|
cleanupObserver = () => {
|
|
83
80
|
containerRef.value?.removeEventListener("scroll", checkScroll);
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
getImageEditorLabels,
|
|
32
32
|
mergeTigerLocale
|
|
33
33
|
} from "@expcat/tigercat-core";
|
|
34
|
+
var isPositiveFinite = (value) => Number.isFinite(value) && value > 0;
|
|
34
35
|
var ImageCropper = defineComponent({
|
|
35
36
|
name: "TigerImageCropper",
|
|
36
37
|
inheritAttrs: false,
|
|
@@ -73,20 +74,27 @@ var ImageCropper = defineComponent({
|
|
|
73
74
|
const dragStartPos = ref({ x: 0, y: 0 });
|
|
74
75
|
const dragStartRect = ref({ x: 0, y: 0, width: 0, height: 0 });
|
|
75
76
|
const loadImage = () => {
|
|
77
|
+
imageRef.value = null;
|
|
76
78
|
const img = new window.Image();
|
|
77
79
|
img.crossOrigin = "anonymous";
|
|
78
80
|
img.onload = () => {
|
|
79
|
-
|
|
81
|
+
const naturalWidth = img.naturalWidth;
|
|
82
|
+
const naturalHeight = img.naturalHeight;
|
|
83
|
+
if (!isPositiveFinite(naturalWidth) || !isPositiveFinite(naturalHeight)) return;
|
|
80
84
|
if (containerRef.value) {
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
const measuredWidth = containerRef.value.clientWidth;
|
|
86
|
+
const measuredHeight = containerRef.value.clientHeight;
|
|
87
|
+
const containerW = isPositiveFinite(measuredWidth) ? measuredWidth : naturalWidth;
|
|
88
|
+
const containerH = isPositiveFinite(measuredHeight) ? measuredHeight : 400;
|
|
89
|
+
const ratio = Math.min(containerW / naturalWidth, containerH / naturalHeight, 1);
|
|
90
|
+
displayWidth.value = naturalWidth * ratio;
|
|
91
|
+
displayHeight.value = naturalHeight * ratio;
|
|
86
92
|
} else {
|
|
87
|
-
displayWidth.value =
|
|
88
|
-
displayHeight.value =
|
|
93
|
+
displayWidth.value = naturalWidth;
|
|
94
|
+
displayHeight.value = naturalHeight;
|
|
89
95
|
}
|
|
96
|
+
if (!isPositiveFinite(displayWidth.value) || !isPositiveFinite(displayHeight.value)) return;
|
|
97
|
+
imageRef.value = img;
|
|
90
98
|
cropRect.value = getInitialCropRect(
|
|
91
99
|
displayWidth.value,
|
|
92
100
|
displayHeight.value,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-UOJOJBEU.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/Upload.ts
|
|
6
|
-
import { defineComponent, ref, computed, watch, h } from "vue";
|
|
6
|
+
import { defineComponent, ref, computed, watch, h, onBeforeUnmount } from "vue";
|
|
7
7
|
import {
|
|
8
8
|
classNames,
|
|
9
9
|
coerceClassValue,
|
|
@@ -216,6 +216,23 @@ var Upload = defineComponent({
|
|
|
216
216
|
}
|
|
217
217
|
return internalFileList.value;
|
|
218
218
|
});
|
|
219
|
+
const objectUrls = /* @__PURE__ */ new Map();
|
|
220
|
+
const revokeUnusedObjectUrls = (files) => {
|
|
221
|
+
const activeFiles = new Set(
|
|
222
|
+
files.flatMap((file) => file.file && !file.url ? [file.file] : [])
|
|
223
|
+
);
|
|
224
|
+
objectUrls.forEach((url, file) => {
|
|
225
|
+
if (!activeFiles.has(file)) {
|
|
226
|
+
URL.revokeObjectURL(url);
|
|
227
|
+
objectUrls.delete(file);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
watch(fileListValue, revokeUnusedObjectUrls, { deep: true });
|
|
232
|
+
onBeforeUnmount(() => {
|
|
233
|
+
objectUrls.forEach((url) => URL.revokeObjectURL(url));
|
|
234
|
+
objectUrls.clear();
|
|
235
|
+
});
|
|
219
236
|
const setFileList = (value) => {
|
|
220
237
|
if (!isControlled.value) {
|
|
221
238
|
internalFileList.value = value;
|
|
@@ -597,7 +614,14 @@ var Upload = defineComponent({
|
|
|
597
614
|
);
|
|
598
615
|
};
|
|
599
616
|
const renderPictureCard = (file) => {
|
|
600
|
-
|
|
617
|
+
let imageUrl = file.url ?? "";
|
|
618
|
+
if (!imageUrl && file.file && typeof URL !== "undefined" && typeof URL.createObjectURL === "function") {
|
|
619
|
+
imageUrl = objectUrls.get(file.file) ?? "";
|
|
620
|
+
if (!imageUrl) {
|
|
621
|
+
imageUrl = URL.createObjectURL(file.file);
|
|
622
|
+
objectUrls.set(file.file, imageUrl);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
601
625
|
return h(
|
|
602
626
|
"div",
|
|
603
627
|
{
|
|
@@ -27,6 +27,34 @@ import {
|
|
|
27
27
|
buildNotificationGroups,
|
|
28
28
|
formatActivityTime
|
|
29
29
|
} from "@expcat/tigercat-core";
|
|
30
|
+
|
|
31
|
+
// ../core/src/internal/notification-center-styles.ts
|
|
32
|
+
var notificationCenterItemClasses = "tiger-motion-aware group relative flex items-start gap-3.5 w-full p-3.5 rounded-[var(--tiger-radius-lg,0.75rem)] hover:bg-[var(--tiger-surface-muted,#f9fafb)] [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
33
|
+
var notificationCenterUnreadItemClasses = "bg-[var(--tiger-outline-bg-hover,#eff6ff)] border-l-[3px] border-l-[var(--tiger-primary,#2563eb)] -ml-[3px] pl-[calc(0.875rem-3px)]";
|
|
34
|
+
var notificationCenterReadItemClasses = "border-l-[3px] border-l-transparent -ml-[3px] pl-[calc(0.875rem-3px)]";
|
|
35
|
+
var notificationCenterReadTitleClasses = "text-[var(--tiger-text-secondary,#4b5563)]";
|
|
36
|
+
var notificationCenterUnreadTitleClasses = "text-[var(--tiger-text,#111827)]";
|
|
37
|
+
var notificationCenterUnreadDotClasses = "tiger-motion-aware w-1.5 h-1.5 rounded-full bg-[var(--tiger-primary,#2563eb)] shrink-0 shadow-sm animate-pulse";
|
|
38
|
+
var notificationCenterTimeClasses = "text-[11px] text-[var(--tiger-text-muted,#6b7280)] font-medium whitespace-nowrap flex-shrink-0 self-center";
|
|
39
|
+
var notificationCenterReadDescriptionClasses = "text-[var(--tiger-text-muted,#6b7280)]";
|
|
40
|
+
var notificationCenterUnreadDescriptionClasses = "text-[var(--tiger-text-secondary,#4b5563)]";
|
|
41
|
+
var notificationCenterItemActionClasses = "tiger-motion-aware opacity-0 group-hover:opacity-100 focus:opacity-100 rounded-full px-2.5 py-1 text-[11px] font-semibold bg-[var(--tiger-surface-muted,#f3f4f6)] hover:bg-[var(--tiger-fill-hover,#e5e7eb)] text-[var(--tiger-text-secondary,#374151)] border-0 flex-shrink-0 self-center [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
42
|
+
var notificationCenterEmptyIconWrapperClasses = "p-3.5 bg-[var(--tiger-surface-muted,#f9fafb)] rounded-full mb-3 shadow-inner";
|
|
43
|
+
var notificationCenterEmptyIconClasses = "tiger-motion-aware w-8 h-8 text-[var(--tiger-text-muted,#9ca3af)] animate-pulse";
|
|
44
|
+
var notificationCenterEmptyTextClasses = "font-semibold text-[var(--tiger-text-muted,#6b7280)]";
|
|
45
|
+
var notificationCenterLoadingClasses = "text-[var(--tiger-primary,#2563eb)] font-medium";
|
|
46
|
+
var notificationCenterCardClasses = "tiger-motion-aware w-full rounded-[var(--tiger-radius-xl,1rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] shadow-[var(--tiger-shadow-glass,0_8px_30px_rgb(0_0_0_/_0.04))] [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))] overflow-hidden";
|
|
47
|
+
var notificationCenterTitleClasses = "text-[var(--tiger-text,#111827)]";
|
|
48
|
+
var notificationCenterUnreadBadgeClasses = "tiger-motion-aware inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-[11px] font-bold rounded-full bg-[var(--tiger-primary,#2563eb)] text-white shadow-sm animate-pulse";
|
|
49
|
+
var notificationCenterMarkAllBaseClasses = "tiger-motion-aware text-xs font-semibold transition-colors";
|
|
50
|
+
var notificationCenterMarkAllEnabledClasses = "text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)]";
|
|
51
|
+
var notificationCenterMarkAllDisabledClasses = "text-[var(--tiger-text-muted,#9ca3af)]";
|
|
52
|
+
var notificationCenterFilterGroupClasses = "inline-flex items-center gap-0.5 p-0.5 rounded-[var(--tiger-radius-md,0.5rem)] bg-[var(--tiger-surface-muted,#f3f4f6)] self-start";
|
|
53
|
+
var notificationCenterFilterButtonClasses = "tiger-motion-aware px-3.5 py-1 text-xs font-semibold rounded-[var(--tiger-radius-sm,0.375rem)] [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
54
|
+
var notificationCenterFilterActiveClasses = "bg-[var(--tiger-surface,#ffffff)] text-[var(--tiger-text,#111827)] shadow-sm";
|
|
55
|
+
var notificationCenterFilterIdleClasses = "text-[var(--tiger-text-muted,#6b7280)] hover:text-[var(--tiger-text,#111827)]";
|
|
56
|
+
|
|
57
|
+
// src/components/NotificationCenter.ts
|
|
30
58
|
var getGroupKey = (group, index) => {
|
|
31
59
|
return group.key ?? group.title ?? index;
|
|
32
60
|
};
|
|
@@ -275,7 +303,7 @@ var NotificationCenter = defineComponent({
|
|
|
275
303
|
return h(
|
|
276
304
|
"div",
|
|
277
305
|
{
|
|
278
|
-
class:
|
|
306
|
+
class: notificationCenterFilterGroupClasses
|
|
279
307
|
},
|
|
280
308
|
options.map(
|
|
281
309
|
(option) => h(
|
|
@@ -283,8 +311,8 @@ var NotificationCenter = defineComponent({
|
|
|
283
311
|
{
|
|
284
312
|
key: option.key,
|
|
285
313
|
class: classNames(
|
|
286
|
-
|
|
287
|
-
currentReadFilter.value === option.key ?
|
|
314
|
+
notificationCenterFilterButtonClasses,
|
|
315
|
+
currentReadFilter.value === option.key ? notificationCenterFilterActiveClasses : notificationCenterFilterIdleClasses
|
|
288
316
|
),
|
|
289
317
|
onClick: () => handleReadFilterChange(option.key)
|
|
290
318
|
},
|
|
@@ -300,8 +328,8 @@ var NotificationCenter = defineComponent({
|
|
|
300
328
|
"div",
|
|
301
329
|
{
|
|
302
330
|
class: classNames(
|
|
303
|
-
|
|
304
|
-
|
|
331
|
+
notificationCenterItemClasses,
|
|
332
|
+
isRead ? notificationCenterReadItemClasses : notificationCenterUnreadItemClasses
|
|
305
333
|
)
|
|
306
334
|
},
|
|
307
335
|
[
|
|
@@ -314,18 +342,18 @@ var NotificationCenter = defineComponent({
|
|
|
314
342
|
tag: "span",
|
|
315
343
|
size: "sm",
|
|
316
344
|
weight: isRead ? "normal" : "semibold",
|
|
317
|
-
class: isRead ?
|
|
345
|
+
class: isRead ? notificationCenterReadTitleClasses : notificationCenterUnreadTitleClasses
|
|
318
346
|
},
|
|
319
347
|
{ default: () => item.title }
|
|
320
348
|
),
|
|
321
349
|
!isRead ? h("span", {
|
|
322
|
-
class:
|
|
350
|
+
class: notificationCenterUnreadDotClasses
|
|
323
351
|
}) : null
|
|
324
352
|
]),
|
|
325
353
|
timeText ? h(
|
|
326
354
|
"span",
|
|
327
355
|
{
|
|
328
|
-
class:
|
|
356
|
+
class: notificationCenterTimeClasses
|
|
329
357
|
},
|
|
330
358
|
timeText
|
|
331
359
|
) : null
|
|
@@ -335,7 +363,7 @@ var NotificationCenter = defineComponent({
|
|
|
335
363
|
{
|
|
336
364
|
class: classNames(
|
|
337
365
|
"mt-1 text-xs leading-relaxed line-clamp-2",
|
|
338
|
-
isRead ?
|
|
366
|
+
isRead ? notificationCenterReadDescriptionClasses : notificationCenterUnreadDescriptionClasses
|
|
339
367
|
)
|
|
340
368
|
},
|
|
341
369
|
item.description
|
|
@@ -346,7 +374,7 @@ var NotificationCenter = defineComponent({
|
|
|
346
374
|
{
|
|
347
375
|
size: "sm",
|
|
348
376
|
variant: "ghost",
|
|
349
|
-
class:
|
|
377
|
+
class: notificationCenterItemActionClasses,
|
|
350
378
|
onClick: (event) => {
|
|
351
379
|
event.stopPropagation();
|
|
352
380
|
handleItemReadChange(item, !isRead);
|
|
@@ -366,13 +394,13 @@ var NotificationCenter = defineComponent({
|
|
|
366
394
|
h(
|
|
367
395
|
"div",
|
|
368
396
|
{
|
|
369
|
-
class:
|
|
397
|
+
class: notificationCenterEmptyIconWrapperClasses
|
|
370
398
|
},
|
|
371
399
|
[
|
|
372
400
|
h(
|
|
373
401
|
"svg",
|
|
374
402
|
{
|
|
375
|
-
class:
|
|
403
|
+
class: notificationCenterEmptyIconClasses,
|
|
376
404
|
fill: "none",
|
|
377
405
|
viewBox: "0 0 24 24",
|
|
378
406
|
stroke: "currentColor",
|
|
@@ -394,7 +422,7 @@ var NotificationCenter = defineComponent({
|
|
|
394
422
|
tag: "div",
|
|
395
423
|
size: "sm",
|
|
396
424
|
color: "muted",
|
|
397
|
-
class:
|
|
425
|
+
class: notificationCenterEmptyTextClasses
|
|
398
426
|
},
|
|
399
427
|
{ default: () => props.emptyText }
|
|
400
428
|
)
|
|
@@ -454,14 +482,14 @@ var NotificationCenter = defineComponent({
|
|
|
454
482
|
tag: "div",
|
|
455
483
|
size: "base",
|
|
456
484
|
weight: "bold",
|
|
457
|
-
class:
|
|
485
|
+
class: notificationCenterTitleClasses
|
|
458
486
|
},
|
|
459
487
|
{ default: () => props.title }
|
|
460
488
|
),
|
|
461
489
|
totalUnread.value > 0 ? h(
|
|
462
490
|
"span",
|
|
463
491
|
{
|
|
464
|
-
class:
|
|
492
|
+
class: notificationCenterUnreadBadgeClasses
|
|
465
493
|
},
|
|
466
494
|
String(totalUnread.value)
|
|
467
495
|
) : null
|
|
@@ -473,8 +501,8 @@ var NotificationCenter = defineComponent({
|
|
|
473
501
|
variant: "ghost",
|
|
474
502
|
disabled: !hasUnread.value,
|
|
475
503
|
class: classNames(
|
|
476
|
-
|
|
477
|
-
hasUnread.value ?
|
|
504
|
+
notificationCenterMarkAllBaseClasses,
|
|
505
|
+
hasUnread.value ? notificationCenterMarkAllEnabledClasses : notificationCenterMarkAllDisabledClasses
|
|
478
506
|
),
|
|
479
507
|
onClick: handleMarkAllRead
|
|
480
508
|
},
|
|
@@ -486,7 +514,7 @@ var NotificationCenter = defineComponent({
|
|
|
486
514
|
const content = props.loading ? h("div", { class: "flex items-center justify-center py-16" }, [
|
|
487
515
|
h(Loading, {
|
|
488
516
|
text: props.loadingText,
|
|
489
|
-
class:
|
|
517
|
+
class: notificationCenterLoadingClasses
|
|
490
518
|
})
|
|
491
519
|
]) : resolvedGroups.value.length > 0 ? h("div", { class: "-mx-4 -mb-4" }, [renderTabs()]) : h("div", { class: "-mx-4 -mb-4 max-h-[380px] overflow-y-auto" }, [
|
|
492
520
|
renderList(filteredFlatItems.value)
|
|
@@ -507,7 +535,7 @@ var NotificationCenter = defineComponent({
|
|
|
507
535
|
Card,
|
|
508
536
|
{
|
|
509
537
|
variant: "bordered",
|
|
510
|
-
className:
|
|
538
|
+
className: notificationCenterCardClasses
|
|
511
539
|
},
|
|
512
540
|
{
|
|
513
541
|
header: () => header,
|
|
@@ -87,7 +87,12 @@ var Image = defineComponent({
|
|
|
87
87
|
floatingRef: hoverFloatingRef,
|
|
88
88
|
floatingStyles: hoverFloatingStyles,
|
|
89
89
|
triggerHandlers: hoverTriggerHandlers
|
|
90
|
-
} = useFloatingPopup({
|
|
90
|
+
} = useFloatingPopup({
|
|
91
|
+
props: floatingPopupProps,
|
|
92
|
+
// Hover visibility is internal; popup model events are not Image events.
|
|
93
|
+
emit: () => {
|
|
94
|
+
}
|
|
95
|
+
});
|
|
91
96
|
const setContainerRef = (el) => {
|
|
92
97
|
containerRef.value = el;
|
|
93
98
|
hoverTriggerRef.value = el;
|