@lemonriver/core 0.1.0 → 0.2.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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{build-f-fM2ZY4.js → build-Df_xwIpg.js} +1 -1
  3. package/dist/cli/bin.js +4 -4
  4. package/dist/{config-DO45GU3e.js → config-BjWCLoMQ.js} +2343 -363
  5. package/dist/{config-B6JaKJM4.d.ts → config-rMGCkz6i.d.ts} +6 -2
  6. package/dist/{dev-CqS2xpgE.js → dev-Ctsx9IeO.js} +2 -2
  7. package/dist/index.d.ts +3 -3
  8. package/dist/index.js +4 -3
  9. package/dist/locale/index.d.ts +5 -2
  10. package/dist/locale/index.js +2 -2
  11. package/dist/{preview-BihgMlEl.js → preview-CJgcqsPk.js} +1 -1
  12. package/dist/{types-BjW4glip.d.ts → types-8VUyA2bu.d.ts} +133 -5
  13. package/dist/{update-C_R0ycVC.js → update-BKOA3Z6o.js} +153 -21
  14. package/dist/vite/index.d.ts +1 -1
  15. package/dist/vite/index.js +1 -1
  16. package/dist/{zh-tw-Ci0jK8eg.js → zh-tw-CeLrYwRE.js} +1178 -25
  17. package/package.json +21 -15
  18. package/skills/apply-comments/SKILL.md +10 -6
  19. package/skills/create-slide/SKILL.md +2 -0
  20. package/skills/current-slide/SKILL.md +1 -0
  21. package/skills/slide-authoring/SKILL.md +31 -1
  22. package/src/agent/prompt.ts +141 -0
  23. package/src/agent/provider.ts +123 -0
  24. package/src/agent/types.ts +151 -0
  25. package/src/app/app.tsx +2 -0
  26. package/src/app/assets/open-slide.svg +39 -0
  27. package/src/app/components/agent/agent-dock.tsx +35 -0
  28. package/src/app/components/agent/agent-markdown.tsx +45 -0
  29. package/src/app/components/agent/agent-panel.tsx +692 -0
  30. package/src/app/components/agent/agent-presence.tsx +74 -0
  31. package/src/app/components/agent/composer.tsx +120 -0
  32. package/src/app/components/agent/connect-view.tsx +184 -0
  33. package/src/app/components/agent/history-view.tsx +135 -0
  34. package/src/app/components/agent/provider-logo.tsx +34 -0
  35. package/src/app/components/agent/transcript.tsx +609 -0
  36. package/src/app/components/board/board-canvas.tsx +143 -12
  37. package/src/app/components/board/board.css +51 -0
  38. package/src/app/components/board/layout.test.ts +53 -1
  39. package/src/app/components/board/layout.ts +50 -2
  40. package/src/app/components/board/page-node.tsx +287 -13
  41. package/src/app/components/board/use-board-cards.ts +210 -0
  42. package/src/app/components/board/use-page-order.ts +17 -9
  43. package/src/app/components/command/slide-command-menu.tsx +10 -0
  44. package/src/app/components/icon-switcher-indicator.tsx +1 -1
  45. package/src/app/components/inspector/comment-layer.tsx +1011 -0
  46. package/src/app/components/inspector/image-crop-dialog.tsx +1 -5
  47. package/src/app/components/inspector/inspect-overlay.tsx +2 -39
  48. package/src/app/components/inspector/inspector-panel.tsx +10 -93
  49. package/src/app/components/inspector/inspector-provider.tsx +121 -47
  50. package/src/app/components/panel/editor-sidebar.tsx +85 -16
  51. package/src/app/components/panel/panel-shell.tsx +2 -2
  52. package/src/app/components/panel/resize-handle.tsx +129 -0
  53. package/src/app/components/player.tsx +0 -1
  54. package/src/app/components/preview-step-host.tsx +16 -0
  55. package/src/app/components/sidebar/sidebar.tsx +2 -2
  56. package/src/app/components/style-panel/style-panel.tsx +3 -2
  57. package/src/app/components/thumbnail-rail.tsx +76 -1
  58. package/src/app/favicon.ico +0 -0
  59. package/src/app/favicon.svg +39 -0
  60. package/src/app/index.html +2 -1
  61. package/src/app/lib/agent/use-agent.ts +543 -0
  62. package/src/app/lib/inspector/freeze-motion.ts +61 -0
  63. package/src/app/lib/inspector/use-comments.ts +32 -3
  64. package/src/app/lib/locale-store.ts +6 -1
  65. package/src/app/lib/print-ready.ts +9 -6
  66. package/src/app/lib/use-auto-grow.ts +15 -0
  67. package/src/app/lib/utils.ts +4 -0
  68. package/src/app/routes/board.tsx +48 -11
  69. package/src/app/routes/home.tsx +43 -7
  70. package/src/app/routes/presenter.tsx +1 -16
  71. package/src/app/routes/preview.tsx +169 -0
  72. package/src/app/routes/slide.tsx +221 -173
  73. package/src/app/styles.css +234 -80
  74. package/src/editing/placeholder-id.ts +1 -0
  75. package/src/locale/en.ts +127 -5
  76. package/src/locale/es.ts +692 -0
  77. package/src/locale/index.ts +1 -0
  78. package/src/locale/ja.ts +120 -6
  79. package/src/locale/types.ts +132 -5
  80. package/src/locale/zh-cn.ts +117 -5
  81. package/src/locale/zh-tw.ts +117 -5
  82. package/src/app/assets/open-slide.png +0 -0
  83. package/src/app/components/inspector/comment-widget.tsx +0 -119
