@justanarthur/modo-ui-notch 0.3.0 → 0.4.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/blocks/activities/agenda/examples.mdx +8 -0
- package/blocks/activities/agenda/index.tsx +164 -16
- package/blocks/activities/clock/examples.mdx +16 -0
- package/blocks/activities/clock/index.tsx +357 -59
- package/blocks/activities/now-playing/examples.mdx +8 -0
- package/blocks/activities/now-playing/index.tsx +140 -54
- package/blocks/activities/weather/examples.mdx +9 -1
- package/blocks/activities/weather/index.tsx +241 -12
- package/blocks/app/expanded-island/index.tsx +3 -1
- package/blocks/app/settings-window/examples.mdx +8 -0
- package/blocks/app/settings-window/index.tsx +8 -3
- package/blocks/system/clipboard/examples.mdx +8 -0
- package/blocks/system/clipboard/index.tsx +262 -52
- package/blocks/system/recent-files/examples.mdx +14 -0
- package/blocks/system/recent-files/index.tsx +110 -25
- package/blocks/system/system-stats/examples.mdx +8 -0
- package/blocks/system/system-stats/index.tsx +211 -4
- package/components/island/widget/index.tsx +38 -4
- package/dist/blocks/activities/agenda/index.d.ts +2 -1
- package/dist/blocks/activities/agenda/index.js +2 -2
- package/dist/blocks/activities/clock/index.d.ts +2 -1
- package/dist/blocks/activities/clock/index.js +2 -2
- package/dist/blocks/activities/now-playing/index.d.ts +2 -1
- package/dist/blocks/activities/now-playing/index.js +2 -2
- package/dist/blocks/activities/weather/index.d.ts +2 -1
- package/dist/blocks/activities/weather/index.js +2 -2
- package/dist/blocks/app/expanded-island/index.d.ts +1 -1
- package/dist/blocks/app/expanded-island/index.js +1 -1
- package/dist/blocks/app/settings-window/index.d.ts +1 -1
- package/dist/blocks/app/settings-window/index.js +1 -1
- package/dist/blocks/system/clipboard/index.d.ts +2 -1
- package/dist/blocks/system/clipboard/index.js +2 -2
- package/dist/blocks/system/recent-files/index.d.ts +2 -1
- package/dist/blocks/system/recent-files/index.js +2 -2
- package/dist/blocks/system/system-stats/index.d.ts +2 -1
- package/dist/blocks/system/system-stats/index.js +2 -2
- package/dist/components/island/widget/index.d.ts +2 -2
- package/dist/components/island/widget/index.js +3 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +12 -10
- package/dist/shared/{chunk-2m5dz8nf.d.ts → chunk-0ym9mcqc.d.ts} +6 -2
- package/dist/shared/{chunk-7fvnrtz4.d.ts → chunk-1v35ck2y.d.ts} +12 -2
- package/dist/shared/{chunk-wkg17nxs.d.ts → chunk-2bqmmfg9.d.ts} +13 -2
- package/dist/shared/{chunk-mt0k6v8x.js → chunk-2nxwdn5s.js} +147 -39
- package/dist/shared/{chunk-pfhy5e4q.d.ts → chunk-6tnq6p89.d.ts} +2 -0
- package/dist/shared/{chunk-bvtyjcce.d.ts → chunk-72s4sqwh.d.ts} +16 -1
- package/dist/shared/{chunk-t0hcxh89.d.ts → chunk-9b8b7fw6.d.ts} +12 -0
- package/dist/shared/{chunk-xq5hc5gv.js → chunk-a059ccj0.js} +177 -66
- package/dist/shared/{chunk-qdzemt2v.js → chunk-cry81asr.js} +401 -89
- package/dist/shared/{chunk-da177e8r.d.ts → chunk-fr9jf804.d.ts} +16 -1
- package/dist/shared/{chunk-9c7ewvkk.js → chunk-kbk4bp6p.js} +162 -19
- package/dist/shared/{chunk-3thgcfcq.d.ts → chunk-kv0w8vhq.d.ts} +18 -1
- package/dist/shared/{chunk-416tsgbc.d.ts → chunk-nqjermbr.d.ts} +25 -3
- package/dist/shared/chunk-p3nezxvx.js +481 -0
- package/dist/shared/{chunk-2818esrq.d.ts → chunk-sen170mz.d.ts} +10 -1
- package/dist/shared/{chunk-9m0xbg5v.js → chunk-wayv5rhr.js} +1 -1
- package/dist/shared/{chunk-ym0xbses.js → chunk-ygnrrqta.js} +274 -18
- package/dist/shared/{chunk-j77cx8dp.js → chunk-yw478nmj.js} +325 -58
- package/dist/shared/{chunk-cc9nwbtf.js → chunk-z3tj1ydg.js} +3 -0
- package/dist/shared/{chunk-x7f3g82r.js → chunk-zxsw11dr.js} +14 -4
- package/dist/styles.css +61 -1
- package/mock/clipboard.tsx +34 -0
- package/mock/clock.tsx +3 -3
- package/mock/data.ts +48 -0
- package/mock/files.tsx +14 -1
- package/mock/island-content.tsx +47 -15
- package/mock/system.ts +3 -0
- package/mock/weather.tsx +42 -12
- package/package.json +2 -2
- package/dist/shared/chunk-s2jeqqan.js +0 -243
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-ndf79pv5.js";
|
|
6
6
|
import {
|
|
7
7
|
widget_default
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-zxsw11dr.js";
|
|
9
9
|
import {
|
|
10
10
|
MINUTE2,
|
|
11
11
|
useEdgeClock2
|
|
@@ -182,7 +182,34 @@ function fact(clip) {
|
|
|
182
182
|
return path(clip.content);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Actions({ clip, pinned, onPin, onCopy, onDelete }) {
|
|
186
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
187
|
+
className: "-mr-1 flex shrink-0 items-center gap-0.5",
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ jsx(widget_default.Action, {
|
|
190
|
+
icon: Pin,
|
|
191
|
+
label: pinned ? "Unpin" : "Pin",
|
|
192
|
+
pressed: pinned,
|
|
193
|
+
onClick: onPin
|
|
194
|
+
}),
|
|
195
|
+
onDelete && /* @__PURE__ */ jsx(widget_default.Action, {
|
|
196
|
+
icon: Trash2,
|
|
197
|
+
label: "Delete",
|
|
198
|
+
onClick: () => onDelete(clip)
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ jsx(Button, {
|
|
201
|
+
variant: "primary",
|
|
202
|
+
size: "compact",
|
|
203
|
+
leadingIcon: Copy,
|
|
204
|
+
className: "ml-1.5",
|
|
205
|
+
onClick: () => onCopy?.(clip),
|
|
206
|
+
children: "Copy"
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function Hero(props) {
|
|
212
|
+
const { clip } = props;
|
|
186
213
|
const line = fact(clip);
|
|
187
214
|
return /* @__PURE__ */ jsxs("div", {
|
|
188
215
|
className: "flex min-w-0 flex-col gap-2",
|
|
@@ -199,29 +226,8 @@ function Hero({ clip, pinned, onPin, onCopy, onDelete }) {
|
|
|
199
226
|
children: line
|
|
200
227
|
})
|
|
201
228
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
|
|
204
|
-
children: [
|
|
205
|
-
/* @__PURE__ */ jsx(widget_default.Action, {
|
|
206
|
-
icon: Pin,
|
|
207
|
-
label: pinned ? "Unpin" : "Pin",
|
|
208
|
-
pressed: pinned,
|
|
209
|
-
onClick: onPin
|
|
210
|
-
}),
|
|
211
|
-
onDelete && /* @__PURE__ */ jsx(widget_default.Action, {
|
|
212
|
-
icon: Trash2,
|
|
213
|
-
label: "Delete",
|
|
214
|
-
onClick: () => onDelete(clip)
|
|
215
|
-
}),
|
|
216
|
-
/* @__PURE__ */ jsx(Button, {
|
|
217
|
-
variant: "primary",
|
|
218
|
-
size: "compact",
|
|
219
|
-
leadingIcon: Copy,
|
|
220
|
-
className: "ml-1.5",
|
|
221
|
-
onClick: () => onCopy?.(clip),
|
|
222
|
-
children: "Copy"
|
|
223
|
-
})
|
|
224
|
-
]
|
|
229
|
+
/* @__PURE__ */ jsx(Actions, {
|
|
230
|
+
...props
|
|
225
231
|
})
|
|
226
232
|
]
|
|
227
233
|
})
|
|
@@ -310,6 +316,223 @@ function List({ order, selected, pinned, now, searching, onPick, onCopy }) {
|
|
|
310
316
|
}, group.label))
|
|
311
317
|
});
|
|
312
318
|
}
|
|
319
|
+
function Tile({ clip }) {
|
|
320
|
+
const level = useLift(1);
|
|
321
|
+
if (clip.kind === "color")
|
|
322
|
+
return /* @__PURE__ */ jsx("span", {
|
|
323
|
+
"aria-hidden": true,
|
|
324
|
+
className: "size-8 shrink-0 rounded-lg ring-1 ring-border ring-inset",
|
|
325
|
+
style: { backgroundColor: paint(clip) }
|
|
326
|
+
});
|
|
327
|
+
if (clip.kind === "image" && clip.preview != null)
|
|
328
|
+
return /* @__PURE__ */ jsx(Picture, {
|
|
329
|
+
preview: clip.preview,
|
|
330
|
+
className: "size-8 rounded-lg"
|
|
331
|
+
});
|
|
332
|
+
const Icon = KIND_ICON[clip.kind];
|
|
333
|
+
return /* @__PURE__ */ jsx("span", {
|
|
334
|
+
className: cn("flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground", SURFACE_BG[level]),
|
|
335
|
+
children: clip.kind === "link" && clip.preview != null ? /* @__PURE__ */ jsx(Picture, {
|
|
336
|
+
preview: clip.preview,
|
|
337
|
+
className: "size-4 rounded-sm"
|
|
338
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
339
|
+
size: 15,
|
|
340
|
+
strokeWidth: 1.5
|
|
341
|
+
})
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
function SheetList({ order, selected, pinned, now, searching, onPick, onCopy }) {
|
|
345
|
+
const level = useLift(1);
|
|
346
|
+
if (!order.length)
|
|
347
|
+
return /* @__PURE__ */ jsx("span", {
|
|
348
|
+
className: "flex h-12 items-center text-body text-muted-foreground",
|
|
349
|
+
children: "No clips match"
|
|
350
|
+
});
|
|
351
|
+
const groups = [
|
|
352
|
+
{ label: "Pinned", clips: order.filter((clip) => pinned.includes(clip.id)) },
|
|
353
|
+
{ label: searching ? "Matches" : "Recent", clips: order.filter((clip) => !pinned.includes(clip.id)) }
|
|
354
|
+
].filter((group) => group.clips.length);
|
|
355
|
+
return /* @__PURE__ */ jsx(FluidHover, {
|
|
356
|
+
className: "-mx-2 flex flex-col gap-0",
|
|
357
|
+
role: "listbox",
|
|
358
|
+
"aria-label": "Clipboard history",
|
|
359
|
+
children: groups.map((group) => /* @__PURE__ */ jsxs("div", {
|
|
360
|
+
role: "presentation",
|
|
361
|
+
className: "flex min-w-0 flex-col",
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ jsxs("div", {
|
|
364
|
+
className: "flex h-7 items-end justify-between px-2 pb-1 text-caption text-muted-foreground",
|
|
365
|
+
children: [
|
|
366
|
+
/* @__PURE__ */ jsx("span", {
|
|
367
|
+
children: group.label
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ jsx("span", {
|
|
370
|
+
className: "tabular-nums",
|
|
371
|
+
children: group.clips.length
|
|
372
|
+
})
|
|
373
|
+
]
|
|
374
|
+
}),
|
|
375
|
+
group.clips.map((clip) => {
|
|
376
|
+
const index = order.indexOf(clip);
|
|
377
|
+
const current = index === selected;
|
|
378
|
+
return /* @__PURE__ */ jsx(FluidHover.Item, {
|
|
379
|
+
index,
|
|
380
|
+
role: "option",
|
|
381
|
+
"aria-selected": current,
|
|
382
|
+
tabIndex: -1,
|
|
383
|
+
className: cn("h-12 px-2", current && SURFACE_BG[level]),
|
|
384
|
+
onClick: () => onPick(clip.id),
|
|
385
|
+
onDoubleClick: () => onCopy?.(clip),
|
|
386
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
387
|
+
className: "flex w-full min-w-0 items-center gap-3",
|
|
388
|
+
children: [
|
|
389
|
+
/* @__PURE__ */ jsx(Tile, {
|
|
390
|
+
clip
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ jsxs("span", {
|
|
393
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ jsx("span", {
|
|
396
|
+
className: "truncate text-body text-foreground",
|
|
397
|
+
children: clip.kind === "link" ? clip.detail ?? domain(clip.content) : clip.content
|
|
398
|
+
}),
|
|
399
|
+
/* @__PURE__ */ jsx("span", {
|
|
400
|
+
className: "truncate text-caption text-muted-foreground",
|
|
401
|
+
children: [
|
|
402
|
+
clip.kind === "link" ? domain(clip.content) : clip.app ?? KIND_LABEL[clip.kind],
|
|
403
|
+
short(now - clip.copiedAt)
|
|
404
|
+
].join(" · ")
|
|
405
|
+
})
|
|
406
|
+
]
|
|
407
|
+
}),
|
|
408
|
+
pinned.includes(clip.id) && /* @__PURE__ */ jsx(Pin, {
|
|
409
|
+
size: 12,
|
|
410
|
+
strokeWidth: 1.5,
|
|
411
|
+
"aria-label": "Pinned",
|
|
412
|
+
className: "shrink-0 text-muted-foreground"
|
|
413
|
+
})
|
|
414
|
+
]
|
|
415
|
+
})
|
|
416
|
+
}, clip.id);
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
}, group.label))
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
function Full({ clip }) {
|
|
423
|
+
const level = useLift(1);
|
|
424
|
+
if (clip.kind === "text")
|
|
425
|
+
return /* @__PURE__ */ jsx("p", {
|
|
426
|
+
className: "line-clamp-8 min-w-0 whitespace-pre-wrap text-title weight-medium break-words text-foreground",
|
|
427
|
+
children: clip.content
|
|
428
|
+
});
|
|
429
|
+
if (clip.kind === "link")
|
|
430
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
431
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
432
|
+
children: [
|
|
433
|
+
/* @__PURE__ */ jsx(widget_default.Title, {
|
|
434
|
+
leading: clip.preview != null && /* @__PURE__ */ jsx(Picture, {
|
|
435
|
+
preview: clip.preview,
|
|
436
|
+
className: "size-5 rounded-md"
|
|
437
|
+
}),
|
|
438
|
+
children: clip.detail ?? domain(clip.content)
|
|
439
|
+
}),
|
|
440
|
+
/* @__PURE__ */ jsx("span", {
|
|
441
|
+
className: "min-w-0 text-body break-all text-muted-foreground",
|
|
442
|
+
children: clip.content
|
|
443
|
+
})
|
|
444
|
+
]
|
|
445
|
+
});
|
|
446
|
+
const picture = clip.kind === "color" ? /* @__PURE__ */ jsx("span", {
|
|
447
|
+
"aria-hidden": true,
|
|
448
|
+
className: "block h-36 w-full rounded-2xl ring-1 ring-border ring-inset",
|
|
449
|
+
style: { backgroundColor: paint(clip) }
|
|
450
|
+
}) : clip.kind === "image" && clip.preview != null ? /* @__PURE__ */ jsx(Picture, {
|
|
451
|
+
preview: clip.preview,
|
|
452
|
+
className: "aspect-[16/10] w-full rounded-2xl"
|
|
453
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
454
|
+
className: cn("flex h-36 w-full items-center justify-center rounded-2xl text-muted-foreground", SURFACE_BG[level]),
|
|
455
|
+
children: clip.kind === "file" ? /* @__PURE__ */ jsx(File, {
|
|
456
|
+
size: 40,
|
|
457
|
+
strokeWidth: 1.25
|
|
458
|
+
}) : /* @__PURE__ */ jsx(Image, {
|
|
459
|
+
size: 40,
|
|
460
|
+
strokeWidth: 1.25
|
|
461
|
+
})
|
|
462
|
+
});
|
|
463
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
464
|
+
className: "flex min-w-0 flex-col gap-3",
|
|
465
|
+
children: [
|
|
466
|
+
picture,
|
|
467
|
+
/* @__PURE__ */ jsxs("div", {
|
|
468
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
469
|
+
children: [
|
|
470
|
+
/* @__PURE__ */ jsx(widget_default.Title, {
|
|
471
|
+
className: cn(clip.kind === "color" && "font-mono"),
|
|
472
|
+
children: clip.content
|
|
473
|
+
}),
|
|
474
|
+
clip.detail && /* @__PURE__ */ jsx(widget_default.Subtitle, {
|
|
475
|
+
children: clip.detail
|
|
476
|
+
})
|
|
477
|
+
]
|
|
478
|
+
})
|
|
479
|
+
]
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
function Facts({ clip }) {
|
|
483
|
+
const words = clip.content.trim().split(/\s+/).length;
|
|
484
|
+
return /* @__PURE__ */ jsxs(widget_default.Meta, {
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ jsx(widget_default.MetaItem, {
|
|
487
|
+
icon: KIND_ICON[clip.kind],
|
|
488
|
+
children: KIND_LABEL[clip.kind]
|
|
489
|
+
}),
|
|
490
|
+
clip.kind === "text" && /* @__PURE__ */ jsxs(widget_default.MetaItem, {
|
|
491
|
+
children: [
|
|
492
|
+
words,
|
|
493
|
+
" ",
|
|
494
|
+
words === 1 ? "word" : "words",
|
|
495
|
+
" · ",
|
|
496
|
+
clip.content.length,
|
|
497
|
+
" characters"
|
|
498
|
+
]
|
|
499
|
+
}),
|
|
500
|
+
clip.kind === "link" && /* @__PURE__ */ jsx(widget_default.MetaItem, {
|
|
501
|
+
children: domain(clip.content)
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ jsxs(widget_default.MetaItem, {
|
|
504
|
+
children: [
|
|
505
|
+
"Copied ",
|
|
506
|
+
new Date(clip.copiedAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
|
|
507
|
+
]
|
|
508
|
+
})
|
|
509
|
+
]
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
function Detail(props) {
|
|
513
|
+
const { clip, now } = props;
|
|
514
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
515
|
+
className: "sticky top-0 flex min-w-0 flex-col gap-3",
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ jsx(widget_default.Header, {
|
|
518
|
+
icon: KIND_ICON[clip.kind],
|
|
519
|
+
children: [clip.app ?? KIND_LABEL[clip.kind], ago(now - clip.copiedAt)].join(" · ")
|
|
520
|
+
}),
|
|
521
|
+
/* @__PURE__ */ jsx(Full, {
|
|
522
|
+
clip
|
|
523
|
+
}),
|
|
524
|
+
/* @__PURE__ */ jsx(Facts, {
|
|
525
|
+
clip
|
|
526
|
+
}),
|
|
527
|
+
/* @__PURE__ */ jsx("div", {
|
|
528
|
+
className: "flex justify-end pt-1",
|
|
529
|
+
children: /* @__PURE__ */ jsx(Actions, {
|
|
530
|
+
...props
|
|
531
|
+
})
|
|
532
|
+
})
|
|
533
|
+
]
|
|
534
|
+
});
|
|
535
|
+
}
|
|
313
536
|
function ClipboardHistoryLeading2() {
|
|
314
537
|
return /* @__PURE__ */ jsx(ClipboardList, {
|
|
315
538
|
size: 16,
|
|
@@ -377,6 +600,7 @@ var ClipboardHistory2 = Object.assign(function ClipboardHistory({
|
|
|
377
600
|
onCopy,
|
|
378
601
|
onDelete,
|
|
379
602
|
now: nowProp,
|
|
603
|
+
layout = "fit",
|
|
380
604
|
size,
|
|
381
605
|
className
|
|
382
606
|
}) {
|
|
@@ -386,10 +610,22 @@ var ClipboardHistory2 = Object.assign(function ClipboardHistory({
|
|
|
386
610
|
const [pinned, setPinned] = useControllableState(pinnedProp, defaultPinned, onPinnedChange);
|
|
387
611
|
const [query, setQuery] = useControllableState(queryProp, defaultQuery, onQueryChange);
|
|
388
612
|
const [paused, setPaused] = useControllableState(pausedProp, defaultPaused, onPausedChange);
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
613
|
+
const status = /* @__PURE__ */ jsxs(Fragment, {
|
|
614
|
+
children: [
|
|
615
|
+
paused ? /* @__PURE__ */ jsx(widget_default.Chip, {
|
|
616
|
+
children: "Paused"
|
|
617
|
+
}) : ignoredApp && /* @__PURE__ */ jsxs(widget_default.Chip, {
|
|
618
|
+
children: [
|
|
619
|
+
"Ignoring ",
|
|
620
|
+
ignoredApp
|
|
621
|
+
]
|
|
622
|
+
}),
|
|
623
|
+
/* @__PURE__ */ jsx(widget_default.Action, {
|
|
624
|
+
icon: paused ? Play : Pause,
|
|
625
|
+
label: paused ? "Resume history" : "Pause history",
|
|
626
|
+
onClick: () => setPaused(!paused)
|
|
627
|
+
})
|
|
628
|
+
]
|
|
393
629
|
});
|
|
394
630
|
if (!clips.length)
|
|
395
631
|
return /* @__PURE__ */ jsx(widget_default.Message, {
|
|
@@ -416,6 +652,7 @@ var ClipboardHistory2 = Object.assign(function ClipboardHistory({
|
|
|
416
652
|
const selected = found < 0 ? Math.max(0, order.indexOf(newest[0])) : found;
|
|
417
653
|
const hero = order[selected] ?? clips[0];
|
|
418
654
|
const heroPinned = pinned.includes(hero.id);
|
|
655
|
+
const togglePin = () => setPinned(heroPinned ? pinned.filter((id) => id !== hero.id) : [...pinned, hero.id]);
|
|
419
656
|
const onKeyDown = (event) => {
|
|
420
657
|
const step = event.key === "ArrowDown" ? 1 : event.key === "ArrowUp" ? -1 : 0;
|
|
421
658
|
if (step) {
|
|
@@ -430,6 +667,61 @@ var ClipboardHistory2 = Object.assign(function ClipboardHistory({
|
|
|
430
667
|
onCopy?.(order[selected]);
|
|
431
668
|
}
|
|
432
669
|
};
|
|
670
|
+
const search = /* @__PURE__ */ jsx(Input, {
|
|
671
|
+
size: "compact",
|
|
672
|
+
icon: Search,
|
|
673
|
+
placeholder: "Search clips",
|
|
674
|
+
"aria-label": "Search clips",
|
|
675
|
+
value: query,
|
|
676
|
+
onValueChange: setQuery
|
|
677
|
+
});
|
|
678
|
+
const listProps = { order, selected, pinned, now, searching: !!needle, onPick: setValue, onCopy };
|
|
679
|
+
if (layout === "tall")
|
|
680
|
+
return /* @__PURE__ */ jsx("div", {
|
|
681
|
+
className: cn("flex min-w-0 flex-col", className),
|
|
682
|
+
onKeyDown,
|
|
683
|
+
children: /* @__PURE__ */ jsxs(widget_default.Sheet, {
|
|
684
|
+
size,
|
|
685
|
+
className: "gap-4",
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ jsxs("div", {
|
|
688
|
+
className: "flex min-w-0 items-center gap-3",
|
|
689
|
+
children: [
|
|
690
|
+
/* @__PURE__ */ jsx("div", {
|
|
691
|
+
className: "min-w-0 flex-1",
|
|
692
|
+
children: search
|
|
693
|
+
}),
|
|
694
|
+
/* @__PURE__ */ jsx("span", {
|
|
695
|
+
className: "-mr-1 flex shrink-0 items-center gap-1.5",
|
|
696
|
+
children: status
|
|
697
|
+
})
|
|
698
|
+
]
|
|
699
|
+
}),
|
|
700
|
+
/* @__PURE__ */ jsxs("div", {
|
|
701
|
+
className: "flex min-w-0 items-stretch gap-5",
|
|
702
|
+
children: [
|
|
703
|
+
/* @__PURE__ */ jsx("div", {
|
|
704
|
+
className: "w-[46%] min-w-0 shrink-0",
|
|
705
|
+
children: /* @__PURE__ */ jsx(SheetList, {
|
|
706
|
+
...listProps
|
|
707
|
+
})
|
|
708
|
+
}),
|
|
709
|
+
/* @__PURE__ */ jsx("div", {
|
|
710
|
+
className: "min-w-0 flex-1 border-l border-border pl-5",
|
|
711
|
+
children: /* @__PURE__ */ jsx(Detail, {
|
|
712
|
+
clip: hero,
|
|
713
|
+
pinned: heroPinned,
|
|
714
|
+
onPin: togglePin,
|
|
715
|
+
onCopy,
|
|
716
|
+
onDelete,
|
|
717
|
+
now
|
|
718
|
+
})
|
|
719
|
+
})
|
|
720
|
+
]
|
|
721
|
+
})
|
|
722
|
+
]
|
|
723
|
+
})
|
|
724
|
+
});
|
|
433
725
|
return /* @__PURE__ */ jsx("div", {
|
|
434
726
|
className: cn("flex min-h-0 flex-col", className),
|
|
435
727
|
onKeyDown,
|
|
@@ -439,22 +731,9 @@ var ClipboardHistory2 = Object.assign(function ClipboardHistory({
|
|
|
439
731
|
aside: /* @__PURE__ */ jsxs("div", {
|
|
440
732
|
className: "flex min-w-0 flex-col gap-1",
|
|
441
733
|
children: [
|
|
442
|
-
|
|
443
|
-
size: "compact",
|
|
444
|
-
icon: Search,
|
|
445
|
-
placeholder: "Search clips",
|
|
446
|
-
"aria-label": "Search clips",
|
|
447
|
-
value: query,
|
|
448
|
-
onValueChange: setQuery
|
|
449
|
-
}),
|
|
734
|
+
search,
|
|
450
735
|
/* @__PURE__ */ jsx(List, {
|
|
451
|
-
|
|
452
|
-
selected,
|
|
453
|
-
pinned,
|
|
454
|
-
now,
|
|
455
|
-
searching: !!needle,
|
|
456
|
-
onPick: setValue,
|
|
457
|
-
onCopy
|
|
736
|
+
...listProps
|
|
458
737
|
})
|
|
459
738
|
]
|
|
460
739
|
}),
|
|
@@ -464,25 +743,13 @@ var ClipboardHistory2 = Object.assign(function ClipboardHistory({
|
|
|
464
743
|
children: [
|
|
465
744
|
/* @__PURE__ */ jsx(widget_default.Header, {
|
|
466
745
|
icon: KIND_ICON[hero.kind],
|
|
467
|
-
trailing:
|
|
468
|
-
children: [
|
|
469
|
-
paused ? /* @__PURE__ */ jsx(widget_default.Chip, {
|
|
470
|
-
children: "Paused"
|
|
471
|
-
}) : ignoredApp && /* @__PURE__ */ jsxs(widget_default.Chip, {
|
|
472
|
-
children: [
|
|
473
|
-
"Ignoring ",
|
|
474
|
-
ignoredApp
|
|
475
|
-
]
|
|
476
|
-
}),
|
|
477
|
-
resume
|
|
478
|
-
]
|
|
479
|
-
}),
|
|
746
|
+
trailing: status,
|
|
480
747
|
children: [hero.app ?? KIND_LABEL[hero.kind], ago(now - hero.copiedAt)].join(" · ")
|
|
481
748
|
}),
|
|
482
749
|
/* @__PURE__ */ jsx(Hero, {
|
|
483
750
|
clip: hero,
|
|
484
751
|
pinned: heroPinned,
|
|
485
|
-
onPin:
|
|
752
|
+
onPin: togglePin,
|
|
486
753
|
onCopy,
|
|
487
754
|
onDelete
|
|
488
755
|
})
|
|
@@ -219,6 +219,7 @@ function SettingsWindow2({
|
|
|
219
219
|
permissions = [],
|
|
220
220
|
onOpenPermission,
|
|
221
221
|
about = [],
|
|
222
|
+
flush = false,
|
|
222
223
|
className
|
|
223
224
|
}) {
|
|
224
225
|
const [page, setPage] = useControllableState(value, defaultValue, onValueChange);
|
|
@@ -241,6 +242,7 @@ function SettingsWindow2({
|
|
|
241
242
|
children: /* @__PURE__ */ jsxs(Sidebar.Content, {
|
|
242
243
|
children: [
|
|
243
244
|
/* @__PURE__ */ jsxs(Sidebar.Group, {
|
|
245
|
+
className: cn(flush && "pl-0"),
|
|
244
246
|
children: [
|
|
245
247
|
/* @__PURE__ */ jsx(Sidebar.GroupLabel, {
|
|
246
248
|
children: name
|
|
@@ -257,6 +259,7 @@ function SettingsWindow2({
|
|
|
257
259
|
]
|
|
258
260
|
}),
|
|
259
261
|
withSettings.length > 0 && /* @__PURE__ */ jsxs(Sidebar.Group, {
|
|
262
|
+
className: cn(flush && "pl-0"),
|
|
260
263
|
children: [
|
|
261
264
|
/* @__PURE__ */ jsx(Sidebar.GroupLabel, {
|
|
262
265
|
children: "Plugin settings"
|
|
@@ -89,7 +89,7 @@ function WidgetFigure2({ value, unit, prefix, color, className }) {
|
|
|
89
89
|
function WidgetMetaItem2({ icon: Icon, children }) {
|
|
90
90
|
const size = useSize();
|
|
91
91
|
return /* @__PURE__ */ jsxs("span", {
|
|
92
|
-
className: "flex min-w-0 items-center gap-1 last:shrink
|
|
92
|
+
className: "flex min-w-0 shrink-0 items-center gap-1 last:shrink",
|
|
93
93
|
children: [
|
|
94
94
|
Icon && /* @__PURE__ */ jsx(Icon, {
|
|
95
95
|
size: META_ICON[size.variant],
|
|
@@ -106,7 +106,7 @@ function WidgetMetaItem2({ icon: Icon, children }) {
|
|
|
106
106
|
function WidgetMeta2({ children, className }) {
|
|
107
107
|
const size = useSize();
|
|
108
108
|
return /* @__PURE__ */ jsx("div", {
|
|
109
|
-
className: cn("flex min-w-0 items-center gap-3 whitespace-nowrap text-muted-foreground tabular-nums", CAPTION[size.variant], className),
|
|
109
|
+
className: cn("flex min-w-0 items-center gap-3 overflow-hidden whitespace-nowrap text-muted-foreground tabular-nums", CAPTION[size.variant], className),
|
|
110
110
|
children
|
|
111
111
|
});
|
|
112
112
|
}
|
|
@@ -243,6 +243,15 @@ function WidgetChip2({ color, children }) {
|
|
|
243
243
|
]
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
+
function WidgetSheet2({ children, size, className }) {
|
|
247
|
+
return /* @__PURE__ */ jsx(SizeScope, {
|
|
248
|
+
size,
|
|
249
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
250
|
+
className: cn("flex w-full min-w-0 flex-col gap-6", className),
|
|
251
|
+
children
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
}
|
|
246
255
|
var Widget2 = Object.assign(function Widget({ media, aside, children, size, className }) {
|
|
247
256
|
const step = useSize(size);
|
|
248
257
|
return /* @__PURE__ */ jsx(SizeScope, {
|
|
@@ -279,7 +288,8 @@ var Widget2 = Object.assign(function Widget({ media, aside, children, size, clas
|
|
|
279
288
|
Message: WidgetMessage2,
|
|
280
289
|
Section: WidgetSection2,
|
|
281
290
|
Row: WidgetRow2,
|
|
282
|
-
Chip: WidgetChip2
|
|
291
|
+
Chip: WidgetChip2,
|
|
292
|
+
Sheet: WidgetSheet2
|
|
283
293
|
});
|
|
284
294
|
var widget_default = Widget2;
|
|
285
|
-
export { WidgetHeader2, WidgetTitle2, WidgetSubtitle2, WidgetFigure2, WidgetMetaItem2, WidgetMeta2, WidgetAction2, WidgetMessage2, WidgetSection2, WidgetRow2, WidgetChip2, Widget2, widget_default };
|
|
295
|
+
export { WidgetHeader2, WidgetTitle2, WidgetSubtitle2, WidgetFigure2, WidgetMetaItem2, WidgetMeta2, WidgetAction2, WidgetMessage2, WidgetSection2, WidgetRow2, WidgetChip2, WidgetSheet2, Widget2, widget_default };
|