@autono/open-pages 0.8.0 → 0.9.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 (44) hide show
  1. package/dist/{build-CCoxDxL-.js → build-Cpod-K9R.js} +9 -4
  2. package/dist/cli/bin.js +5 -5
  3. package/dist/{config-D_U_aCQz.js → config-CYLBzMMb.js} +1077 -18
  4. package/dist/{config-p-TWNXbv.d.ts → config-IkwICvOe.d.ts} +2 -1
  5. package/dist/{dev-CTrB263u.js → dev-B7x-G-wk.js} +1 -1
  6. package/dist/{export-enKL9R7x.js → export-BxMksWEc.js} +74 -12
  7. package/dist/index.d.ts +23 -3
  8. package/dist/locale/index.d.ts +1 -1
  9. package/dist/locale/index.js +96 -0
  10. package/dist/{preview-Dmzyd1cf.js → preview-CMv1lGOC.js} +1 -1
  11. package/dist/{types-DDdUFUIS.d.ts → types-B-9WXL93.d.ts} +24 -0
  12. package/dist/vite/index.d.ts +1 -1
  13. package/dist/vite/index.js +1 -1
  14. package/package.json +1 -1
  15. package/skills/apply-comments/SKILL.md +6 -4
  16. package/skills/create-email/SKILL.md +166 -0
  17. package/skills/create-theme/SKILL.md +31 -7
  18. package/skills/create-theme/references/email-theme-from-css.mjs +185 -0
  19. package/skills/create-theme/references/email-theme.md +48 -0
  20. package/skills/current-page/SKILL.md +3 -3
  21. package/src/app/app.tsx +4 -0
  22. package/src/app/components/command/home-command-menu.tsx +19 -2
  23. package/src/app/components/selection-note.tsx +71 -0
  24. package/src/app/components/sidebar/folder-item.tsx +9 -2
  25. package/src/app/components/sidebar/sidebar.tsx +10 -0
  26. package/src/app/frame/email-inspect.ts +17 -0
  27. package/src/app/lib/emails.ts +17 -0
  28. package/src/app/lib/frame.ts +15 -4
  29. package/src/app/lib/page-thumb.tsx +11 -3
  30. package/src/app/lib/sdk.ts +22 -0
  31. package/src/app/routes/email.tsx +424 -0
  32. package/src/app/routes/emails.tsx +94 -0
  33. package/src/app/routes/home-shell.tsx +21 -2
  34. package/src/app/routes/page.tsx +9 -50
  35. package/src/app/virtual.d.ts +10 -0
  36. package/src/locale/en.ts +25 -0
  37. package/src/locale/ja.ts +25 -0
  38. package/src/locale/types.ts +24 -0
  39. package/src/locale/zh-cn.ts +25 -0
  40. package/src/locale/zh-tw.ts +25 -0
  41. package/workspace/components.json +3 -1
  42. package/workspace/styles/globals.css +8 -2
  43. package/dist/open-pages-plugin-C8cFhMB9.js +0 -662
  44. package/dist/version-DZrXLoAD.js +0 -42
@@ -4,16 +4,15 @@ import {
4
4
  Crosshair,
5
5
  ExternalLink,
6
6
  Loader2,
7
- MessageSquarePlus,
8
7
  Monitor,
9
8
  RotateCw,
10
9
  Smartphone,
11
10
  Tablet,
12
- X,
13
11
  } from 'lucide-react';
14
12
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15
13
  import { useNavigate, useParams } from 'react-router-dom';
16
14
  import { toast } from 'sonner';
15
+ import { type Selection, SelectionNote } from '~/components/selection-note';
17
16
  import { Button, buttonVariants } from '~/components/ui/button';
18
17
  import { readLastHomeLocation } from '~/lib/last-home-location';
19
18
  import { cn } from '~/lib/utils';