Binary file
@@ -1,119 +0,0 @@
1
- import { MessageSquare, Trash2, X } from 'lucide-react';
2
- import { useEffect, useRef, useState } from 'react';
3
- import { usePanelMount } from '@/components/panel/panel-shell';
4
- import { format, plural, useLocale } from '@/lib/use-locale';
5
- import { cn } from '@/lib/utils';
6
- import { useInspector } from './inspector-provider';
7
-
8
- export function CommentWidget() {
9
- const t = useLocale();
10
- const { comments, remove, error } = useInspector();
11
- const [open, setOpen] = useState(false);
12
- const count = comments.length;
13
- const ref = useRef<HTMLDivElement>(null);
14
- const panelRef = useRef<HTMLDivElement>(null);
15
- const fabRef = useRef<HTMLButtonElement>(null);
16
- const { mounted, animVisible } = usePanelMount(open);
17
-
18
- useEffect(() => {
19
- if (!open) return;
20
- const onPointerDown = (e: PointerEvent) => {
21
- if (!ref.current?.contains(e.target as Node)) setOpen(false);
22
- };
23
- document.addEventListener('pointerdown', onPointerDown);
24
- return () => document.removeEventListener('pointerdown', onPointerDown);
25
- }, [open]);
26
-
27
- // The panel stays mounted through its close fade; hand focus back to the
28
- // toggle so it doesn't sit on a control that's about to unmount.
29
- useEffect(() => {
30
- if (open) return;
31
- if (panelRef.current?.contains(document.activeElement)) fabRef.current?.focus();
32
- }, [open]);
33
-
34
- return (
35
- <div
36
- ref={ref}
37
- data-inspector-ui
38
- className="absolute right-4 bottom-4 z-20 flex flex-col items-end gap-2"
39
- >
40
- {mounted && (
41
- <div
42
- ref={panelRef}
43
- aria-hidden={!animVisible}
44
- className={cn(
45
- 'w-80 origin-bottom-right rounded-[8px] border bg-card shadow-overlay',
46
- 'motion-safe:transition-[opacity,translate,scale] motion-safe:duration-200 motion-safe:ease-swift',
47
- animVisible
48
- ? 'translate-y-0 scale-100 opacity-100'
49
- : 'pointer-events-none translate-y-1.5 scale-95 opacity-0',
50
- )}
51
- >
52
- <div className="flex items-center justify-between border-b px-3 py-2">
53
- <span className="text-xs font-semibold">
54
- {format(plural(count, t.inspector.commentsCount), { count })}
55
- </span>
56
- <button
57
- type="button"
58
- aria-label={t.common.close}
59
- className="-m-1 rounded-[5px] p-1 text-muted-foreground transition-[color,scale] duration-150 hover:text-foreground active:scale-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
60
- onClick={() => setOpen(false)}
61
- >
62
- <X className="size-3.5" />
63
- </button>
64
- </div>
65
- {error && <p className="px-3 py-2 text-xs text-destructive">{error}</p>}
66
- {count === 0 ? (
67
- <p className="px-3 py-6 text-center text-xs text-muted-foreground">
68
- {t.inspector.commentsEmpty}
69
- </p>
70
- ) : (
71
- <>
72
- <ul className="max-h-72 overflow-auto">
73
- {comments.map((c) => (
74
- <li
75
- key={c.id}
76
- className="flex items-start gap-2 border-b px-3 py-2 last:border-0"
77
- >
78
- <div className="min-w-0 flex-1">
79
- <div className="text-[10px] font-mono text-muted-foreground">
80
- {format(t.inspector.commentLineLabel, { n: c.line })}
81
- </div>
82
- <div className="mt-0.5 text-xs break-words">{c.note}</div>
83
- </div>
84
- <button
85
- type="button"
86
- onClick={() => remove(c.id)}
87
- className="shrink-0 rounded-[5px] p-1 text-muted-foreground transition-[color,background-color,scale] duration-150 hover:bg-muted hover:text-destructive active:scale-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
88
- aria-label={t.inspector.commentDeleteAria}
89
- title={t.inspector.commentDeleteAria}
90
- >
91
- <Trash2 className="size-3.5" />
92
- </button>
93
- </li>
94
- ))}
95
- </ul>
96
- <div className="border-t px-3 py-2 text-[11px] text-muted-foreground">
97
- {t.inspector.commentsApplyHintPrefix}
98
- <code className="rounded bg-muted px-1 py-0.5 font-mono text-foreground">
99
- /apply-comments
100
- </code>
101
- {t.inspector.commentsApplyHintSuffix}
102
- </div>
103
- </>
104
- )}
105
- </div>
106
- )}
107
- <button
108
- ref={fabRef}
109
- type="button"
110
- onClick={() => setOpen((o) => !o)}
111
- className="flex items-center gap-2 rounded-full border bg-card px-3 py-2 text-xs font-medium shadow-floating transition-[background-color,scale] duration-150 hover:bg-muted active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
112
- aria-expanded={open}
113
- >
114
- <MessageSquare className="size-4" />
115
- <span className="nums">{count}</span>
116
- </button>
117
- </div>
118
- );
119
- }