@@ -44,8 +43,6 @@ function readViewportPref(): Viewport {
44
43
 
45
44
  const VIEWPORT_ICONS = { desktop: Monitor, tablet: Tablet, mobile: Smartphone } as const;
46
45
 
47
- type Selection = { loc: string; tag: string; text: string };
48
-
49
46
  export function PageView() {
50
47
  const { pageId = '' } = useParams();
51
48
  const known = pageIds.includes(pageId);
@@ -296,52 +293,14 @@ export function PageView() {
296
293
  )}
297
294
 
298
295
  {selection && (
299
- <div className="fixed bottom-6 right-6 z-20 w-[340px] rounded-lg border bg-background p-3 shadow-xl">
300
- <div className="flex items-center gap-2">
301
- <span className="rounded bg-muted px-1.5 py-0.5 font-mono text-[11px]">
302
- {selection.tag}
303
- </span>
304
- <span className="font-mono text-[11px] text-muted-foreground">
305
- line {selection.loc.replace(':', ', col ')}
306
- </span>
307
- <Button
308
- variant="ghost"
309
- size="icon"
310
- className="ml-auto size-6"
311
- aria-label="Clear selection"
312
- onClick={() => setSelection(null)}
313
- >
314
- <X className="size-3.5" />
315
- </Button>
316
- </div>
317
- {selection.text && (
318
- <p className="mt-1.5 line-clamp-2 text-xs text-muted-foreground">
319
- “{selection.text}”
320
- </p>
321
- )}
322
- <textarea
323
- value={note}
324
- onChange={(e) => setNote(e.target.value)}
325
- placeholder="Leave a note for your agent — e.g. “make this bold”"
326
- rows={2}
327
- className="mt-2 w-full resize-none rounded-md border bg-transparent px-2 py-1.5 text-sm outline-none focus:ring-1 focus:ring-ring"
328
- />
329
- <div className="mt-2 flex justify-end gap-2">
330
- <Button
331
- size="sm"
332
- onClick={submitComment}
333
- disabled={!note.trim() || savingNote}
334
- aria-label="Save comment"
335
- >
336
- {savingNote ? (
337
- <Loader2 className="size-3.5 animate-spin" />
338
- ) : (
339
- <MessageSquarePlus className="size-3.5" />
340
- )}
341
- Comment
342
- </Button>
343
- </div>
344
- </div>
296
+ <SelectionNote
297
+ selection={selection}
298
+ note={note}
299
+ saving={savingNote}
300
+ onNoteChange={setNote}
301
+ onSubmit={submitComment}
302
+ onClear={() => setSelection(null)}
303
+ />
345
304
  )}
346
305
  </main>
347
306
  </div>
@@ -7,6 +7,15 @@ declare module 'virtual:open-pages/pages' {
7
7
  export function loadPage(id: string): Promise<PageModule>;
8
8
  }
9
9
 
10
+ declare module 'virtual:open-pages/emails' {
11
+ export const emailIds: string[];
12
+ export const emailMeta: Record<
13
+ string,
14
+ { title: string; subject: string | null; description: string | null }
15
+ >;
16
+ export const emailCreatedAt: Record<string, number>;
17
+ }
18
+
10
19
  declare module 'virtual:open-pages/pages.css' {}
11
20
 
12
21
  declare module 'virtual:open-pages/config' {
@@ -15,6 +24,7 @@ declare module 'virtual:open-pages/config' {
15
24
  const config: {
16
25
  base?: string;
17
26
  pagesDir?: string;
27
+ emailsDir?: string;
18
28
  port?: number;
19
29
  locale?: Locale;
20
30
  version: string;
package/src/locale/en.ts CHANGED
@@ -23,6 +23,7 @@ export const en: Locale = {
23
23
  duplicate: 'Duplicate',
24
24
  themes: 'Themes',
25
25
  assets: 'Assets',
26
+ emails: 'Emails',
26
27
  folders: 'Folders',
27
28
  pages: 'Pages',
28
29
  menu: 'Menu',
@@ -193,6 +194,7 @@ export const en: Locale = {
193
194
  placeholder: 'Search pages or run a command…',
194
195
  empty: 'No results.',
195
196
  groupDocs: 'Pages',
197
+ groupEmails: 'Emails',
196
198
  groupFolders: 'Folders',
197
199
  groupNavigation: 'Go to',
198
200
  groupAppearance: 'Appearance',
@@ -211,6 +213,29 @@ export const en: Locale = {
211
213
  system: 'System',
212
214
  },
213
215
 
216
+ emails: {
217
+ title: 'Emails',
218
+ noEmailsTitle: 'No emails yet',
219
+ noEmailsHintPrefix: 'Run ',
220
+ noEmailsHintSuffix: ' in your agent to scaffold one under emails/.',
221
+ subjectLabel: 'Subject',
222
+ noSubject: 'No subject set',
223
+ openEmailAria: 'Open email {name}',
224
+ backToEmails: 'Back to emails',
225
+ viewHtml: 'HTML',
226
+ viewText: 'Text',
227
+ viewportDesktop: 'Desktop',
228
+ viewportMobile: 'Mobile',
229
+ copyHtml: 'Copy HTML',
230
+ copiedHtml: 'HTML copied',
231
+ copyHtmlFailed: 'Could not copy the HTML',
232
+ reload: 'Reload email',
233
+ openInTab: 'Open the rendered email by itself in a new tab',
234
+ notFound: 'Email not found: {id}',
235
+ unresolvedCount: '{count} classes did not compile',
236
+ unresolvedTitle:
237
+ 'Tailwind utilities the email compiler could not inline (check components/email/email-theme.ts):',
238
+ },
214
239
  themes: {
215
240
  title: 'Themes',
216
241
  noThemesTitle: 'No themes yet',
package/src/locale/ja.ts CHANGED
@@ -23,6 +23,7 @@ export const ja: Locale = {
23
23
  duplicate: '複製',
24
24
  themes: 'テーマ',
25
25
  assets: 'アセット',
26
+ emails: 'メール',
26
27
  folders: 'フォルダ',
27
28
  pages: 'スライド',
28
29
  menu: 'メニュー',
@@ -196,6 +197,7 @@ export const ja: Locale = {
196
197
  placeholder: 'スライドを検索、またはコマンドを実行…',
197
198
  empty: '結果がありません。',
198
199
  groupDocs: 'スライド',
200
+ groupEmails: 'メール',
199
201
  groupFolders: 'フォルダ',
200
202
  groupNavigation: '移動',
201
203
  groupAppearance: '外観',
@@ -214,6 +216,29 @@ export const ja: Locale = {
214
216
  system: 'システム',
215
217
  },
216
218
 
219
+ emails: {
220
+ title: 'メール',
221
+ noEmailsTitle: 'メールはまだありません',
222
+ noEmailsHintPrefix: 'エージェントで ',
223
+ noEmailsHintSuffix: ' を実行すると emails/ に作成されます。',
224
+ subjectLabel: '件名',
225
+ noSubject: '件名が未設定',
226
+ openEmailAria: 'メール {name} を開く',
227
+ backToEmails: 'メール一覧へ戻る',
228
+ viewHtml: 'HTML',
229
+ viewText: 'テキスト',
230
+ viewportDesktop: 'デスクトップ',
231
+ viewportMobile: 'モバイル',
232
+ copyHtml: 'HTML をコピー',
233
+ copiedHtml: 'HTML をコピーしました',
234
+ copyHtmlFailed: 'HTML をコピーできませんでした',
235
+ reload: 'メールを再読み込み',
236
+ openInTab: 'レンダリングされたメールを新しいタブで開く',
237
+ notFound: 'メールが見つかりません: {id}',
238
+ unresolvedCount: '{count} 個のクラスが変換されませんでした',
239
+ unresolvedTitle:
240
+ 'メールコンパイラがインライン化できなかった Tailwind ユーティリティ (components/email/email-theme.ts を確認):',
241
+ },
217
242
  themes: {
218
243
  title: 'テーマ',
219
244
  noThemesTitle: 'テーマがまだありません',
@@ -23,6 +23,7 @@ export type Locale = {
23
23
  duplicate: string;
24
24
  themes: string;
25
25
  assets: string;
26
+ emails: string;
26
27
  folders: string;
27
28
  pages: string;
28
29
  menu: string;
@@ -192,6 +193,7 @@ export type Locale = {
192
193
  placeholder: string;
193
194
  empty: string;
194
195
  groupDocs: string;
196
+ groupEmails: string;
195
197
  groupFolders: string;
196
198
  groupNavigation: string;
197
199
  groupAppearance: string;
@@ -210,6 +212,28 @@ export type Locale = {
210
212
  system: string;
211
213
  };
212
214
 
215
+ emails: {
216
+ title: string;
217
+ noEmailsTitle: string;
218
+ noEmailsHintPrefix: string;
219
+ noEmailsHintSuffix: string;
220
+ subjectLabel: string;
221
+ noSubject: string;
222
+ openEmailAria: string;
223
+ backToEmails: string;
224
+ viewHtml: string;
225
+ viewText: string;
226
+ viewportDesktop: string;
227
+ viewportMobile: string;
228
+ copyHtml: string;
229
+ copiedHtml: string;
230
+ copyHtmlFailed: string;
231
+ reload: string;
232
+ openInTab: string;
233
+ notFound: string;
234
+ unresolvedCount: string;
235
+ unresolvedTitle: string;
236
+ };
213
237
  themes: {
214
238
  title: string;
215
239
  noThemesTitle: string;
@@ -23,6 +23,7 @@ export const zhCN: Locale = {
23
23
  duplicate: '复制',
24
24
  themes: '主题',
25
25
  assets: '素材',
26
+ emails: '邮件',
26
27
  folders: '頁面夹',
27
28
  pages: '幻灯片',
28
29
  menu: '菜单',
@@ -193,6 +194,7 @@ export const zhCN: Locale = {
193
194
  placeholder: '搜索幻灯片或执行命令…',
194
195
  empty: '没有匹配的结果。',
195
196
  groupDocs: '幻灯片',
197
+ groupEmails: '邮件',
196
198
  groupFolders: '頁面夹',
197
199
  groupNavigation: '前往',
198
200
  groupAppearance: '外观',
@@ -211,6 +213,29 @@ export const zhCN: Locale = {
211
213
  system: '系统',
212
214
  },
213
215
 
216
+ emails: {
217
+ title: '邮件',
218
+ noEmailsTitle: '还没有邮件',
219
+ noEmailsHintPrefix: '在你的代理中运行 ',
220
+ noEmailsHintSuffix: ' 即可在 emails/ 下创建一封。',
221
+ subjectLabel: '主题',
222
+ noSubject: '未设置主题',
223
+ openEmailAria: '打开邮件 {name}',
224
+ backToEmails: '返回邮件列表',
225
+ viewHtml: 'HTML',
226
+ viewText: '纯文本',
227
+ viewportDesktop: '桌面',
228
+ viewportMobile: '移动端',
229
+ copyHtml: '复制 HTML',
230
+ copiedHtml: '已复制 HTML',
231
+ copyHtmlFailed: '无法复制 HTML',
232
+ reload: '重新加载邮件',
233
+ openInTab: '在新标签页中单独打开渲染后的邮件',
234
+ notFound: '找不到邮件: {id}',
235
+ unresolvedCount: '{count} 个类未能编译',
236
+ unresolvedTitle:
237
+ '邮件编译器无法内联的 Tailwind 工具类 (请检查 components/email/email-theme.ts):',
238
+ },
214
239
  themes: {
215
240
  title: '主题',
216
241
  noThemesTitle: '尚无主题',
@@ -23,6 +23,7 @@ export const zhTW: Locale = {
23
23
  duplicate: '複製',
24
24
  themes: '主題',
25
25
  assets: '素材',
26
+ emails: '郵件',
26
27
  folders: '資料夾',
27
28
  pages: '投影片',
28
29
  menu: '選單',
@@ -193,6 +194,7 @@ export const zhTW: Locale = {
193
194
  placeholder: '搜尋簡報或執行指令…',
194
195
  empty: '沒有符合的結果。',
195
196
  groupDocs: '簡報',
197
+ groupEmails: '郵件',
196
198
  groupFolders: '資料夾',
197
199
  groupNavigation: '前往',
198
200
  groupAppearance: '外觀',
@@ -211,6 +213,29 @@ export const zhTW: Locale = {
211
213
  system: '系統',
212
214
  },
213
215
 
216
+ emails: {
217
+ title: '郵件',
218
+ noEmailsTitle: '還沒有郵件',
219
+ noEmailsHintPrefix: '在你的代理中執行 ',
220
+ noEmailsHintSuffix: ' 即可在 emails/ 下建立一封。',
221
+ subjectLabel: '主旨',
222
+ noSubject: '未設定主旨',
223
+ openEmailAria: '開啟郵件 {name}',
224
+ backToEmails: '返回郵件列表',
225
+ viewHtml: 'HTML',
226
+ viewText: '純文字',
227
+ viewportDesktop: '桌面',
228
+ viewportMobile: '行動裝置',
229
+ copyHtml: '複製 HTML',
230
+ copiedHtml: '已複製 HTML',
231
+ copyHtmlFailed: '無法複製 HTML',
232
+ reload: '重新載入郵件',
233
+ openInTab: '在新分頁中單獨開啟渲染後的郵件',
234
+ notFound: '找不到郵件: {id}',
235
+ unresolvedCount: '{count} 個類別未能編譯',
236
+ unresolvedTitle:
237
+ '郵件編譯器無法內聯的 Tailwind 工具類別 (請檢查 components/email/email-theme.ts):',
238
+ },
214
239
  themes: {
215
240
  title: '主題',
216
241
  noThemesTitle: '尚無主題',
@@ -21,5 +21,7 @@
21
21
  },
22
22
  "menuColor": "default",
23
23
  "menuAccent": "subtle",
24
- "registries": {}
24
+ "registries": {
25
+ "@emailcn": "https://emailcn.run/r/{name}.json"
26
+ }
25
27
  }
@@ -10,9 +10,15 @@
10
10
 
11
11
  @custom-variant dark (&:is(.dark *));
12
12
 
13
- @theme inline {
14
- --font-heading: var(--font-sans);
13
+ /* Fonts are emitted as :root variables (not inlined) so a theme's own
14
+ :root block can swap them; inlined, Geist would be baked into every
15
+ font-* utility and themes could never change the typeface. */
16
+ @theme {
15
17
  --font-sans: 'Geist Variable', sans-serif;
18
+ --font-heading: var(--font-sans);
19
+ }
20
+
21
+ @theme inline {
16
22
  --color-sidebar-ring: var(--sidebar-ring);
17
23
  --color-sidebar-border: var(--sidebar-border);
18
24
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);